var testsuccess=0;var lnid=new Array();function categorylist(a){self.location=a}var noresults=function(a){return true};var changetaxntotal=function(a){prices=a.split(":");c=parseFloat(prices[0])+parseFloat(prices[1])+parseFloat(prices[2]);var c=roundNumber(c,2);var b=roundNumber(prices[0],2);b=b.toFixed(2);c=c.toFixed(2);document.getElementById("checkout_tax").innerHTML="<span class='pricedisplay'>$"+b+"</span>";document.getElementById("checkout_total").innerHTML="<span class='pricedisplay'>$"+c+"</span>";return true};function roundNumber(b,c){var a=Math.round(b*Math.pow(10,c))/Math.pow(10,c);return a}var getresults=function(results){eval(results);if(window.drag_and_drop_cart_updater){drag_and_drop_cart_updater()}if(document.getElementById("loadingimage")!=null){document.getElementById("loadingindicator").style.visibility="hidden"}else{if(document.getElementById("alt_loadingimage")!=null){document.getElementById("alt_loadingindicator").style.visibility="hidden"}}if((document.getElementById("sliding_cart")!=null)&&(document.getElementById("sliding_cart").style.display=="none")){jQuery("#fancy_collapser").attr("src",(MTOC_URL+"/images/minus.png"));jQuery("#sliding_cart").show("fast",function(){ajax.post("index.php",noresults,"ajax=true&set_slider=true&state=1")})}if(document.getElementById("fancy_notification")!=null){jQuery("#loading_animation").css("display","none")}};function set_billing_country(b,a){var c="";country=jQuery(("div#"+b+" select[@class=current_country]")).val();region=jQuery(("div#"+b+" select[@class=current_region]")).val();if(/[\d]{1,6}/.test(region)){c="&billing_region="+region}ajax.post("index.php",getresults,("ajax=true&form_id="+a+"&billing_country="+country+c));ajax.post("index.php",changetaxntotal,("ajax=true&changetax=true&form_id="+a+"&billing_country="+country+c))}function submitform(d,b){if(b!=false){b=true}ajax.post("index.php?ajax=true&user=true",getresults,ajax.serialize(d));if(document.getElementById("loadingimage")!=null){document.getElementById("loadingimage").src=MTOC_URL+"/images/indicator.gif";document.getElementById("loadingindicator").style.visibility="visible"}else{if(document.getElementById("alt_loadingimage")!=null){document.getElementById("alt_loadingimage").src=MTOC_URL+"/images/indicator.gif";document.getElementById("alt_loadingindicator").style.visibility="visible"}}if((b==true)&&(document.getElementById("fancy_notification")!=null)){var c={margin:1,border:1,padding:1,scroll:1};form_button_id=d.id+"_submit_button";var e={};new_container_offset=jQuery("#products_page_container").offset(c,e);if(e.left==null){e.left=new_container_offset.left;e.top=new_container_offset.top}var a={};new_button_offset=jQuery("#"+form_button_id).offset(c,a);if(a.left==null){a.left=new_button_offset.left;a.top=new_button_offset.top}jQuery("#fancy_notification").css("left",(a.left-e.left+10)+"px");jQuery("#fancy_notification").css("top",((a.top-e.top)-60)+"px");jQuery("#fancy_notification").css("display","block");jQuery("#loading_animation").css("display","block");jQuery("#fancy_notification_content").css("display","none")}return false}function emptycart(){ajax.post("index.php",getresults,"ajax=true&user=true&emptycart=true&current_page="+window.location+"");if(document.getElementById("loadingimage")!=null){document.getElementById("loadingimage").src=MTOC_URL+"/images/indicator.gif";document.getElementById("loadingindicator").style.visibility="visible"}else{if(document.getElementById("alt_loadingimage")!=null){document.getElementById("alt_loadingimage").src=MTOC_URL+"/images/indicator.gif";document.getElementById("alt_loadingindicator").style.visibility="visible"}}}function show_additional_description(b,a){currentstate=document.getElementById(b).style.display;if(currentstate!="inline"){document.getElementById(b).style.display="inline";document.getElementById(a).src=MTOC_URL+"/images/icon_window_collapse.gif"}else{document.getElementById(b).style.display="none";document.getElementById(a).src=MTOC_URL+"/images/icon_window_expand.gif"}return false}function prodgroupswitch(a){if(a=="brands"){jQuery(".categorydisplay").css("display","none");jQuery(".branddisplay").css("display","block")}else{if(a=="categories"){jQuery(".categorydisplay").css("display","block");jQuery(".branddisplay").css("display","none")}}return false}var previous_rating;function ie_rating_rollover(b,a){target_element=document.getElementById(b);switch(a){case 1:previous_rating=target_element.style.background;target_element.style.background="url("+MTOC_URL+"/images/blue-star.gif)";break;default:if(target_element.style.background!="url("+MTOC_URL+"/images/gold-star.gif)"){target_element.style.background=previous_rating}break}}var apply_rating=function(a){outarr=a.split(",");for(i=1;i<=outarr[1];i++){id="star"+outarr[0]+"and"+i+"_link";document.getElementById(id).style.background="url("+MTOC_URL+"/images/gold-star.gif)"}for(i=5;i>outarr[1];i--){id="star"+outarr[0]+"and"+i+"_link";document.getElementById(id).style.background="#c4c4b8"}lnid[outarr[0]]=1;rating_id="rating_"+outarr[0]+"_text";if(document.getElementById(rating_id).innerHTML!="Your Rating:"){document.getElementById(rating_id).innerHTML="Your Rating:"}saved_id="saved_"+outarr[0]+"_text";document.getElementById(saved_id).style.display="inline";update_vote_count(outarr[0])};function hide_save_indicator(a){document.getElementById(a).style.display="none"}function rate_item(b,a){ajax.post("index.php",apply_rating,"ajax=true&rate_item=true&product_id="+b+"&rating="+a)}function update_vote_count(b){var a=function(c){outarr=c.split(",");vote_count=outarr[0];b=outarr[1];vote_count_id="vote_total_"+b;document.getElementById(vote_count_id).innerHTML=vote_count};ajax.post("index.php",a,"ajax=true&get_rating_count=true&product_id="+b)}function submit_change_country(){document.forms.change_country.submit()}function update_preview_url(a){image_height=document.getElementById("image_height").value;image_width=document.getElementById("image_width").value;if(((image_height>0)&&(image_height<=1024))&&((image_width>0)&&(image_width<=1024))){new_url="index.php?productid="+a+"&height="+image_height+"&width="+image_width+"";document.getElementById("preview_link").setAttribute("href",new_url)}else{new_url="index.php?productid="+a+"";document.getElementById("preview_link").setAttribute("href",new_url)}return false}function change_variation(product_id,variation_ids,special){value_ids="";special_prefix="";if(special==true){form_id="specials_"+product_id}else{form_id="product_"+product_id}for(var i in variation_ids){if(!isNaN(parseInt(i))){variation_name="variation["+variation_ids[i]+"]";value_ids+="&variation[]="+document.getElementById(form_id).elements[variation_name].value}}if(special==true){var return_price=function(results){eval(results);if(product_id!=null){target_id="special_product_price_"+product_id;buynow_id="BB_BuyButtonForm"+product_id;document.getElementById(target_id).firstChild.innerHTML=price;if(price.substring(27,price.indexOf("&"))!=""){document.getElementById(buynow_id).item_price_1.value=price.substring(27,price.indexOf("&"))}}}}else{var return_price=function(results){eval(results);if(product_id!=null){target_id="product_price_"+product_id;buynow_id="BB_BuyButtonForm"+product_id;document.getElementById(target_id).firstChild.innerHTML=price;if(price.substring(27,price.indexOf("&"))!=""){document.getElementById(form_id).item_price_1.value=price.substring(27,price.indexOf("&"))}}}}ajax.post("index.php",return_price,"ajax=true&get_updated_price=true&product_id="+product_id+value_ids)}function shopping_cart_collapser(){switch(jQuery("#sliding_cart").css("display")){case"none":jQuery("#sliding_cart").slideToggle("fast",function(){ajax.post("index.php",noresults,"ajax=true&set_slider=true&state=1");jQuery("#fancy_collapser").attr("src",(MTOC_URL+"/images/minus.png"))});break;default:jQuery("#sliding_cart").slideToggle("fast",function(){ajax.post("index.php",noresults,"ajax=true&set_slider=true&state=0");jQuery("#fancy_collapser").attr("src",(MTOC_URL+"/images/plus.png"))});break}return false}function show_details_box(b,a){state=document.getElementById(b).style.display;if(state!="block"){document.getElementById(b).style.display="block";document.getElementById(a).src=MTOC_URL+"/images/icon_window_collapse.gif"}else{document.getElementById(b).style.display="none";document.getElementById(a).src=MTOC_URL+"/images/icon_window_expand.gif"}return false}var register_results=function(a){jQuery("div#TB_ajaxContent").html(a);jQuery("div#checkout_login_box").css("border","1px solid #339933");jQuery("div#checkout_login_box").css("background-color","#e8fcea")};function submit_register_form(a){jQuery("img#register_loading_img").css("display","inline");ajax.post("index.php?ajax=true&action=register",register_results,ajax.serialize(a));return false}var fadeInSuggestion=function(b,a){$(b).fadeTo(300,1)};var fadeOutSuggestion=function(b,a){$(b).fadeTo(300,0)};function change_pics(a){location1=window.location.href;if(a==1){document.getElementById("out_view_type").innerHTML="<input type='hidden' id='view_type' name='view_type' value='default'>";document.getElementById("out_default_pic").innerHTML="<img id='default_pic' src='"+MTOC_URL+"/images/default-on.gif'>";document.getElementById("out_grid_pic").innerHTML="<img id='grid_pic' style='cursor:pointer;' onclick='change_pics(0)' src='"+MTOC_URL+"/images/grid-off.gif'>";if(location1.search(/view_type/)!=-1){$new_location=location1.replace("grid","default")}else{if(location1.search(/\?/)!=-1){$new_location=location1+"&view_type=default"}else{$new_location=location1+"?view_type=default"}}window.location=$new_location}else{document.getElementById("out_view_type").innerHTML="<input type='hidden' id='view_type' name='view_type' value='grid'>";document.getElementById("out_default_pic").innerHTML="<img id='default_pic'  style='cursor:pointer;' onclick='change_pics(1)' src='"+MTOC_URL+"/images/default-off.gif'>";document.getElementById("out_grid_pic").innerHTML="<img id='grid_pic' src='"+MTOC_URL+"/images/grid-on.gif'>";if(location1.search(/view_type/)!=-1){$new_location=location1.replace("default","grid")}else{if(location1.search(/\?/)!=-1){$new_location=location1+"&view_type=grid"}else{$new_location=location1+"?view_type=grid"}}window.location=$new_location}}function log_buynow(a){id=a.product_id.value;price=a.item_price_1.value;ajax.post("index.php",noresults,"ajax=true&buynow=true&product_id="+id+"price="+price)}function gotoexternallink(a){window.location=a}function manage_extras(product_id,extras_id,special){value_ids="";special_prefix="";extra_idss="";document.getElementById("extras_indicator"+product_id+extras_id).style.display="block";if(special==true){form_id="specials_"+product_id}else{form_id="product_"+product_id}jQuery(document).ready(function(){extra_ids=jQuery("input.extras_"+product_id+":checked")});jQuery.each(extra_ids,function(key,value){extra_idss+="&extra[]="+extra_ids[key].value});pm="stay";if(special==true){var return_price=function(results){eval(results);if(product_id!=null){target_id="special_product_price_"+product_id;buynow_id="BB_BuyButtonForm"+product_id;document.getElementById(target_id).firstChild.innerHTML=price;if(price.substring(27,price.indexOf("&"))!=""){document.getElementById(buynow_id).item_price_1.value=price.substring(27,price.indexOf("&"))}}document.getElementById("extras_indicator"+product_id+extras_id).style.display="none"}}else{var return_price=function(results){eval(results);if(product_id!=null){target_id="product_price_"+product_id;buynow_id="BB_BuyButtonForm"+product_id;document.getElementById(target_id).firstChild.innerHTML=price;if(price.substring(27,price.indexOf("&"))!=""){document.getElementById(form_id).item_price_1.value=price.substring(27,price.indexOf("&"))}}document.getElementById("extras_indicator"+product_id+extras_id).style.display="none"}}ajax.post("index.php",return_price,"ajax=true&get_updated_price=true&pm="+pm+"&product_id="+product_id+extra_idss)}function store_list(){address=document.getElementById("user_address").value;city=document.getElementById("user_city").value;if((address!="")&&(city!="")){document.getElementById("gloc_loading").style.display="block";ajax.post("index.php",return_store_list,"ajax=true&store_list=true&addr="+address+"&city="+city)}}var return_store_list=function(a){document.getElementById("gloc_storelist").innerHTML=a;document.getElementById("gloc_loading").style.display="none";return true};function autocomplete(a){if(!a){a=window.event}if(a.keyCode){keyPressed=a.keyCode}else{if(a.which){keyPressed=a.which}}str=document.getElementById("wpsc_search_autocomplete").value;if(str!=""){ajax.post("index.php",autocomplete_results,"wpsc_live_search=true&keyword="+str)}else{jQuery("#blind_down").slideUp(100)}}var autocomplete_results=function(a){document.getElementById("blind_down").innerHTML=a;if(document.getElementById("blind_down").style.display!="block"){jQuery("#blind_down").slideDown(200)}return true};function statusTextKeyPress(a){if(!a){a=window.event}if(a.keyCode){keyPressed=a.keyCode}else{if(a.which){keyPressed=a.which}}if(keyPressed==9){return false}if(keyPressed==13){newstatus=document.getElementById("status_change_text").value;ajax.post("index.php",submit_user_status,"ajax=true&submitstatus=true&status="+newstatus);return false}if(keyPressed==27){document.getElementById("edit_status_select").style.display="none";return false}return true}function switchmethod(a){total=document.getElementById("shopping_cart_total_price").value;ajax.post("index.php",usps_method_switch,"ajax=true&uspsswitch=true&key="+a+"&total="+total)}var usps_method_switch=function(a){document.getElementById("checkout_total").innerHTML=a};
