/*
*/
	var message = "function disabled"; 
	function rtclickcheck(keyp)
		{ 
		if (navigator.appName == "Netscape" && keyp.which == 3)
			{ 	
			alert(message); 
			return false; 
			} 
		if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) 
			{ 	
			alert(message); 	
			return false; 
			} 
		} 
	document.onmousedown = rtclickcheck;
				
/*
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			*/

/***************************************************************************************/
			/*
			Document findPosX Script- 
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			!! DO NOT REMOVE THIS DISCLAIMER !!
			*/
/***************************************************************************************/
function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

/***************************************************************************************/
			/*
			Document findPosY Script- 
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			!! DO NOT REMOVE THIS DISCLAIMER !!
			*/
/***************************************************************************************/
function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

/***************************************************************************************/
			/*
			Document setCookie Script- 
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			!! DO NOT REMOVE THIS DISCLAIMER !!
			*/
/***************************************************************************************/
function setCookie(name, value, expires, path, domain, secure)
{
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
//		"; expires=Thu, 01-Jan-06 00:00:01 GMT" + 
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

/***************************************************************************************/
			/*
			Document getCookie Script- 
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			!! DO NOT REMOVE THIS DISCLAIMER !!
			*/
/***************************************************************************************/
function getCookie(name)

{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

/***************************************************************************************/
			/*
			Document deleteCookie Script- 
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			!! DO NOT REMOVE THIS DISCLAIMER !!
			*/
/***************************************************************************************/
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";
    }
}

/***************************************************************************************/
			/*
			Document randomNumber Script- 
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			!! DO NOT REMOVE THIS DISCLAIMER !!
			*/
/***************************************************************************************/
function randomNumber(min,max)
	{
	var ranNum = 0;
//	ranNum = (Math.round((Math.random()*max)+min));
	ranNum = (Math.round((Math.random()*(max-min))+min));
	if(ranNum<min||ranNum>max)
		{
		randomNumber(min,max);
		}
	return ranNum;
	}

/***************************************************************************************/
			/*
			Document pageSound Script- 
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			!! DO NOT REMOVE THIS DISCLAIMER !!
			*/
/***************************************************************************************/
function pageSound(soundFile)
	{
	if (navigator.appName == "Microsoft Internet Explorer")
		document.writeln ('<BGSOUND SRC="' + soundFile + '">');
	else if (navigator.appName == "Netscape")
    	document.writeln ('<EMBED SRC="' + soundFile + '" AUTOSTART=TRUE WIDTH=144 HEIGHT=60><P>');
	}

/***************************************************************************************/
			/*
			Document randomText Script- 
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			!! DO NOT REMOVE THIS DISCLAIMER !!
			*/
/***************************************************************************************/
var varTemp="";
var intInterval=100;

function randomText(displayVal,alpha)
	{
	var digitChar="";

	if(varTemp==displayVal)
		{
		clearInterval(doIt);
		}
	for(i=0;i<displayVal.length;i++)
		{
		if(varTemp.charAt(i)!=displayVal.charAt(i)||alpha==2)
			{
			if(alpha==0)
				{
				digitChar+=randomNumber(0,9);
				}
			else
				{
				digitChar+=ascii2text(randomNumber(32,126));
				}
			}
		else
			{
				digitChar+=displayVal.charAt(i);
			}
		}
	varTemp=digitChar;

	return digitChar;
	}

/***************************************************************************************/
			/*
			Document ascii2text Script- 
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			!! DO NOT REMOVE THIS DISCLAIMER !!
			*/
/***************************************************************************************/
function ascii2text(num)
	{
	return String.fromCharCode(num);
	}

/***************************************************************************************/
			/*
			Document showHide Script- 
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			!! DO NOT REMOVE THIS DISCLAIMER !!
			*/
/***************************************************************************************/
function showHide(elem)
	{
	if(elem.style.display=="none")
		{
		elem.style.display="inline";
		}
	else
		{
		elem.style.display="none";
		}
	}

/***************************************************************************************/
			/*
			Document getTime Script- 
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			!! DO NOT REMOVE THIS DISCLAIMER !!
			*/
/***************************************************************************************/
function getTime(statusBarDisplay)
	{
	var now = new Date();
	var hours = now.getHours();
	var minutes = now.getMinutes();
	var seconds = now.getSeconds()

	var timeValue = "" + ((hours >12) ? hours -12 :hours)
	timeValue += ((minutes < 10) ? ":0" : ":") + minutes
	timeValue += ((seconds < 10) ? ":0" : ":") + seconds
	timeValue += (hours >= 12) ? " P.M." : " A.M."

	if(statusBarDisplay=1)
		{
		window.status = timeValue;
		}
			
	return timeValue;
	}

/***************************************************************************************/
			/*
			Document getTime Script- 
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			!! DO NOT REMOVE THIS DISCLAIMER !!
			*/
/***************************************************************************************/
function newDiv(xPos,yPos)
	{
	var objDiv=document.createElement("div");
	objDiv.id="1";
	objDiv.name="1";
	objDiv.style.width=2;
	objDiv.style.height=1;
	objDiv.style.top=yPos;
	objDiv.style.left=xPos;
	objDiv.style.border="1px solid black";
	objDiv.style.position="absolute";
	objDiv.style.fontSize=0;
 	document.body.appendChild(objDiv);
	}


function mouseX(evt) {
if (evt.pageX) return evt.pageX;
else if (evt.clientX)
   return evt.clientX + (document.documentElement.scrollLeft ?
   document.documentElement.scrollLeft :
   document.body.scrollLeft);
else return null;
}
function mouseY(evt) {
if (evt.pageY) return evt.pageY;
else if (evt.clientY)
   return evt.clientY + (document.documentElement.scrollTop ?
   document.documentElement.scrollTop :
   document.body.scrollTop);
else return null;
}

/***************************************************************************************/
			/*
			Document decimal to hex/hex to decimal converter Script- 
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			!! DO NOT REMOVE THIS DISCLAIMER !!
			*/
/***************************************************************************************/
var hD="0123456789ABCDEF";
function d2h(d) {
var h = hD.substr(d&15,1);
while(d>15) {d>>=4;h=hD.substr(d&15,1)+h;}
return h;
}
function h2d(h) {return parseInt(h,16);} 
/*
*/

function simpleRandomText(maxChars)
	{
	var returnString="";
	var rand=32;
	
	for(i=0;i<maxChars;i++)
		{
//		rand=randomNumber(32,126);
		rand=randomNumber(65,122);
		if ((rand>90)&(rand<97))
			{
			rand=32;
			}
		returnString+=ascii2text(rand);
		}
	
	return returnString;	
	}
	
/***************************************************************************************/
			/*
			Document showHTML() Script- 
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			!! DO NOT REMOVE THIS DISCLAIMER !!
			*/
/***************************************************************************************/
function showHTML()
 {
  return document.body.innerHTML;
 }

/***************************************************************************************/
			/*
			Document createDiv() Script- 
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			!! DO NOT REMOVE THIS DISCLAIMER !!
			*/
/***************************************************************************************/
			var DivObj;
			var myArray=new Array();
			function createDiv(objName,inObj,objColor,borderWidth,width,height,left,top)
			 {
				try 
			  		{
				   	var tempDiv=document.createElement('div');
//				   	tempDiv.setAttribute('id',objName);
//				   	tempDiv.setAttribute('name',objName);
//				   	tempDiv.style.border=borderWidth+'px solid '+objColor;
			       tempDiv.style.backgroundColor=objColor;
				   	tempDiv.style.left=left+'px';
				   	tempDiv.style.top=top+'px';
				   	tempDiv.style.width=width+'px';
				   	tempDiv.style.height=height+'px';
				   	tempDiv.style.position='absolute';
//				   	tempDiv.style.display='inline';
//				   	tempDiv.style.fontSize='1px';
//				   	tempDiv.style.fontSize='1px';
				   	tempDiv.style.overflow='hidden';
			 		
					if (inObj=='body')
			   			{
						DivObj = document.body.appendChild(tempDiv);
			   			}
			  		else
			   			{
						DivObj = document.getElementById(inObj).appendChild(tempDiv);
			   			}
				  
				   	if (document.frames) 
			   			{
					 	// this is for IE5 Mac, because it will only
					 	// allow access to the document object
					 	// of the IFrame if we access it through
					 	// the document.frames array
					 	DivObj = document.frames[objName];
						}
				 	} 
			 
			 	catch(exception) 
			  		{
				   	// This is for IE5 PC, which does not allow dynamic creation
				   	// and manipulation of an iframe object. Instead, we'll fake
				   	// it up by creating our own objects.
				   	divHTML='\<div ';
				  	divHTML+='id="'+objName+'" ';
				  	divHTML+='name="'+objName+'" ';
				   	divHTML+='border:'+borderWidth+'px solid black;';
				   	divHTML+='left:'+left+'px;';
				   	divHTML+='top:'+top+'px;';
				   	divHTML+='width:'+width+'px;';
				   	divHTML+='height:'+height+'px;';
				   	divHTML+='position:absolute;';
				   	divHTML+='display=inline;';
				   	divHTML+='fontSize=1px;';
				   	divHTML+='"><\/div>';
			//       document.body.innerHTML+=divHTML;
				   	document.getElementById(inObj).innerHTML+=divHTML;
					
				   	DivObj = new Object();
				   	DivObj.document = new Object();
				   	DivObj.document.location = new Object();
				   	DivObj.document.location.iframe = document.getElementById(objName);
				   	DivObj.document.location.replace = function(location) {this.iframe.src = location;}
				 	}
			 	}

/***************************************************************************************/
			/*
			Document showHide() Script- 
			By 4DHypercube (www.4dhypercube.com)
			For Terms Of Use, 
			visit 4dhypercube.com
			!! DO NOT REMOVE THIS DISCLAIMER !!
			*/
/***************************************************************************************/
function showHide2(objId)
	{

	if(document.getElementById(objId).style.display==""||document.getElementById(objId).style.display=="inline"||document.getElementById(objId).style.display=="block")
		{
		document.getElementById(objId).style.display="none";
		}
	else
		{
		document.getElementById(objId).style.display="inline";
		}
	}


//***********************************************************************************
function jsContentGrabSearch(strContent,strURL)
	{
//the original XMLHTTP was unpredictable
//had to close all browsers after session expired...
//	i=1;
//	while((txtContent.length>0) && (i<strSkip))
//		{
		var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHttp.open("GET", strURL, false);
		xmlHttp.setRequestHeader("Content-type", "text/plain");
		xmlHttp.send();
		xmlDoc=xmlHttp.responseText;
//		document.write(xmlDoc);
//		alert(xmlDoc.substr(xmlDoc.indexOf("&Unit=")+6,5));
		var strReturn=xmlDoc.substr(xmlDoc.indexOf(strContent)+6,5);

//		strSkip++;
//		}

	return (strReturn);
	}
//***********************************************************************************


//***********************************************************************************
function jsContentGrab(strURL)
	{
//the original XMLHTTP was unpredictable
//had to close all browsers after session expired...
		var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHttp.open("GET", strURL, false);
		xmlHttp.setRequestHeader("Content-type", "text/plain");
		xmlHttp.send();
		xmlDoc=xmlHttp.responseText;

	return (xmlDoc);
	}
//***********************************************************************************




function copyRow(oTable,oRow,iOffsetFromEnd)
{
	var i,j; 
//	var newRow = oTable.insertRow(oTable.rows.length+iOffsetFromEnd);
	var newRow = oTable.insertRow(oTable.rows.length);
	for (i=0;i<oRow.cells.length;i++)
	{
		newRow.insertCell(i).innerHTML = oRow.cells[i].innerHTML;
		newRow.cells[i].className = oRow.cells[i].className;
	}
}

function insertRow(tableId,rowId,cells,displayIf,rowIndex)
{
	if (isNaN(rowIndex))
	{
		rowIndex = -1
	}
	var theTable = document.getElementById(tableId);
	var newRow = theTable.insertRow(rowIndex);
	newRow.id = rowId;
	if (displayIf.length > 0)
	{
		newRow.displayif = displayIf;
		dynamicElements[dynamicElements.length++] = newRow;
	}
	var arrCells = new Array();
	for (var i=0;i<cells;i++)
	{
		arrCells[arrCells.length++] = newRow.insertCell(i);
	}
	return arrCells;
}

