$( function() {
	$( '.category' ).click( function() {
		$( this ).toggleClass( 'active' )
		$( this ).siblings( '.dropdown' ).toggle();
		$( this ).find( '.indicator' ).toggleClass( 'indicator-active' );
		return false;
	} );
			
	$( '#dock > li' ).hover( function() {
		$( '.latest' ).fadeOut( 'fast' );
		$( this ).addClass( 'dock-active' );
		$( this ).children( 'span' ).fadeIn( 200 );
	}).bind( "mouseleave", function() {		
		$( this ).removeClass( 'dock-active' );	
		$( this ).children( 'span' ).fadeOut( 200 );
	} );
			
	$( '#dock' ).bind( "mouseleave", function() {
		$( '.latest' ).fadeIn( 1000 );
	} );
	
	
	$("#searchform #go").click(function(){
		
		var s=$("#searchform #s").val();
		window.location.href="?s="+s;
		
	})
	$("#searchform-header #go").click(function(){
		
		var s=$("#searchform-header #s").val();
		window.location.href="?s="+s;
		
	})
} );




function gestionaTagCloud(){
	
	var iframe=document.createElement('iframe');
	var div=document.createElement('div');
	$(div).attr("id","container_iframe_tags");	
	$(iframe).attr("src","http://www.pixelfarm.es/tag-cloud/index.php?max=20").attr("frameborder","no").attr("scrolling","no");
	$(iframe).css({width:'100%',height:'280px',border:'0px solid blue'});
	var iframe2=$(iframe).clone();
	$(iframe).css({background:"#fff"});
	$(iframe2).attr("src","http://www.pixelfarm.es/tag-cloud/index.php?max=20&iframe=2");
	setTimeout(function(){
		$(div).prepend($(iframe));
		$("#menu").prepend($(div));
		$(".categories").html($(iframe2)); 
		
	},3000)
	
	//$("#menu").prepend("<iframe src='http://www.pixelfarm.es/tag-cloud/index.php'></iframe>");
	
}