function stripTags(input){ 
   return input.replace(/(<([^>]+)>)/gi, '');
}

function doSubmitCheckProductEnQuiryForm(){
  if(checkProductEnQuiryForm()){
       document.getElementById("productEnQuiryForm").submit();
       return true;
    }else{
       return false;
    }
}

function doSubmitCheckAteOnlineForm2(){
  if(checkAteOnlineForm2()){
       document.getElementById("ateOnlineForm2").submit();
       return true;
    }else{
        return false;
    }
}
function toggle_visibility(id,value) {
var e = document.getElementById(id);
if(e != null) {
if(value=='yes') { 
e.style.display = 'block';
} else {
e.style.display = 'none';
}
}
}

function doSubmitCheck(){
  if(checkAteOnlineForm()){
       document.getElementById("ateOnlineForm").submit();
       return true;
    }else{
       return false;
     }
}
function toggle_visibility(id,value) {
var e = document.getElementById(id);
if(e != null) {
if(value=='yes') { 
e.style.display = 'block';
} else {
e.style.display = 'none';
}
}
}

function clearForm(formName){ 
 if(formName == "eliteSearchForm" && (document.eliteSearchForm.search_query.value == "Search News" || document.eliteSearchForm.search_query.value == "Search Site")){
   document.eliteSearchForm.search_query.value= "";
 }else if(formName == "mailingListSubscribeForm" && document.mailingListSubscribeForm.emailAddress.value == "Enter Email Address"){
  document.mailingListSubscribeForm.emailAddress.value=""
 }
}
function Mypopup(id){
		var sharebtn=document.getElementById(id).style.display;
		if(sharebtn=="none")
		{
		 document.getElementById(id).style.display="block";
		}
		else
		{
		 document.getElementById(id).style.display="none";
		}
}

function validate(){
var keyword = document.getElementById("eliteSearch").value;
if(keyword.indexOf('"')>-1 || keyword.indexOf('#')>-1 || keyword.indexOf('%')>-1 || keyword.indexOf('&')>-1){
alert("Search keyword should not contain special characters - \", #, %, &");
return false;
}else if(keyword==""){
alert("Please Enter Search keyword");
return false;
}
document.getElementById("searchForm").submit;
}


function validateNewsSearch(){
var keyword = document.getElementById("search_query").value;
if(keyword.indexOf('"')>-1 || keyword.indexOf('#')>-1 || keyword.indexOf('%')>-1 || keyword.indexOf('&')>-1){
alert("Search keyword should not contain special characters - \", #, %, &");
return false;
}else if(keyword=="" || keyword=="Search News"){
alert("Please Enter Search keyword");
return false;
}
document.getElementById("eliteSearchForm").submit;
return true;
}


function validateSiteSearch(){
var keyword = document.getElementById("search_query").value;
if(keyword.indexOf('"')>-1 || keyword.indexOf('#')>-1 || keyword.indexOf('%')>-1 || keyword.indexOf('&')>-1){
alert("Search keyword should not contain special characters - \", #, %, &");
return false;
}else if(keyword=="" || keyword=="Search Site"){
alert("Please Enter Search keyword");
return false;
}
document.getElementById("eliteSearchForm").submit;
return true;
}

	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){
		   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 doSubmit () {
		var emailAddress = document.getElementById ("emailAddressText");
		if (emailAddress.value == "" || !echeck(emailAddress.value)) {
			alert ("Please specify a valid email.");
			return false;
		}
		var form = document.getElementById ("mailingListSubscribeForm");
		form.submit ();
	}

function aboutClosepopup(ID){
	thisMenu=document.getElementById(ID).style;	
    thisMenu.display = "none"
}

