// JavaScript Document
	function submitform(){
		//var img = document.getElementById('crack_image').value
		//alert(img);
		//document.crackform.action="index.php?process=crack";
		//document.crackform.submit();
		//if(img){
			document.getElementById('imgmsg').style.display='block';
		//}
	}
	/*----------------------------------------------------------------
	Description   :- list all records
	Programmer    :- SLS
	Last Modified :- 17/Dec/2009
	-------------------------------------------------------------------*/
	function listallrecords(url){
		value = document.getElementById('Sel_rec').value;
		url = "setrecordsperpage.php?&Sel_rec="+value+"&url="+url; 
 		window.location=url;
	}
 
	/*------------------------------------------------------------------
	Description   :- Show by register date
	Programmer    :- SLS
	Last Modified :- 17/Dec/2009
	-------------------------------------------------------------------*/
	function ShowByregisterdate(){  
		var regfrom=document.getElementById('from').value ; 
		var regto	=document.getElementById('to').value ;  
		window.location="index.php?process=myaccount&from="+regfrom+"&to="+regto;
	}

	/*------------------------------------------------------------------
	Description   :- Show by register date
	Programmer    :- SLS
	Last Modified :- 21/Dec/2009
	-------------------------------------------------------------------*/
	function refreshpage(){  
		window.location="index.php";
	}

	/*------------------------------------------------------------------
	Description   :- Show admin login status
	Programmer    :- SDYA
	Last Modified :- 18/Dec/2009
	-------------------------------------------------------------------*/
	function showAdminStatus()
	{
		ajaxpage("ajax_common.php","admStatus");
		setTimeout("showAdminStatus()",30000);
	}	
	
	/*------------------------------------------------------------------
	Description   :- check the captcha status
	Programmer    :- SDYA
	Last Modified :- 19/Dec/2009
	-------------------------------------------------------------------*/
	function check_image_status(imgid,captchatimeout)
	{
		//alert(imgid+"=="+captchatimeout);
			$.post("ajax_common.php",{action:'captchastatus',imgid:imgid,captchatimeout:captchatimeout,rand:Math.random() } ,function(data){ //alert(data);
																																							$return_arr = data.split("~*");
				//alert($return_arr[0]+'cc'+$return_arr[1]+'bb'+$return_arr[2]);	
				var imgid = $return_arr[0];
				var captchatimeout = $return_arr[1];
				var text = $return_arr[2];
				var image = $return_arr[3];
				if(text !=0){//alert(text);
					document.getElementById('upload_details').innerHTML = '<img src="thumbnail.php?image=images/crack_image/'+image+'&amp;height=250"   alt="captcha"  border="0"/><br/><br/><b>Captcha Text :&nbsp;<input name="crack_text" readonly="true" id="crack_text" type="text" value="'+text+'" /></b>';
				}else{
					document.getElementById('upload_details').innerHTML = '<b>Please wait while your image is being cracked  &nbsp;&nbsp; <img border="0" src="images/ajax-loader.gif"/> </b>';
					if(captchatimeout==0){
						document.getElementById('upload_details').innerHTML = '<b>You are timeout</b>';
						setTimeout('refreshpage()',5000);
					}else{
						setTimeout('check_image_status('+imgid+','+captchatimeout+')',1000);
					}
				}
		});
/*ajaxpage("ajax_common.php?action=captchastatus&imgid="+imgid,"upload_details");
		alert(imgid+"=="+captchatimeout);
		setTimeout("check_image_status(imgid,captchatimeout)",1000);
*/	}

	/*----------------------------------------------------------------
	Description   :- pop up window
	Programmer    :- SLS
	Last Modified :- 21/Dec/2009
	-------------------------------------------------------------------*/
	function show_popup(url)
	{
		var newwindow;
		newwindow=window.open(url,'name','height=700,width=950,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=no,status=no,directories=no');
		if (window.focus) {
			newwindow.focus();
			window.parent.close();
			//window.opener.close();
		}
	}

	function user_amount_low(){
		document.getElementById('upload_details').innerHTML  = '<b>You have no sufficient amount to upload the captcha</b>';
		setTimeout('refreshpage()',5000);
	}
	
	function user_limit_over(){
		document.getElementById('upload_details').innerHTML  = '<b>Your free usage limit is over please login to continue</b>';
		setTimeout('refreshpage()',5000);
	}
	
	/*------------------------------------------------------------------
	Description   :- check the captcha status
	Programmer    :- SDYA
	Last Modified :- 30/Dec/2009
	-------------------------------------------------------------------*/
	function check_image_status_1(imgid,captchatimeout,msgtoshow,msgtoshow1,message3,message4,time_passed)
	{
		//alert(imgid+"=="+captchatimeout);
		$.post("ajax_common.php",{action:'captchastatus1',imgid:imgid,captchatimeout:captchatimeout,rand:Math.random() } ,						           function(data){ //alert(data); return false; 
																																												   				$return_arr = data.split("~*");
				//alert($return_arr[0]+'**'+$return_arr[1]+'**'+$return_arr[2]+'**'+$return_arr[3]+'**'+$return_arr[4]+'*timepassed*'+$return_arr[5]);	//return false;
				var imgid = $return_arr[0];//
				var captchatimeout = $return_arr[1];
				var text = $return_arr[2]; //alert(text+'---'+captchatimeout);
				var isbad = $return_arr[3]; 
				var image = $return_arr[4];
				var time_passed = $return_arr[5]; 
				if(isbad=='yes'){
					document.getElementById('upload_details').innerHTML = '<br/><table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" ><tr><td colspan=\"3\" align=\"center\" class=\"success\"><b>'+message4+'</b></td></tr></table>';					
						setTimeout('refreshpage1('+imgid+')',5000);
				}else if(text !=0 ){//alert(text);
				setTimeout('refreshpage1('+imgid+')',5000);
/*					document.getElementById('upload_details').innerHTML = '<br/><table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" ><tr><td colspan=\"3\" align=\"center\" class=\"success\"><b>Success ! </b></td></tr><tr><td colspan=\"3\" align=\"center\">&nbsp;</td></tr><tr><td width=\"33%\" align=\"right\"><b>'+message3+'</b></td><td width=\"6%\" align=\"center\">:</td><td width=\"61%\" align=\"left\"><b>'+text+'</b></td></tr></table>';					
*/				}else{
					document.getElementById('upload_details').innerHTML = '<span class="small_text">'+msgtoshow1+': '+time_passed+'sec </span><br /><br /><span class="bold_text">'+msgtoshow+'&nbsp;'+captchatimeout+' sec</span>';
					if(captchatimeout==0){
						document.getElementById('upload_details').innerHTML = '<b>Time out, retry again?</b><input value=\"Yes\" onClick=\"javascript:retry_upload('+imgid+');\"  class=\"button\" type=\"submit\" />&nbsp;<input value=\"No\" onClick=\"javascript:cancel_upload();\"  class=\"button\" type=\"button\" />';
						setTimeout('refreshpage1('+imgid+')',5000);
					}else{
						/*setTimeout('check_image_status1('+imgid+','+captchatimeout+','+msgtoshow+')',1000);*/
						setTimeout("check_image_status_1("+imgid+","+captchatimeout+",'"+msgtoshow+"','"+msgtoshow1+"','"+message3+"','"+(message4+'').replace(/([\\"'])/g, "\\$1").replace(/\u0000/g, "\\0")+"',"+time_passed+")",1000);
					}
				}
		});
	}
	function check_image_status_1_old(imgid,captchatimeout,msgtoshow,msgtoshow1,message3,message4)
	{
		//alert(imgid+"=="+captchatimeout);
		$.post("ajax_common.php",{action:'captchastatus1',imgid:imgid,captchatimeout:captchatimeout,rand:Math.random() } ,						           function(data){ //alert(data); return false; 
																																												   				$return_arr = data.split("~*");
			//	alert($return_arr[0]+'---'+$return_arr[1]+'--'+$return_arr[2]+'--'+$return_arr[3]+'--'+$return_arr[4]);	
				var imgid = $return_arr[0];//
				var captchatimeout = $return_arr[1];
				var text = $return_arr[2]; //alert(text+'---'+captchatimeout);
				var isbad = $return_arr[3]; 
				var image = $return_arr[34];
				if(isbad=='yes'){
					document.getElementById('upload_details').innerHTML = '<br/><table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" ><tr><td colspan=\"3\" align=\"center\" class=\"success\"><b>'+message4+'</b></td></tr></table>';					
						setTimeout('refreshpage1('+imgid+')',5000);
				}else if(text !=0 ){//alert(text);
					document.getElementById('upload_details').innerHTML = '<br/><table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" ><tr><td colspan=\"3\" align=\"center\" class=\"success\"><b>Success ! </b></td></tr><tr><td colspan=\"3\" align=\"center\">&nbsp;</td></tr><tr><td width=\"33%\" align=\"right\"><b>Captcha Text</b></td><td width=\"6%\" align=\"center\">:</td><td width=\"61%\" align=\"left\"><b>'+text+'</b></td></tr></table>';					
				}else{
					document.getElementById('upload_details').innerHTML = '<b>'+message3+'<br /><br />'+msgtoshow1+'<br />'+msgtoshow+'&nbsp;'+captchatimeout+' sec</b>';
					if(captchatimeout==0){
						document.getElementById('upload_details').innerHTML = '<b>Time out, retry again?</b><input value=\"Yes\" onClick=\"javascript:retry_upload('+imgid+');\"  class=\"button\" type=\"submit\" />&nbsp;<input value=\"No\" onClick=\"javascript:cancel_upload();\"  class=\"button\" type=\"button\" />';
						setTimeout('refreshpage1('+imgid+')',5000);
					}else{
						/*setTimeout('check_image_status1('+imgid+','+captchatimeout+','+msgtoshow+')',1000);*/
						setTimeout("check_image_status_1("+imgid+","+captchatimeout+",'"+msgtoshow+"','"+msgtoshow1+"','"+message3+"','"+(message4+'').replace(/([\\"'])/g, "\\$1").replace(/\u0000/g, "\\0")+"')",1000);
					}
				}
		});
	}
	function refreshpage1(imgid){  
		window.location="procesingyourimage.php?imagenum="+imgid;
	}
	function trim(str) {
        return str.replace(/^\s+|\s+$/g,"");
    }
	/*------------------------------------------------------------------
	Description   :- check the captcha status
	Programmer    :- SLS
	Last Modified :- 01/Jan/2010
	-------------------------------------------------------------------*/
	function check_demoimage_status(imgid,captchatimeout,msgtoshow1)
	{
		//alert(imgid+"=="+captchatimeout);
		$.post("ajax_common.php",{action:'captchastatus1',imgid:imgid,captchatimeout:captchatimeout,rand:Math.random() } ,function(data){//alert(trim(data));	
																																					  				$return_arr = trim(data).split("~*");
				//alert("+++"+$return_arr[0]+'cc'+$return_arr[1]+'bb'+$return_arr[2]);  return false;  
				var imgid = $return_arr[0];
				var captchatimeout = $return_arr[1];
				var text = $return_arr[2];
				var image = $return_arr[3];
				var divid = 'upload_details_'+imgid;//alert(divid);return false;	
				if(text !=0){//alert(text);
						setTimeout('refreshdemopage()',1000);
					//document.getElementById(divid).innerHTML = '<br/><table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"33%\" align=\"right\"><b>Captcha Text</b></td><td width=\"6%\" align=\"center\">:</td><td width=\"61%\" align=\"left\"><b>'+text+'</b></td></tr></table>';					
				}else{
					document.getElementById(divid).innerHTML = '<b><br />'+msgtoshow1+'&nbsp;'+captchatimeout+' sec</b>';
					if(captchatimeout==0){
						//document.getElementById(divid).innerHTML = '<b>Timeout</b>';
						setTimeout('refreshdemopage('+imgid+')',1000);
					}else{
						/*setTimeout('check_image_status1('+imgid+','+captchatimeout+','+msgtoshow+')',1000);*/
						setTimeout("check_demoimage_status("+imgid+","+captchatimeout+",'"+msgtoshow1+"')",1000);
					}
				}
		});
	}
	function refreshdemopage(imgid){  
		//alert(imgid+"=="+captchatimeout);
		$.post("ajax_common.php",{action:'updateStatus',imgid:imgid,rand:Math.random() } ,
			function(data){ //alert(data); return false; 
		});
		window.location="demoimages.php";
	}
	
	function addtext(imgid){
		//alert(imgid);
		var fieldid = 'crack_text_'+imgid;
		var text	= document.getElementById(fieldid).value;
		if(text==""){
			alert('Please enter the text');
			return false;
		}else{
			if(text.toLowerCase()=="bad")
			{
				$.post("ajax_common.php",{action:'badcaptcha',imgid:imgid,rand:Math.random() } ,
				function(data){
					setTimeout('refreshdemopage()',1000);																																
				});																																									
			}
			else{
				$.post("ajax_common.php",{action:'addtext',imgid:imgid,text:text,rand:Math.random() } ,						           function(data){ 
				setTimeout('refreshdemopage()',1000);																																
		});	
			}
		}
		return false;
	}
	
	/*------------------------------------------------------------------
	Description   :- captcha retry
	Programmer    :- SLS
	Last Modified :- 01/Jan/2010
	-------------------------------------------------------------------*/
	function retry_upload(imgid)
	{
		//document.form.action="procesingyourimage.php?imagenum="+imgid+"&action=retryImage";
		document.submit;
	}
	
	function cancel_upload()
	{
		window.location = "index.php";
	}
	/*------------------------------------------------------------------
	Description   :- list user funds by date
	Programmer    :- SLS
	Last Modified :- 18/Jan/2010
	-------------------------------------------------------------------*/
	function userfund_list(){  
		var from = document.getElementById('from').value ; 
		var to	= document.getElementById('to').value ;  
		var UserId	= document.getElementById('UserId').value ; 
		window.location="index.php?process=funds&from="+from+"&to="+to+"&UserId="+UserId;
	}
	
	/*------------------------------------------------------------------
	Description   :- function to make the captcha as bad captcha
	Programmer    :- SDYA
	Last Modified :- 20/Jan/2010
	-------------------------------------------------------------------*/
	function badcaptchaText(imgid){ 
		var contId = "bad_textdiv_"+imgid;
		var cracktxt = "crack_text_"+imgid;
		var postbut = "post_"+imgid;
		var badbut = "bad_"+imgid;
		alert("Please specify the bad captcha reason");
		document.getElementById(contId).style.display = "block";
		document.getElementById(postbut).disabled = true; 
		document.getElementById(badbut).disabled = true; 
		document.getElementById(cracktxt).disabled = true; 
	}
	
	function cancel_badcaptcha(imgid){
		var contId = "bad_textdiv_"+imgid;
		var cracktxt = "crack_text_"+imgid;
		var postbut = "post_"+imgid;
		var badbut = "bad_"+imgid;
		document.getElementById(contId).style.display = "none";
		document.getElementById(postbut).disabled = false; 
		document.getElementById(badbut).disabled = false; 
		document.getElementById(cracktxt).disabled = false; 
	}
	
	function badcaptcha(imgid){ 
		var badTextid = "bad_text_"+imgid;
		var badText = document.getElementById(badTextid).value;
		$.post("ajax_common.php",{action:'badcaptcha',imgid:imgid,badText:badText,rand:Math.random() } ,
		function(data){
			setTimeout('refreshdemopage()',1000);																																
		});																																									
		return false;
	}
	
	/*------------------------------------------------------------------
	Description   :- function to update the download count
	Programmer    :- SDYA
	Last Modified :- 21/Jan/2010
	-------------------------------------------------------------------*/
	function update_count(softid,downStatus,pausedReason)
	{	
		if(downStatus =='paused')
		{
			document.getElementById('paused_reason_'+softid).innerHTML = pausedReason;	
		}
		else
		{
			$.post("ajax_common.php",{action:'update_count',softid:softid,rand:Math.random() } ,
			function(data){ 
				if(data.indexOf('exceed') != -1){
					window.location = 'index.php?process=downExceed&softid='+softid;
				}else{
					document.getElementById('down_cnt_'+softid).innerHTML = data;	
					window.location = 'download_software.php?id='+softid;
				}
			});																																									
			return false;
		}
	}
	
	/*----------------------------------------------------------------
    Description   :- Function for gadget screen shots
    Programmer    :- SLS
    Last Modified :- 23/JAN/2010
    -------------------------------------------------------------------*/
	function displayscreenImage(screenImage)
	{
		var url = "ajax_common.php?action=showscreenshots&screenshot="+screenImage;
		ajaxpage(url,'screenDisplay');
	}
	function show_popup_new(url)
	{
		var newwindow;
		newwindow=window.open(url,'name','height=200,width=350,left=300,top=600,resizable=yes,scrollbars=yes,toolbar=no,status=no,directories=no');
		if (window.focus) {
			newwindow.focus();
			//window.parent.close();
		}
	}
/***********************************Affiliate************************************************************/
function SubmitAffiliateLoginform(){   
 	document.FormLogin.action="login-Submit.html";
	document.FormLogin.submit();
	
}//end function

/*----------------------------------------------------------------
User validation
-----------------------------------------------------------------*/

function tool_tip_js(field,imgid,boxid,requiredflag){
	var closeid=imgid+'_close';
	var trueid=imgid+'_true';
	if(field=='firstname' || field=='lastname' || field=='address' || field=='city'  || field=='postcode' || field=='phone' || field=='age'  || field=='dateofbirth'    || field=='fname'   || field=='lname'   || field=='zip'  || field=='siteName' ){
		var text =document.getElementById(field).value;
		text = text.replace(/ /g,""); 
		if(text==''){  
			document.getElementById(closeid).style.display = 'block';
			document.getElementById(trueid).style.display = 'none';
			document.getElementById(boxid).style.display = 'block';	
		}else{ 
			document.getElementById(closeid).style.display = 'none';
			document.getElementById(trueid).style.display = 'block';
			document.getElementById(boxid).style.display = 'none';	
		}
	}
	if(field=='email' || field=='confirmemail'){	 
		var mailid=document.getElementById(field).value;
		var EmailId=document.getElementById('email').value;
		mailid = mailid.replace(/ /g,"");
		 
 			if(mailid!=''){ 
				var email_status=validate_email(mailid);	
				if(email_status){ 
					if( field=='confirmemail' && EmailId!=mailid){	
						document.getElementById(closeid).style.display = 'block';
						document.getElementById(trueid).style.display = 'none';
						document.getElementById(boxid).style.display = 'block';
					}else{
						document.getElementById(trueid).style.display = 'block';
						document.getElementById(closeid).style.display = 'none';
						document.getElementById(boxid).style.display = 'none';
					}
				}else{ 
					document.getElementById(closeid).style.display = 'block';
					document.getElementById(trueid).style.display = 'none';
					document.getElementById(boxid).style.display = 'block';
				}
			}else {
				
					document.getElementById(closeid).style.display = 'block';
					document.getElementById(trueid).style.display = 'none';
					document.getElementById(boxid).style.display = 'block';
				
			}
		 
	} 
	if(field=='img_verification'){	
		var rand_img=document.getElementById('rand_img').value;
		var img_verification=document.getElementById('img_verification').value;
		img_verification = img_verification.replace(/ /g,"");
 			if(img_verification==''){ 
				document.getElementById(closeid).style.display = 'block';
				document.getElementById(trueid).style.display = 'none';
				document.getElementById(boxid).style.display = 'block';
			}else if(img_verification !=rand_img  ){
				document.getElementById(closeid).style.display = 'block';
				document.getElementById(trueid).style.display = 'none';
				document.getElementById(boxid).style.display = 'block';
			}else{
				document.getElementById(closeid).style.display = 'none';
				document.getElementById(trueid).style.display = 'block';
				document.getElementById(boxid).style.display = 'none';	
			}
			
		}
	 
	if(field=='password'){
		var pwd=document.getElementById('password').value; //alert("kk"+trueid);
		pwd = pwd.replace(/ /g,"");
		var len=pwd.length;
		if(pwd=='' || len<6){    
			document.getElementById(closeid).style.display = 'block';
			document.getElementById(trueid).style.display = 'none';
			document.getElementById(boxid).style.display = 'block';	
		}else{  
			document.getElementById(closeid).style.display = 'none';
			document.getElementById(trueid).style.display = 'block';
			document.getElementById(boxid).style.display = 'none';
			
		}
	}
	if(field=='confirmPassword'){
		var pwd=document.getElementById('password').value;
		var confirmPassword=document.getElementById('confirmPassword').value;
		pwd = pwd.replace(/ /g,"");
		confirmPassword = confirmPassword.replace(/ /g,"");
 		if(confirmPassword==''){  
			document.getElementById(closeid).style.display = 'block';
			document.getElementById(trueid).style.display = 'none';
			document.getElementById(boxid).style.display = 'block';	
		}else if(confirmPassword != pwd){
			document.getElementById(closeid).style.display = 'block';
			document.getElementById(trueid).style.display = 'none';
			document.getElementById(boxid).style.display = 'block';	
		}
		else{
			document.getElementById(closeid).style.display = 'none';
			document.getElementById(trueid).style.display = 'block';
			document.getElementById(boxid).style.display = 'none';
			
		}
	}
	
	if(field=='country'){
		var country=document.getElementById('country').value;  
 		if(country==''){  
			document.getElementById(closeid).style.display = 'block';
			document.getElementById(trueid).style.display = 'none';
			document.getElementById(boxid).style.display = 'block';	
			
		}else{ 
			document.getElementById(closeid).style.display = 'none';
			document.getElementById(trueid).style.display = 'block';
			document.getElementById(boxid).style.display = 'none';	
			
		}
	}
	
	if(field=='state'){
		var text =document.getElementById(field).value;
		text = text.replace(/ /g,""); 
		var countryid = document.getElementById('country').value;   //alert("inner"+countryid +"fgfgf"+requiredflag ); 
		//if(countryid=='223' || requiredflag =='1' ){
		if(countryid=='223' && requiredflag =='1' ){
			if(text==''){
				document.getElementById(closeid).style.display = 'block';
				document.getElementById(trueid).style.display = 'none';
				document.getElementById(boxid).style.display = 'block';	
			}else{
				document.getElementById(closeid).style.display = 'none';
				document.getElementById(trueid).style.display = 'block';
				document.getElementById(boxid).style.display = 'none';	
			}
		}else{
				document.getElementById(closeid).style.display = 'none';
				document.getElementById(trueid).style.display = 'none';
				document.getElementById(boxid).style.display = 'none';	
			}
	}
	if(field=='dateofbirth'){
		var dateofbirth =document.getElementById(field).value;
		if(dateofbirth =='0000-00-00' || dateofbirth ==''){
				document.getElementById(closeid).style.display = 'block';
				document.getElementById(trueid).style.display = 'none';
				document.getElementById(boxid).style.display = 'block';	
		}else{
				document.getElementById(closeid).style.display = 'none';
				document.getElementById(trueid).style.display = 'none';
				document.getElementById(boxid).style.display = 'none';	
		}
	}
	
	if(  field=='siteURL' ){
		
		var url = document.getElementById('siteURL').value;
		var newvalue = url.substr(7);
		newvalue = newvalue.replace(/ /g,""); 
		if(newvalue==''){
				document.getElementById(closeid).style.display = 'block';
				document.getElementById(trueid).style.display = 'none';
				document.getElementById(boxid).style.display = 'block';	
		}else{
 				document.getElementById(closeid).style.display = 'none';
				document.getElementById(trueid).style.display = 'none';
				document.getElementById(boxid).style.display = 'none';	
 		}
		
	}
	
  	
	
 }
/*----------------------------------------------------------------
Description   :- Function is used to show affiliate stats
-----------------------------------------------------------------*/
function Showaffiliatestats(){
	 var fromdate = document.getElementById('from_date').value;
	 var todate = document.getElementById('to_date').value;
	 var url = "Sales-Stats~"+fromdate+"~"+todate+"_1.html";
 	 document.allstats.action=url;
	 document.allstats.submit();
 }
/*----------------------------------------------------------------
Description   :- Function is used to show the payment info 
-------------------------------------------------------------------*/
function showPaymentInfo(){
	var Gateway = document.getElementById('Paymentgateway').value;
	if(Gateway==''){
		alert("Please select payment method");
	}else{
		var url= "ajax_common.php?action=Paymentinfo&gateway="+Gateway;
		ajaxpage(url,'Paymentdetails');
	}//end if
	
}//end function

/*------------------------------------------------------------------
Description   :- Display State 
-------------------------------------------------------------------*/
function Selectcountry(reqstate,flag){  
var countryId  = document.getElementById('country').value;
if(flag){
	var url ="ajax_common.php?countryId="+countryId+"&reqstate="+reqstate+"&action=state";  
}else{
 var url ="ajax_state.php?countryId="+countryId+"&reqstate="+reqstate;  
}
ajaxpage(url,'DivState');
}
/*------------------------------------------------------------------
Description   :- Email validation
-------------------------------------------------------------------*/

function validate_email(email) {
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	var address = email;
	if(reg.test(address) == false) {
	  return false;
	}
	return true;
}
/*--------------------------------------------------------------------------
Description   :- function to check Password Strength
--------------------------------------------------------------------------*/

function passwordStrength(password)
{

	var desc = new Array();
	desc[0] = "Very Weak";
	desc[1] = "Weak";
	desc[2] = "Better";
	desc[3] = "Medium";
	desc[4] = "Strong";
	desc[5] = "Strongest";

	var score   = 0;
	
	//if password bigger than 6 give 1 point
	if (password.length > 6) score++;
	//if password has both lower and uppercase characters give 1 point      
	
	if ( ( password.match(/[a-z]/) ) && ( password.match(/[A-Z]/) ) ) score++;
	
	//if password has at least one number give 1 point
	if (password.match(/\d+/)) score++;
	
	//if password has at least one special caracther give 1 point
	if ( password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/) ) score++;
	
	//if password bigger than 12 give another 1 point
	if (password.length > 12) score++;
	//document.getElementById("passwordDescription").innerHTML = desc[score];
	document.getElementById("passwordStrength").innerHTML = desc[score];
	document.getElementById("passwordStrength").className = "strength" + score;
}
//function to show the affilaite earned commisssion
function ShowByDateRange(){
	/*frmDate = document.getElementById('frmDate').value;
	toDate = document.getElementById('toDate').value;*/
	document.frm_search.action = "Affiliate-earnedCommn_1.html";
	document.frm_search.submit();
}


/***********************************End Affiliate************************************************************/

