	//Standard Utility Code
	var isNS = (document.layers) ? 1 : 0;
	var isIE = (document.all) ? 1 : 0;
	
	// Browser Parameters
	var HT_cHide = (isIE)? 'hidden':'hide';
	var HT_cShow = (isIE)? 'visible':'show';
	var HT_cXMargin = (isIE)? 10:8; 
	var HT_cYMargin = (isIE)? 15:8;
	
	// reload protection for NS4 Browsers 
	if (isNS) {
		origWidth = innerWidth;
		origHeight = innerHeight;
	}
	function ht_reDoNS() {
		if (innerWidth != origWidth || innerHeight != origHeight) location.reload();
	}
	if (isNS) onresize = ht_reDoNS;
	
	function ht_getLayerObj(strName, objBaseDoc)
	{
		//For NS a may have to traverse the layer hierarchy. 
		//objBase is the base layer document to start from.
		if (isIE) 
			return document.all[strName]; 
		
		var q=0; 
		var temp=null;
		
		if (objBaseDoc==null) 
		{
			objBaseDoc=document;
		} 
		
		if (objBaseDoc.layers[strName]!=null) 
			return objBaseDoc.layers[strName];
		
		for (q=0; q<objBaseDoc.layers.length; q++) 
		{ 
			if(objBaseDoc.layers[q].document.layers.length>0) 
			{ 
				temp = ht_getLayerObj(strName,objBaseDoc.layers[q].document); 
				if (temp != null) return temp; 
			} 
		}
		return null;
	}

	function ht_getLayerPropObj(strName) 
	{ 
		if (isIE) 
			return document.all[strName].style;
			
		if (isNS) 
			return d_getLayer(strName);
	}

	function ht_setLayerTop(layer, nTop) 
	{ 
		if (layer==null) layer=this; 
		
		if (isIE) 
		{
			layer.style.pixelTop = nTop;
			return;
		} 
		
		if (isNS) 
		{
			layer.top = nTop;
			return;
		} 
	}
	function ht_getLayerTop(layer) 
	{ 
		if (layer==null) layer=this; 
		
		if (isIE) return layer.style.pixelTop; 
		
		if (isNS) return layer.top; 
	}
			
	function ht_beginLayer(objBase,strName,z,vis,l,t,w,h,extra,ieStyleExtra) 
	{
		
		if (h==null) h=0;  
		if (w==null) w='100%';  
		if (w==0) w=1;  
		if (t==null) t=0;  
		if (l==null) l=0;  
		if (vis==null) vis=HT_cHide;  
		if (z==null) z=10; 
		if (extra==null) extra='';   
		if (ieStyleExtra==null) ieStyleExtra='';   
		if (isIE) 
		{ 
			var px = (isNaN(w))? '':'px'; 
		}
		if (isIE) 
		{
			isMac = (navigator.appVersion.indexOf("Mac") != -1);
			// try to work around Mac IE 5 bug
			ovfl = isMac?'none':'visible';
			document.write('<DIV ID="'+strName+'" STYLE="position:absolute; overflow:'+ovfl+'; left:'+l+'px; top:'+t+'px; width:'+w+px+'; height:'+h+'px; visibility:'+vis+'; z-index:'+z+';');
			if (ieStyleExtra.length > 0)
			{
				document.write(' '+ieStyleExtra);
			}
			document.writeln('" '+extra+'>');
		}
		if (isNS) 
		{
			objBase.document.writeln('<LAYER NAME="'+strName+'" left="'+l+'" top="'+t+'" width="'+w+'" height="'+h+'" visibility="'+vis+'" z-index="'+z+'" '+extra+'>'); 
		}
	}
	
	function ht_writeLayer(objBase,strName,content,z,vis,l,t,w,h,extra) 
	{
		ht_beginLayer(objBase,strName,z,vis,l,t,w,h,extra);
		if (isIE) document.writeln(content +'</DIV>');
		if (isNS) objBase.document.writeln(content +'</LAYER>'); }
	
	function ht_endLayer(objBase) 
	{ 
		if (isIE) 
			document.writeln('</DIV>'); 
		if (isNS) 
			objBase.document.writeln('</LAYER>'); 
	}
	function ht_setLayerVisiblility(layer, bVis)
	{
		if (layer==null) layer=this; 
		
		if (isIE) 
		{
			layer.style.visibility = bVis ? HT_cShow:HT_cHide;
			return;
		} 
		
		if (isNS) 
		{
			layer.visibility = bVis ? HT_cShow:HT_cHide;
			return;
		} 
		
	}
	function ht_setLayerPosition(layer, nX, nY)
	{
		if (layer==null) layer=this; 
		
		if (isIE) 
		{
			layer.style.pixelLeft = nX;
			layer.style.pixelTop = nY;
			return;
		} 
		
		if (isNS) 
		{
			layer.moveTo(nX, nY);
			return;
		} 
	}
	function ht_setLayerResize(layer, nWidth, nHeight)
	{
		if (layer==null) layer=this; 
		
		if (isIE) 
		{
			layer.style.width = nWidth;
			layer.style.height = nHeight;
			return;
		} 
		
		if (isNS) 
		{
			layer.resizeTo(nWidth, nHeight);
			return;
		} 
	}
	function ht_setLayerContent(objLayer, strText)
	{
		//var objLayer = ht_getLayerObj(strName, null);
		
		if (isNS)
		{
			objLayer.document.open();
			objLayer.document.write(strText);
			objLayer.document.close();
		}
		else if (isIE)
		{
			objLayer.innerHTML = strText;
		}
	}
	// End of Utility Code

