/*
 * This file is only for backup. The file in use is located at: 
 * C:\Program Files\EPiServer\CMS\5.2.375.7\Application\Util\Editor\Javascript
 * If you want to do changes, change this file and then put a copy at the path above.
 */

if (!window.EditorScriptVersions)
	window.EditorScriptVersions = new Array();
window.EditorScriptVersions.push("InsertTitle 10");


// Function checking whether the subscript tool should be enabled or not
function IsInsertTitleEnabled(id) {
    var currentSelection = getEditor(id).document.selection;
    // Only return true if the user has selected some text.
    var result = (currentSelection.type == 'Text');
    // Extra check that there really is one or more characters selected - for some reason
    // IE returns selection.type == 'Text' when you click to move the cursor...
    if(result)
        result = currentSelection.createRange().text.length > 0;

    return result;
}


function LaunchInsertTitleWindow(plugin, dialogURL, id) 
{
	var args = Array();
	args[0] = plugin.editorDocument.selection.createRange().text; 
	args[1] = window;
	args[2] = id;

	OpenDialog(dialogURL, args, 370, 150);

}
