﻿// Global Javascript file for site templates

/* ----- CKFinder pop-up support ----- */

var boxId;

function BrowseServer(targetBox)
{
    boxId = targetBox;
    
    // You can use the "CKFinder" class to render CKFinder in a page:
    var finder = new CKFinder() ;
    finder.BasePath = '/Admin/ckfinder/' ;	// The path for the installation of CKFinder (default = "/ckfinder/").
    finder.SelectFunction = SetFileField ;
    finder.Popup() ;

    // It can also be done in a single line, calling the "static"
    // Popup( basePath, width, height, selectFunction ) function:
    // CKFinder.Popup( '../../', null, null, SetFileField ) ;
}

// This is a sample function which is called when a file is selected in CKFinder.
function SetFileField( fileUrl )
{
    document.getElementById( boxId ).value = fileUrl ;
}

/* ----- END CKFinder pop-up support ----- */
