


var pippo;

function center_me(w,h){
	if(navigator.appName.indexOf('Explorer')+1){
		var win_width=w;
		var win_height=h;
	} else {
		var win_width=window.outerWidth;
		var win_height=window.outerHeight;
	}
	var pos_x=(screen.width-win_width)/2;
	var pos_y=(screen.height-win_height)/2;
	moveTo(pos_x,pos_y);
}

function open_it(url,w,h){
	if(pippo) pippo.close();
	pippo = window.open(url,'pop','height='+h+',width='+w+',location=0,resizable=no,scrollbars=no,status=0,menubar=no,toolbar=no,title=no,directories=no,titlebar=0');
}

function open_pop(url,w,h){
	if(pippo) pippo.close();
	pippo = window.open(url,'pop','height='+h+',width='+w+',location=no,resizable=no,scrollbars=yes');
}

function close_pop(){
	if(pippo) pippo.close();
}

function open_noscroll(url,w,h){
	now=new Date();
	window.open(url,'immagine'+now.getMinutes()+now.getMilliseconds(),'width='+w+',height='+h+',location=no,scrollbars=no,resizable=no');
}


function change_img(num){
    
    document.dett.zoom_img.src =  "../images/eventi_pop_"+num+".jpg" ;

}


//here you place the ids of every element you want.
var ids=new Array('extra','onda','sole','ambra','venere','mare','cadore');

function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

// APERTURA MENU TENDINA

startMenu = function() {
if (document.all&&document.getElementById) {
cssmenu = document.getElementById("csstopmenu");
for (i=0; i<cssmenu.childNodes.length; i++) {
node = cssmenu.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function(){                  
this.className=this.className.replace(" over", "")
}
}
}
}
}
if (window.attachEvent)
window.attachEvent("onload", startMenu)
else
window.onload=startMenu;


