function myFileBrowser (field_name, url, type, win) {

    //alert("Field_Name: " + field_name + "\nURL: " + url + "\nType: " + type + "\nWin: " + win); // debug/testing

    var fileBrowserWindow = new Array();

    /* If you work with sessions in PHP and your client doesn't accept cookies you might need to carry
       the session name and session ID in the request string (can look like this: "?PHPSESSID=88p0n70s9dsknra96qhuk6etm5").
       These lines of code extract the necessary parameters and add them back to the filebrowser URL again. */

    var cmsURL = window.location.pathname;      // script URL
    var searchString = window.location.search;  // possible parameters
    if (searchString.length < 1) {
        // add "?" to the URL to include parameters (in other words: create a search string because there wasn't one before)
        searchString = "?";
    }

    // PATH TO FILEBROWSER
    cmsURL = "../../../tiny_filebrowser/index.php";

    fileBrowserWindow["file"] = cmsURL + searchString + "&type=" + type; // PHP session ID is now included if there is one at all
    fileBrowserWindow["title"] = "File Browser";
    fileBrowserWindow["width"] = "420";
    fileBrowserWindow["height"] = "400";
    fileBrowserWindow["close_previous"] = "no";
	
    tinyMCE.openWindow(fileBrowserWindow, {
      window : win,
      input : field_name,
      resizable : "yes",
      inline : "yes"
    });
	
    return false;
}

