/**
 * @author Ismael Sleifer
 */
$(document).ready(function(){
	$('.png').pngFix();
	if($(window).height() > 545){
		$('#container').height($(window).height() - 2)
		$('#icentro').height($(window).height() - 155);
		$('#containercentro').height($(window).height() - 151);
	}
	
	$(window).resize(function(){
		if($(window).height() > 545){
			$('#container').height($(window).height() - 2)
			$('#icentro').height($(window).height() - 155);
			$('#containercentro').height($(window).height() - 151);
		}
	})
	
	$('#popup').delay(20000, function(){
		$('#popup').hide(300);
	})
//	$('#popup2').delay(20000, function(){
//		$('#popup2').hide(300);
//	})
	
//	$('#popup').easydrag();
//	$('#popup').show();
	$('#popup').easydrag();
	$('#popup').show();
	
	$('#popup')
	.css("top" ,  ($(window).height() / 2)  - ($('#popup').height() / 2))
	.css("left",  ($(window).width()  / 2)  - ($('#popup').width()  / 2));
//	$('#popup2')
//	.css("top" ,  ($(window).height() / 2)  - ($('#popup2').height() / 2))
//	.css("left",  ($(window).width()  / 2)  - ($('#popup2').width()  / 2));
	
//	var pos = Math.floor(Math.random() * 2 + 1)
//	function position(pos){
//		if(pos == 1){
//			$('#fechar').css('width', 448);
//			$('#popup').css('width', 448);
//		}
//		else if(pos == 2){
//			$('#fechar').css('width', 544);
//			$('#popup').css('width', 544);		
//		}
//		
//	}
//	$('#popup').delay(1000, function(){	
//		position(pos)

//		
//		
//		$('#popup').fadeIn('slow');
////		$('#l' + pos).show();
//		$('#l' + pos).fadeIn();
//		repeat(pos)
//	});


//	function repeat(pos){
//		$('#popup').delay(10000, function(){
//			$('#l' + pos).hide();
//			if(pos == 2)
//				pos = 1;
//			else
//				pos++
//			$('#l' + pos).fadeIn(1000);
//			position(pos)
//			repeat(pos)
//		})
//	}
//	$('#fechar span').bind('click', function(){
//		$('#popup').hide();
//	});
	$('#fechar span').bind('click', function(){
		$('#popup').hide();
	});

});
