var type = "IE";	//Variable used to hold the browser name
var largeFont = '18px';
var smallFont = '14px';
var rightMargin = '40px';
var leftMargin = '15px';
var topMargin = '40px';
var path = '../';
var playText = '';
function DoOnLoad() {
BrowserSniffer();       // Determine browser type
setTimeout("ShowLayer('divPageFlip','hidden')",2500);
try{
	var flashText = '';
	var musicText = '';
	var zoomText = '';
	if (isHome){
	   path = './';
	}
	else{
	   path = '../';
	}
        if (soundOn != 0){
	   if (parent.frames[0].VoiceOn > 0) {
        	<!--  onMouseOver="F_roll(\'XMusicButton\',1)" onMouseOut="F_roll(\'XMusicButton\',0)" -->
	      musicText = '<A onMouseOver="F_roll(\'XMusicButton\',1)" onMouseOut="F_roll(\'XMusicButton\',0)" onClick="ToggleVoice();"><IMG ID="XMusicButton" NAME="XMusicButton" border="0" src="' + path + 'assets/images/SoundOn.gif" width="26" height="22" onLoad="F_loadRollover(this,\'SoundOnH.gif\',0)" BORDER=0  ALT="Turn Sound Off" ></A>';
	   }
	   else {
	       <!--   onMouseOver="F_roll(\'XMusicButton\',1)" onMouseOut="F_roll(\'XMusicButton\',0)" -->
	      musicText = '<A onMouseOver="F_roll(\'XMusicButton\',1)" onMouseOut="F_roll(\'XMusicButton\',0)" onClick="ToggleVoice();"><IMG ID="XMusicButton" NAME="XMusicButton" border="0" src="' + path + 'assets/images/SoundOff.gif" width="26" height="22" onLoad="F_loadRollover(this,\'SoundOffH.gif\',0)" BORDER=0  ALT="Turn Sound On" ></A>';
	   }
	   }
         else { 	    
	 if (soundFile != ''){
	   if (parent.frames[0].MusicOn > 0) {
        	<!--  onMouseOver="F_roll(\'XMusicButton\',1)" onMouseOut="F_roll(\'XMusicButton\',0)" -->
	      musicText = '<A onMouseOver="F_roll(\'XMusicButton\',1)" onMouseOut="F_roll(\'XMusicButton\',0)" onClick="ToggleMusic();"><IMG ID="XMusicButton" NAME="XMusicButton" border="0" src="' + path + 'assets/images/MusicOn.gif" width="26" height="22" onLoad="F_loadRollover(this,\'MusicOnH.gif\',0)" BORDER=0  ALT="Turn Music Off" ></A>';
              playText = '<EMBED SRC="' + soundFile + '" HIDDEN="true" NAME="foobar">';
//		document.all.tags("bgsound")[0].volume = 0;
//		document.all.tags("bgsound")[0].src = soundfile;
//              playText = '<BGSOUND SRC="' + soundFile + '">';
ChangeVolume("bgsound", 0)
	   }
	   else {
	       <!--   onMouseOver="F_roll(\'XMusicButton\',1)" onMouseOut="F_roll(\'XMusicButton\',0)" -->
	      musicText = '<A onMouseOver="F_roll(\'XMusicButton\',1)" onMouseOut="F_roll(\'XMusicButton\',0)" onClick="ToggleMusic();"><IMG ID="XMusicButton" NAME="XMusicButton" border="0" src="' + path + 'assets/images/MusicOff.gif" width="26" height="22" onLoad="F_loadRollover(this,\'MusicOffH.gif\',0)" BORDER=0  ALT="Turn Music On" ></A>';
//		document.all.tags("bgsound")[0].volume = -10000;
//		document.all.tags("bgsound")[0].src = '';
              playText = '';
ChangeVolume("bgsound", -10000)
	   }
	 }
         else {
  	    musicText = '<IMG ID="XMusicButton" NAME="XMusicButton" border="0" src="' + path + 'assets/images/SoundX.gif" width="26" height="22">';
  	 }
//	   ChangeContent('divSound', playText)
	}
	ChangeContent('divMusic', musicText)

  	    
	 if (hasZoom != 0){
	   if (parent.frames[0].ZoomOn > 0) {
        	<!--  onMouseOver="F_roll(\'XZoomButton\',1)" onMouseOut="F_roll(\'XZoomButton\',0)" -->
	      zoomText = '<A onMouseOver="F_roll(\'XZoomButton\',1)" onMouseOut="F_roll(\'XZoomButton\',0)" onClick="ToggleZoom();"><IMG ID="XZoomButton" NAME="XZoomButton" border="0" src="' + path + 'assets/images/ZoomOn.gif" width="27" height="22" onLoad="F_loadRollover(this,\'ZoomOnH.gif\',0)" BORDER=0  ALT="Zoom Out" ></A>';
	      changeFontsize(largeFont,"0%","0%")
//              changeFontsizeID("stations","18px")
	   }
	   else {
	       <!--   onMouseOver="F_roll(\'XZoomButton\',1)" onMouseOut="F_roll(\'XZoomButton\',0)" -->
	      zoomText = '<A onMouseOver="F_roll(\'XZoomButton\',1)" onMouseOut="F_roll(\'XZoomButton\',0)" onClick="ToggleZoom();"><IMG ID="XZoomButton" NAME="XZoomButton" border="0" src="' + path + 'assets/images/ZoomOff.gif" width="27" height="22" onLoad="F_loadRollover(this,\'ZoomOffH.gif\',0)" BORDER=0  ALT="Zoom In" ></A>';
              changeFontsize(smallFont,leftMargin,rightMargin)
//              changeFontsizeID("stations","14px")
	   }
	 }
         else {
  	    zoomText = '<IMG ID="XZoomButton" NAME="XZoomButton" border="0" src="' + path + 'assets/images/ZoomX.gif" width="27" height="22">';
  	 }
	 ChangeContent('divZoom', zoomText)


	if (parent.frames[0].HasFlash == 0) {
	   flashText = flashText + '<IMG HEIGHT=24 WIDTH=256 SRC="' + path + 'assets/images/RCC.gif" BORDER=0  ALT="" ></IMG>';
	}
	else {
	   flashText = flashText + '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"';
           flashText = flashText + ' WIDTH="256" HEIGHT="24" id="Fade" ALIGN="">';
           flashText = flashText + ' <PARAM NAME=movie VALUE="' + path + 'assets/flash/FadeIn.swf"> <PARAM NAME=loop VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#082952>'; 
           flashText = flashText + ' <EMBED src="' + path + 'assets/flash/FadeIn.swf" quality=high bgcolor=#0A2F52  WIDTH="256" HEIGHT="24" NAME="Fade" ALIGN="RIGHT" LOOP="false"';
           flashText = flashText + ' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
	}
	ChangeContent('divFlash', flashText)
   }
catch(e){
 alert(e.description);
   }

}
//turns Music On and Off
function ToggleMusic() {
     parent.frames[0].MusicOn += 1;
     parent.frames[0].MusicOn %= 2;

	   if (parent.frames[0].MusicOn > 0) {
	      musicText = '<A onMouseOver="F_roll(\'XMusicButton\',1)" onMouseOut="F_roll(\'XMusicButton\',0)" onClick="ToggleMusic();"><IMG ID="XMusicButton" NAME="XMusicButton" border="0" src="' + path + 'assets/images/MusicOn.gif" width="26" height="22" onLoad="F_loadRollover(this,\'MusicOnH.gif\',0)" BORDER=0  ALT="Turn Music Off" ></A>';
              playText = '<EMBED SRC="' + soundFile + '" HIDDEN="true" NAME="foobar">';

//		document.all.tags("bgsound")[0].volume = 0;
//		document.all.tags("bgsound")[0].src = soundfile;
ChangeVolume("bgsound", 0)
//              playText = '<BGSOUND SRC="' + soundFile + '">';
	   }
	   else {
	      musicText = '<A onMouseOver="F_roll(\'XMusicButton\',1)" onMouseOut="F_roll(\'XMusicButton\',0)" onClick="ToggleMusic();"><IMG ID="XMusicButton" NAME="XMusicButton" border="0" src="' + path + 'assets/images/MusicOff.gif" width="26" height="22" onLoad="F_loadRollover(this,\'MusicOffH.gif\',0)" BORDER=0  ALT="Turn Music On" ></A>';

//		document.all.tags("bgsound")[0].volume = -10000;
//		document.all.tags("bgsound")[0].src = '';
ChangeVolume("bgsound", -10000)
              playText = '<!--     -->';
	   }
	   ChangeContent('divMusic', musicText)
//	   ChangeContent('divSound', playText)
}

//turns Voice On and Off
function ToggleVoice() {
     parent.frames[0].VoiceOn += 1;
     parent.frames[0].VoiceOn %= 2;

	   if (parent.frames[0].VoiceOn > 0) {
	      musicText = '<A onMouseOver="F_roll(\'XMusicButton\',1)" onMouseOut="F_roll(\'XMusicButton\',0)" onClick="ToggleVoice();"><IMG ID="XMusicButton" NAME="XMusicButton" border="0" src="' + path + 'assets/images/SoundOn.gif" width="26" height="22" onLoad="F_loadRollover(this,\'SoundOnH.gif\',0)" BORDER=0  ALT="Turn Sound Off" ></A>';
	   }
	   else {
	      musicText = '<A onMouseOver="F_roll(\'XMusicButton\',1)" onMouseOut="F_roll(\'XMusicButton\',0)" onClick="ToggleVoice();"><IMG ID="XMusicButton" NAME="XMusicButton" border="0" src="' + path + 'assets/images/SoundOff.gif" width="26" height="22" onLoad="F_loadRollover(this,\'SoundOffH.gif\',0)" BORDER=0  ALT="Turn Sound On" ></A>';
	   }
	   ChangeContent('divMusic', musicText)
}


//turns Zoom In and Out
function ToggleZoom() {
     parent.frames[0].ZoomOn += 1;
     parent.frames[0].ZoomOn %= 2;
	   var zoomText = '';
	   if (parent.frames[0].ZoomOn > 0) {
	      zoomText = '<A onMouseOver="F_roll(\'XZoomButton\',1)" onMouseOut="F_roll(\'XZoomButton\',0)" onClick="ToggleZoom();"><IMG ID="XZoomButton" NAME="XZoomButton" border="0" src="' + path + 'assets/images/ZoomOn.gif" width="27" height="22" onLoad="F_loadRollover(this,\'ZoomOnH.gif\',0)" BORDER=0  ALT="Zoom Out" ></A>';
	      changeFontsize(largeFont,"0%","0%")
	   }
	   else {
	      zoomText = '<A onMouseOver="F_roll(\'XZoomButton\',1)" onMouseOut="F_roll(\'XZoomButton\',0)" onClick="ToggleZoom();"><IMG ID="XZoomButton" NAME="XZoomButton" border="0" src="' + path + 'assets/images/ZoomOff.gif" width="27" height="22" onLoad="F_loadRollover(this,\'ZoomOffH.gif\',0)" BORDER=0  ALT="Zoom In" ></A>';
              changeFontsize(smallFont,leftMargin,rightMargin)
	   }
	   ChangeContent('divZoom', zoomText)
}

//detects the capabilities of the browser
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 = "OP";		//I assume it will not get here
}


//Puts the contents of str into the layer id
// parameter id is the name of the layer
// parameter str is the required content
//Note: Works with all browsers except Opera
function ChangeContent(id, str) {
	if (type=="IE") {
		document.all[id].innerHTML = str;
	}
	if (type=="NN") { 
		document.layers[id].document.open();
		document.layers[id].document.write(str);
		document.layers[id].document.close();
	}
	if (type=="MO") {
		document.getElementById(id).innerHTML = str;
	}
}

//Change the volume of the background sound <BGSound>
// parameter id is the name of the tag 
// parameter volume is the required volume
//Note Works with all browsers supporting <BGSound>
function ChangeVolume(id, volume){
	try{
	   if (type=="IE"){
		 document.all.tags("bgsound")[0].volume=volume;
	   }
	   else{
		ChangeContent('divSound', playText)
	   }
	}
	catch(e){
	}
}


//Change the color of the layer background
// parameter id is the name of the layer
// parameter color is the required color
//Note Works with all browsers except NN4
function ChangeLayerBgColor(id, color){
	if (type=="IE") document.all[id].style.backgroundColor=color;
	if (type=="NN") document.layer['id'].bgColor=color;
	if (type=="MO" || type=="OP") document.getElementById(id).style.backgroundColor=color;
}

function changeFontsize(fSize,leftmargin,rightmargin) {
try{
  if (document.getElementsByTagName) {
    var getElement = document.getElementsByTagName("table");
    var eachElement;
    for (i=0; i<getElement.length; i++) {
      eachElement = getElement[i];
	if (eachElement.className == 'Format'){
	    var parElement = eachElement.getElementsByTagName("p");
    	    var paragraph;
    		for (j=0; j<parElement.length; j++) {
      		   paragraph = parElement[j];			
      	    	   paragraph.style.fontSize = fSize;
      	    	   paragraph.style.marginRight = rightmargin;
      	    	   paragraph.style.marginLeft = leftmargin;
		}
	    parElement = eachElement.getElementsByTagName("ol");
    		for (j=0; j<parElement.length; j++) {
      		   paragraph = parElement[j];			
      	    	   paragraph.style.fontSize = fSize;
      	    	   paragraph.style.marginRight = rightmargin;
      	    	   paragraph.style.marginLeft = leftmargin;
		}
	    parElement = eachElement.getElementsByTagName("ul");
    		for (j=0; j<parElement.length; j++) {
      		   paragraph = parElement[j];			
      	    	   paragraph.style.fontSize = fSize;
      	    	   paragraph.style.marginRight = rightmargin;
      	    	   paragraph.style.marginLeft = leftmargin;
		}
	}
    }
  }
}
catch(e){

}
}

//Show and hide a layer 
// parameter id is the name of the layer
// parameter action is either hidden or visible
//Note Seems to work with all versions NN4 plus other browsers
function ShowLayer(id, action){
	if (type=="IE") eval("document.all." + id + ".style.visibility='" + action + "'");
	if (type=="NN") eval("document." + id + ".visibility='" + action + "'");
	if (type=="MO" || type=="OP") eval("document.getElementById('" + id + "').style.visibility='" + action + "'");
}

function GotoPage(redirect) {
//    parent.parent.frames[0].beenHere = 0;
     parent.location = redirect;
}
function LinkTo(redirect) {
     parent.frames[0].redirect = redirect;
     parent.frames[1].location = path + 'html/linkframeX.htm';	
}
function LinkToRead(redirect) {
     parent.frames[0].redirect = redirect;
     parent.frames[1].location = path + 'html/readframe.htm';	
}
function FlashTo(flashfile) {
     parent.frames[0].flashfile = flashfile;
     parent.frames[1].location = "flashit.htm";	
}
function ConvertIt(){
	var strdate = document.FDate.RDate.value;
	var listArray = strdate.split("/");
	var number = listArray[0];
            number--;
	parent.parent.frames[0].cDate = new Date(listArray[2],number,listArray[1]);
	DateToString();
}
function DateToString(){
	var strmon = parent.parent.frames[0].cDate.getMonth()+ 1;
	strdate =  strmon.toString() + '/' + parent.parent.frames[0].cDate.getDate() + '/' + parent.parent.frames[0].cDate.getYear();
	document.FDate.RDate.value = strdate;
}
function AddDay(number){
	var secondsInDay = 86400;
	var intDate = parent.parent.frames[0].cDate.valueOf();
	if (number == 7) number =  7 - parent.parent.frames[0].cDate.getDay();	 
	if (number == -7) number =  -parent.parent.frames[0].cDate.getDay();
	if (number == 0) number =  -7;
	intDate += (number * secondsInDay * 1000);
	var sunday = new Date(intDate);
	parent.parent.frames[0].cDate = sunday;
	DateToString();
}
function FindIt(){
	var strmon = parent.parent.frames[0].cDate.getMonth() + 101;
	strmon = strmon.toString();
	var strday = parent.parent.frames[0].cDate.getDate() + 100;
	strday = strday.toString();
        var stryear = parent.parent.frames[0].cDate.getYear();
	stryear = stryear.toString();
	var redirect = "http://www.nccbuscc.org/nab/";
        redirect += strmon.substr(1,2) + strday.substr(1,2) + stryear.substr(2,2) + ".htm";
 	parent.frames[1].location = redirect;	
}
