// General page init functions for HM Premium Pack 1.24
// Version for pages without headers
// Copyright (c) 2009, 2010 by Tim Green and EC Software. 
// All rights reserved.
function addEvent(e,d,b,a){if(e.addEventListener){e.addEventListener(d,b,a);
return true
}else{if(e.attachEvent){var c=e.attachEvent("on"+d,b);
return c
}else{alert("Could not add event!")
}}}function trim(a){return a.replace(/^\s+|\s+$/g,"")
}function getHref(b,a,d){var e;
var c=document.location.href.replace(/\#.*$/,"");
c=c.replace(/\?.*?$/,"");
c=c.replace(/\/(?!.*?\/)/,"/"+b+"?");
e='<p class="help-url"><b>'+a+'&nbsp;</b><a href="'+c;
e=e+'" target="_top" title="'+d+'">'+c+"</a></p>";
return e
}function toggleToggles(){if(HMToggles.length!=null){var a=true;
for(var b=0;
b<HMToggles.length;
b++){if(HMToggles[b].getAttribute("hm.state")=="1"){a=false;
break
}}HMToggleExpandAll(a)
}}function toggleCheck(d){var c=$(d[0]).parents("table[id^='TOGGLE']");
var a=c.size();
var e=false;
if(a>0){var j,h,f,g;
for(var b=0;
b<a;
b++){j=c[b];
h=$(j).attr("id");
f="$"+h+"_ICON";
g=j.getAttribute("hm.state");
if($("img[id='"+f+"']").attr("src")!=null){e=true
}if((g)=="0"||(g==null)){if(!e){HMToggle("toggle",h)
}else{HMToggle("toggle",h,f)
}}}}}function openTargetToggle(e,b){var a;
var d=false;
if(b=="menu"){a=$(e[0]).parent("span:has(a.dropdown-toggle)").find("a.dropdown-toggle").attr("href");
if(!a){a=$(e[0]).parent("p:has(a.dropdown-toggle)").find("a.dropdown-toggle").attr("href")
}}else{a=$(e[0]).parent("p:has(a.dropdown-toggle)");
a=$(a).find("a.dropdown-toggle").attr("href");
if(!a){a=$(e[0]).parents("table:has(a.dropdown-toggle)")[0];
a=$(a).find("a.dropdown-toggle").attr("href")
}}var f=false;
var c="";
if(a){if(a.indexOf("ICON")!=-1){f=true
}a=a.replace(/^.*?\,\'/,"");
a=a.replace(/\'.*$/,"");
if(f){c="$"+a+"_ICON"
}if(!f){HMToggle("toggle",a);
return true
}else{HMToggle("toggle",a,c);
return true
}}else{return false
}}function toggleJump(){if(location.hash){var b=location.hash.replace(/\#/,"");
var a;
if($("a[id='"+b+"']").length>0){a=$("a[id='"+b+"']")
}else{if($("a[name='"+b+"']").length>0){a=$("a[name='"+b+"']")
}else{return false
}}if(HMToggles.length!=null){HMToggleExpandAll(false)
}toggleCheck(a);
if($(a).parent("p:not(:has(a.dropdown-toggle))").length==0){openTargetToggle(a,"page")
}$().scrollTo($(a),300,{offset:-30,axis:"y"});
return false
}}$(document).ready(function(){var a=/msie 6|MSIE 6/.test(navigator.userAgent);
var b=document.location.pathname;
b=b.replace(/^.*[/\\]|[?#&].*$/,"");
$("a[href^='"+b+"#'],a[href^='#']:not(a[href='#'])").click(function(){var c=$(this).attr("href").replace(/.*?\#/,"");
var d=$("a[id='"+c+"']");
if(!d.length>0){d=$("a[name='"+c+"']")
}if(HMToggles.length!=null){HMToggleExpandAll(false)
}toggleCheck(d);
if($(d).parent("p:not(:has(a.dropdown-toggle))").length==0){openTargetToggle(d,"page")
}$().scrollTo($(d),600,{offset:-30,axis:"y"});
return false
})
});
function readCookie(b){var e=b+"=";
var a=document.cookie.split(";");
for(var d=0;
d<a.length;
d++){var f=a[d];
while(f.charAt(0)==" "){f=f.substring(1,f.length)
}if(f.indexOf(e)==0){return f.substring(e.length,f.length)
}}return null
}function frameWidth(){var a=$("#hmframeset",window.parent.document).attr("cols");
var c=a.split(",");
if(c[0].indexOf("%")==-1){var b=parseInt(c[0]);
if(b>1000){b=b/100
}a=b+","+c[1]
}return a
}function togTOC(b){var a=frameWidth();
if(readCookie("colWidth")){var c=readCookie("colWidth")
}else{var c="0"
}if(a.substring(0,2)=="0%"){if(c!="0"){$("#hmframeset",window.parent.document).attr("cols",c)
}else{$("#hmframeset",window.parent.document).attr("cols",b+",*")
}$("#hmframeset",window.parent.document).attr("frameBorder","1");
$("#hmframeset",window.parent.document).attr("frameSpacing","1")
}else{document.cookie="colWidth="+a;
$("#hmframeset",window.parent.document).attr("cols","0%,100%");
$("#hmframeset",window.parent.document).attr("frameBorder","0");
$("#hmframeset",window.parent.document).attr("frameSpacing","0")
}};