// VP : 30/11/2005 : Type thesaurus dans showAndInitRechInd()// VP : 22/11/2005 : Test existance dans MaJChamp()// VP : 07/11/2005 : Modification retour valeurs dans MaJChamp()// XS : 18/10/2005 : Ajout de la fonction "explodeArray()" + Simplification du traitement des index, utilisation de la seule fonction "showAndInitRechInd()"// XS : 13/10/2005 : Modif de MaJChamp pour que les valeurs du champs input se concatennent// XS : 05/10/2005 : Modification de la  fonction "removeLine()", ajout d'un param�tre "type" + Ajout de la gestion des cancels (retour de la fonction "confirm()") dans "removeLine()" et "removeAll()"// XS : 27/09/2005 : Fonction affiche/cache qui permet d'afficher/chacher des �l�ments + Cr�ation de "removeAll()"// JC : 17/06/2005 : rajout d'un fonction pour se connecter facilement (d�mo opsis uniquement)// JC : 01/06/2005 : rajout de quelques fonctions pour la recherche avanc�e// JavaScript Document/** Récupère la valeur d'un paramètre dans une url. IN: param, OUT:valeur (string) **/function getURLParam(strParamName){  var strReturn = "";  var strHref = window.location.href;  if ( strHref.indexOf("&") > -1 ){    var strQueryString = strHref.substr(strHref.indexOf("&")).toLowerCase();    var aQueryString = strQueryString.split("&");    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){      if (aQueryString[iParam].indexOf(strParamName + "=") > -1 ){        var aParam = aQueryString[iParam].split("=");        strReturn = aParam[1];        break;      }    }  }  return strReturn;}function checkAll() {    // fonction appelee lors du clic sur une checkbox    var compteur = 0;    for (var j = 1; j <= document.form1.length-1; j++) {    box = eval("document.liste.checkbox" + j);     if (box.checked == true) compteur += 1;   }   //alert("You selected " + compteur + " boxes.");    compteurPanier(compteur);}function compteurPanier(valeur){    // fonction qui affiche dans le compteur du panier le nombre de document selectionnes    //if(valeur!=null) document.all['compteur'].innerHTML=valeur;    if(valeur!=null) document.panier.compteur.value=document.panier.compteurref.value+valeur;    else document.write('0');}function reloadIframe(id){    var url;    box = eval("document.documentSelection.checkbox" + id);    if(box.checked==true) url="iframePanier.php?ajouteDoc="+id;    else url="iframePanier.php?enleveDoc="+id;    document.getElementById('framePanier').src=url;}function ajouterPanier(id){    document.getElementById('framePanier').src="iframePanier.php?ajouteDoc="+id;}function addItem() {    document.form1.commande.value="ADD";    document.form1.submit();}function removeVersion(version) {	if (confirm("Confirmez-vous la suppression de cette version ?")) {		document.form1.commande.value="SUP";		document.form1.version2suppr.value=version;		document.form1.submit();		}}function removeItem(url) {    if (confirm("Confirmez-vous la suppression ?")) {        document.form1.commande.value="SUP";        document.form1.page.value=url;        document.form1.submit();        }}function duplicateItem(url) {     if (confirm("Confirmez-vous la duplication ?")) {        document.form1.commande.value="DUP";        if (url!='') document.form1.page.value=url;        document.form1.submit();     }}function save() {    document.form1.commande.value="SAVE";    document.form1.submit();}function saveAndGo(url) {	// Le formulaire doit avoir un champ save_action qui détermine le type de sauvegarde	// à effectuer (ex : doc, sequence, matériel, etc...)	if (!document.form1.save_action) commande="SAVE";	else commande=document.form1.save_action.value;    document.form1.commande.value=commande;    document.form1.page.value=url;    document.form1.submit();}function submitKey() {    if(event.keyCode == 13){        submitForm();    }}function submitForm() {    document.form1.submit();}function goUrl(url) {    document.form1.action=url;    document.form1.submit();}function getSiteRoot() {	url=window.location.href.split('?');	return url[0];}function removeAll() {    if (confirm("Confirmez-vous la suppression de toutes les lignes ?")) {        document.form1.commande.value="SUP_ALL";        document.form1.submit();    }else{        document.form1.commande.value="CANCEL";        document.form1.submit();    }}function removeLine(i,type,action) {    if (confirm("Confirmez-vous la suppression de la ligne ? ")) {        document.form1.ligne.value=i;        if (typeof(action)=='undefined') action="SUP";        document.form1.commande.value=action;        if (type){            document.form1.type.value=type;        }        document.form1.submit();    }else{    	if (typeof(action)=='undefined') action="CANCEL";        document.form1.commande.value=action;        document.form1.submit();    }}function updateLine(i,action) {    document.form1.ligne.value=i;      if (typeof(action)=='undefined') action="SAVE";    document.form1.commande.value=action;    document.form1.submit();}function addLine(i,action) {    document.form1.ligne.value=i;    if (typeof(action)=='undefined') action="ADD";    document.form1.commande.value=action;    document.form1.submit();}function popupWindow(newURL, newName, newFeatures, orgName) {  var remote = open(newURL, newName, newFeatures);    if (remote.opener == null)    remote.opener = window;  remote.opener.name = orgName;  remote.focus();  //return remote;}function popupVideo(newURL,orgName){    if(newURL.indexOf("popUpVisionnage")==0) {    // Appel capsule    popupWindow(newURL, 'Visionnage', 'height=300, width=400,screenX=50,left=50,screenY=50,top=50,fullscreen=0,resizable=0,scrollbars=0,menubar=0,toolbar=0', orgName);    } else {    // Appel player    popupWindow(newURL, 'Visionnage', 'height=400,width=400,screenX=50,left=50,screenY=50,top=50,fullscreen=0,resizable=0,scrollbars=0,menubar=0,toolbar=0', orgName);    }}function popupPrint(newURL,orgName){    popupWindow(newURL, 'Print','height=500,width=500,screenX=100,left=100,screenY=100,top=100,fullscreen=0,resizable=1,scrollbars=1,menubar=1,toolbar=1', orgName);}function popupUpload(newURL,orgName,type){       //alert(window['Upload_'+type]);       // on n'ouvre pas si elle existe déjà car on pourrait annuler un transfert en cours    popupWindow(newURL, 'Upload_'+type,'height=430,width=370,screenX=100,left=100,screenY=100,top=100,fullscreen=0,resizable=1,scrollbars=1,menubar=0,toolbar=0', orgName);}function popupDoc(newURL,orgName){    popupWindow(newURL, 'Document','height=600,width=900,screenX=50,left=50,screenY=50,top=50,fullscreen=0,resizable=1,scrollbars=1,menubar=1,toolbar=1', orgName);}function popupLex(newURL,orgName){    popupWindow(newURL, 'Lexique','height=500,width=600,screenX=350,left=350,screenY=150,top=150,fullscreen=0,resizable=1,scrollbars=1,menubar=0,toolbar=0', orgName);}function popupVal(newURL,orgName){    popupWindow(newURL, 'Valeurs','height=500,width=500,screenX=350,left=350,screenY=150,top=150,fullscreen=0,resizable=1,scrollbars=1,menubar=0,toolbar=0', orgName);}function popupMat(newURL,orgName){    popupWindow(newURL, 'Materiel','height=600,width=500,screenX=300,left=300,screenY=100,top=100,fullscreen=0,resizable=1,scrollbars=1,menubar=0,toolbar=0', orgName);}function popupUsager(newURL,orgName){    popupWindow(newURL, 'Usager','height=600,width=500,screenX=300,left=350,screenY=100,top=100,fullscreen=0,resizable=1,scrollbars=1,menubar=0,toolbar=0', orgName);}function popupSelect(newURL,orgName){    popupWindow(newURL, 'Select','height=500,width=500,screenX=250,left=250,screenY=150,top=150,fullscreen=0,resizable=0,scrollbars=auto,menubar=0,toolbar=0', orgName);}function popupAbout(newURL,orgName){    popupWindow(newURL, 'About','height=200,width=200,screenX=350,left=350,screenY=250,top=150,fullscreen=0,resizable=0,scrollbars=auto,menubar=0,toolbar=0', orgName);}function popupSave(newURL,orgName){    popupWindow(newURL, 'About','height=100,width=400,screenX=350,left=350,screenY=250,top=150,fullscreen=0,resizable=0,scrollbars=auto,menubar=0,toolbar=0', orgName);}function popupImage(img,txt) { 			window.open("popupImage.php?img="+img+"&amp;txt="+txt,'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=yes'); //onblur='window.close()' onclick='window.close()'} function popupInfo(newURL,orgName){    popupWindow(newURL, 'Info','height=400,width=790,screenX=100,left=100,screenY=100,top=100,fullscreen=0,resizable=1,scrollbars=1,menubar=0,toolbar=0', orgName);}function popupPersonne(newURL,orgName){    popupWindow(newURL, 'Personne','height=550,width=800,screenX=150,left=150,screenY=100,top=100,fullscreen=0,resizable=1,scrollbars=1,menubar=0,toolbar=0', orgName);}function popupPlayerFlash(id){    document.getElementById('player').src="popupPlayerFlash.php?id_doc="+id;}function copyValue(f1,f2) {    if(f2.value=='') f2.value=f1.value;}function setValues(f1,f2) {    if(f1.value!='') {        f2.value=f1.value;        f2.text=f1.text;        }}function setValueBox(box,field) {	var val="";	for(i=0;i<box.length;i++){		if(box[i].checked) {			if(val=='') val= box[i].value;			else val+=", "+box[i].value;			}	}	    field.value=val;}function selectMenu(f,url,src) {    if(f.selectedIndex==2){    //Selection    popupSelect(url, src)    }    else if(f.selectedIndex==3) {    //Suppression        f.options[0].value='';        f.options[0].text=''        }    f.selectedIndex=0;}function selectMenuAndSend(f,url,src) {    if(f.selectedIndex==2){    //Selection    popupSelect(url, src)    }    else if(f.selectedIndex==3) {    //Suppression        f.options[0].value='';        f.options[0].text=''        f.selectedIndex=0;        }    f.selectedIndex=0;        document.form1.commande.value='SELECT'        document.form1.submit();    }function formatDate(srcField) {    var value_date = srcField.value;    if ( (value_date.length == 4) && (value_date.indexOf("-") == -1) ) {        value_date = value_date  + "-";        srcField.value = value_date;    }    if ( (value_date.length == 7) && (value_date.lastIndexOf("-") == 4) ) {        value_date = value_date  + "-";        srcField.value = value_date;    }     p = "--";    if (value_date.match(p)) {        value_date = value_date.replace(p, "-");        srcField.value = value_date;    }}function formatNum(n) {if(n<10) return "0"+n;else return n;}function formatTime(srcField) {    var value_tc = srcField.value;    if ( (value_tc.length == 1) && (value_tc.indexOf("0") == -1) && (value_tc.indexOf("1") == -1) && (value_tc.indexOf("2") == -1) ) {       srcField.value = "";        return;    }    if ( (value_tc.length == 2) && (value_tc.indexOf(":") == -1) ) {        value_tc = value_tc  + ":";        srcField.value = value_tc;        return;    }    if ( (value_tc.length == 5) && (value_tc.lastIndexOf(":") == 2) ) {        value_tc = value_tc  + ":";        srcField.value = value_tc;        return;    }    p = "::";    if (value_tc.match(p)) {        value_tc = value_tc.replace(p, ":");        srcField.value = value_tc;    }}function formatTC(srcField) {    var value_tc = srcField.value;    if ( (value_tc.length == 1) && (value_tc.indexOf("0") == -1) && (value_tc.indexOf("1") == -1) && (value_tc.indexOf("2") == -1) ) {       srcField.value = "";        return;    }    if ( (value_tc.length == 2) && (value_tc.indexOf(":") == -1) ) {        value_tc = value_tc  + ":";        srcField.value = value_tc;        return;    }    if ( (value_tc.length == 5) && (value_tc.lastIndexOf(":") == 2) ) {        value_tc = value_tc  + ":";        srcField.value = value_tc;        return;    }    if ( (value_tc.length == 8) && (value_tc.lastIndexOf(":") == 5) ) {        value_tc = value_tc  + ":";        srcField.value = value_tc;        return;    }    p = "::";    if (value_tc.match(p)) {        value_tc = value_tc.replace(p, ":");        srcField.value = value_tc;    }}function checkDate(srcField) {    if(srcField.value !='') {        dat = srcField.value;        dat = dat.replace(/\//gi,'-');        datret = dat;        x = dat.indexOf("-");        if(x>0) {            a=parseInt(dat.substring(0,x),10);            y = dat.indexOf("-",x+1);            if(y==-1) {                m=parseInt(dat.substring(x+1),10);                if(isNaN(m))m=0;                datret = formatNum(a) + "-" + formatNum(m);            } else {                m=parseInt(dat.substring(x+1,y),10);                j=parseInt(dat.substring(y+1),10);                if(isNaN(j))j=0;                if(isNaN(m))m=0;                datret = formatNum(a) + "-" + formatNum(m) + "-" + formatNum(j);            }        }        srcField.value = datret;        //alert("Format : AAAA-MM-JJ");    }}function checkTime(srcField) {    t = srcField.value;    x = t.indexOf(":");    h=0;    m=0;    s=0;    if(x==-1) h=parseInt(t,10);    else {        h=parseInt(t.substring(0,x),10);        y = t.indexOf(":",x+1);        if(y==-1) m=parseInt(t.substring(x+1),10);        else {            m=parseInt(t.substring(x+1,y),10);            s=parseInt(t.substring(y+1),10);        }    }    if ((m<60) && (s<60)) {        ret= h + ":";        if(m<10)  ret +="0";        ret += m + ":";         if(s<10) ret +="0";        srcField.value =  ret + s;        }    else {        srcField.value = t;        alert("Format : 00:00:00");    }}function checkTC(srcField) {    t = srcField.value;    x = t.indexOf(":");    h=0;    m=0;    s=0;    f=0;    if(x==-1) {        h=parseInt(t.substring(0,2),10);        m=parseInt(t.substring(2,4),10);        s=parseInt(t.substring(4,6),10);        f=parseInt(t.substring(6,8),10);    } else {        h=parseInt(t.substring(0,x).substring(0,2),10);        y = t.indexOf(":",x+1);        z = t.indexOf(":",y+1);        if(y==-1) m=parseInt(t.substring(x+1).substring(0,2),10);        else {            m=parseInt(t.substring(x+1,y).substring(0,2),10);            if(z==-1) s=parseInt(t.substring(y+1).substring(0,2),10);            else {                s=parseInt(t.substring(y+1,z).substring(0,2),10);                f=parseInt(t.substring(z+1).substring(0,2),10);            }        }    }    if(isNaN(h)) h=0;    if(isNaN(m)) m=0;    if(isNaN(s)) s=0;    if(isNaN(f)) f=0;    srcField.value =  formatNum(h) + ":" + formatNum(m) + ":" + formatNum(s)+ ":" + formatNum(f);}function showAndInitRechInd2(titre_index,valeur,id_lang,champ,id_input_result){	var lex_aff=0;	var type_lex="";	if(document.getElementById("thes_"+champ)) {		lex_aff=1;		type_lex=document.getElementById("thes_"+champ).value;	}	showAndInitRechInd(titre_index,valeur,id_lang,champ,id_input_result,lex_aff,type_lex);}function showAndInitRechInd(titre_index,valeur,id_lang,champ,id_input_result,lex_aff,type_lex){    var url = "chercheIndex.php?";    url +='titre_index='+titre_index+'&id_lang='+id_lang+'&valeur='+valeur+'&champ='+champ+'&id_input_result='+id_input_result;	if(lex_aff) url+='&lex_aff='+lex_aff;	if(type_lex) url+='&type_lex='+type_lex;    iframeChrchInd.location.href=url; }// JC 01/06/05 : Pour mettre � jour les champs du formulaire du document parent, depuis l'iframe qu'il incorpore.//(utilis�e par exemple dans l'iframe chercheIndex.php, incorpor�e dans cherche2.php (dans cherche2.inc.php) ).function MaJChamp(id_champ, valeur){		var valChamp = window.parent.document.getElementById(id_champ).value;	if(valChamp.indexOf('"'+valeur+'"')==-1){		if (valChamp!=""){			window.parent.document.getElementById(id_champ).value+=',"'+valeur+'"';		}else{			window.parent.document.getElementById(id_champ).value='"'+valeur+'"';		}	}}// JC 17/06/05 : utile uniquement pour la d�mofunction doConnect(login, password){    document.getElementById('login').value=login;     document.getElementById('password').value=password;     document.connexion.submit();        }// Permet de cacher/montrer l'�lement "id_objet" (utilis� pour les storyboards)    function cache(id) {        if (document.getElementById) { // DOM3 = IE5, NS6            document.getElementById(id).style.display = 'none';        }        else {            if (document.layers) { // Netscape 4                document.id.display = 'none';            }            else { // IE 4                document.all.id.style.display = 'none';            }        }    }        function affiche(id) {        if (document.getElementById) { // DOM3 = IE5, NS6            document.getElementById(id).style.display = 'block';        }        else {            if (document.layers) { // Netscape 4                document.id.display = 'block';            }            else { // IE 4                document.all.id.style.display = 'block';            }        }    }    // Permet de cacher/montrer l'�lement "id_objet" (utilis� pour les storyboards)function affiche_cache(id) {    if (document.getElementById) { // DOM3 = IE5, NS6        if (document.getElementById(id).style.display == 'none'){            document.getElementById(id).style.display = 'block';        }else{            document.getElementById(id).style.display = 'none';        }    }    else {        if (document.layers) { // Netscape 4            if (document.id.display == 'none'){                document.id.display = 'block';            }else{                document.id.display = 'none';            }        }        else { // IE 4            if (document.all.id.style.display == 'none'){                document.all.id.style.display = 'block';            }else{                document.all.id.style.display = 'none';            }                    }    }}function alterne_texte(objet,text1,text2) {        if (objet.value == text1){            objet.value = text2;        }else{            objet.value = text1;        }}// R�alise un explode de 'item' selon 'delimiter'function explodeArray(item,delimiter) {  tempArray=new Array(1);  var Count=0;  var tempString=new String(item);  while (tempString.indexOf(delimiter)>0) {    tempArray[Count]=tempString.substr(0,tempString.indexOf(delimiter));    tempString=tempString.substr(tempString.indexOf(delimiter)+1,tempString.length-tempString.indexOf(delimiter)+1);     Count=Count+1  }  tempArray[Count]=tempString;  return tempArray;}// Formate une durée saisie en minute en h:mm si celle-ci dépasse 60 minutesfunction calcDuree(fld) {	if (isNaN(fld.value)) return;	hours=parseInt(fld.value/60);	mins=fld.value-60*hours;	fld.value=hours+":"+mins;	checkTime(fld);}// Ajout de la fonction TRIM aux strings : retire les espaces au début et à la fin d'une chaine.// usage : mytrimmedString=myString.Trim()if (typeof String.prototype.Trim == "undefined") {    	String.prototype.Trim = function () {        		var s = this.replace(/^\s*/, "");        		return s.replace(/\s*$/, "");    	}}function encodeQuotes(str) {	//str.replace(/"/,'&quot;');	return str;}//Fonction de formulaire : vérifie si un champ est videfunction formCheckNonEmpty(val) {	if (val.Trim()=='') {return false;} else {return true;}}//Fonction de formulaire : vérifie si une adresse mail est validefunction formCheckEmail(val) {    re=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; //from Quirksmode.org	if (val.search(re)!=-1) {return true;} else {return false;}}//Fonction de formulaire : vérifie si 2 valeurs sont identiques, ex: ctrl password.function formCheckSameVal(val1,val2) {	if (val1===val2 && val1.Trim()!='') {return true;} else {return false;}}function formCheckDate(val) {	re = /^([0-9]){2}(\/|-){1}([0-9]){2}(\/|-)([0-9]){4}$/;	if (val.search(re)!=-1) {return true;} else {return false;}}function formCheckInt(val) {	if (isNaN(parseInt(val))) return false; else return true;}function formCheckFloat(val) {	if (isNaN(parseFloat(val))) return false; else return true;}// FONCTIONS AJAXfunction getHTTPObject(fonc) {	var xmlhttp=false;	/* Compil addit IE */	/*@cc_on	@if (@_jscript_version >= 5)				try {			xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");		} catch(e) {			try {					xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");			} catch (E) {				xmlhttp=false;				}		}		@else			xmlhttp=false;	@end @*/		/* création objet si pas encore fait */	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {		try {			xmlhttp=new XMLHttpRequest();		} catch (e) {xmlhttp=false;}	}	if (xmlhttp) {		xmlhttp.onreadystatechange=function() {			if (xmlhttp.readyState==4) { /* COMPLETE */				if (xmlhttp.status==200) { /*HTTP PAGE OK */										eval('window.'+fonc+'(xmlhttp.responseText);'); //by LD, transfo window.parent en window				}			}		}	}	return xmlhttp;}function sendData(method,url,data,fonc) {	if (typeof(fonc)=='undefined') fonc='dspResult';	var xmlhttp=getHTTPObject(fonc);	if (!xmlhttp) {alert('pas xml');return false;}		if (method=='GET') {		if (data=='null') {			xmlhttp.open("GET",url,true); //ouverture async		} else {			xmlhttp.open("GET",url+"?"+data,true);		}		xmlhttp.send(null);	} else if (method=='POST') {		alert(data);		xmlhttp.open("POST",url,true);		xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencode');				xmlhttp.send(data);	}	return true;}function importXML(str){ //Transforme une chaine XML en objet XML		if (document.implementation && document.implementation.createDocument)	{	  var parser=new DOMParser();	  var xmlDoc=parser.parseFromString(str,"text/xml");	}	else if (window.ActiveXObject)	{		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");		xmlDoc.async=false; 		xmlDoc.loadXML(str); 	}	else	{		alert('Your browser can\'t handle this script');		return;	}		return xmlDoc;}function choose(fromElement,params,classname,ww,hh) {	if (!ww) ww=300;	if (!hh) hh=300;				w=fromElement.offsetWidth;		h=fromElement.offsetHeigth;				myDiv=document.getElementById('chooser');		myDiv.position='absolute';			if (document.getElementById('choose')) {		document.getElementById('choose').parentNode.removeChild(document.getElementById('choose'));	}		myIFrame=document.createElement('iframe');	myIFrame.src="palette.php?urlaction=chercheIndex2&"+params+"&id_input_result="+fromElement.id+"&w="+ww+"&h="+hh;		if (classname!='') {myIFrame.className=classname;} else {myIFrame.style.border="2px solid black";}		myIFrame.id='choose';	myIFrame.name='choose';	myIFrame.width=(ww-4)+'px';	myIFrame.height=(hh-4)+'px';	myDiv.style.width=ww+'px';	myDiv.style.height=hh+'px';	myDiv.appendChild(myIFrame);			myDiv.style.display='block';		x=getLeft(fromElement)+w;	y=getTop(fromElement);		if (document.documentElement && document.documentElement.clientHeight ) {			winh=document.documentElement.clientHeight+document.documentElement.scrollTop; 			winw=document.documentElement.clientWidth+document.documentElement.scrollLeft;	} else {			winh=document.body.clientHeight+document.body.scrollTop;			winw=document.body.clientWidth+document.body.scrollLeft;	}	if ((y+hh+10) > winh) y=winh-(hh+10);	if ((x+ww+10) > winw) x=winw-(ww+10);	myDiv.style.left=x+"px";	myDiv.style.top=y+"px";	}function getLeft(MyObject)//Fonction permettant de connaître la position d'un objet//par rapport au bord gauche de la page.//Cet objet peut être à l'intérieur d'un autre objet.    {    if (MyObject.offsetParent)        return (MyObject.offsetLeft + getLeft(MyObject.offsetParent));    else         return (MyObject.offsetLeft);    } function getTop(MyObject)//Fonction permettant de connaître la position d'un objet//par rapport au bord haut de la page.//Cet objet peut être à l'intérieur d'un autre objet.    {    if (MyObject.offsetParent)        return (MyObject.offsetTop + getTop(MyObject.offsetParent));    else        return (MyObject.offsetTop);    }     // FONCTIONS DRAG'N'DROPfunction getMouseOffset(target, ev){	ev = ev || window.event;	var docPos    = getPosition(target);	var mousePos  = mouseCoords(ev);	return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};}function getPosition(e){	var left = 0;	var top  = 0;	while (e.offsetParent){		left += e.offsetLeft;		top  += e.offsetTop;		e     = e.offsetParent;	}	left += e.offsetLeft;	top  += e.offsetTop;	return {x:left, y:top};}function mouseMove(ev){	ev           = ev || window.event;	var mousePos = mouseCoords(ev);	if(dragObject){		dragObject.style.position = 'absolute';		dragObject.style.top      = mousePos.y - mouseOffset.y+"px";		dragObject.style.left     = mousePos.x - mouseOffset.x+"px";		if (typeof(dragObject.style.mozOpacity)!='undefined') dragObject.style.mozOpacity=0.7;		if (typeof(dragObject.style.opacity)!='undefined')  dragObject.style.opacity=0.7;		if (typeof(dragObject.style.filter)!='undefined') dragObject.style.filter = 'alpha(opacity=70)';		return false;	}}function mouseUp(){	if (dragObject) {		if (typeof(dragObject.style.mozOpacity)!='undefined') dragObject.style.mozOpacity=1;		if (typeof(dragObject.style.opacity)!='undefined')  dragObject.style.opacity=1;		if (typeof(dragObject.style.filter)!='undefined') dragObject.style.filter = 'alpha(opacity=100)';	}	dragObject = null;}function mouseCoords(ev){	if(ev.pageX || ev.pageY){		return {x:ev.pageX, y:ev.pageY};	}	return {		x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,		y:ev.clientY + document.body.scrollTop  - document.body.clientTop	};}	function makeDraggable(item){	if(!item) { return;}	item.onmousedown = function(ev){		dragObject  = this;		mouseOffset = getMouseOffset(this, ev);		return false;	}}function removeValue(id_div) {		fld=document.getElementById(id_div);		fld.parentNode.removeChild(fld);}	function toggleVisibility(myDiv,imgArrow) { 		 		if (myDiv.style.display=='block') { 			myDiv.style.display='none'; 			if (imgArrow) imgArrow.src='design/images/arrow_right.gif'; 		} else { 			myDiv.style.display='block'; 			if (imgArrow) imgArrow.src='design/images/arrow_down.gif'; 		} 	}			function moveUp(elt) {		tab=elt.parentNode.parentNode;		div=elt.parentNode;		prv=div.previousSibling;		//alert("mydiv: "+div.id+"  parent: "+tab.id+"  previous: "+prv.nodeName);		if (prv.nodeName!='SCRIPT') tab.insertBefore(div,prv);}	function moveDown(elt) {		tab=elt.parentNode.parentNode;		div=elt.parentNode;		nxt=div.nextSibling;		//alert("mydiv: "+div.id+"  parent: "+tab.id+"  next: "+nxt.nodeName);		if ((nxt.nodeName=='DIV' || nxt.nodeName=='SPAN') && nxt.className!='miniButton' ) tab.insertBefore(div,nxt.nextSibling);}function show_props_R (obj, obj_name, equ, delim, depth) {  var result = ''  depth--  for (var i in obj) {    if (parseInt (navigator.appVersion)==2)      var typ= 'number'     // Netscape 2.0 doesn't know about typeof    else      var typ= typeof (obj[i])    if (typ=='number' && i=='length') continue    var del= (typ=='string') ? '"' : ''    var suf= (typ!='string' && typ!='number' && typ!='object') ?              ' ('+typ+')' : ''    result += obj_name+'.'+i+equ+del+obj[i]+del+suf+delim    if (depth>0)// && typ=='object')      result += show_props_R (obj[i], obj_name+'.'+i, equ, delim, depth)  }  return result;}function objshow (object, depth) {  var str= show_props_R (eval (object), object, '=</TD><TD VALIGN=TOP>',                         '</TD></TR>\n<TR><TD VALIGN=TOP>', depth)//Output everything in one go. Required for Netscape 3.0b5, which forgets//everything once we start writing to the new page.  document.writeln ('<TABLE>\n<TR><TD>',str,'</TABLE>')//Finish off page (needed for Netscape 3.0b4 and before).  document.close()} 