URLBaseRelativ='/';
DocDirectoryRelativ='/document/';

function closeQ(Question) {
	var framenoframe_element;
	framenoframe_element = document.getElementById('Q'+Question);
	framenoframe_element.innerHTML = '<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD class="QCompletLink"><A HREF="JAVASCRIPT:showQ('+Question+');">Afficher la question complète</A></TD></TR></TABLE>';
}
function showQ(Question) {
	LoadURLinDIV(URLBaseRelativ+'search/showq.php?Q='+Question,'Q'+Question);
}
function lien(type,index) {
	if ((index!='')&&(!isNaN(index))) {
		switch (type) {
			case 1:
				document.location=URLBaseRelativ+'donnees/enquetes.php?E='+index;
				break;
			case 2:
				document.location=URLBaseRelativ+'donnees/themes.php?T='+index;
				break;
			case 3:
				document.location=URLBaseRelativ+'donnees/questions.php?Q='+index;
				break;
		}
	}
}
function lienMots(E,T,Q) {
	document.location='mots.php?E='+E+'&T='+T+'&Q='+Q;
}
function Help(page) {
	window.open(URLBaseRelativ+'aide/aide.php?URL='+page,'Aide','menubar=false,resizable=yes,width=360,height=400,scrollbars=1');
}
function openpdf(path) {
	window.open(DocDirectoryRelativ+path,'Enquete','menubar=false,resizable=yes,scrollbars=yes');
}
function UrlFile(URLText) {
	var TmpUrl=URLText;
	a=TmpUrl.indexOf("/");
	b=TmpUrl.indexOf("?");
	alert('/:' + a);
		alert('?:' + b);
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function PreloadMenu() {
MM_preloadImages(URLBaseRelativ+'img/accueil_on.jpg',URLBaseRelativ+'img/recherches_on.jpg',URLBaseRelativ+'img/contact_on.jpg',URLBaseRelativ+'img/aide_on.jpg',URLBaseRelativ+'img/liens_on.jpg')
}
function ValidAuth() {
   if(document.auth.login.value.length<1){
   	alert('Veuillez renseigner le champ \"Identifiant\" !');
	document.auth.login.focus();
	return false;
	}
   if(document.auth.pw.value.length<1){
   	alert('Veuillez renseigner le champ \"Mot de passe\" !');
	document.auth.pw.focus();
	return false;
	}
	return true;
}
function SendAuth() {
	if (ValidAuth()) { 
		document.auth.submit();
	}
}

leave=true;

//window.onbeforeunload=Qsatisfaction;




function Qsatisfaction() {
	if (leave) {
	//function Redirect() {
//		var where="/satisfaction.php";
//		var gothere=confirm("You will be taken to "+where+". Is This okay?");
//		if (gothere) { window.location=where; }
//		if (!gothere) { history.go(-1); }
		//}
	}
}



/******************************************
* Popup Box- By Jim Silver @ jimsilver47@yahoo.com
* Visit http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for use
******************************************/

//var ns4=document.layers
//var ie4=document.all
//var ns6=document.getElementById&&!document.all
//
////drag drop function for NS 4////
///////////////////////////////////
//
//var dragswitch=0
//var nsx
//var nsy
//var nstemp
//
//function drag_dropns(name){
//if (!ns4)
//return
//temp=eval(name)
//temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
//temp.onmousedown=gons
//temp.onmousemove=dragns
//temp.onmouseup=stopns
//}
//
//function gons(e){
//temp.captureEvents(Event.MOUSEMOVE)
//nsx=e.x
//nsy=e.y
//}
//function dragns(e){
//if (dragswitch==1){
//temp.moveBy(e.x-nsx,e.y-nsy)
//return false
//}
//}
//
//function stopns(){
//temp.releaseEvents(Event.MOUSEMOVE)
//}
//
////drag drop function for ie4+ and NS6////
///////////////////////////////////
//
//
//function drag_drop(e){
//if (ie4&&dragapproved){
//crossobj.style.left=tempx+event.clientX-offsetx
//crossobj.style.top=tempy+event.clientY-offsety
//return false
//}
//else if (ns6&&dragapproved){
//crossobj.style.left=tempx+e.clientX-offsetx+"px"
//crossobj.style.top=tempy+e.clientY-offsety+"px"
//return false
//}
//}
//
//function initializedrag(e){
//crossobj=ns6? document.getElementById("showimage") : document.all.showimage
//var firedobj=ns6? e.target : event.srcElement
//var topelement=ns6? "html" : document.compatMode && document.compatMode!="BackCompat"? "documentElement" : "body"
//while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!="dragbar"){
//firedobj=ns6? firedobj.parentNode : firedobj.parentElement
//}
//
//if (firedobj.id=="dragbar"){
//offsetx=ie4? event.clientX : e.clientX
//offsety=ie4? event.clientY : e.clientY
//
//tempx=parseInt(crossobj.style.left)
//tempy=parseInt(crossobj.style.top)
//
//dragapproved=true
//document.onmousemove=drag_drop
//}
//}
//document.onmouseup=new Function("dragapproved=false")
//
//////drag drop functions end here//////
//
//function hidebox(){
//crossobj=ns6? document.getElementById("showimage") : document.all.showimage
//if (ie4||ns6)
//crossobj.style.visibility="hidden"
//else if (ns4)
//document.showimage.visibility="hide"
//}
//function showbox(){
//crossobj=ns6? document.getElementById("showimage") : document.all.showimage
//if (ie4||ns6) {
//	crossobj.style.visibility="visible"
//} else if (ns4) {
//	document.showimage.visibility="visible"
//}
//crossobj.style.left=0;
//crossobj.style.top=0;
//
//}

