
var browser_ie=(navigator.userAgent.indexOf('MSIE')>=0);
var browser_opera=(navigator.userAgent.indexOf('Opera')>=0);
var browser_webkit=(navigator.userAgent.indexOf('WebKit')>=0);
var browser_firefox=(navigator.userAgent.indexOf('Firefox')>=0);
var browser_mozilla=(navigator.userAgent.indexOf('Mozilla')>=0);

var debugging=false;
function debug(inMessage)
{
if (debugging){
if (objDebug=document.getElementById('debug')){
if (objMessage=document.createElement('div'))
{
objMessage.innerHTML=inMessage;
objDebug.appendChild(objMessage);
}}}
}

function doGetObjPos(objInput)
{
intOutLeft=0;
intOutTop=0;
intOutRight=objInput.offsetRight?objInput.offsetRight:null;
intOutBottom=objInput.offsetBottom?objInput.offsetBottom:null;
intOutWidth=objInput.offsetWidth?objInput.offsetWidth:null;
intOutHeight=objInput.offsetHeight?objInput.offsetHeight:null;
if (objInput.offsetParent)
{while (objInput.offsetParent)
{intOutLeft+=objInput.offsetLeft;
intOutTop+=objInput.offsetTop;
objInput=objInput.offsetParent;
}
}
else
if (objInput.x||objInput.y)
{intOutLeft+=objInput.x;
intOutTop+=objInput.y;
intOutWidth=objInput.width?objInput.width:null;
intOutHeight=objInput.height?objInput.height:null;
}
if ((intOutRight==null)&&intOutWidth){intOutRight=intOutLeft+intOutWidth;}
if ((intOutBottom==null)&&intOutHeight){intOutBottom=intOutTop+intOutHeight;}
rayOutput=new Array();
rayOutput['left']=intOutLeft;
rayOutput['right']=intOutRight;
rayOutput['top']=intOutTop;
rayOutput['bottom']=intOutBottom;
rayOutput['width']=intOutWidth;
rayOutput['height']=intOutHeight;
return rayOutput;
}
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;
}
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;
}
function removeNodeChildren(objInNode)
{
if (objInNode&&objInNode.childNodes)
{
for (n=0;n<objInNode.childNodes.length;n++)
{
objInNode.removeChild( objInNode.childNodes[n] );
}
}
}

function getArraySum(rayInput)
{
intOutput=0;
for (i=0;i<rayInput.length;i++){intOutput+=rayInput[i];}
return intOutput;
}

function setOpacity(objIn,intOpacity)
{
if (browser_ie)
{
objIn.style.filter='alpha(opacity='+intOpacity+')';
objIn.style.zoom='1';
}
else
{
objIn.style.opacity=(intOpacity/100);
}
}
var objBTHideTimer=null;
var objBTShowTimer=null;
var intBTFadeAmount=5;
var intBTFadeWait=25;
function hideElement(inElement)
{if (!inElement.id){inElement=document.getElementById(inElement);}
if (inElement)
{
if (!inElement.current_opacity){inElement.current_opacity=100;}
inElement.current_opacity-=intRPFadeAmount;
if (inElement.current_opacity<0){
inElement.current_opacity=0;
}
setOpacity(inElement,inElement.current_opacity);
if (inElement.current_opacity>0)
{
clearTimeout(objRPHideTimer);
objBTHideTimer=setTimeout("hideElement('"+inElement.id+"')",intBTFadeWait);
}
}
}
function showElement(inElement)
{if (!inElement.id){inElement=document.getElementById(inElement);}
if (inElement)
{
if (!inElement.current_opacity){inElement.current_opacity=0;}
inElement.current_opacity+=intRPFadeAmount;
if (inElement.current_opacity>100){
inElement.current_opacity=100;
}
setOpacity(inElement,inElement.current_opacity);
if (inElement.current_opacity<100)
{
clearTimeout(objBTHideTimer);
objBTShowTimer=setTimeout("showElement('"+inElement.id+"')",intBTFadeWait);
}
}
}
var hideElementTimer=null;
var hideElementDelay=1000;
function requestShowElement(inElement)
{
window.clearTimeout(hideElementTimer);
showElement(inElement);
}
function requestHideElement(inElement)
{
hideElementTimer=window.setTimeout("hideElement('"+inElement.id+"')",hideElementDelay);
}

var rayLoadedImages=new Array();
function loadImage(strImageUrl)
{
objNewImage=new Image();
objNewImage.src=strImageUrl;
rayLoadedImages[strImageUrl]=objNewImage;
return rayLoadedImages[strImageUrl];
}
var rayImageTimers=new Array();
function waitForImageComplete(strImageUrl,strFollowupFunction)
{clearTimeout(rayImageTimers[strImageUrl]);
if (rayLoadedImages[strImageUrl].complete)
{rayImageTimers[strImageUrl]=setTimeout(strFollowupFunction,0);}
else
{rayImageTimers[strImageUrl]=setTimeout("waitForImageComplete('"+strImageUrl+
"',\""+strFollowupFunction+"\")",100);}
}

function DataStrToRay(strInput)
{
rayOutput=new Array();
rayInput=strInput.split(';');
for (dstri=0;dstri< rayInput.length;dstri++)
{
rayThisPair=rayInput[dstri].split(':');
rayOutput[rayThisPair[0]]=rayThisPair[1];
}
return rayOutput;
}
function DataRayToStr(rayInput)
{
strOutput='';
for (drtsi in rayInput)
{
if (typeof(rayInput[drtsi]) != 'function')
{
if (strOutput) strOutput+=';';
strOutput+=drtsi+':'+rayInput[drtsi];
}
}
return strOutput;
}
function summarize(rayInput)
{
strOutput='';
for (smrzi in rayInput)
{
if (typeof(rayInput[smrzi]) != 'function')
{
if (strOutput) strOutput+=',';
strOutput+=smrzi+':'+rayInput[smrzi];
}
}
return strOutput;
}
