﻿// JScript File
var divHeaderMenu;
function BrowserCheck()
        {
            this.ver = navigator.appVersion;
            this.agent = navigator.userAgent;
            this.dom = document.getElementById ? 1 : 0;
            this.opera5 = this.agent.indexOf("Opera 5") >- 1;
            this.ie5 = (this.ver.indexOf("MSIE 5") >- 1 && this.dom && !this.opera5) ? 1 : 0; 
            this.ie6 = (this.ver.indexOf("MSIE 6") >- 1 && this.dom && !this.opera5) ? 1 : 0;
            this.ie4 = (document.all && !this.dom && !this.opera5) ? 1 : 0;
            this.ie = this.ie4 || this.ie5 || this.ie6;
            this.mac = this.agent.indexOf("Mac") >- 1;
            this.ns6 = (this.dom && parseInt(this.ver) >= 5) ? 1 : 0; 
            this.ns4 = (document.layers && !this.dom) ? 1 : 0;
            this.bw = (this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5);
            return this;
        }
        function findPosX(obj)
        {
            bw = BrowserCheck();
            
            var curleft 
            if(bw.ie)
                curleft = 7;
            else
                curleft = 0
            if(obj.offsetParent)
            while(1) 
            {
              curleft += obj.offsetLeft;
              if(!obj.offsetParent)
                break;
              obj = obj.offsetParent;
            }
            else if(obj.x)
                curleft += obj.x;
            return curleft;
        }

        function findPosY(obj)
        {
            var curtop = 0;
            if(obj.offsetParent)
            while(1)
            {
              curtop += obj.offsetTop;
              if(!obj.offsetParent)
                break;
              obj = obj.offsetParent;
            }
            else if(obj.y)
                curtop += obj.y;
            return curtop;
        } 
        
        
        
        //////// Trim /////
        function Trim(TRIM_VALUE){
if(TRIM_VALUE.length < 1){
return"";
}
TRIM_VALUE = RTrim(TRIM_VALUE);
TRIM_VALUE = LTrim(TRIM_VALUE);
if(TRIM_VALUE==""){
return "";
}
else{
return TRIM_VALUE;
}
} //End Function

function RTrim(VALUE){
var w_space = String.fromCharCode(32);
var v_length = VALUE.length;
var strTemp = "";
if(v_length < 0){
return"";
}
var iTemp = v_length -1;

while(iTemp > -1){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(0,iTemp +1);
break;
}
iTemp = iTemp-1;

} //End While
return strTemp;

} //End Function

function LTrim(VALUE){
var w_space = String.fromCharCode(32);
if(v_length < 1){
return"";
}
var v_length = VALUE.length;
var strTemp = "";

var iTemp = 0;

while(iTemp < v_length){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(iTemp,v_length);
break;
}
iTemp = iTemp + 1;
} //End While
return strTemp;
} //End Function
