var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
//RegionList = new Array("Aquitaine", "Auvergne", "Corse");
RegionList = new Array("Alsace", "Aquitaine", "Auvergne", "Bourgogne", "Bretagne", "Centre", "Champagne", "Franche-Comte", "Haute-Normandie", "Ile-de-France", "Limousin", "Lorraine", "Midi-Pyrenees", "Nord-Pas-de-Calais", "Provence-Alpes-C-A", "Pays-de-la-Loire", "Picardie", "Poitou-Charentes", "Rhone-Alpes", "Monaco", "Guadeloupe");

function downloadPDF(PDF){
	if (PDF != "0") { window.location.href = PDF;}
}

function affich(nomDiv,value) {
	   var maDiv = document.getElementById(nomDiv);
		if( document.getElementById(nomDiv).style.visibility == "visible" ) {
			maDiv.style.visibility = "hidden";
			maDiv.style.position = 'absolute';
		} else if (value == true) {
		  maDiv.style.visibility = "visible";
			maDiv.style.position = 'relative';
		} else {
			maDiv.style.visibility = "hidden";
			maDiv.style.position   = 'absolute';
		}
	}

function setSize() {
	var iframeElement = document.getElementById('iframeTarifs'); 
	iframeElement.style.height = 100; //100px or 100% 
	iframeElement.style.width = 100; //100px or 100%
}
	
function loadIframe(iframeName, URLframe) {
 	var iframeElement = document.getElementById('iframeTarifs'); 
	
	if (URLframe == "textes/tarifs_carte/start.html" ) {
				iframeElement.style.height = 30; 
				//iframeElement.style.width = 100; //100px or 100%
	} else {
 				iframeElement.style.height = 300; 
 	}
 				
  if ( window.frames[iframeName] ) {
		window.frames[iframeName].location = URLframe;   
		return false;
  }
  else return true;
}
	
function affichconteneur(nomContent) {
	var nomDiv;
		//alert('affichconteneur REGION : '+ nomContent);
		if (nomContent == "start") {
			loadIframe("iframeTarifs","textes/tarifs_carte/"+nomContent+".html");
		} else {
			loadIframe("iframeTarifs","pointventes.php?region="+nomContent);
		}
}

function affichconteneur2(nomContent) {
	var nomDiv;
		//alert('affichconteneur VILLE : '+ nomContent);
		if (nomContent == "start") {
			loadIframe("iframeTarifs","textes/tarifs_carte/"+nomContent+".html");
		} else {
			loadIframe("iframeTarifs","pointventes.php?ville="+nomContent);
		}
}

function carteFlash_DoFSCommand(command, args)                {
  var carteFlashObj = InternetExplorer ? carteFlash : document.carteFlash;
	 	if (command == "send_var")  { affichconteneur(args) };
	 	if (command == "send_var2") { affichconteneur2(args) };
}

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
  navigator.userAgent.indexOf("Windows") 
!= -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
  document.write('<SCRIPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('Sub carteFlash_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call carteFlash_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  document.write('</SCRIPT\> \n');
} 