function changeVideo(theVideoURL){
	window.document.videoMaster.SetVariable("globalVideoName", theVideoURL);
	window.document.videoMaster.SetVariable("globalAction", "play");
	window.document.videoMaster.GotoFrame(2);
	window.document.videoMaster.Play();	
}

function stopVideo(){
	window.document.videoMaster.SetVariable("globalAction", "stop");
	window.document.videoMaster.GotoFrame(4);
	window.document.videoMaster.Play();	
}

function printPage() 
{
	if (window.print)
    	window.print();
	else
    	alert("Sorry, your browser doesn't support this feature.");
}

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_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_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];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

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 jump(sel) {
	var url = sel.options[sel.selectedIndex].value;
	if ( url != '#' ) top.location = url;
}

function openWindow(theURL,winName,features) {
  	window.open(theURL,winName,features).focus();
}



// Initialisies array for date
function isnArray() { 
	argnr = isnArray.arguments.length;
	for (var i = 0; i < argnr; i++) {
		this[i] = isnArray.arguments[i];
	}
}

// Function to display the date
function displayDate(wantYear) {
	//var months = new isnArray("","January","February","March","April","May","June","July","August","September","October","November","December");
	var months = new isnArray("","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	//var days = new isnArray("","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");				
	var days = new isnArray("","Sun","Mon","Tue","Wed","Thu","Fri","Sat");
	var dateObj = new Date(); // todays date
	//var hour = dateObj.getHours();
	//var min = ((dateObj.getMinutes() < 10) ? "0" : "") + dateObj.getMinutes();
	//var min = dateObj.getMinutes();
	//var sec = dateObj.getSeconds();
	var hour = dateObj.getHours()
	var min = dateObj.getMinutes()
	var sec = dateObj.getSeconds()
	var time = ((hour < 10) ? "0" : "") + hour + ":" + ((min < 10) ? "0" : "") + min
	// add this to the line above for seconds + ":" + ((sec < 10) ? "0" : "") + sec
	var wday = days[dateObj.getDay() + 1];
	var lmonth = months[dateObj.getMonth() + 1];
	var date = dateObj.getDate();
	var fyear = dateObj.getYear();
	if (fyear < 2000) {
		fyear = fyear + 1900;
	}
	if(wantYear=='noyear'){
		return(wday + " " + lmonth + " " + date +" " + time);
	}
	else if(wantYear=='timeonly'){
		return(time);
	}
	else if(wantYear=='houronly'){
		return(hour);
	}
	else{
		return(wday + ", " + lmonth + " " + date + ", " + fyear);
	}
}

function displayLayer( id, value )
{
    if ( document.getElementById )
    {
        document.getElementById( id ).style.display = value;
    }
    else if ( document.all )
    {
        document.all[ id ].style.display = value;
    }
}

function hide( id )
{
    displayLayer( id, 'none' );
}

function show( id )
{
    displayLayer( id, 'block' );
}


	function swapLayers(id) {
	 if (cur_lyr) hideLayer(cur_lyr);
		showLayer(id);
		cur_lyr = id;
}
		
function showLayer(id) {
	var lyr = getElemRefs(id);
	if (lyr && lyr.css) lyr.css.visibility = "visible";
}
		
function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "hidden";
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

