﻿<!--

// ******************************
// ** SCRIPT GESTIONE MIGLIACA **
// ** CopyRight: Elio Puglisi  **
// ******************************

document.write('<style type="text/css">.close_data {display: none}</style>');

function showPic(whichpic)	{
  if (document.getElementById && whichpic)	{		
		try	{
			$("#contents").append("<div id='IMG_Loading'>loading</div>");
			$("#PNL_Img").addClass("fade");
			$('#IMG_Loading').show();
			
			var url = whichpic.href;
			var title = jQuery.trim(whichpic.title);
				
			imgPreloader = new Image();
			imgPreloader.onload = function(){		
				imgPreloader.onload = null;

				if (title != '')	{
					document.getElementById('img_comment').innerHTML = title;
					document.getElementById('IMG_Gallery').alt = title;
				} 
				else {
					document.getElementById('img_comment').innerHTML  = '';
					document.getElementById('IMG_Gallery').alt = ''; 
				}
			
				document.getElementById('IMG_Gallery').src = url;
				
				$('#IMG_Loading').remove();
				$("#PNL_Img").removeClass("fade");
			};
			
			imgPreloader.src = url;
			
			return false;
		}
		catch(e) {
			alert(e);
			return false;
		}
	}
	else {
	  return true;
	}		
}


String.prototype.trim = function () {
	//funzione trim
    return this.replace(/^\s*/, "").replace(/\s*$/, "");
}

function jViewHideBox(id, objLink) {
	$("#" + id).slideToggle("slow");
	if (objLink) {
		$(objLink).toggleClass("go_up"); 
		
		if ($(objLink).attr("title") == "open") $(objLink).attr("title", "close");
		else $(objLink).attr("title", "open");
	}
	return false;
}

function addBookmark()	{
	if (window.sidebar) {
    	// versione FF
	    window.sidebar.addPanel(document.title, location.href, '');
	} else if (window.external) {
	    // versione IE
    	window.external.AddFavorite( location.href, document.title); 
	} else { 
		alert("Function not supported.");
	}
	
	return false;
}

function flashIntalled() {
	if ((navigator.appName == "Microsoft Internet Explorer" && 
		 navigator.appVersion.indexOf("Mac") == -1 &&  
		 navigator.appVersion.indexOf("3.1") == -1) || 
		(navigator.plugins && navigator.plugins["Shockwave Flash"]) || 
		 navigator.plugins["Shockwave Flash 2.0"])
	{
		return true;
	} else {
		return false;
	}
}
// -->
