
/* TEMPLATE CONTROL COPY
-------------------------------------------------------------------------------------*/

function announce(){
	if(window.event .keyCode==0x11){
   		window.alert ("Please contact adminstrator for resource duplication. Thank you.");
		}
	}
	
function init(){
	window.alert('FLEAVE DESIGN WEBCMS DEMO\nYou are visiting the WebCMS demo website presented by Fleave Design.\nThis is not the business official website.');
}


/* EMAIL VERIFICATION
-------------------------------------------------------------------------------------*/

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("INVALID E-MAIL!\nPlease enter your valid e-mail address.")
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("INVALID E-MAIL!\nPlease enter your valid e-mail address.")
		   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("INVALID E-MAIL!\nPlease enter your valid e-mail address.")
		    return false
		}
		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("INVALID E-MAIL!\nPlease enter your valid e-mail address.")
		    return false
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("INVALID E-MAIL!\nPlease enter your valid e-mail address.")
		    return false
		 }
		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("INVALID E-MAIL!\nPlease enter your valid e-mail address.")
		    return false
		 }		
		 if (str.indexOf(" ")!=-1){
		    alert("INVALID E-MAIL!\nPlease enter your valid e-mail address.")
		    return false
		 }
 		 return true
 	}

function checkSubscribeForm(){
	x=document.subscribe;	
	
	if (echeck(x.email.value) == false){
		x.email.focus(); 
		return false;
	}
}
