﻿

function toggleMenuMouseOver(DivMenu) {

    document.getElementById(DivMenu).style.display = "block";
    
}

function toggleMenuMouseOut(DivMenu) {

    document.getElementById(DivMenu).style.display = "none";

}

//Banner rotate

window.onload = choosePic;

var adImages = new Array("/Images/Pictures/Main-Folding-Doors.gif", "/Images/Pictures/Main-Conservatory.gif", "/Images/Pictures/Main-Composite-Doors.gif");
var thisAd = 0;
var adURL = new Array("http://www.bifoldingslidingdoors.co.uk", "/Conservatory/Conservatories.aspx", "/Double-Glazing-Prices/Composite-Doors.aspx");

function rotate(){
    thisAd++;
    if(thisAd == adImages.length){
        thisAd=0;
        }
        document.getElementById("adBanner").src = adImages[thisAd];
        
        setTimeout("rotate()",7*1000);
    }

function newLocation() {
    document.location.href = adURL[thisAd];
    return false;
}

function initBannerLink() {
    if (document.getElementById("adBanner").parentNode.tagName == "A") {
        document.getElementById("adBanner").parentNode.onclick = newLocation;
    }
    rotate();
}

function choosePic() {
    thisAd = Math.floor((Math.random() * adImages.length));
    document.getElementById("adBanner").src = adImages[thisAd];

    initBannerLink();
}


           