function isEmail(s){
if (s==""){ alert("Invalid email"); return false; }	if (s.indexOf(" ")>0){ alert("Invalid email"); return false; } if (s.indexOf("@")==-1){ alert("Invalid email"); return false; } if (s.indexOf(".")==-1){ alert("Invalid email"); return false; } if (s.indexOf("..")!=-1){ alert("Invalid email"); return false; } if(s.indexOf("@")!=s.lastIndexOf("@")){ alert("Invalid email"); return false; } if (s.lastIndexOf(".")==s.length-1){ alert("Invalid email"); return false; } return true;	
}
function showDataBack(v_id,v_url,v_str){
	if (v_str.length==0) { 
	  document.getElementById(v_id).innerHTML="";
	  return;
	}
	if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	} else {// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}		
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {			
			document.getElementById(v_id).innerHTML=xmlhttp.responseText;
		}
	}
	xmlhttp.open("GET",v_url+v_str,true);
	xmlhttp.send();
}
function isInput(s){ if (s==""){ alert("Input not null"); return false;	} return true; }
function checkInput(s1,s2){isInput(s1);isEmail(s2);}
function isEmpty(s){return ((s==null) || (s.length==0))}
function isWhitespace(s){ var whitespace="\t\n\r"; var i; if (isEmpty(s)) return true; for (i=0;i<s.length;i++){ var c=s.charAt(i); if (whitespace.indexOf(c)==-1) return false;} return true; }
function showHide(name,elementid,k){
	var str;
	//document.write(k);
	for(var j=1;j<=k;j++){
			str = name + j;
			document.getElementById(str).style.display = "none";				
	}
	
	if (document.getElementById(elementid).style.display == "block"){
		document.getElementById(elementid).style.display = "none";
	} else {
		document.getElementById(elementid).style.display = "block";
	} 
}

