	function openImage(filename) {
	    if (window.ImageWindow) ImageWindow.close();
		if (navigator.appName == 'Microsoft Internet Explorer') {
		    msgWindow=open("/viewImage.cfm?filename="+filename,"ImageWindow","toolbar=no,width=675,height=480,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=yes,top=0,left=0");
		} else { 
		    msgWindow=open("/viewImage.cfm?filename="+filename,"ImageWindow","toolbar=no,width=675,height=460,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no,screenX=0,screenY=0");
		}	
	    if (msgWindow.opener == null) msgWindow.opener = self;
		msgWindow.focus();
	}
	
var activeSub=0;
var SubNum=0;
var timerID = null;
var timerOn = false;
var timecount = 1000;
var what = null;
var newbrowser = true;
var check = false;

//function reDo(){ window.location.reload() }
// window.onresize = reDo;

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function init() {
	if (document.layers) {
		layerRef="document.layers";
		styleSwitch="";
		visibleVar="show";
		screenSize = window.innerWidth;
		what ="ns4";
	} else if(document.all) {
		layerRef="document.all";
		styleSwitch=".style";
		visibleVar="visible";
		screenSize = document.body.clientWidth + 18;
		what ="ie";
	} else if (document.getElementById) {
		layerRef="document.getElementByID";
		styleSwitch=".style";
		visibleVar="visible";
		what="moz";
	} else {
		what="none";
		newbrowser = false;
	}
check = true;
}

function showLayer(layerName, imageName) {
	if(check) {
		var coors = findPos(document.getElementById(imageName));
		var x = document.getElementById(layerName);
		x.style.top = (coors[1]-1) + 'px';
		x.style.left = (coors[0]+166) + 'px';

		if (what =="none") {
			return;
		}
		else if (what == "moz") {
			document.getElementById(layerName).style.visibility="visible";
		}
		else {
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
		}
	}
	else return; 
}

function hideLayer(layerName) {
	if(check) {
		if (what =="none") {
			return;
		}
		else if (what == "moz") {
			document.getElementById(layerName).style.visibility="hidden";
		}
		else {
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
		}
	}
	else return;
}

function startTime() {
	if (timerOn == false) {
		timerID=setTimeout( "hideAll()" , timecount);
		timerOn = true;
	}
}

function stopTime() {
	if (timerOn) {
		clearTimeout(timerID);
		timerID = null;
		timerOn = false;
	}
}

function onLoad() {
	init();
}
	
function Open_Freight() {
        win1 = window.open('/popup/dsp_freight.cfm','win1','toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no,border=no,width=540,height=230')
}

function Open_Tutorial() {
        win1 = window.open('/popup/dsp_help.cfm','win1','toolbar=yes,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,border=no,width=600,height=500')
}

function LoadWin(URL) {
	win1 = window.open(URL,'win1','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,border=no,width=440,height=290')
}

isQty = 0;

function chkEmpty(chk)
	{
		if (chk.value=="")
		{
			chk.value=1;
			isQty = isQty + 1;
			chk.select();
		}
		else
			chk.select();
	}

function order_form_reset() {
	form.user.value="";
	form.pass.value="";
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

