// Accessible popups - http://accessify.com/features/tutorials/the-perfect-popup/
	// Esempio:  <a href="..." rel="popup [console|standard] width height">...</a>
	// NB: width e height sono numeri, senza "px"
	$("a[rel*=popup]")
		.click(function(){
			//set defaults - if nothing in rel attrib, these will be used
			var t = "standard";
			var w = "600";
			var h = "590";
			var hr = $(this).attr("href");
			
			if(hr.indexOf("apri_popup_methode_mailto")==-1){
			//look for parameters
			attribs = $(this).attr("rel").split(" ");
			if (attribs[1]!=null) {t = attribs[1];}
			if (attribs[2]!=null) {w = attribs[2];}
			if (attribs[3]!=null) {h = attribs[3];}

			if(t=="generic" || t=="generico") {
					 w = "620";
					 h = "690";	
					 popUpGeneric($(this).attr("href"),t,w,h);
				}
				else if(t=="standard_ppn"){
					 if($.browser.msie && $.browser.version < 7){
   					 w = "600";
  					 h = "770";	    
           }	
           else {			
  					 w = "600";
  					 h = "750";	
            // popUpGallery("/gallery/Calcio/12-2009/palloni/prova.shtml","standard_ppn",600,740);
           }	
          popUpGallery($(this).attr("href"),t,w,h);
        }
			else {
				//call the popup script
				if(($(this).attr("href")).indexOf("vuoto.shtml")>-1) {
					 w = "750";
					 h = "565";
					}
				popUpGallery($(this).attr("href"),t,w,h);
			}
			return false;
			}
	});