/* --- For Help & Manual Premium Pack 1.40 --- */
/* --- (c) 2008-2011 by Tim Green --- */
/* --- All Rights Reserved --- */
// Check and init for mobile devices
var mobVars={navLoaded:false,ctLoaded:false};function get_cookie(a){var b=a+"=";var c="";if(document.cookie.length>0){offset=document.cookie.indexOf(b);if(offset!=-1){offset+=b.length;end=document.cookie.indexOf(";",offset);if(end==-1){end=document.cookie.length;}c=unescape(document.cookie.substring(offset,end));}}return c;}function browserPlatform(){var c=navigator.userAgent.toLowerCase();otherBrowser=(c.indexOf("series60")!=-1)||(c.indexOf("symbian")!=-1)||(c.indexOf("windows ce")!=-1)||(c.indexOf("blackberry")!=-1);var g=typeof orientation!="undefined"?true:false;var e=("ontouchstart" in document.documentElement)?true:false;var b=(navigator.platform.indexOf("iPhone")!=-1)?true:false;var f=(navigator.platform.indexOf("iPad")!=-1)?true:false;var d=(b||f)?true:false;var a=(c.indexOf("android")!=-1)||(!d&&!otherBrowser&&e&&g)?true:false;if(!(otherBrowser||g||e||d||a)){return"desktop";}else{if(otherBrowser){return"other";}else{if(a){return"Android";}else{if(b){return"iPhone";}else{if(f){return"iPad";}else{return"desktop";}}}}}}function iOSfix(){var d=document.getElementById("hmcontent");var f=document.getElementById("hmnavigation");function b(){history.replaceState(null,null,null);window.frames.hmcontent.history.replaceState(null,null,null);window.frames.hmnavigation.history.replaceState(null,null,null);}function c(g){$(g).click(function(i){i.preventDefault();var h=g.href.substr(g.href.lastIndexOf("/")+1);mobVars.ctLoaded=false;d.contentWindow.location.replace(h);});}function e(){var g=setInterval(function(){var i=f.contentWindow.document;if($(i).find("a.tablink").length===3){clearInterval(g);var k=($(i).find("#indexRefs").length>0);var j=($(i).find("table.toc").length>0);var h=($(i).find("p.submit").length>0);$(i).find("a.tablink").each(function(){$(this).bind("click",function(n){n.preventDefault();var m=$(this).attr("href");f.contentWindow.location.replace(m);});});if(j){$(i).find("div#tree a").not("[href^='javascript']").each(function(){c(this);});}else{if(k){$(i).find("a[target='hmcontent']").each(function(){c(this);});}else{if(h){b();var l=$(i).find("input.zoom_button")[0];if(l){$(l).click(function(){b();});}if($(i).find("div.result_block").length>0){$(i).find("a[target='hmcontent']").each(function(){c(this);});}$(i).find("input").each(function(){$(this).attr("autocapitalize",false).attr("autocorrect",false);});}}}mobVars.navLoaded=true;}},100);}function a(){var g=setInterval(function(){var h=d.contentWindow.document;if($(h).find("#headtable a, #innerdiv a").length>0){clearInterval(g);$(h).find("#headtable a, #innerdiv a").not("[href^='http'],[href^='javascript'],[href^='ftp']").each(function(){c(this);});mobVars.ctLoaded=true;}},100);}$(f).bind("load",function(){e();});$(d).bind("load",function(){a();});if(!mobVars.navLoaded){e();}if(!mobVars.ctLoaded){a();}}function mobInit(b){var a=browserPlatform();function d(h){var e=document.getElementsByTagName("head")[0];var f=document.createElement("meta");if(h==="iPhone"){var g="width=960px, minimum-scale=0.5, maximum-scale=1.5, initial-scale=0.5, user-scalable=yes";}else{var g="width=device-width, initial-scale=1, minimum-scale=0.5 maximum-scale=1.6, user-scalable=yes";}f.setAttribute("name","viewport");f.setAttribute("content",g);$("frame[name='hmnavigation'], frame[name='hmcontent']").each(function(){$(this).bind("load",function(){iOSlen();});});e.appendChild(f);if(get_cookie("alerted")==""){alert(b.iOSalert);document.cookie="alerted=yes";}setTimeout(function(){iOSfix();},500);}function c(f,e){if(f!=""){window.location=f;}else{if(e==="iOS"){d(a);window.onorientationchange=function(){iOSlen();};}else{alert(e);window.history.back();}}}switch(a){case"desktop":return;break;case"iPhone":c(b.iPhRedirect,"iOS");break;case"iPad":c(b.iPdRedirect,"iOS");break;case"Android":c(b.aOSredirect,b.aOSalert);break;case"other":c(b.mobRedirect,b.aOSalert);break;default:return;}}function iOSlen(){var a=0;var f=$("frame[name='hmnavigation']");var e=$("frame[name='hmcontent']");var c=$("div#idheader",e[0].contentWindow.document).length===0?true:false;var b=navigator.platform.indexOf("iPad")!=-1?-78:0;var d=window.devicePixelRatio;if(navigator.platform.indexOf("iPad")!=-1){scrHeight=(Math.abs(window.orientation)===90)?screen.width*d:screen.height*d;}else{scrHeight=($(window).height()>$(window).width()?$(window).height():$(window).width());}$("div#scrollPadder",f[0].contentWindow.document).hide();a=(scrHeight+b-$("div#ns-header, div#ns-title",f[0].contentWindow.document).outerHeight())+"px";$("div#body-shift",f[0].contentWindow.document).css({height:a,overflow:"auto"});a=(scrHeight+b)+"px";$("html, body",e[0].contentWindow.document).css("height",a);if(c){$("div#idcontent",e[0].contentWindow.document).css({height:a,overflow:"auto"});}}
