// JScript source code

/* Detect browser first 
--------------------------------------------------------------------- */

    // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();
    var appVer = navigator.appVersion.toLowerCase();

    // *** BROWSER VERSION ***

    var is_minor = parseFloat(appVer);
    var is_major = parseInt(is_minor);

   // Note: On IE, start of appVersion return 3 or 4
    // which supposedly is the version of Netscape it is compatible with.
    // So we look for the real version further on in the string

    var iePos  = appVer.indexOf('msie');
    if (iePos !=-1) {
       is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))
       is_major = parseInt(is_minor);
    }

	 var is_opera = (agt.indexOf("opera") != -1);
	 
	 var is_konq = false;
    var kqPos   = agt.indexOf('konqueror');
    if (kqPos !=-1) {                 
       is_konq  = true;
       is_minor = parseFloat(agt.substring(kqPos+10,agt.indexOf(';',kqPos)));
       is_major = parseInt(is_minor);
    }                                 

    var is_safari = ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))?true:false;
    var is_khtml  = (is_safari || is_konq);
	    
    var is_ie   = ((iePos!=-1) && (!is_opera) && (!is_khtml));

    var is_ie6   = (is_ie && is_major == 6);
    var is_ie6up = (is_ie && is_minor >= 6);
    
    var is_ie7   = (is_ie && is_major == 7);
    var is_ie7up = (is_ie && is_minor >= 7);

    // *** PLATFORM ***
    var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );

/* ---------- end detect browser -------------*/

function makeActiveTitleSearchOnLoad() {
    
    if (document.getElementById('HS_Div1')) {
    
    var thisSection = document.getElementById('HS_Div1');
    
    //var elementClickedOn = document.getElementById('HS_Tab_s1');
    
   thisSection.style.display="block";
   
   // pattern begins with "HS_Div" and can be followed by any digits or chars
   var myRegxp = /^HS_Div[0-9a-zA-Z]/;
   
   var e=document.getElementsByTagName(thisSection.tagName);
   
      for(var i=0;i<e.length;i++) {
      //check for divs named according to convention "HS_Tab..."
         if (myRegxp.test(e[i].id)) {
            if (e[i].id!==thisSection.id){
            	e[i].style.display="none";
            }
         }
      }
   
   //handle the active tab background
   //spans inside anchors are clickable, and set properties for their parent anchors
   
   var myRegxp = /^HS_Tab_[0-9a-zA-Z]/;
   
   var f=document.getElementsByTagName("span");
   
   for(var i=0;i<f.length;i++) {
      //check for anchors named according to convention "HS_Tab_..."
      if (myRegxp.test(f[i].id)) {
         if (f[i].id!=='HS_Tab_s1'){  
            if ((is_ie6 && is_win) || (is_opera)) {
            	f[i].style.color="";
            } else {
             	f[i].href="#Off";
         		f[i].parentNode.href="#Off";
           }
         } else {
         
            if ((is_ie6 && is_win) || (is_opera)) {
            	document.getElementById('HS_Tab_s1').style.color="#000000";
            } else {
               document.getElementById('HS_Tab_s1').href="#On";
               document.getElementById('HS_Tab_s1').parentNode.href="#On";
            }
      	}
      }
   }
  }
}


function makeActive(thisSection,elementClickedOn) {
        
   thisSection.style.display="block";
   
   // pattern begins with "HS_Div" and can be followed by any digits or chars
   var myRegxp = /^HS_Div[0-9a-zA-Z]/;
   
   var e=document.getElementsByTagName(thisSection.tagName);
   
      for(var i=0;i<e.length;i++) {
      //check for divs named according to convention "HS_Tab..."
         if (myRegxp.test(e[i].id)) {
            if (e[i].id!==thisSection.id){
            	e[i].style.display="none";
            }
         }
      }
   
   //handle the active tab background
   //spans inside anchors are clickable, and set properties for their parent anchors
   
   var myRegxp = /^HS_Tab_[0-9a-zA-Z]/;
   
   var f=document.getElementsByTagName(elementClickedOn.tagName);
   
   for(var i=0;i<f.length;i++) {
      //check for anchors named according to convention "HS_Tab_..."
      if (myRegxp.test(f[i].id)) {
         if (f[i].id!==elementClickedOn.id){  
            if ((is_ie6 && is_win) || (is_opera)) {
            	f[i].style.color="";
            } else {
             	f[i].href="#Off";
         		f[i].parentNode.href="#Off";
           }
         } else {
         
            if ((is_ie6 && is_win) || (is_opera)) {
            	elementClickedOn.style.color="#000000";
            } else {
               elementClickedOn.href="#On";
               elementClickedOn.parentNode.href="#On";
            }
      	}
      }
   }
}
