function isValidEmail(str) {

   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);


}


function subscribe_foward()
{
	if (isValidEmail(document.getElementById('myemail').value))
	{
		document.getElementById('ea').value = document.getElementById('myemail').value;
		hide_Weekly_View('');
		return true;
	}else{
		alert('Invalid Email ID');
	}
	
	return false;
}

function subscribe_Weekly_View()
{
	if (isValidEmail(document.getElementById('myemail').value))
	{
		$.ajax({
				type : 'POST',
				url : 'subscribe-email.php',
				dataType : 'json',
				data: {
					email : document.getElementById('myemail').value
				},
				success : function(data){	
					document.getElementById('myemail').value = '';
					hide_Weekly_View(data.msg);
				},
				error : function(XMLHttpRequest, textStatus, errorThrown) {					
					document.getElementById('myemail').value = '';
					hide_Weekly_View('Sorry we have email server problem, try it later');					
				}
			});
	}else{
		alert('Invalid Email ID');
	}
		
		return false;
	
}
