//  This file defines the initializations and functions necessary to perform
//  image mouse rollover effects.  This file would need to be included in 
//  HTML files that will use a rollover effect.  In the anchor tag, onmouseover
//  and onmouseout events should call the imageOn and imageOff functions 
//  respectively.  Both functions take the name of the image as variable.

//  ex.
//  <a href="yourdomain.com" onmouseover="imageOn('button'); return true;" onmouseout="imageOff('button'); return true;">
//  <img src="button_1.jpg" name="button">
//  </a>

if (document.images)
    {
    //  create "on" array and populate with Image objects
    var onImgArray = new Array();
    onImgArray["enter"] = new Image(201, 57);
    onImgArray["home"] = new Image(63, 67);
    onImgArray["portfolio"] = new Image(53, 67);
    onImgArray["contact"] = new Image(60, 67);
    onImgArray["back"] = new Image(54, 39);
    onImgArray["next"] = new Image(54, 39);
	onImgArray["sback"] = new Image(51, 37);
	onImgArray["snext"] = new Image(51, 37);
	
    //  set URLs for the "on" images
    onImgArray["enter"].src = "images/enterimageroll.gif";
    onImgArray["home"].src = "images/homeiconroll.gif";
    onImgArray["portfolio"].src = "images/portfolioiconroll.gif";
    onImgArray["contact"].src = "images/contacticonroll.gif";
    onImgArray["back"].src = "images/backpopuproll.jpg";
    onImgArray["next"].src = "images/nextpopuproll.jpg";
	onImgArray["sback"].src = "images/smallbackpopuproll.jpg";
	onImgArray["snext"].src = "images/smallnextpopuproll.jpg";
    
    //  create "off" array and populate with Image objects
    var offImgArray = new Array();
    offImgArray["enter"] = new Image(201, 57);
    offImgArray["home"] = new Image(63, 67);
    offImgArray["portfolio"] = new Image(53, 67);
    offImgArray["contact"] = new Image(60, 67);
    offImgArray["back"] = new Image(54, 39);
    offImgArray["next"] = new Image(54, 39);
	offImgArray["sback"] = new Image(51, 37);
	offImgArray["snext"] = new Image(51, 37);
	
    //  set URLs for the "off" images
    offImgArray["enter"].src = "images/enterimage.gif";
    offImgArray["home"].src = "images/homeicon.gif";
    offImgArray["portfolio"].src = "images/portfolioicon.gif";
    offImgArray["contact"].src = "images/contacticon.gif";
    offImgArray["back"].src = "images/backpopup.jpg";
    offImgArray["next"].src = "images/nextpopup.jpg";
	offImgArray["sback"].src = "images/smallbackpopup.jpg";
	offImgArray["snext"].src = "images/smallnextpopup.jpg";
    
    //  preload extra rollover images
    var exImgArray = new Array();
    exImgArray["home_2"] = new Image(176, 12);
    exImgArray["portfolio_2"] = new Image(176, 12);
    exImgArray["contact_2"] = new Image(176, 12);
    exImgArray["blank"] = new Image(176, 12);
    
    exImgArray["home_2"].src = "images/homeiconb.gif";
    exImgArray["portfolio_2"].src = "images/portfolioiconb.gif";
    exImgArray["contact_2"].src = "images/contacticonb.gif";
    exImgArray["blank"].src = "images/blankexrollover.gif";   
    }
    
function imageOn(imgName)
    {
    if (document.images)
        {
        if ((imgName == "home") || (imgName == "portfolio") || (imgName == "contact"))
            {
            eximgName = imgName + "_2";
            
            document.images["ex_rollover"].src = exImgArray[eximgName].src;
            }
        
        document.images[imgName].src = onImgArray[imgName].src;
        }
    }
    
function imageOff(imgName)
    {
    if (document.images)
        {
        if ((imgName == "home") || (imgName == "portfolio") || (imgName == "contact"))
            {
            document.images["ex_rollover"].src = exImgArray["blank"].src;
            }
        
        document.images[imgName].src = offImgArray[imgName].src;
        }
    }