/* --------------------------------------------
* eden.js
* copyright Acreat Web Technologies
*/
$(function() {
	$("#video_programme").click(function() {
		play_video_thickbox("img/videos/eden_parc.flv", "Eden Parc : pour un quotidien qui respire !", 640, 368);
		return false;
	});
});

/* ---
* play_video_thickbox
*/
function play_video_thickbox(filename, label, width,height) {
	if(!width) var width = 600;
	if(!height) var height = width/(16/9);
	tb_show(label, "#TB_inline?width="+(width-30)+"&height="+(height+4));
	$("#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: "0xF4823B",
			backcolor: "0xA857A8",
			frontcolor: "0xFFFFFF",
			image: filename + ".jpg",
			autostart: true,
			displayclick:"none"
		}
	}, { expressInstall: true });
}

/* ---
* GOOGLE MAP
*/
function EdenGIcon(img) {
	var icon = new GIcon();
	icon.image='img/gmap/'+img;
	icon.shadow='img/gmap/icon_shadow.png';
	icon.iconSize=new GSize(31,37);
	icon.shadowSize=new GSize(64,36);
	icon.iconAnchor=new GPoint(15,37);
	icon.infoWindowAnchor=new GPoint(15,5);
	return icon;
}

/* ---
* switch_eden_gicon
*/
function switch_EdenGIcon(marker, type) {
	var new_img = marker.getIcon().image.replace(type == "off" ? "_on" : "_off", type == "off" ? "_off" : "_on");
	marker.setImage(new_img);
	return;
}

