$(window).load(function(){
	 
 	var int ;
			// The text of the paragraphs in the rounded divs is also the
			// jQuery code needed to create that effect. Cosmic.
		// saltos
// new conversation scroller
 $('#otraMas').click(function() {
    var input = '<li><input name="attachment[]" size="30" type="file" /></li>'
    $(input).appendTo('#new-attachments')
    if ($('#anadir').text() == 'Attach a file') {
      $('#anadir').text('Attach another file')
    }
    return false
  })
lafoto();
			//jMP3 init
			$("#sound").jmp3();
			$("#sounddl").jmp3({
				showfilename: "false",
				backcolor: "000000",
				forecolor: "990000",
				width: 150,
				showdownload: "false"
			});
			$("#external").jmp3({
				filepath: "http://www.thelostplanet.net/WeirdAl/",
				backcolor: "ffd700",
				forecolor: "8B4513",
				width: 300,
				showdownload: "false"
			});
			$("#broken").jmp3();  // it's a bah-roken
		});
		   function refreshProducts() {
          cerrarRotor(); /// ELIMINAR ESTO PARA KE SIGA FURULANDO
           $("#widgetbox").fadeOut(750, function() {

		   		<!-- empty the current content and then fetch new data -->
				$("#widgetbox").empty
				<!-- load the getProducts.pho file which will replace all the content -->
                $("#widgetbox").load("rotacion/getProducts.php", function() {
                    $("#widgetbox").fadeIn();
				 
                });
            });
            
        };
    
	function lafoto(){
		$("#lafoto").empty
				<!-- load the getProducts.pho file which will replace all the content -->
                $("#lafoto").load("rotacion/getFoto.php", function() {
                    $("#lafoto").fadeIn();
                });
	}
	
		<!-- initiate the function above -->
    	$(function(){
				   $valor= $.cookie('rotator');
			<!-- set the interval for refreshing, default set to 6.5 seconds -->
    	  int = setInterval("refreshProducts()", 7500);	   
if( $valor<1){
    		 refreshProducts();
}
			else {
			  cerrarRotor();
				// botonFotos();
			}
			
    		
			
    	});
		
	function cerrarRotor(){
	clearInterval(int);
	$("#widget").fadeOut("slow", function () {       $("#widgetbox").empty();});
	$.cookie('rotator', '1');
	}
	function activarFotos(){
		$.cookie('rotator', '0');
		int = setInterval("refreshProducts()", 7500);	   
		refreshProducts();
	}
	
	
	function botonFotos(){
		  $("#tope").append("<div style='float:right'><b> <a href='#' onclick='activarFotos();return false'> Ver Fotos </a> </b></div>");
 
	}
	