
bgcolor="#cccccc";  
fgcolor="#000000";

// work-around for shitty ff css absolute positioning
var name=navigator.appName;
if (name.indexOf('Microsoft') != 0) {
  //not ie
  ie=false;
}else{
	//is ie  
  ie=true;
}

// show links
document.write("<div style='color:#ffffff;font-family:arial;font-size:10pt;margin-top:0'>");
if(ie){
	document.write("<h4>site resources:</h4>");
}else{
	document.write("<span style='font-size:12pt;font-weight:bold'>site resources:</span><p>");
}	
document.write("<a class='navClass' href='#' onMouseover='ddInternet()' onMouseOut='show(\"menuDiv\",0)'>internet</a> :: ");
document.write("<a class='navClass' href='#' onMouseover='ddServices()' onMouseout='show(\"menuDiv\",0)'>services</a> :: ");
document.write("<a class='navClass' href='#' onMouseover='ddProducts()' onMouseout='show(\"menuDiv\",0)'>products</a> :: ");
document.write("<a class='navClass' href='#' onMouseover='ddLocations()' onMouseout='show(\"menuDiv\",0)'>locations</a> :: ");
document.write("<a class='navClass' href='#' onClick='loadFrame(\"http://www.nbson.com/paybill.htm\",\"1400\")'>pay your bill</a> :: ");
document.write("<a class='navClass' href='#' onMouseover='ddCheckEmail()' onMouseout='show(\"menuDiv\",0)'>check email</a> :: ");
document.write("<a class='navClass' href='#' onClick='loadFrame(\"about.htm\",\"500\")'>about NBS</a> <p> ");
document.write("<a class='navClass' href='#' onClick='loadFrame(\"support.htm\",\"500\")'>support</a> :: ");
document.write("<a class='navClass' href='#' onClick='loadFrame(\"contact.htm\",\"500\")'>contact</a> :: ");
document.write("<a class='navClass' href='#' onClick='loadFrame(\"towerStatus.htm\",\"500\")'>system status</a> :: ");
document.write("<a class='navClass' href='#' onClick='loadFrame(\"news.htm\",\"500\")'>news</a> :: ");
document.write("<a class='navClass' href='#' onClick='loadFrame(\"misc.htm\",\"500\")'>links</a> :: ");
document.write("<a class='navClass' href='#' onClick='loadFrame(\"affiliates.htm\",\"500\")'>affiliate links</a> :: ");
document.write("<a class='navClass' href='#' onClick='loadFrame(\"privacypolicy.html\",\"520\")'>privacy policy</a> :: ");
document.write("<a class='navClass' onClick='setHomeBG(1)' href='index.html?ver="+genNumbers()+"'>home</a> ");
document.write("</div>");

// set background picture on/off
// n=1 on
// n=0 (not 1) off
function setHomeBG(n){
	// this function doesn't work with google maps because
	// we're no longer using a front page image
	return;
	
	var d=document.getElementById("contentDiv");
	
	if(n==1){
		d.style.backgroundImage="url(images/fadeMap.jpg)";
		d.style.backgroundRepeat="no-repeat";
	}else{
		d.style.backgroundImage="url(images/spacer.gif)";
		d.style.backgroundRepeat="no-repeat";		
	}	

}

// internet menu
function ddInternet(){
  var menu=document.getElementById("menuDiv");
  var temp="";
    // show menu
		temp+=space(3)+"<a class='mClass' href='#' onClick='loadFrame(\"wireless.htm\",\"1800\")'>High-speed wireless</a><br>";
		temp+=space(3)+"<a class='mClass' href='#' onClick='loadFrame(\"dialup.htm\",\"1280\")'>Dialup</a><br>";
		temp+=space(3)+"<a class='mClass' href='#' onClick='loadFrame(\"aup.htm\",\"5600\")'>AUP</a><br>";
		menu.innerHTML=temp;
		menu.style.background=bgcolor;
		menu.style.foreground=fgcolor;
		menu.style.visibility="visible";
		menu.style.position="absolute";
		if(ie){
			menu.style.top="195px";
			menu.style.left="28px";
	  }else{
			menu.style.top="184px";
			menu.style.left="26px";	  	
	  }		
	  menu.style.width="150px";
}


// loads external htm file into frame
// fName=file name to load
// h = height of frame
function loadFrame(fName,h){
	setHomeBG(0);
	var cd=document.getElementById("contentDiv");
	cd.style.height=500;	
	cd.style.background="#fff";
	if(!ie){
			cd.style.height=h;
	}
	var temp="<iframe name='contentFrame' id='contentFrame' frameborder='0' src='"+fName+"' width='100%' height='"+h+"' ></iframe>";
	cd.innerHTML=temp;
}

// product menu
function ddProducts(){
  var menu=document.getElementById("menuDiv");
  var temp="";
  // sent divContent inside
    // show menu
    temp+=space(3)+"<a class='mClass' href='#' onClick='loadFrame(\"http://www.nbson.com/partlist.htm\",\"570\")'>Computer Parts</a><br>";
		temp+=space(3)+"<a class='mClass' href='#' onClick='loadFrame(\"http://www.nbson.com/systems\",\"570\")'>Computer System Builder</a><br>";
		temp+=space(3)+"<a class='mClass' href='#' onClick='loadFrame(\"http://www.nbson.com/whyBuy.htm\",\"500\")'>Why Buy from NBS?</a><br>";
		temp+=space(3)+"<a class='mClass' href='http://www.firearmssoftware.com' target='_blank' >Firearms Software</a><br>";
		temp+=space(3)+"<a class='mClass' href='http://www.mixtrack.net' target='_blank' >Mixtrack Software</a><br>";
		menu.innerHTML=temp;
		menu.style.background=bgcolor;
		menu.style.foreground=fgcolor;
		menu.style.visibility="visible";
		menu.style.position="absolute";
		if(ie){
			menu.style.top="195px";
			menu.style.left="150px";
		}else{
			menu.style.top="184px";
			menu.style.left="148px";		
  	}	
	  menu.style.width="175px";

}

// locations menu
function ddLocations(){
  var menu=document.getElementById("menuDiv");
  var temp="";

    // show menu
		temp+=space(3)+"<a class='mClass' href='#' onClick='loadFrame(\"storelocations.htm\",\"570\")'>Store Locations</a><br>";
		temp+=space(3)+"<a class='mClass' href='#' onClick='loadFrame(\"towers.htm\",\"550\")'>Tower Locations</a><br>";
		menu.innerHTML=temp;
		menu.style.background=bgcolor;
		menu.style.foreground=fgcolor;
		menu.style.visibility="visible";
		menu.style.position="absolute";
		if(ie){
			menu.style.top="195px";
			menu.style.left="217px";
		}else{
			menu.style.top="184px";
			menu.style.left="215px";
		}				
	  menu.style.width="150px";

}

// check email menu
function ddCheckEmail(){
  var menu=document.getElementById("menuDiv");
  var temp="";
    // show menu
		temp+=space(3)+"<a class='mClass' target='_blank' href='http://google.com/a/kewanee.com'>Kewanee.com</a><br>";		
		temp+=space(3)+"<a class='mClass' target='_blank' href='http://www.google.com/a/nbson.net'>NBSon.net</a><br>";
		temp+=space(3)+"<a class='mClass' href='#' onClick='loadFrame(\"http://www.nbson.com/new/wmlogin.htm\",\"500\")'>(YourDomain).com</a><br>";
		temp+=space(3)+"<a class='mClass' target='_blank' href='http://google.com/a/princetonnet.net'>PrincetonNet.net</a><br>";
		temp+=space(3)+"<a class='mClass' target='_blank' href='http://google.com/a/nbsmail.net'>NBSmail.net</a><br>";
		temp+=space(3)+"<a class='mClass' target='_blank' href='http://google.com/a/revealed.net'>Revealed.net</a><br>";
		menu.innerHTML=temp;
		menu.style.background=bgcolor;
		menu.style.foreground=fgcolor;
		menu.style.visibility="visible";
		menu.style.position="absolute";
		if(ie){
			menu.style.top="195px";
			menu.style.left="370px";
		}else{
			menu.style.top="184px";
			menu.style.left="369px";
		}				
	  menu.style.width="150px";

}

// services menu
function ddServices(){
  var menu=document.getElementById("menuDiv");
  var temp="";
    // show menu
		temp+=space(3)+"<a class='mClass' href='#' onClick='loadFrame(\"repairs.htm\",\"500\")'>Repairs</a><br>";
		temp+=space(3)+"<a class='mClass' href='#' onClick='loadFrame(\"networking.htm\",\"500\")'>Networking</a><br>";
		temp+=space(3)+"<a class='mClass' href='#' onClick='loadFrame(\"customprogramming.htm\",\"500\")'>Custom Programming</a><br>";
		temp+=space(3)+"<a class='mClass' href='#' onClick='loadFrame(\"whdesign.htm\",\"500\")'>Website Design"+space(4)+"</a><br>";
		temp+=space(3)+"<a class='mClass' href='#' onClick='loadFrame(\"whprices.htm\",\"620\")'>Website Hosting"+space(4)+"</a><br>";
		menu.innerHTML=temp;
		menu.style.background=bgcolor;
		menu.style.foreground=fgcolor;
		menu.style.visibility="visible";
		menu.style.position="absolute";
		if(ie){
			menu.style.top="195px";
			menu.style.left="88px";
	 	}else{
			menu.style.top="183px";
			menu.style.left="86px";	
	 	}		
	  menu.style.width="150px";
}

// about menu
function ddAbout(s){
  var menu=document.getElementById("menuDiv");
  var temp="";
  if(s==1){  
    // show menu
		temp+=space(3)+"<a class='mClass' href='http://www.nbson.com/cool.htm'>About NBS</a><br>";
		temp+=space(3)+"<a class='mClass' href='http://www.nbson.com/storePics.htm'>Store Pictures</a><br>";
		menu.innerHTML=temp;
		menu.style.background=bgcolor;
		menu.style.foreground=fgcolor;
		menu.style.visibility="visible";
		menu.style.position="absolute";
		if(ie){
			var ts=topSpot-53;
			menu.style.top=ts.toString()+"px";
			menu.style.left="14px";
		}else{
			var ts=topSpot-61;
			menu.style.top=ts.toString()+"px";
			menu.style.left="11px";
		}					
	  menu.style.width="150px";
	}else{
	 // hide menu
	  show("menuDiv",0);
	}
}

// support menu
function ddSupport(s){
  var menu=document.getElementById("menuDiv");
  var temp="";
  if(s==1){  
    // show menu
		temp+=space(3)+"<a class='mClass' href='http://www.nbson.com/emailSupport.htm'>Support for Email</a><br>";
		temp+=space(3)+"<a class='mClass' href='http://www.nbson.com/avSupport.htm'>Anti-virus</a><br>";
		temp+=space(3)+"<a class='mClass' href='http://www.nbson.com/swSupport.htm'>Spyware</a><br>";
		temp+=space(3)+"<a class='mClass' href='http://www.nbson.com/swSupport.htm'>Wireless Trouble Shooting</a><br>";
		menu.innerHTML=temp;
		menu.style.background=bgcolor;
		menu.style.foreground=fgcolor;
		menu.style.visibility="visible";
		menu.style.position="absolute";
		if(ie){
			var ts=topSpot-85;
			menu.style.top=ts.toString()+"px";
			menu.style.left="119px";
		}else{
			var ts=topSpot-92;
			menu.style.top=ts.toString()+"px";
			menu.style.left="116px";
		}				
	  menu.style.width="180px";
	}else{
	 // hide menu
	  show("menuDiv",0);
	}
}


// services sub menus
function websiteDesignSub(s){
  var temp="";
	var menu=document.getElementById("subMenuDiv");
  if(s==1){  
    // show menu
    temp+="<span onMouseOver='show(\"menuDiv\",1)' onMouseOut='show(\"menuDiv\",0)'>";
		temp+=space(3)+"<a class='mClass' href='http://www.nbson.com/wsdPhilosophy.htm'>Philosophy</a><br>";
		temp+=space(3)+"<a class='mClass' href='http://www.nbson.com/wsdClientList.htm'>Client List</a><br>";
		temp+="</span>";
		menu.innerHTML=temp;
		menu.style.background=bgcolor;
		menu.style.foreground=fgcolor;
		menu.style.visibility="visible";
		menu.style.position="absolute";
		if(ie){
			menu.style.top="100px";
			menu.style.left="235px";
		}else{
			menu.style.top="94px";
			menu.style.left="235px";
	  }						
	  menu.style.width="150px";
	}else{
	 // hide menu
		menu.style.visibility="hidden";	
	} 
}

function webHostingSub(s){
  var temp="";
	var menu=document.getElementById("subMenuDiv");
  if(s==1){  
    // show menu
    temp+="<span onMouseOver='show(\"menuDiv\",1)' onMouseOut='show(\"menuDiv\",0)'>";
		temp+=space(3)+"<a class='mClass' href='http://www.nbson.com/whPrices.htm'>Prices</a><br>";
		temp+="</span>";
		menu.innerHTML=temp;
		menu.style.background=bgcolor;
		menu.style.foreground=fgcolor;
		menu.style.visibility="visible";
		menu.style.position="absolute";
		if(ie){
			menu.style.top="116px";
			menu.style.left="235px";
		}else{
			menu.style.top="110px";
			menu.style.left="235px";
		}	
	  menu.style.width="150px";
	}else{
	 // hide menu
		menu.style.visibility="hidden";	
	} 
}

// display or hide a page element
function show(i,n){
  if(n==1){
		document.getElementById(i).style.visibility="visible";
  }else{
  	document.getElementById(i).style.visibility="hidden";		
  }	
}


// prints n spaces
function space(n){
	var i;
	var temp="";
	for(i=1;i<=n;i++){
	  temp=temp+"&nbsp;";
	}
	return temp;
}

// sets height of the content frame
function setHeight(n){
	var cf=document.getElementById('contentFrame');
	cf.style.height=n;
}


// Generate and return a random number between 1-100
// this is used to ensure fresh CGI return data that is
// not cached
function genNumbers() {
    var i, rannum;

    // This will generate 0-100.
    rannum = Math.random()*100;

		// rannum is now a decimal value
		// so round to nearest integer
    rannum = Math.round(rannum);
    
    return rannum;
}	

function testForVer(){
	 var temp=location.href;	
	 if (temp.indexOf('ver=')===-1 ){
	 	  // no version in location.href
	 	  window.location = 'http://www.nbson.com/index.html?ver='+genNumbers();	
	 }else{
			//do nothing	
	 }		
}