$(document).ready(function(){
													 
	$(window).resize(function(){
		var p=document.body.clientWidth;
		//alert(p);
		if (p<=1004)
		{
			
			if (document.all && window.external)
			{
				$("#wrap").css("width","1004px");
				$("#wrap").css("overflow-x","hidden");
				$("#waves").css("width","1316px");
				$("#waves").css("background","url(images/waves.png) center top no-repeat");
				$("#waves").css("margin-left",(p-1316)/2+"px");
				if(p=1004){$("#waves").css("margin-left",(p-1316)/2+4+"px");}
				
				$("#shadows").css("width","1084px");
				$("#shadows").css("background","url(images/shadow-sides.gif) center top no-repeat");
				$("#shadows").css("margin-left",(p-1084)/2+"px");
				
				$(document).pngFix();

			}
			else
			{
				//for ff
				$("#wrap").css("width","1004px");
				$("#waves").css("width","1004px");
				$("#waves").css("background","url(images/waves.png) -154px top no-repeat");
				
				$(document).pngFix();
			}
			
		}
		else
		{
			
			if (document.all && window.external)
			{
				$("#wrap").css("width","100%");
				$("#wrap").css("overflow-x","hidden");
				
				$("#waves").css("width","1316px");
				$("#waves").css("background","url(images/waves.png) center top no-repeat");
				$("#waves").css("margin-left",(p-1316)/2+"px");
				
				$("#shadows").css("width","1084px");
				$("#shadows").css("background","url(images/shadow-sides.gif) center top no-repeat");
				$("#shadows").css("margin-left",(p-1084)/2+"px");
				
				
				$(document).pngFix();
			}
			else
			{
				$("#wrap").css("width","100%");
				$("#waves").css("width","100%");
				$("#waves").css("background","url(images/waves.png) center top no-repeat");
			}
			
		}
			
			
			
//			if (document.all && window.external)
//			{
//				$("#wrap").css("width","100%");
//				
//				
//				$("#waves").css("margin-left",(p-1316)/2+"px");
//				$("#shadows").css("margin-left",(p-1084)/2+"px");//
//			}
//			else
//			{$("#waves").css("width","1316px");}
			
			
			//$("#shadows").css("background","url(images/shadow-sides.gif) center bottom no-repeat");
			
		
		//if ($("#wrap").width()<1004)
		//{$("#wrap").css("width","1004px");}
		//else
		//{$("#wrap").css("width","100%");}//
		
	}).trigger("resize");

	$(document).pngFix();

	$(".lmenu ul").superfish();
	
	var h;
	var l=$("#left").height();
	var r=$("#right").height();
	if (l>r)
	{$("#right").height(l);h=l;}
	else
	{$("#left").height(r);h=r}

	$("#left .m").height(h-20-17);
	$("#right .m").height(h-20);
	
	var hh=$(".banner").height();
	//20(t height) 10(margin) 20(postion) 80(ad area)
	$(".content").height(h-20-10-20-80-hh);
	
	//$('#shadows').css({top: $('#left').height()-28});
	
});

