function requestFormValidation(due_amount)
	{
	   	   var amount=document.rform.amount.value;
		   var res=confirm("Are you sure to request this amount ? ");
		   if(!res)
		   {
		       return false;
		   }
		   if(amount == "")
		   {
		        alert("Please insert amount");
				return false;
		   }
		   else if(isNaN(amount))
		   {
		        alert("Please insert numeric value");
				return false;
		   }
		   else if(amount <= 0)
		   {
		        alert("you can not request less than one dollar");
				return false;
		   }
		   else if(due_amount == 0)
		   {
		         alert("You already recieved total amount");
				 return false;
		   }
		   else if(amount > due_amount)
		   {
		         alert("You account not sufficient to request this amount");
				 return false;
		   }
		   else
		   {
		       return true;
		   }
		   
	}
	 function declineConfirm(vid,option)
	{
	     var con=confirm("Are you sure to decline this request ? ");
		 if(con)
		 {
		      window.location="index.php?option="+option+"&act=decline&vid="+vid;
			  
		 }
		 else
		 {
		     window.location="#";
		 }
	}
	function acceptConfirm()
	{
	    var res=confirm("Are you sure to accept this request ? ");
		if(res)
		{
		   return true;
		}
		else
		{
		    return false;
		}  
	}
	function buyer_transaction_validation(due_amount,payable_amount)
  {
      var amount=document.wform.amount.value;
	  
	  if(amount == "")
	  {
	      alert("Please insert amount");
		  return false;
	  }
	  else if(amount < 20)
	  {
	       alert("You can not request under 20 Dollar");
		   return false;
	  }
	  else if(isNaN(amount))
	  {
	      alert("Please insert numeric value");
		  return false;
	  }
	  else if(amount > due_amount)
	  {
	      alert("You have no enough money");
		  return false; 
	  }
	  ///////check if the buyer amount is available
	  else if(amount>(due_amount-payable_amount))
	  {
	  	alert("You at most withdraw "+(due_amount-payable_amount)+" money");
		return false;
	  }
	  else if(due_amount<20)
	  {
	      alert("You can not withdraw less than $20");
		  return false; 
	  }
	  else 
	  {
	    var rs=  confirm("Are you sure about this transaction? ");
		if(rs==false)
		{
			 return false; 
		}
		else
			return true;
	  }
  }
  function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=650,height=770,left = 412,top = 234');");
}
function provider_transaction_validation(due_amount)
  {
      var amount=document.wform.amount.value;
	   if(amount == "")
	  {
	      alert("Please insert amount");
		  return false;
	  }
	  else if(isNaN(amount))
	  {
	      alert("Please insert numeric value");
		  return false;
	  }
	   else if(amount < 20)
	  {
	       alert("You can not request under 20 Dollar");
		   return false;
	  }
	  else if(amount > due_amount)
	  {
	      alert("Your account is not sufficient to request this amount");
		  return false; 
	  }
	  else 
	  {
		var rs=  confirm("Are you sure about this transaction? ");
		if(rs==false)
		{
			 return false; 
		}
		else
			return true;
	  }
  }
 
