//resize the current window

if(document.layers)
{
	var windowWidth = window.innerWidth;
	var windowHeight = window.innerHeight;
}



//reload netscape function

function reloadNetscape()
{
	if(document.layers)
	{
		if(window.innerWidth!=windowWidth || window.innerHeight!=window.innerHeight)
		{
			location.reload();
		}
	}
}


/*################################
container scroller stuff
################################*/
var initialised;
bw=new verifyCompatibleBrowser() 
var speed=250
var loop, timer 



// begin absolutely positioned scrollable area object scripts 
// Extension developed by David G. Miles 
// Original Scrollable Area code developed by Thomas Brattli 


function verifyCompatibleBrowser(){ 
    this.ver=navigator.appVersion 
    this.dom=document.getElementById?1:0 
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
    this.ie4=(document.all && !this.dom)?1:0; 
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
 
    this.ns4=(document.layers && !this.dom)?1:0; 
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
    return this 
} 


 
function ConstructObject(obj,nest){ 
// if not inside another layer do "innerlayername"
// else inside another layer do "document.outerlayername.innerlayername"
    nest=(!nest) ? '':'document.'+nest+'.' 
// setup el
// if getElementById is valid then use getElementById to get element and style
// if IE4 use document.all to get element and style
// is NS4 use nesting string above + document.elementname
    this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
    this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
    this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight 
    this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight 
    this.up=MoveAreaUp;this.down=MoveAreaDown; 
    this.MoveArea=MoveArea; this.x; this.y; 
    this.obj = obj + "Object" 
    eval(this.obj + "=this") 
    return this 
} 
function MoveArea(x,y){ 
    this.x=x;this.y=y 
    this.css.left=this.x 
    this.css.top=this.y 
} 
 
function MoveAreaDown(move){ 
	if(this.y>-this.scrollHeight+objContainer.clipHeight){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".down("+move+")",speed)
	} 
} 
function MoveAreaUp(move){ 
	if(this.y<0){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".up("+move+")",speed)
	} 
} 
 
function PerformScroll(speed){ 
	if(initialised){
		loop=true; 
		if(speed>0) objScroller.down(speed) 
		else objScroller.up(speed) 
	} 
} 
 
function CeaseScroll(){ 
    loop=false 
    if(timer) clearTimeout(timer) 
} 
 
function InitialiseScrollableArea(){ 
    objContainer=new ConstructObject('divContainer');
    objScroller=new ConstructObject('divContent','divContainer');
    objScroller.MoveArea(0,0);
    objContainer.css.visibility='visible';
    initialised=true; 
} 
// end absolutely positioned scrollable area object scripts





/***************************
studio image scroller
***************************/


function InitialiseStudio()
{
	if(document.layers)
	{
		studio = document.studioContainer.document.studioContent;
		container = document.studioContainer;
		var visible = "show";
		var hidden = "hide";
	}
	else if(document.getElementById)
	{
		studio = document.getElementById("studioContent").style;
		container = document.getElementById("studioContainer").style;
		var visible = "visible";
		var hidden = "hidden";
	}
	else if(document.all)
	{
		studio = studioContent.style;
		container = studioContainer.style;
		var visible = "visible";
		var hidden = "hidden";
	}

	studio.top = 0;
	studio.left = 0;
	container.top = viewTopPos;
	container.left = viewLeftPos;
	container.width = windowWidth;
	container.height = windowHeight;
	container.clip.right = windowWidth;
	container.clip.bottom = windowHeight;
	container.clip.left = 0;
	container.clip.top = 0;

	container.visibility = visible;
}

function clickScrollStudio(direction)
{
	var leftPos = parseInt(studio.left);
	var difference = leftPos%bigdistance;

	if(direction == "left")
	{
		if(leftPos == 0)
		{
			scrollLock = true;
		}
		else if(leftPos > -distance)
		{
			studio.left = 0;
			scrollLock = true;
		}
		else if((difference==0 || Math.abs(difference) < distance) && scrollLock==false)
		{
			studio.left = leftPos + Math.abs(difference);
			scrollLock = true;
		}
		else
		{
			studio.left = leftPos + distance;
			scrollLock = false;
			studioscroll = setTimeout("clickScrollStudio('left')", timer);
		}
	}
	else if(direction == "right")
	{
		if(leftPos == parseInt(container.width) - imageWidth)
		{
			scrollLock = true;
		}
		else if(leftPos < parseInt(container.width) - imageWidth + distance)
		{
			studio.left = parseInt(container.width) - imageWidth
			scrollLock = true;
		}
		else if((difference==0 || Math.abs(difference) > bigdistance-distance) && scrollLock==false)
		{
			if(difference != 0)
			{
				studio.left = leftPos - (bigdistance-Math.abs(difference));
			}
			scrollLock = true;
		}
		else
		{
			studio.left = leftPos - distance;
			scrollLock = false;
			studioscroll = setTimeout("clickScrollStudio('right')", timer);
		}
	}
}

function scrollStudio(direction)
{
	var	leftPos = parseInt(studio.left);

	if(direction == "left")
	{
		if(leftPos<-distance)
		{
			studio.left = leftPos + distance;
			studioscroll = setTimeout("scrollStudio('left')", timer);
		}
		else
		{
			studio.left = 0;
		}
	}
	else if(direction == "right")
	{
		if(leftPos+imageWidth > parseInt(container.width)+distance)
		{
			studio.left = leftPos - distance;
			studioscroll = setTimeout("scrollStudio('right')", timer);
		}
		else
		{
			studio.left = parseInt(container.width) - imageWidth;
		}
	}
}

function stopStudio()
{
	if(studioscroll != null)
	{
		clearTimeout(studioscroll);
	}
}
/***************************
end studio image scroller
***************************/




/***************************
BEGIN MACROMEDIA SCRIPTS
***************************/

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

/**************************
END MACROMEDIA SCRIPTS
**************************/

/***************************
FRONT PAGE DROP MENU
***************************/

function changeMenu(element, turnOn)
{
	if(dropping)
	{
		return;
	}
	var layerOn, layerOff;
	if(document.layers)
	{
		eval("layerOn = clients.document.element"+element+"_on");
		eval("layerOff = clients.document.element"+element+"_off");
	}
	else if(document.getElementById)
	{
		eval("layerOn = document.getElementById(\"element"+element+"_on\").style");
		eval("layerOff = document.getElementById(\"element"+element+"_off\").style");
	}
	else if(document.all)
	{
		eval("layerOn = document.all('element"+element+"_on').style");
		eval("layerOff = document.all('element"+element+"_off').style");
	}
	
	if(turnOn)
	{
		layerOn.visibility = visible;
		layerOff.visibility = hidden;
	}
	else
	{
		layerOff.visibility = visible;
		layerOn.visibility = hidden;
	}
}

function dropMenu()
{
	background.top = -134;
	clients.top = -(6 + (clientarray.length)*18);

	for(i=1; i<=clientarray.length; i++)
	{
		if(document.layers)
		{
			eval("document.clientContainer.document.clientContent.document.element"+i+"_off.visibility = 'show'");
		}
		else if(document.getElementById)
		{
			eval("document.getElementById('element"+i+"_off').style.visibility = 'visible'");
		}
		else if(document.all)
		{
			eval("document.getElementById(\"element"+i+"_off\").style.visibility = 'visible'");
		}
	}

	background.visibility = visible;

	dropping = true;
	menuDrop()
}

function menuDrop()
{
	clientTop = parseInt(clients.top)
	backgroundTop = parseInt(background.top)

	clients.zIndex = 3;
	if(clientTop<=0 && clientTop > -distance)
	{
		clients.top = 0;
	}
	else if(clientTop <= -distance)
	{
		clients.top = clientTop+distance;
	}

	if(backgroundTop<=-distance)
	{
		background.top = backgroundTop+distance;
		setTimeout("menuDrop()", timer2);
	}
	else if(backgroundTop<=0 && backgroundTop>-distance)
	{
		background.top = 0;
		dropping = false;
//		hideMenu();
	}
}

function hideMenu()
{
	if(!dropping && !hiding)
	{
		hiding = true;
//		menuTimeout = setTimeout("hide(); hiding = false;", 5000);
	}
}

function hide()
{
	for(i=1; i<=clientarray.length; i++)
	{
		if(document.layers)
		{
			eval("document.clientContainer.document.clientContent.document.element"+i+"_off.visibility = 'hide'");
			eval("document.clientContainer.document.clientContent.document.element"+i+"_on.visibility = 'hide'");
			document.clientContainer.document.clientBackground.visibility = "hide";
		}
		else if(document.getElementById)
		{
			eval("document.getElementById('element"+i+"_off').style.visibility = 'hidden'");
			eval("document.getElementById('element"+i+"_on').style.visibility = 'hidden'");
			document.getElementById("clientBackground").style.visibility = "hidden";
		}
		else if(document.all)
		{
			eval("document.all('element"+i+"_off').style.visibility = 'hidden'");
			eval("document.all('element"+i+"_on').style.visibility = 'hidden'");
			document.all("clientBackground").style.visibility = "hidden";
		}
	}
}

function showMenu(menu)
{
	if(menuTimeout != null)
	{
		clearTimeout(menuTimeout);
		hiding = false;
		menuTimeout = null;
	}
}

function InitialiseMenu()
{
	if(document.getElementById && navigator.appName=="Netscape")
	{
		return;
	}

	if(document.layers)
	{
		container = document.clientContainer;
		clients = document.clientContainer.document.clientContent;
		background = document.clientContainer.document.clientBackground;
		visible = "show";
		hidden = "hide";
	}
	else if(document.getElementById)
	{
		container = document.getElementById("clientContainer").style;
		clients = document.getElementById("clientContent").style;
		background = document.getElementById("clientBackground").style;
		visible = "visible";
		hidden = "hidden";
	}
	else if(document.all)
	{
		container = clientContainer.style;
		clients = clientContent.style;
		background = clientBackground.style;
		visible = "visible";
		hidden = "hidden";
	}

	clients.top = 0;
	clients.left = 0;
	clients.width = windowWidth;
	clients.zIndex = 5;
	background.top = 0;
	background.left = 0;
	background.width = windowWidth;
	background.zIndex = -1;
	container.top = viewTopPos;
	container.left = viewLeftPos;
	container.width = windowWidth;
	container.height = windowHeight;
	container.clip.right = windowWidth;
	container.clip.bottom = windowHeight;
	container.clip.left = 0;
	container.clip.top = 0;

	for(clientcounter=1; clientcounter<=clientarray.length; clientcounter++)
	{
		if(document.layers)
		{
			eval("text_off = clients.document.element"+clientcounter+"_off");
			eval("text_on = clients.document.element"+clientcounter+"_on");
			eval("divider = clients.document.divider"+clientcounter);
		}
		else if(document.getElementById)
		{
			eval("text_off = document.getElementById('element"+clientcounter+"_off').style");
			eval("text_on = document.getElementById('element"+clientcounter+"_on').style");
			eval("divider = document.getElementById('divider"+clientcounter+"').style");
		}
		else if(document.all)
		{
			eval("text_off = element"+clientcounter+"_off.style");
			eval("text_on = element"+clientcounter+"_on.style");
			eval("divider = divider"+clientcounter+".style");
		}
		text_off.top = (clientcounter-1)*18 + 6;
		text_on.top = (clientcounter-1)*18 + 6;
		divider.top = (clientcounter-1)*18 + 6 + 17;
	}

	hide();
	dropping = false;
	hiding = false;

	container.visibility = visible;
	clients.visibility = visible;
	dropMenu()
}
/*******************
END DROP MENU
*******************/