// Declarations var d = document; var i = 0; var n = navigator; var s = d.styleSheets[0]; var nVer = n.appVersion; var nApp = n.appName; var nUser = n.userAgent; var isIE6 = nVer.toLowerCase().indexOf("msie 6.0")!=-1; var isIE = nVer.indexOf("MSIE")!=-1; var isWin = nVer.toLowerCase().indexOf("win")!=-1; var isOpera = nUser.indexOf("Opera")!=-1; var isSafari = nVer.indexOf("Safari")!=-1; var isFirefox = nUser.indexOf("Firefox")!=-1; var isChrome = nUser.indexOf("Chrome")!=-1; function gE(elem) { return d.getElementById(elem) }; function addCSS(elem, rule) { isIE ? s.addRule(elem, rule) : s.insertRule(elem + '{' + rule + '}', 1); } // JavaScript Document function toggleDisclaimer() { //gE('disclaimerbox').style.visibility = (gE('disclaimerbox').style.visibility == "hidden") ? "visible" : "hidden"; gE('disclaimerbox').style.display = (gE('disclaimerbox').style.display == "none") ? "block" : "none"; // gE(str).style.lineHeight = (gE(str).style.visibility == "hidden") ? "2px" : "25px"; // document.getElementById(str).style.lineHeight = (document.getElementById(str).style.lineHeight == "25px") ? "2px" : "25px"; //(name.checked == true) ? "visible" : "hidden"; window.location.href = "#disclaimertext"; } function openemail() { window.location.href = "mailto:contact@ausbatts.com.au"; } // Executed at end of every page function onLoad(curPage) { //gE('disclaimerbox').style.visibility = "hidden"; gE('disclaimerbox').style.display = "none"; //gE(boxID).checked ? gE(row).style.display = isIE ? 'inline':'table-row' : gE(row).style.display = 'none'; var BtnsArray = new Array('home', 'products', 'insulation', 'downlights', 'reports', 'rebate', 'quote', 'contact'); // isIE6 && gE('email-form') ? gE('email-form').style.display = "none" : 0; for (i=0; i < BtnsArray.length; i++) { var btn = gE(BtnsArray[i]); addBtn(btn, "images/menu/btn-"+btn.id+"-active.png"); } function addBtn(btn, file) { var img = new Image(); img.src = file; //!isIE6 ? btn.style.visibility = "visible" : 0; if (btn.id != curPage) { btn.attachEvent ? btn.attachEvent('onmouseover', switchImage) : btn.addEventListener('mouseover', switchImage, true); btn.attachEvent ? btn.attachEvent('onmouseout', restoreImage) : btn.addEventListener('mouseout', restoreImage, true); btn.style.cursor = "pointer"; } else { btn.src = file; //"images/button-"+btn.id+"-selected.png"; btn.style.cursor = "default"; } function switchImage() { btn.src = "images/menu/btn-"+btn.id+"-active.png"; } function restoreImage() { btn.src = "images/menu/btn-"+btn.id+".png"; } } } function checkCalibri() { var detectFont = new Detector(); return (!(detectFont.test('Calibri'))); } function customisePage() { if (isIE) { // s.addRule('h1', 'font-size:27px !important;'); // s.addRule('h2', 'font-size:24px !important;'); } else { // s.insertRule('h1 { font-size:27px !important; }', 0); // s.insertRule('h2 { font-size:24px !important; }', 0); } } function mouseover(button) { button.style.backgroundImage = "url(images/menu/"+button.id+"-mo.png)"; } function mouseout(button) { button.style.backgroundImage = "url(images/menu/"+button.id+".png)"; } function clickButton(button) { button.id!="home" ? window.location=button.id+".php" : window.location="index.php"; } function googleAnalytics() { var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-5720745-11"); pageTracker._trackPageview(); } catch(err) { } ; }