$(document).ready(function(){$(".comment-form").show();$(".new-window").each(function(){$(this).attr("target","_blank")});$(".new-dwindow").click(function(){window.open($(this).attr("href"),"","menubar=yes,toolbar=yes,location=yes,status=yes,scrollbars=yes,resizable=yes,width="+($(window).width()-50)+",height="+($(window).height()-50));return false});var a=$(".call-window").size();if(a){$('<div id="window-fade"></div><div id="window-content-surr"><div id="window-content"><div class="window-header"><div class="window-header-content"><span></span></div></div><div class="window-body-border"><div class="window-body"></div><div class="window-buttons"><div class="button center-button close"><input type="button" value="Close" class="close-window"></div></div></div></div></div>').appendTo("body");var b=$("#window-content-surr");b.css({left:($(window).width()-b.width())/2+"px",top:($(window).height()-b.height())/2+"px"})}$("#window-fade").click(function(){return closeWindow()});var c=$("#post-comment");c.submit(function(a){a.preventDefault();$.ajaxSetup({crossDomain:true});$.getJSON(c.attr("action"),c.serialize()+"&callback=?",function(a){showWindow(a.header,a.error||a.message,a.error?"window-error":"");if(!a.error){c.get(0).reset()}})});$("#share-site-buttons a").click(function(){var a;switch($(this).attr("id")){case"button-facebook":a="http://www.facebook.com/sharer/sharer.php?u="+escape(location.href);break;case"button-linkedin":a="http://www.linkedin.com/shareArticle?mini=true&url="+escape(location.href)+"&title="+escape(document.title)+"&ro=false&summary=&source=";break;case"button-digg":default:a="http://digg.com/submit?url="+escape(location.href)+"&title="+escape(document.title)+"&bodytext=";break}window.open(a,"","menubar=yes,toolbar=yes,location=yes,status=yes,scrollbars=yes,resizable=yes,width="+($(window).width()-50)+",height="+($(window).height()-50));return false})});var showWindow=function(a,b,c){showWindowCallback(a,b,c,null)};var showWindowCallback=function(a,b,c,d){$("#window-fade").css({width:$(document).width()+"px",height:$(document).height()+"px",opacity:.6}).fadeIn("fast",function(){var e=$(window).width();var f=$(window).height();if(!a)a=" ";var g=$(".window-header");g.find("span").html(a);$(".window-body").css("maxHeight",f-100+"px").html(b);$("#window-content-surr").addClass(c).css("visibility","hidden").fadeIn("fast",function(){var a=$(this);a.css({top:Math.floor((f-a.height())/2),left:Math.floor((e-a.width())/2),visibility:"visible"});$(window).resize()});window_opened=true;if(typeof d=="function"){d()}});$(window).resize(function(){$("#window-fade").css({width:$(window).width()+"px",height:$(document).height()+"px"});var a=$(window).width();var b=$(window).height();var c=$(".window-header");$(".window-body").css("maxHeight",b-100+"px");var c=$("#window-content-surr");c.css({left:Math.floor((a-c.width())/2)+"px",top:Math.floor((b-c.height())/2)+"px"})})};$(".close-window").live("click",function(){return closeWindow()});var closeWindow=function(){$("#window-content-surr").fadeOut("fast",function(){$(".window-header span").html("");$(".window-body").html("");$("#window-fade").fadeOut("fast");var a=$(this);a.css({left:($(window).width()-a.width())/2+"px",top:($(window).height()-a.height())/2+"px"}).removeClass("window-error window-correct window-error-block window-correct-block")});if(typeof refreshWindowByClose=="function"){refreshWindowByClose()}return false}
