function openColorPicker(txtId)
{
	var cgi= '/tools/colorpicker/txtId/'+ txtId;
 	window.open(cgi, 'colorpicker', 'scrollbars=no,menubar=no,toolbar=no,resizable=no,width=400,height=330');
}

function SetUrl( url )
{
	document.getElementById('bgImg').value = url ;
}

function openFileBrowser( url, width, height )
{

	var iLeft = ( screen.width  - width ) / 2 ;
	var iTop  = ( screen.width - height ) / 2 ;

	var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes" ;
	sOptions += ",width=" + width ;
	sOptions += ",height=" + height ;
	sOptions += ",left=" + iLeft ;
	sOptions += ",top=" + iTop ;

	var s = navigator.userAgent.toLowerCase() ;

	// The "PreserveSessionOnFileBrowser" because the above code could be
	// blocked by popup blockers.
	if ( s.indexOf( 'msie') > -1)
	{
		// The following change has been made otherwise IE will open the file
		// browser on a different server session (on some cases):
		// http://support.microsoft.com/default.aspx?scid=kb;en-us;831678
		// by Simone Chiaretta.
		var oWindow = window.open( url, 'FCKBrowseWindow', sOptions ) ;

		if ( oWindow )
		{
			// Detect Yahoo popup blocker.
			try
			{
				var sTest = oWindow.name ; // Yahoo returns "something", but we can't access it, so detect that and avoid strange errors for the user.
				oWindow.opener = window ;
			}
			catch(e)
			{
				alert( 'browse server blocked by popup blocker' ) ;
			}
		}
		else
			alert( 'browse server blocked by popup blocker') ;
    }
    else
		window.open( url, 'FCKBrowseWindow', sOptions ) ;
}

function doChallengeResponse()
  {
    var aForm = document.forms["f_login"];
    var strPwd = aForm.pwds.value;
    aForm.password.value = MD5(strPwd);
    //document.f_login.submit();

  }

function twoformsonesubmit()
{
    document.f_m_nav_right_fckeditor.submit();
    setTimeout("jtimeout()",1000);
    document.f_page_fckeditor.submit();
}

function jtimeout(){ ; }

function m_nav_right_handle()
{
	//alert(typeof(FCKeditorAPI));
		var oEditor = FCKeditorAPI.GetInstance('m_nav_right_fckeditor') ;
		//alert(oEditor.GetData(false));
		document.getElementById("m_nav_right_fckeditor_bis").value=oEditor.GetData(true);
		//alert(document.getElementById("m_nav_right_fckeditor_bis").value);
}
