/**
* libUtils.js - Javascript library for handling popups, form etc...
* Author: Alberto Sartori @ ./ERREWF
* Project: Milly Pozzi Arte
* Date: 09/09/2005
* Note: this library comes from WerkofenCMS v1.0.12 (c) 2004-2005 ./RWF
*/

//Function MM_OPENBRWINDOW (Abstract class)
function MM_openBrWindow(theURL,winName,features,width,height) { //v2.0
  features=features+',left='+ ((screen.width - width -10) /3)+',top='+ ((screen.height	- height-100) /3)
  window.open(theURL,winName,features);
}

//Function VIEWPIC (Show big version of image)
function viewPic(nome,misuraX, misuraY, Id) {
	MM_openBrWindow('vedifoto.php?f='+nome+'&Id='+Id,'foto','toolbar=no,scrollbars=yes,alwaysRaised=yes,z-lock=yes,width='+(misuraX+22)+',height='+eval(misuraY+20),misuraX+19,eval(misuraY+20))	   
}

//Function NOSPAM (Hide email address)
function noSpam(nome) {
	switch(nome) {
		case 0 : location.href='mail'+'to'+':'+'alberto'+unescape('%2E')+'sartori'+unescape('%40')+'errewf'+unescape('%2E')+'it'; 
				 break;
		case 1 : location.href='mail'+'to'+':'+'info'+unescape('%40')+'millypozziarte'+unescape('%2E')+'it'; 
				 break;
		case 2 : location.href='mail'+'to'+':'+'valeria'+unescape('%2E')+'bodanza'+unescape('%40')+'polis-mi'+unescape('%2E')+'it'; 
				 break;
		default: return;
	}
}

//Function CHANGEPAGE (Load a in-page content)
function changePage(what) {
	if (isNaN(what)) 
		return;
	else {
		document.content.sec.value=what
		document.content.submit();
	}
}

//Function RAISEWINDOW (Open a single popup)
function raiseWindow(args) {
	if (!args)
		return
	else {
		switch(args) {
			case 1 : MM_openBrWindow('credits.html','credits','toolbar=no,scrollbars=no,alwaysRaised=yes,z-lock=yes,width=292,height=142', 292, 142);
					break;
			case 2 : MM_openBrWindow('newsdetail.php','news','toolbar=no,scrollbars=yes,alwaysRaised=yes,z-lock=yes,width=357,height=400', 357, 400);
					break;
			case 3 : MM_openBrWindow('exhibitions-l.php','exi','toolbar=no,scrollbars=yes,alwaysRaised=yes,z-lock=yes,width=297,height=400', 297, 400);
					break;
			case 4 : MM_openBrWindow('./images/mappa.gif','mappa','toolbar=no,scrollbars=no,alwaysRaised=yes,z-lock=yes,width=670,height=440', 670, 440);
					break;
			case 5 : MM_openBrWindow('mlist.php','mlist','toolbar=no,scrollbars=no,alwaysRaised=yes,z-lock=yes,width=300,height=409', 300, 409);
					break;
			default: MM_openBrWindow('none.html','none','toolbar=no,scrollbars=no,alwaysRaised=yes,z-lock=yes,width=250,height=350');
  		   			break;
		}
	}
}


