function resetLayout(mode) {
		//alert(document.body.offsetWidth);
		var IE = /*@cc_on!@*/false;
		
		/*myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			   //Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
			  
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
				  //IE 6+ in 'standards compliant mode'
		    myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
	
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
				  //IE 4 compatible
		    myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
			
		}*/
  		myWidth = document.body.offsetWidth;
		var change = false;
		  
		if(myWidth < 1000){
			  
		    myWidth = 1000;
			  
		}
		  		
		var render_configuration = null;
		var settings = "settings";
		
		// DEFAULT LAYOUT ELEMENTS 
		
		if (document.getElementById("frontline9")) {
			document.getElementById("frontline9").style.width = myWidth + "px";
		}
		
		if (document.getElementById("frontline10")) {
			document.getElementById("frontline10").style.width = myWidth + "px";
		}
		
		if (document.getElementById("subLinks")) {
			document.getElementById("subLinks").style.width = myWidth - 257 + "px";
		}
		
		
		// NEWS LAYOUT
		if (document.getElementById("newsSection")) {
			document.getElementById("newsSection").style.width = 300  + "px";
						
		}
		
		if (document.getElementById("articleSection")) {
			document.getElementById("articleSection").style.width = myWidth - (300 + 273)  + "px";
						
		}
		
		if (document.getElementById("articleSectionText")) {
			document.getElementById("articleSectionText").style.width = myWidth - (300 + 300)  + "px";
						
		}
		
		if (document.getElementById("newsArticleFlash")) {
			document.getElementById("newsArticleFlash").style.width = myWidth - (300 + 322)  + "px";
			document.getElementById("newsArticleFlash").style.height = (((myWidth - (300 + 300)) / 16) * 6)  + "px";
						
		}
		
		if (document.getElementById("articleBg")) {
			document.getElementById("articleBg").style.width = myWidth - (300 + 312)  + "px";
			
		}
		
		if (document.getElementById("newsList2")) {
			document.getElementById("newsList2").style.width = 230 + "px";
						
		}
		
		
		
		
		
		// FRONT LAYOUT
		if (document.getElementById("frontflash")) {
			flashWidth = myWidth;
			document.getElementById("frontflash").style.width = flashWidth + "px";
			document.getElementById("frontflash").style.height = ((flashWidth / 16) * 2)  + "px";
			
		}
		
		if (document.getElementById("map")) {
			document.getElementById("map").style.width = 500 + "px";
			document.getElementById("map").style.height = 400  + "px";
			
		}
		
		if (document.getElementById("welcomeText")) {
			document.getElementById("welcomeText").style.width = (myWidth - (500 + 270 + 6)) + "px";
						
		}
		
		if (document.getElementById("newsList")) {
			document.getElementById("newsList").style.width = (myWidth - (500 + 270 + 6) - 74) + "px";
						
		}
		
		if (document.getElementById("comercial")) {
			document.getElementById("comercial").style.width = 270 + "px";
						
		}
		
		
		
		// ABOUT LAYOUT 
		
		if (document.getElementById("aboutText")) {
			document.getElementById("aboutText").style.width = myWidth - (315 + 270)  + "px";
			
		}
		
		if (document.getElementById("aboutContactForm")) {
			document.getElementById("aboutContactForm").style.width = 260 + "px";
						
		}
		
		
		
		if (document.getElementById("aboutline")) {
			document.getElementById("aboutline").style.width = 200 + "px";
						
		}
		
		if (document.getElementById("aboutflash")) {
			
			document.getElementById("aboutflash").style.width = myWidth + "px";
			document.getElementById("aboutflash").style.height = ((myWidth / 16) * 2)  + "px";
			
		}
		
		
		// CALENDAR LAYOUT
		
		if (document.getElementById("calendar")) {
			document.getElementById("calendar").style.width = ((myWidth / 100) * 70) + "px";
		}
		
		
		for(i = 0; i < 7; i++){
		
			if (document.getElementById("cal_" + i)) {
			document.getElementById("cal_" + i).style.width = (((((myWidth / 100) * 70) / 100)) * 14) + "px";
			}
		
		}
		
		
		
		if (document.getElementById("calendarList")) {
			document.getElementById("calendarList").style.width = (((myWidth / 100) * 30) - 70) + "px";
		}
		
		
		
		// BOAT LAYOUT
		
		
		if (document.getElementById("topmenu")) {
			document.getElementById("topmenu").style.width = myWidth - 237 + "px";
		}
		
		if (document.getElementById("boatmainnavigation")) {
			document.getElementById("boatmainnavigation").style.width = 220 + "px";
		}
		
		if (document.getElementById("thin1")) {
			document.getElementById("thin1").style.width = myWidth + "px";
		}
		
		if (document.getElementById("thin2")) {
			document.getElementById("thin2").style.width = myWidth + "px";
		}
		
		if (document.getElementById("thin3")) {
			document.getElementById("thin3").style.width = myWidth - 220 + "px";
		}
		
		if (document.getElementById("thin4")) {
			document.getElementById("thin4").style.width = myWidth - 220 + "px";
		}
		if (document.getElementById("thin5")) {
			document.getElementById("thin5").style.width = myWidth - 220 + "px";
		}
		if (document.getElementById("thin6")) {
			document.getElementById("thin6").style.width = myWidth - 220 + "px";
		}
		
		if (document.getElementById("boatFlash")) {
			flashWidth = myWidth - 222;
			document.getElementById("boatFlash").style.width = flashWidth + "px";
			document.getElementById("boatFlash").style.height = ((flashWidth / 16) * 6)  + "px";
			
		}
		
		if (document.getElementById("masterboat")) {
			document.getElementById("masterboat").style.width = myWidth - 222 + "px";
		}
		
		if (document.getElementById("addLinks")) {
			document.getElementById("addLinks").style.width = 700 + "px";
		}
		
		if (document.getElementById("boatmaintext")) {
			document.getElementById("boatmaintext").style.width = (myWidth - 700) + "px";
		}
		
		///////////
		// FRONT LAYOUT
		if (document.getElementById("frontflash")) {
			flashWidth = myWidth;
			document.getElementById("frontflash").style.width = flashWidth + "px";
			document.getElementById("frontflash").style.height = ((flashWidth / 16) * 2)  + "px";
			
		}
		
		if (document.getElementById("map")) {
			document.getElementById("map").style.width = 500 + "px";
			document.getElementById("map").style.height = 400  + "px";
			
		}
		
		if (document.getElementById("welcomeText")) {
			document.getElementById("welcomeText").style.width = (myWidth - (500 + 270 + 6)) + "px";
						
		}
		
		if (document.getElementById("newsList")) {
			document.getElementById("newsList").style.width = (myWidth - (500 + 270 + 6) - 74) + "px";
						
		}
		
		if (document.getElementById("comercial")) {
			document.getElementById("comercial").style.width = 270 + "px";
						
		}
		
		
		
		// COMPANY LAYOUT
		if (document.getElementById("companyline1")) {
			document.getElementById("companyline1").style.width = myWidth + "px";
		}
		
		if (document.getElementById("companyline2")) {
			document.getElementById("companyline2").style.width = myWidth + "px";
		}
		
		if (document.getElementById("companymainnavigation")) {
			document.getElementById("companymainnavigation").style.width = 250 + "px";
		}
		
		if (document.getElementById("companycontentdiv")) {
			document.getElementById("companycontentdiv").style.width = myWidth - (250 + 241) + "px";
		}
		
		if (document.getElementById("departmentheading")) {
			document.getElementById("departmentheading").style.width = myWidth - (250 + 241) + "px";
		}
		
		if (document.getElementById("companycategories")) {
			document.getElementById("companycategories").style.width = myWidth + "px";
		}
		
		if (document.getElementById("companyimgflash")) {
			document.getElementById("companyimgflash").style.width = myWidth - (250 + 241)  + "px";
			document.getElementById("companyimgflash").style.height = (((myWidth - (250 + 247)) / 16) * 6)  + "px";
						
		}
		
		if (document.getElementById("brands")) {
			document.getElementById("brands").style.width = 194 + "px";
		}
		
		// SERVICE LAYOUT
		
		
		if (document.getElementById("servicenavigation")) {
			document.getElementById("servicenavigation").style.width = 259 + "px";
		}
		
		if (document.getElementById("servicecontent")) {
			document.getElementById("servicecontent").style.width = myWidth - (408 + 260) + "px";
		}
		
		if (document.getElementById("contactformservice")) {
			document.getElementById("contactformservice").style.width = 360 + "px";
		}
		
		if (document.getElementById("companycategories")) {
			document.getElementById("companycategories").style.width = myWidth + "px";
		}
		
		if (document.getElementById("service_form")) {
			document.getElementById("service_form").style.width = 330 + "px";
		}
		
		if (document.getElementById("serviceFlash")) {
			document.getElementById("serviceFlash").style.width = myWidth - (408 + 260)  + "px";
			document.getElementById("serviceFlash").style.height = (((myWidth - (408 + 260)) / 16) * 6)  + "px";
						
		}
		
		
		
		/*
	    if (document.getElementById("topBannerMenu")) {
			document.getElementById("topBannerMenu").style.width = (myWidth - (306 + 12)) + "px";
		}
		
		if (document.getElementById("lbOverlay")) {
			document.getElementById('lbOverlay').style.zIndex = 100;
		}
		if (document.getElementById("lbCenter")) {
			document.getElementById('lbCenter').style.zIndex = 101;
		} 
			  
		if (document.getElementById("info_text")) {
			document.getElementById("info_text").style.width = ((((myWidth - 55) / 100) * 70)) + "px";
		}
			  
		if (document.getElementById("contact_text")) {
			document.getElementById("contact_text").style.width = ((((myWidth - 55) / 100) * 30)) + "px";
		}
			  
		if (document.getElementById("newsSection")) {
			document.getElementById("newsSection").style.width = 260 + "px";
		}
		
		
			  
			   
		if (document.getElementById("customers")) {
			document.getElementById("customers").style.width = 258 + "px";
		}*/
		  	
		
		
		
			  
		if (document.getElementById("newsSection")) {
			  		
			var divh = document.getElementById('newsSection').offsetHeight; 
					
				if(divh < 300){
					
					var divh = 270;
					
				} else if(divh > 300){ 
			  		
					var divh = 270;
					
				} else {
					
					var divh = document.getElementById('newsSection').offsetHeight;  
					
				}
						
		} else {
				  
			var divh = 274;
					
		}
			  
		if (document.getElementById("flash_content_2")) {
			document.getElementById("flash_content_2").width = (myWidth - 52) + "px";
			document.getElementById("flash_content_2").height = 270 + "px";
		}
			  
		if (document.getElementById("project_info4")) {
			document.getElementById("project_info4").style.width = (myWidth - 44)  + "px";
		}
		

		if (document.getElementById("flash_content_0")) {
			document.getElementById("flash_content_0").width = ((myWidth - 288) - 24) + "px";
			document.getElementById("flash_content_0").height = (divh - 44) + "px";
		}	
		
		
		
		
	}
	
	
	function requestSize(){
				
			
				
		  	  var myWidth = 0, myHeight = 0;
			  if( typeof( window.innerWidth ) == 'number' ) {
			   //Non-IE
			  myWidth = window.innerWidth;
			  myHeight = window.innerHeight;
			  
			  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
				  //IE 6+ in 'standards compliant mode'
				  myWidth = document.documentElement.clientWidth;
				  myHeight = document.documentElement.clientHeight;
	
			  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
				  //IE 4 compatible
				  myWidth = document.body.clientWidth;
				  myHeight = document.body.clientHeight;
			  }
			  
			  if(myWidth < 1000){
			  
			  	myWidth = 1000;
			 	//return 1000;	
		  
			  }
			  
			  //$.post("set_session.php", { width: myWidth});
			
			
		
				
				
	}
	
	
	function boatFlash(src){
	
		
		
		image = "%2Fgraphic%2Fboatimg%2F" + src; 
		
		flash = "<object type='application/x-shockwave-flash' data='/swf/img.swf?href=" + image + "' width='10' height='10' id='boatFlash'>";
		flash += "<param name='movie' value='/swf/img.swf?href=" + image + "'>";
		flash += "<param name='wmode' value='tranparent'>\"";
		flash += "<param name='menu' value='false'>";
		flash += "<param name='quality' value='high'>";
		flash += "<param name='allowScriptAccess' value='always'>";
		flash += "No flash plugin<br/>";
		flash += "Please install <a href='http://www.macromedia.com/go/getflashplayer' target='_blank'>FLASH plugin</a>";
		flash += "</object>";
		document.getElementById("boatFlashTd").innerHTML = flash;
		
		//alert("/swf/img.swf?href=" + image);
		resetLayout()
	
	}
	
/*function openNewWindow(source){
		
		var fileLoc = ("http://www.stavangerwebdesign.no/movies/moviePlayer.php?source=" + source); 
		//testWindow = window.open ("http://www.lundegruppen.no/swf/moviePlayer.html", "Lunde_Gruppen_AS", "location=no,status=0,scrollbars=1,width=370,height=350,scrollbars=no,resizable=no");
		testWindow = window.open (fileLoc, "Inaflash", "location=no,status=0,scrollbars=1,width=360,height=263,scrollbars=no,resizable=no");
		
		
		
		testWindow.moveTo(0, 0);

	
}*/

