var pav_standard ={
		maxHeight: '270px',
		minHeight: '26px',
		active: 0
	};

var pav_actu = {};
var pav_bonplan = {};
var pav_webcam = {};
var pav_resa = {};
var pav_meteo = {};

function openItem(item){
			if(($(item).css("height")=="26px")||($(item).css("height")=="55px")){
				urlImg = $('div.label img', item).attr('src');
				urlImg = urlImg.substr(0,(urlImg.length-6));
				urlImg = urlImg+'on.gif';
				
				$('div.label img', item).attr({src:urlImg})
				//console.log($(item).attr('id'));
				switch($(item).attr('id')){
					case 'pav_meteo':					  
						$(item).animate({height: "130px"},500)
					  break;
					case 'pav_resa':					  
						$(item).animate({height: "170px"},500)
					  break;
					case 'pav_webcam':					  
						$(item).animate({height: "170px"},500)
					  break;
					default:
						$(item).animate({height: "270px"},500)
				}
			}
}
function closeItem(item){
		
		urlImg = $('img', item).attr('src');
		urlImg = urlImg.substr(0,(urlImg.length-6));
		urlImg = urlImg+'of.gif';
		
		if($(item).parent(".transpoff").attr('id') == "pav_meteo"){
			//console.log($(item).parent(".transpoff").attr('id'));
			$(item).parents(".transpoff").animate({height: "55px"},500);
		}else{
			$(item).parent(".transpoff").animate({height: "26px"},500);
		}
		$('img', item).attr({src:urlImg})
}


$(document).ready(function(){
	$("#content").css("overflow","hidden");
	$(".visu_off").css({
		display: "block",
		marginTop: "4px"
	});
	$(".transpoff").css({
		overflow: "hidden",
		height: "26px"
	}).mouseover(function(){
		openItem(this);
	}).each(function (i) {
		openItem(this);
	});
	$(document).oneTime(2000, function() {
		$(".transpoff div.label").each(function(){
			closeItem(this);
		});
	});
	$(".transpoff div.label").mouseup(function () {
		
		closeItem(this);
		
		/*urlImg = $('img', this).attr('src');
		urlImg = urlImg.substr(0,(urlImg.length-6));
		urlImg = urlImg+'of.gif';
		
		$(this).parents(".transpoff").animate({height: "26px"},500)
		$('img', this).attr({src:urlImg})*/
	});
})