//preload images

/* MX-DEV code

var hover_dir = "/globals/images/nav/hover/";
var off_dir = 	"/globals/images/nav/off/";
var tooldir = "/globals/images/toolbar/";

*/

/* WWW code */
var hover_dir = "http://www.wharton.upenn.edu/globals/images/nav/hover/";
var off_dir = 	"http://www.wharton.upenn.edu/globals/images/nav/off/";
var tooldir = "http://www.wharton.upenn.edu/globals/images/toolbar/";
/* 
*/



    if (document.images) 
    {
	
		bluebg = new Image(1,10000);
	//	bluebg.src = "/globals/images/bluebackground.gif";
		bluebg.src = "http://www.wharton.upenn.edu/globals/images/bluebackground.gif";
	
	
        academics1 = new Image(154,23);
        academics1.src = hover_dir + "academics.gif";
        academics2 = new Image(154,23);
        academics2.src = off_dir + "academics.gif";

        executive1 = new Image(158,23);
        executive1.src = hover_dir + "executive.gif";
        executive2 = new Image(158,23);
        executive2.src = off_dir + "executive.gif";

        faculty1 = new Image(147,23);
        faculty1.src = hover_dir + "faculty.gif";
        faculty2 = new Image(147,23);
        faculty2.src = off_dir + "faculty.gif";

        alumni1 = new Image(137,23);
        alumni1.src = hover_dir + "alumni.gif";
        alumni2 = new Image(137,23);
        alumni2.src = off_dir + "alumni.gif";

        campus1 = new Image(83,23);
        campus1.src = hover_dir + "campus.gif";
        campus2 = new Image(83,23);
        campus2.src = off_dir + "campus.gif";

        whartonfacts1 = new Image(120,23);
        whartonfacts1.src = hover_dir + "whartonfacts.gif";
        whartonfacts2 = new Image(120,23);
        whartonfacts2.src = off_dir + "whartonfacts.gif";
		
		
		
        // toolbar graphics

        thome1 = new Image(92,24);
        thome1.src = tooldir + "home1.gif";
        thome2 = new Image(92,24);
        thome2.src = tooldir + "home.gif";

        tcontact1 = new Image(74,24);
        tcontact1.src = tooldir + "contact1.gif";
        tcontact2 = new Image(74,24);
        tcontact2.src = tooldir + "contact.gif";

        tmaps1 = new Image(94,24);
        tmaps1.src = tooldir + "maps1.gif";
        tmaps2 = new Image(94,24);
        tmaps2.src = tooldir + "maps.gif";

        tgo1 = new Image(23,24);
        tgo1.src = tooldir + "go1.gif";
        tgo2 = new Image(23,24);
        tgo2.src = tooldir + "go.gif";

        tadvsearch1 = new Image(95,24);
        tadvsearch1.src = tooldir + "advsearch1.gif";
        tadvsearch2 = new Image(95,24);
        tadvsearch2.src = tooldir + "advsearch.gif";
 }

    // simple image replacement

    function swapImg(imgDocID,imgObjName){ 
//	window.alert(imgDocID);
//	window.alert(imgObjName);	
//window.alert(eval(imgObjName + ".src"));		
	
	if (document.images){ 
        document.images[imgDocID].src = eval(imgObjName + ".src"); 
	   }
    }
	
	function ClearField (thefield) {
		thefield.value = "";
	}

	
    // functions to show and hide quotes in sidebar

    function showQuote(id){
        if (quote = document.getElementById(id))
        {
            //quote.style.top = document.body.scrollTop + 200;
            quote.style.top = document.body.scrollTop + (document.body.clientHeight / 2) - 100;			
            //quote.style.left = document.body.clientWidth - 187;
            quote.style.visibility = "visible";
        }
    }

    function hideQuote(id)
    {
        if (quote = document.getElementById(id))
        {
            quote.style.visibility = "hidden";
        }
    }	