// JavaScript global functions in pg_header.inc.php
function openpopup(url, width, height, sbar, rsize){winpops=window.open(url,"",+"'"+"scrollbars="+ sbar +", resizable="+ rsize +", width="+ width +", height="+ height +", left=350, top=200"+"'")} 
function confirmDelete(str, title){ if ((window.confirm('Are you sure you want to '+ str + ': \n"'+ title +'"?')) == true) return true; else return false; }
function validate(){ 
formObj = document.index; 
if (isValidEmail(formObj.email.value) == false){
	alert("Please enter valid email address. Thank You.");
	return false;
}else{
	return true; 
	}
} 
//return true if . and @ exist
function isValidEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}
function noexchange(){
	formObj = document.index;
	if(formObj.nocheck.checked == true){
		formObj.reclink.value = formObj.domainname.value;
	}else{
		formObj.reclink.value = "";
	}
}
function gethtmltitle(url,cat,email,reclink){
	formObj = document.index;
	if(formObj.reclink.value==""){
	reclink = url;
	}
	var attrbs ="&c="+cat+"&em="+email+"&rl="+reclink;
	if(url.indexOf('http://') ==-1){
		url = "http://"+url;
	}
	var geturl = "scr_gethtmltitle.php?remurl=";
	document.location.href(geturl+url+attrbs);
	url="";
	cat="";
	email="";
	reclink="";
}

