
//APERTURA CHIUSURA LISTA

//function showHideList_startUp(){
//	if ( document.getElementById("galleryDetailExpanded") != null ) {
//		ShowHideDiv("galleryDetailExpanded","Apri la lista progetti","Riduci la lista progetti");
//	}
//	if ( document.getElementById("coursesListDetailExpanded") != null ) {
//		ShowHideDiv("coursesListDetailExpanded","Apri la lista corsi","Riduci la lista corsi");
//	}
//}

function ShowHideDiv(id,s1,s2){	
	//alert("ciao");
	var el=document.getElementById(id);	
	el.style.display="none";		
	var c=document.createElement("div");
	
	c.className="ShowHide";
	var div = c.appendChild(document.createElement("div"));
	var span = div.appendChild(document.createElement("span"));
	var link = span.appendChild(document.createElement("a"));
	
	link.href="#";
	link.appendChild(document.createTextNode(s1));
	link.onclick=function(){
	    link.firstChild.nodeValue = (link.firstChild.nodeValue==s1) ? s2 : s1;
		    if(el.style.display=='none'){			
			/*$('div.'+id).show("bounce");*/			
			/*$('div.'+id).fadeIn("slow");*/
			$('div.'+id).slideDown(300);
			/*$('div.'+id).fadeIn('slow');*/
			
				/*	$('div.'+id).next().animate({
						height: 'hide',
						opacity: 'hide',
					}, 'slow');*/			
		    }
		    else{
		    	$('div.'+id).slideUp(300);
			/*$('div.'+id).hide("normal");*/	
			/*$('div.'+id).fadeOut("slow");*/
			/*$('div.'+id).next().animate({
			height: 'show',
			opacity: 'show',
			}, 'slow');*/
		    }
	    return(false);
	    }
	span.appendChild(link);	
	el.parentNode.insertBefore(c,el);	
}


//IMMAGINI A ROTAZIONE

function innerfade_startUp(){
	/* CHIAMATA DI CLASSE
	$('ID or class of the element containing the fading objects').innerfade({ 
	animationtype: Type of animation 'fade' or 'slide' (Default: 'fade'), 
	speed: Fadingspeed in milliseconds or keywords (slow, normal or fast)(Default: 'normal'), 
	timeout: Time between the fades in milliseconds (Default: '2000'), 
	type: Type of slideshow: 'sequence' or 'random' (Default: 'sequence'), 
	containerheight: Height of the containing element in any css-height-value (Default: 'auto')  
	runningclass: CSS-Class which the container get’s applied (Default: 'innerfade') });
	*/

	$('div.imageRotation').innerfade({

		speed: 'slow',
		timeout: 4000,
		type: 'sequence', 
		//type: 'random',
		containerheight: '190px'

		/*
		animationtype: 'slide', 
		speed: 750, 
		timeout: 2000, 
		type: 'random',
		containerheight: '190px'
		*/
	});
}

//HIGHLIGHTFADE

function highlightFade_startUp(){

	$('div.navigation-secondary').mouseover(function() {
		$(this).highlightFade({color:'rgb(206,206,206)',speed:2000,iterator:'sinusoidal'})
	});
	
	$('div.navigation-secondary-home').mouseover(function() {
		$(this).highlightFade({color:'rgb(206,206,206)',speed:2000,iterator:'sinusoidal'})
	});

	$('div.courseDetail').mouseover(function() {
		$(this).highlightFade({color:'rgb(206,206,206)',speed:2000,iterator:'sinusoidal'})
	});

	$('div.courseDetailNoBorder').mouseover(function() {
		$(this).highlightFade({color:'rgb(206,206,206)',speed:2000,iterator:'sinusoidal'})
	});	
	
}

//ZOOM


function zoom(){
	$('a#box').click(function() {			
		zxcZoomText(main,14,20,500);		
	});
}



//WINDOW OPEN
/*
function window_startUp(){

	$('#windowOpen').bind(
		'click',
		function() {
			if($('#main').css('display') == 'none') {
				$(this).TransferTo(
					{
						to:'main',
						className:'transferer2',
						duration: 400,
						complete: function()
						{
							$('#main').show();
						}
					}
				);
			}
			this.blur();
			return false;
		}
	);
	
	
	$('#windowClose').bind(
		'click',
		function()
		{
			$('.section').TransferTo(
				{
					to:'windowOpen',
					className:'transferer2',
					duration: 400
				}
			).hide();
		}
	);
	$('#windowMin').bind(
		'click',
		function()
		{
			$('.mainText').SlideToggleUp(300);
			$('#windowBottom, #windowBottomContent').animate({height: 10}, 300);
			$('#window').animate({height:40},300).get(0).isMinimized = true;
			$(this).hide();
			$('#windowResize').hide();
			$('#windowMax').show();
		}
	);
	$('#windowMax').bind(
		'click',
		function()
		{
			var windowSize = $.iUtil.getSize(document.getElementById('windowContent'));
			$('.mainText').SlideToggleUp(300);
			$('#windowBottom, #windowBottomContent').animate({height: windowSize.hb + 13}, 300);
			$('#window').animate({height:windowSize.hb+43}, 300).get(0).isMinimized = false;
			$(this).hide();
			$('#windowMin, #windowResize').show();
		}
	);
	
	$('#main').Resizable(
		{
			minWidth: 200,
			minHeight: 60,
			maxWidth: 700,
			maxHeight: 400,
			dragHandle: '#windowTop',
			handlers: {
				se: '#windowResize'
			},
			onResize : function(size, position) {
				$('#windowBottom, #windowBottomContent').css('height', size.height-33 + 'px');
				var windowContentEl = $('#windowContent').css('width', size.width - 25 + 'px');
				if (!document.getElementById('window').isMinimized) {
					windowContentEl.css('height', size.height - 48 + 'px');
				}
			}
		}
	);
}*/