var engineWebKit="webkit";
var deviceAndroid="android";
var deviceIphone="iphone";
var deviceIpod="ipod";
var deviceIpad="ipad";
var deviceBBStorm="blackberry95";
var devicePalm="palm";
var deviceWebOS="webos";
var engineOpera="opera";
var engineNetfront="netfront";
var engineUpBrowser="up.browser";
var engineOpenWeb="openweb";
var deviceMidp="midp";
var uplink="up.link";
var engineTelecaQ="teleca q";
var devicePda="pda";
var mini="mini";
var mobile="mobile";
var mobi="mobi";
var uagent=navigator.userAgent.toLowerCase();
function DetectIphone(){if(uagent.search(deviceIphone)>-1){if(uagent.search(deviceIpod)>-1){return false
}else{return true
}}else{return false
}}function DetectIpod(){if(uagent.search(deviceIpod)>-1){return true
}else{return false
}}function DetectIpad(){if(uagent.search(deviceIpad)>-1&&DetectWebkit()){return true
}else{return false
}}function DetectAndroid(){if(uagent.search(deviceAndroid)>-1){return true
}else{return false
}}function DetectWebkit(){if(uagent.search(engineWebKit)>-1){return true
}else{return false
}}function DetectBlackBerryTouch(){if(uagent.search(deviceBBStorm)>-1){return true
}else{return false
}}function DetectPalmWebOS(){if(uagent.search(deviceWebOS)>-1){return true
}else{return false
}}function DetectMobile(){if(DetectIphone()||DetectIpod()||DetectIpad()||DetectAndroid()||DetectBlackBerryTouch()||DetectPalmWebOS()){return true
}else{return false
}}if(DetectMobile()){AJS.$("#splitter-sidebar").hide()
}else{AJS.toInit(function(){var D=false;
var C=false;
var B=function(F){if(F){C=F;
var E=AJS.$("#header").height()||60;
AJS.$("#swk-comments").css({bottom:null,overflow:"auto"});
if(D==false){D=true
}else{AJS.$("#swk-comments").animate({top:(E+175)+"px",height:(AJS.$(window).height()-(175+E))+"px"})
}AJS.$("#comments-close").css("display","inline");
AJS.$("#overlay").css("display","block")
}else{C=F;
AJS.$("#swk-comments").css({overflow:"hidden"});
if(D==false){D=true
}else{AJS.$("#swk-comments").animate({top:(AJS.$(window).height()-38)+"px",height:"38px"})
}AJS.$("#comments-close").css("display","none");
AJS.$("#overlay").css("display","none")
}};
if(window.location.hash.toString().match("#addcomment$")!=null||window.location.href.toString().match("\\?showComments=true$")!=null||window.location.hash.toString().match("#comments$")!=null||window.location.hash.toString().match("#comment-[0-9]+$")){B(true)
}else{if(AJS.$("#comments-hide:visible").length>0){AJS.$("#comments-hide:visible").click()
}B(false)
}AJS.$("#comments-section-title a.comments-show-hide").click(function(){if(C){B(false)
}else{B(true)
}});
AJS.$("#overlay").click(function(){if(C){AJS.$("#comments-section-title a.comments-show-hide").click()
}});
AJS.$("#comments-close").click(function(){if(C){AJS.$("#comments-section-title a.comments-show-hide").click()
}});
AJS.$(".comment-body #rte-button-cancel").click(function(E){if(C){AJS.$("#comments-section-title a.comments-show-hide").click();
E.preventDefault()
}});
var A=function(){var E=AJS.$("#header").height()||60;
AJS.$("#swk-splitter-content").css("height",(AJS.$(window).height()-(101-E))+"px");
AJS.$("#swk-book").css("height",(AJS.$(window).height()-(286-E))+"px");
AJS.$("#swk-main-wrap").css("height",(AJS.$(window).height()-(354-E))+"px");
AJS.$("#swk-splitter-sidebar").css("height",(AJS.$(window).height()-(325-E))+"px");
AJS.$("#swk-comments").width(AJS.$("#swk-book").width()+84);
AJS.$("#content.page.edit").height(AJS.$("#swk-main-wrap").height()-27);
if(C){AJS.$("#swk-comments").css({bottom:null,overflow:"auto",top:(E+175)+"px",height:(AJS.$(window).height()-(175+E))+"px"})
}else{AJS.$("#swk-comments").css({overflow:"hidden",top:(AJS.$(window).height()-38)+"px",height:"38px"})
}};
AJS.$(window).bind("resize",A);
A.call();
AJS.$("html").css("overflow","hidden");
AJS.$("body").css("overflow","hidden");
AJS.$("#breadcrumbs li:last-child").addClass("last")
})
};
