var ns6=document.getElementById&&!document.all
var ie4=document.all
var Selected_Month;
var Selected_Year;
var Current_Date = new Date();
var Current_Month = Current_Date.getMonth();
var Days_in_Month = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var Month_Label = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
var Current_Year = Current_Date.getYear();
if (Current_Year < 1000)
Current_Year+=1900
var Today = Current_Date.getDate();

function Header(Year, Month) {
   if (Month == 1) {
   Days_in_Month[1] = ((Year % 400 == 0) || ((Year % 4 == 0) && (Year % 100 !=0))) ? 29 : 28;
   }
   var Header_String = Month_Label[Month] + ' ' + Year;
   return Header_String;
}
function Make_Calendar(Year, Month) {
   var First_Date = new Date(Year, Month, 1);
   var Heading = Header(Year, Month);
   var First_Day = First_Date.getDay() + 1;
   if (((Days_in_Month[Month] == 31) && (First_Day >= 6)) ||
       ((Days_in_Month[Month] == 30) && (First_Day == 7))) {
      var Rows = 6;
   }
   else if ((Days_in_Month[Month] == 28) && (First_Day == 1)) {
      var Rows = 4;
   }
   else {
      var Rows = 5;
   }
   var HTML_String = '<table><tr><td valign="top"><table BORDER=0 CELLSPACING=0 cellpadding=2 BGCOLOR="292929">';
   HTML_String += '<tr><th colspan=7 class="cal-header">' + Heading + '</font></th></tr>';
   HTML_String += '<tr><th ALIGN="CENTER" class="cal-days">S</th><th ALIGN="CENTER" class="cal-days">M</th><th ALIGN="CENTER" class="cal-days">T</th><th ALIGN="CENTER" class="cal-days">W</th>';
   HTML_String += '<th ALIGN="CENTER" class="cal-days">T</th><th ALIGN="CENTER" class="cal-days">F</th><th ALIGN="CENTER" class="cal-days">S</th></tr>';
   var Day_Counter = 1;
   var Loop_Counter = 1;
   for (var j = 1; j <= Rows; j++) {
      HTML_String += '<tr ALIGN="left" VALIGN="top" class="cal-normalday">';
      for (var i = 1; i < 8; i++) {
         if ((Loop_Counter >= First_Day) && (Day_Counter <= Days_in_Month[Month])) {
		 /* if it's today */
            if ((Day_Counter == Today) && (Year == Current_Year) && (Month == Current_Month)) {
               HTML_String += '<td class="cal-today"><a href="javascript:openWindow(\'/events/tonight.php\', 455, 455);">' + Day_Counter + '</a></td>';
            }
			else {
               HTML_String += '<td class="cal-normalday">' + Day_Counter + '</td>';
            }
            Day_Counter++;    
         }
         else {
            HTML_String += '<td class="cal-noday"> </td>';
         }
         Loop_Counter++;
      }
      HTML_String += '</tr>';
   }
   HTML_String += '</table></td></tr></table>';
   cross_el=ns6? document.getElementById("Calendar") : document.all.Calendar
   cross_el.innerHTML = HTML_String;
}

function Check_Nums() {
   if ((event.keyCode < 48) || (event.keyCode > 57)) {
      return false;
   }
}

function On_Year() {
   var Year = document.when.year.value;
   if (Year.length == 4) {
      Selected_Month = document.when.month.selectedIndex;
      Selected_Year = Year;
      Make_Calendar(Selected_Year, Selected_Month);
   }
}

function On_Month() {
   var Year = document.when.year.value;
   if (Year.length == 4) {
      Selected_Month = document.when.month.selectedIndex;
      Selected_Year = Year;
      Make_Calendar(Selected_Year, Selected_Month);
   }
   else {
      alert('Please enter a valid year.');
      document.when.year.focus();
   }
}

function Defaults() {
   if (!ie4&&!ns6)
   return
   var Mid_Screen = Math.round(document.body.clientWidth / 2);
   document.when.month.selectedIndex = Current_Month;
   document.when.year.value = Current_Year;
   Selected_Month = Current_Month;
   Selected_Year = Current_Year;
   Make_Calendar(Current_Year, Current_Month);
}

function Skip(Direction) {
   if (Direction == '+') {
      if (Selected_Month == 11) {
         Selected_Month = 0;
         Selected_Year++;
      }
      else {
         Selected_Month++;
      }
   }
   else {
      if (Selected_Month == 0) {
         Selected_Month = 11;
         Selected_Year--;
      }
      else {
         Selected_Month--;
      }
   }
   Make_Calendar(Selected_Year, Selected_Month);
   document.when.month.selectedIndex = Selected_Month;
   document.when.year.value = Selected_Year;
}

/****************************************************
     Author: Eric King
     Url: http://redrival.com/eak/index.shtml
     This script is free to use as long as this info is left in
     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/

var win=null;

function NewWindow(mypage,myname,w,h,scroll,pos){

if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}

if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}

else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}

settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';

win=window.open(mypage,myname,settings);}

function VTWindow()	{
	NewWindow("/events/tonight.php",'victonight','455','300','yes','center');
	return false;
}

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.0
	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 && document.getElementById) x=document.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];}
}
//-->

// left menu code
		var abc = "";
		var visibleVar="null";
		var position="null";

		if (navigator.appName == "Netscape") {
			layerStyleRef="layer.";
			layerRef="document.layers";
			styleSwitch="";
			visibleVar="show";
			abc="relative";
			trans = 0;
		}else{
			layerStyleRef="layer.style.";
			layerRef="document.all";
			styleSwitch=".style";
			visibleVar="visible";
			abc="static";
			trans = 0;
		}
		function showLayer(layerName){
			if ((layerName == 'hotspots')){
			  eval(layerRef+'["features"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["community"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["members"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["services"]'+styleSwitch+'.visibility="hidden"');
			}
			if ((layerName == 'features')){
			  eval(layerRef+'["hotspots"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["community"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["members"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["services"]'+styleSwitch+'.visibility="hidden"');
			}
			if ((layerName == 'community')){
			  eval(layerRef+'["hotspots"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["features"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["members"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["services"]'+styleSwitch+'.visibility="hidden"');
			}
			if ((layerName == 'members')){
			  eval(layerRef+'["hotspots"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["features"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["community"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["services"]'+styleSwitch+'.visibility="hidden"');
			}
			if ((layerName == 'services')){
			  eval(layerRef+'["hotspots"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["features"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["community"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["members"]'+styleSwitch+'.visibility="hidden"');
			}
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
			eval(layerRef+'["main"]'+styleSwitch+'.visibility="hidden"');
		}

		function hideLayer(layerName){
			if ((layerName == 'close')){
			  eval(layerRef+'["hotspots"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["features"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["community"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["members"]'+styleSwitch+'.visibility="hidden"');
			  eval(layerRef+'["services"]'+styleSwitch+'.visibility="hidden"');
			}
			eval(layerRef+'["main"]'+styleSwitch+'.visibility="visible"');
		}
// end left menu code