function LearnMoreFormValidation(frm){
    if(frm.Name.value==""){
        alert("Field required: First Name.");
        frm.Name.focus();
        return false;
    }
	 if(frm.LastName.value==""){
        alert("Field required: Last Name.");
        frm.LastName.focus();
        return false;
    }	
    if(frm.Email.value==""){
        alert("Field required: Email.");
        frm.Email.focus();
        return false;
    }
		
    var goodEmail = frm.Email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.sex)|(\.biz)|(\.aero)|(\.coop)|(\.museum)|(\.name)|(\.pro)|(\..{2,2}))$)\b/gi);
    if (!goodEmail) {
        alert("Incorrect email format.");
        frm.Email.focus();
        return false;
    }
		
    if(frm.Phone.value==""){
        alert("Field required: Phone.");
        frm.Phone.focus();
        return false;
    }
	
	var state = document.getElementById("State");
	if(state&&state.value==""){
		alert("Field required: State.");
        state.focus();
        return false;
	}

    try{
        sendValuesToCRM(frm)
    }catch (e){
        alert("error in CRM values "+e);
    }
    return alreadySendCRM;
//NewWindow('Sendmail.asp','mywindow','350','300');
		
//window.open ("thanks.htm","mywindow","location=0,status=0,scrollbars=0,width=250,height=250,menubar=0,resizable=0"); 
}

function NewWindow(mypage,myname,w,h,scroll){
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=0'+scroll+',resizable=0,location=0,status=0,scrollbars=0,menubar=0'
    win = window.open(mypage,myname,settings)

}