currentPic=""

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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function selectPic(mainPic,largePic) {
  document.mainPic.src = "images/" + mainPic + ".jpg"
  currentPic  = largePic
}

function enlargePic(thePic) {
  eval("MM_openBrWindow('" + currentPic + ".html','Portfolio','width=450,height=300')")
}

function choosePic() {
    if (document.images) {
       randomNum = Math.floor((Math.random()*4)) + 1;
       document.home_pic.src = "images/home_pic_" + randomNum + ".jpg";
       document.home_caption.src = "images/home_caption_" + randomNum + ".gif";
    }

    el = document.getElementById('linkToPortfolio');

    if (randomNum == 1) {
       el.href="portfolio_cas_5.html";
    }
    if (randomNum == 2) {
       el.href="portfolio_ed_ent_3.html";
    }
    if (randomNum == 3) {
       el.href="portfolio_hp_2.html";
    }
    if (randomNum == 4) {
       el.href="portfolio_cas_1.html";
    }

}

