// setup ids and images 

rollovers = new Rollovers([
/* use the below commented code when site is live 
	
	["tabHome", "/img/mainmenu_items/home_on1.jpg"],
	["tabHis", "/img/mainmenu_items/his_on1.jpg"],
	["tabHers", "/img/mainmenu_items/hers_on1.jpg"],
	["tabSports", "/img/mainmenu_items/sports_on1.jpg"],
	["tabSale", "/img/mainmenu_items/sale_on1.jpg"],
	["tabOffice", "/img/mainmenu_items/myoffice_on1.jpg"],
	["tabContact", "/img/mainmenu_items/contactus_on1.jpg"],
	["tabBasket", "/img/mainmenu_items/mybasket_on1.jpg"],
	["tabWish", "/img/mainmenu_items/wishlist_on1.gif"],
	["tabParty", "/img/mainmenu_items/discount_on.jpg"],	
	["tabAcc", "/img/mainmenu_items/accesories_on1.jpg"],	
	
	["tabAffiliates", "/img/mainmenu_items/affiliates_on1.gif"],
	["tabSmap", "/img/mainmenu_items/sitemap_on.gif"],
	["tabAbout", "/img/mainmenu_items/about_on.gif"],
	["tabFind", "/img/mainmenu_items/find_on.gif"],
	["tabNews", "/img/mainmenu_items/news_on.gif"],
	["tabBlog", "/img/mainmenu_items/blog_on.gif"],
	["tabCareers", "/img/mainmenu_items/careers_on.gif"],
	["tabFaqs", "/img/mainmenu_items/faqs_on.gif"],
	["tabTerms", "/img/mainmenu_items/terms_on.gif"],
	["tabPrivacy", "/img/mainmenu_items/privacy_on.gif"],

		
	// Poste sub menus 
	["subSmartPoste", "/img/submenu_items/poste_smart_on.gif"],	
	["subContemporaryPoste", "/img/submenu_items/poste_contem_on.gif"],	
	["subBootsPoste", "/img/submenu_items/poste_boots_on.gif"],	
	["subCasualPoste", "/img/submenu_items/poste_casual_on.gif"],
	["subHighTrendPoste", "/img/submenu_items/poste_hightrend_on.gif"],		
	["subSandalsPoste", "/img/submenu_items/poste_sandails_on.gif"],	
	["subSportPoste", "/img/submenu_items/poste_sports_on.gif"],
	["subchildPoste", "/img/submenu_items/poste_childrens_on.gif"],	
	["subHersChildrens", "/img/submenu_items/childrensPink_on.gif"],	
	["subPmistressPoste", "/img/submenu_items/poste_poste_on.gif"],
	["subAllPoste", "/img/submenu_items/poste_all_on.gif"],
	["subAllPoste", "/img/submenu_items/poste_sale_on.gif"],
	["subNewInPoste", "/img/submenu_items/poste_newin_on.gif"],
	["subWelliesPoste", "/img/submenu_items/poste_wellies_on.gif"],
	["subEspadrillesPoste", "/img/submenu_items/poste_espadrilles_on.gif"],

	]);
*/



	["tabHome", "/img/mainmenu_items/home_on1.jpg"],
	["tabHis", "/img/mainmenu_items/his_on1.jpg"],
	["tabHers", "/img/mainmenu_items/hers_on1.jpg"],
	["tabSports", "/img/mainmenu_items/sports_on1.jpg"],
	["tabSale", "/img/mainmenu_items/sale_on1.jpg"],
	["tabOffice", "/img/mainmenu_items/myoffice_on1.jpg"],
	["tabContact", "/img/mainmenu_items/contactus_on1.jpg"],
	["tabBasket", "/img/mainmenu_items/mybasket_on1.jpg"],
	["tabWish", "/img/mainmenu_items/wishlist_on1.gif"],
	["tabParty", "/img/mainmenu_items/discount_on.jpg"],	
	["tabAcc", "/img/mainmenu_items/accesories_on1.jpg"],	
	
	["tabAffiliates", "/img/mainmenu_items/affiliates_on1.gif"],
	["tabSmap", "/img/mainmenu_items/sitemap_on.gif"],
	["tabAbout", "/img/mainmenu_items/about_on.gif"],
	["tabFind", "/img/mainmenu_items/find_on.gif"],
	["tabNews", "/img/mainmenu_items/news_on.gif"],
	["tabBlog", "/img/mainmenu_items/blog_on.gif"],
	["tabCareers", "/img/mainmenu_items/careers_on.gif"],
	["tabFaqs", "/img/mainmenu_items/faqs_on.gif"],
	["tabTerms", "/img/mainmenu_items/terms_on.gif"],
	["tabPrivacy", "/img/mainmenu_items/privacy_on.gif"],
	
			
	// Poste sub menus 
	["subSmartPoste", "/img/submenu_items/poste_smart_on.gif"],	
	["subContemporaryPoste", "/img/submenu_items/poste_contem_on.gif"],	
	["subBootsPoste", "/img/submenu_items/poste_boots_on.gif"],	
	["subCasualPoste", "/img/submenu_items/poste_casual_on.gif"],
	["subHighTrendPoste", "/img/submenu_items/poste_hightrend_on.gif"],	
	["subSandalsPoste", "/img/submenu_items/poste_sandails_on.gif"],	
	["subSportPoste", "/img/submenu_items/poste_sports_on.gif"],	
	["subchildPoste", "/img/submenu_items/poste_childrens_on.gif"],		
	["subPmistressPoste", "/img/submenu_items/poste_poste_on.gif"],
	["subAllPoste", "/img/submenu_items/poste_all_on.gif"],
	["subPosteClearance", "/img/submenu_items/poste_clearance_on.gif"],
	["subPosteSale", "/img/submenu_items/poste_sale_on.gif"],
	["subNewInPoste", "/img/submenu_items/poste_newin_on.gif"],
	["subWelliesPoste", "/img/submenu_items/poste_wellies_on.gif"],
	["subEspadrillesPoste", "/img/submenu_items/poste_espadrilles_on.gif"]

	]);

 




function Rollovers_swap(id){ // id to swap in an image, null to swap out
	if (id != null)
	{	
		var image = document.images[id]
		if (image == null) return
	
		var newimage = this.images[id]
		if (newimage == null) return
		
		this.temp_img = image
		this.temp_src = image.src
		
		image.src = newimage.src
	}
	else
	{
		if ((this.temp_img != null) && (this.temp_src != null))
			this.temp_img.src = this.temp_src
			
		this.temp_img = null
		this.temp_src = null
	}
}
	
function Rollovers(image_list){
	this.images = new Object()		// Storage for swap-in images
	this.load = Rollovers_Install
	this.swap = Rollovers_swap	
	// Storage for the current swap-out image
	this.temp_img = null
	this.temp_src = null
	for (var i=0; i < image_list.length; i++) {
		var id = image_list[i][0]
		var src = image_list[i][1]
		
		var image = new Image()
		image.src = src
		this.images[id] = image
	}
}

function Rollovers_Install() {	// Should be called after page is loaded
	var _this = this
	var swap_out = function(){_this.swap(null);}

	var set = function (id){
		var image = document.images[id]
		if (image == null) return
		image.onmouseover = function(){_this.swap(id);}
		image.onmouseout = swap_out
	}
	
	for(var id in this.images) set(id);
}
