1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<!--
3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5 *
6 * == BEGIN LICENSE ==
7 *
8 * Licensed under the terms of any of the following licenses at your
9 * choice:
10 *
11 *  - GNU General Public License Version 2 or later (the "GPL")
12 *    http://www.gnu.org/licenses/gpl.html
13 *
14 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15 *    http://www.gnu.org/licenses/lgpl.html
16 *
17 *  - Mozilla Public License Version 1.1 or later (the "MPL")
18 *    http://www.mozilla.org/MPL/MPL-1.1.html
19 *
20 * == END LICENSE ==
21 *
22 * This page is used by all dialog box as the container.
23-->
24<html xmlns="http://www.w3.org/1999/xhtml">
25	<head>
26		<title></title>
27		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28		<meta name="robots" content="noindex, nofollow" />
29		<script type="text/javascript">
30// <![CDATA[
31
32// Domain relaxation logic.
33var GetEL = function(id) {
34       return document.getElementById(id);
35     };
36(function()
37{
38	var d = document.domain ;
39
40	while ( true )
41	{
42		// Test if we can access a parent property.
43		try
44		{
45			var parentDomain = ( Args().TopWindow || E ).document.domain ;
46
47			if ( document.domain != parentDomain )
48				document.domain = parentDomain ;
49
50			break ;
51		}
52		catch( e ) {}
53
54		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
55		d = d.replace( /.*?(?:\.|$)/, '' ) ;
56
57		if ( d.length == 0 )
58			break ;		// It was not able to detect the domain.
59
60		document.domain = d ;
61	}
62})() ;
63
64var E = frameElement._DialogArguments.Editor ;
65
66// It seems referencing to frameElement._DialogArguments directly would lead to memory leaks in IE.
67// So let's use functions to access its members instead.
68function Args()
69{
70	return frameElement._DialogArguments ;
71}
72
73function ParentDialog( dialog )
74{
75	return dialog ? dialog._ParentDialog : frameElement._ParentDialog ;
76}
77
78var FCK				= E.FCK ;
79var FCKTools		= E.FCKTools ;
80var FCKDomTools		= E.FCKDomTools ;
81var FCKDialog		= E.FCKDialog ;
82var FCKBrowserInfo	= E.FCKBrowserInfo ;
83var FCKConfig		= E.FCKConfig ;
84
85// Steal the focus so that the caret would no longer stay in the editor iframe.
86window.focus() ;
87
88// Sets the Skin CSS
89document.write( FCKTools.GetStyleHtml( FCKConfig.SkinDialogCSS ) ) ;
90
91// Sets the language direction.
92var langDir = E.FCKLang.Dir ;
93
94// For IE6-, the fck_dialog_ie6.js is loaded, used to fix limitations in the browser.
95if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )
96	document.write( '<' + 'script type="text/javascript" src="' + FCKConfig.SkinPath + 'fck_dialog_ie6.js"><' + '\/script>' ) ;
97
98FCKTools.RegisterDollarFunction( window ) ;
99function GetEL(id) {
100    return document.getElementById(id);
101}
102// Resize related functions.
103var Sizer = function()
104{
105	var bAutoSize = false ;
106
107	var retval = {
108		// Sets whether the dialog should auto-resize according to its content's height.
109		SetAutoSize : function( autoSize )
110		{
111			bAutoSize = autoSize ;
112			this.RefreshSize() ;
113		},
114
115		// Fit the dialog container's layout to the inner iframe's external size.
116		RefreshContainerSize : function()
117		{
118			var frmMain = GetEL( 'frmMain' ) ;
119
120			if ( frmMain )
121			{
122				// Get the container size.
123				var height = GetEL( 'contents' ).offsetHeight ;
124
125				// Subtract the size of other elements.
126				height -= GetEL( 'TitleArea' ).offsetHeight ;
127				height -= GetEL( 'TabsRow' ).offsetHeight ;
128				height -= GetEL( 'PopupButtons' ).offsetHeight ;
129
130				frmMain.style.height = Math.max( height, 0 ) + 'px' ;
131
132			}
133		},
134
135		// Resize and re-layout the dialog.
136		// Triggers the onresize event for the layout logic.
137		ResizeDialog : function( width, height )
138		{
139			FCKDomTools.SetElementStyles( window.frameElement,
140					{
141						'width' : width + 'px',
142						'height' : height + 'px'
143					} ) ;
144
145			// If the skin have defined a function for resize fixes, call it now.
146			if ( typeof window.DoResizeFixes == 'function' )
147				window.DoResizeFixes() ;
148
149		},
150
151		// if bAutoSize is true, automatically fit the dialog size and layout to
152		// accomodate the inner iframe's internal height.
153		// if bAutoSize is false, then only the layout logic for the dialog decorations
154		// is run to accomodate the inner iframe's external height.
155		RefreshSize : function()
156		{
157			if ( bAutoSize )
158			{
159				var frmMain		= GetEL( 'frmMain' ) ;
160				var innerDoc	= frmMain.contentWindow.document ;
161				var isStrict	= FCKTools.IsStrictMode( innerDoc ) ;
162
163				// Get the size of the frame contents.
164				var innerWidth	= isStrict ? innerDoc.documentElement.scrollWidth : innerDoc.body.scrollWidth ;
165				var innerHeight	= isStrict ? innerDoc.documentElement.scrollHeight : innerDoc.body.scrollHeight ;
166
167				// Get the current frame size.
168				var frameSize = FCKTools.GetViewPaneSize( frmMain.contentWindow ) ;
169
170				var deltaWidth	= innerWidth - frameSize.Width ;
171				var deltaHeight	= innerHeight - frameSize.Height ;
172
173				// If the contents fits the current size.
174				if ( deltaWidth <= 0 && deltaHeight <= 0 )
175					return ;
176
177				var dialogWidth		= frameElement.offsetWidth + Math.max( deltaWidth, 0 ) ;
178				var dialogHeight	= frameElement.offsetHeight + Math.max( deltaHeight, 0 ) ;
179
180				this.ResizeDialog( dialogWidth, dialogHeight ) ;
181			}
182			this.RefreshContainerSize() ;
183            window.resizeBy(this.resize_delta_x,this.resize_delta_y);
184
185		}
186	}
187
188	/**
189	 * Safari seems to have a bug with the time when RefreshSize() is executed - it
190	 * thinks frmMain's innerHeight is 0 if we query the value too soon after the
191	 * page is loaded in some circumstances. (#1316)
192	 * TODO : Maybe this is not needed anymore after #35.
193	 */
194	if ( FCKBrowserInfo.IsSafari )
195	{
196		var originalRefreshSize = retval.RefreshSize ;
197
198		retval.RefreshSize = function()
199		{
200			FCKTools.SetTimeout( originalRefreshSize, 1, retval ) ;
201		}
202	}
203
204	/**
205	 * IE6 has a similar bug where it sometimes thinks GetEL('contents') has an
206	 * offsetHeight of 0 (#2114).
207	 */
208	if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )
209	{
210		var originalRefreshContainerSize = retval.RefreshContainerSize ;
211		retval.RefreshContainerSize = function()
212		{
213			FCKTools.SetTimeout( originalRefreshContainerSize, 1, retval ) ;
214		}
215	}
216
217	window.onresize = function()
218	{
219		retval.RefreshContainerSize() ;
220	}
221
222	window.SetAutoSize = FCKTools.Bind( retval, retval.SetAutoSize ) ;
223
224	return retval ;
225}() ;
226        Sizer.resize_delta_x= 0;
227        Sizer.resize_delta_y=0;
228
229// Manages the throbber image that appears if the inner part of dialog is taking too long to load.
230var Throbber = function()
231{
232	var timer ;
233
234	var updateThrobber = function()
235	{
236		var throbberParent = GetEL( 'throbberBlock' ) ;
237		var throbberBlocks = throbberParent.childNodes ;
238		var lastClass = throbberParent.lastChild.className ;
239
240		// From the last to the second one, copy the class from the previous one.
241		for ( var i = throbberBlocks.length - 1 ; i > 0 ; i-- )
242			throbberBlocks[i].className = throbberBlocks[i-1].className ;
243
244		// For the first one, copy the last class (rotation).
245		throbberBlocks[0].className = lastClass ;
246	}
247
248	return {
249		Show : function( waitMilliseconds )
250		{
251			// Auto-setup the Show function to be called again after the
252			// requested amount of time.
253			if ( waitMilliseconds && waitMilliseconds > 0 )
254			{
255				timer = FCKTools.SetTimeout( this.Show, waitMilliseconds, this, null, window ) ;
256				return ;
257			}
258
259			var throbberParent = GetEL( 'throbberBlock' ) ;
260
261			if (throbberParent.childNodes.length == 0)
262			{
263				// Create the throbber blocks.
264				var classIds = [ 1,2,3,4,5,4,3,2 ] ;
265				while ( classIds.length > 0 )
266					throbberParent.appendChild( document.createElement( 'div' ) ).className = ' throbber_' + classIds.shift() ;
267			}
268
269			// Center the throbber.
270			var frm = GetEL( 'contents' ) ;
271			var frmCoords = FCKTools.GetDocumentPosition( window, frm ) ;
272			var x = frmCoords.x + ( frm.offsetWidth - throbberParent.offsetWidth ) / 2 ;
273			var y = frmCoords.y + ( frm.offsetHeight - throbberParent.offsetHeight ) / 2 ;
274			throbberParent.style.left = parseInt( x, 10 ) + 'px' ;
275			throbberParent.style.top = parseInt( y, 10 ) + 'px' ;
276
277			// Show it.
278			throbberParent.style.visibility = ''  ;
279
280			// Hide tabs and buttons:
281			GetEL( 'Tabs' ).style.visibility = 'hidden' ;
282			GetEL( 'PopupButtons' ).style.visibility = 'hidden' ;
283
284			// Setup the animation interval.
285			timer = setInterval( updateThrobber, 100 ) ;
286		},
287
288		Hide : function()
289		{
290			if ( timer )
291			{
292				clearInterval( timer ) ;
293				timer = null ;
294			}
295
296			GetEL( 'throbberBlock' ).style.visibility = 'hidden' ;
297
298			// Show tabs and buttons:
299			GetEL( 'Tabs' ).style.visibility = '' ;
300			GetEL( 'PopupButtons' ).style.visibility = '' ;
301		}
302	} ;
303}() ;
304
305// Drag and drop handlers.
306var DragAndDrop = function()
307{
308	var registeredWindows = [] ;
309	var lastCoords ;
310	var currentPos ;
311
312	var cleanUpHandlers = function()
313	{
314		for ( var i = 0 ; i < registeredWindows.length ; i++ )
315		{
316			FCKTools.RemoveEventListener( registeredWindows[i].document, 'mousemove', dragMouseMoveHandler ) ;
317			FCKTools.RemoveEventListener( registeredWindows[i].document, 'mouseup', dragMouseUpHandler ) ;
318		}
319	}
320
321	var dragMouseMoveHandler = function( evt )
322	{
323		if ( !lastCoords )
324			return ;
325
326		if ( !evt )
327			evt = FCKTools.GetElementDocument( this ).parentWindow.event ;
328
329		// Updated the last coordinates.
330		var currentCoords =
331		{
332			x : evt.screenX,
333			y : evt.screenY
334		} ;
335
336		currentPos =
337		{
338			x : currentPos.x + ( currentCoords.x - lastCoords.x ),
339			y : currentPos.y + ( currentCoords.y - lastCoords.y )
340		} ;
341
342		lastCoords = currentCoords ;
343
344		frameElement.style.left	= currentPos.x + 'px' ;
345		frameElement.style.top	= currentPos.y + 'px' ;
346
347		if ( evt.preventDefault )
348			evt.preventDefault() ;
349		else
350			evt.returnValue = false ;
351	}
352
353	var dragMouseUpHandler = function( evt )
354	{
355		if ( !lastCoords )
356			return ;
357		if ( !evt )
358			evt = FCKTools.GetElementDocument( this ).parentWindow.event ;
359		cleanUpHandlers() ;
360		lastCoords = null ;
361	}
362
363	return {
364
365		MouseDownHandler : function( evt )
366		{
367			var view = null ;
368			if ( !evt )
369			{
370				view = FCKTools.GetElementDocument( this ).parentWindow ;
371				evt = view.event ;
372			}
373			else
374				view = evt.view ;
375
376			var target = evt.srcElement || evt.target ;
377			if ( target.id == 'closeButton' || target.className == 'PopupTab' || target.className == 'PopupTabSelected' )
378				return ;
379
380			lastCoords =
381			{
382				x : evt.screenX,
383				y : evt.screenY
384			} ;
385
386			// Save the current IFRAME position.
387			currentPos =
388			{
389				x : parseInt( FCKDomTools.GetCurrentElementStyle( frameElement, 'left' ), 10 ),
390				y : parseInt( FCKDomTools.GetCurrentElementStyle( frameElement, 'top' ), 10 )
391			} ;
392
393			for ( var i = 0 ; i < registeredWindows.length ; i++ )
394			{
395				FCKTools.AddEventListener( registeredWindows[i].document, 'mousemove', dragMouseMoveHandler ) ;
396				FCKTools.AddEventListener( registeredWindows[i].document, 'mouseup', dragMouseUpHandler ) ;
397			}
398
399			if ( evt.preventDefault )
400				evt.preventDefault() ;
401			else
402				evt.returnValue = false ;
403		},
404
405		RegisterHandlers : function( w )
406		{
407			registeredWindows.push( w ) ;
408		}
409	}
410}() ;
411
412// Selection related functions.
413//(Became simple shortcuts after the fix for #1990)
414var Selection =
415{
416	/**
417	 * Ensures that the editing area contains an active selection. This is a
418	 * requirement for IE, as it looses the selection when the focus moves to other
419	 * frames.
420	 */
421	EnsureSelection : function()
422	{
423		// Move the focus to the Cancel button so even if the dialog contains a
424		// contentEditable element the selection is properly restored in the editor #2496
425		window.focus() ;
426		GetEL( 'btnCancel' ).focus() ;
427
428		FCK.Selection.Restore() ;
429	},
430
431	/**
432	 * Get the FCKSelection object for the editor instance.
433	 */
434	GetSelection : function()
435	{
436		return FCK.Selection ;
437	},
438
439	/**
440	 * Get the selected element in the editing area (for object selections).
441	 */
442	GetSelectedElement : function()
443	{
444		return FCK.Selection.GetSelectedElement() ;
445	}
446}
447
448// Tab related functions.
449var Tabs = function()
450{
451	// Only element ids should be stored here instead of element references since setSelectedTab and TabDiv_OnClick
452	// would build circular references with the element references inside and cause memory leaks in IE6.
453	var oTabs = new Object() ;
454
455	var setSelectedTab = function( tabCode )
456	{
457		for ( var sCode in oTabs )
458		{
459			if ( sCode == tabCode )
460				GetEL( oTabs[sCode] ).className = 'PopupTabSelected' ;
461			else
462				GetEL( oTabs[sCode] ).className = 'PopupTab' ;
463		}
464
465		if ( typeof( window.frames["frmMain"].OnDialogTabChange ) == 'function' )
466			window.frames["frmMain"].OnDialogTabChange( tabCode ) ;
467	}
468
469	function TabDiv_OnClick()
470	{
471		setSelectedTab( this.TabCode ) ;
472	}
473
474	window.AddTab = function( tabCode, tabText, startHidden )
475	{
476		if ( typeof( oTabs[ tabCode ] ) != 'undefined' )
477			return ;
478
479		var eTabsRow = GetEL( 'Tabs' ) ;
480
481		var oCell = eTabsRow.insertCell(  eTabsRow.cells.length - 1 ) ;
482		oCell.noWrap = true ;
483
484		var oDiv = document.createElement( 'DIV' ) ;
485		oDiv.className = 'PopupTab' ;
486		oDiv.innerHTML = tabText ;
487		oDiv.TabCode = tabCode ;
488		oDiv.onclick = TabDiv_OnClick ;
489		oDiv.id = Math.random() ;
490
491		if ( startHidden )
492			oDiv.style.display = 'none' ;
493
494		eTabsRow = GetEL( 'TabsRow' ) ;
495
496		oCell.appendChild( oDiv ) ;
497
498		if ( eTabsRow.style.display == 'none' )
499		{
500			var eTitleArea = GetEL( 'TitleArea' ) ;
501			eTitleArea.className = 'PopupTitle' ;
502
503			oDiv.className = 'PopupTabSelected' ;
504			eTabsRow.style.display = '' ;
505
506			if ( window.onresize )
507				window.onresize() ;
508		}
509
510		oTabs[ tabCode ] = oDiv.id ;
511
512		FCKTools.DisableSelection( oDiv ) ;
513	} ;
514
515	window.SetSelectedTab = setSelectedTab ;
516
517	window.SetTabVisibility = function( tabCode, isVisible )
518	{
519		var oTab = GetEL( oTabs[ tabCode ] ) ;
520		oTab.style.display = isVisible ? '' : 'none' ;
521
522		if ( ! isVisible && oTab.className == 'PopupTabSelected' )
523		{
524			for ( var sCode in oTabs )
525			{
526				if ( GetEL( oTabs[sCode] ).style.display != 'none' )
527				{
528					setSelectedTab( sCode ) ;
529					break ;
530				}
531			}
532		}
533	} ;
534}() ;
535
536// readystatechange handler for registering drag and drop handlers in cover
537// iframes, defined out here to avoid memory leak.
538// Do NOT put this function as a private function as it will induce memory leak
539// in IE and it's not detectable with Drip or sIEve and undetectable leaks are
540// really nasty (sigh).
541var onReadyRegister = function()
542{
543	if ( this.readyState != 'complete' )
544		return ;
545	DragAndDrop.RegisterHandlers( this.contentWindow ) ;
546} ;
547
548// The business logic of the dialog, dealing with operational things like
549// dialog open/dialog close/enable/disable/etc.
550(function()
551{
552	var setOnKeyDown = function( targetDocument )
553	{
554		targetDocument.onkeydown = function ( e )
555		{
556			e = e || event || this.parentWindow.event ;
557			switch ( e.keyCode )
558			{
559				case 13 :		// ENTER
560					var oTarget = e.srcElement || e.target ;
561					if ( oTarget.tagName == 'TEXTAREA' )
562						return true ;
563					Ok() ;
564					return false ;
565
566				case 27 :		// ESC
567					Cancel() ;
568					return false ;
569			}
570			return true ;
571		}
572	} ;
573
574	var contextMenuBlocker = function( e )
575	{
576		var sTagName = e.target.tagName ;
577		if ( ! ( ( sTagName == "INPUT" && e.target.type == "text" ) || sTagName == "TEXTAREA" ) )
578			e.preventDefault() ;
579	} ;
580
581	var disableContextMenu = function( targetDocument )
582	{
583		if ( FCKBrowserInfo.IsIE )
584			return ;
585
586		targetDocument.addEventListener( 'contextmenu', contextMenuBlocker, true ) ;
587	} ;
588
589	// Program entry point.
590	window.Init = function()
591	{
592		GetEL( 'contents' ).dir = langDir;
593
594		// Start the throbber timer.
595		Throbber.Show( 1000 ) ;
596
597		Sizer.RefreshContainerSize() ;
598		LoadInnerDialog() ;
599
600		FCKTools.DisableSelection( document.body ) ;
601
602		// Make the title area draggable.
603		var titleElement = GetEL( 'header' ) ;
604		titleElement.onmousedown = DragAndDrop.MouseDownHandler ;
605
606		// Connect mousemove and mouseup events from dialog frame and outer window to dialog dragging logic.
607		DragAndDrop.RegisterHandlers( window ) ;
608		DragAndDrop.RegisterHandlers( Args().TopWindow ) ;
609
610		// Disable the previous dialog if it exists.
611		if ( ParentDialog() )
612		{
613			ParentDialog().contentWindow.SetEnabled( false ) ;
614			if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )
615			{
616				var currentParent = ParentDialog() ;
617				while ( currentParent )
618				{
619					var blockerFrame = currentParent.contentWindow.GetEL( 'blocker' ) ;
620					if ( blockerFrame.readyState == 'complete' )
621						DragAndDrop.RegisterHandlers( blockerFrame.contentWindow ) ;
622					else
623						blockerFrame.onreadystatechange = onReadyRegister ;
624					currentParent = ParentDialog( currentParent ) ;
625				}
626			}
627			else
628			{
629				var currentParent = ParentDialog() ;
630				while ( currentParent )
631				{
632					DragAndDrop.RegisterHandlers( currentParent.contentWindow ) ;
633					currentParent = ParentDialog( currentParent ) ;
634				}
635			}
636		}
637
638		// If this is the only dialog on screen, enable the background cover.
639		if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )
640		{
641			var blockerFrame = FCKDialog.GetCover().firstChild ;
642			if ( blockerFrame.readyState == 'complete' )
643				DragAndDrop.RegisterHandlers( blockerFrame.contentWindow ) ;
644			else
645				blockerFrame.onreadystatechange = onReadyRegister;
646		}
647
648		// Add Enter/Esc hotkeys and disable context menu for the dialog.
649		setOnKeyDown( document ) ;
650		disableContextMenu( document ) ;
651	} ;
652
653	window.LoadInnerDialog = function()
654	{
655		if ( window.onresize )
656			window.onresize() ;
657
658		// First of all, translate the dialog box contents.
659		E.FCKLanguageManager.TranslatePage( document ) ;
660
661		// Create the IFRAME that holds the dialog contents.
662		GetEL( 'innerContents' ).innerHTML = '<iframe id="frmMain" src="' + Args().Page + '" name="frmMain" frameborder="0" width="100%" height="100%" scrolling="auto" style="visibility: hidden;" allowtransparency="true"><\/iframe>' ;
663	} ;
664
665	window.InnerDialogLoaded = function()
666	{
667		// If the dialog has been closed before the iframe is loaded, do nothing.
668		if ( !frameElement.parentNode )
669			return null ;
670
671		Throbber.Hide() ;
672
673		var frmMain = GetEL('frmMain') ;
674		var innerWindow = frmMain.contentWindow ;
675		var innerDoc = innerWindow.document ;
676
677		// Show the loaded iframe.
678		frmMain.style.visibility = '' ;
679
680		// Set the language direction.
681		innerDoc.documentElement.dir = langDir ;
682
683		// Sets the Skin CSS.
684		innerDoc.write( FCKTools.GetStyleHtml( FCKConfig.SkinDialogCSS ) ) ;
685
686		setOnKeyDown( innerDoc ) ;
687		disableContextMenu( innerDoc ) ;
688
689		Sizer.RefreshContainerSize();
690		DragAndDrop.RegisterHandlers( innerWindow ) ;
691
692		innerWindow.focus() ;
693
694		return E ;
695	} ;
696
697	window.SetOkButton = function( showIt )
698	{
699		GetEL('btnOk').style.visibility = ( showIt ? '' : 'hidden' ) ;
700	} ;
701
702	window.Ok = function()
703	{
704		Selection.EnsureSelection() ;
705
706		var frmMain = window.frames["frmMain"] ;
707
708		if ( frmMain.Ok && frmMain.Ok() )
709			CloseDialog() ;
710		else
711			frmMain.focus() ;
712	} ;
713
714	window.Cancel = function( dontFireChange )
715	{
716		Selection.EnsureSelection() ;
717		return CloseDialog( dontFireChange ) ;
718	} ;
719
720	window.CloseDialog = function( dontFireChange )
721	{
722		Throbber.Hide() ;
723
724		// Points the src to a non-existent location to avoid loading errors later, in case the dialog
725		// haven't been completed loaded at this point.
726		if ( GetEL( 'frmMain' ) )
727			GetEL( 'frmMain' ).src = FCKTools.GetVoidUrl() ;
728
729		if ( !dontFireChange && !FCK.EditMode )
730		{
731			// All dialog windows, by default, will fire the "OnSelectionChange"
732			// event, no matter the Ok or Cancel button has been pressed.
733			// It seems that OnSelectionChange may enter on a concurrency state
734			// on some situations (#1965), so we should put the event firing in
735			// the execution queue instead of executing it immediately.
736			setTimeout( function()
737				{
738					FCK.Events.FireEvent( 'OnSelectionChange' ) ;
739				}, 0 ) ;
740		}
741
742		FCKDialog.OnDialogClose( window ) ;
743	} ;
744
745	window.SetEnabled = function( isEnabled )
746	{
747		var cover = GetEL( 'cover' ) ;
748		cover.style.display = isEnabled ? 'none' : '' ;
749
750		if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )
751		{
752			if ( !isEnabled )
753			{
754				// Inser the blocker IFRAME before the cover.
755				var blocker = document.createElement( 'iframe' ) ;
756				blocker.src = FCKTools.GetVoidUrl() ;
757				blocker.hideFocus = true ;
758				blocker.frameBorder = 0 ;
759				blocker.id = blocker.className = 'blocker' ;
760				cover.appendChild( blocker ) ;
761			}
762			else
763			{
764				var blocker = GetEL( 'blocker' ) ;
765				if ( blocker && blocker.parentNode )
766					blocker.parentNode.removeChild( blocker ) ;
767			}
768		}
769
770	} ;
771})() ;
772// ]]>
773		</script>
774	</head>
775	<body onload="Init();" class="PopupBody">
776		<div class="contents" id="contents">
777			<div id="header">
778				<div id="TitleArea" class="PopupTitle PopupTitleBorder">
779					<script type="text/javascript">
780// <![CDATA[
781var fckTitle = Args().Title;
782if(fckTitle.match(/FCKeditor/)) {
783  fckTitle = fckTitle.replace(/FCKeditor/, "FCKeditor/fckgLite");
784  document.write( fckTitle ) ;
785}
786else document.write( Args().Title ) ;
787
788// ]]>
789					</script>
790					<div id="closeButton" onclick="Cancel();"></div>
791				</div>
792				<div id="TabsRow" class="PopupTabArea" style="display: none">
793					<table border="0" cellpadding="0" cellspacing="0" width="100%">
794						<tr id="Tabs">
795							<td class="PopupTabEmptyArea">&nbsp;</td>
796							<td class="PopupTabEmptyArea" width="100%">&nbsp;</td>
797						</tr>
798					</table>
799				</div>
800			</div>
801			<div id="innerContents"></div>
802			<div id="PopupButtons" class="PopupButtons">
803				<table border="0" cellpadding="0" cellspacing="0">
804					<tr>
805						<td width="100%">&nbsp;</td>
806						<td nowrap="nowrap">
807							<input id="btnOk" style="visibility: hidden;" type="button" value="Ok" class="Button" onclick="Ok();" fckLang="DlgBtnOK" />
808							&nbsp;
809							<input id="btnCancel" type="button" value="Cancel" class="Button" onclick="Cancel();" fckLang="DlgBtnCancel" />
810						</td>
811					</tr>
812				</table>
813			</div>
814		</div>
815		<div class="tl"></div>
816		<div class="tc"></div>
817		<div class="tr"></div>
818		<div class="ml"></div>
819		<div class="mr"></div>
820		<div class="bl"></div>
821		<div class="bc"></div>
822		<div class="br"></div>
823		<div class="cover" id="cover" style="display:none"></div>
824		<div id="throbberBlock" style="position: absolute; visibility: hidden"></div>
825		<script type="text/javascript">
826// <![CDATA[
827			// Set the class name for language direction.
828			document.body.className += ' ' + langDir ;
829
830			var cover = GetEL( 'cover' ) ;
831			cover.style.backgroundColor = FCKConfig.BackgroundBlockerColor ;
832			FCKDomTools.SetOpacity( cover, FCKConfig.BackgroundBlockerOpacity ) ;
833// ]]>
834		</script>
835	</body>
836</html>
837