var futura = {src: FONT_LOCATION+'helvetica-lite.swf'};

sIFR.activate(futura);

sIFR.replace(futura, {
	selector: 'h1.heading',
	fitExactly: true,
	css: [
		'.sIFR-root { font-size: 24px; color: #ffffff; letter-spacing: 1; }',
		'strong { font-style: bold; }',
		'em { font-style: italic; }'
		],
	wmode: 'transparent'
});

sIFR.replace(futura, {
	selector: 'h2.heading',
	fitExactly: true,
	css: [
		'.sIFR-root { font-size: 16px; color: #666666; letter-spacing: 1; }',
		'strong { font-style: bold; }',
		'em { font-style: italic; }'
		],
	wmode: 'transparent'
});

sIFR.replace(futura, {
	selector: 'h2.center',
	css: [
		'.sIFR-root { font-size: 16px; color: #666666; letter-spacing: 1; text-align: center; }',
		'strong { font-style: bold; }',
		'em { font-style: normal; color: #999999; }'
		],
	wmode: 'transparent'
});

$(document).ready(function() {
	Shadowbox.init();
	$(".sig a").tooltip({
		extraClass: "pla_sig",
	    track: true,
	    delay: 0,
	    showURL: true,
	    showBody: " :: "
	});
	$("input[type=text],input[type=password],textarea").each(function() {  
		$(this).focus(function() { 
			if($(this).val()==this.defaultValue) $(this).val(""); 
		});
		$(this).blur(function() { 
			if($(this).val()=="") $(this).val(this.defaultValue); 
		});
	});
	$(".gite_bloc").equalHeights();
});

$.listen("click","a.shadowbox",function() {
	Shadowbox.open({
		player: "img",
		title: $(this).attr("title"),
		content: $(this).attr("href")
	});
	return false;
});

$.listen("click","a.suite",function() {
	var div = $(this).parents(".resume:first");
	div.html(div.find("span.full").html());
});

function GoogleMaps(lat,lng) {
    Shadowbox.open({
        player: "html",
        title: "Plan d'Accès Google Maps",
        content: "",
        width: 750,
        height: 500,        
        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 VisiteVirtuelle(src,title) {
	Shadowbox.open({
        player: "iframe",
        title: "Visite Virtuelle - "+title,
        content: "templates/media/"+src+"/index.html",
        width: 650,
        height: 430
    });
}

function ZoomDrag(img,title) {
	Shadowbox.open({
        player: "img",
        title: title+" - déplacer la carte avec votre souris",
        content: "templates/media/"+img,
        options: { handleOversize: "drag" }
    });
}

function Lang(CODE_PAYS) {
	$.ajax({
		type: "POST",
		url: SITE_PATH+"content/ajax/Ajax_Lang.php",
		data: "lang="+CODE_PAYS,
		success: function(data){
			document.location.reload(true);
		}
	});
}