<!--
function openDetailsWindow(theURL) { //v2.0
 var theWindow = window.open(theURL,'popup','toolbar=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=680,height=500');
theWindow.focus();
}


function openJPGWindow(theURL,w,h) { //v2.0
  var width=w, height=h;
var left = (screen.width/2) - width/2;
var top = (screen.height/2) - height/2;
var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
var ImageWindow = window.open("","ImageWindow", styleStr);
var head = '<html><head><title>Image</title>\n';
head = head+'<style type="text/css">body {margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px;}</style></head>\n';
var bbody ='<body onBlur="self.close();">\n<img src="'+theURL+'" width="'+w+'" height="'+h+'" alt="Image" name="openJPGWindow" id="openJPGWindow">\n</body></html>';
//alert(ImageWindow.document.getElementsByTagName("html"));
if (ImageWindow.document.getElementById("openJPGWindow")){
$currentJPG=ImageWindow.document.getElementById("openJPGWindow");
$currentJPG.src=theURL;
$currentJPG.width=w;
$currentJPG.height=h;
ImageWindow.resizeTo(w,h);
}else{
ImageWindow.document.write(head+bbody);
}
ImageWindow.focus();
}

function openEditWindow(theURL) { //v2.0
var theWindow =window.open(theURL,'popupedit','toolbar=no,status=yes,menubar=no,resizable=yes,scrollbars=yes,width=920,height=700');
theWindow.focus();
}
function openWebArtchitecteWindow(theURL) { //v2.0
var theWindow =window.open(theURL,'popup','toolbar=no,status=yes,menubar=no,resizable=yes,scrollbars=yes,width=400,height=300');
theWindow.focus();
}
function openOptionsWindow(theURL) { //v2.0
 var theWindow = window.open(theURL,'popup','toolbar=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=375,height=300');
theWindow.focus();
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  var theWindow =window.open(theURL,winName,features);
theWindow.focus();
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function delArticle(url){
 if (confirm("Voulez-vous vraiment supprimer cet article?\nCet article peut être présent dans une autre page...")) {
           document.location=url;
  }
}
function OpenCartes(URLtoOpen){
var w1 = screen.width/2-380;
var h1 = screen.height/2-285;
var w2 = 760;
var h2 = 570;
window.open(URLtoOpen,'carte','status=yes,width='+w2+',height='+h2+',top='+h1+',left='+w1+'');
}
//FILE MANAGER #################################################################
//##############################################################################
function confirmDelFile(delUrl,delFile,strMessage){
	//alert(delUrl);
	var agree=confirm(strMessage+delFile+" ?");
	if (agree)location.href = "http://www.tourisme-gaspesie.com/"+delUrl;
	else return false ;
}

function validateFile(theForm,transfertType){
	extArray = new Array(".txt",".php",".php3",".exe",".htm",".html");
	mess = "Les fichiers de types :  " + (extArray.join("  ")) + " ne sont pas valides.\n";
	//alert(theForm.inFile.value);
	file = theForm.userfile.value;
	if(theForm.userfile.value == ""){
		alert("Impossible, aucun fichier.");
	}else{
		allowSubmit = true;
		if(transfertType == "normal"){
			//alert(file);
			
			/*while (file.indexOf("\\") != -1)
				file = file.slice(file.indexOf("\\") + 1);
				ext = file.slice(file.indexOf(".")).toLowerCase();
				for (var i = 0; i < extArray.length; i++) {
					if (extArray[i] == ext) { 
						allowSubmit = false;
						break; 
					}
				}*/
			if(!allowSubmit){
				alert(mess);
			}else{
				theForm.actionField.value = 'normal';
			//	kmLoadingV2();
				theForm.submit();
			}
		}else if(transfertType == "user"){
			theForm.actionField.value = 'user';
		//	kmLoadingV2();
			theForm.submit();
		}
	}
	
}
function showHideRange(val){
	var elem = document.getElementById("timeRange");
	var elem2 = document.getElementById("selTimeRange");
	var divtimeOption=document.getElementById("timeOption");
	switch(val){
		case "modification":
		elem.disabled =false;
		elem2.disabled =false;
		elem.readOnly =true;
		divtimeOption.style.display = "block";
		break
		
		case "consultation":
		elem.disabled =true;
		elem2.disabled =true;
		divtimeOption.style.display = "none";
		break
	}
	
}
function checkValidFile(tR,like){
	var theString =tR.userfile.value;
	var urlArray = theString.split("\\");
	var theFile = urlArray[urlArray.length-1];
	theFile = theFile.toLowerCase();
	//alert(theFile);
	if(like != theFile){
		alert(" Le fichier [ "+theFile+" ] est différent de [ "+like+" ] \n Il ne pourra etre chargé. Veuillez vérifier le nom du fichier à charger")
		return false;
	}
	return true;
}
function attTimeRangeVal(){
	var elem = document.getElementById("timeRange");
	var elem2 = document.getElementById("selTimeRange");
	elem.value = elem2.options[elem2.selectedIndex].value;
	
	
}
function checkValidNum(tR){
	//cons = document.getElementById("consultation");
	mod = document.getElementById("modification");
	if(mod.checked){
		if(tR.timeRange.value == ""){
			alert("La valeur saisie est invalide.");
			return false;
		}else{
			//window.opener.location.reload();
			return true;
		}
	}
}
//###############################################################
//###############################################################

