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

function highlight_tab( tabName) {

 document.getElementById('tab_back1').style.background = "url(images/ps_new_2011/layout/product/blue_tab.jpg)";

 document.getElementById('tab_back2').style.background = "url(images/ps_new_2011/layout/product/blue_tab.jpg)";

 document.getElementById('tab_back3').style.background = "url(images/ps_new_2011/layout/product/blue_tab.jpg)";

 document.getElementById('tab_back4').style.background = "url(images/ps_new_2011/layout/product/blue_tab.jpg)";


 document.getElementById(tabName).style.background = "url(images/ps_new_2011/layout/product/green_tab.jpg)";
 document.getElementById(tabName).style.color = "#ffffff";

 var myAjax3 = new Ajax.Updater('ajax_desc_div', 'ajax.productdesc.php', {method: 'post', parameters: 'tab_number='+  tabName + '&product_id='+escape($F('productid')) });

}

var colour_selection="";
var size_selection = "";

function ajax_hide_mini_cart(){
 new Effect.SlideUp('ajax_mini_roll_cart');
 var myAjax7 = new Ajax.Updater('ajax_mini_roll_cart', 'ajax.minicart_add.php', {method: 'post', parameters: 'show_filler=true' });
 cart_box_open = "";
}

var cart_box_open="";

function ajax_check_and_hide_mini_cart() {
 if (cart_box_open=="yes") {
  ajax_hide_mini_cart();
 }
}

function show_size_box(size_id) {

 for (var i = 0; i < my_sizes_array.length; i++) {
   toggle_off('size_' + my_sizes_array[i]);
   document.getElementById('link_s_select_' + my_sizes_array[i]).style.fontWeight  = "";
 }

 toggle('size_' + size_id);
 document.getElementById('link_s_select_' + size_id).style.fontWeight  = "bold";

}

function sb_check_1(box_id) {

 var box_value_1 = document.getElementById(box_id).value;
 if (box_value_1 == 0) {
  document.getElementById(box_id).value = "";
 }

}

function sb_check_2(box_id) {

 var box_value_2 = document.getElementById(box_id).value;
 if (box_value_2 == "") {
  document.getElementById(box_id).value = "0";
 }

}

function apply_colour(colour_id,tracking_type) {
 document.getElementById('scid').value = colour_id;
 document.getElementById('colour_' + colour_id).checked = true;
 colour_selection='yes';
 ajax_image_change();
 ajax_size_box();
 ajax_check_and_hide_mini_cart();
 ajax_email_close_box(); 
}

function ajax_email_stock(size_id) {
 toggle_off('ajax_email_in_stock');
 Effect.Appear('ajax_email_in_stock');
 var myAjax20 = new Ajax.Updater('ajax_email_in_stock', 'ajax.email_in_stock.php', {method: 'post', parameters: 'size_id='+  size_id + '&product_id='+escape($F('productid')) + '&colour_id='+escape($F('scid')) });
}

function ajax_email_stock_2(size_id) {
 var myAjax21 = new Ajax.Updater('ajax_email_in_stock', 'ajax.email_in_stock.php', {method: 'post', parameters: 'action=update&size_id=' +escape($F('es_size_id')) + '&product_id='+escape($F('productid')) + '&colour_id='+escape($F('scid')) + '&email_send='+escape($F('email_in_stock')) });
}

function ajax_email_close_box() {
 var myAjax22 = new Ajax.Updater('ajax_email_in_stock', 'ajax.email_in_stock.php', {method: 'post', parameters: 'action=update2' });
 toggle_off('ajax_email_in_stock');
}

function ajax_email_stock_from_table(size_id,colour_id) {
	 toggle_off('ajax_email_in_stock');
	 Effect.Appear('ajax_email_in_stock');
	 var myAjax23 = new Ajax.Updater('ajax_email_in_stock', 'ajax.email_in_stock.php', {method: 'post', parameters: 'size_id='+ size_id +'&product_id='+ escape($F('productid')) +'&colour_id='+ colour_id +'&table=true' });
	}

function ajax_email_stock_from_table_2(size_id,colour_id) {
 var myAjax24 = new Ajax.Updater('ajax_email_in_stock', 'ajax.email_in_stock.php', {method: 'post', parameters: 'action=update&size_id=' +escape($F('es_size_id')) + '&product_id='+escape($F('productid')) + '&colour_id='+colour_id + '&email_send='+escape($F('email_in_stock')) +'&table=true' });
}

