function submitForm(formname){
	var theForm=document.forms[formname];
	var fields=theForm['om_fields'].value.split(',');
	var fStyles=theForm['om_colors'].value.split(',');
	var orgStyles=theForm['om_org_colors'].value.split(',');
	var error=0;
	for(var i=0;i<fields.length;i++){
		var theField=fields[i];
		var rpos=theField.indexOf('_r');
		if(rpos>-1){
			theField=theField.substring(0,rpos);
		}
		if(rpos>-1 && theForm[theField].value.length==0 ){//
			error++;
			document.getElementById(theField).style.backgroundColor=fStyles[0];
			document.getElementById(theField).style.color=fStyles[1];
		}else if (theField=='email' && theForm[theField].value.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/)==null) {//
			error++;
			//alert(theForm[theField].value.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/));
			document.getElementById(theField).style.backgroundColor=fStyles[0];
			document.getElementById(theField).style.color=fStyles[1];
		}else{
			document.getElementById(theField).style.backgroundColor=orgStyles[0];
			document.getElementById(theField).style.color=orgStyles[1];
		}
	}
	
	if(error>0){
		document.getElementById(formname+'Error').style.display='';
		return false;
	}else{
		document.getElementById(formname+'Error').style.display='none';
		return true;
	}	
			
}
function mp(url,opts){
	window.open(url,"mp",opts);
}