var loggedIn = false;
var prevTab = "";
function addToWishList(){
url = "wishlist_update.php?Add&";
quantity = $('Order').value;
colour = $('product_colour').value;
size = $('product_size').value;
prodID = $('prodID').value;
user = '';
title = $('product_title').value;
url += "quantity="+quantity+"&size="+size+"&colour="+colour+"&Title="+title+"&prodID="+prodID+"&ajax";
loadPage(url,'wishlist');
}
function displayPostage(){
var size = $('product_size').value;
var bits = size.split(",");
var price = bits[1] * $('Order').value;
var basketTotal = 0;
if(basketTotal==0)
msg = "";
else
msg = "This item would bring your postage to:
"
price += basketTotal;
if(price>=180){
$('postage').innerHTML = "Postage
"+msg+
"
FREE within the UK, and
"+
"
Please call for the rest of the world
";
}
if(price<180){
$('postage').innerHTML = ""+msg+
"
£7.50 within the UK, and
"+
"
£12.00 to the rest of the world
";
}
if(price<75){
$('postage').innerHTML = ""+msg+
"
£5.50 within the UK, and
"+
"
£9.50 to the rest of the world
";
}
if(price<50){
$('postage').innerHTML = ""+msg+
"
£4.50 within the UK, and
"+
"
£7.50 to the rest of the world
";
}
if(price<30){
$('postage').innerHTML = ""+msg+
"
£3.50 within the UK, and
"+
"
£5.50 to the rest of the world
";
}
if(price<15){
$('postage').innerHTML = ""+msg+
"
£2.00 within the UK, and
"+
"
£4.50 to the rest of the world
";
}
}
function updateDetails(){
if($('password1').value!="" && $('password1').value != $('password2').value){
displayMessage("The new passwords you have entered do not match, please try again");
}
if($('pass').value==''){
alert("For security you must enter your password in order to update your details.");
gotoField("pass");
return false;
} else {
url = 'ajax=true&'+$('details').toQueryString();
if($('checkout')){
loadPage('user_editaccount.php','details_div','main_address',url);
} else {
loadPage('user_editaccount.php','details_div','details_div',url);
}
return false;
}
}
function checksubmit(){
//this checks to see if the old password has been entered on the edit account page
//if so the submit button is enabled, otherwise it is disabled
if($('pass').value!=""){
$('submitbutton').disabled = false;
$('update_message').innerHTML = "";
}else{
$('submitbutton').disabled = true;
$('update_message').innerHTML = "You must enter your old password before you can proceed.";
}
}
//================================================
//registration functions
//================================================
function genpassword() {
var length = 6;
var pass = "";
// all the chars we want to use
var chars = "a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 - + * / ! @ %";
var bits = chars.split(" ");
for(i=0;i