function popWin(strURL, intW, intH){
	var w = window.frames["PopWindow"];
	if (w) {
		w.location = strURL;
	} else {
		window.open(strURL, "PopWindow", "scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no,height=" + intH + ",width=" + intW);
	}
}

function check_address(field,f) {
	var fieldvalue=document.getElementById(field).value
	var filter=/^([\w-]+(\.[\w-]+)*)@(([\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(\.[a-z]{2})?)$/i

	if (filter.test(fieldvalue)) {
		return true;
	}
	f();
	return false;
}

function obfuscate(dom,name) {
	return name + "@" + dom.replace(/#/g,'.')
}

function emailguard(dom,name,attr,content,subject,body) {
	var address = obfuscate(dom,name);
	var mailto = address;

	if (!content) content = address
	if (subject) mailto = mailto + "?subject=" + subject.replace(/ /g,"%20");
	if (body) mailto = mailto + "&amp;body=" + body.replace(/ /g,"%20");
	document.write('<a ' + attr + ' href="mailto:' + mailto + '">' + content + '</a>');
}
