// JavaScript Document



////////////////////////////////////////////////////
//   Functions to HIDE / SHOW Element             //
////////////////////////////////////////////////////

var type = "NN";	//Variable used to hold the browser name

function BrowserSniffer() {
	if (navigator.userAgent.indexOf("Opera")!=-1 && document.getElementById) type="OP";		//Opera
	else if (document.all) type="IE";														//Internet Explorer e.g. IE4 upwards
	else if (document.layers) type="NN";													//Netscape Communicator 4
	else if (!document.all && document.getElementById) type="MO";							//Mozila e.g. Netscape 6 upwards
	else type = "IE";		//I assume it will not get here
}


function ShowLayer(id){
	BrowserSniffer();
	if (type=="IE") 
        {eval("document.all." + id + ".style.visibility='visible'");
         eval("document.all." + id + ".style.display='block'");
        }
	if (type=="NN") 
         {eval("document." + id + ".visibility='visible'");
          eval("document." + id + ".style.display='block'");
         }
	if (type=="MO" || type=="OP") 
         {eval("document.getElementById('" + id + "').style.visibility='visible'");
          eval("document.getElementById('" + id + "').style.display='block'");
         }
}

function HideLayer(id){
	BrowserSniffer();
	if (type=="IE") 
        {eval("document.all." + id + ".style.visibility='hidden'");
         eval("document.all." + id + ".style.display='none'");
        }
	if (type=="NN") 
        {eval("document." + id + ".visibility='hidden'");
         eval("document." + id + ".display='none'");
        }
	if (type=="MO" || type=="OP") 
        {eval("document.getElementById('" + id + "').style.visibility='hidden'");
         eval("document.getElementById('" + id + "').style.display='none'");
        }
}


	
////////////////////////////////////////////////////
//   popup window in center of user screen        //
//   using destination URL, width, and height     //
////////////////////////////////////////////////////

	function windowPopup(UrlLocation, windowWidth, windowHeight){ 
	
	var windowSizeX=400; <!-- default value -->
	var windowSizeY=400; <!-- default value -->
	var screenCenterHorizontal = 512; <!-- monitor screen width minus popup window size-->
	var screenCenterVertical = 359;

	BrowserSniffer();
	if (type=="IE") { // availwidth & availheight only works in IE 6.0x
		if ((windowWidth>0) && (windowWidth<=screen.availwidth)) { <!--Validate input Value -->
			windowSizeX = windowWidth;
			}
			else if (windowWidth>screen.availwidth) {
				windowSizeX = screen.availwidth;
			}
		if ((windowHeight>0) && (windowHeight<=screen.availheight)) { <!--Validate input Value -->
			windowSizeY = windowHeight;
			}
			else if (windowHeight>screen.availheight) {
				windowSizeY = screen.availheight;
			}
		screenCenterHorizontal=((screen.availwidth-windowSizeX)/2); <!-- centers window: Monitor screen width minus popup window size--> 
		screenCenterVertical=((screen.availheight-windowSizeY)/2); <!-- centers window: Monitor screen height minus popup window size-->
		}
		else { //all NON-IE browsers
			if ((windowWidth>0) && (windowWidth<=1024)){
				windowSizeX = windowWidth;
				}
			if ((windowHeight>0) && (windowHeight<=718)) {	
				windowSizeY = windowHeight;
				}
			screenCenterHorizontal = (1024-windowSizeX)/2;
			screenCenterVertical = (718-windowSizeY)/2;
		}
	popupWindow = eval("window.open(\'"+UrlLocation+"\',\'windowName\',\'width="+windowSizeX+", height="+windowSizeY+", top="+screenCenterVertical+", left="+screenCenterHorizontal+", toolbar=0, menubar=0, location=0, status=0, scrollbars=1, resizable=1"+"\');");
	popupWindow.self.focus();
	} 
	
	

////////////////////////////////////////////////////
//   Write today's date                           //
////////////////////////////////////////////////////

function writeTodaysDate(){
	
	var todaysDate=new Date();
	var charMonth = new Array() // used to write month, especially to convert January to "01"
	charMonth[0] = "01"
	charMonth[1] = "02"
	charMonth[2] = "03"
	charMonth[3] = "04"
	charMonth[4] = "05"
	charMonth[5] = "06"
	charMonth[6] = "07"
	charMonth[7] = "08"
	charMonth[8] = "09"
	charMonth[9] = "10"
	charMonth[10] = "11"
	charMonth[11] = "12"
	
	todaysDate.setDate(todaysDate.getDate()); 
	return (charMonth[todaysDate.getMonth()]+"/"+todaysDate.getDate()+"/"+todaysDate.getFullYear());  
	
}	

////////////////////////////////////////////////////
//   Write Year & Month                           //
////////////////////////////////////////////////////

function writeYearMonth(){
	
	var yearMonth=new Date();
	var charMonth = new Array() // used to write month, especially to convert January to "01"
		charMonth[0] = "01"
		charMonth[1] = "02"
		charMonth[2] = "03"
		charMonth[3] = "04"
		charMonth[4] = "05"
		charMonth[5] = "06"
		charMonth[6] = "07"
		charMonth[7] = "08"
		charMonth[8] = "09"
		charMonth[9] = "10"
		charMonth[10] = "11"
		charMonth[11] = "12"
	yearMonth.setDate(yearMonth.getDate()); 
	return (yearMonth.getFullYear()+""+charMonth[yearMonth.getMonth()]);  
	
}	


////////////////////////////////////////////////////
//   Dreamweaver's Popup Window                   //
////////////////////////////////////////////////////

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
