
//check browser
theBrowser_ie = false
theBrowser_ns4 = false
theBrowser_ns6 = false
if(document.all) {
	theBrowser_ie = true
} else if(document.layers) {
	theBrowser_ns4 = true
} else if(document.getElementById) {
	theBrowser_ns6 = true
}
theTimerCheck=false;
theOldTargetLayer=null
theOldtargetImageName=null
theOldtargetImageLocation=null
theOldExtention=null
theCloseTime=10000

var image_array = new Array();

image_array[0] = "images/laptop.jpg";
image_array[1] = "images/goinside.gif";
image_array[2] = "images/whoweare.jpg";
image_array[3] = "images/whatwedo.jpg";
image_array[4] = "images/whatwehavedone.gif";
image_array[5] = "images/road2.jpg";
image_array[6] = "images/dropaline.gif";
image_array[7] = "images/talk2us.jpg";


//Function that shows/hides a chosen layer and image
function mouseoverControll(theID,theAction){
	
	if( theAction == 'over')
		$('#SwapImage').attr('src', './' + image_array[ parseInt(theID) ] );
	else
		$('#SwapImage').attr('src', './' + image_array[ 0 ] );
	/*
	if(theAction=="over"){
		//check if timer still active and cancel it if it is 
		if(theTimerCheck==true){
			clearTimeout(theTimer);
			theTimerCheck=false;
			closeItems(theOldTargetID);
		}
		//make layer visible and swap image
		ImgSwap(("gr_"+theID),"over");
		setLayerVisibility("L_00","hide");
		setLayerVisibility(("L_"+theID),"show");
		theOldTargetID=theID;
	} else if (theAction=="out") {
		eval('theTimer = setTimeout("closeItems(\''+theID+'\')", '+theCloseTime+');')
		theTimerCheck=true;
	}*/
}


//hides layer and swaps back image
function closeItems(theID){
	ImgSwap(("gr_"+theID));
	setLayerVisibility(("L_"+theID),"hide");
	setLayerVisibility("L_00","show");
	theTimerCheck=false;
}

//image swapper
function ImgSwap(element,theStatus){
/*
	if(theStatus!="over"){
		if (theBrowser_ie){
			eval("document.all." + element + ".src='/images/grey.gif';");
		} else if (theBrowser_ns4) {
				eval ("document." + element + ".src = '/images/grey.gif';");
		} else {
			document.getElementById(element).src = "/images/grey.gif";
		}
	} else {
		if (theBrowser_ie){
			eval("document.all." + element + ".src='/images/grey_over.gif';");
		} else if (theBrowser_ns4) {
				eval ("document." + element + ".src = '/images/grey_over.gif';");
		} else {
			document.getElementById(element).src = "/images/grey_over.gif";
		}
	}
*/
}


//set visibilty on layer
function setLayerVisibility(theLayer,showHide){
	if (theBrowser_ie) {
		if(showHide=="show"){
			showHide="visible"
		} else {
			showHide="hidden"
		}
		eval(theLayer+".style.visibility = '"+showHide+"'")
	} else if (theBrowser_ns4){
		if(showHide=="show"){
			showHide="show"
		} else {
			showHide="hide"
		}
		document.layers[theLayer].visibility=showHide
	} else {
		if(showHide=="show"){
			showHide="visible"
		} else {
			showHide="hidden"
		}
		document.getElementById(theLayer).style.visibility = showHide
	}
}
