
	function jFocusInput(oElement, sDefault, bIsFocusing) {
		if (bIsFocusing && oElement.value == sDefault) {
			oElement.value = "";
		} else if (!bIsFocusing && oElement.value == "") {
			oElement.value = sDefault;
		}
	}
	
	function strripos (haystack, needle, offset) {
		var i = (haystack+'').toLowerCase().lastIndexOf((needle + '').toLowerCase(), offset);
		return i;
	}
	
	function jValidateSubmitURL(oForm) {
		var sValue = oForm['URL'].value;
		
		var oRegExp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
		var bIsValid = oRegExp.test(sValue);
		
		if (!bIsValid) {
			jShowAjaxAlert("ERROR", "You have entered an invalid [B]url[/B].[NL]Please try again.");
			return false;
		}
		
		return true;
	}
	
	function jLoadAjaxScreen(sURL) {
		jExecuteAjaxRequest(sURL, document.getElementById("AJAXInjectionTarget"), "Loading, please wait..");
		document.getElementById("AJAXInjectionContainer").style.display = "";
	}
	
	function jShowAjaxAlert(sHeader, sMessage) {
		jExecuteAjaxRequest("./ajax/alert.ajax.php", document.getElementById("AJAXInjectionTarget"), "Loading, please wait..", "&Header=" + sHeader + "&Message=" + sMessage);
		document.getElementById("AJAXInjectionContainer").style.display = "";
	}
	
	function jDeleteHyperlink(sHyperlinkID) {
		var bDeleteHyperlink = confirm("Do you really want to delete this hyperlink?");
		
		if (bDeleteHyperlink) {
			jExecuteAjaxProcessingRequest("./ajax/delete-hyperlink.ajax.php", "&HyperlinkID=" + sHyperlinkID, "DeleteHyperlink");
			jRestartAjaxInterval(0);
		}
	}
	
	function jPostCallback() {
		switch (sPostCallback) {
		case "DeleteHyperlink":
			jExecuteAjaxRequest("./ajax/dashboard.ajax.php", document.getElementById("DashboardInjection"), null);
			jRestartAjaxInterval(0);
			break;
		case "FlagRobot":
			jExecuteAjaxRequest("./ajax/visitors.ajax.php", document.getElementById("VisitorsInjection"), null, "&IsAutomated=Y");
			jRestartAjaxInterval(2);
			break;
		}
	}
	
	function jFlagRobot(sHash, bIsRobot) {
		jExecuteAjaxProcessingRequest("./ajax/flag-robot.ajax.php", "&ViewID=" + sHash + "&IsRobot=" + (bIsRobot ? "Y" : "N"), "FlagRobot");
		jRestartAjaxInterval(2);
	}
	
