$(window).bind("unload", function() { // ... 
		carga();						  
 });

$(window).load(function(){
	
	carga();
	
});


function carga(){
						
						
function preloadImages(id) {
    var c = new Array();
	
    $(id+' img').each( function(j) {
        c[j] = new Image();
        c[j].src = this.src;
		
		


		
        if (( $.browser.msie )&&(this.name!='none')) {
			
            this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',sizingMethod='image',src='"+ this.src +"')"; 
        }
    });

}


preloadImages('body');
			
					
						
						
						
function imageresize() {
    
	if ($(window).width()<=1024){
		
		$('#cuerpo').css("left",'0%');
		$('#cuerpo').css("margin-left",'0px');
		

	}else{
		$('#cuerpo').css("left",'50%');
		$('#cuerpo').css("margin-left",'-512px');
	}
	
	
	
	//$("#info").html("LEFT: "+posicionReal.left+ " TOP: "+posicionReal.top);
}
			
			
$(window).bind("resize", function(){
			imageresize();
		});
  //llamada cuando la ventana cambia de tamaņo
imageresize();




diapo = 1;
diapo2 = 1;

var oarray = new Array(3); 
oarray[1] = 0;
oarray[2] = 0;
oarray[3] = 0;









$('.enl1').click(function(){
						
				
		if ($('#subbloque1').height()==0)
		{
			$('#subbloque1').animate({height: '669px' }, {duration: 700,specialEasing: {marginLeft: 'easeInOutBack'},complete: function() {}});
			oarray[1]=1;
		}
		else
		{
			$('#subbloque1').animate({height: '0px' }, {duration: 700,specialEasing: {marginLeft: 'easeInOutBack'},complete: function() {}});
			oarray[1]=0;
		}
		$('#subbloque2').animate({height: '0px' }, {duration: 700,specialEasing: {marginLeft: 'easeInOutBack'},complete: function() {}});
		$('#subbloque3').animate({height: '0px' }, {duration: 700,specialEasing: {marginLeft: 'easeInOutBack'},complete: function() {}});
		
		
		
		
		
		
		oarray[2]=0;
		oarray[3]=0;
	
		return false;
  });
  
  $('.enl2').click(function(){
							
	   if ($('#subbloque2').height()==0)
	   {
		$('#subbloque2').animate({height: '780px' }, {duration: 700,specialEasing: {marginLeft: 'easeInOutBack'},complete: function() {}});
		oarray[2]=1;
	   }else{ 
		$('#subbloque2').animate({height: '0px' }, {duration: 700,specialEasing: {marginLeft: 'easeInOutBack'},complete: function() {}});
		oarray[2]=0;
	   }
		$('#subbloque1').animate({height: '0px' }, {duration: 700,specialEasing: {marginLeft: 'easeInOutBack'},complete: function() {}});
		$('#subbloque3').animate({height: '0px' }, {duration: 700,specialEasing: {marginLeft: 'easeInOutBack'},complete: function() {}});
		
		
		
		oarray[1]=0;
		oarray[3]=0;
		
		
		return false;
  });
  
  
  $('.enl3').click(function(){
	  
	    if ($('#subbloque3').height()==0){
		$('#subbloque3').animate({height: '950px' }, {duration: 700,specialEasing: {marginLeft: 'easeInOutBack'},complete: function() {}});
		oarray[3]=1;
		}else{
		$('#subbloque3').animate({height: '0px' }, {duration: 700,specialEasing: {marginLeft: 'easeInOutBack'},complete: function() {}});
		oarray[3]=0;
		}
		$('#subbloque2').animate({height: '0px' }, {duration: 700,specialEasing: {marginLeft: 'easeInOutBack'},complete: function() {}});
		$('#subbloque1').animate({height: '0px' }, {duration: 700,specialEasing: {marginLeft: 'easeInOutBack'},complete: function() {}});
		
		
		oarray[1]=0;
		oarray[2]=0;
		
		
		return false;
  });
  
 



}
