function showAndHide(theId){ 
	var el = document.getElementById(theId) 
	if (el.style.display=="none") { 
		el.style.display="block"; //show element 
	} 
	else { 
		el.style.display="none"; //hide element 
	} 
} 
function popUp(strURL,h,w){
	newwindow=window.open(strURL,'name',"menubar=no,width="+w+",height="+h+",toolbar=no,resizable=no");
	if (window.focus) {newwindow.focus()}
}
function popUp2(strURL,h,w){
	newwindow=window.open(strURL,'name',"menubar=no,width="+w+",height="+h+",toolbar=no,resizable=no,scrollbars=yes");
	if (window.focus) {newwindow.focus()}
}
function popUpVideo(){
	newwindow=window.open('pop_video.php','name',"menubar=no,width=600,height=500,toolbar=no,resizable=no");
	if (window.focus) {newwindow.focus()}
}
function popUpAudio(){
	newwindow=window.open('pop_audio.php','name',"menubar=no,width=400,height=200,toolbar=no,resizable=no");
	if (window.focus) {newwindow.focus()}
}
function privacy(strURL){
	newwindow=window.open(strURL,'name',"menubar=no,width=560,height=600,toolbar=no,resizable=no,scrollbars=yes");
	if (window.focus) {newwindow.focus()}
}
function toggleEnabled(el){
	if(document.getElementById(el).value != ""){
		document.getElementById(el).disabled = false;
	}
}

function isEmail(str) {
	// are regular expressions supported?
	var supported = 0;
	if (window.RegExp) {
		var tempStr = "a";
		var tempReg = new RegExp(tempStr);
		if (tempReg.test(tempStr)) supported = 1;
	}
	if (!supported) 
		return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
	var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
	var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
	return (!r1.test(str) && r2.test(str));
}
