
function loadScroll(actif,contenu,contenant){
	if(actif){
		var csstop = contenu.css("top");
		csstop = parseInt(csstop);
		alert(window.height());
		/*
		if(-csstop<=contenu.height()-contenant.height()){
			csstop = csstop-1;
			//alert(csstop);
			contenu.css("top",csstop+"px");
		}else{
			contenu.css("top","0px");
		}
		*/
	}
}
$(document).ready(function(){	
	$('.scroll-pane').each(function(){
		$(this).jScrollPane({scrollbarWidth:10,showArrows:true});

	});

	$('.scroll-pane-home').each(function(){
	    $(this).jScrollPane({scrollbarWidth:10,showArrows:false});

	});
	/*var selectMiddle = $(".selecteur .thema-middle").height();
	var contentMiddle = $(".content-thema .content-thema-middle").height();
	if(selectMiddle>contentMiddle) 
		$(".content-thema .content-thema-middle").css("height",(selectMiddle+8)+"px");
	else 
		 $(".selecteur .thema-middle").css("height",(contentMiddle-3)+"px")*/
		 
	if($("li .Cols .colLeft").height()>$("li .Cols .colRight").height()){
		$("li .Cols .colRight").css("height",($("li .Cols .colLeft").height()-2)+"px");
	}else{
		$("li .Cols .colLeft .in").css("height",($("li .Cols .colRight").height()-57)+"px");
	}
	
	/*
	if($(".selecteur .thema-middle ul").height()>$(".selecteur .thema-middle").height()){
		$(".selecteur .thema-bottom").addClass("thema-bottom-act");
		$(".selecteur .thema-bottom").hover(function(){
			$(".selecteur .thema-middle ul").addClass("act");
			setInterval(function() {
				if($(".selecteur .thema-middle ul").hasClass("act")){
					//if((-$(".selecteur .thema-middle").height()))
					loadScroll(true,$(".selecteur .thema-middle ul"),$(".selecteur .thema-middle"));
				}
			}, 50);
		},function(){
			$(".selecteur .thema-middle ul").removeClass("act");
		});	
	}
	*/
	/*
	if($(".content-thema-middle .texte").not(".scroll").height()>$(".content-thema-middle ").height()){
		$(".scroll").show();
		$(".scroll").hover(function(){
			$(".content-thema-middle .texte").not(".scroll").addClass("act");
			setInterval(function() {
				if($(".content-thema-middle .texte").not(".scroll").hasClass("act")){
					//if((-$(".selecteur .thema-middle").height()))
					loadScroll(true,$(".content-thema-middle .texte").not(".scroll"),$(".content-thema-middle"));
				}
			}, 10);
		},function(){
			$(".content-thema-middle .texte").not(".scroll").removeClass("act");
		});	
	}else{
		$(".content-thema-middle .scroll").hide();
	}
	*/
	$("ul.devis").children("li").children("a").each(function(){
		$(this).click(function(){
			if($(this).hasClass("actif")){
				$(this).removeClass("actif");
			}else{
				$(this).addClass("actif");
			}
			$(this).next("ul").slideToggle("slow");
			return false;
		});
	});
	/*$(".theme a.choose").click(function(){
		$(this).next("ul").slideToggle();
		return false;
	});*/
	$("textarea").click(function(){if(!$(this).hasClass("act")){$(this).val("");$(this).addClass("act");}});
	$("input").click(function(){if(!$(this).hasClass("act")){$(this).val("");$(this).addClass("act");}});
	
	$(".theme a.choose").parent().parent().parent().hover(function(){
		$(this).children("ul").children("li").children("ul").show();
		return false;
	},function(){
		$(this).children("ul").children("li").children("ul").hide();
		return false;	
	});
	$(".zoom .content-zoom .carte").children("ul").hover(function(){
		$(this).children("li").children("ul").show();
		return false;
	},function(){
		$(this).children("li").children("ul").hide();
		return false;	
	});
});

