var sizeidx=0;
function resizeT(){
	var s;
	var th = 0;
	if(getWinSize){ s = getWinSize();}
	else {return;}
	if(top.standalone){
		builderheight = s.h;
		if(!top.widget) {
			builderheight +=32; 
			}
		builderwidth = s.w;
		saveIni();
		}
		var win;
	if(top.main){win = top.main;}
		else {win = window;}
	var doc = win.document;
	var lc = doc.getElementById("layerChoices");
	var sw = s.w;
	var sh = s.h - th;
	if(top.standalone)sw -= 8;
	if(top.widget){	sh -= 4;sw -= 4;}
	var hidel=false;
	var hidel2=false;
	var hidel3=false;
	var hidel4=false;
	if(sh < 420)hidel4=true;
	if(sh < 320)hidel3=true;
	if(sw < 450){hidel2 = true;}
	if(sw < 670){ sw += 364; hidel =true; }
	var tb = 102;
	var tabwidth = sw - 370;

    if(hidel3){ tb -= 20;}
	if(lc){
		lc.style.height = (sh - tb - 15) + "px";
		lc.style.width = (sw - 420)+"px";
		}
	lc = doc.getElementById("layerView");
	if(lc){
		lc.style.height = (sh - tb - 15) + "px";
		//lc.style.width = (sw - 416)+"px"; //tabwidth - 46;
		lc.style.width = tabwidth - 46+"px"; 
		}
	lc = doc.getElementById("locatorView");
	if(lc){
		lc.style.height = (sh - tb) + "px";
		//lc.style.width = (sw - 416)+"px";
		lc.style.width = tabwidth - 46+"px"; 
		}
	lc = doc.getElementById("backtab");
	if(lc){
		lc.style.height = (sh - tb + 20) + "px";
	//	lc.style.width = (sw - 382) + "px";
		lc.style.width = tabwidth - 12+"px"; 
		}

	lc = doc.getElementById("opZone");
	if(lc){
		lc.style.height = (sh - tb -8) + "px";
		lc.style.width = (sw - 402)+"px";
		}
	
	lc = doc.getElementById("helpZone");
	if(lc){
		var r = 324;
		if(!top.standalone || top.widget)r -= 10;
		lc.style.height = (sh - tb - 44) + "px";
		lc.style.width = (sw - r)+"px";
		}

	lc = doc.getElementById("helpArea");
	if(lc){
		var r = 448;
		if(!top.standalone)r -= 45;
		lc.style.height = (sh - tb - 24) + "px";
		lc.style.width = (sw - r)+"px";
		}
 
	lc = doc.getElementById("helpurls");
	if(lc){
		lc.style.height = (sh - tb) + "px";
		lc.style.width = (sw - 424)+"px";
		}

	lc = doc.getElementById("faveZone");
	if(lc){
		var r = 382;
		if(!top.standalone)r=398;
		lc.style.height = (sh - tb) + "px";
		lc.style.width = (sw - r)+"px";
		}

	lc = doc.getElementById("faveArea");
	if(lc){
		lc.style.height = (sh - tb) + "px";
		lc.style.width = (sw - 417)+"px";
		}

	lc = doc.getElementById("lfaves");
	if(lc){
		lc.style.height = (sh - tb-38) + "px";
		lc.style.width = (sw - 432)+"px";
		}
 
	lc = doc.getElementById("hosted");
	if(lc){
		lc.style.height = (sh - tb - 28) + "px";
		lc.style.width = (sw - 432)+"px";
		}

	lc = doc.getElementById("faveurls");
	if(lc){
		lc.style.height = (sh - tb - 28) + "px";
		lc.style.width = (sw - 424)+"px";
		}

	lc = doc.getElementById("ovZone");
	if(lc){
		lc.style.height = (sh - tb) + "px";
		lc.style.top = 200 + "px";
		lc.style.width = (sw - 402)+"px";
		}
	lc = doc.getElementById("locArea");
	if(lc){
		lc.style.left = (sw - 368)+"px";
		if(hidel) { lc.style.display="none"; }
 		else { lc.style.display=""; }
		}
	lc = doc.getElementById("ovArea");
	if(lc){
		lc.style.left = (sw - 368)+"px";
		if(hidel) { lc.style.display="none"; }
 		else { lc.style.display=""; }
		}
	lc = doc.getElementById("mzArea");
	if(lc){	 
		if(sh>182 && sw>432){
			lc.style.height = (sh - 182) + "px";
			lc.style.width = (sw - 432)+"px";
			}
		}
 	
	lc = doc.getElementById("manextents");
	if(lc  ){
		if (hidel || hidel4 || hidel2) lc.style.display ="none";
			else lc.style.display="";
		}
 
	lc = doc.getElementById("urllist");
	if(lc){
		n = parseInt((sh - 180)/13);
		lc.setAttribute("size",n-5);
		lc.style.width = sw - 408;
		}
	lc = doc.getElementById("crsdiv");
	if(lc){
		var adj = 50;
		if(hidel3)adj = 30;
	 	lc.style.top = (sh - adj + th) + "px";
		lc.style.width = (sw - 402)+"px";
		if(hidel){ lc.style.display="none"; }
			else {lc.style.display=""; }
		}

	lc = doc.getElementById("launchdiv");
	if(lc){
		var sdl = 365; 
		var sdt = tb - 88;
		if(!top.widget) sdt += 20;
		if(hidel){ 
			sdl = 705; 
			sdt = 15;
			if(!document.all){ 
				sdl -= 50; 
				if(top.widget)sdl += 20;
				}
			 }
		if(document.all){
			lc.style.top = (sh - 42 - sdt+th)+"px";
			lc.style.left = (sw - sdl)+"px";
			}
		else {
			lc.style.top = (sh - 68 - sdt+th)+"px";
			lc.style.left = (sw - sdl -20)+"px";
			}
		}
 
	lc = doc.getElementById("logo");
	if(lc){
		if(hidel2){lc.style.display="none";}
		else {lc.style.display="";}
		}
		 
    lc = doc.getElementById("productname");
	if(lc){
		if(hidel){lc.style.display="none";}
		else {if(top.widget)lc.style.display="";}
		}
	lc = doc.getElementById("Tools");
	if(lc)lc.style.left = (sw - 398)+"px";
	lc = doc.getElementById("choiceTools");
	if(lc)lc.style.left = (sw - 402)+"px";
	lc = doc.getElementById("locatortools");
	if(lc)lc.style.left = (sw - 398)+"px";
	lc = doc.getElementById("statusDiv");
	if(lc){
		if(hidel3) { lc.style.display="none"; }
			else { lc.style.display=""; }
		}

	lc=document.getElementById("locatorlink");
	if(lc){
		if(hidel) { lc.style.display="none"; }
		else {lc.style.display=""; }
		}
	lc = doc.getElementById("urlist");
	if(lc)lc.style.width = (sw - 406)+"px";
	lc = doc.getElementById("lasturl");
	var lw;
	if(lc){
		lw = sw - 75;
		if(top.widget)lw -= 70;
		if(!top.standalone)lw+=50;
		if(hidel){ lw -= 260;
			if(!top.widget)lw -= 100;
			 }
		if(hidel2){ lw += 90; }
		lc.style.width = (lw - 170)+"px";
		}
	if(!top.standalone){
 		lc = document.getElementById("localbrowser");
    		if(lc)lc.style.display="none";
		}
	lc = document.getElementById('addservers');
	if(lc)lc.style.left = parseInt(lw - 368)+"px";

	lc = document.getElementById("messageBox");
	if(lc)lc.style.left = (sw/2 - 200) + "px";
	}
window.onresize = resizeT;

