function warning(text)
{
	alert (text);
}

function print()
{ 
  var disp_setting="toolbar=no, location=no, directories=no, menubar=yes, scrollbars=yes, width=800, height=800, left=100, top=25"; 
  var content_value = document.getElementById("print_content").innerHTML; 
  
  var docprint=window.open("","",disp_setting); 
   docprint.document.open(); 
   docprint.document.write('<html><head><title>Print</title>');
   docprint.document.write('<head><link href="print.css" type=text/css rel=stylesheet></head>'); 
   docprint.document.write('<body onLoad="self.print()">');
   docprint.document.write(content_value);
   docprint.document.write('</body></html>'); 
   docprint.document.close(); 
   docprint.focus(); 
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Vigane E-posti aadress")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Vigane E-posti aadress")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Vigane E-posti aadress")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Vigane E-posti aadress")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Vigane E-posti aadress")
		    return false
		 }

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

 		 return true					
	}

function ValidateForm(){
	var emailID=document.subs.subscribe
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please enter your E-mail")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }