if($.browser.msie){var browsers=navigator.userAgent.toLowerCase().match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/);var highestBrowser=0;for(var i=0;i<browsers.length;i++){browsers[i]=parseInt(browsers[i]);if(!isNaN(browsers[i])){highestBrowser=Math.max(highestBrowser,browsers[i])}}if(highestBrowser==6){$.browser.version="6.0";if($.cookie("ie_six_error")==null){var ie6error='<div id="upgradebrowser"><a href="#" id="ie6errorclose"></a><div>You are using Internet Explorer 6. Please note that some Wolfram|Alpha features require a more up-to-date browser, such as <a href="http://www.microsoft.com/windows/internet-explorer/default.aspx" target="_blank">Internet Explorer</a> 7+, <a href="http://www.mozilla.com/en-US/firefox/personal.html" target="_blank">Firefox</a> 3+, <a href="http://www.apple.com/safari/download/" target="_blank">Safari</a> 3+, <a href="http://www.opera.com/download/" target="_blank">Opera</a> 9+, etc.</div></div>';$("#calculate").after(ie6error);$("#ie6errorclose").click(function(A){A.preventDefault();$("#upgradebrowser").remove();$.cookie("ie_six_error","hide",{domain:"www.wolframalpha.com"})})}else{}}}function assumptionSubmit(){$("#spin").addClass("active");$("#warnings,.assuming,#results,#timeout,#datasources,#footer,#debug-wrapper,#sidebar").hide();$("#calculateAssum").unbind().submit();return false}function asynchronousSubpod(D,F,C,B,A){var G="pod_"+F;if(pulldownClicked){var E=$("span#substituteValue_"+F+"_"+clickedPulldownIndex).html();if(E){D+="&subselection="+encodeURIComponent(E)+"&subselectionindex="+clickedPulldownIndex}pulldownClicked=false}asynchronousPod(D+" #subpod_"+F+">*",G,C)}function getURLParam(A){var I="";var D=window.location.href;var F,E,C,J,B,H,G;if(D.indexOf("?")>-1){F=D.substr(D.indexOf("?"));E=F.toLowerCase();C=F.split("&");J=E.split("&");for(B=0;B<J.length;B++){if(J[B].indexOf(A+"=")>-1){H=C[B].split("=");if(H.length==2){I=H[1]}else{if(H.length>2){I=H[1];for(G=2;G<H.length;G++){I=I+"="+H[G]}}}break}}}return I}function recompute(){var B=window.location;var C=B.protocol+"//"+B.hostname+B.pathname;var D=getURLParam("i");var A=getURLParam("a");var E=getURLParam("f");if(D){C+="?i="+D}if(A){C+="&a="+A}if(E){C+="&f="+E}window.location=C}var searchPages={Google:"http://www.google.com/search?q=",Live:"http://search.live.com/results.aspx?q=",Yahoo:"http://search.yahoo.com/search?p="};var searchURL=searchPages.Google;var iValue=getURLParam("i");function goToEngine(A){switch(A){case"exact":window.open(searchURL+"%22"+iValue+"%22","otherSearch");break;case"standard":window.open(searchURL+iValue,"otherSearch");break;case"core":default:window.open(searchURL+"${searchterms}","otherSearch");break}}function EscapeP(B){var A=escape(B);return A.replace(/\+/g,"%2B")}function applyAssumption(A,B){document.getElementById("a"+A).value=unescape(B);return assumptionSubmit()}function applyAssumptionField(B,A,C){document.getElementById("f"+B).value=A+"_"+C;return(false)}function applyAssumptionPullDown(A){document.getElementById("a"+A).value=document.getElementById("pd"+A).value;return assumptionSubmit()}function getCookie(A){var F=document.cookie.split(";");var B="";var D="";var E="";var C=false;for(i=0;i<F.length;i++){B=F[i].split("=");D=B[0].replace(/^\s+|\s+$/g,"");if(D==A){C=true;if(B.length>1){E=unescape(B[1].replace(/^\s+|\s+$/g,""));E=E.replace(/^\"+|\"+$/g,"")}return E}B=null;D=""}if(!C){return null}}function toggleDebug(){var B=$("#debug-contents").get(0);var A=$("#debug-toggle").get(0);if(A.src.match(/debug1/)){B.style.display="block";A.src="/images/debug.gif"}else{B.style.display="none";A.src="/images/debug1.gif"}}function UTF8Encode(B){B=B.replace(/\r\n/g,"\n");var A="";for(var D=0;D<B.length;D++){var C=B.charCodeAt(D);if(C<128){A+=String.fromCharCode(C)}else{if((C>127)&&(C<2048)){A+=String.fromCharCode((C>>6)|192);A+=String.fromCharCode((C&63)|128)}else{A+=String.fromCharCode((C>>12)|224);A+=String.fromCharCode(((C>>6)&63)|128);A+=String.fromCharCode((C&63)|128)}}}return A}function progressBar(A){var C=$(A);var B=C.find(".progress");if(B.length!=1){B=$('<div class="progress"><img src="/images/reload.gif" height="100%" width="548px"/></div>');C.prepend(B)}B.css("width",0+"%");B.animate({width:"100%"},3000,function(){progressBar(this.parentNode)})}function fnSelect(B){if(document.selection){var A=document.body.createTextRange();A.moveToElementText(B);A.select()}else{if(window.getSelection){var A=document.createRange();A.selectNode(B);window.getSelection().addRange(A)}}}function fnDeSelect(){if(document.selection){document.selection.empty()}else{if(window.getSelection){window.getSelection().removeAllRanges()}}}$(function(){jQuery.italics=document.body.createTextRange?function(C,D){var B=document.body.createTextRange();B.moveToElementText(C);for(var A=0;B.findText(D);A++){B.pasteHTML("<i>"+B.text+"</i>");B.collapse(false)}}:function(E,C){var H,I,B,F,A,D;I=0;if(E.nodeType==3){H=E.data.toUpperCase().indexOf(C);if(H>=0){B=document.createElement("i");F=E.splitText(H);A=F.splitText(C.length);D=F.cloneNode(true);B.appendChild(D);F.parentNode.replaceChild(B,F);I=1}}else{if(E.nodeType==1&&E.childNodes&&!/(script|style)/i.test(E.tagName)){for(var G=0;G<E.childNodes.length;++G){G+=$.italics(E.childNodes[G],C)}}}return I}});jQuery.fn.removeItalics=function(){this.find("i").each(function(){with(this.parentNode){replaceChild(this.firstChild,this);normalize()}});return this};function appendToPopAnchor(A,C,B){$(A).show().appendTo("#popanchor").css("top",C+"px").css("left",B+"px")}function downloadPDF(D,A,B){loadCSS("popupCSS",popupCSS);var C=$("#downloadpdf").offset();$("#popanchor").append('<div id="downloadingpdf" style="top:'+(C.top-45)+"px;left:"+(C.left-90)+'px;"><img src="/images/loadingdots.gif" alt="loading..." /></div>');$("#downloadpdf, #downloadnb").attr("disabled","disabled");$.ajax({url:"/input/pdf.jsp?id="+D+"&"+B.substring(1),complete:function(G,E){if(G.status==200){$("#downloadingpdf").hide();var F="pdfGet.jsp?id="+$.trim(G.responseText)+"&i="+A;window.location=F}else{$("#downloadingpdf").hide()}$("#downloadpdf, #downloadnb").attr("disabled","")}});return false}function downloadNotebook(C,A,B){$("#downloadingnb").show();$("#downloadpdf, #downloadnb").attr("disabled","disabled");$.ajax({url:"/input/nb.jsp?id="+C+"&"+B.substring(1),complete:function(E,D){if(E.status==200){$("#downloadingnb").hide();window.location="nbGet.jsp?id="+$.trim(E.responseText)+"&i="+A}else{$("#downloadingnb").hide()}$("#downloadpdf, #downloadnb").attr("disabled","")}});return false}function loadCSS(C,A,B){$.get(A,function(D,E){$("head").append('<style id="'+C+'" type="text/css">'+D+"</style>");if(typeof B=="function"){B()}},"text")}String.prototype.trim=function(){return this.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};jQuery.jScrollPane={active:[]};jQuery.fn.jScrollPane=function(A){A=jQuery.extend({scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false},A);return this.each(function(){var K=jQuery(this);if(jQuery(this).parent().is(".jScrollPaneContainer")){var y=A.maintainPosition?K.offset({relativeTo:jQuery(this).parent()[0]}).top:0;var I=jQuery(this).parent();var Y=I.innerWidth();var z=I.outerHeight();var J=z;if(I.unmousewheel){I.unmousewheel()}jQuery(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown",I).remove();K.css({top:0})}else{var y=0;this.originalPadding=K.css("paddingTop")+" "+K.css("paddingRight")+" "+K.css("paddingBottom")+" "+K.css("paddingLeft");this.originalSidePaddingTotal=(parseInt(K.css("paddingLeft"))||0)+(parseInt(K.css("paddingRight"))||0);var Y=K.innerWidth();var z=K.innerHeight();var J=z;K.wrap(jQuery("<div></div>").attr({className:"jScrollPaneContainer"}).css({height:z+"px",width:Y+"px"}));jQuery(document).bind("emchange",function(AA,AB,p){K.jScrollPane(A)})}var k=this.originalSidePaddingTotal;var g={height:"auto",width:Y-A.scrollbarWidth-A.scrollbarMargin-k+"px"};if(A.scrollbarOnLeft){g.paddingLeft=A.scrollbarMargin+A.scrollbarWidth+"px"}else{g.paddingRight=A.scrollbarMargin+"px"}K.css(g);var h=K.outerHeight();var d=z/h;if(d<0.99){var E=K.parent();E.append(jQuery("<div></div>").attr({className:"jScrollPaneTrack"}).css({width:A.scrollbarWidth+"px"}).append(jQuery("<div></div>").attr({className:"jScrollPaneDrag"}).css({width:A.scrollbarWidth+"px"}).append(jQuery("<div></div>").attr({className:"jScrollPaneDragTop"}).css({width:A.scrollbarWidth+"px"}),jQuery("<div></div>").attr({className:"jScrollPaneDragBottom"}).css({width:A.scrollbarWidth+"px"}))));var v=jQuery(">.jScrollPaneTrack",E);var L=jQuery(">.jScrollPaneTrack .jScrollPaneDrag",E);if(A.showArrows){var b;var x;var O;var m;var e=function(){if(m>4||m%4==0){u(q+x*W)}m++};var H=function(p){jQuery("html").unbind("mouseup",H);b.removeClass("jScrollActiveArrowButton");clearInterval(O)};var U=function(){jQuery("html").bind("mouseup",H);b.addClass("jScrollActiveArrowButton");m=0;e();O=setInterval(e,100)};E.append(jQuery("<a></a>").attr({href:"javascript:;",className:"jScrollArrowUp"}).css({width:A.scrollbarWidth+"px"}).html("Scroll up").bind("mousedown",function(){b=jQuery(this);x=-1;U();this.blur();return false}),jQuery("<a></a>").attr({href:"javascript:;",className:"jScrollArrowDown"}).css({width:A.scrollbarWidth+"px"}).html("Scroll down").bind("mousedown",function(){b=jQuery(this);x=1;U();this.blur();return false}));var M=jQuery(">.jScrollArrowUp",E);var G=jQuery(">.jScrollArrowDown",E);if(A.arrowSize){J=z-A.arrowSize-A.arrowSize;v.css({height:J+"px",top:A.arrowSize+"px"})}else{var n=M.height();A.arrowSize=n;J=z-n-G.height();v.css({height:J+"px",top:n+"px"})}}var s=jQuery(this).css({position:"absolute",overflow:"visible"});var B;var T;var W;var q=0;var R=d*z/2;var V=function(AA,AC){var AB=AC=="X"?"Left":"Top";return AA["page"+AC]||(AA["client"+AC]+(document.documentElement["scroll"+AB]||document.body["scroll"+AB]))||0};var a=function(){return false};var r=function(){j();B=L.offset(false);B.top-=q;T=J-L[0].offsetHeight;W=2*A.wheelSpeed*T/h};var C=function(p){r();R=V(p,"Y")-q-B.top;jQuery("html").bind("mouseup",P).bind("mousemove",c);if(jQuery.browser.msie){jQuery("html").bind("dragstart",a).bind("selectstart",a)}return false};var P=function(){jQuery("html").unbind("mouseup",P).unbind("mousemove",c);R=d*z/2;if(jQuery.browser.msie){jQuery("html").unbind("dragstart",a).unbind("selectstart",a)}};var u=function(AA){AA=AA<0?0:(AA>T?T:AA);q=AA;L.css({top:AA+"px"});var AB=AA/T;s.css({top:((z-h)*AB)+"px"});K.trigger("scroll");if(A.showArrows){M[AA==0?"addClass":"removeClass"]("disabled");G[AA==T?"addClass":"removeClass"]("disabled")}};var c=function(p){u(V(p,"Y")-B.top-R)};var l=Math.max(Math.min(d*(z-A.arrowSize*2),A.dragMaxHeight),A.dragMinHeight);L.css({height:l+"px"}).bind("mousedown",C);var f;var N;var F;var o=function(){if(N>8||N%4==0){u((q-((q-F)/2)))}N++};var w=function(){clearInterval(f);jQuery("html").unbind("mouseup",w).unbind("mousemove",Z)};var Z=function(p){F=V(p,"Y")-B.top-R};var Q=function(p){r();Z(p);N=0;jQuery("html").bind("mouseup",w).bind("mousemove",Z);f=setInterval(o,100);o()};v.bind("mousedown",Q);if(E.mousewheel){E.mousewheel(function(AA,AC){r();j();var AB=q;u(q-AC*W);var p=AB!=q;return !p},false)}var D;var S;function X(){var p=(D-q)/A.animateStep;if(p>1||p<-1){u(q+p)}else{u(D);j()}}var j=function(){if(S){clearInterval(S);delete D}};var t=function(AB,p){if(typeof AB=="string"){$e=jQuery(AB,this);if(!$e.length){return }AB=$e.offset().top-K.offset().top}j();var AA=-AB/(z-h)*T;if(p||!A.animateTo){u(AA)}else{D=AA;S=setInterval(X,A.animateInterval)}};K[0].scrollTo=t;K[0].scrollBy=function(AA){var p=-parseInt(s.css("top"))||0;t(p+AA)};r();t(-y,true);jQuery.jScrollPane.active.push(K[0])}else{K.css({height:z+"px",width:Y-this.originalSidePaddingTotal+"px",padding:this.originalPadding})}})};jQuery(window).bind("unload",function(){var B=jQuery.jScrollPane.active;for(var A=0;A<B.length;A++){B[A].scrollTo=B[A].scrollBy=null}});(function(C){C.ui=C.ui||{};C.extend(C.ui,{plugin:{add:function(F,G,I){var H=C.ui[F].prototype;for(var E in I){H.plugins[E]=H.plugins[E]||[];H.plugins[E].push([G,I[E]])}},call:function(E,G,F){var I=E.plugins[G];if(!I){return }for(var H=0;H<I.length;H++){if(E.options[I[H][0]]){I[H][1].apply(E.element,F)}}}},cssCache:{},css:function(E){if(C.ui.cssCache[E]){return C.ui.cssCache[E]}var F=C('<div class="ui-resizable-gen">').addClass(E).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");C.ui.cssCache[E]=!!((!(/auto|default/).test(F.css("cursor"))||(/^[1-9]/).test(F.css("height"))||(/^[1-9]/).test(F.css("width"))||!(/none/).test(F.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(F.css("backgroundColor"))));try{C("body").get(0).removeChild(F.get(0))}catch(G){}return C.ui.cssCache[E]},disableSelection:function(E){E.unselectable="on";E.onselectstart=function(){return false};if(E.style){E.style.MozUserSelect="none"}},enableSelection:function(E){E.unselectable="off";E.onselectstart=function(){return true};if(E.style){E.style.MozUserSelect=""}},hasScroll:function(H,F){var E=/top/.test(F||"top")?"scrollTop":"scrollLeft",G=false;if(H[E]>0){return true}H[E]=1;G=H[E]>0?true:false;H[E]=0;return G}});var B=C.fn.remove;C.fn.remove=function(){C("*",this).add(this).trigger("remove");return B.apply(this,arguments)};function A(F,G,H){var E=C[F][G].getter||[];E=(typeof E=="string"?E.split(/,?\s+/):E);return(C.inArray(H,E)!=-1)}var D={init:function(){},destroy:function(){},getData:function(F,E){return this.options[E]},setData:function(G,E,F){this.options[E]=F},enable:function(){this.setData(null,"disabled",false)},disable:function(){this.setData(null,"disabled",true)}};C.widget=function(F,E){var G=F.split(".")[0];F=F.split(".")[1];C.fn[F]=function(K,L){var I=(typeof K=="string"),J=arguments;if(I&&A(G,F,K)){var H=C.data(this[0],F);return(H?H[K](L):undefined)}return this.each(function(){var M=C.data(this,F);if(!M){C.data(this,F,new C[G][F](this,K))}else{if(I){M[K].apply(M,C.makeArray(J).slice(1))}}})};C[G][F]=function(J,I){var H=this;this.options=C.extend({},C[G][F].defaults,I);this.element=C(J).bind("setData."+F,function(M,K,L){return H.setData(M,K,L)}).bind("getData."+F,function(L,K){return H.getData(L,K)}).bind("remove",function(){return H.destroy()});this.init()};C[G][F].prototype=C.extend({},D,E)};C.widget("ui.mouse",{init:function(){var E=this;this.element.bind("mousedown.mouse",function(){return E.click.apply(E,arguments)}).bind("mouseup.mouse",function(){(E.timer&&clearInterval(E.timer))}).bind("click.mouse",function(){if(E.initialized){E.initialized=false;return false}});if(C.browser.msie){this.unselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}},destroy:function(){this.element.unbind(".mouse").removeData("mouse");(C.browser.msie&&this.element.attr("unselectable",this.unselectable))},trigger:function(){return this.click.apply(this,arguments)},click:function(G){if(G.which!=1||C.inArray(G.target.nodeName.toLowerCase(),this.options.dragPrevention||[])!=-1||(this.options.condition&&!this.options.condition.apply(this.options.executor||this,[G,this.element]))){return true}var F=this;this.initialized=false;var E=function(){F._MP={left:G.pageX,top:G.pageY};C(document).bind("mouseup.mouse",function(){return F.stop.apply(F,arguments)});C(document).bind("mousemove.mouse",function(){return F.drag.apply(F,arguments)});if(!F.initalized&&Math.abs(F._MP.left-G.pageX)>=F.options.distance||Math.abs(F._MP.top-G.pageY)>=F.options.distance){(F.options.start&&F.options.start.call(F.options.executor||F,G,F.element));(F.options.drag&&F.options.drag.call(F.options.executor||F,G,this.element));F.initialized=true}};if(this.options.delay){if(this.timer){clearInterval(this.timer)}this.timer=setTimeout(E,this.options.delay)}else{E()}return false},stop:function(E){if(!this.initialized){return C(document).unbind("mouseup.mouse").unbind("mousemove.mouse")}(this.options.stop&&this.options.stop.call(this.options.executor||this,E,this.element));C(document).unbind("mouseup.mouse").unbind("mousemove.mouse");return false},drag:function(E){var F=this.options;if(C.browser.msie&&!E.button){return this.stop.call(this,E)}if(!this.initialized&&(Math.abs(this._MP.left-E.pageX)>=F.distance||Math.abs(this._MP.top-E.pageY)>=F.distance)){(F.start&&F.start.call(F.executor||this,E,this.element));this.initialized=true}else{if(!this.initialized){return false}}(F.drag&&F.drag.call(this.options.executor||this,E,this.element));return false}})})(jQuery);(function(A){A.widget("ui.draggable",{init:function(){var B=this.options;this.element.mouse({executor:this,delay:B.delay,distance:B.distance,dragPrevention:B.cancel,start:this.start,stop:this.stop,drag:this.drag,condition:function(D){var C=!this.options.handle||!A(this.options.handle,this.element).length?true:false;if(!C){A(this.options.handle,this.element).each(function(){if(this==D.target){C=true}})}return !(D.target.className.indexOf("ui-resizable-handle")!=-1||this.options.disabled)&&C}});if(B.helper=="original"&&!(/(relative|absolute|fixed)/).test(this.element.css("position"))){this.element.css("position","relative")}},start:function(E){var G=this.options;if(A.ui.ddmanager){A.ui.ddmanager.current=this}this.helper=A.isFunction(G.helper)?A(G.helper.apply(this.element[0],[E])):(G.helper=="clone"?this.element.clone():this.element);if(!this.helper.parents("body").length){this.helper.appendTo((G.appendTo=="parent"?this.element[0].parentNode:G.appendTo))}if(!this.helper.css("position")||this.helper.css("position")=="static"){this.helper.css("position","absolute")}this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};this.cssPosition=this.helper.css("position");this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:E.pageX-this.offset.left,top:E.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();this.offset.parent={top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};var D=this.element.position();this.offset.relative=this.cssPosition=="relative"?{top:D.top-(parseInt(this.helper.css("top"),10)||0)+this.offsetParent[0].scrollTop,left:D.left-(parseInt(this.helper.css("left"),10)||0)+this.offsetParent[0].scrollLeft}:{top:0,left:0};this.originalPosition=this.generatePosition(E);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(G.cursorAt){if(G.cursorAt.left!=undefined){this.offset.click.left=G.cursorAt.left}if(G.cursorAt.right!=undefined){this.offset.click.left=this.helperProportions.width-G.cursorAt.right}if(G.cursorAt.top!=undefined){this.offset.click.top=G.cursorAt.top}if(G.cursorAt.bottom!=undefined){this.offset.click.top=this.helperProportions.height-G.cursorAt.bottom}}if(G.containment){if(G.containment=="parent"){G.containment=this.helper[0].parentNode}if(G.containment=="document"){this.containment=[0,0,A(document).width(),(A(document).height()||document.body.parentNode.scrollHeight)]}if(!(/^(document|window|parent)$/).test(G.containment)){var C=A(G.containment)[0];var F=A(G.containment).offset();this.containment=[F.left+(parseInt(A(C).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left,F.top+(parseInt(A(C).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top,F.left+Math.max(C.scrollWidth,C.offsetWidth)-(parseInt(A(C).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),F.top+Math.max(C.scrollHeight,C.offsetHeight)-(parseInt(A(C).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}}this.propagate("start",E);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(A.ui.ddmanager&&!G.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,E)}return false},convertPositionTo:function(C,D){if(!D){D=this.position}var B=C=="absolute"?1:-1;return{top:(D.top+this.offset.relative.top*B+this.offset.parent.top*B-(this.cssPosition=="fixed"?0:this.offsetParent[0].scrollTop)*B+this.margins.top*B),left:(D.left+this.offset.relative.left*B+this.offset.parent.left*B-(this.cssPosition=="fixed"?0:this.offsetParent[0].scrollLeft)*B+this.margins.left*B)}},generatePosition:function(E){var F=this.options;var B={top:(E.pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top),left:(E.pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?0:this.offsetParent[0].scrollLeft))};if(!this.originalPosition){return B}if(this.containment){if(B.left<this.containment[0]){B.left=this.containment[0]}if(B.top<this.containment[1]){B.top=this.containment[1]}if(B.left>this.containment[2]){B.left=this.containment[2]}if(B.top>this.containment[3]){B.top=this.containment[3]}}if(F.grid){var D=this.originalPosition.top+Math.round((B.top-this.originalPosition.top)/F.grid[1])*F.grid[1];B.top=this.containment?(!(D<this.containment[1]||D>this.containment[3])?D:(!(D<this.containment[1])?D-F.grid[1]:D+F.grid[1])):D;var C=this.originalPosition.left+Math.round((B.left-this.originalPosition.left)/F.grid[0])*F.grid[0];B.left=this.containment?(!(C<this.containment[0]||C>this.containment[2])?C:(!(C<this.containment[0])?C-F.grid[0]:C+F.grid[0])):C}return B},drag:function(B){this.position=this.generatePosition(B);this.positionAbs=this.convertPositionTo("absolute");this.position=this.propagate("drag",B)||this.position;if(!this.options.axis||this.options.axis=="x"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis=="y"){this.helper[0].style.top=this.position.top+"px"}if(A.ui.ddmanager){A.ui.ddmanager.drag(this,B)}return false},stop:function(C){if(A.ui.ddmanager&&!this.options.dropBehaviour){A.ui.ddmanager.drop(this,C)}if(this.options.revert){var B=this;A(this.helper).animate(this.originalPosition,parseInt(this.options.revert,10)||500,function(){B.propagate("stop",C);B.clear()})}else{this.propagate("stop",C);this.clear()}return false},clear:function(){if(this.options.helper!="original"&&!this.cancelHelperRemoval){this.helper.remove()}if(A.ui.ddmanager){A.ui.ddmanager.current=null}this.helper=null;this.cancelHelperRemoval=false},plugins:{},ui:function(B){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,options:this.options}},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.ui()]);return this.element.triggerHandler(C=="drag"?C:"drag"+C,[B,this.ui()],this.options[C])},destroy:function(){if(!this.element.data("draggable")){return }this.element.removeData("draggable").unbind(".draggable").mouse("destroy")},enable:function(){this.options.disabled=false},disable:function(){this.options.disabled=true}});A.ui.draggable.defaults={helper:"original",appendTo:"parent",cancel:["input","textarea","button","select","option"],distance:1,delay:0};A.ui.plugin.add("draggable","cursor",{start:function(D,C){var B=A("body");if(B.css("cursor")){C.options._cursor=B.css("cursor")}B.css("cursor",C.options.cursor)},stop:function(C,B){if(B.options._cursor){A("body").css("cursor",B.options._cursor)}}});A.ui.plugin.add("draggable","zIndex",{start:function(D,C){var B=A(C.helper);if(B.css("zIndex")){C.options._zIndex=B.css("zIndex")}B.css("zIndex",C.options.zIndex)},stop:function(C,B){if(B.options._zIndex){A(B.helper).css("zIndex",B.options._zIndex)}}});A.ui.plugin.add("draggable","opacity",{start:function(D,C){var B=A(C.helper);if(B.css("opacity")){C.options._opacity=B.css("opacity")}B.css("opacity",C.options.opacity)},stop:function(C,B){if(B.options._opacity){A(B.helper).css("opacity",B.options._opacity)}}});A.ui.plugin.add("draggable","iframeFix",{start:function(C,B){A(B.options.iframeFix===true?"iframe":B.options.iframeFix).each(function(){A('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(A(this).offset()).appendTo("body")})},stop:function(C,B){A("div.DragDropIframeFix").each(function(){this.parentNode.removeChild(this)})}});A.ui.plugin.add("draggable","scroll",{start:function(D,C){var E=C.options;var B=A(this).data("draggable");E.scrollSensitivity=E.scrollSensitivity||20;E.scrollSpeed=E.scrollSpeed||20;B.overflowY=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-y"))){return F}F=F.parent()}while(F[0].parentNode);return A(document)}(this);B.overflowX=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-x"))){return F}F=F.parent()}while(F[0].parentNode);return A(document)}(this);if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){B.overflowYOffset=B.overflowY.offset()}if(B.overflowX[0]!=document&&B.overflowX[0].tagName!="HTML"){B.overflowXOffset=B.overflowX.offset()}},drag:function(D,C){var E=C.options;var B=A(this).data("draggable");if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){if((B.overflowYOffset.top+B.overflowY[0].offsetHeight)-D.pageY<E.scrollSensitivity){B.overflowY[0].scrollTop=B.overflowY[0].scrollTop+E.scrollSpeed}if(D.pageY-B.overflowYOffset.top<E.scrollSensitivity){B.overflowY[0].scrollTop=B.overflowY[0].scrollTop-E.scrollSpeed}}else{if(D.pageY-A(document).scrollTop()<E.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()-E.scrollSpeed)}if(A(window).height()-(D.pageY-A(document).scrollTop())<E.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()+E.scrollSpeed)}}if(B.overflowX[0]!=document&&B.overflowX[0].tagName!="HTML"){if((B.overflowXOffset.left+B.overflowX[0].offsetWidth)-D.pageX<E.scrollSensitivity){B.overflowX[0].scrollLeft=B.overflowX[0].scrollLeft+E.scrollSpeed}if(D.pageX-B.overflowXOffset.left<E.scrollSensitivity){B.overflowX[0].scrollLeft=B.overflowX[0].scrollLeft-E.scrollSpeed}}else{if(D.pageX-A(document).scrollLeft()<E.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()-E.scrollSpeed)}if(A(window).width()-(D.pageX-A(document).scrollLeft())<E.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()+E.scrollSpeed)}}}});A.ui.plugin.add("draggable","snap",{start:function(D,C){var B=A(this).data("draggable");B.snapElements=[];A(C.options.snap===true?".ui-draggable":C.options.snap).each(function(){var F=A(this);var E=F.offset();if(this!=B.element[0]){B.snapElements.push({item:this,width:F.outerWidth(),height:F.outerHeight(),top:E.top,left:E.left})}})},drag:function(J,N){var I=A(this).data("draggable");var L=N.options.snapTolerance||20;var D=N.absolutePosition.left,C=D+I.helperProportions.width,P=N.absolutePosition.top,O=P+I.helperProportions.height;for(var H=I.snapElements.length-1;H>=0;H--){var E=I.snapElements[H].left,B=E+I.snapElements[H].width,R=I.snapElements[H].top,M=R+I.snapElements[H].height;if(!((E-L<D&&D<B+L&&R-L<P&&P<M+L)||(E-L<D&&D<B+L&&R-L<O&&O<M+L)||(E-L<C&&C<B+L&&R-L<P&&P<M+L)||(E-L<C&&C<B+L&&R-L<O&&O<M+L))){continue}if(N.options.snapMode!="inner"){var K=Math.abs(R-O)<=20;var Q=Math.abs(M-P)<=20;var G=Math.abs(E-C)<=20;var F=Math.abs(B-D)<=20;if(K){N.position.top=I.convertPositionTo("relative",{top:R-I.helperProportions.height,left:0}).top}if(Q){N.position.top=I.convertPositionTo("relative",{top:M,left:0}).top}if(G){N.position.left=I.convertPositionTo("relative",{top:0,left:E-I.helperProportions.width}).left}if(F){N.position.left=I.convertPositionTo("relative",{top:0,left:B}).left}}if(N.options.snapMode!="outer"){var K=Math.abs(R-P)<=20;var Q=Math.abs(M-O)<=20;var G=Math.abs(E-D)<=20;var F=Math.abs(B-C)<=20;if(K){N.position.top=I.convertPositionTo("relative",{top:R,left:0}).top}if(Q){N.position.top=I.convertPositionTo("relative",{top:M-I.helperProportions.height,left:0}).top}if(G){N.position.left=I.convertPositionTo("relative",{top:0,left:E}).left}if(F){N.position.left=I.convertPositionTo("relative",{top:0,left:B-I.helperProportions.width}).left}}}}});A.ui.plugin.add("draggable","connectToSortable",{start:function(D,C){var B=A(this).data("draggable");B.sortable=A.data(A(C.options.connectToSortable)[0],"sortable");B.sortableOffset=B.sortable.element.offset();B.sortableOuterWidth=B.sortable.element.outerWidth();B.sortableOuterHeight=B.sortable.element.outerHeight();if(B.sortable.options.revert){B.sortable.shouldRevert=true}},stop:function(D,C){var E=A(this).data("draggable");var B=E.sortable;if(B.isOver){B.isOver=0;E.cancelHelperRemoval=true;B.cancelHelperRemoval=false;if(B.shouldRevert){B.options.revert=true}B.stop(D);B.options.helper="original"}},drag:function(F,E){var G=A(this).data("draggable");var D=G.sortable;G.position.absolute=E.absolutePosition;if(D.intersectsWith.call(G,{left:G.sortableOffset.left,top:G.sortableOffset.top,width:G.sortableOuterWidth,height:G.sortableOuterHeight})){if(!D.isOver){D.isOver=1;var B=D.options.placeholderElement?A(D.options.placeholderElement,A(D.options.items,D.element)).innerHeight():A(D.options.items,D.element).innerHeight();var C=D.options.placeholderElement?A(D.options.placeholderElement,A(D.options.items,D.element)).innerWidth():A(D.options.items,D.element).innerWidth();D.currentItem=A(this).clone().appendTo(D.element);D.options.helper=function(){return E.helper[0]};D.start(F);D.clickOffset.top=G.offset.click.top;D.clickOffset.left=G.offset.click.left;D.offset.left-=E.absolutePosition.left-D.position.absolute.left;D.offset.top-=E.absolutePosition.top-D.position.absolute.top;D.helperProportions={width:C,height:B};E.helper.animate({height:B,width:C},500);G.propagate("toSortable",F)}if(D.currentItem){D.drag(F)}}else{if(D.isOver){D.isOver=0;D.cancelHelperRemoval=true;D.options.revert=false;D.stop(F);D.options.helper="original";D.currentItem.remove();D.placeholder.remove();E.helper.animate({height:this.innerHeight(),width:this.innerWidth()},500);G.propagate("fromSortable",F)}}}});A.ui.plugin.add("draggable","stack",{start:function(D,B){var C=A.makeArray(A(B.options.stack.group)).sort(function(F,E){return(parseInt(A(F).css("zIndex"))||B.options.stack.min)-(parseInt(A(E).css("zIndex"))||B.options.stack.min)});A(C).each(function(E){this.style.zIndex=B.options.stack.min+E});this[0].style.zIndex=B.options.stack.min+C.length}})})(jQuery);$(document).ready(function(){if(($.browser.msie&parseInt($.browser.version)<8)||($.browser.mozilla&$.browser.version.indexOf("1.9.0")!=-1)){$("#calculate").append('<b class="bot"></b>').prepend('<b class="top"></b>');$("body").removeClass("dc")}if(navigator.userAgent.indexOf("iPhone")!=-1){if($.cookie("iphone_app")==null){$.cookie("iphone_app",null,{expires:365,path:"/",domain:".wolframalpha.com"});$("#popanchor").append('<div id="iphoneOverlay"></div><div id="iphoneAppAdContainer"><a id="closeIphoneAd" href=""></a><a id="downloadIphoneApp" href="http://www.itunes.com/apps/wolframalpha"></a></div>');$("#iphoneOverlay").css("height",$(document).height()).css("width",$(document).width());$("#closeIphoneAd").click(function(A){A.preventDefault();$.cookie("iphone_app","hide",{expires:7,path:"/",domain:".wolframalpha.com"});$("#iphoneOverlay").remove();$("#iphoneAppAdContainer").remove()})}}$("#equal").replaceWith('<div id="equal" title="compute"></div>');if($(".future").length>0){$(".assuming").show()}if($.browser.safari){$("#more ul").css("display","inline");$("#footer ul li").css("padding-right","21px").css("padding-left","21px");$("#footer ul li:last-child").css("padding-right","0");$("#footer ul li:first-child").css("padding-left","0");$("#sidebar").css("margin-top","20px").css("top","82px")}else{if($.browser.opera){$("#sidebar").css("margin-top","20px")}else{if($.browser.msie){$(".note").mouseover(function(){$("#results .bot").css("top","").css("top","auto")});$(".note").mouseout(function(){$("#results .bot").css("top","").css("top","auto")})}}}$(".pod img").each(function(){addScrollBars(this,$(this))});if($.browser.opera){$(".pulldown-menu").css("top","15px")}});function showpopup(B){var A=document.getElementById(B);if(A){A.style.display="block"}}function hidepopup(B){var A=document.getElementById(B);if(A){A.style.display="none"}}function getPopupTextHeight(B){B=B.replace(/\n/g,"<br />");B=B.replace(/\s\s/g,"&nbsp; ");if($("#ieHeightCorrection").length>0){$("#ieHeightCorrection").html(B)}else{$("#popanchor").before('<div id="ieHeightCorrection" class="popup-text">'+B+"</div>")}$("#ieHeightCorrection").css("text-align","left").css("left","-10000px");var A=$("#ieHeightCorrection").height();$("#ieHeightCorrection").remove();if($.browser.msie&&$.browser.version=="6.0"){A=A*1.2+2}return A+"px"}function showpopnew(D){if(!document.getElementById("popupCSS")){loadCSS("popupCSS",popupCSS,function(){showpopnew(D)});return }var B="mov"+D+"popup_dyn";if($("#"+B).length!=0){$("#"+B).css("display","block");return }if(typeof (jsonArray.popups[D])=="undefined"){return }var F=jsonArray.popups[D].stringified.replace(/^\s\s*/,"").replace(/\s\s*$/,"");var J=jsonArray.popups[D].mInput.replace(/^\s\s*/,"").replace(/\s\s*$/,"");var C=jsonArray.popups[D].mOutput.replace(/^\s\s*/,"").replace(/\s\s*$/,"");var N=jsonArray.popups[D].popLinks;var L=false;if(N){for(var E in N){L=true;break}}if((F=="- Graphics -")||(!F&&!J&&!C&&!L)){F="No copyable plaintext"}var H=true;var M="";if(L){M='    <div class="popup-links pdrag">';for(var A in N){if(N[A]!=""){if(H){H=false}else{M+=" | "}M+='<a href="/input?i='+encodeURIComponent(N[A])+'">'+N[A]+"</a>"}}M+="</div>"}var G="";G+='<div class="popup" id="'+B+'">';G+='  <div class="popup-top pdrag">&nbsp;</div>';G+='    <div class="popup-mid pdrag">';G+='      <div class="popup-label pdrag">'+(F?"Copyable plaintext:":"");G+='        <b class="close">x</b>';G+="     </div>";if(F){if($.browser.msie){var I=getPopupTextHeight(F);G+='    <textarea style="height:'+I+';">'+F+"</textarea>"}else{G+="    <pre>"+F+"</pre>"}if(J||C){G+="    <hr />"}}if(J){G+='    <div class="popup-label pdrag"><i class="pdrag">Mathematica</i> plaintext input:</div>';if($.browser.msie){var I=getPopupTextHeight(J);G+='    <textarea style="height:'+I+';">'+J+"</textarea>"}else{G+="    <pre>"+J+"</pre>"}}if(C){G+='    <div class="popup-label pdrag"><i class="pdrag">Mathematica</i> plaintext output:</div>';if($.browser.msie){var I=getPopupTextHeight(C);G+='    <textarea style="height:'+I+';">'+C+"</textarea>"}else{G+="    <pre>"+C+"</pre>"}}G+=M;G+='  <a href="#" class="downloadas" target="_blank" id="download_'+D+'" title="Generate image of output"><img src="/images/ajaxloader.gif"/></a>';G+="  </div>";G+='  <div class="popup-bottom pdrag">&nbsp;</div>';G+="</div>";$("#popanchor").append($(G));if($.browser.msie&&$.browser.version=="6.0"){$("#"+B+" .popup-label .close").replaceWith('<a href="#" class="close">x</a>')}$(".popup").draggable({handle:".pdrag"});$(".popup textarea").focus(function(){$(this).blur()});var K=$("#scannerresult_"+D.slice(2)).offset();if($("#scannerresult_"+D.slice(2)).parent().hasClass("jScrollPaneContainer")){K=$("#scannerresult_"+D.slice(2)).parent().offset()}$("#"+B).css("top",K.top);$("#"+B).css("left",K.left);$("#"+B+" textarea").each(function(){$(this).get(0).spellcheck=false});downloadAs(D,false)}function showmathpop(D){if(!document.getElementById("popupCSS")){loadCSS("popupCSS",popupCSS,function(){showmathpop(D)});return }var A="math_form_popup";var E="#scannerresult_0100_1";if(D==""){return }if($("#"+A).length!=0){$("#"+A).css("display","block");return }var C="";C+='<div class="popup" id="'+A+'">';C+='  <div class="popup-top pdrag">&nbsp;</div>';C+='    <div class="popup-mid pdrag">';C+='      <div class="popup-label pdrag"><i class="pdrag">Mathematica&nbsp;</i>plaintext:';C+='        <b class="close">x</b>';C+="      </div>";if($.browser.msie){var B=getPopupTextHeight(D);C+='    <textarea style="height:'+B+';">'+D+"</textarea>"}else{C+="    <pre>"+D+"</pre>"}C+="  </div>";C+='  <div class="popup-bottom pdrag">&nbsp;</div>';C+="</div>";$("#popanchor").append($(C));if($.browser.msie&&$.browser.version=="6.0"){$("#"+A+" .popup-label .close").replaceWith('<a href="#" class="close">x</a>')}$(".popup").draggable({handle:".pdrag"});$(".popup-text").onclick="";$(".popup textarea").focus(function(){$(this).blur()});var F=$(E).offset();$("#"+A).css("top",F.top);$("#"+A).css("left",F.left);$("#"+A+" textarea").each(function(){$(this).get(0).spellcheck=false})}function dataSources(A){if($("#sources h3").length>0){$("#sources").show();return }if(!document.getElementById("scrollBarCSS")){loadCSS("scrollBarCSS",scrollBarCSS)}if(!document.getElementById("popupCSS")){loadCSS("popupCSS",popupCSS)}if(!document.getElementById("dataSourcesCSS")){loadCSS("dataSourcesCSS",dataSourcesCSS,function(){dataSources()});A.preventDefault();return false}$("#sources a[href$=SourceInformation.html]").each(function(C){var B=$(this).attr("href").substring($(this).attr("href").indexOf("/note/")+6,$(this).attr("href").length-22);var D="/sources/"+B+"SourceInformationNotes.html";$(this).parent().load(D,function(){var F=$("#computed").offset();if($("#sources").is(":not(:visible)")){var E=F.top-380>20?F.top-380:20;$("#sources").css({top:E+"px",right:F.left+"px"}).show(20,function(){$("#air").click(function(G){if($("#alphaInfoRequest").length!=0){$("#alphaInfoRequest .popup").show()}else{G.preventDefault();$("<div></div>").load("/input/alphaInfoRequest.jsp #alphaInfoRequest",function(){$("#alphaInfoRequest .popup").css({}).show().draggable();$("#dInput").val(decodeURIComponent(escapedInput));F=$(G.target).offset();$("#alphaInfoRequest").css("top",F.top-120);$("#alphaInfoRequest").css("left",F.left);$("#airSend").click(function(){sendAir()})}).appendTo("#popanchor")}});$("#sources .content a").not("#air").attr("rel","external");if($("#sources h3").length<=2){$("#sources h3:not(.open)").addClass("open")}else{$("#sources h3:not(.open)").addClass("closed")}$("#sources h3").unbind().click(function(G){if($(G.target).is(".open")){$(G.target).removeClass("open").addClass("closed")}else{$(G.target).removeClass("closed").addClass("open")}$("#sources").css("zoom","1").css("zoom","");$("#sources .content").jScrollPane({showArrows:true,scrollbarWidth:11,scrollbarMargin:0,dragMaxHeight:60});$("#sources").draggable()});$("#sources .popup-close").click(function(G){G.preventDefault();$(this).parent().hide()});$("#sources .content").jScrollPane({showArrows:true,scrollbarWidth:11,scrollbarMargin:0,dragMaxHeight:60});$("#sources").draggable()})}})})}function showunits(D,B){if(!document.getElementById("popupCSS")){loadCSS("popupCSS",popupCSS,function(){showunits(D,B)});return }var A=D+"units_dyn";$("div.units.pdrag").each(function(F){var G=this.id;$("#units-"+D).parents().map(function(){if((this.id).indexOf("pod_")>=0&&(this.id).indexOf("subpod")==-1){if(this.id==jQuery.data($("#"+G).get(0),"parentID")){$("#"+G).remove()}}})});var E=$("#units-"+D).offset();if($("#"+A).length!=0){$("#"+A).css({top:E.top,left:E.left,display:"block"});return }var C="";C+='<div id="'+A+'" class="units pdrag">';C+='  <div class="units-top pdrag">&nbsp;</div>';C+='  <div class="units-mid pdrag">';C+='    <div class="units-label pdrag">';C+='      <a class="units-close" href="javascript:hidepopup(\''+A+"');\">x</a>";C+="    </div>";C+='    <img src="'+B+'"/>';C+="  </div>";C+='  <div class="units-bottom pdrag">&nbsp;</div>';C+="</div>";$("#popanchor").append($(C));$(".units").draggable({handle:".pdrag"});$("#"+A).css("top",E.top);$("#"+A).css("left",E.left);$("#units-"+D).parents().map(function(){if((this.id).indexOf("pod_")>=0&&(this.id).indexOf("subpod")==-1){jQuery.data($("#"+A).get(0),"parentID",this.id)}})}var timeoutfade;function podtimeout(C,D){if(!document.getElementById("popupCSS")){loadCSS("popupCSS",popupCSS,function(){podtimeout(C,D)});return }var A=C.substring(4)+"_podtimeout_dyn";$("#"+C+".pod > h1 div.progress").remove();$(".related-content").removeClass("show");if($("#"+A).length!=0){$("#"+A).css("display","block")}else{var B="";B+='<div id="'+A+'" class="timeout-pop-container">';B+='<em class="left-timeout-pop">&nbsp;</em>';if(D==403){B+='<em class="timeout-pop"><span>Computation timed out.</span></em>'}else{B+='<em class="timeout-pop"><span>No more results available.</span></em>'}B+='<em class="right-timeout-pop">&nbsp;</em>';B+="</div>";$("#popanchor").append($(B));var E=$("#"+C).offset();$("#"+A).css("top",E.top+17).css("right",E.left-35).css("float","left")}if(timeoutfade!=null){$("#"+A).stop();clearTimeout(timeoutfade)}timeoutfade=setTimeout(function(){if($.browser.msie){$("#"+A).hide()}else{$("#"+A).fadeOut("slow")}},4000)}function feedbackconfirm(){loadCSS("popupCSS",popupCSS);var A="feedback-confirm";if($("#"+A).length!=0){$("#"+A).css("display","block");return }var B="";B+='<div id="'+A+'" class="email-confirm">';B+='  <div class="content">';B+="    <p>Please include a valid email address if you want to make a response possible.</p>";B+="    <div>";B+='      <input id="ecInput" type="text" />';B+='      <input id="ecSend" type="image" src="/images/calculate-feedbackopen-send.gif"/>';B+="      <br/>";B+="      <span>We will keep your email address private.</span>";B+="    </div>";B+='    <p><a class="inv" id="ecBlankSend">Send without a return email address &raquo;</a></p>';B+="  </div>";B+="</div>";$("#popanchor").append($(B));var C=$("#fbsb").offset();$("#"+A).css("top",C.top-95);$("#"+A).css("left",C.left-210)}function hideclass(A){document.getElementById(A).className="hide"}function showclass(A){document.getElementById(A).className="show"}function splattips(){var A="tip";if($("#"+A).length!=0){$("#"+A).css("display","block");return }var B="";B+='<div id="'+A+'">';B+='<div class="top">&nbsp;</div>';B+='<img id="tip-close" src="/images/gray-close.png" alt="Close" title="Close"/>';B+='<div class="content">';B+='<div class="title">Important things to know about Wolfram<span style="color:#949494;">|</span>Alpha:</div>';B+="<ul>";B+="<li>Wolfram|Alpha answers specific questions <br/>rather than explaining general topics";B+='<p>Enter "2 cups of sugar", not "nutrition information"</p></li>';B+="<li>You can only get answers about objective facts";B+='<p>Try "highest mountain", not "most beautiful painting"</p></li>';B+="<li>Only what is known is known to Wolfram|Alpha";B+='<p>Ask "how many men in Mauritania", not "how many monsters in Loch Ness"</p></li>';B+="<li>Only public information is available";B+='<p>Request "GDP of France", not "home phone of Michael Jordan"</p></li>';B+="</ul>";B+='<div class="title">If Wolfram<span style="color:#949494;">|</span>Alpha is still not sure what to do, try the following:</div>';B+="<ul>";B+="<li>Don't use long complete sentences; just enter the minimum number of words needed to communicate</li>";B+="<li>Try different words or notations </li>";B+="<li>Use whole words instead of abbreviations </li>";B+="<li>Check your spelling </li>";B+="</ul>";B+='<div class="links">';B+='<p>&raquo;<a href="http://community.wolframalpha.com">Ask the Wolfram<span style="color:#949494;">|</span>Alpha Community for Help</a></p><br/>';B+='<p>&raquo;<a href="/examples/">Examples by Topic</a></p>';B+='<p>&raquo;<a href="/screencast/introducingwolframalpha.html">Quick Video Overview</a></p>';B+="</div>";B+="</div>";B+='<div class="bot">&nbsp;</div>';B+="</div>";$("#popanchor").append($(B));var C=$("#tips").offset();$("#"+A).draggable({handle:".pdrag"});$("#"+A).css("top",C.top-127);$("#"+A).css("left",C.left-240);$("#tip-close").mouseover(function(D){$("#tip-close").attr("src","/images/gray-close-red.png")}).mouseout(function(D){$("#tip-close").attr("src","/images/gray-close.png")}).click(function(D){$("#tip").hide()})}function sendAir(){var C=true;var B="required";var A="enter valid email address";if($("#refEmail").val().indexOf("@")==-1){$("#refEmail").blur().css("color","red").val(A).one("focus",function(){$(this).val("").css("color","black")});C=false}if($("#refName").val()==""||$("#refName").val()==B){$("#refName").blur().css("color","red").val(B).one("focus",function(){$(this).val("").css("color","black")});C=false}if($("#Organization").val()==""||$("#Organization").val()==B){$("#Organization").blur().css("color","red").val(B).one("focus",function(){$(this).val("").css("color","black")});C=false}if($("#Occupation").val()==""||$("#Occupation").val()==B){$("#Occupation").blur().css("color","red").val(B).one("focus",function(){$(this).val("").css("color","black")});C=false}if($("#air_source").val()==""||$("#air_source").val()==B){$("#air_source").blur().css("color","red").val(B).one("focus",function(){$(this).val("").css("color","black")});C=false}if($("#air_purpose").val()==""||$("#air_purpose").val()==B){$("#air_purpose").blur().css("color","red").val(B).one("focus",function(){$(this).val("").css("color","black")});C=false}if($("#air_deadline").val()==""||$("#air_deadline").val()==B){$("#air_deadline").blur().css("color","red").val(B).one("focus",function(){$(this).val("").css("color","black")});C=false}if(C){var D=$("#alphaInfoRequest").serializeArray();$("#alphaInfoRequest .popup div.content").load("/input/sendDataSourceForm.jsp #dthanks",D,function(){$("#alphaInfoRequest .popup .content").css("height","135px");$("#alphaInfoRequest .popup").css("height","175px");setTimeout('$("#alphaInfoRequest .popup").css("display","none")',10000)})}}function downloadAs(B,E){var I=B.replace("i_","pod_");I=I.substring(0,I.lastIndexOf("_"));var C=$("#"+I+" h1 span").html();var D=$("#"+B).attr("src");var G="";var A="";$("#"+I+" .sub .annotpod div").each(function(K){if($(this).hasClass("note")){A+=$(this).find("img").attr("src")}else{A+=$(this).find("a").text()}A+=","});if(A.indexOf(",")>0){A=A.substring(0,A.lastIndexOf(","))}else{A=" "}A="{"+A+"}";var H=$("#"+I+" .sub").length;var J="";if(H>1){$("#"+I+" .sub").each(function(M){var K=$(this).attr("id");var N=$("#"+K+" h1 span").text();if(N==""){N=" "}var L="";$("#"+K+" h1 ul li").each(function(P){var O=$(this).find("a[id^='substitute'], #mathsource, .selected").text();if(O.length>0){L+=O+" | "}});L=L.substring(0,L.lastIndexOf(" | "));J+="{"+N+","+L+",,"+$("#"+K+" .output img").attr("src")+"}"})}$("#"+I+" > h1 ul li").each(function(L){var K=$(this).find("a[id^='substitute'], #mathsource, .selected").text();if(K.length>0){G+=K+" | "}});G=G.substring(0,G.lastIndexOf(" | "));var F=$("#"+I+" .sub:first .output img").attr("src");F="MSPSaveAs"+F.substring(F.indexOf("/MSP/MSP")+8,F.indexOf("?MSPStoreType"))+".gif";$.ajax({url:"/Calculate/download.jsp",data:{podtitle:C,podtopright:G,podbottom:A,subpodcount:H,imgloc:D,rawsubpods:J,fileID:F},success:function(K){$("#download_"+B+" img").attr("src","/images/image-icon.gif");$("#download_"+B).attr("href","/input/MSP/"+F)},error:function(K,M,L){}})}$(document).ready(function(){$("#results .pod img").load(function(A){$(this).parents("div.loading").removeClass("loading")}).each(function(){if(this.complete){$(this).parents("div.loading").removeClass("loading")}});$("#sources").ajaxStop(function(){if($("#sources h3").length<=2){$("#sources h3:not(.open)").addClass("open")}else{$("#sources h3:not(.open)").addClass("closed")}$("#sources").draggable()});if(!($.browser.msie&&$.browser.version=="6.0")){$("#more").hover(function(){$("#more ul").addClass("hover")},function(){$("#more ul").removeClass("hover")});$("#menu").hover(function(){$("#menu").addClass("hover")},function(){$("#menu").removeClass("hover")})}$(".related-content, #hwday").mouseover(function(){$("#sidebar").css("padding-bottom","250px")});$("body").click(function(H){if($(H.target).is("img")){showpopnew(H.target.id)}if($(H.target).is('a[rel="external"]')||$(H.target).parent("a").is('a[rel="external"]')){if($(H.target).is("a")){window.open($(H.target).attr("href"))}else{window.open($(H.target).parent("a").attr("href"))}return false}if($(H.target).is("#source")||$(H.target).is("#toSources")||$(H.target).is("#financialMore")){H.preventDefault();dataSources(H)}if($(H.target).is("#ecSend")){if($("#ecInput").val()!=""){$("#Email").val($("#ecInput").val());$("#feedback").submit()}}if($(H.target).is("#ecBlankSend")){$("#Email").val("Anonymous");$("#feedback").submit()}if($(H.target).is(".popup .close")){H.preventDefault();$(H.target).parents(".popup").hide()}if($(H.target).is(".pulldown-menu li a")){var E=$(H.target).closest(".sub,.pod").attr("id");var D=E.indexOf("sub")==-1?E.substring(4):E.substring(7);var C=$(H.target).closest(".pod").find("a").index(H.target);changeSelection(C);H.preventDefault();var B=$(H.target).attr("href");if(B.indexOf("input/")!=-1){B=B.substring(B.indexOf("input/")+6)}asynchronousPod(B+"&state=1",E,escapedInput,0,0)}if($(H.target).is("h1>ul>li>a")&H.target.id!="mathsource"){if($(H.target).text()=="Play notes"|$(H.target).text()=="Play chord"|$(H.target).text()=="Play sound"){H.preventDefault();playSound($(H.target).attr("href"));return }var E=$(H.target).closest(".sub,.pod").attr("id");var D=E.indexOf("sub")==-1?E.substring(4):E.substring(7);var C=$(H.target).parents(".pod").find("a").index(H.target);var B=$(H.target).attr("href");if(B.indexOf("input/")!=-1){B=B.substring(B.indexOf("input/")+6)}H.preventDefault();asynchronousPod(B+"&state=1",E,escapedInput,0,0)}if(podselector=="1"){if($(H.target).is("#selectwarnings")){parent.changeWarnings($("#selectwarnings").attr("checked"))}if($(H.target).is("#selectassumptions")){parent.changeAssumptions($("#selectassumptions").attr("checked"))}if($(H.target).is("input[id^=selectpod_]")){var E=$(H.target).parents(".pod").attr("id");var G=E.substring(E.length-4);var F=$(H.target).attr("checked");var A=$("#pod_"+G+":not(iframe #pod_"+G+")");if(type=="include"){if(F){parent.includePod(G,A.data("podIdentifier"),A.data("podShortIdentifier"),A.data("buttonStates"),A.data("scanner"))}else{parent.removeIncludedPod(A.data("podIdentifier"))}}else{if(type=="exclude"){if(F){parent.excludePod(G,A.data("podIdentifier"),A.data("podShortIdentifier"))}else{parent.removeExcludedPod(A.data("podIdentifier"),A.data("buttonStates"),A.data("scanner"))}}}}}});if(podselector=="1"){$("#selectassumptions").attr("checked",parent.showAssumptions);$("#selectwarnings").attr("checked",parent.showWarnings)}$("html").keyup(function(A){if(A.which==27){$(".popup:visible").hide()}});$("#tips").click(function(){splattips()});$("#relatedlinks .related-content").mouseover(function(A){if($(this).children(".mouseover-tracer").length<=0){$(this).prepend('<img class="mouseover-tracer" src="/mouseover.txt?link='+$(this).attr("name")+"&type=rel&url="+$(this).find(".more-link").attr("href")+'"/>')}});$("#ads .related-content").mouseover(function(A){if($(this).children(".mouseover-tracer").length<=0){$(this).prepend('<img class="mouseover-tracer" src="/mouseover.txt?link='+$(this).attr("name")+"&type=ads&url="+$(this).find(".more-link").attr("href")+'"/>')}});$("#calculate").click(function(A){if($(A.target).is("#i")){$("[id^='equal']").css("left","-10000px");$("#input > #equal").css("left","auto")}});$("#calculate").submit(function(A){if($("#i").val().replace(/\s*/g,"")==""){A.preventDefault();window.location="/";return }$("#spin").addClass("active");$("#warnings,.assuming,.popup,#results,#timeout,#sources,#footer,#debug-wrapper,#sidebar,#splat,#ex-main-content,#related").hide()}).keypress(function(A){if(A.which==13){$("#calculate").submit()}});$("#calculate").prepend('<div id="inputArrow" style="display: none;" alt="Input Arrow" title="Input Arrow"></div><div id="howToCompute" style="display: none;" alt="How to Compute" title="How to Compute" ></div>');$("div#equal").click(function(){$("#calculate").submit()});$("#calculateAssum").submit(function(){assumptionSubmit()});$("#calculateAssum input").filter("[name^='f']").focus(function(A){$("#equal"+this.name.substring(1)).css("left","auto");$("[id^='equal']").filter("[id!='equal"+this.name.substring(1)+"']").css("left","-10000px");$("#calculateAssum .warn").html("")}).keyup(function(A){$("#"+this.name).val(this.alt+"_"+this.value);if(A.which==13){$("#calculateAssum").submit()}});$("#calculateAssum input").filter("[id='equal']").focus(function(){$(this).show()});$("[id^='relExA']").click(function(A){$("#i").val($("#relExInput"+$(this).attr("id").substring(6)).val());$("#calculate").submit()});$("[id^='relExInput']").keypress(function(A){if(A.which==13){$("#i").val(this.value);$("#calculate").submit()}});$("#feedback").bind("focus keyup click",function(A){if($(A.target).is("#tmpMessage,#tmpSend,#giveus")){var B=this.value;if(!document.getElementById("feedbackCSS")){loadCSS("feedbackCSS",feedbackCSS)}if(!document.getElementById("popupCSS")){loadCSS("popupCSS",popupCSS)}$("#feedback").load("/input/feedback.jsp",function(){$("#feedback").addClass("open");$("#feedback-textarea").val(B?B:"").focus();$("#spin").removeClass("active")})}});$("#feedback").submit(function(B){B.preventDefault();reqFeed="required";if(($("#feedback-textarea").val()==""||$("#feedback-textarea").val()==reqFeed)&&$("#i").get(0).defaultValue==""){$("#feedback-textarea").blur().css("color","red").val(reqFeed).one("focus",function(){$(this).val("").css("color","black")})}else{if($("#Email").val()==""){feedbackconfirm()}else{if($("#Remember").is(":checked")){$.cookie("WolframAlphaName",$("#Name").val(),{expires:90,domain:"www.wolframalpha.com"});$.cookie("WolframAlphaEmail",$("#Email").val(),{expires:90,domain:"www.wolframalpha.com"});$.cookie("WolframAlphaOccupation",$("#Occupation").val(),{expires:90,domain:"www.wolframalpha.com"});$.cookie("WolframAlphaOrganization",$("#Organization").val(),{expires:90,domain:"www.wolframalpha.com"});$.cookie("WolframAlphaCountry",$("#Country").val(),{expires:90,domain:"www.wolframalpha.com"})}$("#feedback hr.top,#feedback hr.bot, #feedback table, #feedback-confirm").css("display","none");$("#feedback").append('<div style="height:150px;">&nbsp;</div>');var A=$("#feedback").serializeArray();$("#feedback").load("/input/sendmessage.jsp #thanks",A,function(){$("#thanks .close").click(function(){$(this).parent().remove()});$("#thanks .close").mouseover(function(){$(this).attr("src","/images/thanks-close-red.png")}).mouseout(function(){$(this).attr("src","/images/thanks-close.png")});$("#feedback").append("<fieldset></fieldset>");$("#feedback fieldset").load("/input/footer.jsp fieldset *",{i:"i"})}).removeClass("open");return true}}});$("#ftEmail,div#ftSend").click(function(A){$("#splat").addClass("open");$("#ftYourInput").text($("#i").get(0).defaultValue);if($.browser.msie){$("span#ftInput").parent().append('<input id="ftSend" type="submit"/>')}else{$("span#ftInput").parent().append('<input id="ftSend" type="image"/>')}$("div#ftSend").css("display","none")});$("#ftForm").submit(function(B){B.preventDefault();if($("#ftEmail").val().indexOf("@")==-1){$("#ftEmail").blur().css("color","red").val("enter valid email address").one("focus",function(){$(this).val("").css("color","black")})}else{var A=$("#ftForm").serializeArray();$("#popanchor").load("/input/futureTopicMessage.jsp #thanks",A,function(){$("#thanks").appendTo("#splat").css("display","block");$("#thanks .close").click(function(){$(this).parent().remove()});$("#thanks .close").mouseover(function(){$(this).attr("src","/images/thanks-close-red.png")}).mouseout(function(){$(this).attr("src","/images/thanks-close.png")})});$("#splat").removeClass("open").addClass("closed");return true}});$("#downloadpdf").click(function(A){A.preventDefault();downloadPDF(downloadKey+"&s=20",inputEsc,window.location.search);return false});$("#downloadnb, #download_m").click(function(B){if(!document.getElementById("popupCSS")){loadCSS("popupCSS",popupCSS)}if(!document.getElementById("downloadnbpopup")){var A=$("#downloadnb").offset();$("#popanchor").append('<div id="downloadnbpopup" style="top:'+(A.top-100)+"px; left:"+(A.left-200)+'px; display: none;"><div class="top"><a href="#" class="popup-close"></a></div><div class="mid"><div class="content"><h1><b>Note:</b> To view and interact with this live notebook you need <i>Mathematica</i> 7+ or the free <i>Mathematica Player</i></h1><br/><span>Please make a selection:</span><input type="radio" name="dlnbpop" id="dlnbpop2" value="yes" />&nbsp;<label for="dlnbpop2">I already have <i>Mathematica Player</i> or <i>Mathematica</i> 7+</label><br /><input type="radio" name="dlnbpop" id="dlnbpop1" value="no" checked="checked" />&nbsp;<label for="dlnbpop1">Download or upgrade to <i>Mathematica Player 7</i></label><br /><div class="button" title="continue"></div></div></div><div class="bot"></div></div><div id="downloadingnb" style="top:'+(A.top-45)+"px; left:"+(A.left-90)+'px; display: none;"><img src="/images/loadingdots.gif"  alt="loading..."/></div>');$("#downloadnbpopup a.popup-close").click(function(C){$("#downloadnbpopup").hide();return false});$("#downloadnbpopup div.button").click(function(C){$("#downloadnbpopup").hide();if($("input:radio[name=dlnbpop]:checked").val()=="yes"){downloadNotebook(downloadKey+"&s=20",inputEsc,window.location.search);$.cookie("has_mathematica","yes",{expires:365,domain:".wolframalpha.com"})}else{window.location="http://www.wolfram.com/products/player"}return false})}if($.cookie("has_mathematica")==null){$("#downloadnbpopup").show()}else{downloadNotebook(downloadKey+"&s=20",inputEsc,window.location.search);$.cookie("has_mathematica","yes",{expires:365,domain:".wolframalpha.com"})}return false});$(".pulldown, .pulldown-menu").mouseover(function(){$(this).find(".pulldown-menu").removeClass("hide");$("#results").css("z-index","200");$("#sidebar").css("z-index","199")});$(".pulldown, .pulldown-menu").mouseout(function(){$(this).find(".pulldown-menu").addClass("hide")});$("#debug-toggle").click(function(){toggleDebug()});$("#moreDebug").click(function(A){A.preventDefault();window.location.href=window.location.href+"&debug=1"})});function setInputTextField(A,D){var E=location.search.substring(1);var C=getURLParam(A);C=C.replace(/\+/g," ");try{if(C==""){document.title="Wolfram|Alpha"}else{document.title=decodeURIComponent(C)+" - Wolfram|Alpha"}if(D){D.value=decodeURIComponent(C)}}catch(B){document.title="Wolfram|Alpha"}return C}var removeArrow;var arrow;function sidebarInit(){if($.browser.msie&&$.browser.version=="6.0"){$("#relatedlinks .related-content, #ads .related-content").hover(function(){$("#sidebar").css("z-index","203");$(this).find(".article-container").removeClass("hide")},function(){$(this).find(".article-container").addClass("hide");$("#sidebar").css("z-index","200")})}else{$("#relatedlinks .related-content, #ads .related-content").hover(function(){$("#sidebar").css("z-index","203");$("#sidebar .related-content").removeClass("show");var C=$(this).attr("id");if((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i))){$("#"+C).addClass("show")}setTimeout(function(){$("#"+C).addClass("show");$(".timeout-pop-container").hide()},250)},function(){$("#sidebar").css("z-index","200");$(this).removeClass("show")})}$("#calculateAssum, #results, #sidebar, #splatWeb").mouseover(function(){$("#calculateAssum").css("z-index","199");$("#results").css("z-index","199");$("#sidebar").css("z-index","199");$("#splatWeb").css("z-index","199");$(this).css("z-index","300")});if($.browser.msie){$("#inputArrow").attr("src","/images/newtoalpha-inputarrow-ie.gif");if($.browser.version=="6.0"){$("#howToCompute").attr("src","/images/ie6-howtocompute.gif")}}$("div[id^=relatedLink]").click(function(E){if(!$(E.target).is("a[rel='external']")){var C=$(this).attr("id");C=C.substring(C.indexOf("relatedLink")+11,C.length);var D=$("#siteLink"+C).attr("href");window.open(D,"")}});$("div[id^=base-ad]").click(function(D){var C=$(this).find(".adLinkTo").attr("href");window.open(C,"")});$("#searchicon, #searchEngineMenu").hover(function(){$("#searchicon").addClass("hover");$("#searchEngineMenu").removeClass("hide")},function(){$("#searchicon").removeClass("hover");$("#searchEngineMenu").addClass("hide")});$("#doSearch").hover(function(){$("#searchicon").addClass("hover")},function(){$("#searchicon").removeClass("hover")});var B="";try{B=decodeURIComponent(escapedInput)}catch(A){B=escapedInput}$("#q").val(B);$("#searchicon").attr("alt","Search the web for: "+B);$("#searchicon").attr("title","Search the web for: "+B);$("#doSearch").text(B);$("#doSearch").attr("title","Search the web for: "+B);$("#c").val(B);$("#ftYourInput").text(B);$("#ftInput").append(B);$("#sendfeedback").click(function(){$("#tmpMessage").focus()});$("#askcommunity").click(function(){$("#askForm").submit()});$("#searchEngineMenu li").click(function(){$("#searchEngineMenu li.on").removeClass("on");$(this).addClass("on");var C=$(this).text();if(C==null){C="Google"}switch(jQuery.trim(C)){case"Bing":$("#webSearch").attr("action","http://www.bing.com/search");break;case"Yahoo":$("#webSearch").attr("action","http://search.yahoo.com/search");break;case"Google":$("#webSearch").attr("action","http://www.google.com/search");break;default:$("#webSearch").attr("action","http://www.google.com/search");break}});$("#doSearch").mouseover(function(){$("#searchicon").attr("src","/images/searchicon-red.gif")});$("#doSearch").mouseout(function(){$("#searchicon").attr("src","/images/searchicon.gif")});$("#doSearch").click(function(){url="click.jsp?type=search&url="+encodeURIComponent($("#webSearch").attr("action")+"?q="+escapedInput);window.open(url,"");return false});if($.browser.safari){$("#sidebar").css("margin-top","47px")}formatSidebarExcerpts(false);formatSidebarPopupExcerpts(false);formatWebSearchInput(false);$("#relatedlinks img").each(function(){var E=$(this).attr("id");var D=$(this).attr("src");var C=new Image();C.onerror=function(F){$("#"+E+", #"+E+" + .sidebar-image-frame").addClass("hide")};C.src="http://"+window.location.hostname+D});if($.cookie("new_to_alpha")==null){loadNewToAlpha()}else{$.cookie("new_to_alpha","hide",{expires:365,path:"/",domain:".wolframalpha.com"});$("#newToAlphaContainer").remove();$("#sidebar").css("left","auto")}$("#new-to").click(function(C){$.cookie("new_to_alpha",null);$("#popanchor").append('<img src="/sidebar.txt?type=add" style="display:none;"/>');loadNewToAlpha()})}function loadNewToAlpha(){if(!document.getElementById("newbieCSS")){loadCSS("newbieCSS",newbieCSS,function(){$("#newbie").show()})}$.cookie("new_to_alpha",null,{expires:365,path:"/",domain:".wolframalpha.com"});if($("#newToAlphaContainer").length==0){$("#sidebar").prepend('<div id="newToAlphaContainer"></div>')}var A=function(B){$("#newToAlphaContainer").html(B);if(document.getElementById("newbieCSS")){$("#newbie").show()}$("#newbie #try a:not(#moreThingsToTry)").click(function(){$("#i").val($(this).parents("li").find("kbd").html()).focus();$("#howToCompute").css("display","block");$("#inputArrow").css("display","block");$("#popanchor").append('<img src="/sidebar.txt?type='+$(this).parents("li").find("kbd").attr("id")+'" style="display:none;"/>');if(arrow!=null){$("#inputArrow").stop();clearTimeout(arrow)}removeArrow=function(){$("#inputArrow").fadeOut("slow")};arrow=setTimeout(removeArrow,3000);return false});$("#closeNewToAlpha").hover(function(){$("#closePopup").removeClass("hide")},function(){$("#closePopup").addClass("hide")});$("#moreThingsToTry").toggle(function(){$("#try li").removeClass("hide");$(this).html("less &raquo;");$("#popanchor").append('<img src="/sidebar.txt?type=more" style="display:none;"/>');if($.browser.msie&&($.browser.version=="6.0"||$.browser.version=="7.0")){$("#newtoalpha .bot").css("top","0").css("top","auto")}},function(){$("#try li").slice(5).addClass("hide");$(this).html("more &raquo;");$("#popanchor").append('<img src="/sidebar.txt?type=less" style="display:none;"/>');if($.browser.msie&&($.browser.version=="6.0"||$.browser.version=="7.0")){$("#newtoalpha .bot").css("top","0").css("top","auto")}});$("#closeNewToAlpha").click(function(){$("#newToAlphaContainer").remove();$("#relatedlinks").css("top","").css("top","auto");$("#searchtheweb").css("top","").css("top","auto");$("#ads").css("top","").css("top","auto");$.cookie("new_to_alpha","hide",{expires:365,path:"/",domain:".wolframalpha.com"});$("#popanchor").append('<img src="/sidebar.txt?type=remove" style="display:none;"/>')});$("#relatedlinks").css("top","").css("top","auto");$("#searchtheweb").css("top","").css("top","auto");$("#ads").css("top","").css("top","auto");$("#sidebar").css("left","auto")};$.get("newbie.jsp",{},A,"html")}function formatWebSearchInput(A){var B="webSearchContent";var C=B.length;$("div[id^="+B+"]").each(function(){var F=$(this).attr("id");F=F.substring(F.indexOf(B)+C,F.length);var E=new Number($(this).height());var J=27;if(A){$("#testmessages").append("Test by Eric:<br />height="+E+"; maxheight="+J+";<br />")}var H=$("#doSearch").html();var G=$("#doSearch").html();if(G.length>50){G=G.substring(0,50)}if(E>J){var D="";G+="&nbsp;...";var I=0;while(E>J){I++;D+="height &gt; maxHeight<br />";G=G.substring(0,G.length-10);G+="&nbsp;...";$("#doSearch").html(G);E=new Number($(this).height());D+="height="+E+"<br />"}if(A){$("#testmessages").append(D);$("#testmessages").append("count="+I+"<br />")}}else{}$("#doSearch").html(G)})}function formatSidebarPopupExcerpts(A){$("div[id^=relatedLink]").mouseover(function(){var C=$(this).attr("id");C=C.substring(11,C.length);var B=$(this).attr("id");$(this).find("p[id^=sidebarPopupContent]:not(.trimmed)").each(function(){$(this).css("left","-10000px");var E=new Number($(this).height());var I=140;if(A){$("#testmessages").append("Test by Eric:<br />height="+E+"; maxheight="+I+";<br />")}var G=$(this).html();var F=$(this).html();if(F.length>400){F=F.substring(0,400)}if(E>I){var D="";var H=0;while(E>I){H++;D+="height &gt; maxHeight<br />";F=F.substring(0,F.length-5);$(this).html(F);E=new Number($(this).height());D+="height="+E+"<br />"}if(A){$("#testmessages").append(D);$("#testmessages").append("count="+H+"<br />")}F=F.substring(0,F.length-10);F=F.substring(0,F.lastIndexOf(" "))}else{}F=F.replace(/Mathematica/g,"<i>Mathematica</i>");F=encodeURIComponent(F);F=F.replace(/%E2%80%A2/g,'<span class="newparagraph">%E2%80%A2</span>');$(this).html(decodeURIComponent(F));$("#moreLink"+C).appendTo("#"+$(this).attr("id")).css("display","inline");$("#"+B+" .popbot").css("top","0").css("top","auto");$(this).css("left","auto").addClass("trimmed")})})}function formatSidebarExcerpts(A){var C="sidebarContent";var B=C.length;$("p[id^="+C+"]").each(function(){var F=$(this).attr("id");F=F.substring(F.indexOf(C)+B,F.length);$("#relatedLink"+F+".collapse").removeClass("hide");var E=new Number($(this).height());var J=42;if(A){$("#testmessages").append("Test by Eric:<br />height="+E+"; maxheight="+J+";<br />")}var H=$(this).html();var G=$(this).html();if(G.length>150){G=G.substring(0,150)}if(E>J){var D="";var I=0;while(E>J){I++;D+="height &gt; maxHeight<br />";G=G.substring(0,G.length-5);$(this).html(G);E=new Number($(this).height());D+="height="+E+"<br />"}if(A){$("#testmessages").append(D);$("#testmessages").append("count="+I+"<br />")}G=G.substring(0,G.length-5);G=G.substring(0,G.lastIndexOf(" "));G+="&nbsp;..."}else{}G=G.replace(/Mathematica/g,"<i>Mathematica</i>");G=encodeURIComponent(G);G=G.replace(/%E2%80%A2/g,'<span class="newparagraph">%E2%80%A2</span>');$(this).html(decodeURIComponent(G));$("#relatedLink"+F+".collapse").addClass("hide")})}$("#expand-sidebar").click(function(){$("div[id^=relatedLink].collapse").removeClass("hide");$("#expand-sidebar").addClass("hide");$("#collapse-sidebar").removeClass("hide");if($.browser.msie&&$.browser.version=="7.0"){$("#relatedlinks .bot").css("top","0");$("#relatedlinks .bot").css("top","auto")}});$("#collapse-sidebar").click(function(){$("div[id^=relatedLink].collapse").addClass("hide");$("#expand-sidebar").removeClass("hide");$("#collapse-sidebar").addClass("hide");if($.browser.msie&&$.browser.version=="7.0"){$("#relatedlinks .bot").css("top","0");$("#relatedlinks .bot").css("top","auto")}});$("#compair").click(function(){window.open("http://www.wolframalpha.com/input/?i="+escapedInput)});function relatedLinkClick(A){window.open(A,"")}$("#sidebar .screenshot").each(function(C){var B=$(this).attr("src");var A=B.substring(B.lastIndexOf("/")+1);A=encodeURIComponent(A);B=B.substring(0,B.lastIndexOf("/")+1);$(this).attr("src",B+A)});