window.onload = function(){  
	$('input.check').customInput();
	$('select.dropdown').selectmenu({style:'dropdown'});
	//$('#submenu').accordion({header: '.heading'});
	if(document.getElementById("slidebox")){
		$(".controller").jFlow({
		    slides: "#slides",
		    width:"714px",
		    height: "520px",
		    duration: 400
		});
		oLinks = $(".mainProcess a");
		$("a.jFlowControl").bind("click", function(){return false;});
		oLinksController = $("#controller a");
		if(oLinks.length == oLinksController.length -1){
			$("#controller a:not(:first)").bind("click", function(){resizeToDetail()});			
			$("#controller a:first").bind("click", function(){resizeToMain()});
			
			for(i=0,len=oLinks.length;i<len;i++){
				if(i!=0){
					//oLinksController[i].bind("click", function(){resizeToDetail()});
					oLinks[i].click = oLinksController[i].click;
				}
			}
		}
	}
	if(document.getElementById("player")){
		flowplayer("player", "/swf/flowplayer-3.1.5.swf", { 
		    // common clip properties are valid for the RSS playlist entries 
		    clip: {baseUrl: 'http://blip.tv/file/get',
		    	autoPlay: false, 
		        autoBuffering: true 
		    },
		    // playlist is configured from a RSS playlist file 
		    playlist: '/videos/playlist_es.rss'  ,
		    // show playlist buttons  
		    plugins: {controls:  null}
		}).controls("controls").playlist(".playlist", {loop: false});
	}
	makeNiceTitles();
}

function resizeToMain(){
	//alert("tomain");
	//if($("#slides").height() != 522){ 	
		/*
			*/
		//Modificamos la propiedad height del objeto opts de jFlow para que se mantenga la altura al llamar a la función resize() 
		
		$("#jFlowSlide").animate({height:522},400, 'linear');		
		$("#slides").animate({height:522},400, 'linear');
		$(".jFlowSlideContainer").animate({height:520},400, 'linear',function(){E.height=522;});
	
		/*$("#slides").height(522)
			
		$(".jFlowSlideContainer").height(520);*/
	//}
}

function resizeToDetail(){
	//alert("todetail");
	/* 
	$("#jFlowSlide").animate({height:288},300, 'linear');
	/* $("#slides").animate({height:288},300, 'linear');*/
	//Modificamos la propiedad height del objeto opts de jFlow para que se mantenga la altura al llamar a la función resize()
	$(".jFlowSlideContainer").animate({height:358},400, 'linear'); 
	$("#slides").animate({height:360},400, 'linear')
	$("#jFlowSlide").animate({height:358},400, 'linear',function(){E.height=360;});
	
	/*
		
	$(".jFlowSlideContainer").height(284);*/ 		
}
