// JavaScript Document
// Stefano Frasca Maggio 2011|Settembre 2011|Ottobre 2011(YT)
$(document).ready(function(){
	//Examples of how to assign the ColorBox event to elements
	if ($("a.bigger").length ){
		$("a.bigger").colorbox();
	}
	if ($("a[rel='album']").length ){
		$("a[rel='album']").colorbox({transition:"fade", width:"800px", height:"600px", current: "{current}^ di {total} foto"});
	}
	if ($("a.youtube").length ){
		$("a.youtube").colorbox({iframe:true, innerWidth:500, innerHeight:419});
	}
	//$("a.bigger").colorbox({transition:"fade"});
	//$("a[rel='example4']").colorbox({slideshow:true});
});

function clickfb() {
        u=location.href;
        t=document.title;
        window.open('http://www.facebook.com/sharer.php?u=' +
             encodeURIComponent(u) +
             '&t=' +
             encodeURIComponent(t),
             ' sharer', 'toolbar=0, status=0, width=626, height=436');
        return false;
}

function openTree(ids) {
   $('#'+ids).toggle();
   if($('#textContent').length > 0)
		var el = $('#textContent').show().jScrollPane({showArrows:true});
}
function openTreeCloseOther(numid, nummax){
	for(var i = 1; i<=nummax; i++){
		if(i == Number(numid)){
			 $('#list'+numid).slideDown();	
		}else{
			$('#list'+i).slideUp();	
		}
	}	
	if($('#textContent').length > 0)
		var el = $('#textContent').show().jScrollPane({showArrows:true});
}

//PRODUCTS
function _Description(){
	$('#prj_description').toggle();	
	//alert($('#prj_description').is(':visible')+"####");
	if($('#prj_description').is(':visible')){
		//alert($('#prj_description').length+"####");
		if($('#prj_description').length > 0){
					//alert("OPSS");
					var el2 = $('#prj_description').show().jScrollPane({showArrows:true});
		}
	}
}

