
var dosubmit = false;

function emptyBasket(){
 window.location = "../checkout/?emptybasket=true";
 }
function proceedToCheckout(){
 $('checkout').setAttribute('action','?step=2');
 dosubmit=true;
 $('checkout').submit();
 }
function backToBasket(){
 $('checkout').setAttribute('action','?step=1');
 dosubmit=true;
 $('checkout').submit();
 }
function confirmOrder(){
 html = '';
 if(document.forms['checkout']['first_name'].value==''){
html = ''
+'<p style="color:#ffffff;font-family:arial;font-size:12px;font-weight:normal;line-height:14px;">'
+'Please provide a Name.'
+'</p>'
;
  }
 else if(document.forms['checkout']['address1'].value==''){
html = ''
+'<p style="color:#ffffff;font-family:arial;font-size:12px;font-weight:normal;line-height:14px;">'
+'Please provide an Address.'
+'</p>'
;
  }
  else if(document.forms['checkout']['zip'].value==''){
html = ''
+'<p style="color:#ffffff;font-family:arial;font-size:12px;font-weight:normal;line-height:14px;">'
+'Please provide a Zip Code / Postcode.'
+'</p>'
;
  }
  else if(document.forms['checkout']['email'].value==''){
html = ''
+'<p style="color:#ffffff;font-family:arial;font-size:12px;font-weight:normal;line-height:14px;">'
+'Please provide a valid Email address. This is required for receipt of you order.'
+'</p>'
;
  }
 else if(onclick_form_submit_handler('checkout')){
  $('checkout').setAttribute('action','?step=3');
  dosubmit=true;
  $('checkout').submit();
  }
 if(html!=''){
html += ''
+ '<div class="break0"></div>'
+ '<a href="javascript:cancelpopup();;" onclick="cancelpopup();" class="button" style="float:right;" >'
+ '<div class="btn-lhs"><img src="../php.fonts/maketextww.php?text=Close&c=FFFFFF&bgc=000000&font=AGENCYB.TTF&size=14&topPadding=6" /></div>'
+ '<div class="btn-rhs"></div>'
+ '</a>'
+ '<div class="break2"></div>'
;
  openpopup(html);
  }
 }
function editCustomerDetails(){
 getElem('checkout').setAttribute('action','?step=2');
 dosubmit = true;
 getElem('checkout').submit();
 }
function proceedToPaypal(){
 var html = ''
+ '<p style="color:#ffffff;font-family:arial;font-size:12px;font-weight:normal;line-height:14px;">You are about to leave Otis Riddim Records and enter the Paypal website for payment.'
//+ '<br/> When you click "Continue" an order will be made, and details of it will be logged and emailed to you. After payment is completed, you will be directed back to this website and supplied with details for delivery/collection of your order, onscreen and via email.'
+ '<br/><br/>YOU MUST RETURN TO THIS WEBSITE BY CLICKING THE "RETURN TO MERCHANT" LINK AFTER PAYMENT IS COMPLETED .<br/><br/> If you do not not receive payment receipt via email shortly after, or wish to make any enquiry concerning your order you may contact us at <a href="mailto:sales@otisriddim.com" style="text-decoration:none;">sales@otisriddim.com</a><br/><br/>Do you wish to proceed?</p>'
+ '<div class="break20"></div>'
+ '<a href="javascript:void()" onclick="proceedToPaypalConfirm();" class="button" style="float:right;">'
+ '<div class="btn-lhs"><img src="../php.fonts/maketextww.php?text=Continue&c=FFFFFF&bgc=000000&font=AGENCYB.TTF&size=14&topPadding=6" /></div>'
+ '<div class="btn-rhs"></div>'
+ '</a>'
+ '<a href="javascript:void();" onclick="cancelpopup();" class="button" style="float:right;" >'
+ '<div class="btn-lhs"><img src="../php.fonts/maketextww.php?text=Cancel&c=FFFFFF&bgc=000000&font=AGENCYB.TTF&size=14&topPadding=6" /></div>'
+ '<div class="btn-rhs"></div>'
+ '</a>'
+ '<div class="break2"></div>'
;
 openpopup(html);
 }
function proceedToPaypalConfirm(){
 getElem('submitbuttons').innerHTML = '<div class="button" style="float:right;"><div class="btn-lhs"><img src="../php.fonts/maketextww.php?text=Proccessing+Order...&c=FFFFFF&bgc=000000&font=AGENCYB.TTF&size=14&topPadding=6" /></div><div class="btn-rhs"></div></div>';
 ajax_formpost(getElem('checkout'));
 }


