"); d.close(); } function toggle_layout() { main_loaded = false; current_content = top.main.content.document.location.toString(); if(current_layout == layout_menu) { current_layout = layout_plain; top.main.location = "fs_cont.html"; } else { current_layout = layout_menu; top.main.location = "fs_menu.html"; } } function update_basket_total(f) { update_running_total(); var l = new String(top.main.content.location); var t = 0; var cb = 0; if(l.indexOf("basket.html") != -1) { f.total_ex_tax.value = currency_symbol + " " + ex_tax_total_string(); if(current_tax_area) f.total_inc_tax.value = currency_symbol + " " + inc_tax_total_string(); else f.total_inc_tax.value = ""; if(current_currency.index) { t = ex_tax_total(); cb = t * (top.base_currency.multiplier / top.shop_currency.multiplier); t = cb * top.current_currency.multiplier; f.total_ex_tax_cur.value = current_currency.abbrev + " " + decimal_string_currency(t, current_currency); if(current_tax_area) { t = inc_tax_total(); cb = t * (top.base_currency.multiplier / top.shop_currency.multiplier); t = cb * top.current_currency.multiplier; f.total_inc_tax_cur.value = current_currency.abbrev + " " + decimal_string_currency(t, current_currency); } else f.total_inc_tax_cur.value = ""; } } } function change_shipping_region(f) { current_shipping_region = parseInt(f.shipping_region.options[f.shipping_region.selectedIndex].value); update_basket_total(f); } function change_tax_area(f) { current_tax_area = parseInt(f.tax_area.options[f.tax_area.selectedIndex].value); update_basket_total(f); } function change_shipping_method(f) { current_shipping_method = parseInt(f.shipping_method.options[f.shipping_method.selectedIndex].value); update_basket_total(f); } function recalculate_basket_totals(f) { if(has_shipping_regions) { change_shipping_region(f); } if(has_shipping_methods) { change_shipping_method(f); } if(has_tax_areas) { change_tax_area(f); } } function customer_save_billing() { var billing_string = new String(""); billing_string = this.billing_details.name + "|"; billing_string += this.billing_details.company + "|"; billing_string += this.billing_details.street + "|"; billing_string += this.billing_details.city + "|"; billing_string += this.billing_details.state + "|"; billing_string += this.billing_details.zip + "|"; billing_string += this.billing_details.country + "|"; billing_string += this.billing_details.phone + "|"; billing_string += this.billing_details.fax + "|"; billing_string += this.billing_details.email + "|"; save_cookie_string("CUSTOMER_BILLING", billing_string, -1); } function customer_load_billing() { var billing_string = new String(""); billing_string = get_cookie_string("CUSTOMER_BILLING"); if(billing_string != "") { if(this.billing_details.name.length == 0) { if(confirm(ln_load_customer)) { var a = billing_string.split('|'); this.billing_details.name = a[0]; this.billing_details.company = a[1]; this.billing_details.street = a[2]; this.billing_details.city = a[3]; this.billing_details.state = a[4]; this.billing_details.zip = a[5]; this.billing_details.country = a[6]; this.billing_details.phone = a[7]; this.billing_details.fax = a[8]; this.billing_details.email = a[9]; var f = top.main.content.document.order_form; f.customer_name.value = this.billing_details.name; f.company_name.value = this.billing_details.company; f.customer_street.value = this.billing_details.street; f.customer_city.value = this.billing_details.city; f.customer_state.value = this.billing_details.state; f.customer_zip.value = this.billing_details.zip; f.customer_country.value = this.billing_details.country; f.customer_phone.value = this.billing_details.phone; f.customer_fax.value = this.billing_details.fax; f.customer_email.value = this.billing_details.email; } } } } function customer_save_delivery() { var delivery_string = new String(""); delivery_string = this.delivery_details.name + "|"; delivery_string += this.delivery_details.company + "|"; delivery_string += this.delivery_details.street + "|"; delivery_string += this.delivery_details.city + "|"; delivery_string += this.delivery_details.state + "|"; delivery_string += this.delivery_details.zip + "|"; delivery_string += this.delivery_details.country + "|"; delivery_string += this.delivery_details.phone + "|"; save_cookie_string("CUSTOMER_DELIVERY", delivery_string, -1); } function customer_load_delivery() { var delivery_string = new String(""); delivery_string = get_cookie_string("CUSTOMER_DELIVERY"); if(delivery_string != "") { if(this.delivery_details.name.length == 0) { if(confirm(ln_load_customer)) { var a = delivery_string.split('|'); this.delivery_details.name = a[0]; this.delivery_details.company = a[1]; this.delivery_details.street = a[2]; this.delivery_details.city = a[3]; this.delivery_details.state = a[4]; this.delivery_details.zip = a[5]; this.delivery_details.country = a[6]; this.delivery_details.phone = a[7]; var f = top.main.content.document.order_form; f.delivery_name.value = this.delivery_details.name; f.company_name.value = this.delivery_details.company; f.delivery_street.value = this.delivery_details.street; f.delivery_city.value = this.delivery_details.city; f.delivery_state.value = this.delivery_details.state; f.delivery_zip.value = this.delivery_details.zip; f.delivery_country.value = this.delivery_details.country; f.delivery_phone.value = this.delivery_details.phone; } } } } function customer_payment_details() { this.cc_type = ""; this.cc_name = ""; this.cc_number = ""; this.cc_expiry = ""; return(this); } function customer_details() { this.name = ""; this.company = ""; this.street = ""; this.city = ""; this.state = ""; this.zip = ""; this.country = ""; this.phone = ""; this.fax = ""; this.email = ""; this.notice = ""; return(this); } function customer() { this.payment_details = new customer_payment_details(); this.billing_details = new customer_details(); this.delivery_details = new customer_details(); this.save_billing = customer_save_billing; this.load_billing = customer_load_billing; this.save_delivery = customer_save_delivery; this.load_delivery = customer_load_delivery; return(this); } the_customer = new customer(); function print_basket(d, m) { var b = the_basket; if(m) { d.writeln("
"); } d.writeln(""); d.writeln(""); d.writeln(""); d.writeln(""); d.writeln(""); d.writeln(""); if(m) { d.writeln(""); } for(var i=1; i<=b.items.count; i++) { var item_price = new Number(0); item_price = parseFloat(0); d.writeln(""); d.writeln(""); item_price += b.items[i].price; d.writeln(""); d.writeln(""); if(m) { d.writeln(""); } else { d.writeln(""); } d.write(""); if(m) { d.writeln(""); } d.writeln(""); } d.writeln("
" + ln_title + "" + ln_price + "" + ln_options + "" + ln_quantity + "" + ln_subtotal + " 
" + b.items[i].title + "" + currency_symbol + " " + decimal_string(round(item_price,2)) + ""); if(b.items[i].options.count != 0) { d.writeln(""); for(var j=1; j<=b.items[i].options.count; j++) { d.writeln(""); d.writeln(""); d.writeln(""); item_price = item_price + b.items[i].options[j].price; } d.writeln("
"); d.writeln(b.items[i].options[j].product_number); d.writeln(""); d.writeln(b.items[i].options[j].option_value); d.write(""); d.write(currency_symbol + " "); d.write(decimal_string(round(b.items[i].options[j].price,2))); d.write("
"); } else { d.write(" "); } d.writeln("
"); d.writeln("" + b.items[i].quantity + ""); var font_tag = ""; if(font_tag != "") { if(current_currency.index) { font_tag += " size=\"-1\""; } d.write(font_tag + ">"); } else { d.write(""); } d.write(currency_symbol + " " + decimal_string(round((item_price * b.items[i].quantity),2))); if(current_currency.index) { d.write("
"); var cb = 0; var price = item_price * b.items[i].quantity; cb = price * (base_currency.multiplier / shop_currency.multiplier); price = cb * current_currency.multiplier; d.write(current_currency.abbrev + " " + decimal_string_currency(price, current_currency)); } if(font_tag != "") { d.write("
"); } d.writeln("
" + ln_delete + "
"); if(m) { d.writeln("
"); } } function apply_font(s) { var rval = new String(); rval = ""; var i = s.indexOf("."); if(i != -1) { var s1 = s.substring(0, i); var s2 = s.substring(i, i+1); var s3 = s.substring(i+1, s.length); rval = s1 + "" + s2 + "" + s3; } else { rval = s; } return(rval); } function show_item_price(f) { if(good_browser) { var price_ex = parseFloat(parseFloat(f.price.value) * parseInt(f.item_quantity.value)); for(var i=0; i 0) && (has_tax_areas)) || (current_currency.index > 0)) { if((current_tax_area > 0) && (has_tax_areas)) { price_inc = price_ex + (price_ex * (tax_areas[current_tax_area].multiplier / 100)); } if(current_currency.index) { var cb = 0; cb = price_ex * (base_currency.multiplier / shop_currency.multiplier); price_ex = cb * current_currency.multiplier; if(price_inc) { cb = price_inc * (base_currency.multiplier / shop_currency.multiplier); price_inc = cb * current_currency.multiplier; } } var d = top.extra.individual.document; d.open("text/html"); d.writeln(""); d.writeln("

"); d.writeln("
"); d.writeln(""); d.writeln(""); d.write(""); d.writeln(""); d.writeln("
   "); if(current_currency.index) { d.write(current_currency.abbrev); } else { d.write(currency_symbol); } d.write(" "); if(current_currency.index) { d.write(apply_font(decimal_string_currency(price_ex, current_currency))); } else { d.write(apply_font(decimal_string(round(price_ex, 2)))); } if((current_tax_area > 0) && (has_tax_areas)) { d.write(" "); d.write(top.ln_ex); } if((current_tax_area > 0) && (has_tax_areas)) { d.write("  "); if(current_currency.index) { d.write(current_currency.abbrev); } else { d.write(currency_symbol); } d.write(" "); if(current_currency.index) { d.write(apply_font(decimal_string_currency(price_inc, current_currency))); } else { d.write(apply_font(decimal_string(round(price_inc, 2)))); } d.write(" "); d.write(top.ln_inc); } d.writeln("   
"); d.writeln(""); d.writeln("



"); d.close(); } } } function hide_item_price() { if(good_browser) { var d = top.extra.individual.document; d.open("text/html"); d.writeln(""); d.writeln("

"); d.writeln(""); d.writeln("



"); d.close(); } } function load_currency_data() { if(top.good_browser) { if(top.location.protocol.toLowerCase().substring(0,4) == "file") { if(confirm(top.ln_currency_online)) { top.extra.cdata.location = "cload.html"; } } else { top.extra.cdata.location = "cload.html"; } } } function second_currency_string() { var cb = 0; cb = inc_tax_total() * (base_currency.multiplier / shop_currency.multiplier); var ttl = cb * current_currency.multiplier; return(current_currency.name + " " + ln_total_inc + " " + decimal_string_currency(ttl, current_currency)); } document.writeln(""); document.writeln(""); document.writeln(""); document.writeln(""); document.writeln(""); //-->