var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 && parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
var isMinNS6 = (isMinNS4 && navigator.userAgent.indexOf("Gecko")>=0) ? 1 : 0;
var isMinIE4 = (document.all) ? 1 : 0;
var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.")) >= 0 ? 1 : 0;
var isDOM = (document.getElementById) ? 1 : 0;
function hideLayer(l) {if (isMinIE4||isDOM) l.style.visibility = "hidden"; if (isMinNS4)l.visibility = "hide";}
function showLayer(l) {if (isMinIE4||isDOM)l.style.visibility = "visible";if (isMinNS4) l.visibility = "show";}
function moveLayerTo(l, x, y) {if (isMinIE4||isDOM) {l.style.left = x + "px"; l.style.top  = y + "px";return;}if (isMinNS4)l.moveTo(x, y);}
function getPageLeft(l) {if (isMinIE4||isDOM) return(l.offsetLeft);if (isMinNS4) return(l.pageX);return(-1);}
function getPageTop(l) {if (isMinIE4||isDOM) return(l.offsetTop);if (isMinNS4) return(l.pageY);return(-1);}
function getWidth(l) {if (isDOM){if (l.style.width)return(parseInt(l.style.width));else return(l.clientWidth);}if (isMinIE4) {if (l.style.pixelWidth) return(l.style.pixelWidth); else return(l.clientWidth);}if (isMinNS4) {if (l.width) return(l.width); else return(l.clip.right - l.clip.left);} return(-1);}
function getHeight(l) {if (isDOM){if (l.style.height) return(parseInt(l.style.height)); else return(l.clientHeight);} if (isMinIE4) {if (false && l.style.pixelHeight) return(l.style.pixelHeight); else return(l.clientHeight);} if (isMinNS4) {if (l.height) return(l.height); else return(l.clip.bottom - l.clip.top);} return(-1);}
function setBgColor(l, color) {if (isMinIE4||isDOM) l.style.backgroundColor = color;if (isMinNS4) l.bgColor = color;}
function setBgImage(l, src) {if (isMinIE4||isDOM) l.style.backgroundImage = "url(" + src + ")";if (isMinNS4) l.background.src = src;}
function getLayer(name) {if (isDOM) return document.getElementById(name);if (isMinNS4) return findLayer(name, document);if (isMinIE4) return eval('document.all.' + name); return null;}
function findLayer(name, doc) {var i, l;for (i = 0; i < doc.layers.length; i++) {l = doc.layers[i];if (l.name == name) return l;if (l.document.layers.length > 0) {l = findLayer(name, l.document);if (l != null) return l;}} return null;}
function getImage(name) {if (isDOM) return document.getElementById(name); if (isMinNS4) {return findImageNS(name, document);} if (isMinIE4) return eval('document.all.' + name); return null;}
function findImageNS(name, doc) {var i, img;for (i = 0; i < doc.images.length; i++) if (doc.images[i].name == name) return doc.images[i];for (i = 0; i < doc.layers.length; i++) if ((img = findImage(name, doc.layers[i].document)) != null) {img.container = doc.layers[i]; return img;}  return null;}
function getImagePageLeft(img) {var x, obj;if (isMinNS4) {if (img.container != null) return img.container.pageX + img.x; else  return img.x;} if (isMinIE4||isDOM) {x = 0;obj = img; while (obj.offsetParent != null) {x += obj.offsetLeft;obj = obj.offsetParent;}x += obj.offsetLeft;return x;} return -1;}
function getImagePageTop(img) { var y, obj;if (isMinNS4) {if (img.container != null) return img.container.pageY + img.y; else return img.y;}if (isMinIE4||isDOM) {y = 0;obj = img;while (obj.offsetParent != null) {y += obj.offsetTop;obj = obj.offsetParent;}y += obj.offsetTop; return y;}return -1;}
function showActiveImg (activeobj){if (activeobj!=window.curActiveImg){	window.curActiveImg = activeobj;window.oldActiveImgSrc = activeobj.src;	activeobj.src = activeobj.src.replace(".gif","_over.gif");}}
function hideActiveImg (){if (window.curActiveImg != null){window.curActiveImg.src = window.oldActiveImgSrc;window.curActiveImg = null;}}
function MM_reloadPage(init) {if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();}
function _cookiesAreEnabled()
{
	SetCookie( "foo", "bar" );
	if ( GetCookie( "foo" ) )
	{
		DeleteCookie( "foo" );
		return true;
	}
	else
	{
		return false;
	}
}
navigator.cookiesAreEnabled = _cookiesAreEnabled;

 

function _getHVCCAuthID() {

  return GetCookie( "HVCCAuthID" );

}

document.getHVCCAuthID = _getHVCCAuthID;

 

function GetCookie( name ) {

  var arg = name + "=";

  var alen = arg.length;

  var clen = document.cookie.length;

  var i = 0;

  while ( i < clen ) {

    var j = i + alen;

    if ( document.cookie.substring(i, j) == arg ) return getCookieVal(j);

    i = document.cookie.indexOf( " ", i ) + 1;

    if ( i == 0 ) break;

  }

  return null;

}

 

function DeleteCookie( name, path, domain ) {

  if ( GetCookie( name ) ) {

    document.cookie = name + "=" +

    ( ( path ) ? "; path=" + path : "" ) +

    ( ( domain ) ? "; domain=" + domain : "" ) +

    "; expires=Thu, 01-Jan-70 00:00:01 GMT";

  }

}

 

function SetCookie( name, value, expires, path, domain, secure ) {

  document.cookie = name + "=" + escape (value) +

  ( ( expires ) ? "; expires=" + expires.toGMTString() : "" ) +

  ( ( path ) ? "; path=" + path : "" ) +

  ( ( domain ) ? "; domain=" + domain : "" ) +

  ( ( secure ) ? "; secure" : "" );

}

 

/**

 *   Helper function for GetCookie()

 */

function getCookieVal( offset ) {

  var endstr = document.cookie.indexOf ( ";", offset );

  if ( endstr == -1 ) endstr = document.cookie.length;

  return unescape( document.cookie.substring( offset, endstr ) );

}
