// JavaScript Document

//	*****	GLOBAL VARS	***** //	
		var bV=parseFloat(navigator.appVersion);
		var bN=navigator.appName;
		var stopfade;	// stop the background found when user moves out of menu area
		var fades;		// fade start
		var fadee;		// fade end
		var isNav;		// is Navigator 4
		var isIE4;
		var isIE;		// is Internet Explorer
		var isNav06;	// is Navigator 6
		var isMacIE;	// is Internet Explorer on a Mac
		var fadertimeoutID;	// an id for the fader timeout
		var aWindow;
		
//	*****	GLOBAL CODE TO INCLUDE A STYLESHEET DEPENDING ON BROWSER	***************************************************88			
			//if (document.layers) {
				//document.write("<LINK REL=\"STYLESHEET\" HREF=\"../styles/NN4.css\" TYPE=\"text\/css\">");
				//}
    		//else if (document.all) {
				//document.write("<LINK REL=\"STYLESHEET\" HREF=\"../styles/IE.css\" TYPE=\"text\/css\">");}
			//else if (!document.all && document.getElementById) {
  				//document.write("<LINK REL=\"STYLESHEET\" HREF=\"../styles/NN6.css\" TYPE=\"text\/css\">");}		
				
// *****	BROWSER DETECTION	**************************************************************************************
		if(parseInt(navigator.appVersion) >= 4){
  			isNav = (navigator.appName == "Netscape")&&(parseInt(navigator.appVersion) < 5);
  			isNav06 = (navigator.appName == "Netscape")&&(parseInt(navigator.appVersion) >= 5);
 			isIE4 = (navigator.appName.indexOf("Microsoft Internet Explorer") != -1)&&(parseInt(navigator.appVersion) < 5);
			isIE = (navigator.appName.indexOf("Microsoft Internet Explorer") != -1)&&(parseInt(navigator.appVersion) >= 5);
			isMacIE = (navigator.userAgent.indexOf("MSIE") != -1) && (navigator.userAgent.indexOf("Mac") != -1) && (parseInt(navigator.appVersion) >= 4);
		//	alert(' IsNav ' + isNav + ' IsNav06 ' +isNav06 + ' IsIE ' +isIE + ' IsMacIE ' + isMacIE);
			}

//	****** IMG SWAP ****************************************************************************************** 		

function imgswp(imgid,img){
		
		if (isNav) {
		    var count;
			var layername;
			count=0; 		
			for (count ; count<document.layers.length; count++){
					if (eval("document.layers[" + count +"].document.images['" +imgid + "'];")){
					layername=document.layers[count].name;} 
				}
			eval("document.layers['" + layername +"'].document.images['" + imgid + "'].src=img;");
			}
		else if (isIE4){document.all[imgid].src=img;}
		else{document.getElementById(imgid).src=img;}		
	}
	
   function imgLoad(imgArray)
   {
	 var tempImg;
    for (var i=0; i < imgArray.length;i++)
	{
      tempImg = new Image();
      tempImg.src = imgArray[i];
	}
   }
	
//	*****	OBJECTS TO VISIBLE	******************************************************************************************
	function show(id){		  
	  	if (isNav){document.layers[id].visibility = "show";}
		else if (isIE4){document.all[id].style.visibility='visible';}
		else {document.getElementById(id).style.visibility = 'visible';}
		}
		
//	*****	OBJECTS TO HIDDEN	***********************************************************************************************
	function hide(id){
	 	if (isNav){document.layers[id].visibility = "hide";}
	  	else if (isIE4){document.all[id].style.visibility='hidden';}
	  	else{document.getElementById(id).style.visibility = 'hidden';}
	}

// *****	BRING LAYER TO FRONT 	****************************************************************************************************
	function changeorder(obj,x){
		if (isNav){document.layers[obj].zIndex=x;}
		else if (isIE4){document.all[obj].style.zIndex=x;}
		else{document.getElementById(obj).style.zIndex=x;}
	}
		
		
//******	To open an image in a new window! *****	
	function openwindowpic(filename){
		if (!aWindow || aWindow.closed){aWindow=window.open(filename, "thewindow", "top=100, left=100, width=640, height=480");}
		else{
				aWindow.close();
				aWindow=window.open(filename, "thewindow", "top=100, left=100, width=640, height=480");
			}
		}
	
	
//****** MENU *****	

/***********************************************
* DD Tab Menu script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
//var initialtab=[1, "sc1"]
 
 
//Turn menu into single level image tabs (completely hides 2nd level)?
var turntosingle=0 //0 for no (default), 1 for yes

//Disable hyperlinks in 1st level tab images?
var disabletablinks=0 //0 for no (default), 1 for yes

////////Stop editting////////////////

var previoustab=""

if (turntosingle==1)
document.write('<style type="text/css">\n#tabcontentcontainer{display: none;}\n</style>')

function expandcontent(cid, aobject)
{
	if (disabletablinks==1)
	aobject.onclick=new Function("return false")
	if (document.getElementById)
	{
		highlighttab(aobject)
		if (turntosingle==0)
		{
			if (previoustab!="")
			document.getElementById(previoustab).style.display="none"
			document.getElementById(cid).style.display="block"
			previoustab=cid
		}
	}
}

function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].className=""
aobject.className="current"
}

function collecttablinks(){
var tabobj=document.getElementById("tablist")
tabobjlinks=tabobj.getElementsByTagName("A")
}

function do_onload(){

collecttablinks()
// The inittab varible is declared in site_config.inc file (Auto generated by Site_config.tpl). This variable is used for left 
//hand menu navigation. If variable is not true means, Menu options are used in the page.
if(!inittab)
	{
		
		expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
  	}
}

if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload
