
//////////////////////////////////////////////////////////////////
// Bibliotheque javascript pour la visite
////////////////////////////////////////////////////

var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;
var ie7 = false;
if(ie4)
{
	var strChUserAgent = navigator.userAgent; 
	var intSplitStart = strChUserAgent.indexOf("(",0);
	var intSplitEnd = strChUserAgent.indexOf(")",0);
	var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);
	if((strChMid.indexOf("MSIE 7") != -1) || (strChMid.indexOf("MSIE 8") != -1))  ie7 = true;
}

function writeToDiv(lay,txt) {
	if (ie4 && !ie7) {
	document.all[lay].innerHTML = txt;
	}
	if(ie7){
	document.getElementById(lay).innerHTML = txt;
	}
	if (ns4) {
	document[lay].document.write(txt);
	document[lay].document.close();
	}
	if (ns6) {
	over = document.getElementById([lay]);
	range = document.createRange();
	range.setStartBefore(over);
	domfrag = range.createContextualFragment(txt);
		while (over.hasChildNodes()) {
			over.removeChild(over.lastChild);
		}
	over.appendChild(domfrag);
	}
}

function isEmptyDiv(lay) {
	if (ie4 && !ie7) {
		if(document.all[lay].innerHTML=='') return true;
		else return false;
	}
	if(ie7){
		if(document.getElementById(lay).innerHTML=='') return true;
		else return false;
	}
	else return true;
}

// return the value of the radio button that is checked
// return an empty string if none are checked, or
// there are no radio buttons
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

//
// Affiche un pop-up contenant le fichier désigné et lui donne le focus
//
function PopUp_Display (Filename, width, height, top, left) 
{ 
	window.open(Filename, "Information", "resizable=1, menubar=0, location=0, toolbar=0, scrollbars=1, width="+width+", height="+height+", top="+top+", left="+left).focus();
}

