
// MAIN NAV - SUBNAV
	function change(id, newClass) {
		identity=document.getElementById(id);
		if (identity != null)
		{
			identity.className=newClass;
		}
	}
	
	function navShow( strId )
	{
		var eTarget = document.getElementById( "dvSubMenuTarget" );
		
		//hide all except with activeSubNav in the class
		if ( typeof( eTarget ) != "undefined" )
		{
			for ( var i=0; i < eTarget.childNodes.length; i++ )
			{
				if ( eTarget.childNodes[i].nodeName != "#text" )
				{
					if ( eTarget.childNodes[i].id == strId )
					{
						eTarget.childNodes[i].style.display = "block";
						eTarget.childNodes[i].style.visibility = "visible";

					}
					else if ( eTarget.childNodes[i].className.indexOf( "activeSubNav" ) == -1 )
					{
						eTarget.childNodes[i].style.display = "none";
						eTarget.childNodes[i].style.visibility = "hidden";

					}
				}
			}
		}
	}
		
	

	//Used to display a top level menu children
	function navShow_New( strId )
    {
	
        var eTarget = document.getElementById( "dvSubMenuTarget" );
		//dvSubNav navColour8 is the class id of the sub level menus
		//dvSubNav navColour8 activeSubNav is the class if of the ACTIVE sub level menu (if it exists)

		//does strId exist?
		var mySubNavItem = document.getElementById(strId);
		if(mySubNavItem != null)
		{
			//found it so hide everything else and display it
			if ( typeof( eTarget ) != "undefined" )
        	{
				for ( var i=0; i < eTarget.childNodes.length; i++ )
				{
					if ( eTarget.childNodes[i].nodeName != "#text" )
					{
						if ( eTarget.childNodes[i].id == strId )
						{
							eTarget.childNodes[i].style.display = "block";
							eTarget.childNodes[i].style.visibility = "visible";
						}
						else
						{
							eTarget.childNodes[i].style.display = "none";
							eTarget.childNodes[i].style.visibility = "hidden";	
						}
					}
				}
        	}
		}
    }
	
	//Used to hide any temporary children and revert to the selected children (if any)
	function navHide()
    {
        var eTarget = document.getElementById( "dvSubMenuTarget" );
        
        //hide all except with activeSubNav in the class
        if ( typeof( eTarget ) != "undefined" )
        {
            for ( var i=0; i < eTarget.childNodes.length; i++ )
            {
                if ( eTarget.childNodes[i].nodeName != "#text" )
                {
                    if (eTarget.childNodes[i].className.indexOf( "activeSubNav" ) != -1 )
                    {
                        eTarget.childNodes[i].style.visibility = "visible";
                        eTarget.childNodes[i].style.display = "block";
                    }
                    else
                    {
                        eTarget.childNodes[i].style.visibility = "hidden";
                        eTarget.childNodes[i].style.display = "none";
                    }
                }
            }
        }
    }

//FLASH SNIFFER

	var sLoadString = "";
	var requiredVersion = 7;   // Version the user needs to view site (max 9, min 2)
		// System globals
	var flash2Installed = false;    // boolean. true if flash 2 is installed
	var flash3Installed = false;    // boolean. true if flash 3 is installed
	var flash4Installed = false;    // boolean. true if flash 4 is installed
	var flash5Installed = false;    // boolean. true if flash 5 is installed
	var flash6Installed = false;    // boolean. true if flash 6 is installed
	var flash7Installed = false;    // boolean. true if flash 7 is installed
	var flash8Installed = false;    // boolean. true if flash 8 is installed
	var flash9Installed = false;    // boolean. true if flash 9 is installed
	var maxVersion = 9;             // highest version we can actually detect
	var actualVersion = 0;          // version the user really has
	var hasRightVersion = false;    // boolean. true if it's safe to embed the flash movie in the page
	var jsVersion = 1.0;            // the version of javascript supported
	
	var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
	var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; // true if we're on windows
	
	if(isIE && isWin){
		
	  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	  document.write('on error resume next \n');
	  document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
	  document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	  document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	  document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
	  document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
	  document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
	  document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
	  document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
	  document.write('<\/SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script

	}
	
	function detectFlash(flashfile,imagefile,imagewidth,imageheight,imagealt,imagelink) {  
	  // If navigator.plugins exists...
	  if (navigator.plugins) {
		// ...then check for flash 2 or flash 3+.
		if (navigator.plugins["Shockwave Flash 2.0"]
			|| navigator.plugins["Shockwave Flash"]) {
	
		  // Some version of Flash was found. Time to figure out which.
		  
		  // Set convenient references to flash 2 and the plugin description.
		  var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
		  var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
	
		  // DEBUGGING: uncomment next line to see the actual description.
		  // alert("Flash plugin description: " + flashDescription);
		  
		  // A flash plugin-description looks like this: Shockwave Flash 4.0 r5
		  // We can get the major version by grabbing the character before the period
		  // note that we don't bother with minor version detection. 
		  // Do that in your movie with $version or getVersion().
		  var flashVersion = parseInt(flashDescription.substring(16));
	
		  // We found the version, now set appropriate version flags. Make sure
		  // to use >= on the highest version so we don't prevent future version
		  // users from entering the site.
		  flash2Installed = flashVersion == 2;    
		  flash3Installed = flashVersion == 3;
		  flash4Installed = flashVersion == 4;
		  flash5Installed = flashVersion == 5;
		  flash6Installed = flashVersion == 6;
		  flash7Installed = flashVersion == 7;
		  flash8Installed = flashVersion == 8;
		  flash9Installed = flashVersion >= 9;
		}
	  }
	  
	  //detecting if safari mac
	  //var agt=navigator.userAgent.toLowerCase();
	  //var is_safari = ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))?true:false;
	 // alert(is_safari)
	   
	  // Loop through all versions we're checking, and
	  // set actualVersion to highest detected version.
	  for (var i = 2; i <= maxVersion; i++) {  
		if (eval("flash" + i + "Installed") == true) actualVersion = i;
	  }
	  
	  // DEBUGGING: uncomment next line to display flash version
	 //alert("version detected: " + actualVersion);
	  
	   // If the user has a new enough version...
	 // if (actualVersion < requiredVersion || is_safari) {
	  if (actualVersion < requiredVersion) {
		  if (imagelink == null){
			  document.writeln('<img src="' + imagefile + '" alt="' + imagealt + '" width="' + imagewidth + '" height="'+ imageheight +'" border="0" usemap="#imageMap">');
		  } else {
			  document.writeln('<a href="'+ imagelink +'"><img src="' + imagefile + '" alt="' + imagealt + '" width="' + imagewidth + '" height="'+ imageheight +'" border="0"></a>');
		  }
		
	  } else {
	  
		document.writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ imagewidth +'" height="'+ imageheight+'">');
		document.writeln('  <param name="movie" value="' + flashfile + '">');
		document.writeln('	<param name="quality" value="high">');
		document.writeln('	<param name="wmode" value="opaque">');
		document.writeln('	<embed WMODE="opaque" src="' + flashfile + '" width="'+ imagewidth +'" height="'+ imageheight+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="fma"></embed>');
		document.writeln('</object>');
		}
	}

// NAV CONTENT TABS
	//these 2 functions for the tabs system
	function changeclass(id) {
		for (zz=1; zz < 5; zz++){
			if (id == zz){
				identity=document.getElementById(zz);
				identity.className = 'current'
			}
			if (id != zz){
				identity=document.getElementById(zz);
				identity.className = ''
			} 
		}
	}
	
	function changecontent(id) {
		for (zz=1; zz < 5; zz++){
			if (id == ('middle'+zz)){
				identity=document.getElementById('middle'+zz);
				identity.className = 'showcontent'
			}
			if (id != ('middle'+zz)){
				identity=document.getElementById('middle'+zz);
				identity.className = 'hidecontent'
			} 
		}
	}
	// this one below for the expand - close left nav
	selectednav = '';
	newnav = '';
	oldlink = '';
	newlink = '';
	function changenav(navid,id) {
		selectednav = newnav;
		oldlink = newlink;
		newnav = 'leftnav' + navid;
		newlink = id;
		navobject = document.getElementById(newnav);
		linkobject = document.getElementById(newlink);
		oldnavobject = document.getElementById(selectednav);
		oldlinkobject = document.getElementById(oldlink);
//		navobject.className = 'showcontent';
		if (selectednav == newnav){
			selectednav='';
			oldlink = '';
			if (navobject.className == 'hidecontent') {
				navobject.className = 'showcontent';
				linkobject.className = 'leftnavon';
			} else {
				oldnavobject.className = 'hidecontent';
				oldlinkobject.className = 'leftnav2';
			}
		} else if (selectednav != newnav && selectednav != ''){
			navobject.className = 'showcontent';
			linkobject.className = 'leftnavon';
			oldnavobject.className = 'hidecontent';
			oldlinkobject.className = 'leftnav2';
		} else {
			navobject.className = 'showcontent';
			linkobject.className = 'leftnavon';
		}
	}
	
//DROPDOWN JUMP MENU

	function MM_jumpMenu(targ,selObj,restore){ //v3.0
	  	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  		if (restore) selObj.selectedIndex=0;
	}
	
// POP UP WINDOW

	function popWin(url,winName,winW,winH){
		window.open(url,winName,"'toolbar=no,location=no,status=yes,menubar=no,scrollbars=np,resizable=no,width="+winW+",height="+winH+"'")
	}