function signupme(frmid)
{
	
	var mailerror="";

	frmobj=document.getElementById(frmid);
	email=frmobj.deals.value;
	
	if(email=="")
	{
		mailerror="Please Enter EmailID ";
	}
	else
	{
		
		if ( email =='')
		{
		mailerror="Email required. \n";
		}
	
		var teststing="name@email.com";
		 if((email.match(teststing))) {
		mailerror= "Please enter a valid  email address.\n";
		}
	 	
		
		if(frmobj.name=='frm_signup')
		{
			var testpath=document.frm_signup.deals;
		}
		else
		{
			var testpath=document.frmsignup.deals;
		}
		if (!ValidateEmail(testpath))
		{
			mailerror= "Please enter a valid  email address.\n";
		}

		var illegalChars= '/[\(\)\<\>\,\;\:\#\{\}\\\/\"\[\]]/';
		if (email.match(illegalChars)) {
			
		   mailerror= "The Email address contains illegal characters3.\n";
		}
		
					
		
			
	}// check valid emailID
		if(!mailerror)
		{
				
				var setulr1="stream_send_user.php?emailid="+email;
				frmobj.action=setulr1;
				var status = AjaxRequest.submit(
		    frmobj
		    ,{
		    	
		      'onSuccess':function(req)
		      { 
		      	//alert(req.responseText);
				document.getElementById('deals').value="";
		      	//alert("Email Address Received. Thank You!");
				location.href="email_confirmation.php?emailid="+email;
		      	     	
		      }
		     }
		  );
    return false;
  	return status;
	}// if emailID not empty and valid then
	else
		{
			alert(mailerror);
			frmobj.deals.focus();
			return false;
		}
}

// function created by amit gandhi for register and send pdf file
function signup(frmid,path)
{
	
	var mailerror="";

	frmobj=document.getElementById(frmid);
	email=frmobj.deals.value;
	
	if(email=="")
	{
		mailerror="Please Enter EmailID ";
	}
	else
	{
		
		if ( email =='')
		{
		mailerror="Email required. \n";
		}
	
		var teststing="name@email.com";
		 if((email.match(teststing))) {
		mailerror= "Please enter a valid  email address.\n";
		}
	 	
		
		if(frmobj.name=='frm_signup')
		{
			var testpath=document.frm_signup.deals;
		}
		else
		{
			var testpath=document.frmsignup.deals;
		}
		if (!ValidateEmail(testpath))
		{
			mailerror= "Please enter a valid  email address.\n";
		}

		var illegalChars= '/[\(\)\<\>\,\;\:\#\{\}\\\/\"\[\]]/';
		if (email.match(illegalChars)) {
			
		   mailerror= "The Email address contains illegal characters3.\n";
		}
		
					
		
			
	}// check valid emailID
		if(!mailerror)
		{
				
				var setulr1="stream_send_user.php?emailid="+email;
				frmobj.action=setulr1;
				var status = AjaxRequest.submit(
		    frmobj
		    ,{
		    	
		      'onSuccess':function(req)
		      { 
		      	//alert(req.responseText);
				document.getElementById('deals').value="";
		      	//alert("Email Address Received. Thank You!");

				location.href="send_email.php?email="+email+"&&path1="+path;
		      	     	
		      }
		     }
		  );
   	 return false;
  	return status;
	}// if emailID not empty and valid then
	else
		{
			alert(mailerror);
			frmobj.deals.focus();
			return false;
		}
}


function ValidateEmail(obj)
{
        var objFrm = eval(obj);
        if (objFrm.value=="")
        {
                return false;
        }
        else
        {
                if (objFrm.value.indexOf("@")==-1)
                {
                        return false;
                }
                var arr=objFrm.value.split("@");
                if (arr[1].indexOf(".")==-1)
                {
                        return false;
                }
        }
        return true;
}