//Swap Sub Nav Images
	function swap_subnav(dir, imgname, status){
		document.images[imgname].src=dir+"images/interface/"+imgname+status+".gif";
	}

//Swap Sub Nav Images - for Diesel Pusher Page
	function swap_tab(dir, imgname, status){
		document.images[imgname].src=dir+imgname+status+".gif";
	}


function 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 showHideLayers() { //v6.0
var i,p,v,obj,args=showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3)
  if ((obj=findObj(args[i]))!=null) {
	 v=args[i+2];
	 if (obj.style) {
		obj=obj.style;
		v=(v=='show')?'visible':(v=='hide')?'hidden':v;
	 }
	 obj.zIndex = 60;
	 obj.visibility=v;
  };
}

//PopUp Window
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=620,height=500,left = 212,top = 134');");
}

function popPrintUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=790,height=600,left = 212,top = 134');");
}


function popUpWin(url, type, strWidth, strHeight){
	
	
	closeWin();
	
	if (type == "fullScreen"){
		strWidth = screen.availWidth - 10;
		strHeight = screen.availHeight - 160;
	}
	
	var tools="";
	if (type == "standard" || type == "fullScreen") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+",top=0,left=0";
	if (type == "console") tools = "resizable,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left=0,top=0";
	
	newWindow = window.open(url, 'newWin', tools);
	//newWindow.focus();
}


function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=1,width=660,height=550,left = 171,top = 110');");
}

//Show and hide the "options" div

olddiv="";
function dsp(loc){
	if(olddiv!="" && olddiv!=loc){
		thediv=olddiv;
		olddiv="";
		dsp(thediv);
	}
   if(document.getElementById){
	   if(olddiv==loc){olddiv="";}
	   else{olddiv=loc;}
      var foc=document.getElementById(loc);
      foc.style.display=foc.style.display=='block'?'none':'block';
	}
}


// FADE IN

var opacity = 0;
var toFadeIn = null;
var fadeOutInterval = null;

function fadeIn () {
  if (opacity < 100) {
    opacity     += 10;
    opacityTemp  = opacity / 100;
    for (i = 0; i < toFadeIn.length; i++) {
      currentElement = document.getElementById(toFadeIn[i]);
      if (currentElement.filters)
        currentElement.filters.alpha.opacity = opacity; // Internet Explorer
      currentElement.style.MozOpacity = opacityTemp;    // Firefox < 0.9
      currentElement.style.KhtmlOpacity = opacityTemp;  // Konqueror, Safari
      currentElement.style.opacity = opacityTemp;       // CSS3
    }
  } else {
      clearInterval(fadeInInterval);
  }
}

function startFadeIn (elements) {
  toFadeIn = elements;
  fadeInInterval = setInterval("fadeIn()", 25);
}


//FADE OUT START


var opacity = 0;
var toFadeOut = null;
var fadeOutInterval = null;

function fadeOut () {
  if (opacity > 0) {
    opacity     -= 10;
    opacityTemp  = opacity / 100;
    for (i = 0; i < toFadeOut.length; i++) {
      currentElement = document.getElementById(toFadeOut[i]);
      if (currentElement.filters)
        currentElement.filters.alpha.opacity = opacity; // Internet Explorer
      currentElement.style.MozOpacity = opacityTemp;    // Firefox < 0.9
      currentElement.style.KhtmlOpacity = opacityTemp;  // Konqueror, Safari
      currentElement.style.opacity = opacityTemp;       // CSS3
    }
  } else {
      clearInterval(fadeOutInterval);
  }
}

function winBRopen(theURL, Name, popW, popH, scroll) { // V 1.0
	if (theURL != ""){
		var winleft = (screen.width - popW) / 2;
		var winUp = (screen.height - popH) / 2;
		winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable=no'
		var Win = window.open(theURL, Name, winProp)
		//if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }
	}
}
