// Target Browser function
var pre_w3c = false;
var isMac = false;
var isNS = false;
if(typeof(printable) == "undefined"){
	printable = -1;
}

// Edit function variables
var selectedFormName = "";

w3c();
checkPrint();

function w3c()  { 
	if(navigator.appVersion.indexOf( "Macintosh" ) != -1){
		isMac = true;
	}
			
  if (navigator.appName.indexOf("Netscape") != -1) {
   var version = navigator.appVersion
    var subVersion = version.substring(0,3)
    var subVersion_p = parseFloat(subVersion)
     if (subVersion_p < 5)  {
        //document.layers[0].visibility = "show"
		pre_w3c = true;
		isNS = true;
    }  
  }   
 if (navigator.appName.indexOf("Explorer") != -1) {
    var version = navigator.appVersion
    var subVersion = version.substring(22,25)
    var subVersion_p = parseFloat(subVersion)
     if (subVersion_p < 5)  {
       //document.all.w_ie.style.visibility = "visible"
	   pre_w3c = true;
	   isNS = false;
  }  
  }   
}  

// Printing
function checkPrint(){
	var tempString = location.search;
	if(tempString == ""){
		printable = -1;
	}else{
		printable = 1;
		if (window.print) {
			window.print();
		}
	}
}

// Date variables

var day="";
var month="";
var ampm="";
var ampmhour="";
var myweekday="";
var year="";
mydate = new Date();
myday = mydate.getDay();
mymonth = mydate.getMonth();
myweekday= mydate.getDate();
weekday= myweekday;
myyear= mydate.getFullYear();
year = myyear;
myhours = mydate.getHours();
ampmhour  =  (myhours > 12) ? myhours - 12 : myhours;
ampm =  (myhours >= 12) ? ' PM' : ' AM';
mytime = mydate.getMinutes();
myminutes =  ((mytime < 10) ? ':0' : ':') + mytime;
if(myday == 0)
day = " Sunday, ";
else if(myday == 1)
day = " Monday, ";
else if(myday == 2)
day = " Tuesday, ";
else if(myday == 3)
day = " Wednesday, ";
else if(myday == 4)
day = " Thursday, ";
else if(myday == 5)
day = " Friday, ";
else if(myday == 6)
day = " Saturday, ";
if(mymonth == 0) {
month = "January ";}
else if(mymonth ==1)
month = "February ";
else if(mymonth ==2)
month = "March ";
else if(mymonth ==3)
month = "April ";
else if(mymonth ==4)
month = "May ";
else if(mymonth ==5)
month = "June ";
else if(mymonth ==6)
month = "July ";
else if(mymonth ==7)
month = "August ";
else if(mymonth ==8)
month = "September ";
else if(mymonth ==9)
month = "October ";
else if(mymonth ==10)
month = "November ";
else if(mymonth ==11)
month = "December ";

// Open window functions

var newWindow = null;


function openWindow(page,width,height,sbars) {
	if (newWindow != null){
		if(navigator.appName.indexOf("Netscape")>=0){
			if(newWindow.name){
				newWindow.close();
			}
		}else{
			// IE on Mac doesn't like this
			if(!isMac){
				newWindow.close();
			}
		}
	}
	newWindow = window.open("", "newWin", "width=" + width + ",height=" + height + ",screenX=0,screenY=0,top=0,left=0,status=no,toolbar=no,menubar=no,location=no,scrollbars=" + sbars + ",resizable=yes");
	newWindow.location.href = page;
	if (newWindow.opener == null) newWindow.opener = window;

}

function openWindow2(page,width,height,sbars) {
	if (newWindow != null){
		if(navigator.appName.indexOf("Netscape")>=0){
			if(newWindow.name){
		 		newWindow.close();
			}
		}else{
			newWindow.close();
		}
	}
	newWindow = window.open("", "newWin", "width=" + width + ",height=" + height + ",screenX=0,screenY=0,top=0,left=0,status=yes,toolbar=yes,menubar=yes,location=yes,scrollbars=" + sbars + ",resizable=yes");
	newWindow.location.href = page;
	if (newWindow.opener == null) newWindow.opener = window;

}

function openWindow_nobars(page,width,height,sbars) {
	if (newWindow != null){
		if(navigator.appName.indexOf("Netscape")>=0){
			if(newWindow.name){
		 		newWindow.close();
			}
		}else{
			newWindow.close();
		}
	}
	newWindow = window.open("", "newWin", "width=" + width + ",height=" + height + ",screenX=0,screenY=0,top=0,left=0,status=yes,toolbar=yes,menubar=no,location=no,scrollbars=" + sbars + ",resizable=yes");
	newWindow.location.href = page;
	if (newWindow.opener == null) newWindow.opener = window;

}

function closeWindow(){
	window.close();
	return true;
}

// DW Behavior functions


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_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_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];}
}
