$(document).ready(function(){var lightboxArr=new Array()
$('a[rel^=lightbox]').each(function(){if(jQuery.inArray($(this).attr('rel'),lightboxArr)<0){lightboxArr.push($(this).attr('rel'));}});jQuery.each(lightboxArr,function(){$('a[rel^='+this+']').lightBox();});if(jQuery('.show_product_options').length>0){change_prices();jQuery('.show_product_options').change(function(){change_prices();});}
if(jQuery.nyroModal)
{jQuery('.popup').nyroModal();}
jQuery('#bank').click(function(){p=jQuery('#p12');if(p!=undefined){p.attr('checked',true);}});});function change_prices(){var tmp_price_add=0;var tmp_price_set=0;jQuery('select.show_product_options option:selected').each(function(){str=jQuery(this).html().replace(/\s|&nbsp;/g,'').match(/\(.*\)/g)+'';if(str=='null')return null;is_add=str.search(/\+/);str=str.match(/\d+\.?\d*/g)+'';number=parseFloat(str.replace(/,/g,'.'));if(number>0){if(is_add>0)
tmp_price_add+=number;else
tmp_price_set=number;}else return null;})
if(tmp_price_set>0){if(prom_price>0){vat_value=((show_product_tax*(tmp_price_set+tmp_price_add))/(show_product_tax+100)).toFixed(2);netto=(tmp_price_set+tmp_price_add-vat_value);netto=parseFloat(netto.toFixed(2));jQuery('#prom_price').html((tmp_price_set+tmp_price_add).toString().replace(/\./g,','));jQuery('#prom_price_net').html(netto.toString().replace(/\./g,','));jQuery('#prom_price_formated').html((tmp_price_set+tmp_price_add).number_format());jQuery('#prom_price_formated_net').html(netto.number_format());}else{vat_value=((show_product_tax*(tmp_price_set+tmp_price_add))/(show_product_tax+100)).toFixed(2);netto=(tmp_price_set+tmp_price_add-vat_value);netto=parseFloat(netto.toFixed(2));jQuery('#price').html((tmp_price_set+tmp_price_add).toString().replace(/\./g,','));jQuery('#price_net').html(netto.toString().replace(/\./g,','));jQuery('#price_formated').html((tmp_price_set+tmp_price_add).number_format());jQuery('#price_formated_net').html(netto.number_format());}}else if(tmp_price_set==0){if(prom_price>0){vat_value=((show_product_tax*(prom_price+tmp_price_add))/(show_product_tax+100)).toFixed(2);netto=(prom_price+tmp_price_add-vat_value);netto=parseFloat(netto.toFixed(2));jQuery('#prom_price').html((prom_price+tmp_price_add).toString().replace(/\./g,','));jQuery('#prom_price_net').html(netto.toString().replace(/\./g,','));jQuery('#prom_price_formated').html((prom_price+tmp_price_add).number_format());jQuery('#prom_price_formated_net').html(netto.number_format());}else{vat_value=((show_product_tax*(price+tmp_price_add))/(show_product_tax+100)).toFixed(2);netto=(price+tmp_price_add-vat_value);netto=parseFloat(netto.toFixed(2));jQuery('#price').html((price+tmp_price_add).toString().replace(/\./g,','));jQuery('#price_net').html(netto.toString().replace(/\./g,','));jQuery('#price_formated').html((price+tmp_price_add).number_format());jQuery('#price_formated_net').html(netto.number_format());}}}
