/* THINGS TO DO IMMEDIATELY */

function addToFavorites(urlAddress) 
{
	var txt = "DMT Towertel";
	/*var url = urlAddress;*/
	var url = location.href;
	var who = "dmt visitor";

	var ver = navigator.appName;
	var num = parseInt(navigator.appVersion);
	if (window.sidebar) 
	{ // Mozilla Firefox Bookmark
		window.sidebar.addPanel(txt, url,"");
	} 
	else if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) 
	{
		document.write('<A HREF="javascript:window.external.AddFavorite(url,who);" ');
		document.write('onMouseOver=" window.status=');
		document.write("txt; return true ");
		document.write('"onMouseOut=" window.status=');
		document.write("' '; return true ");
		document.write('">'+ txt + '</a>');
	}
	else if (window.opera && window.print) 
	{
		window.external.AddFavorite(url, txt);
	}
	else
	{
		txt += " - Il browser che stai utilizzando non supporta questa funzione - Clicca ctrl+D per salvare la pagina";
		alert(txt);
	} 
	
}

function sendMail(urlAddress) 
{
	mail_str = "mailto:?subject= DMT Towertel" /*+ document.title*/;
	mail_str += "&body= ti segnalo questa pagina. <br/>";
	mail_str += " Guradala a questo indirizzo: <br/>" + escape(urlAddress); 
	mail_str += " <br/><br/>Saluti, <br/>"; 
	location.href = mail_str;
}



/* THEN THINGS TO DO ON READY */


$(document).ready(
	function()
	{
		
		//activate all popup for images
		$(".popupImage").ceebox({titles:false,margin:"20",padding:"10"});
		//activate all popup for flash
		$(".popupFlash").ceebox({titles:false,margin:"20",padding:"10"});
		//activate all popup for html
		$(".popupHtml").ceebox({image:false,titles:false,margin:"20",padding:"10"});
		
		
		/*
		//activate fading links
		$("a").fadeTo("slow", 0.7); // This sets the opacity of the thumbs to fade down to 60% when the page loads
		$("a").hover(function(){
			$(this).fadeTo(500, 1.0); // This should set the opacity to 100% on hover
		},function(){
			$(this).fadeTo(1500, 0.7); // This should set the opacity to 100% on hover
		});		
		*/
		
	}
);

	
	
	
//FINALLY THINGS TO DO ON LOAD (AFTER ALL IMAGES ARE LOADED)

	
$(window).load(
	function()
	{
		//$('.masonry').masonry({	animate: true }); //questo è quello in produzione
		//$('.masonry').masonry({	animate: true }); //va richiamato due volte altrimenti sbaglia
		//$('.masonry').masonry({	animate: true, columnWidth: 112 }); //esempio
		//$('.moduleBox').masonry({	animate: true }); //esempio
	}
);
	


