var nImg1 = new Image();
var nImg1_on = new Image();
var nImg2 = new Image();
var nImg2_on = new Image();
var winPointer;

winPointer = 0;
nImg1.src = "img/play.gif";
nImg1_on.src = "img/play_roll.gid";
nImg2.src = "img/download.gif";
nImg2_on.src = "img/download_roll.gif";


function ManipLayer(layername, bool)
{
if(document.all){
obj = "document.all."+layername+".style";
boolOn = "'visible'";
boolOff = "'hidden'";

(bool == "On")?visBool = boolOn:visBool = boolOff
action = obj+".visibility="+visBool+";"

eval(action)}
//(document.layers)?obj=layername+".document."+obj:obj = obj;
}


function openPopUp(whichDoc,w,h,scroll) {
	
		// set correct w and h according to platform and browser
	//offset_obj = get_window_offset();
	//w += offset_obj.x;
	//h += offset_obj.y;
	
if (navigator.platform.indexOf("Mac") > -1){

	//w = w - 15
	//h = h-35
}
thisTarget ="JJPopWin";

paramList = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0," + ",width=" + w + ",height=" + h;

window.open(whichDoc,thisTarget,paramList);	
	
}

function EMopenPopUp(whichDoc,w,h,scroll) {
if (navigator.platform.indexOf("Mac") > -1){
	//w = w - 10
	//h = h-10
}
thisTarget ="EMPopWin";
if (scroll == 1)
{
paramList = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0," + ",width=" + w + ",height=" + h;
}
else
{
paramList = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0," + ",width=" + w + ",height=" + h;
}

window.open(whichDoc,thisTarget,paramList);	

}


function swopenPopUp(whichDoc,w,h,scroll) {
thisTarget ="SWPopWin";

	// set correct w and h according to platform and browser
	//offset_obj = get_window_offset();
	//w += offset_obj.x;
	//h += offset_obj.y;
	

if (navigator.platform.indexOf("Mac") > -1){

	//w = w + 15
	//h = h + 15
}
if (scroll == 1)
{
paramList = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0," + ",width=" + w + ",height=" + h;
}
else
{
paramList = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0," + ",width=" + w + ",height=" + h;
}

winPointer = window.open(whichDoc,thisTarget,paramList);	


    // resize the window
	if ((navigator.appName.indexOf( "Microsoft" ) != -1 ) &&
	    ( navigator.appVersion.indexOf( "Win" ) != -1 )) { 
	    // make sure window is open before trying a resize.  Patch for IE4.x Win //
		if (!winPointer.closed) {
			//winPointer.resizeTo(w,h);
		}
	}else{
	    // IE4.x Mac will not resize an already open window, smaller than a certain threshold//
	    if (!winPointer.closed) {
			//winPointer.resizeTo(w,h);
		}
	}


}


function roll(obj,fname,bin,lname,exten)
{
window.status = "";
if((obj) && (fname) && (bin)){
	imgdir = "img/";
	docu="document.";
	(bin=="On")?tempstring = imgdir+"/"+fname+"_r."+exten : tempstring = imgdir+"/"+fname+"_n."+exten;
	(document.layers)?obj=lname+".document."+obj:obj = obj;
	eval(docu+obj+".src='"+tempstring+"';");
					}
}

