<?php 
function SQLSafe($val){
	$val = str_ireplace("--", "", $val);
	$val = str_ireplace("'", "''", $val);
	return $val;
}
function redirect($url){
$pos1 = stripos($url, '.php');

// Nope, 'a' is certainly not in 'xyz'
if ($pos1 === false) {
   $url=$url.".php";
}
	
	echo("<script>");	
	echo("document.location='".$url."'");
	echo("</script>");	
	exit();
}

?>

<script>
	function cancelAct(val){
		if(confirm("Are you sure want to cancel!")){
			document.location = val+'.php';
		}
	}
	function ExecAction(WM_ActionToExec, ArticleID, ConfirmText) {
		document.admin.location_id.value = ArticleID;
	//	document.admin.<%=WM_CompPrefix%>.value = WM_ActionToExec;
		document.admin.FormAction.value = WM_ActionToExec;
		if (ConfirmText != "") {
			if (confirm("Are you sure you wish to " + ConfirmText + "?") == false) {
				return;
			}
		}
	//	document.admin.PageNumber.value = "<%=PageNum%>";
	//	alert(document.admin.FormAction.value);
		document.admin.submit();
	}
</script>