
<!--
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_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function preloadImages(ar) { //v3.0
  	var d=document;
	
	if(d.images){ 
		if(!d.MM_p) {
			d.MM_p=new Array();
			}
		var i,j=d.MM_p.length,a=ar;
			for(i=0; i<a.length; i++){
				if (a[i].indexOf("#")!=0){ 
					d.MM_p[j]=new Image;
					d.MM_p[j++].src=a[i];
				}
			}
	}
}

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];}
}


/**


THIS IS CALLED WHEN THE PAGE IS LOADED

before this function the scripts in onload.js are executed that give cross-browser compatibility

*/

function init() {
    // quit if this function has already been called
    if (arguments.callee.done) return;

    // flag this function so we don't do the same thing twice
    arguments.callee.done = true;

    // kill the timer
    if (_timer) clearInterval(_timer);

	
	
	   //-->
	
	// BOOTSTRAP
	
	/**
	* C() gets reference to controller
	* M(String title) gets reference to display module
	* B(String title) gets reference to business model class
	*/
   
   /**
var cont = $("creditsContainer");
Element.toggle(cont);
cont.isVisible = false;*/



	// read Parameters and save in qsParm
	var qsParm = new Array();
	var query = window.location.search.substring(1);
	var parms = query.split('&');
	for (var i=0; i<parms.length; i++) {
	   var pos = parms[i].indexOf('=');
	   if (pos > 0) {
	      var key = parms[i].substring(0,pos);
	      var val = parms[i].substring(pos+1);
	      qsParm[key] = val;
	      }
	   }
	
	var navMemory;
	if(qsParm["nav"]){
	navMemory = qsParm["nav"].split(',');
}


	// static navigation list
	var list = new Array();
	
		list = [{title: 'home',  img: '01', url: 'javascript:onLinkClick("home.asp")'},
				{title: 'about', img: '03', subItems: [{title: 'massimo<br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iosa ghini',  img: '05', url: 'javascript:onLinkClick("massimo.asp")'},
				{title: 'iosa ghini',  img: '19', url: 'javascript:onLinkClick("associati.asp")'}]},
				{title: 'works', img: '06', subItems: [{title: 'design',  img: '07', url: 'javascript:onLinkClick("progetti.asp", "tipo=design")'}, {title: 'architecture', img: '08', url: 'javascript:onLinkClick("progetti.asp", "tipo=architecture")'}, {title: 'interiors',  img: '20', url: 'javascript:onLinkClick("progetti.asp", "tipo=interiors")'}, {title: 'retails',  img: 'Retail', url: 'javascript:onLinkClick("progetti.asp", "tipo=retail")'},{title: 'by year',  img: '09', url: 'javascript:onLinkClick("progettiByYear.asp", "tipo=byYear&year=2008")'}]},
				{title: 'clients', img: '10', url: 'javascript:onLinkClick("clients.asp")'},
				{title: 'press', img: '11', subItems: [{title: 'events', img: '12', url: 'javascript:onLinkClick("events.asp")'}, {title: 'books', img: '13', url: 'javascript:onLinkClick("books.asp")'}, {title: 'press<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;release',  img: '14', url: 'javascript:onLinkClick("press.asp")'}]},
				{title: 'contact', img: '18', url: 'javascript:onLinkClick("contact.asp")'}]; 
	
	
	var i = 0;
	var array = new Array();
	while(i++ < list.length){
		array.push("menu/menu-off-"+list[i-1].img+".gif");
		array.push("menu/menu-on-"+list[i-1].img+".gif");
	}
	
	preloadImages(array);
	
	// navigation setup			
	new display.ShiftNavigation({id: 'shiftNavigation', parent: $('navigation'), appendToParent: true, appendAsFirst: false, showTitleBar: false, showScrollBars: false, showButtons: false, showTitle: false, 'list': list, 'navMemory': navMemory});

	
		
   


   
};

// link navigation with memory of navigation status
	var navMemory = new Hash();



function addNavMemory(status){
 	navMemory.add(status,status);
}

function removeNavMemory(status){
	if(navMemory.has(status))
	navMemory.del(status);
}

function getNavMemory(){
	
	var str ='';
	for(var i = 0; i < navMemory.items.length; i++){
		
		if(i==0)
		str += navMemory.items[i][1];
		
		else
		str += ','+navMemory.items[i][1];
	}
	return str;
}

function onLinkClick(index, pars){
	var url = index+'?nav='+getNavMemory();
	if(pars){
		url += "&" + pars;
	}
	parent.location= url;
}

function showCredits(type){
	var txt;
	switch(type){
	case "privacy":
	txt = "<div class='titleCredits'>Privacy</div><div class='whiteTrans'><table class='innerContent'><tr><td valign='top'>"+
	"<p>..</p></td></table></div>";
	break;
	case "credits":
	txt = "<div class='titleCredits'>Credits</div><div class='whiteTrans'><table class='innerContent'><tr><td valign='top'>"+
	"<p>site planned, designed and implemented by <a href='http://www.nowhere.it'>Nowhere s.r.l</a></p></td></table></div>";
	break;
	case "requirements":
	txt = "<div class='titleCredits'>Requirements</div><div class='whiteTrans'><table class='innerContent'><tr><td valign='top'>"+
	"<p>Best viewed with Internet Explorer and Firefox at a Resolution of 1024x768</p><p>Settings: JavaScript enabled</p>"+
	"<p>Internet Connection: Low (56k) sufficient</p></td></table></div>";
	break;
	}
	
	var cont = $("creditsContainer");
	cont.innerHTML = txt;
	cont.style.visibility="visible";
	cont.isVisible = true;
}

function showTesto(testo){
	var testoCont = $('testoContainer');
	var testoDiv = $('testo');
	testoDiv.innerHTML = testo;
	
	if(testoCont.isVisible == false){
		Element.toggle(testoCont);
		testoCont.isVisible = true;
	}

}

function visualizza(id){
	if (document.getElementById){
		if(document.getElementById(id).style.display == 'none'){
			document.getElementById(id).style.display = 'block';
		} else {
			document.getElementById(id).style.display = 'none';
		}
	}
} 

function dropTesto(){
	//$('testo').style.visible = false;
	//$('testo').firstChild.innerHTML = "";
	var testoCont = $('testoContainer');
	
	if(!testoCont.isVisible || testoCont.isVisible == true){
		Element.toggle(testoCont);
		testoCont.isVisible = false;
	}

}