/*
 * Kerbea - Acreat - http://www.acreat.com
 */
 
/* ---
 * body onload 
 */
 $(function() {
 
	/* ---
	* TROUVER UN CONSTRUCTEUR
	*/

	// boutton
	$("#trouver_franchise").hover(function() {
		$("#trouver_franchise_liste").fadeIn();
		$("#trouver_franchise_bt").addClass("on");
	}, function() {
		$("#trouver_franchise_liste").fadeOut("slow", function() { 
			if($.cookie('franchise'))
				$("#trouver_franchise_bt").removeClass("on"); 
		});
		
	});
	
	// click sur le département
	$("#trouver_franchise_liste LI A").click(function() {
		$("#trouver_franchise_liste LI UL").hide();
		$("UL", $(this).parent()).fadeIn();	
		return false;
	});
	
 });
 
 
 
/* ---
 * set_franchise 
 */
 function set_franchise(idFranchise,popup) {
	$.cookie('franchise', idFranchise);
	if(popup) {
		var src = "./?controller=franchise&action=news&id=" + idFranchise; 
		var w = 400;
		var h = 400;
		var top = (screen.height-h)/2;
		var left = (screen.width-w)/2;
		window.open (src, "news", "height="+h+", width="+w+", toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no, left="+left+", top="+top);
	}
	document.location.reload();
 }
 
/* ---
* play_video_thickbox
*/
function play_video_thickbox(filename, label) {
	var width = 550;
	var height = 440;
	tb_show(label, "#TB_inline?width="+(width-30)+"&height="+(height+5));
	$("#TB_ajaxContent").html("<div id='video'></div>");
	$("#TB_ajaxContent").css("padding", 0);
	$("#TB_ajaxContent").css("width", width);
	$("#TB_ajaxContent").css("overflow", "hidden");
	
	$('#video').flash({
		src: 'flvplayer.swf',
		width: width,
		height: height,
		wmode: "opaque",
		flashvars: { 
			file: filename,
			lightcolor: "0xFFFFFF",
			backcolor: "0xE3001B",
			frontcolor: "0xFFFFFF",
			logo: "img/logo.video.png",
			image: filename + ".jpg",
			autostart: true,
			displayclick:"none"
		}
	}, { expressInstall: true });
} 