document.writeln("<script language=\"JavaScript\" type=\"text/JavaScript\" src=\"http://www.psyma-statistics.com/aufruf/230_skoda_it.asp\"></script>");

//-------------------------
// Aggiunta da LMilani in data 03/03/2006 per consentire l'utilizzo di una BASE HREF verso 
// www.skoda-auto.it
var baseHref = "http://www.skoda-auto.it";

//-------------------------

var Vett_Pagine= new Array();
Vett_Pagine[1]= baseHref + "/gamma/gamma_octavia/octavia/octavia.asp";
Vett_Pagine[2]= baseHref + "/gamma/gamma_fabia/fabia/fabia.asp";

function VaiAllaPagina (URL, ID){
	if (isNaN(URL)) document.form1.action=URL;
	else document.form1.action=Vett_Pagine[URL];
	document.form1.ID.value=ID;
	document.form1.submit();
}

function ApriFinestraRete(){
	window.open( baseHref + '/rete/ret-distr-index.html','RETE','width=618,height=696');
}

function ApriSkodaSuperb(){
	window.open( baseHref +'/superb/default.htm','SkodaSuperb','width=800,height=600,scrollbars=yes,resizable=yes,toolbar=yes,location=yes,manubar=yes');
}

function ApriNuovaOctavia(){
	window.open('http://www.skoda-auto.com/newoctavia/ita','NuovaOctavia','width=800,height=600,scrollbars=yes,resizable=yes,toolbar=yes,location=yes,manubar=yes');
}

function ApriFinestra (URL, larghezza_loc, altezza_loc){
	window.open(URL,'GENERICA','width='+larghezza_loc+',height='+altezza_loc+'');
}

function ApriFinestraOctaviaRS (){
	window.open('http://www.skoda-auto.com/ita/model/octavia_rs/','NuovaOctaviaRS','width=800,height=600,scrollbars=yes,resizable=yes,toolbar=yes,location=yes,manubar=yes,status=yes');
}

function ApriSkodaFriends(){
	window.open('http://www.skoda-auto.it/skoda-friends.html','SkodaFriends','scrollbars=yes,resizable=yes,toolbar=yes,location=yes,manubar=yes,status=yes');
//	window.open('http://www.skoda-auto.it/skoda-friends.html','SkodaFriends','width=780,height=590');
}

function ApriRoomster(){
	window.open('http://www.skoda-auto.com/ita/model/roomster/homepage','Roomster','scrollbars=yes,resizable=yes,toolbar=yes,location=yes,manubar=yes,status=yes');
}
function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
function BuildMenu()
{

//detect menu span and position
var PositionSpan=document.getElementById('MenuPositionSpan')
var left_pos=findPosX(PositionSpan);
var top_pos=findPosY(PositionSpan)-4;
//detect browser type
//bwExplorer = (navigator.appName == 'Microsoft Internet Explorer') ? "True" : "False";
bwNetscape = (navigator.appName == 'Netscape') ? "True" : "False";
agent = navigator.userAgent;
if (((agent.toLowerCase().indexOf('opera 7')>-1) || (agent.toLowerCase().indexOf('opera/7')>-1))) {bwOpera = "True";} else {bwOpera = "False";}

//defining styles for different browsers
var TOP_STYLE_ON = "TopOn";
var TOP_STYLE_OVER = "TopOver";
var SUB_STYLE_ON = "SubOn";
var SUB_STYLE_OVER = "SubOver";
var SUB_STYLE_ON_BOTTOM = "SubOnBottom";
var SUB_STYLE_OVER_BOTTOM = "SubOverBottom";
opera_pos = 1;
level_off = 20;
if (bwNetscape == "True") 
	{ 
		opera_pos = 1;
		level_off = 20;
		TOP_STYLE_ON = "TopOn";
		TOP_STYLE_OVER = "NetscapeTopOver";
		SUB_STYLE_ON = "SubOn";
		SUB_STYLE_OVER = "NetscapeSubOver";
		SUB_STYLE_ON_BOTTOM = "SubOnBottom";
		SUB_STYLE_OVER_BOTTOM = "SubOverBottom";
	}
if (bwOpera == "True") 
	{ 
		opera_pos = 4;
		level_off = 22;
		TOP_STYLE_ON = "OperaTopOn";
		TOP_STYLE_OVER = "OperaTopOver";
		SUB_STYLE_ON = "SubOn";
		SUB_STYLE_OVER = "SubOver";
		SUB_STYLE_ON_BOTTOM = "SubOnBottom";
		SUB_STYLE_OVER_BOTTOM = "SubOverBottom";
	}

//Definition of menu items
//Item attributes : itemName, itemPosition[left,top], itemSize[height,width], itemOff[left,top], 
//					itemLevelOff[left,top], itemUrl, itemStyle[styleOn, styleOff], itemDescription

var skodaTopMenuItems = 
[
	// default value for first level - position, size, item off, style nad url
	{"itemPosition": [left_pos + opera_pos, top_pos + opera_pos], "itemSize": [12,90], "itemOff": [90,0], "itemStyle": [TOP_STYLE_ON, TOP_STYLE_OVER], "itemUrl": "none"},
	
	//first level
	{"itemName": "La gamma", "itemSize": [16, 77], "itemOff": [77,0],"itemSubMenu":                 
	[	//second level
		// default value for second level - size, item off, level off, style and url
		{"itemSize": [14, 200], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"},
		
		{"itemName": "» Roomster", "itemUrl": "javascript:ApriRoomster();", "itemDescription": "Roomster", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},

		{"itemName": "» Skoda Fabia", "itemUrl": "javascript:VaiAllaPagina(2,4);", "itemDescription": "Skoda Fabia", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		
		{"itemName": "» Nuova Skoda Octavia", "itemUrl": baseHref + "/gamma/gamma_octavia/newoctavia/newoctavia.asp", "itemDescription": "Nuova Skoda Octavia", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		
		{"itemName": "» Nuova Skoda Octavia RS", "itemUrl": "javascript:ApriFinestraOctaviaRS();", "itemDescription": "Skoda Octavia RS", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		
		{"itemName": "» Nuova Skoda Octavia Wagon", "itemUrl": baseHref +"/gamma/gamma_octavia/newoctavia_w/newoctavia_w.asp", "itemDescription": "Nuova Skoda Octavia Wagon", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},

		{"itemName": "» Skoda Octavia Workstation", "itemUrl": baseHref +"/gamma/gamma_octavia/octavia_work/oct_work_intro.asp", "itemDescription": "Skoda Octavia Workstation", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},

		{"itemName": "» Octavia Wagon Tour", "itemUrl": baseHref +"/gamma/gamma_octavia/octavia_w/octw_1piano.asp", "itemDescription": "Octavia Wagon Tour", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},

		{"itemName": "» Skoda Superb", "itemUrl": "javascript:ApriSkodaSuperb();", "itemDescription": "Link a minisito Skoda Superb", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
	
		{"itemName": "» Edition 100", "itemUrl": baseHref +"/gamma/edition100/edition100.asp", "itemDescription": "Edition 100", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
	
		{"itemName": "» Concept Car Yeti", "itemUrl": baseHref +"/gamma/concept_car/yeti/yeti_intro.asp", "itemDescription": "Concept Car Yeti", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},

		{"itemName": "&nbsp;", "itemStyle": [SUB_STYLE_ON_BOTTOM, SUB_STYLE_OVER_BOTTOM]}
	]},
	//first level
	{"itemName": "Vivi Skoda", "itemSize": [16, 83], "itemOff": [83,0],"itemSubMenu":                 
	[	//second level
		// default value for second level - size, item off, level off, style and url
		{"itemSize": [14, 100], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"},
		
		{"itemName": "» Eventi", "itemUrl": baseHref +"/viviskoda/eventi/eventi.asp", "itemDescription": "Eventi Skoda", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		
		{"itemName": "» Concorsi", "itemUrl": baseHref +"/viviskoda/concorsi/concorsi.asp", "itemDescription": "Concorsi Skoda", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		
		{"itemName": "&nbsp;", "itemStyle": [SUB_STYLE_ON_BOTTOM, SUB_STYLE_OVER_BOTTOM]}
	]},
	//first level
	{"itemName": "Service", "itemSize": [16, 73], "itemOff": [73,0], "itemUrl": baseHref +"/service/servizi_new.asp", "itemSubMenu":                 
	[	//second level
		// default value for second level - size, item off, level off, style and url
		{"itemSize": [14, 131], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"}
	]},
	//first level
	{"itemName": "111 anni di Skoda", "itemSize": [16, 146], "itemOff": [146,0],"itemSubMenu":                 
	[	//second level
		// default value for second level - size, item off, level off, style and url
		{"itemSize": [14, 190], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"},
		
		{"itemName": "» La storia", "itemUrl": baseHref +"/storia/lastoria_1.asp", "itemDescription": "La storia di Skoda", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		
		{"itemName": "» Evoluzione del marchio", "itemUrl": baseHref +"/storia/ev_marchio.asp", "itemDescription": "Evoluzione del marchio", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		
		{"itemName": "» Dalle motociclette alle auto", "itemUrl": "/storia/moto_auto.asp", "itemDescription": "Dalle motociclette alle auto", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		
		{"itemName": "» Il Museo", "itemUrl": baseHref +"/storia/museo.asp", "itemDescription": "Il Museo", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		
		{"itemName": "&nbsp;", "itemStyle": [SUB_STYLE_ON_BOTTOM, SUB_STYLE_OVER_BOTTOM]}
	]},
	//first level
	{"itemName": "La Rete Skoda", "itemSize": [16, 130], "itemOff": [130,0], "itemUrl": "http://www.skoda-auto.it/rete_new/sedi_operative.asp", "itemSubMenu":                 
	[	//second level
		// default value for second level - size, item off, level off, style and url
		{"itemSize": [14, 162], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"}        		
		
	]},
	//first level
	{"itemName": "Skoda Friends", "itemSize": [16, 100], "itemOff": [100,0], "itemUrl": "javascript:ApriSkodaFriends();", "itemSubMenu":                 
	[	//second level
		// default value for second level - size, item off, level off, style and url
		{"itemSize": [14, 200], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"}
	]}
];

SkodaMenu(skodaTopMenuItems);
menuBuilded=true;
//aggiunta per questionario
//set_event_handler();	// commentato da LMilani (ONION) in data 03/03/2006 x evitare errori di caricamento
//fine aggiunta questionario
}

var menuBuilded=false

function onResizeRebuildMenu()
{
	if (!menuBuilded)
		return;
	try
	{
		if (document.getElementById('MainMenuSpan') != null)
			{document.body.removeChild(document.getElementById('MainMenuSpan'));}
	}catch(e){}
	BuildMenu();
}
