function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function chkBrowser(){
  var chkAgent1=navigator.userAgent;
  var chkVersion=navigator.appVersion.substring(0,3);
  var IE=chkAgent1.search(/MSIE/i);
  var Netscape=chkAgent1.search(/Netscape/i);
  var Opera=chkAgent1.search(/Opera/i);
  var Mozilla=chkAgent1.search(/Mozilla/i);
  var compatible=chkAgent1.search(/compatible/i);
  var Firefox=chkAgent1.search(/Firefox/i);
  var Gecko = chkAgent1.search(/Gecko/i);

  if (IE != -1 && compatible != -1 && Mozilla != -1 && Netscape == -1 &&
chkVersion == "4.0" ){
  	Browser = "MSIE";
	var startpos = navigator.userAgent.search(/MSIE/i);
	var startid = startpos + 5;
	var end = startpos + 8;
	getVersion = navigator.userAgent.substring(startid,end);
	return(Browser + getVersion);
  }
  if (Opera != -1 && Mozilla != -1 && compatible != -1){
	Browser = "Opera";
	var startpos = navigator.userAgent.search(/Opera/i);
	var startid = startpos + 6;
	var end = startpos + 10;
	getVersion = navigator.userAgent.substring(startid,end);
	return(Browser + getVersion);
  }
  if (Mozilla != -1 && Firefox == -1 && chkVersion == "5.0" &&
compatible == -1 && Netscape == -1){
  	Browser = "Mozilla";
	var startpos = navigator.userAgent.search(/rv/i);
	var startid = startpos + 3;
	var end = navigator.userAgent.search(/G/i);
	var endpos = end -2;
	getVersion = navigator.userAgent.substring(startid,endpos);
	return(Browser + getVersion);
  }
  if (Mozilla != -1 && Firefox != -1 && chkVersion == "5.0"  &&
compatible == -1 && Netscape == -1){
  	Browser = "Firefox";
	var startpos = navigator.userAgent.search(/rv/i);
	var startid = startpos + 3;
	var end = navigator.userAgent.search(/G/i);
	var endpos = end -2;
	getVersion = navigator.userAgent.substring(startid,endpos);
	return(Browser + getVersion);
  }
  if ((Mozilla != -1 && chkVersion == "4.8")){
  	Browser = "Netscape";
	getVersion = "4.8";
	return(Browser + getVersion);
  }
  
  if (Netscape != -1){
  	Browser = "Netscape";
	var startpos = navigator.userAgent.search(/Netscape/i);
	var startid = startpos + 9;
	var end = startpos + 12;
	getVersion = navigator.userAgent.substring(startid,end);
	return(Browser + getVersion);

  }
}
