Ajax.Responders.register({onCreate:function(a){a.timeoutId=window.setTimeout(function(){switch(a.transport.readyState){case 0:case 1:case 2:case 3:a.transport.abort();if(a.options.onFailure){a.options.onFailure(a.transport,a.json)}break}},5000)},onComplete:function(a){window.clearTimeout(a.timeoutId)}});function hoverLayer(a,b){if(typeof $(a)!="undefined"){hover=$(a);hover.style.position="absolute";hover.setStyle({left:b.positionedOffset()["left"]-2+"px",top:b.positionedOffset()["top"]-4+"px",zIndex:"10"});hover.style.display="block"}}function hideLayer(a){if(typeof $(a)!="undefined"){$(a).style.display="none"}}function displayLayer(a){if(typeof $(a)!="undefined"){$(a).style.display="block"}}function toggleLayers(b,a){if($(b).style.display=="none"){displayLayer(b);hideLayer(a)}else{displayLayer(a);hideLayer(b)}}var hideAllHovermenuItems=function(a){$$("*.hovermenuitem").each(function(b){b.hide()})};function getMousePosition(a){var b;if(!a){var a=window.event}if(a.pageX||a.pageY){posx=a.pageX;posy=a.pageY}else{if(a.clientX||a.clientY){posx=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;posy=a.clientY+document.body.scrollTop+document.documentElement.scrollTop}}return{x:posx,y:posy}}function popupLayerEvent(e,b,c){if($(b)!=null){pos=getMousePosition(e);if(typeof c=="undefined"){var c=new Object()}var f=18;var a=14;if(typeof c.x!="undefined"){a=c.x}if(typeof c.y!="undefined"){f=c.y}var d=$(b);d.style.display="block";d.style.position="absolute";if(typeof c.fixedPosition=="undefined"||c.fixedPosition==false){d.style.left=pos.x+a+"px";d.style.top=pos.y+f+"px"}}}function getSiteComponentsConfig(b,c,a){if(typeof siteComponentsConfig!="undefined"&&typeof siteComponentsConfig[b]!="undefined"&&siteComponentsConfig[b][c]!="undefined"){return siteComponentsConfig[b][c]}if(typeof a!="undefined"){return a}return null}function initCalendarPopupLinks(){var a=function(b){b.stop();var c=b.findElement("a").id.substring(26);$(c).hide()};$$("a.calendar_popup_link").each(function(b){b.observe("click",function(d){d.stop();var c=d.findElement("a");var e=c.id.substring(20);c.observe("click",a);$(e).setStyle({left:c.positionedOffset()["left"]-11+"px",top:(c.positionedOffset()["top"]+18)+"px"});$(e).show()})});$$("a.window-close-button").each(function(b){b.observe("click",a)})}function recommendCommentPost(a){new Ajax.Updater({success:"commentpost-rating-"+a},"/xmlhttprequest.php?service=entity.rate",{parameters:{entity_id:a,entity_type:"EntityCommentPost",rating:"99"}});return false}function getThemeName(){if(typeof themeName=="undefined"){var b=$$("link[rel=stylesheet]");if(b.size()>0){var a=b[0].readAttribute("href");a=a.substring(0,a.lastIndexOf("/"));themeName=a.substring(a.lastIndexOf("/")+1)}}return themeName}function articleOpinion(b,a){new Ajax.Updater({success:"article-opinion-"+b+"-"+(a?"agree":"disagree")},"/xmlhttprequest.php?service=entity.rate",{parameters:{entity_id:b,entity_type:"Article",rating:a?99:1}});return false};
