	function JSgetUniqueURL(URL){

		var tmpURL;

		var d;
		d = new Date();

		tmpURL = '';
		tmpURL = tmpURL + d.getUTCFullYear();
		tmpURL = tmpURL + d.getUTCMonth();
		tmpURL = tmpURL + d.getUTCDay();
		tmpURL = tmpURL + d.getUTCHours();
		tmpURL = tmpURL + d.getUTCMinutes();
		tmpURL = tmpURL + d.getUTCSeconds();
		tmpURL = tmpURL + d.getUTCMilliseconds();

		var arrURL
		arrURL = URL.split("?");
		
		if (arrURL[0] == URL){
			tmpURL = URL + '?ID=' + tmpURL;
		}else{
			
			tmpURL = arrURL[0] + '?ID=' + tmpURL + '&' + arrURL[1];
		}

		var re;
		re = new RegExp(' ','ig');
		
		var retStr;
		retStr = tmpURL.replace(re,'%20');
		
		return retStr;
	}

function OpenNewWindow(stURL, stTitle, stLeft, stTop, stWidth, stHeight, stMenuBar, stResizable, stScrollBars)
{
	var varLeft, varTop, varUrl, varParms, varWidth, varHeight, Object

	if (stWidth == -1)
		varWidth = screen.width - 20;
	else
		varWidth = stWidth;

	if (stHeight == -1)
		varHeight = screen.height - 20;
	else
		varHeight = stHeight;

	if (stLeft == -1)
		varLeft = (screen.width - varWidth) / 2;
	else
		varLeft = stLeft;

	if (stTop == -1)
		varTop = (screen.height - varHeight) / 2;
	else
		varTop = stTop;

	varUrl = JSgetUniqueURL(stURL);

	varParms = 'left=' + varLeft + ',top=' + varTop + ',width=' + varWidth + ',height=' + varHeight + ',menubar=' + stMenuBar + ',resizable=' + stResizable + ',scrollbars=' + stScrollBars;

	Object = window.open(varUrl,stTitle,varParms);
	Object.focus();
	return;
}

function Preview(Id)
{
	OpenNewWindow('../amministrazione/img_preview.asp?code=' + Id,'PreviewLarge',-1,-1,750,450,'no','yes','yes');
}


