
function validate_review_form(){  
	if($('submit_article_review_form_name').value == ''){
  	alert("Please enter your Name.");
		$('submit_article_review_form_name').focus();
		return false;
	}
	if($('submit_article_review_form_summarize').value == '')
 	{
  	alert("Please enter your Summarize Review.");
		$('submit_article_review_form_summarize').focus();
		return false;
	}
	if($('submit_article_review_form_description').value == '')
 	{
  	alert("Please enter your Review.");
		$('submit_article_review_form_description').focus();
		return false;
	}
	var st = email($('submit_article_review_form_email').value);
	if(!st) 
	{ 
		alert('Either email field is empty or this is not a valid email address.');  
    $('submit_article_review_form_email').focus();
		return false;	
	}
	return true;
}

function email(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true					
	}

	function url(val){
		tomatch= /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/;
		if(val.substring(0, 7) != 'http://'){
			val = 'http://' + val;
		}
		if (tomatch.test(val)){
			return true;
		}
		
		return false;
	}
	
	function phone(val){
		tomatch= /[0-9\.-]/;
		if (tomatch.test(val)){
			return true;
		}
		
		return false;
	}



