/*obj browser detection */
function Is ()
{   
				var agt=navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.nav  = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1)));
    this.nav2 = (this.nav && (this.major == 2));
    this.nav3 = (this.nav && (this.major == 3));
				
    this.ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

    this.ie6     = (this.ie && (this.major == 4) && (agt.indexOf ("msie 6.") != -1));
    this.vms   = (agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1);
				this.chr = agt.indexOf('chrome') > -1;
}
var is = new Is(); 
//if (is.nav) {  ... navigator code here ... }
//else if (is.ie) {  ... explorer code here ... }


getViewportWidth = function() {
  var width=0;
  if( document.documentElement && document.documentElement.clientWidth ) {
    width = document.documentElement.clientWidth;
  }
  else if( document.body && document.body.clientWidth ) {
    width = document.body.clientWidth;
  }
  else if( window.innerWidth ) {
    width = window.innerWidth - 18;
  }
  return width;
}
getViewportHeight = function() {
  var height=0;
  if( document.documentElement && document.documentElement.clientWidth ) {
    height = document.documentElement.clientHeight;
  }
  else if( document.body && document.body.clientHeight ) {
    height = document.body.clientHeight;
  }
  else if( window.innerHeight ) {
    height = window.innerHeight;
  }
  return height;
}

//obj screen resolution 
function myscreen(){
var	width = getViewportWidth();
			if (width < 900){
				  width = "800";
			}else if (width < 1025){
			   width= "1024";
			}else if (width > 1025){
			   width= "1280";
			}else {width = "";	
			}
			return width ;
}


//win popup
function popWin( url, name, width, height, scroller ) {
	var outStr = 'height=' + height + ',width=' + width;
	if (scroller == true) {	outStr = outStr + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes';} 
	else if (scroller == false) {	outStr = outStr + ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no';} 
	else {	outStr = outStr +',menubar=yes,toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,resizable=yes';
	}newWindow=window.open(url, name, outStr);
}

//Sukerfish Menu
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
