//fonction qui verifie que l'utilisateur a entre un chiffre variant de 1 a NBPAGES
function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}
function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}

function isInteger (s)

{   var i;

    if (isEmpty(s)) 
      return false;

    // Search through string's characters one by one
    // until we find a non-numeric character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);

        if (!isDigit(c)) return false;
    }

    // All characters are numbers.
    if (s + 0 ==0)return false;	    
    return true;
}

function checkIsInteger(theBox){
	if(!isInteger(theBox.value)){
		alert("VOUS DEVEZ ENTRER UN NUMERO DE PAGE VALIDE");
		return false;
	}
	return true;
}
//popup s'ouvrant pour renseigner les champs d'une image
function open_renseigne_popup(url) {
var searchWidth = 1024;
var searchHeight = 768;
var searchLeft = (screen.width/2)-(searchWidth/2);
var searchTop = (screen.height/2)-(searchHeight/2);
  renseigne_popup=window.open(url,"renseigne_popup","scrollbars=yes,width="+searchWidth+",height="+searchHeight+",left="+searchLeft+",top="+searchTop);
}
//popup s'ouvrant pour ajouter ou retirer une image du panier, vider le panier ...
function open_op_panier_popup(url) {
var searchWidth = 150;
var searchHeight = 50;
var searchLeft = 0;
var searchTop = 0;
  search_popup=window.open(url,"op_panier_popup","scrollbars=yes,width="+searchWidth+",height="+searchHeight+",left="+searchLeft+",top="+searchTop);
}
//popup s'ouvrant pour renseigner les champs d'une image
function open_faq(url) {
var searchWidth = 550;
var searchHeight = 400;
var searchLeft = 0;
var searchTop = 0;
//var searchLeft = (screen.width/2)-(searchWidth/2);
//var searchTop = (screen.height/2)-(searchHeight/2);
  faq_popup=window.open(url,"faq_popup","scrollbars=yes,resizeable=yes,width="+searchWidth+",height="+searchHeight+",left="+searchLeft+",top="+searchTop);
}
//popup s'ouvrant pour tester une skin
function open_test_popup(url,theForm) {
var searchWidth = 1024;
var searchHeight = 768;
var searchLeft = (screen.width/2)-(searchWidth/2);
var searchTop = (screen.height/2)-(searchHeight/2);
id_user=theForm.id_user.value;
id_collection=theForm.id_collection.value;
skin_name=theForm.skin_name.value;
test_popup=window.open(url+'?id_user='+id_user+'&id_collection='+id_collection+'&skin_name='+skin_name,"test_popup","scrollbars=yes,resizeable=yes,width="+searchWidth+",height="+searchHeight+",left="+searchLeft+",top="+searchTop);
}
//popup s'ouvrant pour tester une skin
function open_test_popup_home(url,theForm) {
var searchWidth = 1024;
var searchHeight = 768;
var searchLeft = (screen.width/2)-(searchWidth/2);
var searchTop = (screen.height/2)-(searchHeight/2);
id_user=theForm.id_user.value;
skin_name=theForm.skin_name_accueil.value;
test_popup=window.open(url+'?id_user='+id_user+'&skin_name='+skin_name,"test_popup","scrollbars=yes,resizeable=yes,width="+searchWidth+",height="+searchHeight+",left="+searchLeft+",top="+searchTop);
}
//popup s'ouvrant pour renseigner les champs d'une image
function open_renseigne_album_popup(formulaire,field) {
var searchWidth = 1024;
var searchHeight = 768;
var searchLeft = (screen.width/2)-(searchWidth/2);
var searchTop = (screen.height/2)-(searchHeight/2);
  renseigne_popup=window.open("/scripts/editor/editor.php?field=" + field + "&formulaire=" + formulaire ,"renseigne_popup","scrollbars=yes,width="+searchWidth+",height="+searchHeight+",left="+searchLeft+",top="+searchTop);
}
function supprimerLesImages(theForm){
	if(theForm!=null){
		if(confirm("Voulez-vous vraiment supprimer ces images ?")){
			theForm.action='/scripts/admin/traiter_un_lot.php';
			xajax_deleteBasket(theForm.id_user.value,theForm.id_collection.value,'admin',0);
			theForm.choix.value='supprimer';
			theForm.submit();
		}
	
	}		
}
function confirmerSuppressionCollection(theform){
  if(confirm("Voulez-vous vraiment supprimer cette collection ?")){   
    theform.choix.value="supprimer";
    return true;  
  }
  return false;    
}
//popup s'ouvrant pour supprimer une image
function supprimerUneImageTableau(theForm,image) {
	var id_user=theForm.id_user.value;
	var id_collection=theForm.id_collection.value;
	var provenance=theForm.provenance.value;
	if(confirm("Voulez-vous vraiment supprimer cette image ?")){
		var url='/scripts/admin/traiter_un_lot.php?id_user=' + id_user + '&id_collection=' + id_collection + '&image[]=' + image + '&provenance=' + provenance + '&doList=1&choix=supprimer';
		document.location=url;
	}
}
function supprimerUneImage(id_user,id_collection,image,provenance){
	if(confirm("Voulez-vous vraiment supprimer cette image ?")){
		var url='/scripts/admin/traiter_un_lot.php?id_user=' + id_user + '&id_collection=' + id_collection + '&image[]=' + image + '&provenance=' + provenance + '&doList=1&choix=supprimer';
		document.location=url;
	}
}
//function supprimer_album
function supprimer_album(id_user,id_collection){
	if(confirm("Voulez-vous vraiment supprimer cet album ?")){
		var url='/scripts/admin/gestion_collections.php?id_user=' + id_user + '&id_collection=' + id_collection + '&choix=supprimer&provenance=col';
		document.location=url;
	}
}
//popup s'ouvrant pour sélectionner l'image d'accueil
function open_image_accueil_popup(url) {
var searchWidth = 950;
var searchHeight = 650;
var searchLeft = (screen.width/2)-(searchWidth/2);
var searchTop = (screen.height/2)-(searchHeight/2);

accueil_popup=window.open(url,"accueil","scrollbars=yes,resizeable=yes,width="+searchWidth+",height="+searchHeight+",left="+searchLeft+",top="+searchTop+",status=yes");
}
//popup s'ouvrant pour renseigner les champs d'une image
function setImagedefault(id_user,id_collection,image,provenance,extra){
var url='/scripts/admin/traiter_un_lot.php?id_user=' + id_user + '&id_collection=' + id_collection + '&image=' + image + '&provenance=' + provenance + '&choix=set_image&extra=' + extra + '&closeWindow=1';
document.location=url;
}

function fermer_renseigne_popup(imgurl){
	
	if(self.window.opener){
	    var w = self.window.opener;
		if(imgurl==''){
		
		w.location.reload();
		}else{
		w.document.image_accueil.src=imgurl;
		}
	}
	self.window.close();
}

//popup s'ouvrant pour renseigner les champs d'une image
function setImageInfo(id_user,id_collection,image,provenance) {
	var searchWidth = 950;
	var searchHeight = 630;
	var searchLeft = (screen.width/2)-(searchWidth/2);
	var searchTop = (screen.height/2)-(searchHeight/2);
	
	var URL='/scripts/admin/renseigner_une_image.php?id_user='+id_user+'&id_collection='+id_collection+'&image='+image+'&choix=afficher&format=MD';
	URL=URL + '&provenance=' + provenance; 
	//alert(URL);
	  //search_popup=window.open(URL,"renseigne_popup","resizable=yes,scrollbars=yes,status=yes,width="+searchWidth+",height="+searchHeight+",left="+searchLeft+",top="+searchTop);
	window.open(URL,"_self");
}
//popup s'ouvrant pour renseigner les champs d'une image
function open_transformer(formulaire,operation) {
	var searchWidth = 200;
	var searchHeight = 200;
	var searchLeft = (screen.width/2)-(searchWidth/2);
	var searchTop = (screen.height/2)-(searchHeight/2);
	var URL="";
	
	transforme_popup=window.open(URL,"transforme_popup","resizable=yes,scrollbars=yes,status=yes,width="+searchWidth+",height="+searchHeight+",left="+searchLeft+",top="+searchTop);
	formulaire.target="transforme_popup";
	formulaire.operation.value=operation;
	formulaire.submit();
}
//popup s'ouvrant pour voir les champs d'une image
function getImageInfo(id_user,id_collection,image,provenance) {
	var searchWidth = 950;
	var searchHeight = 630;
	var searchLeft = (screen.width/2)-(searchWidth/2);
	var searchTop = (screen.height/2)-(searchHeight/2);
	
	var URL='/scripts/common/info_img.php?id_user='+id_user+'&id_collection='+id_collection+'&image='+image+'&choix=afficher&format=MD';
	URL=URL + '&provenance=' + provenance ; 
	//alert(URL);
	//search_popup=window.open(URL,"renseigne_popup","resizable=yes,scrollbars=yes,width="+searchWidth+",height="+searchHeight+",left="+searchLeft+",top="+searchTop);
	window.open(URL,"_self");
}
//popup s'ouvrant pour voir les champs d'une image
function downloadImage(id_user,id_collection,image,isAdmin) {
	var searchWidth = 50;
	var searchHeight = 50;
	var searchLeft = (screen.width/2)-(searchWidth/2);
	var searchTop = (screen.height/2)-(searchHeight/2);
	var url='/scripts/common/telecharger.php?id_user=' + id_user + '&id_collection='+id_collection+'&image[]='+image+'&isAdmin='+ isAdmin + '&choix=telecharger';
	download_popup=window.open(url,"download_popup","scrollbars=yes,status=yes,width="+searchWidth+",height="+searchHeight+",left="+searchLeft+",top="+searchTop);
}
//popup s'ouvrant pour voir les champs d'une image
function downloadPanier(id_user,id_collection,panier) {
	var searchWidth =50;
	var searchHeight = 50;
	var searchLeft = (screen.width/2)-(searchWidth/2);
	var searchTop = (screen.height/2)-(searchHeight/2);
	var url='/scripts/common/telecharger.php?id_user=' + id_user + '&id_collection='+id_collection+'&panier='+ panier + '&choix=telecharger';
	document.location=url;
	//download_popup=window.open(url,"download_popup","scrollbars=yes,width="+searchWidth+",height="+searchHeight+",left="+searchLeft+",top="+searchTop);
}

function downloadFromForm(theForm,maxi){
	var tl=false;
	
	if(theForm!=null){
		if(theForm.elements['image[]'].length > maxi){
			if(confirm("Vous ne pouvez télécharger que " + maxi + " images.\nVoulez-vous télécharger les " + maxi + " premières de cette page ?")){  
				tl=true;
			}
		}else if(theForm.elements['image[]'].length>0){
			tl=true;
		}else{
			alert("Aucune image à télécharger.");
		}	
		
		if(tl){
			theForm.action='/scripts/common/telecharger.php';
			theForm.choix.value='telecharger';
			//theForm.target="_blank";
			theForm.submit();
		}
	}		
}

// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
  //alert(curCookie);
}

// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
  var dc = document.cookie;
 
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;

  return unescape(dc.substring(begin + prefix.length, end));
  
}

// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" + 
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"
function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

function putIntoBasket(id_user,id_collection,panier,value){
panier=id_user + '-' + id_collection + '-' + panier;
var strPanier=getCookie(panier);
if(strPanier!=null){
	if (strPanier.length >0){
		var tab=strPanier.split("|");
		var found=false;
		for(var i=0;i<tab.length;i++){			
			if(tab[i]==value){
				found=true;
			}
		}
		if(!found){
			strPanier=strPanier+'|'+value
		}
	}else{
			strPanier=value;
	}
}else{
	strPanier=value;
}

var today = new Date();
var expire = new Date();
expire.setTime(today.getTime() + 3600000*24);
setCookie(panier,strPanier,expire,"/");
}

// Declaring valid date character, minimum year and maximum year
var dtCh= "/";
var minYear=1900;
var maxYear=2100;

function isInteger(s){
        var i;
    for (i = 0; i < s.length; i++){
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
        var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
        // February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
        for (var i = 1; i <= n; i++) {
                this[i] = 31
                if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
                if (i==2) {this[i] = 29}
   }
   return this
}

function isDate(dtStr){
        var daysInMonth = DaysArray(12)
        var pos1=dtStr.indexOf(dtCh)
        var pos2=dtStr.indexOf(dtCh,pos1+1)
        var strDay=dtStr.substring(0,pos1)
        var strMonth=dtStr.substring(pos1+1,pos2)
        var strYear=dtStr.substring(pos2+1)
        strYr=strYear
        if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
        if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
        for (var i = 1; i <= 3; i++) {
                if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
        }
        month=parseInt(strMonth)
        day=parseInt(strDay)
        year=parseInt(strYr)
        if (pos1==-1 || pos2==-1){
                alert("Format de date : jj/mm/yyyy")
                return false
        }
        if (strMonth.length<1 || month<1 || month>12){
                alert("Entrez un mois valide, svp")
                return false
        }
        if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
                alert("Entrez un jour valide, svp")
                return false
        }
        if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
                alert("SVP, entrez une annee valide comprise entre "+minYear+" et "+maxYear)
                return false
        }
        if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
                alert("Entrez une date valide, svp")
                return false
        }
return true
}

function ValidateDate(theTextBox){
        var dt=theTextBox
        if (isDate(dt.value)==false){
                dt.focus()
                return false
        }
    return true
}
function ValidateInteger(theTextBox){
        var dt=theTextBox
        if (isInteger(dt.value)==false || dt.value==''){
                alert('Ce champ doit contenir un numero !');
                dt.focus()
                return false
        }
    return true
}
function getTypeAlbum(theForm){
	//return theForm.type_album.selectedIndex.value;
	var j;
	var vCat1;
	j=theForm.type_album.length;
	for (i=0; i<j; i++){
		if(theForm.type_album[i].checked) 
		return theForm.type_album[i].value;
	}
	return "";
}
function opeCollections(theForm,op){
    //op=inserer|modifier|supprimer
    if(op=="modifier"){
		//determiner le type d'album
		if(theForm.nom_collection.value==""){
			alert("Vous devez choisir un nom valide pour cet album");
			theForm.nom_collection.value=theForm.orig_collection.value;
		}else{
			//theForm.nom_collection.value = theForm.nom_collection.value.replace(/&/, 'et'); 
			//theForm.nom_collection.value = theForm.nom_collection.value.replace(/'/, ' ');
			//theForm.nom_collection.value = theForm.nom_collection.value.replace(/"/, ' ');
			if(getTypeAlbum(theForm)=="privé" && theForm.cle_visiteur.value==""){
				alert('Cet album est privé, vous devez indiquer une clé-visiteurs');
			}else{
				theForm.choix.value="modifier";
				theForm.submit();
			}
		}
    }else if(op=="inserer"){
	
	if(theForm.nom_collection.value==""){
 		alert("Vous devez choisir un nom valide pour cet album");  
	}else if(theForm.orig_collection.value==theForm.nom_collection.value){
 		alert("Ce nom d'album existe déjà");  
	}else{
		//theForm.nom_collection.value = theForm.nom_collection.value.replace(/&/, 'et');
		//theForm.nom_collection.value = theForm.nom_collection.value.replace(/'/, ' ');
		//theForm.nom_collection.value = theForm.nom_collection.value.replace(/"/, ' ');
	    theForm.choix.value="inserer";
	    theForm.submit();
	 
	}
    }else if(op=="supprimer"){
	if(confirm("Voulez vous vraiment supprimer l'album courant et toutes ses images ?")){
	    theForm.choix.value="supprimer";
	    theForm.submit();
	}
    }    
}
////////////////////////////////////macromedia !
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_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}
function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='Vous devez entrer une adresse email valide.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' est obligatoire.\n'; }
  } if (errors) alert(errors);
  document.MM_returnValue = (errors == '');
}
function toutCocherDecocher(f,debut,t)
{
//f : la reference du formulaire sur lequel on veut travailler
//t : un booleen qui indique si on est en mode cocher ou décocher.
	for (counter = 0; counter < f.elements.length; counter++)
	{
		var bouton=f.elements[counter];
		if(bouton.name.indexOf(debut) == 0){
			bouton.checked=t;
		}
	}
}
function addMacro(champ,val){
	champ.value+=val + " ";
}

function show(divID) {

if (document.layers && document.layers[divID] != null){
	document.layers[divID].visibility = 'visible';
	document.layers[divID].display = '';
}else if (document.all){
	document.all[divID].style.visibility = 'visible';
	document.all[divID].style.display = '';
}else if (document.getElementById){
	document.getElementById(''+divID+'').style.visibility = 'visible';
	document.getElementById(''+divID+'').style.display = '';
}
}
function hide(divID) {

if (document.layers && document.layers[divID] != null){
	document.layers[divID].visibility = 'hidden';
	document.layers[divID].visibility = 'none';	
}else if (document.all){
	document.all[divID].style.visibility = 'hidden'; 
	document.all[divID].style.display = 'none';
}else if (document.getElementById){
	document.getElementById(''+divID+'').style.visibility = 'hidden';
	document.getElementById(''+divID+'').style.display = 'none';
}
}

function show_image(){
	show('espace_image');
	hide('espace_transformation');
	hide('espace_formulaire');
	hide('espace_classifs');
}
function show_form(){
	show('espace_formulaire');
	hide('espace_image');
	hide('espace_transformation');
	hide('espace_classifs');
}
function show_transformation(){
	show('espace_transformation');
	hide('espace_image');
	hide('espace_formulaire');
	hide('espace_classifs');
}
function show_classifs(){
	show('espace_classifs');
	hide('espace_image');
	hide('espace_transformation');
	hide('espace_formulaire');
}
function get_screen_img(){
if(getCookie('choix_zoom')=='form'){
	show_form()
}else if(getCookie('choix_zoom')=='image'){
	show_image()
}else{
	show_form()
}
}

//popup s'ouvrant pour voir les champs d'une image
function goImages(id_user,id_collection,extra) {
var URL='/scripts/admin/listimages.php?id_user='+id_user+'&id_collection=' + id_collection + '&' + extra;
window.open(URL,"_self");
}
function goImages_TEST(id_user,id_collection,extra) {
var URL='/scripts/visite/listimages.php?id_user='+id_user+'&id_collection=' + id_collection + '&' + extra;
window.open(URL,"_blank");
}
function goSearch(id_user,id_collection,extra) {
var URL='/scripts/admin/recherche_album.php?id_user='+id_user+'&id_collection=' + id_collection + '&' + extra;
window.open(URL,"_self");
}
function goPaniers(id_user,id_collection) {
var URL='/scripts/admin/panier.php?id_user='+id_user+'&id_collection='+id_collection;
window.open(URL,"_self");
}
function goImport(id_user,id_collection) {
var URL='/scripts/admin/upload_images.php?id_user='+id_user+'&id_collection='+id_collection;
window.open(URL,"_self");
}
function goAlbum(id_user,id_collection,extra) {
var URL='/scripts/admin/gestion_collections.php?id_user='+id_user+'&id_collection='+id_collection;
if(extra=="supprimer"){
	if(confirm("Voulez-vous supprimer cet album et toutes les images qu'il contient ?")){
		URL += "&choix=supprimer&provenance=col";
		window.open(URL,"_self");
	}
}else{
	window.open(URL,"_self");
}
}
function goBAL() {
var URL='/scripts/admin/contacts.php';
search_popup=window.open(URL,"_self","resizable=yes,scrollbars=yes,status=yes");
}
function goBaskets(id_user,id_collection) {
var searchWidth = 1024;
var searchHeight = 768;
var searchLeft = (screen.width/2)-(searchWidth/2);
var searchTop = (screen.height/2)-(searchHeight/2);

var URL='/scripts/admin/panier.php?id_user='+id_user+'&id_collection='+id_collection;
search_popup=window.open(URL,"_self");
}
function aide(code) {
var URL='/scripts/common/aide.php?cle=code&clevaleur='+code;
var aideWidth =1024;
var aideHeight = 780;
var aideLeft = (screen.width/2)-(aideWidth/2);
var aideTop = (screen.height/2)-(aideHeight/2);
aide_popup=window.open(URL,"aide_popup","scrollbars=yes,width="+aideWidth+",height="+aideHeight+",left="+aideLeft+",top="+aideTop);
}

function copy2Clipboard(intext)
{
	if(intext!=''){
	intext=intext.replace("&gt;",">");
	intext=intext.replace("&lt;","<");
	alert("Le motif \n" + intext + "\n a été copié.\n Vous pouvez le coller avec la commande ctrl+v");	
	window.clipboardData.setData('Text', intext);
	}
}
function insImgLinks(box,src)
{
	box.value = src;
}