//var ry=Math.floor(Math.random()*myimages.length);

////////2ND PAGE DROP-DOWN MENUS
//set up an array of variables to use as timeout intervals
var going=new Array();
for(var i=1; i<5; i++){
	going[i]="";
}

function gohide(which){
	//HIDE THE LAYER PASSED IN
	var arrayindextohide = (which.substring(which.length-1,which.length));
	clearInterval(going[arrayindextohide]);
	if (document.getElementById) {
		thisLayer = document.getElementById(which).style ;
	}else if (document.all){
		thisLayer = document.all[which].style; 
	}else if (document.layers) { 
		thisLayer = document.layers[which];
	}
	thisLayer.visibility='hidden';
}

function goshow(which){
	//HIDE ALL OTHER LAYERS	
	for(var i=1; i<5; i++){
		gohide('menu' + i);
	}
	//SHOW THIS LAYER
	if (document.getElementById) {
		thisLayer = document.getElementById(which).style ;
	}else if (document.all){
		thisLayer  = document.all[which].style; 
	}else if (document.layers) { 
		thisLayer  = document.layers[which];
	}
	thisLayer .visibility='visible';
}

function delayhide(which){
	//DELAY THE HIDING OF THE LAYER WE JUST EXITED
	var arrayindextohide = (which.substring(which.length-1,which.length));
	clearInterval(going[arrayindextohide]);
	going[arrayindextohide]=setTimeout("gohide('" + which + "')",500);
}
///////// END 2ND PAGE DROPDOWN MENUS
var cellovercolor = '#8DAAE2';
var celloutcolor = '#5B85D6';

function inCell(cell){
//Changes Background Back To Previous Color
	if (!cell.contains(event.fromElement)){
		cell.bgColor = cellovercolor;
	}
}

function outCell(cell){	//Changes Background Back To Previous Color
	if (!cell.contains(event.toElement)){
		cell.bgColor = celloutcolor;
	}
}


function windowOpenUps(sURL, ht, wd){
	var newWindow;
	newWindow =	window.open(sURL,'product_window','height=' + ht + ',width=' + wd + ',status=no,toolbar=no,menubar=no,location=no,top=50px,left=50px,sizable=yes,scrollbars=yes',false);
	if (window.focus) {newWindow.focus()}
}

function windowOpenUp(sURL, ht, wd){
	sURL = "/fullsize.php?img=" + sURL;
	var newWindow;
	var winl = (screen.width - wd) / 2;
	var wint = (screen.height - ht) / 2;
	newWindow =	window.open(sURL,'product_window','height=' + ht + ',width=' + wd + ',top='+wint+',left='+winl+',status=no,toolbar=no,menubar=no,location=no,sizable=yes,scrollbars=yes',false);
	if (window.focus) {newWindow.focus()}
}

