
warp_layout();

hook.hook('window.onload','warp_layout()');
hook.hook('window.onresize','warp_layout()');

//--------------------------------------------------------------------------

	var warp_layout_is_called=0

	function warp_layout() {

		if(warp_layout_is_called)return 0;

		warp_layout_is_called = 1;

		if (document.getElementById) {
			
			
			var new_height = 0;
			
			var conteiner_outer = document.getElementById('conteiner_outer');
			var menu = document.getElementById('menu');
			var page = document.getElementById('page');
	
			if(menu)
			{
				menu.style.height = '';
				if(menu.offsetHeight>new_height) new_height = menu.offsetHeight
			}
			
			if(page)
			{
				page.style.height = '';
				if(page.offsetHeight>new_height) new_height = page.offsetHeight
			}
			
			if(conteiner_outer) conteiner_outer.style.height = (new_height)+'px';

			if(menu)
			{
				menu.style.height = (new_height)+'px';
			}
			
			if(page)
			{
				page.style.height = (new_height)+'px';
			}
			
		}
		
		warp_layout_is_called = 0;
		
	}
	
	function warp_load_gb_images(id, images)
	{
		var container = document.getElementById("warp_gbimc_"+id);
		container.innerHTML="";

		for(i=0;i<images.length;i++)
		{
	
			var img_c = document.createElement("div");
			img_c.style.width="120px"
			img_c.style.height="92px"
			img_c.style.styleFloat="left"
			img_c.style.cssFloat="left"
			img_c.style.margin="0px 0px 8px 16px"
			img_c.style.position="relative"
			
			
			
			var img_a = document.createElement("a");
			img_a.setAttribute("href", "image.php?file=upload/guestbook/"+id+"/"+images[i]);
			img_a.setAttribute("target", "_blank");
			img_a.setAttribute("style", "position:absolute;top:0px;left:0px;width:120px;height:92px;");
		
			//img_a.style.background="url(upload/guestbook/"+id+"/"+images[i]+")"
			
			img_a.innerHTML="<div style=\"width:120px;height:92px;cursor: pointer;\"> </div>"
			
			img_c.appendChild(img_a);
			container.appendChild(img_c);
		
			img_a.style.backgroundImage="url(upload/guestbook/"+id+"/tn/"+images[i]+")"
	
			img_c.style.background="url(upload/guestbook/"+id+"/tn/"+images[i]+")"
			
			if((i+1)%3==0)
			{
				//var img_br = document.createElement("br");
				//container.appendChild(img_br);
			}
			
		}
		
		container.innerHTML+="<div style=\"clear:both;\"></div>";
	
	
	}
