function isMSIE(){
    return (window.navigator.userAgent.indexOf("MSIE") >= 0);
}

function isSafari(){
    return (window.navigator.userAgent.indexOf("Safari") >= 0);
}

function isMozilla(){
    return (window.navigator.userAgent.indexOf("Firefox") >= 0);
}

function BodyClick(e){
    document.body.event = e;
}

function getEvent(){
    var evt;    
    if (isMSIE() || isSafari()) evt = event ? event : window.event;
	if (isMozilla()) evt = document.body.event;
	return evt;
}

function isNull(item){
    return (typeof(item) == 'undefined' || item == null)
}

function toInt(item){
    var result = 0;
    if (!isNull(item)) result = isNaN(parseInt(item)) ? 0 : parseInt(item);
    return result;
}

function HyperLinkClick(ID, Url)
{
    if(isMozilla())
    {
        var a = document.getElementById(ID);
        var NewUrl = Url.replace("~","");
        a.href = NewUrl;
    }
}
function Download(src)
{
	if(isSafari()) 
	{
		if(window.clientInformation.platform.indexOf("Mac") < 0)
		{
				src.target="_blank";
		}
	}
}