//this highlights the topnav link, which is set in the body tag
var currentpage = "none";
	
	function setPage(pagename){
		if (document.images[currentpage]){
			document.images[currentpage].src = eval(currentpage).src;
		}
			if (pagename != 'none' && document.images[pagename]){
				document.images[pagename].src = eval(pagename+"on").src;
			}
			currentpage = pagename;
		}
		
//this preloads all the images
if (document.images) {
		
		nav_shop_off= new Image;
     	nav_shop_off.src="images/nav_shop_off.jpg";
		nav_shop_on= new Image;
     	nav_shop_on.src="images/nav_shop_on.jpg";
		
		/* nav_products_off= new Image;
     	nav_products_off.src="images/nav_products_off.jpg";
		nav_products_on= new Image;
     	nav_products_on.src="images/nav_products_on.jpg"; */
		
		nav_recipes_off= new Image;
     	nav_recipes_off.src="images/nav_recipes_off.jpg";
		nav_recipes_on= new Image;
     	nav_recipes_on.src="images/nav_recipes_on.jpg";
		
		nav_contact_off= new Image;
     	nav_contact_off.src="images/nav_contact_off.jpg";
		nav_contact_on= new Image;
     	nav_contact_on.src="images/nav_contact_on.jpg";
		
		tab_shop_off= new Image;
     	tab_shop_off.src="images/tab_shop_off.gif";
		tab_shop_on= new Image;
     	tab_shop_on.src="images/tab_shop_on.gif";
		
		nav_stores_off= new Image;
     	nav_stores_off.src="images/nav_stores_off.jpg";
		nav_stores_on= new Image;
     	nav_stores_on.src="images/nav_stores_on.jpg";
		
		/* tab_products_off= new Image;
     	tab_products_off.src="images/tab_products_off.gif";
		tab_products_on= new Image;
     	tab_products_on.src="images/tab_products_on.gif"; */
		
		tab_recipes_off= new Image;
     	tab_recipes_off.src="images/tab_recipes_off.gif";
		tab_recipes_on= new Image;
     	tab_recipes_on.src="images/tab_recipes_on.gif";
		
		tab_contact_off= new Image;
     	tab_contact_off.src="images/tab_contact_off.gif";
		tab_contact_on= new Image;
     	tab_contact_on.src="images/tab_contact_on.gif";
		
		tab_checkout_off= new Image;
     	tab_checkout_off.src="images/tab_checkout_off.gif";
		tab_checkout_on= new Image;
     	tab_checkout_on.src="images/tab_checkout_on.gif";
		
		tab_stores_off= new Image;
     	tab_stores_off.src="images/tab_stores_off.gif";
		tab_stores_on= new Image;
     	tab_stores_on.src="images/tab_stores_on.gif";
		
  }
 
 //rollover function for single images
 function rollImage(imagename,imageloc){
		if (currentpage != imageloc){
			document.images[imageloc].src = imagename.src;
		}
	}

function openAWindow( pageToLoad, winName, width, height, center) {  
	xposition=250; yposition=50;

    if ((parseInt(navigator.appVersion) >= 4 ) && (winName=="undefined")){
    xposition=screen.width-400; yposition=screen.height-480;
    }
    args = "width=" + width + "," 
    + "height=" + height + "," 
    + "location=0," 
    + "menubar=0,"
    + "resizable=0,"
    + "scrollbars=1,"
    + "status=0," 
    + "titlebar=0,"
    + "toolbar=0,"
    + "hotkeys=0,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only

    window.open( pageToLoad,winName,args );
	}
	
