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"}if(top.location!=self.location)top.location=self.location;function TellAFriend(){window.open("../TellFriend.aspx",null,"height=380,width=640,scrollbars=no,resizable=no,status=no,toolbar=no,menubar=no,location=no").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 RunTalkQR(a,c,b){a.indexOf("Imperial")>-1?(a+="<br />Centers "+ConEng(c,true)+" Start at "+ConEng(b,true),c/=32,b/=32):a+="<br />Centres "+RoundTo(c,1)+" Start at "+RoundTo(b,1);OpenQR("http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl=http://blocklayer.mobi/android.aspx%3Fi%3D"+c+"%26sa%3D"+b,a)}
function QRun(a){a=a.innerHTML.replace(/\s+/g,"").replace(/'+/g,"f").replace(/"+/g,"i");OpenQR("http://blocklayer.mobi/rundisplay.aspx?r="+a,"Stringer Setout")}
function OpenQR(a,c){var b=window.open("","","width=420,height=470,location=no,status=no,resizable=yes");b.document.body.setAttribute("style","text-align:center;");b.document.title="Blocklayer.com QR Code";var e=b.document.createElement("span");e.setAttribute("style","font-size:18px;font-family:verdana;");e.innerHTML=c;var f=b.document.createElement("img");f.src="http://www.blocklayer.com/images/close.png";f.setAttribute("onclick","window.close()");f.setAttribute("style","cursor:pointer;float:right");
b.document.body.appendChild(f);b.document.body.appendChild(e);b.document.body.appendChild(b.document.createElement("br"));b.document.body.appendChild(b.document.createElement("br"));e=b.document.createElement("img");e.src="http://www.blocklayer.com/images/print.jpg";e.setAttribute("onclick","window.print()");e.setAttribute("style","cursor:pointer");b.document.body.appendChild(e);b.document.body.appendChild(b.document.createElement("br"));e=300+Math.round(a.length/5);f=b.document.createElement("img");
f.src="http://chart.apis.google.com/chart?cht=qr&chs="+e+"x"+e+"&chl="+a;f.setAttribute("onclick","window.print()");f.setAttribute("style","cursor:pointer");b.document.body.appendChild(f);b.focus()}function RoundTo(a,c){if(c==0)return Math.round(a);c=Math.pow(10,c);return d=Math.round(a*c)/c}var dloc=document.location.toString().toLowerCase();if(dloc.indexOf("blocklayer.com")==-1&&dloc.indexOf("localhost")==-1||dloc.indexOf("file:")>-1)location.replace("http://www.blocklayer.com/stairs/"),document.write('<a href="http://www.blocklayer.com"><h1>Blocklayer.com</h1></a>');
function SetNumeric(){for(var a=document.getElementsByTagName("input"),c=0;c<a.length;c++)if(a[c].className=="Num")a[c].onkeypress=CheckNumeric;else if(a[c].className=="Imp")a[c].onkeypress=CheckImperial}
function CheckNumeric(a){if(document.all){var c=event.keyCode;return event.srcElement.id.indexOf("_")==0&&c==46&&event.srcElement.value.indexOf(".")==-1?true:c>47&&c<58?true:false}else{c=a.which;if(a.target.id.indexOf("_")==0&&c==46&&a.target.value.indexOf(".")==-1)return true;if(c>47&&c<58||c==0||c==8)return true;a.preventDefault()}}
function CheckImperial(a){var c=document.all?event.srcElement.value:a.target.value,b=document.all?event.keyCode:a.which;if(b>47&&b<58||b==8)return true;if(b==46&&c.indexOf(".")==-1&&c.length>0)return true;if(b==32&&c.substring(c.length-1)!=" "&&c.length>0)return true;if(b==47&&c.indexOf("/")==-1&&c.length>0)return true;if(document.all)return false;else a.preventDefault()}
function ConEng(a,c){if(a==0)return"0";var b=Math.round(a),e=0,f=0;c?(e=Math.floor(b/384),f=Math.floor(b/32)%12):f=Math.floor(b/32);b%=32;for(var g=32;b%2==0&&b>1;)b/=2,g/=2;var h="";e>0&&(h=e+"'");f>0&&(h+=f);f>0&&b>0&&(h+="~");b>0&&(h+=b.toString()+"/"+g.toString());if(f>0||b>0)h+='"';return h}function SetTitles(){for(var a=0;a<document.images.length;a++)if(document.images[a].alt.length>0)document.images[a].title=document.images[a].alt}
function DrawHR(){for(var a=document.getElementsByTagName("canvas"),c=0;c<a.length;c++)if(a[c].id.indexOf("cnvsHR")==0){var b=a[c],e=b.getContext("2d");e.strokeStyle="#888";var f=b.height-10;e.shadowOffsetY=4;e.shadowOffsetX=4;e.shadowBlur=4;e.shadowColor="#c0c0c0";e.beginPath();e.moveTo(0,f/2);for(var g=0;g<b.width;)g+=4+Math.random()*4,e.lineTo(g,Math.random()*f);e.stroke()}};
