/*
	this js file controls the rollover functions
	as well as the pop-up window.

*/

// get Images for index rollovers
ext1 = new Image(); 
ext1.src = "img/extrusion1.gif";
fab1 = new Image(); 
fab1.src = "img/fab1.gif";
inject1 = new Image(); 
inject1.src = "img/inject_2.gif";
low1 = new Image(); 
low1.src = "img/lowcost1.gif";
wireless1 = new Image(); 
wireless1.src = "img/wirelesspackaging.gif";
proto1 = new Image(); 
proto1.src = "img/proto1.gif";
rot1 = new Image(); 
rot1.src = "img/rot1.gif";
sheet1 = new Image(); 
sheet1.src = "img/rod1.gif";
vacuum1 = new Image();
vacuum1.src = "img/vacuum1.gif";
contact1 = new Image(); 
contact1.src = "img/cellbattery.gif";
home = new Image(); 
home.src = "img/cellbattery.gif";
stamp1 = new Image();
stamp1.src= "img/stamp.gif";


// find the browser
var browser = navigator.appName;
var ie;
if (browser == "Microsoft Internet Explorer"){
	ie = true;
}else{
	ie = false;
}
//alert(document.title);

// this function changes the bgcolor for mouseovers
function ChangeBg(cell,what){
	var TheCell = cell;
	var DoWhat = what;
	var isIndex;

	if (document.title == "Plasticworks, Inc"){
		isIndex = true;	
	
	}else{
		isIndex = false;
	}
	
	
	if (ie){
		if (DoWhat == "clear"){
			var theTD = document.getElementById(TheCell);
			theTD.style.backgroundColor="";
			if (isIndex){
				iImage.src = home.src;
			}
		}else{
			var theTD = document.getElementById(TheCell);
			theTD.style.backgroundColor="#333366";
			if (isIndex){
				var p = TheCell + "1";
				iImage.src = eval(p + ".src");
				
			}
			
		}
	}
	
}


// writes the Copyright Info
function writeCopy(){
	var theDate = new Date();
	var yDate = theDate.getYear();
	if (ie){
		document.write('Copyright &copy; '+ yDate + ', Plasticworks, Inc.' );
	}else{
		document.write('Copyright &copy; 2002, Plasticworks, Inc.' );
	}
}

// opens pop-up window 
function openWin(url){
	var URL = url + '.htm';
	var xHeight = screen.height/2 - 110;
	var yWidth = screen.width/2 - 115;
	window.open(URL,null,'width=200, height=220, scollbars=0, border=0,menu=no,location=no,top='+xHeight+',left='+yWidth+',screenX='+xHeight+',screenY='+yWidth+'');
}

// launches URL
function openURL(url,wid,hei){
	window.open(url,null,'width='+wid+', height='+hei+', scollbars=0, border=0,menu=no,location=no');
}


