function showMessage(message){
    var hrefObj = document.createElement('a');
		hrefObj.href="#";
		//hrefObj.class="highslide";  // NON supportato in Explorer 7
		hrefObj.setAttribute('class', 'highslide');
	hs.htmlExpand(hrefObj, {contentId: 'highslide-html'} );
}

function openPopup(url, title, width, height) {
	return window.open(url, title, 
		"width=" + width + "," +
		"height=" + height + "," +
		"resizable=yes,scrollbars=no,location=no,menubar=no,status=no,toolbar=no," +
		"top=" + ((screen.height - height) / 2) + "," +
		"left=" + ((screen.width - width) / 2));
}

function openCredits() { 
	openPopup('credits.htm','',300, 250);
}

function openPrivacy() { 
	openPopup('privacy.pag','',450, 500);
}

function reloadPage() { 
	window.location.reload();
}

function prevImg(url,w,h)	{
	prev = openPopup("","_blank",w, h);
	prev.document.open();
	prev.document.writeln("<html><head><title>Preview</title></head><body bottommargin=0 leftmargin=0 marginheight=0 marginwidth=0 rightmargin=0 topmargin=0><a href=\"javascript:window.close()\"><img src=\""+url+"\" width=\""+w+"\" height=\""+h+"\" hspace=\"0\" vspace=\"0\" border=\"0\" alt=\"\" title=\"chiudi\"></a></body></html>");
	prev.document.close();
}

function popupImg(url)	{
	prev = window.open("","_blank","resizable=no,scrollbars=no,location=no,menubar=no,status=no,toolbar=no,directories=no");
	prev.document.open();
	prev.document.writeln("<html><head><title>Preview</title></head>")
	prev.document.writeln("<body bottommargin=0 leftmargin=0 marginheight=0 marginwidth=0 rightmargin=0 topmargin=0>");
	prev.document.writeln("<script>");
	prev.document.writeln("function completeImg() {");
	prev.document.writeln("i = document.getElementById(\"imm\");");
	prev.document.writeln("window.resizeTo(i.width + 6, i.height + 50);");
	prev.document.writeln("window.moveTo((screen.width - i.width) / 2, (screen.height - i.height) / 2);");
	prev.document.writeln("}");
	prev.document.writeln("</script>");
	prev.document.writeln("<a href=\"javascript:window.close();\">");
	prev.document.writeln("<img src=\""+url+"\" hspace=\"0\" vspace=\"0\" border=\"0\" alt=\"\" id=\"imm\" name=\"imm\" onload=\"return completeImg();\">");
	prev.document.writeln("</a>");
	prev.document.writeln("</body>");
	prev.document.writeln("</html>");
	prev.document.close();
}

function switchImage(element,imageOpen,imageClose) {
	if(element.src.search("Close") > 0) {
		element.src = element.src.replace("Close","Open");
	} else {
		element.src = element.src.replace("Open","Close");
	}
	
}