function validAll(){
	document.frm.reset();
}


function checkAll(){

	var eMsg="";
	var isOK=true;

	if(document.frm.cmbMagazine.value=="parenthood"){
		document.frm.action="en/signin.php";
	}
	if(document.frm.cmbMagazine.value=="mombaby"){
		document.frm.action="ch/signin.php";
	}
	if(document.frm.cmbMagazine.value=="mamibaby"){
		document.frm.action="my/signin.php";
	}


	if(document.frm.email.value==""){
		eMsg += "Email Address is required<br>";
	} else {
		var testresults;
		var str=document.frm.email.value;
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
		if (filter.test(str)){
		}else{
			eMsg += "Please input a valid email address!<br>";
		}

	}
	if(document.frm.password.value==""){
		eMsg += "Password is required<br>";
	}
	
	if(document.frm.cmbMagazine.value==""){
		eMsg += "Magazine is required<br>";	
	}

	if(eMsg !=""){
		eMsg = "The following field information is required:<br>" + eMsg;
		//goto top
		isOK = false;


if(document.getElementById('abox')!=null){
document.getElementById('ibox').removeChild(document.getElementById('abox'));	
}

var newdiv = document.createElement('div');
  var divIdName = 'abox';
  newdiv.setAttribute('id','abox');
  newdiv.setAttribute('name','abox');	
  newdiv.setAttribute('class','alert');	
  newdiv.setAttribute('className','alert');	
  newdiv.innerHTML = eMsg;
document.getElementById('ibox').appendChild(newdiv);
document.location.href="#top";
	} else {
	isOK=true;
document.getElementById('ibox').removeChild(document.getElementById('abox'));

	}
	return isOK;

}

