function nav(id) {
if (document.all&&document.getElementById) {
navRoot = document.getElementById(id);
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}


/*
if (navigator.appName == "Netscape" ){
var layerRef="document.layers";
var styleSwitch="";
}else{
var layerRef="document.all";
var styleSwitch=".style";
}
*/
if (document.layers)
{
//alert('document.layers');
var layerRef="document.layers";
var styleSwitch="";
function showLayer(layerName){
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
}	
function hideLayer(layerName){
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
}
}

else if  (document.all && !document.getElementById)
{
//alert('document.all && !document.getElementById');
var layerRef="document.all";
var styleSwitch=".style";
function showLayer(layerName){
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
}	
function hideLayer(layerName){
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
}
}

else if (document.getElementById) { 
//alert('document.getElementById');
var layerRef="document.getElementById";
var styleSwitch=".style";
function showLayer(layerName){
eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="visible"');
}	
function hideLayer(layerName){
eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="hidden"');
}
}

else if(document.all){
var layerRef="document.all";
var styleSwitch=".style";
function showLayer(layerName){
eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="visible"');
}	
function hideLayer(layerName){
eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="hidden"');
}
}

else {
alert('This website uses DHTML. We recommend you upgrade your browser.');
}

//hides all
function hideAll(num){
if (num=="99"){
hideLayer('navmenu01');
hideLayer('navmenu02');
hideLayer('navmenu03');
hideLayer('navmenu04');
hideLayer('navmenu97');
}
}

function showSome(num){
if (num=="101"){
hideAll('99');
showLayer('navmenu01');
}
else if (num=="102"){
hideAll('99');
showLayer('navmenu02');
}
else if (num=="103"){
hideAll('99');
showLayer('navmenu03');
}
else if (num=="104"){
hideAll('99');
showLayer('navmenu04');
}

else if (num=="197"){
hideAll('99');
showLayer('navmenu97');
}
}
function resized(){
  if(pageWidth!=innerWidth || pageHeight!=innerHeight){
    location.reload()
  }
}
if(document.layers){
  pageWidth=innerWidth
  pageHeight=innerHeight
  window.onresize=resized
}

//Small Radom Image
var rand2 = 0;
var useSm = 0;

imagesSm = new Array ();
imagesSm[1] = new Image();
imagesSm[1].src = "media/50_image_01.gif";
imagesSm[2] = new Image();
imagesSm[2].src = "media/50_image_02.gif";
imagesSm[3] = new Image();
imagesSm[3].src = "media/50_image_03.gif";
imagesSm[4] = new Image();
imagesSm[4].src = "media/50_image_04.gif";

function swapSmPic() {
var imgnum = imagesSm.length - 1;
do {
var randnum = Math.random();
rand2 = Math.round((imgnum - 1) * randnum) + 1;
} while (rand2 == useSm);
useSm = rand2;
document.randimgSm.src = imagesSm[useSm].src;
}


//Large Radom Image
var rand1 = 0;
var useLg = 0;

imagesLg = new Array ();
imagesLg[1] = new Image();
imagesLg[1].src = "media/100_image_01.jpg";
imagesLg[2] = new Image();
imagesLg[2].src = "media/100_image_02.jpg";
imagesLg[3] = new Image();
imagesLg[3].src = "media/100_image_03.jpg";
imagesLg[4] = new Image();
imagesLg[4].src = "media/100_image_04.jpg";
imagesLg[5] = new Image();
imagesLg[5].src = "media/100_image_05.jpg";
imagesLg[6] = new Image();
imagesLg[6].src = "media/100_image_06.jpg";
imagesLg[7] = new Image();
imagesLg[7].src = "media/100_image_07.jpg";
imagesLg[8] = new Image();
imagesLg[8].src = "media/100_image_08.jpg";
imagesLg[9] = new Image();
imagesLg[9].src = "media/100_image_09.jpg";
imagesLg[10] = new Image();
imagesLg[10].src = "media/100_image_10.jpg";
imagesLg[11] = new Image();
imagesLg[11].src = "media/100_image_11.jpg";
imagesLg[12] = new Image();
imagesLg[12].src = "media/100_image_12.jpg";
imagesLg[13] = new Image();
imagesLg[13].src = "media/100_image_13.jpg";


function swapLgPic() {
var imgnum = imagesLg.length - 1;
do {
var randnum = Math.random();
rand1 = Math.round((imgnum - 1) * randnum) + 1;
} while (rand1 == useLg);
useLg = rand1;
document.randimgLg.src = imagesLg[useLg].src;
}

//Random Quotes
var rand3 = 0;
var useQuotes = 0;

quotes = new Array ();
quotes[1] = new Image();
quotes[1].src = "media/quotes_01.gif";
quotes[2] = new Image();
quotes[2].src = "media/quotes_02.gif";
quotes[3] = new Image();
quotes[3].src = "media/quotes_03.gif";
quotes[4] = new Image();
quotes[4].src = "media/quotes_04.gif";

function swapQuote() {
var imgnum = quotes.length - 1;
do {
var randnum = Math.random();
rand3 = Math.round((imgnum - 1) * randnum) + 1;
} while (rand3 == useQuotes);
useQuotes = rand3;
document.randQuotes.src = quotes[useQuotes].src;
}
