function Menu_Select(a){document.getElementById(a).style.backgroundColor="#a5eefd";document.getElementById(a).style.color="#f00";for(a=0;a<document.images.length;a++)if(document.images[a].alt.length>0)document.images[a].title=document.images[a].alt}
function BookmarkPage(){var a=document.location.href;a.indexOf("?")>0&&(a=a.substring(0,a.indexOf("?")));if(document.all)window.external.AddFavorite(a,document.title);else if(window.sidebar)window.sidebar.addPanel(window.document.title,a,"");else{alert("Sorry! Your browser doesn't appear to support this function.\n\r\n\rYou can Bookmark this page manually by clicking your Browsers' Bookmark icon.");return}(new Image).src="http://www.blocklayer.com/Logger.ashx?p="+escape(document.location.href.substring(11))+
"&a=Bookmarked"}function TellAFriend(){window.open("../TellFriend.aspx",null,"height=380,width=640,scrollbars=no,resizable=no,status=no,toolbar=no,menubar=no,location=no").focus()}if(top.location!=self.location)top.location=self.location;function SetInput(){for(var a=document.getElementsByTagName("input"),b=0;b<a.length;b++)if(a[b].type=="text"&&a[b].className!="Char")a[b].onkeypress=CheckNumeric}
function CheckNumeric(a){if(document.all){var b=event.keyCode;return event.srcElement.id.indexOf("_")==0&&b==46&&event.srcElement.value.indexOf(".")==-1?true:b>47&&b<58?true:false}else{b=a.which;if(a.target.id.indexOf("_")==0&&b==46&&a.target.value.indexOf(".")==-1)return true;if(b>47&&b<58||b==0||b==8)return true;a.preventDefault()}}
function ConEng(a,b){if(a==0)return"0";var c=Math.round(a),e=0,f=0;b?(e=Math.floor(c/384),f=Math.floor(c/32)%12):f=Math.floor(c/32);c%=32;for(var h=32;c%2==0&&c>1;)c/=2,h/=2;var g="";e>0&&(g=e+"'");f>0&&(g+=f);f>0&&c>0&&(g+="~");c>0&&(g+=c.toString()+"/"+h.toString());if(f>0||c>0)g+='"';return g}function OpenSave(){window.open("LocalStorage.aspx",null,"width=440,height=280,scrollbars=1,location=no,menubar=no,toolbar=no,left=10,top=10").focus()}window.onbeforeprint=NoPrint;
function NoPrint(){document.getElementsByTagName("canvas").length>0&&IsIE()<9&&alert("IE"+IsIE()+" may not print this page correctly\n\nPlease use IE9 or later, Firefox or Chrome to print\n\n\nSorry for the inconvenience")}function IsIE(){var a=navigator.userAgent;return a.indexOf("IE")>-1&&/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(a)!=null?parseFloat(RegExp.$1):100}function RoundTo(a,b){if(b==0)return Math.round(a);b=Math.pow(10,b);return d=Math.round(a*b)/b}
function QRun(a,b){var c="http://chart.apis.google.com/chart?cht=qr&chs=320x320&chl=http://blocklayer.mobi/rundisplay.aspx?r="+a.innerHTML.replace(/\s+/g,"").replace(/'+/g,"f").replace(/"+/g,"i");OpenQR(c,b)}function RunTalkQR(a){var b=parseFloat(roofData.split(",")[10]);a.indexOf("Imperial")>-1?(a+="<br />Spacing "+ConEng(b),b/=32):a+="<br />Spacing "+RoundTo(b,1);OpenQR("http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl=http://blocklayer.mobi/android.aspx%3Fi%3D"+b+"%26sa%3D0",a)}
function GetBevelURL(){var a=templateData.split(",");return"http://blocklayer.mobi/bevel-gauge.aspx?ba=Hip-Plumbcut:"+a[1]+",Rafter-Plumbcut:"+a[3]+",Hip-Sidecut:"+a[5]+",Creeper-Sidecut:"+a[7]}function QRBevel(a){var b="http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl="+GetBevelURL();OpenQR(b,a)}function GoBevel(){window.open(GetBevelURL())}
function OpenQR(a,b){var c=window.open("","","width=420,height=420");c.document.body.setAttribute("style","text-align:center;");var e=c.document.createElement("span");e.setAttribute("style","font-size:18px;font-family:verdana;");e.innerHTML=b;c.document.body.appendChild(e);c.document.body.appendChild(c.document.createElement("br"));c.document.body.appendChild(c.document.createElement("br"));e=c.document.createElement("img");e.src="http://www.blocklayer.com/images/print.jpg";e.setAttribute("onclick",
"window.print()");e.setAttribute("style","cursor:pointer");c.document.body.appendChild(e);c.document.body.appendChild(c.document.createElement("br"));e=c.document.createElement("img");e.src=a;e.setAttribute("onclick","window.print()");e.setAttribute("style","cursor:pointer");c.document.body.appendChild(e);c.focus()};
