var global_chemin_url = "http://www.marine.futin.fr/";
var global_chemin_url_images = "http://www.marine.futin.fr/";





	function dcd_m(val)
	{
		var l_val = val.length;
		var code = "";
		var result = "";

		for(i=0; i<l_val; i+=3)
		{
			code = val.substr(i, 3)-3;
			result += String.fromCharCode(code);
		}

		return result;
	}


// ******************************** Pour la gestion des flash ******************************** //


// Variables globales
// Version majeure de Flash requise
var requiredMajorVersion = 9;
// Version mineure de Flash requise
var requiredMinorVersion = 0;
// Révision de Flash requise
var requiredRevision = 0;
// Version de javascript prise en charge
var jsVersion = 1.0;

var msg_deja_affiche = false;

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function aff_bal(ch)
{
	document.write(ch);
}

function insert_flash(p_src,p_name,p_width,p_height) {

	if (p_src.indexOf(".flv")>=0){
		var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
		if(hasRightVersion) {  // if we've detected an acceptable version
			// embed the flash movie

			AC_FL_RunContent(
				'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0',
				'width', p_width,
				'height', p_height,
				'src', 'PlayerVideo',
				'quality', 'high',
				'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
				'align', 'middle',
				'play', 'false',
				'loop', 'false',
				'scale', 'showall',
				'wmode', 'window',
				'devicefont', 'false',
				'id', 'PlayerVideo',
				'bgcolor', '#ffffff',
				'name', 'PlayerVideo',
				'menu', 'true',
				'allowScriptAccess','sameDomain',
				'allowFullScreen','true',
				'movie', 'PlayerVideo',
				'salign', '',
				'flashvars', 'nomflv='+p_src
				); //end AC code
		}
		else{
			// flash is too old or we can't detect the plugin
			var alternateContent = 'Alternate HTML content should be placed here.'
				+ 'This content requires the Adobe Flash Player.'
				+ '<a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
			document.write(alternateContent);  // insert non-flash content
		}
	}
	else{
		var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
		if(!hasRightVersion) {  // si nous avons détecté une version acceptable
			if (!msg_deja_affiche)
			{
				msg_deja_affiche = true;

				var alternateContent = 'Pour visualiser correctement cette page vous avez besoin du Flash&nbsp;Player&nbsp;'+requiredMajorVersion+'.'
				+ '<br /><a href="http://www.macromedia.com/go/getflash/" class="text-normal-lien" target="_blank">T&eacute;l&eacute;charger Flash&nbsp;Player</a><br />';
				document.write(alternateContent);  // Insérer contenu non-Flash
			}
		}
		document.write('<embed src="' + p_src + '" name="' + p_name + '" width="' + p_width + '" height="' + p_height + '" wmode="transparent" quality="high"  align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	}
}




// ****************************** Fin pour la gestion des flash ****************************** //



// ******************************* Pour la gestion des formulaires ****************************//

function valider_moteur_recherche(){
	var f = document.form_moteur_recherche;
	var mot_recherche = f.query.value;
	if (valeur==1){stat('marine-futin','','','recherche;'+mot_recherche);}
	f.submit();
}

function valider_moteur_recherche_2(){
	var f = document.form_moteur_recherche_2;
	var mot_recherche = f.query.value;
	if (valeur==1){stat('marine-futin','','','recherche;'+mot_recherche);}
	f.submit();
}

// ***************************** Fin pour la gestion des formulaires **************************//


// ajouter aux favoris
function add_to_favoris(){
	var titre = "Andra, agence nationale pour la gestion des déchets radioactifs";
	var url = document.location.href;
	if(navigator.appName != 'Microsoft Internet Explorer' ){
		window.sidebar.addPanel(titre,url,"");
	}
	else{
		window.external.AddFavorite(url,titre);
	}
}

var stateHelpLayer = 0;
function showHelpLayer() {
	if (stateHelpLayer == 0){
		$('#cover_layer,#cover_layer_text').show();
		stateHelpLayer = 1;
	}
	else {
		$('#cover_layer,#cover_layer_text').hide();
		stateHelpLayer = 0;
	}
	
	
}


$(document).ready(function() {
	
	if($.browser.msie==true && $.browser.version<7) {
        DD_belatedPNG.fix('.pngfix'); 
        superfish('.hoverfix');
    }
    
   
	$('#cover_layer,#cover_layer_text').click(
		
		function () {
			$('#cover_layer,#cover_layer_text').hide();
		}
	); 
    
			$('a').each(function(ind, obj) {
			var href = $(this).attr('href');
			if (href) {
				var arr_match = href.match(new RegExp('\\\.pdf|\\\.xls|\\\.doc|\\\.exe', 'gi'));
				if (arr_match && arr_match.length) {
					var pos_slash = href.lastIndexOf('/');
					var doc = (pos_slash>-1) ? href.substring(pos_slash+1): href;
					doc = (doc);
					$(this).click(function() {
						if (valeur==1){stat('marine-futin','','','telechargement doc;'+doc);}
					});
				}
			}
		});
		});

