function login_user_check(num,lan){var email = document.getElementById("username").value;var password = document.getElementById("password").value;var lang = lan;error_check="";if(num==1 || num==3){if(email ==""){	var id = "50";	var divid = 1; 	document.getElementById('email_error_1').style.visibility = 'visible';	error_check = error_check+"<br>";	ajax.sendrequest("GET","https://venture.ge/components/com_user/views/ajax_validation/tmpl/default.php",{id:id,divid:divid,lang:lang},"replacefun","");	}else   if(!isValidEmail(email))	{			var id = "51";	var divid = 1; 	document.getElementById('email_error_1').style.visibility = 'visible';	error_check = error_check+"<br>";	ajax.sendrequest("GET","https://venture.ge/components/com_user/views/ajax_validation/tmpl/default.php",{id:id,divid:divid,lang:lang},"replacefun","");		}	else	{		document.getElementById('email_error_1').style.visibility = 'hidden';	}}if(num==2|| num==3){if(password ==""){	var id = "52";	var divid = 2; 	document.getElementById('email_error_2').style.visibility = 'visible';	error_check = error_check+"<br>";	ajax.sendrequest("GET","https://venture.ge/components/com_user/views/ajax_validation/tmpl/default.php",{id:id,divid:divid,lang:lang},"replacefun","");		}elseif(password.search(" ")>-1){	var id = "53";	var divid = 2; 	document.getElementById('email_error_2').style.visibility = 'visible';	error_check = error_check+"<br>";	ajax.sendrequest("GET","https://venture.ge/components/com_user/views/ajax_validation/tmpl/default.php",{id:id,divid:divid,lang:lang},"replacefun","");		}else{	document.getElementById('email_error_2').style.visibility = 'hidden';}}	if(error_check.length > 0)	{	//	alert("in last");		return false;	}}function replacefun(data){	if(data.success>0)	{		var div_id = "email_error_"+data.divid;		document.getElementById(div_id).innerHTML = data.message;		document.getElementById(div_id).className = "error";		return ;	}}function isValidEmail(emailStr){						var emailPat=/^(.+)@(.+)$/						//var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"			var specialChars="\\(\\)<>@,`';:~!#$%^&*+=|{}?\\\\\\\"\\.\\[\\]"									var validChars="\[^\\s" + specialChars + "\]"						var quotedUser="(\"[^\"]*\")"						var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/						var atom=validChars + '+'						var word="(" + atom + "|" + quotedUser + ")"			// The following pattern describes the structure of the user			var userPat=new RegExp("^" + word + "(\\." + word + ")*$")						var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")			var matchArray=emailStr.match(emailPat)			if (matchArray==null) {			  				return false			}			var user=matchArray[1]			var domain=matchArray[2]			// See if "user" is valid 			if (user.match(userPat)==null) {			   			    return false			}						var IPArray=domain.match(ipDomainPat)			if (IPArray!=null) {			    // this is an IP address				  for (var i=1;i<=4;i++) {				    if (IPArray[i]>255) {				        //alert("Destination IP address is invalid!")					return false				    }			    }			    return true			}			// Domain is symbolic name			var domainArray=domain.match(domainPat)			if (domainArray==null) {			//alert("The domain name doesn't seem to be valid.")			    return false			}				var atomPat=new RegExp(atom,"g")			var domArr=domain.match(atomPat)			var len=domArr.length			if (domArr[domArr.length-1].length<2 || 			    domArr[domArr.length-1].length>3) {			   			   return false			}			// Make sure there's a host name preceding the domain.			if (len<2) {			   var errStr="This address is missing a hostname!"			   //alert(errStr)			   return false			}			return true;}function isAllNumerics(objValue){		var characters="0123456789."		var tmp		var lTag		lTag = 0		temp = (objValue.length)		//alert(objValue);		for (var i=0;i<temp;i++)		{			tmp=objValue.substring(i,i+1)			if (characters.indexOf(tmp)==-1)			{				lTag = 1			}		}		if(lTag == 1)			return false		else		  if(objValue<=0)		   {			return false		   }else{ 				return true		  }}	
