var g_ns4 = (document.layers)? true:false
var g_ie4 = (document.all)? true:false
var g_ns6 = (document.getElementById && !document.all)? true:false
function htmlEncode(input)
{
	var strEmpty = "";
	if( input != null && input != strEmpty) 
    		return escape(input).replace(/\+/g,"%2b");
	else
		return strEmpty;	
}
function htmlEncodeURI(input)
{
	var strEmpty = "";
	if( input != null && input != strEmpty) 
    		return encodeURIComponent(input).replace(/\+/g,"%2b");
	else
		return strEmpty;	
}

function submitGIFForm(formObject){
	formObject.submit();
}

function escapeStateValueInURL(dlcURL)
{
	var stateStartIndex = dlcURL.indexOf('&state=');
	var stateEndIndex = dlcURL.indexOf('&',stateStartIndex+1);
	var stateTextValue = dlcURL.substring(stateStartIndex,stateEndIndex);
	var stateValue = stateTextValue.substring(stateTextValue.indexOf('=') + 1);
	var newDLCURL = dlcURL.substring(0,stateStartIndex) + "&state=" + escape(unescape(stateValue)) + dlcURL.substring(stateEndIndex);
	return newDLCURL;
}

function WM_netscapeCssFix() {
	if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
		location.href = location.href;
	}
}

function WM_netscapeCssFixCheckIn() {
	if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
		if (typeof document.WM == 'undefined') {
			document.WM = new Object;
		}
		if (typeof document.WM.WM_scaleFont == 'undefined') {
			document.WM.WM_netscapeCssFix = new Object;
			document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
			document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
		}
		window.onresize = WM_netscapeCssFix;
	}
}

function displayPreviousPage(){
	window.history.back();
}
