if(top!=self){top.location.replace(document.location);alert("For security reasons, framing is not allowed; click OK to remove the frames.")}$(function(){$.ajaxSetup({cache:false})});$.fn.extend({fadeOutAndRemove:function(a){return this.each(function(){var b=$(this);b.fadeOut("fast",function(){b.remove()})})}});function enableSubmitButton(a){setSubmitButtonDisabled(a,false)}function disableSubmitButton(a){setSubmitButtonDisabled(a,true)}function setSubmitButtonDisabled(b,a){$(b).find("input[type='submit']").attr("disabled",a?"disabled":"")}function setConfirmUnload(a,b){window.onbeforeunload=a?function(){if(b&&$.trim(b.val())){return a}}:null}function showAjaxError(a,c){var d=$('<div class="error-notification supernovabg"><h2>'+c+"</h2>(click on this box to dismiss)</div>");var b=function(){$(".error-notification").fadeOut("fast",function(){$(this).remove()})};d.click(function(e){b()});$(a).append(d);d.fadeIn("fast");setTimeout(b,1000*30)}function styleCode(){var a=false;$("pre code").parent().each(function(){if(!$(this).hasClass("prettyprint")){$(this).addClass("prettyprint");a=true}});if(a){prettyPrint()}}function appendLoader(a){$(a).append('<img class="ajax-loader" src="http://sstatic.net/so/img/ajax-loader.gif" title="loading..." alt="loading..." />')}function removeLoader(){$("img.ajax-loader").remove()}function savePreference(a,b,c){$.post("/users/save-preference",{fkey:preffkey,key:a,value:b},c)}var notify=function(){var d=false;var e=0;var c=-1;var g="m";var a=function(i){if(!d){$("#notify-container").append('<table id="notify-table" cellspacing="0" cellpadding="0" border="0"></table>');d=true}var h="<tr"+(i.messageTypeId?' id="notify-'+i.messageTypeId+'"':"");h+=' class="notify" style="display:none"><td class="notify">'+i.text;if(i.showProfile){var j=escape("/users/"+i.userId);h+=' See your <a href="/messages/mark-as-read?messagetypeid='+i.messageTypeId+"&returnurl="+j+'">profile</a>.'}h+='</td><td class="notify-close"><a title="dismiss this notification" onclick="notify.close(';h+=(i.messageTypeId?i.messageTypeId:"")+')">&times;</a></td></tr>';$("#notify-table").append(h)};var b=function(h){};var f=function(){var h=parseInt($.cookie(g));if(isNaN(h)){h=0}if(h<5){$(".module.newuser").show();b(++h)}};return{showFirstTime:function(){if(false){f()}else{$(".module.newuser").show();$("body").css("margin-top","2.5em");a({messageTypeId:c,text:'An item was added to your cart'});$(".notify").fadeIn("slow")}},showMessages:function(h){for(var j=0;j<h.length;j++){a(h[j])}$(".notify").fadeIn("slow");e=h.length},show:function(h){$("body").css("margin-top","2.5em");a({text:h});$(".notify").fadeIn("slow")},close:function(h){var j;var i=0;if(h&&h!=c){$.post("/messages/mark-as-read",{messagetypeid:h});j=$("#notify-"+h);if(e>1){i=parseInt($("body").css("margin-top").match(/\d+/));i=i-(i/e)}}else{if(h&&h==c){b()}j=$(".notify")}j.children("td").css("border-bottom","none").end().fadeOut("fast",function(){$("body").css("margin-top",i+"px");j.remove()})},closeFirstTime:function(){b();document.location="/faq"}}}();