$(document).ready(function() {
	
	// Prechargement
	$("a.preload").preload();
	
	// Shadowbox
	Shadowbox.init();

	$(".iframe").click(function() {
		Shadowbox.open({
			player: 'iframe',
			title: $(this).attr("title"),
			content: $(this).attr("href"),
			width: 780,
			height: 490
		});
		return false;
	});
	
});

var helvetica = {src: FONT_LOCATION+'helvetica.swf'};
var helveticacond = {src: FONT_LOCATION+'helvetica-cond.swf'};
var helveticathin = {src: FONT_LOCATION+'helvetica-thin.swf'};

sIFR.activate(helvetica);
sIFR.activate(helveticacond);
sIFR.activate(helveticathin);

sIFR.replace(helveticathin, {
	selector: 'h1.etabNom',
	css: [
		'.sIFR-root { font-size: 15px; color: #eeeeee; text-align: center; letter-spacing: 2 }',
		'strong { font-style: bold; }',
		'em { font-style: normal; color: #2873b4; }'
		],
	wmode: 'transparent'
});

function GoogleMaps(lat,lng) {
    Shadowbox.open({
        player: "html",
        title: "Plan d'Accès Google Maps",
        content: "",
        height: 500,
        width: 750,
        options: {
            onFinish: function(item){
                if(GBrowserIsCompatible()){
                    var map = new GMap2(document.getElementById("shadowbox_content"));
                    map.setCenter(new GLatLng(lat, lng), 13);
                    var point = new GLatLng(lat,lng);
                    map.addOverlay(new GMarker(point));     
                    map.addControl(new GSmallMapControl());
                    map.addControl(new GMapTypeControl());
                }
            }
        }
    });
}

function NousContacter(etab) {
	Shadowbox.open({
		player: 'iframe',
		title: "Nous Contacter",
		content: "content/pages/contact.php?etab="+etab,
		height: 330,
		width: 640
	});
}