homePic = Math.floor((Math.random()*4)) + 1;
homePicLink = new Array
homePicLink[1] = '<a href="renovations.html"><img src="images/home_revitalizing.jpg" width="226" height="232"></a>';
homePicLink[2] = '<a href="kitchens.html"><img src="images/home_reimagining.jpg" width="226" height="232"></a>';
homePicLink[3] = '<a href="bathrooms.html"><img src="images/home_modernizing.jpg" width="226" height="232"></a>';
homePicLink[4] = '<a href="additions.html"><img src="images/home_creating.jpg" width="226" height="232"></a>';

randomNum = 0;

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function newWindow350(pageHTML,pageName) {
	popupWindow350=window.open(pageHTML,pageName,"height=350,width=350")
}

function newWindow512scroll(pageHTML,pageName) {
	popupWindow512scroll=window.open(pageHTML,pageName,"scrollbars=yes,height=450,width=756")
}

function newWindow(pageHTML,pageName) {
	popupWindow=window.open(pageHTML,pageName,"height=600,width=750,resizable=yes,scrollbars=yes,left=20,top=20")
}

function newPopUp(pageHTML,pageName, popupOptions) {
	popupWindow=window.open(pageHTML,pageName,popupOptions)
}

function choosePic() {
    if (document.images) {
       randomNum = Math.floor((Math.random()*3)) + 1;
       pic_base="images/home_pic_";
       document.home_pic.src = pic_base + randomNum + ".jpg";
    }

    el = document.getElementById('linkToExhibit');

    if (randomNum == 1) {
       el.href="exhibits/lights_camera_action.html";
    }
    if (randomNum == 2) {
       el.href="exhibits/the_great_outdoors.html";
    }
    if (randomNum == 3) {
       el.href="exhibits/north_avenue_art_works.html";
    }

}

function hideSubNav(subNav, Nav) {
    document.getElementById(subNav).style.visibility="hidden";
    document.getElementById(Nav).style.visibility="hidden";
    document.getElementById('subnav_off').style.visibility="hidden";
}

function showSubNav(subNav, Nav) {
    document.getElementById(subNav).style.visibility="visible";
    document.getElementById(Nav).style.visibility="visible";
    document.getElementById('subnav_off').style.visibility="visible";
}

function showPic(picDiv, titleDiv) {
    document.getElementById(currentPicDiv).style.visibility="hidden";
    document.getElementById(currentTitleDiv).style.visibility="hidden";
    document.getElementById(picDiv).style.visibility="visible";
    document.getElementById(titleDiv).style.visibility="visible";
    currentPicDiv = picDiv;
    currentTitleDiv = titleDiv;
}

function showCategory(categoryDiv) {
    document.getElementById(currentCategoryDiv).style.visibility="hidden";
    document.getElementById(categoryDiv).style.visibility="visible";
    currentCategoryDiv = categoryDiv;
}

