
/*
	##### Funzioni x Colorbox
*/
function doColorBox()
{
	if($('a.cb').colorbox)
		$('a.cb').colorbox({
			maxHeight:"100%", 
			maxWidth:"100%"
//			iframe:true, 
//			innerWidth:function(){ return getCbParam($(this).attr("params"), "cb_width",  $(this).attr("_w")); }, 
//			innerHeight:function(){ return getCbParam($(this).attr("params"), "cb_height", $(this).attr("_h")); }
		});	
}



function getCbParam(params, name, fallbackValue)
{
	if(!params)
	  return eval(fallbackValue) + 20;

	var arr = params.split(",");
	for(var i = 0; i<arr.length; i++)
	{
  	  var s = arr[i];
	  if(s.indexOf(name+"=") == 0)
		  return eval(s.replace(name+"=", "")) + 20;
	}
	
	return "";
}
// ##########################################################
