//NS - Netscape
//IE - Internet Explorer
//OP - Opera
	var NS, IE, OP, IE6_up, NS6_up;
	NS = IE = OP = IE6_up = NS6_up = false;
	if (navigator.appName == "Netscape")
	{
		NS = true;
		if (navigator.userAgent.indexOf("Netscape/4.0", 0) >= 0)
			NS6_up = false;	
		else if (navigator.userAgent.indexOf("Netscape/5.0", 0) >= 0)
			NS6_up = false;
		else
			NS6_up = true;
	}
	else if (navigator.appName == "Microsoft Internet Explorer")
	{ 		
		IE = true;
		if (navigator.userAgent.indexOf("MSIE 4", 0) >= 0)
			IE6_up = false;
		if (navigator.userAgent.indexOf("MSIE 5.0", 0) >= 0)
			IE6_up = false;
		else 
			IE6_up = true;	
	}
	else if (navigator.appName == "Opera")		
	{
		OP = true;		
	}

    function getCurrentURLPath()
    {
		var path = window.location.protocol + '//' + window.location.hostname;
		var lSI = window.location.pathname.lastIndexOf('/');
		
		if (lSI <= 0)
			return path;

		return path + window.location.pathname.substring(0, lSI);
    }
	
	function TrimStr(str)
	{
		var newStr = str;

		while ((newStr.charAt(0) == ' ') && (newStr.length > 0))
			newStr = newStr.substring(1, newStr.length);

		while ((newStr.charAt(newStr.length - 1) == ' ') && (newStr.length > 0))
			newStr = newStr.substring(0, newStr.length - 1);

		return newStr;
	}

	function myIsIntQ(str)
	{
		if ((str == '') || (parseInt(str) < 1) || (parseInt(str) > 100000))
			return false;
		
		for (var i=0;i<str.length;i++)
			if (parseInt(str.charAt(i)).toString() == 'NaN')
			return false;
			
		return true;
	}
    
	function myReplace(sourceStr, oldSubStr, newSubStr)
    {
        while (sourceStr.indexOf(oldSubStr) != -1)
            sourceStr = sourceStr.replace(oldSubStr, newSubStr);
            
        return sourceStr;
    }
