Date.prototype.getPrintableDate=function(){var a=this.getMonth()+1;if(a<10){a="0"+a}var e=this.getDate();if(e<10){e="0"+e}var c=this.getHours();if(c<10){c="0"+c}var b=this.getMinutes();if(b<10){b="0"+b}return this.getFullYear()+" "+a+" "+e+" kl: "+c+"."+b};$(function(){if($("#print-fetch").size()>0){$("#print-timestamp").text(new Date().getPrintableDate());var c=location.search;if(c.length<1){return}c=c.substr(1).split("&");var e={};for(var b=0,f=c.length;b<f;b++){var d=c[b].split("=");e[d[0]]=decodeURIComponent(d[1])}if(e.src){$("#src").attr("href",e.src).text(e.src)}if(e.lastmod){date=new Date(e.lastmod);if(date.toString()!="Invalid Date"){$("#timestamp").before(["<h3>Senast uppdaterad</h3>","<p><strong>"+date.getPrintableDate()+"</strong></p>"].join(""))}}var a={pre:[],post:[]};if(e.preincludes){a.pre=e.preincludes.split(",")}if(e.postincludes){a.post=e.postincludes.split(",")}if(e.id){window.opener.$("input:checked").addClass("print_checked");if(e.id!="product-layer"){$("#print-fetch").html(window.opener.$("#"+e.id).outerHTML())}else{$("#print-fetch").html(window.opener.$("div[id="+e.id+"]").filter(".printTarget").eq(0).outerHTML())}if(a.pre.length>0){for(var b=(a.pre.length-1);b>=0;b--){if($("#"+a.pre[b]).size()<1){$("#print-fetch").prepend(window.opener.$("#"+a.pre[b]).outerHTML())}}}if(a.post.length>0){for(var b=0,f=a.post.length;b<f;b++){if($("#"+a.post[b]).size()<1){$("#print-fetch").append(window.opener.$("#"+a.post[b]).outerHTML())}}}$("#print-fetch input.print_checked").each(function(){this.checked=true});$("div.cart table.agreement div.right h3 a, div.price h3 a, table#shopcart tfoot h3 a").attr("rel","");if($("div.agree_box a[rel=popup]").size()>0){$("div.agree_box a[rel=popup]").prev("label").get(0).innerHTML+=" "+$("div.agree_box a[rel=popup]").text()}$("div.puff032 h3 a[rel=popup], div.datatable table.type002 td.tdcol1 a[rel=popup]").attr("rel","");$("div.btncontainer, div.product_details div.btnbuyholder, div.product_details ul.inline_toolbox a.tip").not($("div.product_details div.btncontainer")).remove();$(".printRemove, p.print, a.print, div.puff005, a[class*=button], a[rel=popup], div.puff031, .puffchild, div.puff011, div.moreinfo, div.directions_box, .gmnoprint, div.puff033 input[type=submit], div.cart div.receipt_row div.qa, div#search-apotek, div#hide-search-apotek, div#show-search-apotek").remove();$("a[href=#]").not($("div.tabs a[href=#], div.puff032 h3 a, div.price h3 a, table#shopcart tfoot h3 a")).remove();$("div.expandable").prev("p").find("a.expand,a.collapse").parent("p").remove();$("ul,li").each(function(){if($.trim(this.innerHTML)==""&&$(this).children().size()<1){$(this).remove()}});$("li:empty").remove();$("ul:empty").remove();$("div.navigation, div.toolbar").each(function(){if($(this).is(":empty")||$(this).children(":visible").size()<1){$(this).remove()}});$("table.type002 tr, .puff029 .midexpand, div.puff032 div.tabload div[class^=tab], div.puff032 div.midexpand, div.shop .cart_note, .init_hidden, div.expandable").show();$("div.puff032 div.tabs, div.puff032 .inactivate, div.puff032 ajax-tooltip, div.puff032 .ajax-tooltip, div.puff032 .print, div.puff032 .org").hide();$("a.expand").removeClass("expand").addClass("collapse");$("#product-layer").css("top",0).find("div.pointer").remove();$("a.ajax-tooltip").removeClass("ajax-tooltip").unbind();$("div.cart_contents, div.qa ul li div.answer").show();$("div.puff032 h3 a, div.price h3 a").attr("class","");$("#map").insertBefore($(".col_half_left")).css("margin-bottom","2em");if($.browser.msie&&$.browser.version<7){$("div.row_separate, div.row_separate div.addressrow").css("zoom",1)}$("h1").each(function(){$(this).text($(this).find("span").text())});if($.browser.msie){$("option[_selected]").each(function(){this.parentNode.selectedIndex=this.index})}$("#print-fetch a").css("cursor","auto").attr("href","#").attr("rel","").click(function(){return false});$("select").each(function(){$(this).replaceWith($(this.options[this.selectedIndex]).text());this.disabled=true});setTimeout("window.print()",1000)}}});
