function imageview (imagepath,w,h,wtitle) {
	var wname =  "img" + ((new Date().getSeconds() * 31) + new Date().getDate());
	var wo = window.open(imagepath, wname , "directories=no,menubar=no,resizable=no,top=120,left=50,width=" + ( w ) + ",height=" + ( h ) , false);
	wo.document.write('<HEAD><script language="javascript"> function closeme() { self.close(); wo = null ; }<');
	wo.document.write("/script>");
	wo.document.write('<TITLE>' + wtitle + '</TITLE></HEAD>');
	wo.document.write('<body>');
	wo.document.write('<div style="position: absolute; left:0px; top:0px;">');
	wo.document.write('<a href="javascript:closeme();">');
	wo.document.write('<img src="' + imagepath + '" width="' + w + '" height="' + h + '" border="0" alt="Chiudi">');
	wo.document.write('</a>');
	wo.document.write('</div>');
	wo.document.write('</body>');
}

function openwin(filename,w,h) {	
	win = open(filename, 'dettagli', 'resizable=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, width='+w+', height='+h+', left=200, top=100');	
	win.focus();	
}


function hideObject(id)	{	document.getElementById(id).style.visibility = "hidden";	}
function showObject(id)	{	document.getElementById(id).style.visibility = "visible";	}

/*** 
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/

function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});


function CreateBookmarkLink(link) 
{
	 title =link;
	 url = link;
	// alert(title);
	// alert(url);
	 if (window.sidebar) 
	{ 
		/* FF */ 
		window.sidebar.addPanel(title, url,""); 
		//alert("Premere CTRL + D")
	}else if( window.external ){ 
		/* IE */ 
		window.external.AddFavorite( url, title); 
	}else if(window.opera && window.print) { 
		/* Opera */ 
		return true; 
	}
}
