﻿var ua = navigator.userAgent.toLowerCase();
var isOpera = ua.indexOf("opera") != -1; 
var isIE = ((ua.indexOf("msie") != -1) && !isOpera && (ua.indexOf("webtv") == -1)); 
var isGecko = ua.indexOf("gecko") != -1;
var isNetscape = ua.indexOf("netscape") != -1;
var isFirefox = ua.indexOf("firefox") != -1;

function gebi(id){ return document.getElementById(id); }
function GetAbsPosition(obj) {
	this.x = 0; this.y = 0;
    while(obj) { this.x += obj.offsetLeft; this.y += obj.offsetTop; obj = obj.offsetParent; }
	return {x:this.x,y:this.y};
}
function ReplaceAll(Text, Token, NewToken){
    var NewText="";
    try{
        for (var i=0; i<Text.length; i++){
            if (i+Token.length<=Text.length){
                if (Text.substring(i, i+Token.length).toLowerCase()==Token.toLowerCase()){
                    NewText+=NewToken;
                    i+=Token.length-1;
                }else{
                    NewText+=Text.substring(i, i+1);
                }
            }else{ NewText+=Text.substring(i, i+1); }
        }
    }catch(ex){
        return "";
    }
    return NewText;
}

function Button_MouseDown(id){
    gebi(id).className="ButtonDown";
}
function Button_MouseUp(id){
    gebi(id).className="Button";
}

function ShowHelp(id){

    return false;
}