/*
Browser Sniffer Script-
© Eddie Traversa (nirvana.media3.net)
To add more shock to your site, visit http://www.java-scripts.net
*/
function browserSniffer() {
	var browser="";
 	var agt=navigator.userAgent.toLowerCase();
  	var agt=navigator.userAgent.toLowerCase();
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    var is_nav5 = (is_nav && (is_major == 5));
    var is_nav5up = (is_nav && (is_major >= 5));
    var is_ie   = (agt.indexOf("msie") != -1);
    var is_ie3  = (is_ie && (is_major < 4));
    var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );
    var is_ie4up  = (is_ie  && (is_major >= 4));
    var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);
    var is_aol   = (agt.indexOf("aol") != -1);
    var is_aol3  = (is_aol && is_ie3);
    var is_aol4  = (is_aol && is_ie4);
    var is_opera = (agt.indexOf("opera") != -1);
    var is_webtv = (agt.indexOf("webtv") != -1);
	  
  	if (is_nav4up) {
  	   browser="nav"; // netscape 4+ but not NS5
     }else if (is_webtv) { // Web TV
   	 browser="nav";
	}else if (is_aol || is_aol3 || is_aol4) { //AOL
   		  browser="nav";
	 }else if (is_opera) { // Opera
   	 browser="nav";
    }else if (is_nav5up) { // Netscape 5
   	browser="nav";
     }else if (is_ie3||is_nav3) { // 3.0 version browsers
   	browser="ie";
    }else if (is_ie4up) { //IE4 & IE5 but returns IE4
  	browser="ie";
	}
	else browser="nav";
	return browser;
}

function enlargeImage1(){
   window.open("Images/SAA.jpg", "SAAchart");
}
function dropImage1(){
   image1.height="250"
}

function enlargeFC(){
   window.open("Images/fc.gif", "fc", "height=380, width=380");
}

function enlargeJF(){
   window.open("Images/jf.gif", "jf", "height=380, width=380");
}

function enlargeBunny(){
   window.open("Images/bunny.jpeg", "bunnybunch", "height=425, width=325");
}

function enlargeEW(){
   window.open("Images/3_Dangerous-Wet.jpeg", "ew", "height=445, width=570");
}

function enlargeSM(){
   window.open("../Images/sct_cmap.gif", "sm", "height=600, width=600");
}

function calcHeight()
{
  //find the height of the internal page
  var st_height=682;
  var the_height=document.getElementById('bodyframe').contentWindow.document.body.scrollHeight;
  //change the height of the iframe

  if (the_height<st_height)	   {
  the_height=st_height;
  }
  document.getElementById('bodyframe').height=the_height;
}

var currentPanel;

function loadPanel(tab_no) {

hidePanelStart(tab_no);

showPanel(1);

}

var currentPanel;

function showPanel(panelNum){

//hide visible panel, show selected panel, set tab

if (currentPanel != null) {

hidePanel();

}

document.getElementById("panel"+panelNum).style.visibility = "visible";

currentPanel = panelNum;

setState(panelNum);

}

function hidePanel(){

//hide visible panel, unhilite tab

document.getElementById("panel"+currentPanel).style.visibility = "hidden";

document.getElementById("tab"+currentPanel).style.backgroundColor = "#808080";

document.getElementById("tab"+currentPanel).style.color = "white";

}

function hidePanelStart(noTabs){

for (i=1; i<=noTabs; i++) {

var panel="panel"+i;

document.getElementById(panel).style.visibility = "hidden";

}}

var currentPanel;

function setState(tabNum){

if(tabNum==currentPanel){

document.getElementById("tab"+tabNum).style.backgroundColor = "#c0c0c0";

document.getElementById("tab"+tabNum).style.color = "black";

}else{

document.getElementById("tab"+tabNum).style.backgroundColor = "#808080";

document.getElementById("tab"+tabNum).style.color = "white";

}

}

