function myFileBrowser01 (field_name, url, type, win) {
    var cmsURL = "../../../../modules/filemanager_V2/index.php";      // script URL	
    var searchString = "?appel=tiny";  // possible parameters
    if (searchString.length < 1) {
        searchString = "?";
    }
    tinyMCE.openWindow({
        file : cmsURL + searchString + "&type=" + type, // PHP session ID is now included if there is one at all
        title : "File Browser",
        width : 770,  // Your dimensions may differ - toy around with them!
        height : 617,
        close_previous : "no"
    }, {
        window : win,
        input : field_name,
        resizable : "yes",
        inline : "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
        editor_id : tinyMCE.selectedInstance.editorId
    });
    return false;
  }

 function myFileBrowser (field_name, url, type, win) {
   // var cmsURL = window.location.toString();    // script URL - use an absolute path!
    var cmsURL = "../../../../modules/filemanager_V2/index.php?appel=tiny";      // script URL	
    if (cmsURL.indexOf("?") < 0) {
        //add the type as the only query parameter
        cmsURL = cmsURL + "?type=" + type;
    }
    else {
        //add the type as an additional query parameter
        // (PHP session ID is now included if there is one at all)
        cmsURL = cmsURL + "&type=" + type;
    }

    tinyMCE.activeEditor.windowManager.open({
        file : cmsURL,
        title : 'Gestionnaire de fichier',
        width : 770,  // Your dimensions may differ - toy around with them!
        height : 617,
        resizable : "no",
        inline : "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
        close_previous : "no"
    }, {
        window : win,
        input : field_name
    });
    return false;
  } 
  
  
function checkAll( n, fldName ) {
  if (!fldName) {
     fldName = 'cb';
  }
	var f = document.adminForm;
	var c = f.toggle.checked;
	var n2 = 0;
	for (i=0; i < n; i++) {
		cb = eval( 'f.' + fldName + '' + i );
		if (cb) {
			cb.checked = c;
			n2++;
		}
	}
	if (c) {
		document.adminForm.boxchecked.value = n2;
	} else {
		document.adminForm.boxchecked.value = 0;
	}
}

function isChecked(isitchecked){
	if (isitchecked == true){
		document.adminForm.boxchecked.value++;
	}
	else {
		document.adminForm.boxchecked.value--;
	}
}
function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
  }
  else if (document.all)
  {
	this.obj = document.all[name];
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
  }
}
function swGroupesMenus(lequel){
	if (document.getElementById(lequel).style.display == "none"){
		document.getElementById(lequel).style.display = "block";
		document.getElementById(lequel).style.visibility = "visible";
	}else{
		document.getElementById(lequel).style.display = "none";
		document.getElementById(lequel).style.visibility = "hidden";
	}
	return true;
}

function gopass(masque){		
	// charlist
	var k =  new Array();
	k['0'] = "1234567890"; // chiffres 
	k['x'] = "abcdefghijklmnopqrstuvwxyz"; // minus 		
	k['X'] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; // maj
	k['a'] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; // minus + maj
	k['A'] = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; // tous les chars	
	text = "";
	for(i = 0; i < masque.length; i++) {
		pos = Math.floor(Math.random()*(k[masque.charAt(i)].length));		   
	   	text += k[masque.charAt(i)].charAt(pos);	  
	}
	return text;					
}

