	SELECTED_STYLE = 'background-color:#ffffff;color:#6699CC;font-family:Verdana,Sans-serif;font-size:10px;font-weight:bold;text-decoration:none;';
	UNSELECTED_STYLE = 'color:#666666;font-family:Verdana,Sans-serif;font-size:10px;font-weight:bold;text-decoration:none;';
				
	function navObj(caption, url, tid, sid, sArray, pop, width, height, scroll, status, menubar, toolbar, location, directories) {
		this.c = caption;
		this.u = url;
		this.topid = tid;
		this.subid = sid;
		this.subarr = sArray;
		this.style = UNSELECTED_STYLE;
		this.mover = '';
		this.mout = '';
		this.html = '';
		this.width = width;
		this.height = height;
		this.pop = pop;
		this.scroll = scroll;
		this.status = status;
		this.menubar = menubar;
		this.toolbar = toolbar;
		this.location = location;
		this.directories = directories;
										
		if (pop=="yes") {
			this.u = 'javaScript:openWin(\''+this.u+'\',\''+width+'\',\'' +height+'\',\'' +scroll+'\',\'' +status+'\',\'' +menubar+'\',\'' +toolbar+'\',\'' +location+'\',\'' +directories +'\')';
		}
					
		this.setHtml = navObj_setHtml;
	}
				
	function navObj_setHtml(current, tid) {//tid boolean
		
		spacerwidth='8'
		
		if(tid) {
			spacerwidth='13'
		}
		if(current && tid) {
			spacerwidth='12'
		}
			
		this.html = '<td';
		this.html += this.mover;
		this.html += this.mout;
		this.html += ' style="' + this.style + '" nowrap>';
					
		if(current){
			this.html += '<img src="/common/images/p_cccccc.gif" width="1" height="35" border="0"/>'
				+ '<img src="/common/images/pix.gif" width="' + spacerwidth + '" height="35" border="0"'
					+ this.mover + this.mout + '/></td><td';
		} else {
			this.html += '<img src="/common/images/pix.gif" width="' + spacerwidth + '" height="35" border="0"'
				+ this.mover + this.mout + '/></td><td';
		}
					
		this.html += this.mover;
		this.html += this.mout;
		this.html += ' style="' + this.style + '" nowrap>';
					
		this.html += '<a style="' + this.style + '" href="' + this.u + '"';
		this.html += this.mover;
		this.html += this.mout;
		this.html += '>';
		this.html += this.c;
		this.html += '</a>';
		this.html += '</td>';
		this.html += '<td';
		this.html += this.mover;
		this.html += this.mout;
		this.html += ' style="' + this.style + '" nowrap>';
					
		if(current){
			this.html += '<img src="/common/images/pix.gif" width="' + spacerwidth + '" height="35" border="0"'
				+ this.mover + this.mout + '/><img src="/common/images/p_cccccc.gif" width="1" height="35" border="0"/></td>';
		} else {
			this.html += '<img src="/common/images/pix.gif" width="' + spacerwidth + '" height="35" border="0"'
				+ this.mover + this.mout + '/></td>';
		}
		
					
					
	}
				

				
	//loop trough mainnav.xml and create navObjects...
	function navObjects() {
		navArr = new Array();
				
				
		secondlevelArr0 = new Array();
					
//			secondlevelArr0[0] = new navObj("Σύνοψη Μοντέλων","/models/overview/", 1, 1, "null", "no");
							
			secondlevelArr0[0] = new navObj("9-3 Sport Sedan","/main/GLOBAL/en/model/93_S", 1, 1, "null", "no");
							
			secondlevelArr0[1] = new navObj("9-3 Sport Hatch","/main/GLOBAL/en/model/93_WAGON", 1, 2, "null", "no");
							
	

			secondlevelArr0[2] = new navObj("9-3 Convertible","/main/GLOBAL/en/model/93_CONV", 1, 3, "null", "no");
			
			secondlevelArr0[3] = new navObj("9-3X","/main/GLOBAL/en/model/93x_splash/", 1, 4, "null", "no");
			
			secondlevelArr0[4] = new navObj("9-5","/main/GLOBAL/en/model/95_splash/", 1, 5, "null", "no");

			secondlevelArr0[5] = new navObj("Μεταχειρισμένα Select Class","/main/GLOBAL/en/model/select_class_splash/", 1, 6, "null", "no");
			
			//secondlevelArr0[4] = new navObj("9-5 Sedan","/main/GLOBAL/en/model/95", 1, 6, "null", "no");
							
			//secondlevelArr0[5] = new navObj("9-5 SportWagon","/main/GLOBAL/en/model/95_WAGON", 1, 7, "null", "no");
//			secondlevelArr0[5] = new navObj("9-7X SUV","/main/GLOBAL/en/model/97X/", 1, 6, "null", "yes",770,550,"yes");
							
//			secondlevelArr0[5] = new navObj("9-7X SUV","/models/97x/", 1, 6, "null", "no");
							
					
						
		navArr[0] = new navObj("ΑΥΤΟΚΙΝΗΤΑ","Javascript: void(null);", 1, null, secondlevelArr0);
				
				
		secondlevelArr1 = new Array();
					
						
			secondlevelArr1[0] = new navObj("Saab Assistance","/main/GLOBAL/en/services/assistance/", 2, 2, "null", "no");
							
			secondlevelArr1[1] = new navObj("Saab Business","/main/GLOBAL/en/services/business/", 2, 3, "null", "no");	
			
			secondlevelArr1[2] = new navObj("Saab Unlimited","/main/GLOBAL/en/services/unlimited/", 2, 4, "null", "no");	
			
			secondlevelArr1[3] = new navObj("Χρηματοδότηση","/main/GLOBAL/en/services/finance/", 2, 5, "null", "no");		
			
			secondlevelArr1[4] = new navObj("Expressions","/main/GLOBAL/en/services/expressions/", 2, 6, "null", "no");	
			
			secondlevelArr1[5] = new navObj("Διεθνείς Πωλήσεις","/main/GLOBAL/en/services/sales/", 2, 7, "null", "no");
						
		navArr[1] = new navObj("ΥΠΗΡΕΣΙΕΣ","Javascript: void(null);", 2, null, secondlevelArr1);
				
				
		secondlevelArr2 = new Array();
					
			//secondlevelArr2[0] = new navObj("Ιστορία","#", 3, 2, "null", "no");
							
			secondlevelArr2[0] = new navObj("Βραβεία","/main/GLOBAL/en/about/awards/", 3, 4, "null", "no");
							
			secondlevelArr2[1] = new navObj("Εταιρικές Πληροφορίες","/main/GLOBAL/en/about/company/", 3, 6, "null", "no");
							
			secondlevelArr2[2] = new navObj("Βακάρ ΑΒΕΕ","/main/GLOBAL/en/about/bakar/", 3, 7, "null", "no");
							
			//secondlevelArr2[3] = new navObj("Saab Salomon","/about/salomon/", 3, 7, "null", "no");
							
			secondlevelArr2[3] = new navObj("Concept Cars","/main/GLOBAL/en/about/concept/", 3, 9, "null", "no");
			
			secondlevelArr2[4] = new navObj("Ανακύκλωση","/main/GLOBAL/en/about/recycle/", 3, 10, "null", "no");
							
					
						
		navArr[2] = new navObj("ΣΧΕΤΙΚΑ ΜΕ ΤΗΝ SAAB","Javascript: void(null);", 3, null, secondlevelArr2);
				
				
		secondlevelArr3 = new Array();
					
			secondlevelArr3[0] = new navObj("Δελτία Tύπου","/main/GLOBAL/en/news/pressreleases/", 4, 1, "null", "no");
			secondlevelArr3[1] = new navObj("Δημοσιεύσεις","/main/GLOBAL/en/news/publications/", 4, 2, "null", "no");
			secondlevelArr3[2] = new navObj("Saab i-newsletter","/main/GLOBAL/en/news/newsletter/", 4, 3, "null", "no");
			secondlevelArr3[3] = new navObj("Saab e-magazine","/main/GLOBAL/en/news/magazine/contact/", 4, 4, "null", "no");
			secondlevelArr3[4] = new navObj("Saab@a glance","/main/GLOBAL/en/news/saab_glance/", 4, 5, "null", "no");
			secondlevelArr3[5] = new navObj("e-brochures","/main/GLOBAL/en/news/ebrochures/", 4, 6, "null", "no");
			
			//secondlevelArr3[0] = new navObj("Νέα","/main/GLOBAL/en/news/news/", 4, 1, "null", "no");
									
			//secondlevelArr3[2] = new navObj("Saab-i","/news/saab-i/", 4, 4, "null", "no");
							
		navArr[3] = new navObj("ΝΕΑ","Javascript: void(null);", 4, null, secondlevelArr3);

		
		secondlevelArr4 = new Array();
					
			//secondlevelArr4[0] = new navObj("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;","/main/GLOBAL/en/accessories/accessories/", 5, 0, "null", "no");
			//secondlevelArr4[1] = new navObj("Γνήσια Αξεσουάρ Saab2","/main/GLOBAL/en/accessories/accessories/", 5, 1, "null", "no");
		
		navArr[4] = new navObj("ΓΝΗΣΙΑ ΑΞΕΣΟΥΑΡ","/main/GLOBAL/en/accessories/accessories/", 5, null, secondlevelArr4);
		
				
	}
				


	htmlstring = '';
	
	function clearNav() {
		htmlstring = '';
	}
				
	function initNav() {
		setVisibility("navhider", "visible");
		clearNav();
		writeFirstNav(CURRENT_TOPNAV);
		writeSecondNav(CURRENT_TOPNAV, CURRENT_SUBNAV);
	}
				
	function resetDefaultState() {
		doNavAction(CURRENT_TOPNAV, CURRENT_SUBNAV);
	}
				
	function doNavAction(tid, sid) {
		clearNav();
		
		if(!sid | sid==null | sid == 0){
			writeFirstNav(tid);
		}
		writeSecondNav(tid, sid);
	}
		
	function writeFirstNav(tid) {
	
		TABLE_START = '<table border="0" cellpadding="0" cellspacing="0"><tr>';
		TABLE_END = '</tr></table>\n';
		
		htmlstring += TABLE_START;
		
		for(var i=0;i<navArr.length;i++) {
			
			if(navArr[i].topid==tid) {
						
				navArr[i].style = SELECTED_STYLE + "cursor: default;";
				navArr[i].mover=' onmouseover="setOverTd(\'top\',1);"';
				navArr[i].mout=' onmouseout="setOverTd(\'top\',0);"';
				navArr[i].setHtml(true, tid);
			}
			else {

				navArr[i].style = UNSELECTED_STYLE + "cursor: default;";
				navArr[i].mover=' onmouseover="setOverTd(\'top\',1);doNavAction(' + navArr[i].topid + ',' + navArr[i].subid + ');"';
				navArr[i].mout=' onmouseout="setOverTd(\'top\',0);"';
				navArr[i].setHtml(false, tid);
			}
						
			htmlstring += navArr[i].html;
		}
		htmlstring += TABLE_END;
		reWriteLayer('topnav', htmlstring);
		htmlstring = "";
	}
				
	function writeSecondNav(tid, sid) {
		
		var align = (tid == navArr[0].topid  ||  tid == navArr[1].topid) ? "left" : "center";

		TABLE_START = ''
			+ '<table border="0" cellpadding="0" cellspacing="0" width="721">'
			+ '<tr>'
			+ '<td align="' + align + '" '
			+ 'onmouseover="setOverTd(\'sub\',1)" '
			+ 'onmouseout="setOverTd(\'sub\',0);"'
			+ '>'
			+ '<table border="0" cellpadding="0" cellspacing="0">'
			+ '<tr>';
		TABLE_END = ''
			+ '</tr>'
			+ '</table>'
			+ '</td>'
			+ '</tr>'
			+ '</table>\n';

		htmlstring += TABLE_START;
			
		for(var i=0;i<navArr.length;i++) {
			if(navArr[i].topid == tid) {
				for(var j=0;j<navArr[i].subarr.length;j++){
					if(navArr[i].subarr[j].subid==sid) {
						navArr[i].subarr[j].style = SELECTED_STYLE;
						navArr[i].subarr[j].mover=' onmouseover="setOverTd(\'sub\',1);"';
						navArr[i].subarr[j].mout=' onmouseout="setOverTd(\'sub\',0);"';
					}
					else {
						navArr[i].subarr[j].style = UNSELECTED_STYLE;
						navArr[i].subarr[j].mover=' onmouseover="setOverTd(\'sub\',1);doNavAction(' + navArr[i].subarr[j].topid + ',' + navArr[i].subarr[j].subid + ');"';
						navArr[i].subarr[j].mout=' onmouseout="setOverTd(\'sub\',0);"';
					}
					navArr[i].setHtml();
					navArr[i].subarr[j].setHtml();
					htmlstring += navArr[i].subarr[j].html;
				}
			}
		}
		htmlstring += TABLE_END;
		reWriteLayer('secondnav', htmlstring);
	}
				
	var topMenuOverTd = 0;
	var subMenuOverTd = 0;
	var menuCheckOver = 0;



	function setOverTd (type, b)
	{
		eval (type + "MenuOverTd = " + b);
		menuCheckOver = 1;
	}


	setInterval ("testNavReset()", 250);



	function testNavReset()
	{
		if ((yMousePos > 75  ||  xMousePos > 910)
		&&  menuCheckOver == 1)
// VAG updated by main/js/2008/mainnav.js
//		if ((yMousePos > 50  ||  xMousePos > 772)
//			&&  menuCheckOver == 1)
		{
			menuCheckOver = 0;
			setTimeout ("doNavReset()", 500)
		}
	}



	function doNavReset ()
	{
		if (yMousePos > 75  ||  xMousePos > 910)
	//	if (yMousePos > 50  ||  xMousePos > 772)
		{
			initNav ();
		}
	}
