function ajax_stock_box(){
 var myAjax = new Ajax.Updater('stock_box_div', 'ajax.stock.php', {method: 'post', parameters: 'colour='+escape($F('id[1]')) + '&size='+escape($F('size_select')) + '&pq='+escape($F('pq')) + '&product_id='+escape($F('productid')) });
}

function ajax_image_change(){
 var myAjax2 = new Ajax.Updater('ajax_image_div', 'ajax.changeimage.php', {method: 'post', parameters: 'colour='+escape($F('id[1]')) + '&product_id='+escape($F('productid')) });
}

function toggle( targetId ){
if (document.getElementById) {
 target = document.getElementById (targetId);
if (target.style.display == "none") {
 target.style.display = "";
 }
else {
 target.style.display = "none";
}
}
}

function toggle_off( targetId ){
if (document.getElementById) {
 target = document.getElementById (targetId);
 target.style.display = "none";
}
}

function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,top=150,left=150')
}

function product_clear_loader() {
document.getElementById('ajax_image_div').style.background='url(images/spacer.gif)';
}

var size_selection = "";

function check_colour() {
if ( ($F('id[1]') == "") || ($F('size_select') == "") ) {
alert("Please select colour, size and quantity.");
return (false);
}
return true;
}


