//***********************************************

var platform;
	if (navigator.appVersion.indexOf("95") != -1) platform = "PC";
	if (navigator.appVersion.indexOf("2000") != -1) platform = "PC";
	if (navigator.appVersion.indexOf("XP") != -1) platform = "PC";
	if (navigator.appVersion.indexOf("98") != -1) platform = "PC";
    if (navigator.appVersion.indexOf("16") != -1) platform = "PC";
	if (navigator.appVersion.indexOf("NT") != -1) platform = "PC";
    if (navigator.appVersion.indexOf("PPC") != -1) platform = "Mac";
	if (navigator.appVersion.indexOf("PowerPC") != -1) platform = "Mac";

var browser = navigator.appName;

	if (browser=="Microsoft Internet Explorer") this.browser = "ie";
	else if (browser=="Netscape") this.browser = "ns";


//----------------------------------------------------------

//FUNCTION SET CSS FOR MAC OR WIN
function setStyle()
{

var output = "";
	if (platform == "Mac") 
	{
		if (navigator.appVersion.indexOf("MSIE 5.0") != -1)
		{
			document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="../css/css_win.css">');
		}
		else 
		{
			document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="../css/css_mac.css">');
		}
	}
	else if (platform == "PC") 
	{
		document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="../css/css_win.css">');
	}
	else
	{
		document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="../css/css_win.css">');
	}
}
//END SET STYLE FUNCTION

//FUNCTION FIX CSS FOR NETSCAPE
function nsFix() {
  // This function checks to make sure the version of Netscape 
  // in use contains the bug; if so, it records the window's 
  // width and height and sets all resize events to be handled 
  // by the netscapeCssFix() function.
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document == 'undefined'){
      document = new Object;
    }
    if (typeof document.scaleFont == 'undefined') {
      document.netscapeCssFix = new Object;
      document.netscapeCssFix.initWindowWidth = window.innerWidth;
      document.netscapeCssFix.initWindowHeight = window.innerHeight;
    }
    window.onresize = netscapeCssFix;
  }
}

function netscapeCssFix() {

  // This part gets around another unfortunate bug whereby Netscape 
  // fires a resize event when the scrollbars pop up. This 
  // checks to make sure that the window's available size 
  // has actually changed.
  if (document.netscapeCssFix.initWindowWidth != window.innerWidth || document.netscapeCssFix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}
//END FUNCTION FIX CSS


//FUNCTION IMAGE SWAP ONMOUSE
function swap(imgname,imgB)
	{			
		document[imgname].src = eval(imgB + ".src");
	}
//END FUNCTION IMAGE SWAP

//FUNCTION IMAGE SWAP IE SAFE VERSION
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_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_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];}
}
//END FUNCTION IMAGE SWAP

//FUNCTION OPEN POP-UP WINDOW
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


//FUNCTION TO HIDE AND SHOW POP up LAYERS
function MM_showHideLayers(layername,vis)
{
		if(vis == "show")
		{
			//IE
			if(document.all) {
				document.all[layername].style.visibility = "visible";
			}
			//NS
			else if(document.layers) {
				document.layers[layername].visibility = "visible";
			}
			//NS6
			else if(document.getElementById) {
				document.getElementById(layername).style.visibility = "visible";
			}
		}
		else
		{
			//IE
			if(document.all) {
				document.all[layername].style.visibility = "hidden";
			}
			//NS
			else if(document.layers) {
				document.layers[layername].visibility = "hidden";
			}
			//NS6
			else if(document.getElementById) {
				document.getElementById(layername).style.visibility = "hidden";
			}
		}	
}


//FUNCTION IMAGE SWAP2 ONMOUSE for the netscape layers 
	function swap2(imgname,imgB)
		{	
			//IE
			if(document.all) {
				document.all[imgname].src = eval(imgB + ".src");
			
			}
			//NS
			else if(document.layers) {
				document.wwlayer.document[imgname].src = eval(imgB + ".src");
			}
			//NS6
			else if(document.getElementById) {
				document[imgname].src = eval(imgB + ".src");
			}	
		}
//END FUNCTION IMAGE SWAP2


// library code to access layer objects
var agt = navigator.userAgent.toLowerCase();
var ver = parseInt(navigator.appVersion);

// redirect old browsers
//if (ver < 4){
	//alert('We dont support old browsers! Go get a newer one.');
	//location.replace('http://www.microsoft.com/ie/');

// set variable names for accepted browsers
//} else {

	var is_nav = false, is_nav4 = false, is_nav6 = false, is_ie = false;
	
	if ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('compatible') == -1)){
			is_nav = true;
		
		if(agt.indexOf('netscape6')!=-1){
			is_nav6 = true;
		} else{
			is_nav4 = true;
		}
		
	} else if (agt.indexOf("msie") != -1){
		is_ie = true;
	}

//}



// function to reload page to fix netscape
function reloadScreen(){
		location.reload();
}

