
/***
*   FONCTION D'OUVERTURE DU SHADOWBOX D'ENVOI A UN AMI
***/
function envoyerAunAmi(url){
    Shadowbox.open({
        content:    '/wp-content/themes/septime/popup/envoi-ami.php?url='+url,
        player:     "iframe",
        title:      "",
        width: 625,
        height: 460
    });

}

/***
*   FONCTION D'OUVERTURE DU SHADOWBOX POUR LES ACTUS ET LES EVENEMENTS
***/
function openSB(url){
	Shadowbox.open({
        content:    url,
        player:     "iframe",
        title:      "",
        width: 700,
        height: 600
    });
}

/* charge un fichier pour la carte */
function getJS(file) {
	var response = $.ajax({
		url: file,
		type: "GET",
		async: false,
		dataType: "text",
		cache : true,
		error: function(XMLHttpRequest, textStatus, errorThrown) {
				alert('Error - '+textStatus + ' -- ' + errorThrown + file);
		},
		success: function(data) {
				//alert(data);
		}
	});

	return response.responseText ;
}

/* Met en selected l'item du menu cible demandé */
function rappelerContexteCible(postID) {
	var objMenu = document.getElementById("menu-menu-vous-etes").getElementsByTagName('li');
	for(i=0; i<objMenu.length; i++) {
		if (objMenu[i].id.indexOf(postID)>0) {
			lienMenu = objMenu[i].getElementsByTagName('a');
			lienMenu[0].className='selected';
		}
	}
}


function afficherDiapo(pid,sc_gallery_change_delay,sc_gallery_fade_duration) {

	var hauteurDocument = $(window).height();
	if (swfobject.hasFlashPlayerVersion("9.0.124.0")) {
		var flashvars = {
			ON_LOAD: 'javascript:void(0);',
			ON_CLICK: 'javascript:void(0);',
			CHANGE_DELAY: sc_gallery_change_delay,
			FADE_DURATION: sc_gallery_fade_duration,
			XML_URL: escape('http://www.rn2d.net/wp-content/plugins/gallery/gallery.xml.php?pid=' + pid + '&hauteurDocument=' + hauteurDocument)
		};
		var params = {wmode:"transparent"};
		var attributes = {};
		swfobject.embedSWF("/wp-content/themes/septime/inc/swf/diaporama.swf", "diaporama", "100%", "100%", "9.0.124.0", "", flashvars, params, attributes);
	}
	else {
		document.getElementsByTagName('body')[0].className = 'sansFlash';
		document.getElementById('diaporama').style.display = 'none';
	}
	
}

