(function(){var t="http://ajax.googleapis.com/ajax/services/search/web?v=1.0&callback={callback}&rsz=large&q={query}",r="http://api.stackoverflow.com/1.0/questions/{id}?key={key}&jsonp={callback}",o="http://api.stackoverflow.com/1.0/questions/?key={key}&tagged={tagged}&jsonp={callback}",u="http://api.stackoverflow.com/1.0/search/?key={key}&intitle={intitle}&nottagged={nottagged}&tagged={tagged}&jsonp={callback}",k="http://api.stackoverflow.com/1.0/questions/unanswered/?key={key}&tagged={tagged}&jsonp={callback}",n="http://api.stackoverflow.com/1.0/users/{id}/questions?key={key}&jsonp={callback}",e,p=0,g=/\/questions\/([0-9]*)\//ig,d=[];function q(){if(window.addEventListener)window.addEventListener("load",b,false);else window.attachEvent("onload",b);var a;if(window.attachEvent)if(window==window.top&&document.documentElement.doScroll){var d,e,c=document.createElement("div");a=function(){try{c.doScroll("left")}catch(e){d=window.setTimeout(a,0);return}c=null;b()};a()}else document.onreadystatechange=function(){/loaded|complete/.test(document.readyState)&&b()};else document.addEventListener&&document.addEventListener("DOMContentLoaded",b,false)}function b(){if(!e){e=true;for(var a=0,b=d.length;a<b;a++)d[a]()}}function h(b,c,h){var d="_jsonp"+p++;b=b.replace("{callback}","stackunderflow."+d).replace("{key}",a.appId);if(c)for(var g in c)b=b.replace("{"+g+"}",c[g]);a[d]=function(b){delete a[d];a.loaded(function(){h(b)})};var e=document.createElement("script");e.type="text/javascript";e.src=b;var f=document.getElementsByTagName("head")[0];f.insertBefore(e,f.firstChild)}function m(d){for(var e=[],f={},c=0,i=d.length;c<i;c++){g.lastIndex=0;var h=d[c].unescapedUrl,b=g.exec(h);if(b&&b[1]){var a=parseInt(b[1]);if(!f[a]){e.push(a);f[a]=1}}}return e}function j(b){var a=b+"";return a.length===2?a:"0"+a}function f(f,m){var i,n,l=new RegExp("\\{([^}]*)\\}","g"),e,b,g={site:a.site};do{e=l.exec(f);b=e?e[1]:null;if(b){var h=b.indexOf(":"),c=null;if(h>-1){c=b.substr(0,h);b=b.substr(h+1)}for(var k=b==="="?[]:b.split("."),d=m,i=0,n=k.length;i<n;i++){d=d[k[i]];if(typeof d==="undefined")break}if(c){var j;if(c.indexOf("template-")>-1){j=c.substr("template-".length);c="template"}c=a.filters[c];if(c)d=c(d,j)}if(typeof d!=="undefined")g[e[1]]=d}}while(b);for(b in g)f=f.replace(new RegExp("\\{"+b.replace(/([\.\:\-])/g,"\\$1")+"\\}","g"),g[b]);return f}function s(b,c){var a=document.createElement("div");a.innerHTML=c;while(a.firstChild)b.appendChild(a.firstChild)}function c(f,d,c){var b,e={render:function(){b=arguments}};h(f,d,function(d){c&&c(d);if(b){b=Array.prototype.slice.apply(b);b.splice(0,0,d);a.render.questions.apply(null,b)}});return e}var a=window.stackunderflow={appId:"oxXcnoD51kKE-crj7TadaA",site:"http://stackoverflow.com",loaded:function(a){if(e)a();else d.push(a)},googleQuestions:function(c,d){var b,f={render:function(){b=arguments}},e=a.site+"/questions";c=c||'"'+window.location+'"';h(t,{query:"site:"+e+" "+c},function(e){var c=m(e.responseData.results);c.length&&a.getQuestions(c,function(c){d&&d(c);if(b){b=Array.prototype.slice.apply(b);b.splice(0,0,c);a.render.questions.apply(null,b)}})});return f},getQuestions:function(a,b){return c(r,{id:a.join(";")},b)},searchQuestions:function(d,e,a,b){return c(u,{tagged:e,nottagged:a,intitle:d},b)},getQuestionsWithTags:function(d,a,b){return c(a?k:o,{tagged:d},b)},getQuestionsByUser:function(a,b){return c(n,{id:a instanceof Array?a.join(";"):a},b)},render:{questions:function(c,b,d){d=d||"question";if(typeof b==="string"){if(b.charAt(0)==="#")b=b.substr(1);b=document.getElementById(b)}var g="";c=c.questions;if(c)for(var e=0,h=c.length;e<h;e++)g+=f(a.templates[d],c[e]);s(b,g)}},templates:{tag:'<a href="{site}/questions/tagged/{=}" class="se-post-tag" title="show questions tagged \'{=}\'" rel="tag">{=}</a> ',question:'<div class="se-question-summary" id="question-summary-{question_id}">     <div onclick="window.location.href=\'{site}{question_answers_url}\'" class="se-cp">         <div class="se-votes">             <div class="se-mini-counts">{up_vote_count}</div>             <div>votes</div>         </div>         <div class="se-status {acceptedclass:=}">             <div class="se-mini-counts">{answer_count}</div>            <div>answer</div>         </div>         <div class="se-views">             <div class="se-mini-counts">{view_count}</div>             <div>views</div>         </div>     </div>     <div class="se-summary">         <h3><a href="{site}{question_answers_url}" class="se-question-hyperlink" title="{title}">{title}</a></h3>         <div class="se-tags">             {template-tag:tags}        </div>         <div class="se-started">             <span class="se-relativetime">{date:last_activity_date}</span>             <a style="display:{ifdef:owner}" href="{site}/users/{owner.user_id}/{owner.display_name}">{owner.display_name}</a> <span style="display:{ifdef:owner}"  class="se-reputation-score" title="reputation score">{owner.reputation}</span>         </div>     </div> </div> '},filters:{date:function(b){var a=new Date(parseInt(b)*1e3);return a.getFullYear()+"-"+j(a.getMonth()+1)+"-"+j(a.getDate())},template:function(c,e){var b=a.templates[e],d="";if(b)for(i=0,l=c.length;i<l;i++)d+=f(b,c[i]);return d},acceptedclass:function(a){return a.accepted_answer_id?"se-answered-accepted":a.answers&&a.answers.length?"se-answered":"se-unanswered"},ifdef:function(a){return typeof a==="undefined"?"none":""}}};q()})()
