
enNav = {
	topNav : ["Watch","Products","Support","Buy"],
	topNavURL : ["http://watch.slingbox.com","http://www.slingbox.com/go/products","http://support.slingbox.com/go/home","http://www.slingbox.com/go/buy"],
 	subNode1 : ["Slingbox Directory_us", "Slingbox Setup"],
	subNodeURL1 : ["http://sling.com/sling_player/directory", "http://setup.slingbox.com/"],
	subNode2 : ["Slingbox", "SlingPlayer", "Accessories"],
	subNodeURL2 : ["http://www.slingbox.com/go/slingbox", "http://www.slingbox.com/go/slingplayer", "http://www.slingbox.com/go/accessories"],
	subNode3 : ["FAQ", "Set Up Help", "Internet Viewing Help", "Player Help", "Downloads", "Forums"],
	subNodeURL3 : ["/go/faq", "/go/set-up", "/go/internet-viewing", "/go/slingplayer-help", "/go/downloads", "http://answers.slingbox.com"]
};

inNav = {
	topNav : ["Watch","Products","Support","Buy"],
	topNavURL : ["http://watch.slingbox.com","http://in.slingbox.com/go/products","http://support-in.slingbox.com/go/home","http://in.slingbox.com/go/buy"],
 	subNode1 : ["Slingbox Directory_us", "Slingbox Setup"],
	subNodeURL1 : ["http://sling.com/sling_player/directory", "http://setup.slingbox.com/"],
	subNode2 : ["Slingbox", "SlingPlayer Mobile", "Accessories"],
	subNodeURL2 : ["http://in.slingbox.com/go/slingbox", "http://in.slingbox.com/go/spm", "http://in.slingbox.com/go/accessories"],
	subNode3 : ["FAQ", "Set Up Help", "Internet Viewing Help", "Player Help", "Downloads", "Forums"],
	subNodeURL3 : ["http://support-in.slingbox.com/go/faq", "http://support-in.slingbox.com/go/set-up", "http://support-in.slingbox.com/go/internet-viewing", "http://support-in.slingbox.com/go/slingplayer-help", "http://support-in.slingbox.com/go/downloads", "http://answers.slingbox.com"]
};

ukNav = {
	topNav : ["Watch","Products","Support"],
	topNavURL : ["http://watch.slingbox.com","http://uk.slingbox.com/go/products","http://support.slingbox.com/go/home"],
 	subNode1 : ["Slingbox Directory_us", "Slingbox Setup"],
	subNodeURL1 : ["http://sling.com/sling_player/directory", "http://setup.slingbox.com/"],
	subNode2 : ["Slingbox", "SlingPlayer Mobile", "Accessories","Buy Now"],
	subNodeURL2 : ["http://uk.slingbox.com/go/slingbox", "http://uk.slingbox.com/go/spm", "http://uk.slingbox.com/go/accessories","http://uk.slingbox.com/go/buy"],
	subNode3 : ["FAQ", "Set Up Help", "Internet Viewing Help", "Player Help", "Downloads", "Forums"],
	subNodeURL3 : ["/go/faq", "/go/set-up", "/go/internet-viewing", "/go/slingplayer-help", "/go/downloads", "http://answers.slingbox.com"]
};

caNav = {
	topNav : ["Watch","Products","Support"],
	topNavURL : ["http://watch.slingbox.com","http://ca.slingbox.com/go/products","http://support.slingbox.com/go/home"],
 	subNode1 : ["Slingbox Directory_us", "Slingbox Setup"],
	subNodeURL1 : ["http://sling.com/sling_player/directory", "http://setup.slingbox.com/"],
	subNode2 : ["Slingbox", "SlingPlayer", "Accessories","Buy Now"],
	subNodeURL2 : ["http://ca.slingbox.com/go/slingbox", "http://ca.slingbox.com/go/slingplayer", 
"http://ca.slingbox.com/go/accessories","http://ca.slingbox.com/go/buy"],
	subNode3 : ["FAQ", "Set Up Help", "Internet Viewing Help", "Player Help", "Downloads", "Forums"],
	subNodeURL3 : ["/go/faq", "/go/set-up", "/go/internet-viewing", "/go/slingplayer-help", "/go/downloads", "http://answers.slingbox.com"]
};

frNav = {
	topNav : ["Regarder","Produits","Assistance"],
	topNavURL : ["http://watch.slingbox.com","http://fr.slingbox.com/go/products","http://support.slingbox.com/go/home"],
	subNode1 : [" Annuaire de Slingbox", "Installation de Slingbox"],
 	subNodeURL1 : ["http://sling.com/sling_player/directory", "http://setup.slingbox.com/"],
    	subNode2 : ["Slingbox", "SlingPlayer Mobile", "Accessoires","Acheter"],
   	subNodeURL2 : ["http://fr.slingbox.com/go/slingbox", "http://fr.slingbox.com/go/spm", "http://fr.slingbox.com/go/accessories","http://fr.slingbox.com/go/buy"],
	subNode3 : ["FAQ", "Set Up Help", "Internet Viewing Help", "Player Help", "Downloads", "Forums"],
	subNodeURL3 : ["/go/faq", "/go/set-up", "/go/internet-viewing", "/go/slingplayer-help", "/go/downloads", "http://answers.slingbox.com"]

};

esNav = {
	topNav : ["Mirar","Productos","Asistencia Tecnica"],
	topNavURL : ["http://watch.slingbox.com","http://es.slingbox.com/go/products","http://support.slingbox.com/go/home"],
	subNode1 : ["Directorio de Slingbox", "Disposición de Slingbox"],
	subNodeURL1 : ["http://sling.com/sling_player/directory", "http://setup.slingbox.com/"],
	subNode2 : ["Slingbox", "SlingPlayer Mobile", "Accesorios","Comprar ahora"],
	subNodeURL2 : ["http://es.slingbox.com/go/slingbox", "http://es.slingbox.com/go/spm", "http://es.slingbox.com/go/accessories","http://es.slingbox.com/go/buy"],
	subNode3 : ["FAQ", "Set Up Help", "Internet Viewing Help", "Player Help", "Downloads", "Forums"],
	subNodeURL3 : ["/go/faq", "/go/set-up", "/go/internet-viewing", "/go/slingplayer-help", "/go/downloads", "http://answers.slingbox.com"]

};

deNav = {
	topNav : ["Anschauen","Produkte","Support"],
	topNavURL : ["http://watch.slingbox.com","http://de.slingbox.com/go/products","http://support.slingbox.com/go/home"],
    	subNode1 : ["Slingbox Verzeichnis", "Slingbox Einstellung"],
	subNodeURL1 : ["http://sling.com/sling_player/directory", "http://setup.slingbox.com/"],
	subNode2 : ["Slingbox", "SlingPlayer Mobile", "Zubeh&#xF6;r","Jetzt kaufen"],
	subNodeURL2 : ["http://de.slingbox.com/go/slingbox", "http://de.slingbox.com/go/spm", "http://de.slingbox.com/go/accessories","http://de.slingbox.com/go/buy"],
	subNode3 : ["FAQ", "Set Up Help", "Internet Viewing Help", "Player Help", "Downloads", "Forums"],
	subNodeURL3 : ["/go/faq", "/go/set-up", "/go/internet-viewing", "/go/slingplayer-help", "/go/downloads", "http://answers.slingbox.com"]

};

itNav = {
	topNav : ["Vigilanza","Prodotti","Supporto"],
	topNavURL : ["http://watch.slingbox.com","http://it.slingbox.com/go/products","http://support.slingbox.com/go/home"],
	subNode1 : ["Indice di Slingbox", "Messa a punto di Slingbox"],
	subNodeURL1 : ["http://sling.com/sling_player/directory", "http://setup.slingbox.com/"],
	subNode2 : ["Slingbox", "SlingPlayer Mobile", "Accessori","Acquista ora"],
	subNodeURL2 : ["http://it.slingbox.com/go/slingbox", "http://it.slingbox.com/go/spm", "http://it.slingbox.com/go/accessories","http://it.slingbox.com/go/buy"],
	subNode3 : ["FAQ", "Set Up Help", "Internet Viewing Help", "Player Help", "Downloads", "Forums"],
	subNodeURL3 : ["/go/faq", "/go/set-up", "/go/internet-viewing", "/go/slingplayer-help", "/go/downloads", "http://answers.slingbox.com"]

};

nlNav = {
	topNav : ["Kijken","Producten","Help"],
	topNavURL : ["http://watch.slingbox.com","http://nl.slingbox.com/go/products","http://support.slingbox.com/go/home"],
    	subNode1 : ["De Folder van Slingbox", "De Opstelling van Slingbox"],
	subNodeURL1 : ["http://sling.com/sling_player/directory", "http://setup.slingbox.com/"],
	subNode2 : ["Slingbox", "SlingPlayer Mobile", "Accessoires","Koop nu"],
	subNodeURL2 : ["http://nl.slingbox.com/go/slingbox", "http://nl.slingbox.com/go/spm", "http://nl.slingbox.com/go/accessories","http://nl.slingbox.com/go/buy"],
	subNode3 : ["FAQ", "Set Up Help", "Internet Viewing Help", "Player Help", "Downloads", "Forums"],
	subNodeURL3 : ["/go/faq", "/go/set-up", "/go/internet-viewing", "/go/slingplayer-help", "/go/downloads", "http://answers.slingbox.com"]	

};

hkNav = {
	topNav : ["Watch","Products","Support","Buy"],
	topNavURL : ["http://watch.slingbox.com","http://hk.slingbox.com/go/products","http://support.slingbox.com/go/home","http://hk.slingbox.com/go/buy"],
 	subNode1 : ["Slingbox Directory_us", "Slingbox Setup"],
	subNodeURL1 : ["http://sling.com/sling_player/directory", "http://setup.slingbox.com/"],
	subNode2 : ["Slingbox", "SlingPlayer Mobile"],
	subNodeURL2 : ["http://hk.slingbox.com/go/slingbox-prohd", "http://hk.slingbox.com/go/spm"],
	subNode3 : ["FAQ", "Set Up Help", "Internet Viewing Help", "Player Help", "Downloads", "Forums"],
	subNodeURL3 : ["http://support.slingbox.com/go/faq", "http://support.slingbox.com/go/set-up", "http://support.slingbox.com/go/internet-viewing", "http://support.slingbox.com/go/slingplayer-help", "http://support.slingbox.com/go/downloads", "http://answers.slingbox.com"]
};

bmNav = {
	topNav : ["Watch","Products","Support"],
	topNavURL : ["http://watch.slingbox.com","http://bm.slingbox.com/go/products","http://support.slingbox.com/go/home"],
 	subNode1 : ["Slingbox Directory_us", "Slingbox Setup"],
	subNodeURL1 : ["http://sling.com/sling_player/directory", "http://setup.slingbox.com/"],
	subNode2 : ["Slingbox", "SlingPlayer Mobile"],
	subNodeURL2 : ["http://bm.slingbox.com/go/slingbox-120", "http://bm.slingbox.com/go/spm"],
	subNode3 : ["FAQ", "Set Up Help", "Internet Viewing Help", "Player Help", "Downloads", "Forums"],
	subNodeURL3 : ["http://support.slingbox.com/go/faq", "http://support.slingbox.com/go/set-up", "http://support.slingbox.com/go/internet-viewing", "http://support.slingbox.com/go/slingplayer-help", "http://support.slingbox.com/go/downloads", "http://answers.slingbox.com"]
};

plNav = {
	topNav : ["Watch","Products","Support","Buy"],
	topNavURL : ["http://watch.slingbox.com","http://pl.slingbox.com/go/products","http://support.slingbox.com/go/home","http://pl.slingbox.com/go/buy"],
 	subNode1 : ["Slingbox Directory_us", "Slingbox Setup"],
	subNodeURL1 : ["http://sling.com/sling_player/directory", "http://setup.slingbox.com/"],
	subNode2 : ["Slingbox", "SlingPlayer Mobile"],
	subNodeURL2 : ["http://pl.slingbox.com/go/slingbox-solo", "http://pl.slingbox.com/go/spm"],
	subNode3 : ["FAQ", "Set Up Help", "Internet Viewing Help", "Player Help", "Downloads", "Forums"],
	subNodeURL3 : ["http://support.slingbox.com/go/faq", "http://support.slingbox.com/go/set-up", "http://support.slingbox.com/go/internet-viewing", "http://support.slingbox.com/go/slingplayer-help", "http://support.slingbox.com/go/downloads", "http://answers.slingbox.com"]
};

stagingNav = {
	topNav : ["Watch","Products","Support","Buy"],
	topNavURL : ["http://watch.slingbox.com","http://staging.slingbox.com/go/products","http://support.slingbox.com/go/home","http://staging.slingbox.com/go/buy"],
 	subNode1 : ["Slingbox Directory_us", "Slingbox Setup"],
	subNodeURL1 : ["http://sling.com/sling_player/directory", "http://setup.slingbox.com/"],
	subNode2 : ["Slingbox", "SlingPlayer Mobile", "Accessories"],
	subNodeURL2 : ["http://staging.slingbox.com/go/slingbox-prohd", "http://staging.slingbox.com/go/spm", "http://staging.slingbox.com/go/accessories"],
	subNode3 : ["FAQ", "Set Up Help", "Internet Viewing Help", "Player Help", "Downloads", "Forums"],
	subNodeURL3 : ["http://support.slingbox.com/go/faq", "http://support.slingbox.com/go/set-up", "http://support.slingbox.com/go/internet-viewing", "http://support.slingbox.com/go/slingplayer-help", "http://support.slingbox.com/go/downloads", "http://answers.slingbox.com"]
};



topNav = {
	cookieName: "slingboxLocale",
	lc: this.getCookie,
	selectedNav:"",
	url:"",
	position:1,
	nav:"",
	selectedNode:0,
	navSub:"",
	navTop:"",	
	name:"",
	fullNav:"",	
	
	getCookie: function(){
		var start = document.cookie.indexOf( this.cookieName + "=" );
		var len = start + this.name.length + 1;
		if ( ( !start ) && ( this.name != document.cookie.substring( 0, this.name.length ) ) ) {
			return null;
		}
		if ( start == -1 ) return null;
		var end = document.cookie.indexOf( ';', len );
		if ( end == -1 ) end = document.cookie.length;
			return document.cookie.substring( len, end );
	},	
	genNav : function(p,l){

		this.selectedNode=p-1;
		if(l=="" && this.lc==null){
            		l="en";
		}
		else if(l=="" && this.lc!=null){
            		l= this.lc.substring(0, 2);
        	}
		this.selectedNav= this.getLocaleData(l);
		//check if nav data exists.
		if(this.selectedNav == null)
			this.selectedNav= enNav;
			
		if(p<=this.selectedNav.topNav.length){
			this.position=p;}
		else 
			this.position = 0;	
		//start building nav	
		
		//build top row
		this.navTop="";
		for ( i=0; i < this.selectedNav.topNav.length; i++){
			this.name=this.selectedNav.topNav[i];
			this.url=this.selectedNav.topNavURL[i];
			if (this.position!=0 && this.selectedNode==i){
            //set selected node

				this.navTop +="<div class=\"navtabOn\">"+ this.name +"</div><div class=\"navtabOnEnd\">&nbsp;</div>";
			}
			else{//non selected node
				this.navTop +="<div class=\'navtabOff\'><a href='" + this.url + "'>"+ this.name +"</a></div>";
			}
		}
		this.navSub="";
		if(this.position!=0){
			var sNode = eval(l+"Nav.subNode"+this.position);

			var sNodeURL = eval(l+"Nav.subNodeURL"+this.position);
		
			//	this.navSub +="<div id=\'subBox\' style=\'clear:both;\'>";
			//add childern node
			for ( i=0; i < sNode.length; i++){
				this.name=sNode[i];
				this.url=sNodeURL[i];
				this.navSub +="<div class=\"subNav\"><a href='" + this.url + "'>"+ this.name +"</a></div>";

			}

			//this.navSub +="</div>";
		}
		this.fullNav = {
		top:this.navTop,
		sub:this.navSub
		};
		return this.fullNav;		
		
		
		
	},
	getNav: function(p,l){
		//	alert(n.top+n.sub);
		var n = this.genNav(p,l);

		return n.top+n.sub;
	},
	getNavObj: function(p,l){
		var n = this.genNav(p,l);
		return n;
	},
	getLocaleData: function(l){
		if(l.length==2 && l!="en"){

			if(typeof window[l+"Nav"]=="object"){
				navData=eval(l+"Nav");
			}
			else
				navData=enNav;		
		}

		else
			navData=enNav;
		
		return navData;
	
	}

};

