/**
* This fuction is used for
*  save newsletter details
*  using AJAX
*
* @access   public
* @param    null
*
* @return   null
*/

function saveDetails(){

	if(validateFields())	
	{
		if(validateCaptcha())
		{
           document.getElementById("action").value="saveDetails";
           document.getElementById("frmDevMarch").submit();
		}		
	}
}


/**
* This fuction is used
*  to validate fields
*
* @access   public
* @param    null
*
* @return   null
*/
function validateFields(){

	if(checkEmail(document.getElementById("email").value)!=true){
		document.getElementById("email").focus();
		return false ;
	}

	else if(document.getElementById("email2").value!=document.getElementById("email").value){
		alert("Please enter the same email address as above");
		document.getElementById("email2").focus();
		return false ;
	}
	else if(document.getElementById("company").value.match(/^ *$/)){
		alert("Please enter your company.");
		document.getElementById("company").focus();
		return false ;
	}

	else if(document.getElementById("employees").value=='new'){
		alert("Please select number of employees in your company.");
		document.getElementById("employees").focus();
		return false ;
	}

	return true;
}


function unsubscribe(){

	if(validateCaptcha())
	{
       document.getElementById("action").value="unsubscribe";
       document.getElementById("frmDevMarch").submit();
	}
}
