// JavaScript Document
function detectBrowser()
{

  var str= navigator.userAgent; 
  //alert(str);
  var strName = str.substr(24,5);
  //alert (strName);
  var strNumber = str.substr(30,9);
  var browser = parseFloat(strNumber);
  var patt = /MSIE/g;
  if (patt.test(strName) && browser < 7) {
    alert("Your browser is Internet Explorer "+ browser +" please upgrade!");
	window.location="http://www.microsoft.com/windows/internet-explorer/default.aspx?ocid=ie8_b_1C438A12-D738-4A04-9BCB-9EA8BFF3E796";}
	}
	
	
function loadXMLDoc(url , id)
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
document.getElementById('content').innerHTML=xmlhttp.responseText;

//this section sets the current 
var arr =document.getElementsByTagName('li');//this is for internet explorer 8
var arr2 =document.getElementsByName('menuItem');//this is for firefox

//alert(arr2.length);
//internet explorer 8
for (i=0; i<arr.length; i++){
	if (arr[i].name == 'menuItem')
	arr[i].className='menu';
		}
//firefox & others		
for (i=0; i<arr2.length; i++){
	arr2[i].className='menu';
		}

	var curr=document.getElementById(id);
	curr.className='current';
}



function setBackground(nParam) {
	var num = Math.ceil(Math.random()*3);
	
//the following gets the browser width & height	
 var viewportwidth;
 var viewportheight;
 
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }
 
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
 }
 
 // older versions of IE
 
 else
 {
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }

	
var darkGrad = document.getElementById("dark_grad");
var darkStrip = document.getElementById("dark_strip"); 
var tileBottom = document.getElementById("tile_bottom");
var container = document.getElementById("container");
var footer = document.getElementById("footer");
var linksFooter = document.getElementById("links_footer");

if( viewportwidth >= 1300){container.style.height = (viewportwidth * .56) +"px";} 
else { container.style.height = 728 +"px";}

if( viewportwidth >= 1300){darkGrad.style.height = (viewportwidth * .56) +"px";} 
else { darkGrad.style.height = 728 +"px";}

if( viewportwidth >= 1300){darkStrip.style.height = (viewportwidth * .56) +"px";} 
else { darkStrip.style.height = 728 +"px";}

if( viewportwidth >= 1300){tileBottom.style.top = ((viewportwidth * .56)-4) +"px";} 
else { tileBottom.style.top = 728 +"px";}

if( viewportwidth >= 1300){footer.style.top = ((viewportwidth * .56) -50 ) +"px";} 
else { footer.style.top = 678 +"px";}


if( viewportwidth >= 1300){linksFooter.style.top = ((viewportwidth * .56) +10 ) +"px";} 
else { linksFooter.style.top = 728 +"px";}

document.getElementById("backgroundImage").innerHTML = "<img style=\" min-height:728px; min-width:1300px; \" src= \"images/background-" + nParam + ".jpg\" width=\"100%\" height=\""+(viewportwidth * .56)+"\" />";

	}
	
	
function makeCurrent(id){
	
	var navTabs = document.getElementsByName("navTab");
	//alert(navTabs.length);
	for( i=0; i< navTabs.length; i++){
		navTabs[i].className = '';}
	var curr=document.getElementById(id);
	curr.className="current";
	}
	