/*------------------------------------------------------------------*/
/* FUNCTION:	PigFile												*/
/* DESCRIPTION: Apre la scheda del maialino							*/
/* PARAMETERS :	PigNumber	Numero del maialino						*/
/*				Language	Lingua									*/
/*				NoLog		true se non deve loggare				*/
/*------------------------------------------------------------------*/
function PigFile(PigNumber, Language, NoLog) {
	openx('PigFile.asp?Lang=' + Language + '&Number=' + PigNumber + (NoLog?'&NoLog=1':''), 'PigDetails', 416, 540, 'no', 'yes')
}

/*------------------------------------------------------------------*/
/* FUNCTION:	PigVote												*/
/* DESCRIPTION: Apre il popup per la votazione del maialino			*/
/* PARAMETERS :	PigNumber	Numero del maialino						*/
/*				Language	Lingua									*/
/*------------------------------------------------------------------*/
function PigVote(PigNumber, Language) {
	openx('PigVote.asp?Lang=' + Language + '&Number=' + PigNumber, 'PigVote', 400, 365, 'no', 'no')
}

/*------------------------------------------------------------------*/
/* FUNCTION:	openx												*/
/* DESCRIPTION: Apre popup											*/
/* PARAMETERS :	url			pagina da mettere sul popup				*/
/*				wname		nome della nuova finestra				*/
/*				width		larghezza della nuova finestra			*/
/*				height		altezza della nuova finestra			*/
/*				resizable	possibilità di dimensionamento (no,yes)	*/
/*				scrollbars	presenza scrollbars (no,yes)			*/
/*------------------------------------------------------------------*/
function openx(url, wname, width, height, resizable, scrollbars)
{
//	var a;
	var popwin;
	var posX=(window.screen.width/2)-(width/2)
	var posY=(window.screen.height/2)-(height/2)
	if (url==null || url=='')
	  return
	wname = ( wname!=null && wname!='' ? wname : 'Item')
	width = ( width!=null && width!='' ? width : '460')
	height = ( height!=null && height!='' ? height : '260')
	resizable = ( resizable=='yes' ? '1' : '0')
	scrollbars = ( scrollbars=='yes' ? 'yes' : 'no')

//	a = window.location.href;
//	while(a.substr(a.length-1)!='/')
//	  a = a.substr(0,a.length-1);
//	url = a + url;

	popwin = window.open(url,wname,"width="+width+",height="+height+",location=0,menubar=0,resizable="+resizable+",scrollbars="+scrollbars+",status=0,titlebar=0,toolbar=0,z-lock=0,screenX="+posX+",screeny="+posY+",left="+posX+",top="+posY);
	popwin.focus();
}

