
function verifyCompatibleBrowser(){ 
    this.ver=navigator.appVersion 
    this.dom=document.getElementById?1:0 
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
    this.ie4=(document.all && !this.dom)?1:0; 
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
    this.ns4=(document.layers && !this.dom)?1:0; 
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
    return this 
} 
var bw = new verifyCompatibleBrowser();

function getEventY(e){if (e.pageY) {return e.pageY} else {if (e.clientY){return e.clientY} else {return false}}}
function getEventX(e){if (e.pageX) {return e.pageX} else {if (e.clientX){return e.clientX} else {return false}}}	

function addEvent(obj, evType, strJscript){ 
	var strFuncName = randomString(12);
	eval("window.document."+strFuncName+" = function(e){"+strJscript+"}")
	if (document.body.addEventListener){
		eval("obj.addEventListener(evType,window.document."+strFuncName+",false)")
		}
	else{eval("obj.on"+evType+" = function(){"+strJscript+"}")}
	}
	
function randomString(argLength) {
    pool = new String("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
    var i = 0;
    var str = "";
    while (i <= argLength) {
        rand = parseFloat(Math.random()) * parseInt(pool.length);
        str += pool.charAt(rand);
        i++;
    }
    return str
}

function funcGetScreenInnerWidth(){
	if (window.innerWidth){return window.innerWidth;}
	else if (document.body.offsetWidth){return document.body.offsetWidth;}
	else {alert("unexpected error!! please report at support@tpm-webapplicaties.nl, thank you")}
	}

function funcGetScreenInnerHeight(){
	if (window.innerHeight){return window.innerHeight;}
	else if (document.body.offsetHeight){return document.body.offsetHeight;}
	else {alert("unexpected error!! please report at support@tpm-webapplicaties.nl, thank you")}
	}

