	$(function(){
		
$('.textfield').focus(function(){$('.error').fadeOut();
			}
			);			
	
			$('#sell_calculate').click(
					function(){
					$('.error').fadeOut();
						if($('#sell_currency_amount').val()==""){
								$('#sell_currency_amount_error').fadeIn();
								//alert("Please specify amount you want");
								return false;
							}
	
						if(
							$('#sell_currency_select').val()=="alertpay" && $('#sell_payment_method_select').val()=="naira"){
								//get the  amount the dude inputs
								var sell_currency_amount = parseInt($('#sell_currency_amount').val()); 
								//get the fixed amount
								var sell_rate = parseInt($('#alertpay_sell').val());
								var amount_due = sell_currency_amount * sell_rate;
								$('#sell_amount_due').html(amount_due).fadeIn();
								$('#sell_amount_due_label').html('Amount Due (Naira)').fadeIn();
								
								return false;
								
								}	
								
						if(
							$('#sell_currency_select').val()=="liberty_reserve" && $('#sell_payment_method_select').val()=="naira"){
								//get the  amount the dude inputs
								var sell_currency_amount = parseInt($('#sell_currency_amount').val()); 
								//get the fixed amount
								var sell_rate = parseInt($('#lr_sell').val());
								var amount_due = sell_currency_amount * sell_rate;
								$('#sell_amount_due').html(amount_due).fadeIn();
								$('#sell_amount_due_label').html('Amount Due (Naira)').fadeIn();
								
								return false;
								
								}	
								
								
						if(
							$('#sell_currency_select').val()=="moneybookers" && $('#sell_payment_method_select').val()=="naira"){
								//get the  amount the dude inputs
								var sell_currency_amount = parseInt($('#sell_currency_amount').val()); 
								//get the fixed amount
								var sell_rate = parseInt($('#moneybookers_sell').val());
								var amount_due = sell_currency_amount * sell_rate;
								$('#sell_amount_due').html(amount_due).fadeIn();
								$('#sell_amount_due_label').html('Amount Due (Naira)').fadeIn();
								
								return false;
								
								}
								
						if(
							$('#sell_currency_select').val()=="paypal" && $('#sell_payment_method_select').val()=="naira"){
								//get the  amount the dude inputs
								var sell_currency_amount = parseInt($('#sell_currency_amount').val()); 
								//get the fixed amount
								var sell_rate = parseInt($('#paypal_sell').val());
								var amount_due = sell_currency_amount * sell_rate;
								$('#sell_amount_due').html(amount_due).fadeIn();
								$('#sell_amount_due_label').html('Amount Due (Naira)').fadeIn();
								
								return false;
								
								}						
								
						if(
							$('#sell_currency_select').val()=="procurrex" && $('#sell_payment_method_select').val()=="naira"){
								//get the  amount the dude inputs
								var sell_currency_amount = parseInt($('#sell_currency_amount').val()); 
								//get the fixed amount
								var sell_rate = parseInt($('#procurrex_sell').val());
								var amount_due = sell_currency_amount * sell_rate;
								$('#sell_amount_due').html(amount_due).fadeIn();
								$('#sell_amount_due_label').html('Amount Due (Naira)').fadeIn();
								
								return false;
								
								}	
								
																																											
						if(
							$('#sell_currency_select').val()=="webmoney" && $('#sell_payment_method_select').val()=="naira"){
								//get the  amount the dude inputs
								var sell_currency_amount = parseInt($('#sell_currency_amount').val()); 
								//get the fixed amount
								var sell_rate = parseInt($('#webmoney_sell').val());
								var amount_due = sell_currency_amount * sell_rate;
								$('#sell_amount_due').html(amount_due).fadeIn();
								$('#sell_amount_due_label').html('Amount Due (Naira)').fadeIn();
								
								return false;
								
								}
								
						if(
							$('#sell_currency_select').val()=="cashu" && $('#sell_payment_method_select').val()=="naira"){
								//get the  amount the dude inputs
								var sell_currency_amount = parseInt($('#sell_currency_amount').val()); 
								//get the fixed amount
								var sell_rate = parseInt($('#cashu_sell').val());
								var amount_due = sell_currency_amount * sell_rate;
								$('#sell_amount_due').html(amount_due).fadeIn();
								$('#sell_amount_due_label').html('Amount Due (Naira)').fadeIn();
								
								return false;
								
								}	
								
																																											
						if(
							$('#sell_currency_select').val()=="ukash" && $('#sell_payment_method_select').val()=="naira"){
								//get the  amount the dude inputs
								var sell_currency_amount = parseInt($('#sell_currency_amount').val()); 
								//get the fixed amount
								var sell_rate = parseInt($('#ukash_sell').val());
								var amount_due = sell_currency_amount * sell_rate;
								$('#sell_amount_due').html(amount_due).fadeIn();
								$('#sell_amount_due_label').html('Amount Due (Naira)').fadeIn();
								
								return false;
								
								}								
								
								
						if(
							$('#sell_currency_select').val()=="alertpay" && $('#sell_payment_method_select').val()=="wu"){
								$('#sell_amount_due').html('<p style="color:#900;">An email will be sent to you with the price, please continue and submit the form.</p>').fadeIn();
								$('#sell_amount_due_label').hide();
								return false;

								}		
								
								
						if(
							$('#sell_currency_select').val()=="liberty_reserve" && $('#sell_payment_method_select').val()=="wu"){
								$('#sell_amount_due').html('<p style="color:#900;">An email will be sent to you with the price, please continue and submit the form.</p>').fadeIn();
								$('#sell_amount_due_label').hide();
								return false;

								}																
								
								
						if(
							$('#sell_currency_select').val()=="moneybookers" && $('#sell_payment_method_select').val()=="wu"){
								$('#sell_amount_due').html('<p style="color:#900;">An email will be sent to you with the price, please continue and submit the form.</p>').fadeIn();
								$('#sell_amount_due_label').hide();
								return false;

								}	
								
								
						if(
							$('#sell_currency_select').val()=="paypal" && $('#sell_payment_method_select').val()=="wu"){
								$('#sell_amount_due').html('<p style="color:#900;">An email will be sent to you with the price, please continue and submit the form.</p>').fadeIn();
								$('#sell_amount_due_label').hide();
								return false;

								}			
								
						if(
							$('#sell_currency_select').val()=="procurrex" && $('#sell_payment_method_select').val()=="wu"){
								$('#sell_amount_due').html('<p style="color:#900;">An email will be sent to you with the price, please continue and submit the form.</p>').fadeIn();
								$('#sell_amount_due_label').hide();
								return false;

								}		
								
								
						if(
							$('#sell_currency_select').val()=="webmoney" && $('#sell_payment_method_select').val()=="wu"){
								$('#sell_amount_due').html('<p style="color:#900;">An email will be sent to you with the price, please continue and submit the form.</p>').fadeIn();
								$('#sell_amount_due_label').hide();
								return false;

								}		
								
						if(
							$('#sell_currency_select').val()=="cashu" && $('#sell_payment_method_select').val()=="wu"){
								$('#sell_amount_due').html('<p style="color:#900;">An email will be sent to you with the price, please continue and submit the form.</p>').fadeIn();
								$('#sell_amount_due_label').hide();
								return false;

								}		
								
								
						if(
							$('#sell_currency_select').val()=="ukash" && $('#sell_payment_method_select').val()=="wu"){
								$('#sell_amount_due').html('<p style="color:#900;">An email will be sent to you with the price, please continue and submit the form.</p>').fadeIn();
								$('#sell_amount_due_label').hide();
								return false;

								}										
								
								
								
								
								
								
								
								//moneygram
	if(
							$('#sell_currency_select').val()=="alertpay" && $('#sell_payment_method_select').val()=="moneygram"){
								$('#sell_amount_due').html('<p style="color:#900;">An email will be sent to you with the price, please continue and submit the form.</p>').fadeIn();
								$('#sell_amount_due_label').hide();
								return false;

								}		
								
								
						if(
							$('#sell_currency_select').val()=="liberty_reserve" && $('#sell_payment_method_select').val()=="moneygram"){
								$('#sell_amount_due').html('<p style="color:#900;">An email will be sent to you with the price, please continue and submit the form.</p>').fadeIn();
								$('#sell_amount_due_label').hide();
								return false;

								}																
								
								
						if(
							$('#sell_currency_select').val()=="moneybookers" && $('#sell_payment_method_select').val()=="moneygram"){
								$('#sell_amount_due').html('<p style="color:#900;">An email will be sent to you with the price, please continue and submit the form.</p>').fadeIn();
								$('#sell_amount_due_label').hide();
								return false;

								}	
								
								
						if(
							$('#sell_currency_select').val()=="paypal" && $('#sell_payment_method_select').val()=="moneygram"){
								$('#sell_amount_due').html('<p style="color:#900;">An email will be sent to you with the price, please continue and submit the form.</p>').fadeIn();
								$('#sell_amount_due_label').hide();
								return false;

								}			
								
						if(
							$('#sell_currency_select').val()=="procurrex" && $('#sell_payment_method_select').val()=="moneygram"){
								$('#sell_amount_due').html('<p style="color:#900;">An email will be sent to you with the price, please continue and submit the form.</p>').fadeIn();
								$('#sell_amount_due_label').hide();
								return false;

								}		
								
								
						if(
							$('#sell_currency_select').val()=="webmoney" && $('#sell_payment_method_select').val()=="moneygram"){
								$('#sell_amount_due').html('<p style="color:#900;">An email will be sent to you with the price, please continue and submit the form.</p>').fadeIn();
								$('#sell_amount_due_label').hide();
								return false;

								}																																						
										
						if(
							$('#sell_currency_select').val()=="cashu" && $('#sell_payment_method_select').val()=="moneygram"){
								$('#sell_amount_due').html('<p style="color:#900;">An email will be sent to you with the price, please continue and submit the form.</p>').fadeIn();
								$('#sell_amount_due_label').hide();
								return false;

								}		
								
								
						if(
							$('#sell_currency_select').val()=="ukash" && $('#sell_payment_method_select').val()=="moneygram"){
								$('#sell_amount_due').html('<p style="color:#900;">An email will be sent to you with the price, please continue and submit the form.</p>').fadeIn();
								$('#sell_amount_due_label').hide();
								return false;

								}														
						}
						
				);//end of math
				
					//validation			
				$('#sell_submit').click(
					function(){
						if($('#sell_currency_amount').val()==""){
							$('#sell_currency_amount_error').fadeIn();
							return false;
						}
						
						if($('#sell_account_id').val()==""){
							$('#sell_account_id_error').fadeIn();
							return false;
						}
						
						if($('#sell_confirm_account_id').val()==""){
							$('#sell_confirm_account_id_error').fadeIn();
							return false;
						}	

						if($('#sell_fullname').val()==""){
							$('#sell_fullname_error').fadeIn();
							return false;
						}

						if($('#sell_email').val()==""){
							$('#sell_email_error').fadeIn();
							return false;
						}		
						if($('#sell_confirm_email').val()==""){
							$('#sell_confirm_email_error').fadeIn();
							return false;
						}							
						if($('#sell_phone').val()==""){
							$('#sell_phone_error').fadeIn();
							return false;
						}	
							var account_id = $('#sell_account_id').val();
							var confirm_account_id= $('#sell_confirm_account_id').val();
						
						if( account_id !== confirm_account_id ){
							$('#sell_confirm_account_id_error').html('<p class="error">Account ID mismatch</p>').fadeIn();
							return false;
						}						
						
							var email = $('#sell_email').val();
							var confirm_email= $('#sell_confirm_email').val();
						
						if( email !== confirm_email ){
							$('#sell_confirm_email_error').html('<p class="error">Email mismatch!</p>').fadeIn();
							return false;
						}								
					}
				);	
	});		
