  function getBrowserType() {
    var browserType = "unknown";
    // Find the browser type
    var uA = navigator.userAgent;
    if (uA.indexOf("Opera") > -1) {
      browserType = "Opera";
    } else if (uA.indexOf("Safari") > -1 ) {
      browserType = "Safari";
    } else if (uA.indexOf("Konqueror") > -1 ) {
      browserType = "Konqueror";
    } else if (uA.indexOf("Gecko") > -1 ) {
      browserType = "Mozilla";
    } else if (uA.indexOf("MSIE") > -1 ) {
      browserType = "Internet Explorer";
    }
    return browserType;
  }

  function add_hover() {
    // Check if DOM is available
    if(!document.createTextNode){return;}

    // Find the div box elements 
    var sel_content = document.getElementById('sel_content');
    if (!sel_content) {return;}
    var items = sel_content.childNodes;
    var i;
    for (i=0;i<items.length;i++) {
      if (items[i].className == 'non_sel_box' ) {
        // These change the class from normal to js_hover
        items[i].onmouseover=function() {
         cssjs('swap', this, 'non_sel_box', 'non_sel_box_js_hover');
        }
        items[i].onmouseout=function() {
          cssjs('swap', this, 'non_sel_box_js_hover', 'non_sel_box');
        }
      }
    }    

    // Kill Autozoom for Safari & Opera
    var bt = getBrowserType();
    if ((bt == "Safari") || (bt == "Opera") ) {
      var azo = document.getElementById('autozoom_off');
      if (azo) {
        azo.style.display = 'none';
      }    
    }
  }

  // Set the link
  function do_non_sel_click(target) {
    parent.location=target;
  }

  // This is the magic function - use as is
  // a is the function (swap/add/remove/check)
  // o is the element object
  // c1 & c2 are the classnames 

  function cssjs(a,o,c1,c2) {
    switch (a) {
	case 'swap':
	  o.className=!cssjs('check',o,c1)?o.className.replace(c2,c1):o.className.replace(c1,c2);
	break;
	case 'add':
	  if(!cssjs('check',o,c1)){o.className+=o.className?' '+c1:c1;}
	break;
	case 'remove':
	  var rep=o.className.match(' '+c1)?' '+c1:c1;
	  o.className=o.className.replace(rep,'');
	break;
	case 'check':
	  return new RegExp('\\b'+c1+'\\b').test(o.className)
	break;
    }
  }

