function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var scrollXpos, scrollYpos, winWidth, winHeight;
function updateVars()
{
 winWidth = (isIE ? document.body.clientWidth : window.innerWidth);
 winHeight = (isIE ? document.body.clientHeight : window.innerHeight);
 scrollYpos = (isIE ? document.body.scrollTop : window.pageYOffset);
 scrollXpos = (isIE ? document.body.scrollLeft : window.pageXOffset);
}
window.onscroll = new Function('updateVars(); pMenu.position("'+window.name+'")');
window.onresize = updateVars;

var pMenu = new PopupMenu('pMenu');
    
     pMenu.startMenu('root', false, 0, 78, 23, hBar);


	 pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M1","","images/menu/h_1_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/trasp.gif" height=23 width=65 border=0 name="M1"></a>', 'modelli', 'sm:','' , 65);
 	 pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M2","","images/menu/h_2_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/trasp.gif" height=23 width=62 border=0 name="M2"></a>','benefit', 'sm:', '', 62);
	 pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M3","","images/menu/h_3_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/trasp.gif" height=23 width=152 border=0 name="M3"></a>','evo', 'sm:','' , 152);
 	 pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M4","","images/menu/h_4_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/trasp.gif" height=23 width=66 border=0 name="M4"></a>','garanzia/index.htm', 'top.centrale','' , 66);
 	 pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M5","","images/menu/h_5_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/trasp.gif" height=23 width=100 border=0 name="M5"></a>','rete', 'sm:', '', 100);  
	 pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M6","","images/menu/h_6_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/trasp.gif" height=23 width=152 border=0 name="M6"></a>','community', 'sm:', '', 152);
	 pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M7","","images/menu/h_7_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/trasp.gif" height=23 width=127 border=0 name="M7"></a>','home/mondo.htm', 'top.centrale','' , 127);
	 pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M8","","images/menu/h_8_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/trasp.gif" height=23 width=75 border=0 name="M8"></a>','press/archivio/index.asp', 'top.centrale','' , 75);

    pMenu.startMenu('modelli', false, 0, 23, 23, '');
	pMenu.addItem('<a href="http://www.ssangyong-actyon.it" target="_blank" onmouseover=MM_swapImage("M1","","images/menu/h_1_on.gif",1);MM_swapImage("SM16","","images/menu/h1_6_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/menu/h1_6.gif" height=23 width=68 border=0 name="SM16"></a>', '', 'top.centrale', crazy2, 69);
	pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M1","","images/menu/h_1_on.gif",1);MM_swapImage("SM12","","images/menu/h1_2_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/menu/h1_2.gif" height=23 width=99 border=0 name="SM12"></a>', 'gamma/index.asp?apModel=2', 'top.centrale', crazy2, 99);
	pMenu.addItem('<a href="http://www.ssangyong-kyron.it" target="_blank" onmouseover=MM_swapImage("M1","","images/menu/h_1_on.gif",1);MM_swapImage("SM15","","images/menu/h1_5_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/menu/h1_5.gif" height=23 width=80 border=0 name="SM15"></a>', '', 'top.centrale', crazy2, 80);
	pMenu.addItem('<a href="http://www.rexton.it" target="_blank" onmouseover=MM_swapImage("M1","","images/menu/h_1_on.gif",1);MM_swapImage("SM11","","images/menu/h1_1_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/menu/h1_1.gif" height=23 width=64 border=0 name="SM11"></a>', '', '', crazy2, 66);
/*	pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M1","","images/menu/h_1_on.gif",1);MM_swapImage("SM14","","images/menu/h1_4_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/menu/h1_4.gif" height=23 width=63 border=0 name="SM14"></a>', 'gamma/index.asp?apModel=3', 'top.centrale', crazy2, 63);  */
    
    pMenu.startMenu('benefit', false, 0, 23, 23, subM);
	pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M2","","images/menu/h_2_on.gif",1);MM_swapImage("SM21","","images/menu/h2_1_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/menu/h2_1.gif" height=23 width=66 border=0 name="SM21"></a>', 'gamma/listino_frm.asp', 'top.centrale', crazy2, 66);
	pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M2","","images/menu/h_2_on.gif",1);MM_swapImage("SM22","","images/menu/h2_2_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/menu/h2_2.gif" height=23 width=102 border=0 name="SM22"></a>', 'promo/index.htm', 'top.centrale', crazy2, 102);
	//pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M2","","images/menu/h_2_on.gif",1);MM_swapImage("SM23","","images/menu/h2_3_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/menu/h2_3.gif" height=23 width=92 border=0 name="SM23"></a>', 'offerte/index.htm', 'top.centrale', crazy2, 92);
	pMenu.addItem('<img src="images/menu/h2_3.gif" height=23 width=92 border=0 name="SM23">', '', '', crazy2, 92);
	pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M2","","images/menu/h_2_on.gif",1);MM_swapImage("SM24","","images/menu/h2_4_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/menu/h2_4.gif" height=23 width=157 border=0 name="SM24"></a>', 'rete/omologazione.htm', 'top.centrale', crazy2, 157);

    pMenu.startMenu('evo', false, 0, 23, 23, subM);
	pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M3","","images/menu/h_3_on.gif",1);MM_swapImage("SM31","","images/menu/h3_1_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/menu/h3_1.gif" height=23 width=72 border=0 name="SM31"></a>', 'evoluzione/index.htm', 'top.centrale', crazy2, 72);
	pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M3","","images/menu/h_3_on.gif",1);MM_swapImage("SM32","","images/menu/h3_2_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/menu/h3_2.gif" height=23 width=41 border=0 name="SM32"></a>', 'evoluzione/4x4.htm', 'top.centrale', crazy2, 41);

	pMenu.startMenu('rete', false, 0, 23, 23, subM);
	pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M5","","images/menu/h_5_on.gif",1);MM_swapImage("SM51","","images/menu/h5_1_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/menu/h5_1.gif" height=23 width=102 border=0 name="SM51"></a>', 'rete/index.asp', 'top.centrale', crazy2, 102);
	pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M5","","images/menu/h_5_on.gif",1);MM_swapImage("SM52","","images/menu/h5_2_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/menu/h5_2.gif" height=23 width=84 border=0 name="SM52"></a>', 'rete/assistenza.asp', 'top.centrale', crazy2, 84);
	pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M5","","images/menu/h_5_on.gif",1);MM_swapImage("SM53","","images/menu/h5_3_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/menu/h5_3.gif" height=23 width=104 border=0 name="SM53"></a>', 'rete/centri_raccolta.asp', 'top.centrale', crazy2, 104);
    
	pMenu.startMenu('community', false, 0, 23, 23, subM);
	pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M6","","images/menu/h_6_on.gif",1);MM_swapImage("SM61","","images/menu/h6_1_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/menu/h6_1.gif" height=23 width=53 border=0 name="SM61"></a>', 'info/index.htm', 'top.centrale', crazy2, 53);
	pMenu.addItem('<a href="#" onmouseover=MM_swapImage("M6","","images/menu/h_6_on.gif",1);MM_swapImage("SM62","","images/menu/h6_2_on.gif",1) onMouseOut=MM_swapImgRestore()><img src="images/menu/h6_2.gif" height=23 width=71 border=0 name="SM62"></a>', 'prep.htm', 'top.centrale', crazy2, 71);


var popOldOL = window.onload;

window.onload = new Function('if (popOldOL) popOldOL(); updateVars(); pMenu.update()');
window.onresize = new Function('ns4BugCheck(); updateVars(); pMenu.position()');
window.onscroll = new Function('updateVars(); pMenu.position()');

if (isNS4) document.captureEvents(Event.CLICK);
document.onclick = new Function('evt', 'pMenu.click(); ' +
 'if (isNS4) return document.routeEvent(evt)');


// A small function that refreshes NS4 on horizontal resize, called above.
var origWinWidth = window.innerWidth;
function ns4BugCheck()
{
 if (isNS4 && origWinWidth != window.innerWidth) location.reload()
}

// Activate the onscroll event for NS browsers.
if (!isIE) setInterval('if (scrollYpos!=pageYOffset || scrollXpos!=pageYOffset) ' +
 'window.onscroll()', 50);


