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')) });
}

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

function check_colour()
{
if ((colour_selection=="") || (size_selection==""))
{
if (colour_selection=="") {
alert("You need to select a colour.");
return (false);
}
else {
alert("You need to enter the number per size required.");
return (false);
}

}

return true;
}

function highlight_tab_price(tabName) {

 document.getElementById('price_tab1').style.background = "url(images/c2o_new_2010/product/blue_tab_small.gif)";
 document.getElementById('price_tab2').style.background = "url(images/c2o_new_2010/product/blue_tab_small.gif)";
 document.getElementById('price_tab3').style.background = "url(images/c2o_new_2010/product/blue_tab_small.gif)";

 document.getElementById(tabName).style.background = "url(images/c2o_new_2010/product/green_tab_small.gif)";

 /* Reset size pricing */
 if (document.getElementById('sizes_a').value == "yes") {
  show_size_box('top');
 }

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

}


function highlight_tab( tabName) {

 document.getElementById('tab_back1').style.background = "url(images/c2o_new_2010/product/blue_tab_large.gif)";
 document.getElementById('tab_back2').style.background = "url(images/c2o_new_2010/product/blue_tab_large.gif)";
 document.getElementById('tab_back3').style.background = "url(images/c2o_new_2010/product/blue_tab_large.gif)";
 document.getElementById('tab_back4').style.background = "url(images/c2o_new_2010/product/blue_tab_large.gif)";

 document.getElementById(tabName).style.background = "url(images/c2o_new_2010/product/green_tab_large.gif)";


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

}

function highlight_tab_stores( tabName) {

 document.getElementById('tab_back1').style.background = "url(images/c2o_new_2009/product/desc_light_tab_stores.gif)";
 document.getElementById('tab_back2').style.background = "url(images/c2o_new_2009/product/desc_light_tab_stores.gif)";
 document.getElementById('tab_back3').style.background = "url(images/c2o_new_2009/product/desc_light_tab_stores.gif)";
 document.getElementById('tab_back4').style.background = "url(images/c2o_new_2009/product/desc_light_tab_stores.gif)";
 document.getElementById('tab_back1').style.color = "#696161";
 document.getElementById('tab_back2').style.color = "#696161";
 document.getElementById('tab_back3').style.color = "#696161";
 document.getElementById('tab_back4').style.color = "#696161";

 document.getElementById(tabName).style.background = "url(images/c2o_new_2009/product/desc_dark_tab_stores.gif)";
 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')) });

}


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 apply_colour_iq(this_colour_id,tracking_type) {
 document.getElementById('scid').value = this_colour_id;
 document.option1.colour_id.value =  this_colour_id;
 document.getElementById('colour_' + this_colour_id).checked = true;
 colour_selection='yes';
 ajax_size_box();
}

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' });
}


function ajax_show_ps_reviews(s1) {
 scroll(0,0);
 document.getElementById('lightbox_highlighted_div').style.height = '500px';
 toggle('lightbox_overlay');
 Effect.BlindDown('lightbox_highlighted_div');
 var myAjax = new Ajax.Updater('lightbox_highlighted_div', 'ajax.show_ps_reviews.php', {method: 'post', parameters: 'ps_id=' + escape(s1) + '&product_id='+escape($F('productid')) });
}



