




function NavTab(URL, ImgOn, ImgOnWidth, ImgOnHeight, ImgOff, ImgOffWidth, ImgOffHeight, ALT, base) {	
	this.imgOn = new MCImage(relative(ImgOn, base), ImgOnWidth, ImgOnHeight);
	this.imgOff = new MCImage(relative(ImgOff, base), ImgOffWidth, ImgOffHeight);
	this.hasImage = (ImgOff.length > 0)?true:false;
	this.key = URL;
	this.url = relative(URL, base);
	this.alt = ALT;
	this.inPath = false;
	this.subnav = new Array();	
}

function MCImage(s, w, h) {
	this.src = s;
	this.width = new Number(w);
	this.height = new Number(h);	
}

function NavLink(URL, Label, base) {
	this.label = Label;
	this.key = URL;
	this.url = relative(URL, base);
	this.inPath = false;
	this.subnav = new Array();	
}

function NavSystem() {
	this.nPrimary = null;
	this.nSecondary = null;
	this.nTertiary = null;
	this.baseURL = "";
	this.subnav = new Array();
}		

function writeNavTabs() {
	var navObj = getNavObject(this.baseURL, this);
	baseURLTokens = this.baseURL.split("/");
	
	if (navObj) navObj.url = baseURLTokens[baseURLTokens.length-1];
							
	function getNavObject(key, base) {
		var i; 
		var myKey = key;
		var myBase = base;
		var myObj = null;
		for (i=0; i < myBase.subnav.length; i++) {		
			if (myKey == myBase.subnav[i] || myKey == myBase.subnav[i] + "index.html") {
				setNavPath(myBase.subnav[i].item);
			 	return myBase.subnav[i].item;
			} 
			if (myBase.subnav[i].item.subnav.length) {
				myObj = getNavObject(myKey, myBase.subnav[i].item)
				if (myObj != null) {
					setNavPath(myObj);
					return myObj;
				}
			}					
		}
	}
	
	function setNavPath($obj) {
		var obj = $obj;
		obj.inPath = true;
		if (obj.parent) setNavPath(obj.parent);
	}			
	
	document.write("<table border='0' cellpadding='0' cellspacing='0'>");
	document.write("<tr>");
	var selectedTabIdx;

	// Primary Navigation Tabs	

	var wp = new Array();
	var wpi = new Array();	

	for (i=0; i < this.subnav.length; i++) {
		if (this.subnav[i].item.inPath) {		
			if (this.subnav[i].item.hasImage) document.write("<td><a href='" + this.subnav[i].item.url + "'><img src='" + this.subnav[i].item.imgOn.src + "' alt='" + this.subnav[i].item.alt + "' width='" + this.subnav[i].item.imgOn.width + "' height='" + this.subnav[i].item.imgOn.height + "' border='0'></a></td>");	
						//if (this.subnav[i].item.hasImage) document.write("<td><a href='" + this.subnav[i].item.url + "' onClick='javascript:setCurrentTab(" + i + ");'" + "><img src='" + this.subnav[i].item.imgOn.src + "' alt='" + this.subnav[i].item.alt + "' width='" + this.subnav[i].item.imgOn.width + "' height='" + this.subnav[i].item.imgOn.height + "' border='0'></a></td>");
						this.nPrimary = this.subnav[i].item;
						this.nPrimaryIMG = this.subnav[i].item.url;
						wpi[i] = this.subnav[i].item.url;
						wp[i] = this.subnav[i].item.imgOn.width;
						wsstag_category = this.subnav[i].item.alt;	
			selectedTabIdx = i;
		} else {
			if (this.subnav[i].item.hasImage) document.write("<td><a href='" + this.subnav[i].item.url + "'><img src='" + this.subnav[i].item.imgOff.src + "' alt='" + this.subnav[i].item.alt + "' width='" + this.subnav[i].item.imgOff.width + "' height='" + this.subnav[i].item.imgOff.height + "' border='0'></a></td>");	
			//if (this.subnav[i].item.hasImage) document.write("<td><a href='" + this.subnav[i].item.url + "' onClick='javascript:setCurrentTab(" + i + ");'" + "><img src='" + this.subnav[i].item.imgOff.src + "' alt='" + this.subnav[i].item.alt + "' width='" + this.subnav[i].item.imgOff.width + "' height='" + this.subnav[i].item.imgOff.height + "' border='0'></a></td>");
						this.nPrimaryIMG = this.subnav[i].item.url;
						wpi[i] = this.subnav[i].item.url;
			wp[i] = this.subnav[i].item.imgOn.width;
		}				
	}
	
	document.write("<td width='100%' background='" + relative("/it/images/nav_rule.gif", this.baseURL) + "'><img src='" + relative("/it/images/nav_rule.gif", this.baseURL) + "' alt='rule' width='100%' height='16' border='0'></td>");
	document.write("</tr>");
	document.write("</table>");
	
	document.write("<table width='100%' border='0' cellpadding='0' cellspacing='0' bgcolor='#FFFFFF'>");
	document.write("<tr>");	
	
	// Secondary Navigation Tabs			
	if (this.nPrimary && this.nPrimary.subnav.length) {
		var L = 0;
		for (i=0; i < this.nPrimary.subnav.length; i++) {
			L += this.nPrimary.subnav[i].item.imgOff.width;
		}
				
				var secondNavTabWidth = (L/2);
				var currentPrimaryTabWidth = getWidth(selectedTabIdx,wp);

		
//		document.write("<td><img src='" + this.spacer.src + "' width='" + (((2*this.nPrimary.index+1)*this.subnav[this.nPrimary.index].item.imgOff.width-L)/2) + "' height='26' alt='' border='0'></td>");
	
			if ((currentPrimaryTabWidth - secondNavTabWidth) != -1 ) {
				document.write("<td><img src='" + this.spacer.src + "' width='" + (currentPrimaryTabWidth - secondNavTabWidth) + "' height='26' alt='' border='0'></td>");
			}
			else {
				if (( currentPrimaryTabWidth - secondNavTabWidth ) > window.screen.availWidth) {
				document.write("<td><img src='" + this.spacer.src + "' width='" + (window.screen.availWidth - (secondNavTabWidth*2)) + "' height='26' alt='' border='0'></td>");
			}}

	
        if (this.nPrimary.subnav[0].item.hasImage)
            document.write("<td><img src='" + relative("/it/images/nav_sub_left-border.gif", this.baseURL) + "' width='1' height='16' border='0' alt=''></td>");

		for (i=0; i < this.nPrimary.subnav.length; i++) {
			if (this.nPrimary.subnav[i].item.inPath) {
				if (this.nPrimary.subnav[i].item.hasImage) document.write("<td><img src='" + this.nPrimary.subnav[i].item.imgOn.src + "' width='" + this.nPrimary.subnav[i].item.imgOn.width + "' height='" + this.nPrimary.subnav[i].item.imgOn.height + "' alt='" + this.nPrimary.subnav[i].item.alt + "' border='0'></td>");
				this.nSecondary = this.nPrimary.subnav[i].item;
			} else {
				if (this.nPrimary.subnav[i].item.hasImage) document.write("<td><a href='" + this.nPrimary.subnav[i].item.url + "'><img src='" + this.nPrimary.subnav[i].item.imgOff.src + "' width='" + this.nPrimary.subnav[i].item.imgOff.width + "' height='" + this.nPrimary.subnav[i].item.imgOff.height + "' alt='" + this.nPrimary.subnav[i].item.alt + "' border='0'></a></td>");	
			}				
		}
	
		document.write("<td width='100%'>&nbsp;</td>");
		document.write("</tr>");
		document.write("<tr>");
		document.write("<td width='100%' bgcolor='#FFFFFF' colspan='" + (this.nPrimary.subnav.length + 3) + "'><img src='" + this.spacer.src + "' width='1' height='26' alt='' border='0'></td>");
		document.write("</tr>");
		
	} else {
		document.write("<td width='100%' bgcolor='#FFFFFF'><img src='" + this.spacer.src + "' width='1' height='26' alt='' border='0'></td>");
		document.write("</tr>");
	}
	
	document.write("</table>");
	document.write("</td>");
	document.write("</tr>");
	document.write("<tr>");
	document.write("<td bgcolor='#FFFFFF' valign='top'>");
}

function writeSubNav() {
	if (this.nSecondary && this.nSecondary.subnav.length) {
		document.write("<table border='0' cellspacing='0' cellpadding='0' width='200'>");
		document.write("<tr>");
		document.write("<td rowspan='100%'><img src='" + this.spacer.src + "' width='25' height='1' alt='' border='0'/></td>");
		document.write("<td><img src='" + this.spacer.src + "' width='15' height='15' alt='' border='0'/></td>");
		document.write("<td width='100%'><img src='" + this.spacer.src + "' width='1' height='1' alt='' border='0'/></td>");
		document.write("<td rowspan='100%'><img src='" + this.spacer.src + "' width='15' height='1' alt='' border='0'/></td>");
		document.write("</tr>");
		for (i=0; i < this.nSecondary.subnav.length; i++) {
			if (this.nSecondary.subnav[i].item.inPath) {
				this.nTertiary = this.nSecondary.subnav[i].item;
				document.write("<tr>");
				document.write("<td valign='top'><img src='/it/images/arrow_down.gif' width='13' height='8' alt='' border='0' vspace='3'></td>");
				document.write("<td>");
				document.write("<a href='" + this.nSecondary.subnav[i].item.url + "' class='linkselected'>" + this.nSecondary.subnav[i].item.label + "</a>");
				if (this.nTertiary.subnav.length) {
					for (j=0; j < this.nTertiary.subnav.length; j++) {
						document.write("<br /><img src='/it/images/arrow_right_small.gif' width='9' height='7' alt='' border='0'><a href='" + this.nTertiary.subnav[j].item.url + "' class='linksmall'>" + this.nTertiary.subnav[j].item.label + "</a>");
					}
				}
				document.write("</td>");
				document.write("</tr>");
			} else {
				document.write("<tr>");
				document.write("<td valign='top'><img src='/it/images/arrow_right_large.gif' width='6' height='11' alt='' border='0' hspace='3' vspace='3'></td>");
				document.write("<td><a href='" + this.nSecondary.subnav[i].item.url + "' class='link'>" + this.nSecondary.subnav[i].item.label + "</a></td>");
				document.write("</tr>");
			}
			document.write("<tr>");
			document.write("<td colspan='2'><img src='" + this.spacer.src + "' width='1' height='3' alt='' border='0'></td>");
			document.write("</tr>");		
		}
		document.write("<tr>");
		document.write("<td colspan='2'><img src='" + this.spacer.src + "' width='1' height='20' alt='' border='0'></td>");
		document.write("</tr>");
		document.write("</table>");
	}
}

function writeFooterLinks() {
	var home = this.subnav[0].item;
	for (i=0; i<home.subnav.length; i++) {
		document.write("<a href='" + home.subnav[i].item.url + "' class='globalHeaderLinks'>" + home.subnav[i].item.alt + "</a>");
		if (i != home.subnav.length-1) document.write(" | ");
	}	
}

function getCookie(name) {
	var allcookies = document.cookie;
	var pos = allcookies.indexOf(name+"=");
	var value = "";
	if (pos != -1) {
		var start = pos + name.length + 1;
		var end = allcookies.indexOf(";", start);
		if (end == -1) end = allcookies.length;
		var value = allcookies.substring(start, end);
		value = unescape(value);
	}
	return value;
}

function setCookie(name, value) {
	var nextyear = new Date();
	nextyear.setFullYear(nextyear.getFullYear() + 1);
	
	var sCookie = name + "=" + escape(value);
	sCookie += "; expires=" + nextyear.toGMTString();
	sCookie += "; path=/";
	//sCookie += "; domain=mastercard.com";
	
	document.cookie = sCookie;
}

function deleteCookie(name) {
	var lastyear = new Date();
	lastyear.setFullYear(lastyear.getFullYear() - 1);
	
	document.cookie = name + "=; expires=" + lastyear.toGMTString();
}

function pop(url) {
var h = 540; // height of the window
	var w = 410; // width of the window
	var winleft = 75;
  	var wintop = 125;
	if(parseInt(navigator.appVersion)>=4) {
		winleft = (screen.width-w)/2;
		wintop = (screen.height-h)/2;
	}
	settings='height=' + h + ',width=' + w + ',top=' + wintop + ',left=' + winleft + ',scrollbars=yes,toolbar=no,location=no,status=no,menubar=no,resizable=yes,dependent=no'
	window.open(url,"PopUp",settings);
	return void(null);

}

function relative(resourceURL, locationURL) {
	var relativePath = "";
	
	if ((resourceURL.indexOf("http://") == 0)||(resourceURL.indexOf("https://") == 0)) {
		relativePath = 'javascript:pop("' + resourceURL + '")';
		return relativePath;
	}
	
	aResource = resourceURL.substring(1, resourceURL.length).split("/");
	aLocation = locationURL.substring(1, locationURL.length).split("/");

	// first, remove anything in either path that is common
	var start = 0;
	
	for (m=0; m<aResource.length; m++) {
		if (m <= aLocation.length && aResource[m] != aLocation[m]) {
			start = m;			
			break;					
		}
	}
	
	aResource = aResource.slice(start, aResource.length);
	aLocation = aLocation.slice(start, aLocation.length);
	
	// then, get the relativePathative path from locationURL to the root
	var n = 0;
	while (n < aLocation.length-1) {
		relativePath += "../";
		n++;		
	}

	// lastly, add each remaining element of the resource path to the relativePath path.
	for (p=0; p<aResource.length; p++) {
		relativePath = (p==aResource.length-1)?relativePath + aResource[p]:relativePath + aResource[p] + "/";
	}

	return relativePath;
}

function addNavSystemObject(obj) {
	index = this.subnav.length;
	key = this.subnav[index] = new String(obj.key);
	key.item = obj;
	key.item.index = index;
	return key.item;
}

function addNavTabObject(obj) {
	index = this.subnav.length;
	key = this.subnav[index] = new String(obj.key);
	obj.parent = this;
	//if(!obj.hasImage) this.imgOn = this.imgOff;
	key.item = obj;
	return key.item;
}

function addNavLinkObject(obj) {
	index = this.subnav.length;
	key = this.subnav[index] = new String(obj.key);
	obj.parent = this;
	key.item = obj;
	return key.item;
}

function setBaseURL(URL) {
	this.baseURL = URL;
	glbBaseURL = URL;
	this.spacer = new Image();
	this.spacer.src = relative("/it/images/spacer.gif", this.baseURL);
		



	
			
			
			navL1 = this.add(new NavTab("/it/index.html","/it/images/nav/home_on.gif","113","16","/it/images/nav/home_off.gif","113","16","Home", this.baseURL));

			


				


						navL2 = navL1.add(new NavTab("/it/general/privacy_policy.html  ","","","","","","","Privacy Policy", this.baseURL));
							
								
						navL3 = navL2.add(new NavLink("/it/general/privacy_print.html","Versione stampabile", this.baseURL));			
											
								
							
					
			


				


						navL2 = navL1.add(new NavTab("http://www.mastercard.com/us/company/en/general/copyright.html","","","","","","","Copyright", this.baseURL));
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/general/chi_siamo.html","","","","","","","Chi siamo", this.baseURL));
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/general/contact_us.html","","","","","","","Contattaci", this.baseURL));
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/general/sitemap.html","","","","","","","Mappa del Sito", this.baseURL));
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/education/shoppingtips.html","","","","","","","Consigli Utili", this.baseURL));
							
					
			
		



	
			
			
			navL1 = this.add(new NavTab("/it/findacard/index.html","/it/images/nav/ourcards_on.gif","114","16","/it/images/nav/ourcards_off.gif","114","16","Le Carte MasterCard", this.baseURL));

			


				


						navL2 = navL1.add(new NavTab("/it/findacard/classic_card.html","/it/images/nav/ourcards_classic_on.gif","77","17","/it/images/nav/ourcards_classic_off.gif","77","17","Carta Classic", this.baseURL));
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/findacard/gold_card.html","/it/images/nav/ourcards_gold_on.gif","71","17","/it/images/nav/ourcards_gold_off.gif","71","17","Carta Gold", this.baseURL));
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/findacard/platinum_card.html","/it/images/nav/ourcards_platinum_on.gif","87","17","/it/images/nav/ourcards_platinum_off.gif","87","17","Carta Platinum", this.baseURL));
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/findacard/scopri_card.html","/it/images/nav/ourcards_scopri_on.gif","153","17","/it/images/nav/ourcards_scopri_off.gif","153","17","Scropi la Carta giusta per Te", this.baseURL));
							
					
			
		



	
			
			
			navL1 = this.add(new NavTab("/it/cardholderservices/index.html","/it/images/nav/cardholderservices_on.gif","113","16","/it/images/nav/cardholderservices_off.gif","113","16","Assistenza Titolari", this.baseURL));

			


				


						navL2 = navL1.add(new NavTab("http://www.mastercard.com/atmlocator/cobrand/index.jsp?lang=en&country=ITA&var=COBRAND","/it/images/nav/cardholderservices_come_on.gif","129","19","/it/images/nav/cardholderservices_come_off.gif","129","19","Come e Dove Prelevare", this.baseURL));
							
								
						navL3 = navL2.add(new NavLink("/it/cardholderservices/atm/atm_country_template.html","ATM Country Template", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/cardholderservices/atm/atm_map_template.html","ATM Map Template", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/cardholderservices/atm/results.html","ATM Results", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/cardholderservices/atm/tips.html","ATM Tips", this.baseURL));			
											
								
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/personal/it/cardholderservices/emergencyservices/index.html","/it/images/nav/cardholderservices_assistan_on.gif","124","19","/it/images/nav/cardholderservices_assistan_off.gif","124","19","Assitenza nel Mondo", this.baseURL));
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/cardholderservices/segnalazioni_ed_assistenza/index.html","/it/images/nav/cardholderservices_segn_on.gif","146","19","/it/images/nav/cardholderservices_segn_off.gif","146","19","Segnalazioni ed Assitenza", this.baseURL));
							
					
			
		



	
			
			
			navL1 = this.add(new NavTab("/it/education/index.html","/it/images/nav/education_on.gif","112","16","/it/images/nav/education_off.gif","112","16","Informazioni Utili", this.baseURL));

			


				


						navL2 = navL1.add(new NavTab("/it/education/revolving.html","/it/images/nav/education_revolving_on.gif","106","17","/it/images/nav/education_revolving_off.gif","106","17","Servizio Revolving", this.baseURL));
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/education/shoppingtips.html","/it/images/nav/education_shoppingtips_on.gif","79","17","/it/images/nav/education_shoppingtips_off.gif","79","17","Consigli Utili", this.baseURL));
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/education/using.html","/it/images/nav/education_using_on.gif","91","17","/it/images/nav/education_using_off.gif","91","17","Utilizza la Carta", this.baseURL));
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/education/fraud.html","/it/images/nav/education_richiedi_on.gif","134","17","/it/images/nav/education_richiedi_off.gif","134","17","Richiedi e Attiva la Carta", this.baseURL));
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/education/glossary.html","/it/images/nav/education_glossary_on.gif","64","17","/it/images/nav/education_glossary_off.gif","64","17","Glossario", this.baseURL));
							
					
			
		



	
			
			
			navL1 = this.add(new NavTab("http://www.mastercard.com/football/ucl/it/","/it/images/nav/cleague_on.gif","139","16","/it/images/nav/cleague_off.gif","139","16","Champions League", this.baseURL));

			
		



	
			
			
			navL1 = this.add(new NavTab("/it/promotion/index.html","/it/images/nav/tuttiigiorni_on.gif","113","16","/it/images/nav/tuttiigiorni_off.gif","113","16","Promozione tutti i giorni", this.baseURL));

			


				


						navL2 = navL1.add(new NavTab("/it/promotion/h3g.html","/it/images/nav/h3g_on.gif","71","17","/it/images/nav/h3g_off.gif","71","17","3", this.baseURL));
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/store3.html","negozi", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/regolamento.html","regolamento", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/premi.html","premi", this.baseURL));			
											
								
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/promotion/fidenza.html","/it/images/nav/fidenza_on.gif","95","17","/it/images/nav/fidenza_off.gif","95","17","Fidenza Village", this.baseURL));
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/fidenza_trovarci.html","fidenza", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/fidenza_winter.html","fidenza", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/fidenza_winterReg.html","fidenza", this.baseURL));			
											
								
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/promotion/autostrade.html","/it/images/nav/autostrade_on.gif","70","17","/it/images/nav/autostrade_off.gif","70","17","Autostrade", this.baseURL));
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/autostrade_vantaggi.html","Autostrade", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/autostrade_punti.html","Autostrade", this.baseURL));			
											
								
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/promotion/cinemaHp.html","/it/images/nav/cinema_on.gif","60","17","/it/images/nav/cinema_off.gif","60","17","Cinema", this.baseURL));
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/cinema_regolamento.html","Cinema", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/cinema_ricerca.html","Cinema", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/cinema_vantaggi.html","Cinema", this.baseURL));			
											
								
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/promotion/blockbusterHp.html","/it/images/nav/block_on.gif","70","17","/it/images/nav/block_off.gif","70","17","Blockbuster", this.baseURL));
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/blockbuster_reg.html","Blockbuster", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/blockbuster_store.html","Blockbuster", this.baseURL));			
											
								
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/promotion/mcarthurHp.html","/it/images/nav/mcarthur_on.gif","79","17","/it/images/nav/mcarthur_off.gif","79","17","McArthur", this.baseURL));
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/mcarthur_reg.html","McArthur", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/mcarthur_premi.html","McArthur", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/mcarthur_negozi.html","McArthur", this.baseURL));			
											
								
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/promotion/auchanHp.html","/it/images/nav/auchan_on.gif","70","17","/it/images/nav/auchan_off.gif","70","17","Auchan", this.baseURL));
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/auchan_premi.html","Auchan", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/auchan_reg.html","Auchan", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/auchan_store.html","Auchan", this.baseURL));			
											
								
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/promotion/levisHp.html","/it/images/nav/levis_on.gif","70","17","/it/images/nav/levis_off.gif","70","17","Levi's", this.baseURL));
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/levisHp.html","Levi's", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/levis_premi.html","Levi's", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/levis_reg.html","Levi's", this.baseURL));			
											
								
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/levis_store.html","Levi's", this.baseURL));			
											
								
							
					
			


				


						navL2 = navL1.add(new NavTab("/it/promotion/centriComm_reg.html","/it/images/nav/centri_on.gif","94","17","/it/images/nav/centri_off.gif","94","17","Promozione Centri Commerciali", this.baseURL));
							
								
						navL3 = navL2.add(new NavLink("/it/promotion/centriComm_reg.html","Promozione Centri Commerciali", this.baseURL));			
											
								
						navL4 = navL3.add(new NavLink("/it/promotion/centriComm_reg.html","Promozione Centri Commerciali", this.baseURL));			
								
							
					
			
		



	
			
			
			navL1 = this.add(new NavTab("/it/premiumoffers/index.html","/it/images/nav/premium_on.gif","130","16","/it/images/nav/premium_off.gif","130","16","Premium Collection", this.baseURL));

			


				


						navL2 = navL1.add(new NavTab("/it/premiumoffers/index.html","/it/images/nav/premium_on.gif","130","16","/it/images/nav/premium_off.gif","130","16","Premium Collection", this.baseURL));
							
					
			
		

}

NavSystem.prototype.setBaseURL = setBaseURL;
NavSystem.prototype.writeNavTabs = writeNavTabs;
NavSystem.prototype.writeSubNav = writeSubNav;
NavSystem.prototype.writeFooterLinks = writeFooterLinks;
NavSystem.prototype.add = addNavSystemObject;
NavTab.prototype.add = addNavTabObject;
NavLink.prototype.add = addNavLinkObject;

function getTabNumber(selectedTabUrl, tabUrls) {
	alert("Selected Tab Url: " +selectedTabUrl);
	
	for(m=0; m < tabNames.length; m++) {
	alert("Current Loop Tab Url: " +tabUrls[m]);
		if (selectedTabUrl == tabUrls[m])  {
//			wpt += (wp[m]/2);
			alert("M " +m);
			return m;
//			document.write("<td><img src='" + this.spacer.src + "' width='" + (wpt-b) + "' height='26' alt='' border='0'></td>");	
		}
	}
}	





// this function is called whenever a tab is clicked in order to obtain the index of the selected tab
function setCurrentTab(tabIdx) {
    this.selectedTabIdx = tabIdx;
    //alert("tabIndex: " + tabIdx);
//    alert("tabIndex: " + this.selectedTabIdx);
}


// obtain the width for the currently selected tab
function getWidth(tabIdx,wp) {

   var width = wp[tabIdx]/2;
//   alert("last tab width: " + width);
   
   if( tabIdx > 0 ) {
      for( var i=0; i < tabIdx; i++ ) {
         width = width + wp[i];
//         alert("width + tabIdx(" + i + "): " + width);
      }
   }
   
   return width;   
}



var nav = new NavSystem();



