// JavaScript Document
$(document).ready(function(){
	
$("div[id^=panel]").addClass("jstyle");
$("#parar").removeClass("dnone");

$("img.delayLoad").each(function() {
	$(this).attr("src",$(this).attr("rel")).removeAttr("rel").removeClass("invisible");
});


$('#loop').waitForImages(function() {
        $("img.delayLoad").removeClass("delayLoad");
        $('#loop').cycle({ fx: 'fade',timeout:5000,speed:1000,requeueOnImageNotLoaded: true,requeueTimeout: 250});
});	
	

				   
//popups on mouseover						   
	$('div [class^="colap"]').hover(function(e){
		e.preventDefault();
		e.stopPropagation();
		var panId = $(this).attr("class").substring(5, 6);
		$("#panel"+panId).addClass('visible');
	}, function(e){
		var panId = $(this).attr("class").substring(5, 6);
		$("#panel"+panId).removeClass('visible');
	});


//limpia texto del input
$.each($("input.limpia:text"),function(i,v){
  	    var default_value = this.value;
  			$(this).focus(function() {
     				if(this.value == default_value) {
          				this.value = '';
      				}
  			});
		   	$(this).blur(function() {
		        	if(this.value == '') {
		            		this.value = default_value;
		        	}
		    	});
});

$("#parar").click(function(){
	$('#loop').cycle('pause');
        $(this).addClass("dnone");
       	$("#reanudar").removeClass("dnone");
});

$("#reanudar").click(function(){
	$('#loop').cycle('resume');
        $(this).addClass("dnone");
       	$("#parar").removeClass("dnone");
});

});
