ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;
ns6 = (document.getElementById)? true:false;

if (document.images) {
		
	webicon1 = new Image();
	webicon2 = new Image();
	webicon3 = new Image();
	webicon4 = new Image();
	webicon5 = new Image();
	webicon6 = new Image();
	webicon7 = new Image();
	webicon8 = new Image();
	webicon9 = new Image();
	webicon10 = new Image();
	webicon11 = new Image();
	webicon12 = new Image();
	webicon13 = new Image();
	webicon14 = new Image();
	webicon15 = new Image();
	webicon16 = new Image();
	
	webicon1.src = "../img/webicon1.gif";
	webicon2.src = "../img/webicon2.gif";
	webicon3.src = "../img/webicon3.gif";
	webicon4.src = "../img/webicon4.gif";
	webicon5.src = "../img/webicon5.gif";
	webicon6.src = "../img/webicon6.gif";
	webicon7.src = "../img/webicon7.gif";
	webicon8.src = "../img/webicon8.gif";
	webicon9.src = "../img/webicon9.gif";
	webicon10.src = "../img/webicon10.gif";
	webicon11.src = "../img/webicon11.gif";
	webicon12.src = "../img/webicon12.gif";
	webicon13.src = "../img/webicon13.gif";
	webicon14.src = "../img/webicon14.gif";
	webicon15.src = "../img/webicon15.gif";
	webicon16.src = "../img/webicon16.gif";
	
	webicon1on = new Image();
	webicon2on = new Image();
	webicon3on = new Image();
	webicon4on = new Image();
	webicon5on = new Image();
	webicon6on = new Image();
	webicon7on = new Image();
	webicon8on = new Image();
	webicon9on = new Image();
	webicon10on = new Image();
	webicon11on = new Image();
	webicon12on = new Image();
	webicon13on = new Image();
	webicon14on = new Image();
	webicon15on = new Image();
	webicon16on = new Image();
	
	webicon1on.src = "../img/webicon1on.gif";
	webicon2on.src = "../img/webicon2on.gif";
	webicon3on.src = "../img/webicon3on.gif";
	webicon4on.src = "../img/webicon4on.gif";
	webicon5on.src = "../img/webicon5on.gif";
	webicon6on.src = "../img/webicon6on.gif";
	webicon7on.src = "../img/webicon7on.gif";
	webicon8on.src = "../img/webicon8on.gif";
	webicon9on.src = "../img/webicon9on.gif";
	webicon10on.src = "../img/webicon10on.gif";
	webicon11on.src = "../img/webicon11on.gif";
	webicon12on.src = "../img/webicon12on.gif";
	webicon13on.src = "../img/webicon13on.gif";
	webicon14on.src = "../img/webicon14on.gif";
	webicon15on.src = "../img/webicon15on.gif";
	webicon16on.src = "../img/webicon16on.gif";
	
	logoimg = new Image();
	logoimg.src = "../img/logotext.gif";
	spacer = new Image();
	spacer.src = "../img/spacer.gif";
	
}

function navOver(id,hex) 
{
	var color = '#'+hex;
	
	
	if (document.all)
		document.all[id].style.backgroundColor = color;
	else if (document.getElementById)
		document.getElementById(id).style.backgroundColor = color;
	else if (document.layers)
	{
		if( document.layers[id] )
		{
			document.layers[id].bgColor = color;
		}
	}
}

function navOff(id,hex) 
{
	var color2 = '#'+hex;
	
	
	if (document.all)
		document.all[id].style.backgroundColor = color2;
	else if (document.getElementById)
		document.getElementById(id).style.backgroundColor = color2;
	else if (document.layers)
	{
		if( document.layers[id] )
		{
			document.layers[id].bgColor = color2;
		}  
	}
}

function chgSqr(id,hex) 
{
	var color = '#'+hex;
	
	
	if (document.all)
		document.all[id].style.backgroundColor = color;
	else if (document.getElementById)
		document.getElementById(id).style.backgroundColor = color;
	else if (document.layers)
	{
		if( document.layers[id] )
		{
			document.layers[id].bgColor = color;
		}
	}
}


function chgImg(imgField,newImg) {
             if (document.images) {
				document[imgField].src = eval(newImg + ".src");
					}
				}

function changeText(id,newText) {
	if (document.all) {
		document.all[id].innerHTML = newText;
		}
	else if (document.getElementById) {
		document.getElementById(id).innerHTML = newText;
		}
	}		

function show(id) {
	if (ns4) {
		document.layers[id].visibility = "show";
	}
	else if (ie4) {
		document.all[id].style.visibility = "visible";
	} 
	else if (ns6) {
		document.getElementById(id).style.visibility = "visible";
	}
}

function hide(id) {
	if (ns4) {
		document.layers[id].visibility = "hide";
	}
	else if (ie4) {
		document.all[id].style.visibility = "hidden";
	} 
	else if (ns6) {
		document.getElementById(id).style.visibility = "hidden";
	}
}


  
function startDrift() {
	setTimeout("goDrift()",300000);
 }
 
 function goDrift() {
	if (ns4) {
		document.layers["square1"].posTop += 4;
		document.layers["square2"].posTop += 3;
		document.layers["square3"].posTop += 5;
	}
	else if (ie4) {
		document.all["square1"].style.posTop += 4;
		document.all["square2"].style.posTop += 3;
		document.all["square3"].style.posTop += 5;
	} 
	else if (ns6) {
		document.getElementById("square1").style.posTop += 4;
		document.getElementById("square2").style.posTop += 3;
		document.getElementById("square3").style.posTop += 5;
	}
	setTimeout("goDrift()",30);
 }
 
 function putHtml(id,page) {
	if (ns4) {
		document.layers[id].visibility = "show";
		document.textLayer.src = page;
	}
	else if (ie4) {
		document.all[id].style.visibility = "visible";
		parent.textFrame.document.location = page;
	}
	else if (ns6) {
		document.getElementById(id).style.visibility = "visible";
		parent.textFrame.document.location = page;
	}
}

function setLyr(obj,lyr)
{
	var newX = findPosX(obj);
	var newY = findPosY(obj);
	if (ns4) {
		newY -= 290;
		newX += 281;
	}
	else if (ie4) {
		newY -= 290;
		newX += 281;
	}
	else if (ns6) {
		newY -= 290;
		newX += 281;
	}
	var x = new getObj(lyr);
	x.style.top = newY + 'px';
	x.style.left = newX + 'px';
}

function setLyr2(obj2,lyr2)
{
	var newX = findPosX(obj2);
	var newY = findPosY(obj2);
	if (ns4) {
		newY -= 284;
		newX += 320;
	}
	else if (ie4) {
		newY -= 274;
		newX += 340;
	}
	else if (ns6) {
		newY -= 284;
		newX += 320;
	}
	var x = new getObj(lyr2);
	x.style.top = newY + 'px';
	x.style.left = newX + 'px';
}

function findPosX(obj)
{
        var curleft = 0;
        if (obj.offsetParent)
        {
                while (obj.offsetParent)
                {
                        curleft += obj.offsetLeft
                        obj = obj.offsetParent;
                }
        }
        else if (obj.x)
                curleft += obj.x;
        return curleft;
}

function findPosY(obj)
{
        var curtop = 0;
        if (obj.offsetParent)
        {
                while (obj.offsetParent)
                {
                        curtop += obj.offsetTop
                        obj = obj.offsetParent;
                }
        }
        else if (obj.y)
                curtop += obj.y;
        return curtop;
} 


function getObj(name)
{
 if (document.getElementById)
 {
	   this.obj = document.getElementById(name);
	   this.style = document.getElementById(name).style;
 }
 else if (document.all)
 {
	   this.obj = document.all[name];
	   this.style = document.all[name].style;
 }
 else if (document.layers)
 {
	   if (document.layers[name])
	   {
	   	this.obj = document.layers[name];
	   	this.style = document.layers[name];
	   }
	   else
	   {
	    this.obj = document.layers.testP.layers[name];
	    this.style = document.layers.testP.layers[name];
	   }
 }
}