/*this array follows this pattern -> path to first image, first image link, path to second image, second image link....*/ var link_num; function close_store(){ document.getElementById('eos-store').style.display='none'; } function open_store(){ document.getElementById('eos-store').style.display='block'; } function zero_store(){ return; // we don't need this set_zero('ee','jb'); set_zero('ee','cb'); set_zero('ee','op'); set_zero('ir2000','b'); set_zero('ir2000','w'); } function set_zero(prod,color){ var prodq=document.getElementById(prod + '_' + color + '_quant'); if(! prodq){ return; }else{ prodq.value='0'; } } var prod_data = new Array(); var total_qty = 0; function isColorSelected(prod,color){ colors = document.getElementById(prod + '_' + color + '_color_options'); if(! colors){ return false; } if(colors.value == ''){ alert('Please select a color.'); return false; } return true; } function checkAnyColor(){ //check for color selection if(isColorSelected('ee','jb')){ return true; }else if(isColorSelected('ir2000','b')){ return true; } // No color is selected at all return false; } function add_to_cart_multi(){ if(! checkAnyColor()){ return false; } // check each product for quantity add_quantity('ee','jb'); // check each product for quantity add_quantity('ir2000','b'); form = document.getElementById('add_product_multi'); if(form){ if(total_qty > 0){ form.submit(); }else{ alert('Please select a quantity'); } }else{ alert("Your web browser does not support javascript properly.\nPlease call us to complete your order."); } return false; } function add_quantity(prod,color){ if(document.getElementById(prod + '_' + color + '_color_options')){ var chColor = document.getElementById(prod + '_' + color + '_color_options').value; multi_product_add(prod,color,chColor); }else{ multi_product_add(prod,color,false); } } function multi_product_add(prod,color,chColor){ // eos core color product ids prod_data['ee'] = new Array(); prod_data['ee']['cb'] = '96'; prod_data['ee']['op'] = '97'; prod_data['ee']['jb'] = '98'; prod_data['ir2000'] = new Array(); prod_data['ir2000']['b'] = '49'; prod_data['ir2000']['w'] = '101'; // get data about the select product var prodq=document.getElementById(prod + '_' + 'cb' + '_quant'); if(! prodq){ prodq=document.getElementById(prod + '_' + 'op' + '_quant'); } if(! prodq){ prodq=document.getElementById(prod + '_' + 'jb' + '_quant'); } if(! prodq){ prodq=document.getElementById(prod + '_' + 'b' + '_quant'); } if(! prodq){ prodq=document.getElementById(prod + '_' + 'w' + '_quant'); } if(! prodq){ return; } var prod_id = prod_data[prod][(chColor ? chColor : color)]; var prod_quant = prodq.value; total_qty += prod_quant; // set the multi add input value var prod_add = document.getElementById(prod + '_' + 'jb' + '_add'); if(! prod_add){ prod_add = document.getElementById(prod + '_' + 'op' + '_add'); } if(! prod_add){ prod_add = document.getElementById(prod + '_' + 'cb' + '_add'); } if(! prod_add){ prod_add = document.getElementById(prod + '_' + 'b' + '_add'); } if(! prod_add){ prod_add = document.getElementById(prod + '_' + 'w' + '_add'); } prod_add.name = 'products_id[' + prod_id + ']'; prod_add.value = prod_quant; } function selectRadio(but){ var b = document.getElementById(but); if(b){ b.checked=true; } }