Index: /FCKeditor/trunk/editor/dialog/fck_link/fck_link.js
===================================================================
--- /FCKeditor/trunk/editor/dialog/fck_link/fck_link.js	(revision 442)
+++ /FCKeditor/trunk/editor/dialog/fck_link/fck_link.js	(revision 443)
@@ -27,4 +27,5 @@
 var FCKConfig	= oEditor.FCKConfig ;
 var FCKRegexLib	= oEditor.FCKRegexLib ;
+var FCKTools	= oEditor.FCKTools ;
 
 //#### Dialog Tabs
@@ -182,5 +183,5 @@
 	}
 
-	var aIds = oEditor.FCKTools.GetAllChildrenIds( oEditor.FCK.EditorDocument.body ) ;
+	var aIds = FCKTools.GetAllChildrenIds( oEditor.FCK.EditorDocument.body ) ;
 
 	bHasAnchors = ( aAnchors.length > 0 || aIds.length > 0 ) ;
@@ -190,10 +191,10 @@
 		var sName = aAnchors[i].name ;
 		if ( sName && sName.length > 0 )
-			oEditor.FCKTools.AddSelectOption( GetE('cmbAnchorName'), sName, sName ) ;
+			FCKTools.AddSelectOption( GetE('cmbAnchorName'), sName, sName ) ;
 	}
 
 	for ( i = 0 ; i < aIds.length ; i++ )
 	{
-		oEditor.FCKTools.AddSelectOption( GetE('cmbAnchorId'), aIds[i], aIds[i] ) ;
+		FCKTools.AddSelectOption( GetE('cmbAnchorId'), aIds[i], aIds[i] ) ;
 	}
 
@@ -224,12 +225,19 @@
 
 	// Accesible popups, the popup data is in the onclick attribute
-	if ( !oPopupMatch ) {
+	if ( !oPopupMatch ) 
+	{
 		var onclick = oLink.getAttribute( 'onclick_fckprotectedatt' ) ;
-		oPopupMatch = oRegex.OnClickPopup.exec( onclick ) ;
-		if( oPopupMatch )
-		{
-			GetE( 'cmbTarget' ).value = 'popup' ;
-			FillPopupFields( oPopupMatch[1], oPopupMatch[2] ) ;
-			SetTarget( 'popup' ) ;
+		if ( onclick )
+		{
+			// Decode the protected string
+			onclick = FCKTools.DecodeHex( onclick ) ;
+			
+			oPopupMatch = oRegex.OnClickPopup.exec( onclick ) ;
+			if( oPopupMatch )
+			{
+				GetE( 'cmbTarget' ).value = 'popup' ;
+				FillPopupFields( oPopupMatch[1], oPopupMatch[2] ) ;
+				SetTarget( 'popup' ) ;
+			}
 		}
 	}
@@ -348,5 +356,5 @@
 	GetE('tdTargetFrame').style.display	= ( targetType == 'popup' ? 'none' : '' ) ;
 	GetE('tdPopupName').style.display	=
-		GetE('tablePopupFeatures').style.display = ( targetType == 'popup' ? '' : 'none' ) ;
+	GetE('tablePopupFeatures').style.display = ( targetType == 'popup' ? '' : 'none' ) ;
 
 	switch ( targetType )
@@ -550,8 +558,12 @@
 		SetAttribute( oLink, '_fcksavedurl', sUri ) ;
 
+		var onclick;
 		// Accesible popups
 		if( GetE('cmbTarget').value == 'popup' )
 		{
-			SetAttribute( oLink, 'onclick_fckprotectedatt', " onclick=\"" + BuildOnClickPopup() + "\"") ;
+			onclick = BuildOnClickPopup() ;
+			// Encode the attribute
+			onclick = FCKTools.EncodeToHex( " onclick=\"" + onclick + "\"" )  ;
+			SetAttribute( oLink, 'onclick_fckprotectedatt', onclick ) ;
 		}
 		else
@@ -559,7 +571,13 @@
 			// Check if the previous onclick was for a popup:
 			// In that case remove the onclick handler.
-			var onclick = oLink.getAttribute( 'onclick_fckprotectedatt' ) ;
-			if( oRegex.OnClickPopup.test( onclick ) )
-				SetAttribute( oLink, 'onclick_fckprotectedatt', '' ) ;
+			onclick = oLink.getAttribute( 'onclick_fckprotectedatt' ) ;
+			if ( onclick )
+			{
+				// Decode the protected string
+				onclick = FCKTools.DecodeHex( onclick ) ;
+			
+				if( oRegex.OnClickPopup.test( onclick ) )
+					SetAttribute( oLink, 'onclick_fckprotectedatt', '' ) ;
+			}
 		}
 
