//Disabling text select in IE & Safari
document.onselectstart=new Function('return false');
//Necessary Variables for the Script
var xMousePos = 0; // Horizontal position of the mouse on the screen
var yMousePos = 0; // Vertical position of the mouse on the screen
var xMousePosMax = 0; // Width of the page
var yMousePosMax = 0; // Height of the page

var oldResize="transparent url(images/sizer.jpg) no-repeat";
var oldClose="transparent url(images/close.jpg) no-repeat";
var invClose="transparent url(images/close_inv.jpg) no-repeat;";
var blank="transparent url(images/blank.jpg) no-repeat;";
var readyState=0;

////Arrays for the various objects
var iCons= new Array(iconCount);
var wIndows= new Array(iconCount);
var sHown=new Array(iconCount);
var scrolling=-1;


var outLine=0;
var go=-1;
var size=-1;
var iconBarHit=30;
var iconMaxWid=70;
var iconCurWid=70;
var current=0;
var ie=0;
var gScroll=-1;
var sOrient="";
var lX=0;
var uX=0;
var lY=0;
var uY=0;
var ieChk=2;

function getWinProp()
{
	prop=new Array(2);
	if (parseInt(navigator.appVersion)>3)
	{
		if (navigator.appName=="Netscape")
		{
			prop[0]= window.innerWidth;
			prop[1]= window.innerHeight;
		}

		if (navigator.appName=="Opera")
		{
			prop[0]= window.innerWidth;
			prop[1]= window.innerHeight;
		}

		if (navigator.appName.indexOf("Microsoft")!=-1)
		{
			prop[0]= document.body.offsetWidth;
			prop[1]= document.body.offsetHeight;
		}
	}
	return prop;
}


function showLoad(id)
{
	document.getElementById("content["+id+"]").innerHTML=loadText;
}

function newObject(id,width,height,color)
{
	iCons[id]=newIcon(id,width,height,color);
	wIndows[id]=newWindow(id,width,height,color);
}

function newIcon(id,color,title)
{
	this.id=id;
	this.color=color;
	this.title=title;
	document.getElementById('icons').innerHTML=document.getElementById('icons').innerHTML+
	"<div id='icon["+this.id+"]' class=icon "+
	"style='background:#" + this.color + ";' "+
	"onClick=\"iconClicked("+this.id+")\" "+
	"onMouseOver=\"temp=getStyleObject('icon["+this.id+"]');temp.background='#000000';temp.color='#FFFFFF';\" "+
	"onMouseOut=\"temp=getStyleObject('icon["+this.id+"]');temp.background='#" + this.color + "';temp.color='#000000';\" "+
	">"+this.title+"</div>";
}

function newWindow(id,width,height,color,top,left,content)
{
	this.id=id;
	this.width=width;
	this.height=height;
	this.color=color;
	this.top=top;
	this.left=left;
	this.content=content;
	this.bottom=document.getElementById('hideAds').innerHTML;
	document.getElementById('windows').innerHTML=document.getElementById('windows').innerHTML+
	"<div id='b1["+id+"]' class='d'></div>"+
	"<div id='b2["+id+"]' class='d'></div>"+
	"<div id='b3["+id+"]' class='d'></div>"+
	"<div id='b4["+id+"]' class='d'></div>"+
	"<div id='sb1["+id+"]' class='s'></div>"+
	"<div id='sb2["+id+"]' class='s'></div>"+
	"<div id='sb3["+id+"]' class='s'></div>"+
	"<div id='sb4["+id+"]' class='s'></div>"+
	"<div id='c1["+id+"]' class='s'></div>"+
	"<div id='c2["+id+"]' class='s'></div>"+
	"<div id='c3["+id+"]' class='s'></div>"+
	"<div id='c4["+id+"]' class='s'></div>"+
	"<div id='window["+this.id+"]' class='window' "+
	"style='' "+
	"onMouseDown='switchFocus("+this.id+")'>"+
	"<div id='titleBar["+this.id+"]' class='titleBar' style=';' onMouseDown='go="+this.id+";' onMouseUp='manClearMouse()'></div>"+
	"<div id='titleCover["+this.id+"]' class='titleCover' onMouseDown='go="+this.id+";' onMouseUp='manClearMouse()' onDblClick='fullScreen("+this.id+")'>&nbsp;</div>"+
	"<div id='closeButt["+this.id+"]' class='closeButt'"+
	" onClick=\"hideWindow("+this.id+");\""+
	" onMouseDown=\"var tmp=getStyleObject('closeButt["+id+"]');tmp.background='transparent url(newlogos/newclosed.jpg) no-repeat';tmp.backgroundPosition='top right';\""+
	" onMouseUp=\"var tmp=getStyleObject('closeButt["+id+"]');tmp.background='transparent url(newlogos/newclose_up.jpg) no-repeat';tmp.backgroundPosition='top right';\""+
	" onMouseOut=\"var tmp=getStyleObject('closeButt["+id+"]');tmp.background='transparent url(newlogos/newclose_up.jpg) no-repeat';tmp.backgroundPosition='top right';\""+
	"></div>"+
	"<div id='content["+this.id+"]' class='content'>"+this.content+"</div>"+
	"<div id='bottomBar["+this.id+"]' class='bottomBar' style=''></div>"+
	"<div id='resizeButt["+this.id+"]' class='resizeButt'"+
	" onMouseDown=\"var tmp=getStyleObject('resizeButt["+id+"]');tmp.background='transparent url(newlogos/newsized.jpg) no-repeat';tmp.backgroundPosition='bottom right';size="+this.id+";\""+
	" onMouseDrag='size="+this.id+"'"+
	" onMouseUp=\"var tmp=getStyleObject('resizeButt["+id+"]');tmp.background='transparent url(newlogos/newsize_up.jpg) no-repeat';tmp.backgroundPosition='bottom right';manClearMouse();\""+
	" onMouseOut=\"var tmp=getStyleObject('resizeButt["+id+"]');tmp.background='transparent url(newlogos/newsize_up.jpg) no-repeat';tmp.backgroundPosition='bottom right';\""+
	">&nbsp;</div>"+
	"<div id='superScrollD["+this.id+"]' class='scrollD' "+
	" onMouseDown=\"if (wIndows["+id+"].vOn==1){var tmp=getStyleObject('superScrollD["+this.id+"]');tmp.background='transparent url(images/down.jpg) no-repeat';scrolling="+id+";scrollDown();}\""+
	" onMouseOut=\"if (wIndows["+id+"].vOn==1){var tmp=getStyleObject('superScrollD["+this.id+"]');tmp.background='transparent url(images/down_up.jpg) no-repeat';}scrolling=-1;\" "+
	" onMouseUp=\"if (wIndows["+id+"].vOn==1){var tmp=getStyleObject('superScrollD["+this.id+"]');tmp.background='transparent url(images/down_up.jpg) no-repeat';}scrolling=-1;\"></div>"+
	"<div class='scrollU' id='superScrollU["+this.id+"]' style=''"+
	" onMouseDown=\"if (wIndows["+id+"].vOn==1){var tmp=getStyleObject('superScrollU["+this.id+"]');tmp.background='transparent url(images/up.jpg) no-repeat';scrolling="+id+";scrollUp();}\""+
	" onMouseOut=\"if (wIndows["+id+"].vOn==1){var tmp=getStyleObject('superScrollU["+this.id+"]');tmp.background='transparent url(images/up_up.jpg) no-repeat';}scrolling=-1;\""+
	" onMouseUp=\"if (wIndows["+id+"].vOn==1){var tmp=getStyleObject('superScrollU["+this.id+"]');tmp.background='transparent url(images/up_up.jpg) no-repeat';}scrolling=-1;\"></div>"+
	"<div id='scrollBarV["+id+"]' class='scrollBar'>"+
	"<div id='scrollCircleV["+id+"]' class='scrollCircle' "+
	"onMouseDown=\"gScroll="+id+";sOrient='v';\""+
	"></div>"+
	"</div>"+
	"<div id='superScrollL["+this.id+"]' class='scrollL'"+
	" onMouseDown=\"if (wIndows["+id+"].hOn==1){var tmp=getStyleObject('superScrollL["+this.id+"]');tmp.background='transparent url(images/left.jpg) no-repeat';scrolling="+id+";scrolling="+id+";scrollLeftFn();}\""+
	" onMouseOut=\"if (wIndows["+id+"].hOn==1){var tmp=getStyleObject('superScrollL["+this.id+"]');tmp.background='transparent url(images/left_up.jpg) no-repeat';}scrolling=-1;\""+
	" onMouseUp=\"if (wIndows["+id+"].hOn==1){var tmp=getStyleObject('superScrollL["+this.id+"]');tmp.background='transparent url(images/left_up.jpg) no-repeat';}scrolling=-1;\"></div>"+
	"<div class='scrollR' id='superScrollR["+this.id+"]' style=''"+
	" onMouseDown=\"if (wIndows["+id+"].hOn==1){var tmp=getStyleObject('superScrollR["+this.id+"]');tmp.background='transparent url(images/right.jpg) no-repeat';scrolling="+id+";scrollRight();}\""+
	" onMouseOut=\"if (wIndows["+id+"].hOn==1){var tmp=getStyleObject('superScrollR["+this.id+"]');tmp.background='transparent url(images/right_up.jpg) no-repeat';}scrolling=-1;\""+
	" onMouseUp=\"if (wIndows["+id+"].hOn==1){var tmp=getStyleObject('superScrollR["+this.id+"]');tmp.background='transparent url(images/right_up.jpg) no-repeat';}scrolling=-1;\"></div>"+
	"<div id='scrollBarH["+id+"]' class='scrollBar'>"+
	"<div id='scrollCircleH["+id+"]' class='scrollCircle' "+
	"onMouseDown=\"gScroll="+id+";sOrient='h';\""+
	"></div>"+
	"</div>"+
	//End Div Below:
	"</div>"+
	"<div id='tc1["+id+"]' class='d'></div>"+
	"<div id='tc2["+id+"]' class='d'></div>";
 }
 
function resetScroll(id)
{
	var circle=getStyleObject('scrollCircleV['+id+']');
	circle.top="0px";
	var circle=getStyleObject('scrollCircleH['+id+']');
	circle.left="0px";

}

function scrollDraw(curr,total,id,orient)
{
	if (curr>0)
	{
		var pct=curr/total;
	}
	else
	{
		pct=0;
	}
	if (ie!=ieChk)
	{
		if (orient=="v")
		{
			var tmpCircle=getStyleObject('scrollCircleV['+id+']');
			var tmpBar=getStyleObject('scrollBarV['+id+']');
			var barHit=parseInt(tmpBar.height);
			var circTop=parseInt(pct*(barHit-17));
			//document.getElementById('copyright').innerHTML=circTop;
			tmpCircle.top=parseInt(circTop)+"px";
		}
		else if (orient=="h")
		{
			var tmpCircle=getStyleObject('scrollCircleH['+id+']');
			var tmpBar=getStyleObject('scrollBarH['+id+']');
			var barWid=parseInt(tmpBar.width);
			var circLeft=parseInt(pct*(barWid-17));
			tmpCircle.left=parseInt(circLeft)+"px";
		}
	}
}


function scrollDown()
{
	if (scrolling>-1)
	{
		var tmpCon=document.getElementById('content['+scrolling+']');
		tmpCon.scrollTop=tmpCon.scrollTop+15;
		var sH=wIndows[scrolling].maxY;
		var scrPct=tmpCon.scrollTop/(sH);
		
		//document.getElementById('copyright').innerHTML=scrPct;
		var tmpBar=getStyleObject('scrollBarV['+scrolling+']');
		var barHit=parseInt(tmpBar.height);
		
		
		if (ie!=ieChk)
		{
			var circTop=parseInt((barHit-17)*scrPct);
			var tmpCircle=getStyleObject('scrollCircleV['+scrolling+']');
			tmpCircle.top=(circTop)+"px";
		}
		
		
		setTimeout("scrollDown()",100);
	}
}

function scrollUp()
{
	if (scrolling>-1)
	{
		var tmpCon=document.getElementById('content['+scrolling+']');
		tmpCon.scrollTop=tmpCon.scrollTop-15;
		
		var sH=wIndows[scrolling].maxY;
		var scrPct=tmpCon.scrollTop/(sH);
		
		//document.getElementById('copyright').innerHTML=scrPct;
		var tmpBar=getStyleObject('scrollBarV['+scrolling+']');
		var barHit=parseInt(tmpBar.height);
		
		if (ie!=ieChk)
		{
			var circTop=parseInt((barHit-17)*scrPct);
			var tmpCircle=getStyleObject('scrollCircleV['+scrolling+']');
			tmpCircle.top=(circTop)+"px";
		}

		setTimeout("scrollUp()",100);
	}
}

function scrollLeftFn()
{
	if (scrolling>-1)
	{
		var tmpCon=document.getElementById('content['+scrolling+']');
		tmpCon.scrollLeft=tmpCon.scrollLeft-15;
		
		var sW=wIndows[scrolling].maxX;
		var scrPct=tmpCon.scrollLeft/(sW);

		var tmpBar=getStyleObject('scrollBarH['+scrolling+']');
		var barWid=parseInt(tmpBar.width);
		
		if (ie!=ieChk)
		{
			var circTop=parseInt((barWid-17)*scrPct);
			var tmpCircle=getStyleObject('scrollCircleH['+scrolling+']');
			tmpCircle.left=(circTop)+"px";
		}

		
		setTimeout("scrollLeftFn()",100);
	}
}


function scrollRight()
{
	if (scrolling>-1)
	{
		var tmpCon=document.getElementById('content['+scrolling+']');
		tmpCon.scrollLeft=tmpCon.scrollLeft+15;

		var sW=wIndows[scrolling].maxX;
		var scrPct=tmpCon.scrollLeft/(sW);

		var tmpBar=getStyleObject('scrollBarH['+scrolling+']');
		var barWid=parseInt(tmpBar.width);
		
		if (ie!=ieChk)
		{
			var circTop=parseInt((barWid-17)*scrPct);
			var tmpCircle=getStyleObject('scrollCircleH['+scrolling+']');
			tmpCircle.left=(circTop)+"px";
		}
 
		setTimeout("scrollRight()",100);
	}
}

function showWindow(id,dub)
{
	if (fUll[id]==1)
	{
		var tmp=getStyleObject("windows");
		var width=parseInt(tmp.width);
		var height=parseInt(tmp.height);
		var top=0;
		var left=0;
	}
	else
	{
		var width=wIndows[id].width
		var height=wIndows[id].height
		var top=wIndows[id].top;
		var left=wIndows[id].left;
	}


	var b1=getStyleObject("b1["+id+"]");
	b1.top=top+'px';
	b1.left=(left-1)+'px';
	b1.width="1px";
	b1.height=(height)+'px';
	b1.zIndex=iconCount;
	
	var b2=getStyleObject("b2["+id+"]");
	b2.top=(top-1)+'px';
	b2.left=left+'px';
	b2.width=(width)+"px";
	b2.height='1px';
	b2.zIndex=iconCount;
	
	var b3=getStyleObject("b3["+id+"]");
	b3.top=top+'px';
	b3.left=(width+left)+'px';
	b3.width="1px";
	b3.height=(height)+'px';
	b3.zIndex=iconCount;
	
	var b4=getStyleObject("b4["+id+"]");
	b4.top=(height+top)+'px';
	b4.left=left+'px';
	b4.width=(width)+"px";
	b4.height='1px';
	b4.zIndex=iconCount;
	
	var sb1=getStyleObject("sb1["+id+"]");
	sb1.top=(top+1)+'px';
	sb1.left=(left-2)+'px';
	sb1.width="1px";
	sb1.height=(height-2)+'px';
	sb1.zIndex=iconCount;

	var sb2=getStyleObject("sb2["+id+"]");
	sb2.top=(top-2)+'px';
	sb2.left=(left+1)+'px';
	sb2.width=(width-2)+"px";
	sb2.height='1px';
	sb2.zIndex=iconCount;
	
	var sb3=getStyleObject("sb3["+id+"]");
	sb3.top=(top+1)+'px';
	sb3.left=(width+left+1)+'px';
	sb3.width="1px";
	sb3.height=(height-2)+'px';
	sb3.zIndex=iconCount;

	var sb4=getStyleObject("sb4["+id+"]");
	sb4.top=(height+top+1)+'px';
	sb4.left=(left+1)+'px';
	sb4.width=(width-2)+"px";
	sb4.height='1px';
	sb4.zIndex=iconCount;

	var c1=getStyleObject("c1["+id+"]");
	c1.top=(top-1)+'px';
	c1.left=(left-1)+'px';
	c1.width="1px";
	c1.height='1px';
	c1.zIndex=iconCount;
	
	var c2=getStyleObject("c2["+id+"]");
	c2.top=(top-1)+'px';
	c2.left=(left+width)+'px';
	c2.width="1px";
	c2.height='1px';
	c2.zIndex=iconCount;

	var c3=getStyleObject("c3["+id+"]");
	c3.top=(top+height)+'px';
	c3.left=(width+left)+'px';
	c3.width="1px";
	c3.height='1px';
	c3.zIndex=iconCount;

	var c4=getStyleObject("c4["+id+"]");
	c4.top=(height+top)+'px';
	c4.left=(left-1)+'px';
	c4.width="1px";
	c4.height='1px';
	c4.zIndex=iconCount;

	var Window=getStyleObject("window["+id+"]");
	Window.top=top+'px';
	Window.left=left+'px';
	Window.width=width+"px";
	Window.height=height+'px';
	Window.display="block";
	Window.zIndex=iconCount;
	
	var Top=getStyleObject("titleBar["+id+"]");
	Top.width=(width-8)+"px";
	Top.height="16px";
	Top.left="2px";
	Top.top="2px";

	var CloseButt=getStyleObject("closeButt["+id+"]");
	CloseButt.width="14px";
	CloseButt.height="14px";
	CloseButt.left=(width-18)+"px";
	CloseButt.top="2px";

	var Cover=getStyleObject("titleCover["+id+"]");
	Cover.width=(width-4)+"px";
	Cover.height="20px";
	Cover.left="2px";
	Cover.top="2px";

	var Content=getStyleObject("content["+id+"]");
	Content.width=(width-20)+"px";
	Content.height=(height-54)+"px";
	Content.left="2px";
	Content.top="18px";

	var SizeButt=getStyleObject("resizeButt["+id+"]");
	SizeButt.width="14px";
	SizeButt.height="14px";
	if (ie==ieChk)
	{
		SizeButt.top=(height-20)+"px";
	}
	else
	{
		SizeButt.top=(height-18)+"px";
	}
	SizeButt.left=(width-18)+"px";
	
	var tc1=getStyleObject("tc1["+id+"]");
	tc1.top=(top)+'px';
	tc1.left=(left)+'px';
	tc1.width="1px";
	tc1.height='1px';
	tc1.zIndex=iconCount;

	var tc2=getStyleObject("tc2["+id+"]");
	tc2.top=(top)+'px';
	tc2.left=(left+width-1)+'px';
	tc2.width="1px";
	tc2.height='1px';
	tc2.zIndex=iconCount;

	var scroll=getStyleObject("superScrollD["+id+"]");
	scroll.width="16px";
	scroll.height="16px";
	scroll.left=(width-17)+"px";
	scroll.top=(height-50)+"px";
	
	var scroll=getStyleObject("superScrollU["+id+"]");
	scroll.width="16px";
	scroll.height="16px";
	scroll.left=(width-17)+"px";
	scroll.top=(20)+"px";

	var scroll=getStyleObject("superScrollR["+id+"]");
	scroll.width="16px";
	scroll.height="16px";
	scroll.left=(width-31)+"px";
	scroll.top=(height-33)+"px";
	
	var scroll=getStyleObject("superScrollL["+id+"]");
	scroll.width="16px";
	scroll.height="16px";
	scroll.left=(2)+"px";
	scroll.top=(height-33)+"px";
	
	if (ie==ieChk)
	{
		var scrollBar=getStyleObject('scrollBarV['+id+']');
		scrollBar.display="none";

		var scroll=getStyleObject("scrollCircleV["+id+"]");
		scroll.display="none";
		var scrollBar=getStyleObject('scrollBarH['+id+']');
		scrollBar.display="none";

		var scroll=getStyleObject("scrollCircleH["+id+"]");
		scroll.display="none";

	}
	else
	{
		var scrollBar=getStyleObject('scrollBarV['+id+']');
		scrollBar.width="16px";
		scrollBar.height=(height-86)+"px";
		scrollBar.top="36px";
		scrollBar.left=(width-17)+"px";

		var scroll=getStyleObject("scrollCircleV["+id+"]");
		scroll.width="16px";
		scroll.height="16px";
		scroll.left="0px";
		scroll.top="0px";
		
		var scrollBar=getStyleObject('scrollBarH['+id+']');
		//scrollBar.background="yellow";
		scrollBar.width=(width-31-17)+"px";
		scrollBar.height="16px";
		scrollBar.top=(height-33)+"px";
		scrollBar.left=(17)+"px";

		var scroll=getStyleObject('scrollCircleH['+id+']');
		//alert (scroll);
		scroll.width="16px";
		scroll.height="16px";
		scroll.left="0px";
		scroll.top="0px";



	}

	//document.getElementById("content["+id+"]").innerHTML=wIndows[id].width-4;

	var i=0;
	for (i=iconCount;i>=0;i--)
	{
		if (sHown[i]==1)
		{
			//A fix to an annoying bug in Camino and Firefox 2/Firefox 3 on Mac OS X, see Notes #1
			var Old=getStyleObject("content["+i+"]");
			Old.overflow="hidden";
			var Old=getStyleObject("window["+i+"]");
			if (Old.zIndex>1)
			{
				var tmpZ=Old.zIndex-1;
			}
			else
			{
				var tmpZ=1;
			}
			Old.zIndex=tmpZ;
			var Old=getStyleObject("b1["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("b2["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("b3["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("b4["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("sb1["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("sb2["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("sb3["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("sb4["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("c1["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("c2["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("c3["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("c4["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("tc1["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("tc2["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("content["+i+"]");
			Old.overflow="hidden";
		}
	}

	oRder[id]=iconCount;
	var New=getStyleObject("content["+id+"]");
	New.overflow="auto";
	New.overflow="hidden";
	var Bottom=getStyleObject("bottomBar["+id+"]");
	Bottom.width=(width-4)+"px";
	Bottom.height="16px";
	Bottom.left="2px";
	Bottom.top=(height-18)+"px";
	document.getElementById("titleBar["+id+"]").innerHTML=iCons[id].title;
	current=id;
	sHown[id]=1; 
	if (lOaded[id]!=1)
	{
		x_getOutput(id,iDs[id],printOutput);
		lOaded[id]=1;
	}

	var tmpCont=document.getElementById("content["+id+"]");
	var LastY=tmpCont.scrollTop;
	tmpCont.scrollTop=tmpCont.scrollHeight;
	wIndows[id].maxY=tmpCont.scrollTop;

	var LastX=tmpCont.scrollLeft;
	tmpCont.scrollLeft=tmpCont.scrollWidth;
	wIndows[id].maxX=tmpCont.scrollLeft;
	
	//document.getElementById('copyright').innerHTML=wIndows[id].maxX+" "+wIndows[id].width;
	checkBars(id);
	
	tmpCont.scrollLeft=LastX;
	tmpCont.scrollTop=LastY;
	
	scrollDraw(LastX,wIndows[id].maxX,id,"h");
	scrollDraw(LastY,wIndows[id].maxY,id,"v");
	
	if (dub==0 & ie)
	{
		setTimeout("showWindow("+id+")",100);
	}
}

function checkBars(id)
{
	if (wIndows[id].maxX==0)
	{
		var obj=getStyleObject('scrollCircleH['+id+']');
		obj.display="none";
		var obj=getStyleObject('superScrollL['+id+']');
		obj.background="transparent url(images/left.jpg) no-repeat";
		var obj=getStyleObject('superScrollR['+id+']');
		obj.background="transparent url(images/right.jpg) no-repeat";
		wIndows[id].hOn=0;
	}
	else
	{
		var obj=getStyleObject('scrollCircleH['+id+']');
		obj.display="inline";
		var obj=getStyleObject('superScrollL['+id+']');
		obj.background="transparent url(images/left_up.jpg) no-repeat";
		var obj=getStyleObject('superScrollR['+id+']');
		obj.background="transparent url(images/right_up.jpg) no-repeat";
		wIndows[id].hOn=1;
	}
	
	if (wIndows[id].maxY==0)
	{
		var obj=getStyleObject('scrollCircleV['+id+']');
		obj.display="none";
		var obj=getStyleObject('superScrollU['+id+']');
		obj.background="transparent url(images/up.jpg) no-repeat";
		var obj=getStyleObject('superScrollD['+id+']');
		obj.background="transparent url(images/down.jpg) no-repeat";
		wIndows[id].vOn=0;
	}
	else
	{
		var obj=getStyleObject('scrollCircleV['+id+']');
		obj.display="inline";
		var obj=getStyleObject('superScrollU['+id+']');
		obj.background="transparent url(images/up_up.jpg) no-repeat";
		var obj=getStyleObject('superScrollD['+id+']');
		obj.background="transparent url(images/down_up.jpg) no-repeat";
		wIndows[id].vOn=1;
	}

}

function hideWindow(id)
{

	var b1=getStyleObject("b1["+id+"]");
	b1.top='0px';
	b1.left='0px';
	b1.width="0px";
	b1.height='0px';

	var b2=getStyleObject("b2["+id+"]");
	b2.top='0px';
	b2.left='0px';
	b2.width="0px";
	b2.height='0px';

	var b3=getStyleObject("b3["+id+"]");
	b3.top='0px';
	b3.left='0px';
	b3.width="0px";
	b3.height='0px';

	var b4=getStyleObject("b4["+id+"]");
	b4.top='0px';
	b4.left='0px';
	b4.width="0px";
	b4.height='0px';

	var sb1=getStyleObject("sb1["+id+"]");
	sb1.top='0px';
	sb1.left='0px';
	sb1.width="0px";
	sb1.height='0px';

	var sb2=getStyleObject("sb2["+id+"]");
	sb2.top='0px';
	sb2.left='0px';
	sb2.width="0px";
	sb2.height='0px';

	var sb3=getStyleObject("sb3["+id+"]");
	sb3.top='0px';
	sb3.left='0px';
	sb3.width="0px";
	sb3.height='0px';

	var sb4=getStyleObject("sb4["+id+"]");
	sb4.top='0px';
	sb4.left='0px';
	sb4.width="0px";
	sb4.height='0px';


	var c1=getStyleObject("c1["+id+"]");
	c1.top='0px';
	c1.left='0px';
	c1.width="0px";
	c1.height='0px';

	var c2=getStyleObject("c2["+id+"]");
	c2.top='0px';
	c2.left='0px';
	c2.width="0px";
	c2.height='0px';

	var c3=getStyleObject("c3["+id+"]");
	c3.top='0px';
	c3.left='0px';
	c3.width="0px";
	c3.height='0px';

	var c4=getStyleObject("c4["+id+"]");
	c4.top='0px';
	c4.left='0px';
	c4.width="0px";
	c4.height='0px';

	var tc1=getStyleObject("tc1["+id+"]");
	tc1.top='0px';
	tc1.left='0px';
	tc1.width="0px";
	tc1.height='0px';

	var tc2=getStyleObject("tc2["+id+"]");
	tc2.top='0px';
	tc2.left='0px';
	tc2.width="0px";
	tc2.height='0px';


	var Window=getStyleObject("window["+id+"]");
	Window.top='-1px';
	Window.left='-1px';
	Window.width="0px";
	Window.height='0px';
	Window.display="none";
	
	var Top=getStyleObject("titleBar["+id+"]");
	Top.width="0px";
	Top.height="0px";
	Top.left="0px";
	Top.top="0px";
	var Bottom=getStyleObject("bottomBar["+id+"]");
	Bottom.width="0px";
	Bottom.height="0px";
	Bottom.left="0px";
	Bottom.top="0px";
	var CloseButt=getStyleObject("closeButt["+id+"]");
	CloseButt.width="0px";
	CloseButt.height="0px";
	CloseButt.left="0px";
	CloseButt.top="0px";
	var Content=getStyleObject("content["+id+"]");
	Content.width="0px";
	Content.height="0px";
	Content.left="0px";
	Content.top="0px";

	var scroll=getStyleObject("superScrollD["+id+"]");
	scroll.width="0px";
	scroll.height="0px";
	scroll.left="0px";
	scroll.top="0px";

	var New=getStyleObject("window["+id+"]");
	New.zIndex="1";
	document.getElementById("titleBar["+id+"]").innerHTML="";
	sHown[id]=0;
	var New=getStyleObject("content["+id+"]");
	New.overflow="hidden";
	var tmpArg=-1;
	var tmpPlc=-1;
	for (i=iconCount;i>-1;i--)
	{
		if (sHown[i]==1)
		{
			if (oRder[i]>tmpPlc)
			{
				tmpArg=i;
				tmpPlc=oRder[i];
			}
		}
	}
	if (tmpArg>-1)
	{
		current=wIndows[tmpArg].id;
		switchFocus(current);
	}
}

function hideCurrent()
{
	hideWindow(current);
}

//Hides all windows
function hideAll()
{
	for (i=iconCount;i>=0;i--)
	{
		if (sHown[i]==1)
		{
			var Window=getStyleObject("window["+i+"]");
			Window.top='-1px';
			Window.left='-1px';
			Window.width="0px";
			Window.height='0px';
			var Top=getStyleObject("titleBar["+i+"]");
			Top.width="0px";
			Top.height="0px";
			Top.left="0px";
			Top.top="0px";
			var Bottom=getStyleObject("bottomBar["+i+"]");
			Bottom.width="0px";
			Bottom.height="0px";
			Bottom.left="0px";
			Bottom.top="0px";
			var CloseButt=getStyleObject("closeButt["+i+"]");
			CloseButt.width="0px";
			CloseButt.height="0px";
			CloseButt.left="0px";
			CloseButt.top="0px";
			var Content=getStyleObject("content["+i+"]");
			Content.width="0px";
			Content.height="0px";
			Content.left="0px";
			Content.top="0px";

			var b1=getStyleObject("b1["+i+"]");
			b1.top='0px';
			b1.left='0px';
			b1.width="0px";
			b1.height='0px';
			var b2=getStyleObject("b2["+i+"]");
			b2.top='0px';
			b2.left='0px';
			b2.width="0px";
			b2.height='0px';
			var b3=getStyleObject("b3["+i+"]");
			b3.top='0px';
			b3.left='0px';
			b3.width="0px";
			b3.height='0px';
			var b4=getStyleObject("b4["+i+"]");
			b4.top='0px';
			b4.left='0px';
			b4.width="0px";
			b4.height='0px';
			var sb1=getStyleObject("sb1["+i+"]");
			sb1.top='0px';
			sb1.left='0px';
			sb1.width="0px";
			sb1.height='0px';
			var sb2=getStyleObject("sb2["+i+"]");
			sb2.top='0px';
			sb2.left='0px';
			sb2.width="0px";
			sb2.height='0px';
			var sb3=getStyleObject("sb3["+i+"]");
			sb3.top='0px';
			sb3.left='0px';
			sb3.width="0px";
			sb3.height='0px';
			var sb4=getStyleObject("sb4["+i+"]");
			sb4.top='0px';
			sb4.left='0px';
			sb4.width="0px";
			sb4.height='0px';

			var c1=getStyleObject("c1["+i+"]");
			c1.top='0px';
			c1.left='0px';
			c1.width="0px";
			c1.height='0px';
			var c2=getStyleObject("c2["+i+"]");
			c2.top='0px';
			c2.left='0px';
			c2.width="0px";
			c2.height='0px';
			var c3=getStyleObject("c3["+i+"]");
			c3.top='0px';
			c3.left='0px';
			c3.width="0px";
			c3.height='0px';
			var c4=getStyleObject("c4["+i+"]");
			c4.top='0px';
			c4.left='0px';
			c4.width="0px";
			c4.height='0px';
			var tc1=getStyleObject("tc1["+i+"]");
			tc1.top='0px';
			tc1.left='0px';
			tc1.width="0px";
			tc1.height='0px';
			var tc2=getStyleObject("tc2["+i+"]");
			tc2.top='0px';
			tc2.left='0px';
			tc2.width="0px";
			tc2.height='0px';			//Moving the window to the back (layer)
			var New=getStyleObject("window["+i+"]");
			New.zIndex="1";

			//Updating the sHown variable
			sHown[i]=0;
			oRder[i]=-1;
			//Clearing the title to ensure it remains hidden
			document.getElementById("titleBar["+i+"]").innerHTML="";

			//A fix to an annoying bug in Camino and Firefox 2/Firefox 3 on Mac OS X, see Notes #1
			var New=getStyleObject("content["+i+"]");
			New.overflow="hidden";

		}
	}
}

function fullScreen(id)
{
	if (fUll[id]==1)
	{
		fUll[id]=0;
		temp=getStyleObject('resizeButt['+id+']');
		temp.display='block';
	}
	else
	{
		fUll[id]=1;
		temp=getStyleObject('resizeButt['+id+']');
		temp.display='none';
	}
	showWindow(id);
}

function switchFocus(id)
{
	var i=0;
	for (i=iconCount;i>=0;i--)
	{
		if (sHown[i]==1)
		{
			var Old=getStyleObject("window["+i+"]");
			if (Old.zIndex>1)
			{
				var tmpZ=Old.zIndex-1;
			}
			else
			{
				var tmpZ=1;
			}
			Old.zIndex=tmpZ;
			var Old=getStyleObject("b1["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("b2["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("b3["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("b4["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("sb1["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("sb2["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("sb3["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("sb4["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("c1["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("c2["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("c3["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("c4["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("tc1["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("tc2["+i+"]");
			Old.zIndex=tmpZ;
			var Old=getStyleObject("content["+i+"]");
			Old.overflow="hidden";
	
		}
	}
	var New=getStyleObject("window["+id+"]");
	New.zIndex=iconCount;
	
	var New=getStyleObject("b1["+id+"]");
	New.zIndex=iconCount;
	var New=getStyleObject("b2["+id+"]");
	New.zIndex=iconCount;
	var New=getStyleObject("b3["+id+"]");
	New.zIndex=iconCount;
	var New=getStyleObject("b4["+id+"]");
	New.zIndex=iconCount;
	var New=getStyleObject("sb1["+id+"]");
	New.zIndex=iconCount;
	var New=getStyleObject("sb2["+id+"]");
	New.zIndex=iconCount;
	var New=getStyleObject("sb3["+id+"]");
	New.zIndex=iconCount;
	var New=getStyleObject("sb4["+id+"]");
	New.zIndex=iconCount;
	var New=getStyleObject("c1["+id+"]");
	New.zIndex=iconCount;
	var New=getStyleObject("c2["+id+"]");
	New.zIndex=iconCount;
	var New=getStyleObject("c3["+id+"]");
	New.zIndex=iconCount;
	var New=getStyleObject("c4["+id+"]");
	New.zIndex=iconCount;
	var New=getStyleObject("tc1["+id+"]");
	New.zIndex=iconCount;
	var New=getStyleObject("tc2["+id+"]");
	New.zIndex=iconCount;
	
	
	var New=getStyleObject("content["+id+"]");
	New.overflow="auto";
	New.overflow="hidden";
	current=id;
}

//Function to switch through the windows
function toggleForward()
{
	var tmpArg=-1;
	var tmpPlc=-1;
	for (i=iconCount;i>-1;i--)
	{
		if (sHown[i]==1)
		{
			if (i!=current)
			{
				if (oRder[i]>tmpPlc)
				{
					tmpArg=i;
					tmpPlc=oRder[i];
				}

			}
		}
	}
	if (tmpArg>-1)
	{
		var New=getStyleObject("window["+current+"]");
		New.zIndex="1";
		oRder[current]=1;
		var last=current;
		
		current=wIndows[tmpArg].id;
		var New=getStyleObject("window["+current+"]");
		New.zIndex="1";
		oRder[current]=iconCount;
		var start=iconCount-1;
		for (i=iconCount;i>-1;i--)
		{
			if (i==current | i==last)
			{
			}
			else
			{
				if (sHown[i]==1)
				{
					oRder[i]=start;
					var New=getStyleObject("window["+i+"]");
					New.zIndex=start;
					start=start-1;
				}
			}
		}
		
		switchFocus(current);
		document.getElementById('tester').innerHTML="tmpArg="+tmpArg+" id="+wIndows[tmpArg].id+"<BR>"+document.getElementById('tester').innerHTML;
	}
}



function iconClicked(id)
{
	if (sHown[id]==1)
	{
		switchFocus(id);
	}
	else
	{
		showWindow(id);
	}
}

if (navigator.appName.indexOf("Microsoft")!=-1)
{
	var Props = new Array(2);
}
else
{
	var Props=getWinProp();
}

function captureMousePosition(e) 
{
	if (document.layers) {
		xMousePos = e.pageX;
		yMousePos = e.pageY;
		xMousePosMax = window.innerWidth+window.pageXOffset;
		yMousePosMax = window.innerHeight+window.pageYOffset;
	} else if (document.all) {
		xMousePos = window.event.x+document.body.scrollLeft;
		yMousePos = window.event.y+document.body.scrollTop;
		xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
		yMousePosMax = document.body.clientHeight+document.body.scrollTop;
	} else if (document.getElementById) {
		xMousePos = e.pageX;
		yMousePos = e.pageY;
		xMousePosMax = window.innerWidth+window.pageXOffset;
		yMousePosMax = window.innerHeight+window.pageYOffset;
	}
	if (go>-1 & fUll[go]==0)
	{
		document.onselectstart=new Function('return false');
		if (outLine<1)
		{
			tmpSize=getStyleObject("sizeOutline");
			tmpSize.display="block";
			tmpSize.top=wIndows[go].top+"px";
			tmpSize.left=wIndows[go].left+"px";
			tmpSize.width=wIndows[go].width+"px";
			tmpSize.height=wIndows[go].height+"px";
			tmpSize.zIndex=iconCount+2;
			//tmpSize.background="transparent";
			outLine=1;
		}
		temp=getStyleObject('window['+go+']');
		curLeft=parseInt(temp.left);
		curTop=parseInt(temp.top);

		if (xDiff>0)
		{
		}
		else
		{
			xDiff=xMousePos-curLeft;
		}

		if (yDiff>0)
		{
		}
		else
		{
			yDiff=yMousePos-curTop;
		}
		var newX=xMousePos-xDiff;
		var newY=yMousePos-yDiff;

		if (newX<1)
		{
			newX=1;
		}
		else if (newX>(Props[0]-1-wIndows[current].width))
		{
			newX=Props[0]-1-wIndows[current].width;
		}

		if (newY<1)
		{
			newY=1;
		}
		else if (newY>(Props[1]-iconBarHit-wIndows[current].height))
		{
			newY=Props[1]-iconBarHit-wIndows[current].height;
		}
		
		tmpSize.left=newX+"px";
		tmpSize.top=newY+"px";
		
		wIndows[go].left=newX;
		wIndows[go].top=newY;
	}
	else if (size>-1 & fUll[size]==0)
	{
		document.onselectstart=new Function('return false');
		if (outLine<1)
		{
			tmpSize=getStyleObject("sizeOutline");
			tmpSize.display="block";
			tmpSize.top=wIndows[size].top+"px";
			tmpSize.left=wIndows[size].left+"px";
			tmpSize.width=wIndows[size].width+"px";
			tmpSize.height=wIndows[size].height+"px";
			tmpSize.zIndex=iconCount+2;
			//tmpSize.background="transparent";
			outLine=1;
		}

		//document.getElementById('icons').innerHTML=size;
		temp=getStyleObject('window['+size+']');
		curWid=parseInt(temp.width);
		curHit=parseInt(temp.height);
		if (xMousePos<Props[0])
		{
			if (xDiff<0)
			{
			}
			else
			{
				xDiff=curWid-xMousePos;
			}
			var newWid=xMousePos+xDiff;
			if (newWid>549)
			{
			}
			else
			{
				newWid=550;
			}
		}
		else
		{
			var newWid=curWid;
		}

		if (yMousePos<(Props[1]-iconBarHit))
		{
			if (yDiff<0)
			{
			}
			else
			{
				yDiff=curHit-yMousePos;
			}
			var newHit=yMousePos+yDiff;
			if (newHit>275)
			{
			}
			else
			{
				newHit=276;
			}
		}
		else
		{
			var newHit=curHit;
		}

		wIndows[size].width=newWid;
		wIndows[size].height=newHit;
		//showWindow(size);
		//temp.width=newWid+"px";
		//temp.height=newHit+"px";
		tmpSize.width=newWid+"px";
		tmpSize.height=newHit+"px";
	}
	else if (gScroll>-1 & sOrient!="")
	{
		if (sOrient=="h")
		{
			if (lX==0 && uX==0)
			{
				var wIn=getStyleObject('window['+gScroll+']');
				var bar=getStyleObject('scrollBarH['+gScroll+']');
				lX=parseInt(wIn.left)+parseInt(bar.left);
				uX=parseInt(wIn.left)+parseInt(bar.left)+parseInt(bar.width)-17;
			}
			if (xMousePos>lX && xMousePos<uX)
			{
				var bar=getStyleObject('scrollBarH['+gScroll+']');
				var max=parseInt(bar.width)-17;
				var circ=getStyleObject('scrollCircleH['+gScroll+']');
				var newX=xMousePos-lX;
				
				circ.left=newX+"px";
				var pctX=newX/max;
				//document.getElementById('copyright').innerHTML=pctX;
				var cont=document.getElementById('content['+gScroll+']');
				var sL=parseInt(wIndows[gScroll].maxX*pctX);
				cont.scrollLeft=sL;
			}
			else if (xMousePos>uX)
			{
				var bar=getStyleObject('scrollBarH['+gScroll+']');
				var max=parseInt(bar.width)-17;
				var circ=getStyleObject('scrollCircleH['+gScroll+']');
				var newX=max;
				
				circ.left=newX+"px";
				var pctX=newX/max;
				//document.getElementById('copyright').innerHTML=pctX;
				var cont=document.getElementById('content['+gScroll+']');
				var sL=parseInt(wIndows[gScroll].maxX*pctX);
				cont.scrollLeft=sL;
			}
			else if (xMousePos<lX)
			{
				var bar=getStyleObject('scrollBarH['+gScroll+']');
				var max=parseInt(bar.width)-17;
				var circ=getStyleObject('scrollCircleH['+gScroll+']');
				var newX=0;
				
				circ.left=newX+"px";
				var pctX=newX/max;
				//document.getElementById('copyright').innerHTML=pctX;
				var cont=document.getElementById('content['+gScroll+']');
				var sL=parseInt(wIndows[gScroll].maxX*pctX);
				cont.scrollLeft=sL;

			}
		}
		else if (sOrient=="v")
		{
			if (lY==0 && uY==0)
			{
				var wIn=getStyleObject('window['+gScroll+']');
				var bar=getStyleObject('scrollBarV['+gScroll+']');
				lY=parseInt(wIn.top)+parseInt(bar.top);
				uY=parseInt(wIn.top)+parseInt(bar.top)+parseInt(bar.height)-17;
			}
			
			if (yMousePos>lY && yMousePos<uY)
			{
				var bar=getStyleObject('scrollBarV['+gScroll+']');
				var max=parseInt(bar.height)-17;
				var circ=getStyleObject('scrollCircleV['+gScroll+']');
				var newY=yMousePos-lY;
				circ.top=newY+"px";
				var pctY=newY/max;
				//document.getElementById('copyright').innerHTML=pctY;
				var cont=document.getElementById('content['+gScroll+']');
				var sT=parseInt(wIndows[gScroll].maxY*pctY);
				cont.scrollTop=sT;
			}
			else if (yMousePos>uY)
			{
				var bar=getStyleObject('scrollBarV['+gScroll+']');
				var max=parseInt(bar.height)-17;
				var circ=getStyleObject('scrollCircleV['+gScroll+']');
				var newY=max;
				
				circ.top=newY+"px";
				var pctY=newY/max;
				//document.getElementById('copyright').innerHTML=pctY;
				var cont=document.getElementById('content['+gScroll+']');
				var sT=parseInt(wIndows[gScroll].maxY*pctY);
				cont.scrollTop=sT;
			}
			else if (yMousePos<lY)
			{
				var bar=getStyleObject('scrollBarV['+gScroll+']');
				var max=parseInt(bar.height)-17;
				var circ=getStyleObject('scrollCircleV['+gScroll+']');
				var newY=0;
				
				circ.top=newY+"px";
				var pctY=newY/max;
				//document.getElementById('copyright').innerHTML=pctY;
				var cont=document.getElementById('content['+gScroll+']');
				var sT=parseInt(wIndows[gScroll].maxY*pctY);
				cont.scrollTop=sT;
			}
		}

		
	}
}

function clearMouse(e)
{
	manClearMouse();
}

function manClearMouse()
{
	if (size>-1)
	{
		showWindow(size);
	}
	else if (go>-1 & fUll[go]==0)
	{
		temp=getStyleObject('window['+go+']');
		temp.left=wIndows[go].left+"px";
		temp.top=wIndows[go].top+"px";
		showWindow(go);

	}
	tmpSize=getStyleObject('sizeOutline');
	tmpSize.display="none";
	outLine=0;
	go=-1;
	size=-1;
	gScroll=-1;
	sOrient="";
	lX=0;
	lY=0;
	uX=0;
	uY=0;
	xDiff=0;
	yDiff=0;
}


function start()
{
	if (Props[0])
	{
	}
	else
	{
		//Setting the variables for IE, won't work until something has been drawn on screen for some reason, stupid IE
		var temp=document.body.offsetWidth;
		Props[0]=temp;
		if (document.documentElement.clientHeight)
		{
			var temp=document.documentElement.clientHeight;
			Props[1]=temp;
		}
		else
		{
			var temp=document.body.offsetHeight;
			Props[1]=temp;
			Props[0]=Props[0]-20;
		}
		tmp=getStyleObject('imposing');
		tmp.height=Props[1]+"px";
		tmp.width=Props[0]+"px";
		ie=1;
	}
	//document.getElementById('tester').innerHTML=Props[0]+" "+Props[1]+"<BR>";
	var temp=getStyleObject('icons');
	temp.top=(Props[1]-5-iconBarHit)+"px";
	temp.left="0px";
	temp.width=(Props[0]-4)+"px";
	temp.height=iconBarHit+"px";
	var temp=getStyleObject('windows');
	temp.top="0px";
	temp.left="0px";
	temp.width=(Props[0])+"px";
	temp.height=(Props[1]-iconBarHit-4)+"px";
	//temp.height=400;
	var i=0;
	for (i=0;i<=iconCount;i++)
	{
		if (tItles[i])
		{
			iCons[i] = new newIcon(i,cOlors[i],tItles[i]);
			wIndows[i] = new newWindow(i,wIdths[i],hEights[i],cOlors[i],tOps[i],lEfts[i],cOntents[i]);
			sHown[i]=0;
		}
	}
	if (document.images)
	{
		var close=new Image();
		var logo=new Image();
		var gradient=new Image();
		var resize=new Image();
		var load=new Image();
		
		logo.src='images/phallicysmbl.png';
		gradient.src='images/grad.jpg';
		resize.src='images/resize.jpg';
		close.src='images/close.jpg';
		load.src='ajax-loader.gif';
		
	}
/*	document.getElementById('icons').innerHTML=document.getElementById('icons').innerHTML+
	"<div id='iconSwitch' class=icon "+
	"style='background:#555555;' "+
	"onClick=\"themeSwitchy();\" "+
	"onMouseOver=\"temp=getStyleObject('iconSwitch');temp.background='#000000';temp.color='#FFFFFF';\" "+
	"onMouseOut=\"temp=getStyleObject('iconSwitch');temp.background='#555555';temp.color='#000000';\" "+
	">Style</div>";*/

	keepInLine();
	setTimeout("reveal()",100);
}

if (document.addEventListener) 
{
    document.addEventListener("DOMContentLoaded", setReadyState, false);
}

function setReadyState()
{
	readyState=1;
}

function reveal()
{
	//document.getElementById('imposing').innerHTML=document.readyState+"<BR>"+document.getElementById('imposing').innerHTML;
	if (document.readyState=="complete" | readyState==1)
	{
		imposed=getStyleObject("imposing");
		var filter=imposed.opacity*100;
		filter=Math.round(filter-10);
		if (filter>1)
		{
			imposed.filter="alpha(opacity="+filter+")";
			imposed.opacity=filter/100;
			setTimeout("reveal()", 10);
		}
		else
		{
			imposed.display="none";
		}
	}	
	else
	{
		setTimeout("reveal()", 5);
	}
}

function keepInLine()
{
	if (navigator.appName.indexOf("Microsoft")!=-1)
	{
		var NewProps = new Array(2);
		var temp=document.body.offsetWidth;
		NewProps[0]=temp;
		if (document.documentElement.clientHeight)
		{
			var temp=document.documentElement.clientHeight;
			NewProps[1]=temp;
		}
		else
		{
			var temp=document.body.offsetHeight;
			NewProps[1]=temp;
			NewProps[0]=NewProps[0]-20;
		}	
	}
	else
	{
		var NewProps=getWinProp();
	}
	if (NewProps[0]==Props[0] & NewProps[1]==Props[1])
	{
		//document.getElementById('pageName').innerHTML=NewProps[0]+" "+NewProps[1]+" M <BR>";
	}
	else
	{
		Props=NewProps;
		//document.getElementById('pageName').innerHTML="Whee <BR>";
		var temp=getStyleObject('icons');
		temp.top=(Props[1]-5-iconBarHit)+"px";
		temp.left="0px";
		temp.width=(Props[0]-4)+"px";
		temp.height=iconBarHit+"px";
		var temp=getStyleObject('windows');
		temp.top="0px";
		temp.left="0px";
		temp.width=(Props[0])+"px";
		temp.height=(Props[1]-iconBarHit-4)+"px";
		var i=0;
		for (i=iconCount;i>=0;i--)
		{
			if (sHown[i]==1 & fUll[i]==1)
			{
				showWindow(i);				
			}
		}
		
	}
	if (Props[0]<874)
	{
		var allWid=Props[0]-300;
		var maxWid=(iconMaxWid+10)*(iconCount+1);

		//alert(allWid+"\n"+maxWid);
		
		if (maxWid>allWid)
		{
			var newWid=parseInt((allWid-((iconCount+1)*10))/(iconCount+1));
			for (i=iconCount;i>=0;i--)
			{
				tmpObj=getStyleObject("icon["+i+"]");
				tmpObj.width=(newWid-4)+"px";
			}
			tmpObj=getStyleObject('iconSwitch');
			tmpObj.width=(newWid-4)+"px";
			iconCurWid=newWid;
			//alert(newWid);
		}
		var m=1;
	}
	else if (iconCurWid!=iconMaxWid)
	{
		newWid=iconMaxWid;
		for (i=iconCount;i>=0;i--)
		{
			tmpObj=getStyleObject("icon["+i+"]");
			tmpObj.width=(newWid)+"px";
		}
		tmpObj=getStyleObject('iconSwitch');
		tmpObj.width=(newWid)+"px";
		iconCurWid=newWid;
	
	}
	
	setTimeout("keepInLine()", 100);
	
}

if (document.layers)
{
	// Netscape
	document.captureEvents(Event.MOUSEMOVE);
	document.onmousemove = captureMousePosition;
	document.captureEvents(Event.MOUSEOUT);
	document.onmouseout = clearMouse;
}
else if (document.all)
{
	// Internet Explorer
	document.onmousemove = captureMousePosition;
	//document.onmouseout = clearMouse;
	document.onmouseup = clearMouse;
}
else if (document.getElementById)
{
	// Netcsape 6
	document.onmousemove = captureMousePosition;
	//document.onmouseout = clearMouse;
	document.onmouseup = clearMouse;
}
