diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/css/imgmap.css b/main/inc/lib/fckeditor/editor/plugins/imgmap/css/imgmap.css
new file mode 100644
index 0000000000..a9a29686eb
--- /dev/null
+++ b/main/inc/lib/fckeditor/editor/plugins/imgmap/css/imgmap.css
@@ -0,0 +1,145 @@
+body {
+ overflow: hidden;
+}
+
+FIELDSET {
+ margin: 0;
+ padding: 5px 5px;
+}
+
+LEGEND {
+ background-image: url(../images/bullet_green.gif);
+ background-repeat: no-repeat;
+ background-position: left center;
+ padding-left: 15px;
+ padding-right: 5px;
+}
+LEGEND A {
+ border: none!important;
+ text-decoration: none;
+ cursor: pointer;
+}
+
+.fieldset_off {
+ border-bottom: none;
+ border-right: none;
+}
+.fieldset_off LEGEND {
+ background-image: url(../images/bullet_orange.gif);
+}
+.fieldset_off DIV {
+ display: none;
+}
+
+#img_area_form {
+ margin: 5px 0px;
+ padding: 0;
+ border: 0;
+}
+
+#form_container {
+ white-space: nowrap;
+ overflow: auto;
+ height: 88px;
+ border-top: solid 1px #bfc1c5;
+}
+
+#form_container INPUT, #form_container SELECT {
+ border: 1px solid black;
+ font-size: 10px;
+ margin: 0;
+ padding: 0 0 0 1px;
+}
+
+.img_area {
+ display: block;
+ vertical-align: middle;
+ line-height: 20px;
+ height: 20px;
+}
+
+.img_id {
+ font-weight: bold;
+ width: 25px;
+ padding: 0px 3px;
+ text-align: right;
+ border: none!important;
+ background: none;
+}
+.img_active {
+ border: none!important;
+}
+.img_coords {
+ width: 72px;
+}
+.img_href {
+ width: 82px;
+}
+.img_alt {
+ width: 82px;
+}
+.img_target {
+ width: 82px;
+}
+
+#pic_container {
+ position: relative;
+ width: 100%;
+ height: 300px;
+ border: solid 0px #efefef;
+ overflow: auto;
+}
+
+#pic_container .imgmap_label {
+ font: bold 10px Arial;
+ color: #100;
+ padding: 1px 2px;
+}
+
+#status_container {
+ font-weight: bold!important;
+ font-size: 90%;
+ color: #e95949;
+ width: 100%;
+ height: 1em;
+}
+
+#button_container {
+ padding: 5px;
+ line-height: 16px;
+}
+#button_container a {
+ outline: 0;
+}
+#button_container img {
+ border: 0;
+ padding: 1px;
+}
+#button_container .ActiveMode {
+ border: 1px solid #666;
+ padding: 0;
+ background-color: #ddd;
+}
+
+#fieldset_html {
+ text-align: left;
+}
+
+#html_container {
+ border: 1px solid black;
+ margin: 5px 0;
+ padding: 1px 0 0 1px;
+ height: 100px;
+ width: 100%;
+}
+
+#properties {
+ clear:both;
+ border:1px solid #BFC1C5;
+ border-width:1px 0;
+ padding-bottom:0.8em;
+}
+
+#properties td {
+ padding:2px 4px;
+}
\ No newline at end of file
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/index.html b/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/index.html
new file mode 100644
index 0000000000..001b080d41
--- /dev/null
+++ b/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/index.html
@@ -0,0 +1,11 @@
+
+
+
+ imgmap plugin index
+
+
+
+ You should have been redirected to the documentation
+
+
\ No newline at end of file
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/install.html b/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/install.html
new file mode 100644
index 0000000000..9cf26554a4
--- /dev/null
+++ b/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/install.html
@@ -0,0 +1,103 @@
+
+
+
+
+Image Maps plugin
+
+
+
+
+Image Maps Plugin for FCKeditor
+
+Introduction
+This is a dialog-based plugin to handle insertion and modification of image map areas in FCKeditor
+
+Adam Maschek
+Alfonso Martínez de Lizarrondo
+Sponsored by:
+claromentis.com
+Version history:
+
+ 0.3: 29/10/2007. First version.
+ 0.4: 14/12/2007. Public release based on imgmap 2.0beta3.
+
+Website:
+Visit a demo of this plugin or a demo of the imgmap code
+
+Known bugs:
+None :-P
+Installation
+1. Copying the files
+Extract the contents of the zip in you plugins directory, so it ends up like
+ this
+
+
+editor\
+ ...
+ js\
+ lang\
+ plugins\
+ ...
+ imgmap\
+ excanvas.js
+ fckplugin.js
+ imgmap.js
+ css\
+ docs\
+ images\
+ jscripts\
+ lang\
+ ...
+ skins\
+
+2. Adding it to FCKeditor
+Now add in your fckconfig.js or custom js configuration
+file the following line:
+FCKConfig.Plugins.Add( 'imgmap', 'en') ;
+3. Adding it to the toolbarset
+Add the button 'imgmapPopup' (case sensitive) to your toolbarset:
+FCKConfig.ToolbarSets["Basic"] = [
+ ['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink'],
+['Link','Unlink','Anchor'],
+['Image','imgmapPopup'],
+['FitWindow','-','About']
+] ;
+
+Currently the plugin doesn't have any option to configure.
+5. Use it
+Now empty the cache of your browser and reload the editor, the
+ new button
+ should
+ be ready to use when you select an image.
+Final notes
+This plugin uses the imgmap code that it's available under a dual GPL/Commercial
+ license. You should check which
+ license is the right one for you.
+ Your help is always welcome supporting this project. Donations can be made
+ via the PayPal network using your PayPal account or any of the usual credit
+ cards. The security of the payment is provided by PayPal. To initiate a donation
+ just click on the buttons below that will take you to the PayPal website.
+Any amounts are appreciated, thank you for your help!
+
+Donate to Adam:
+
+Donate to Alfonso:
+
+Disclaimers
+FCKeditor is © FredCK.com
+The core imgmap code is © Adam Maschek
+
+
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/installation.png b/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/installation.png
new file mode 100644
index 0000000000..3c0e30fdf1
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/installation.png differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/styles.css b/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/styles.css
new file mode 100644
index 0000000000..e2f887f8d5
--- /dev/null
+++ b/main/inc/lib/fckeditor/editor/plugins/imgmap/docs/styles.css
@@ -0,0 +1,60 @@
+body {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 90%;
+}
+h1 {
+ text-align:center;
+ font-size:180%;
+}
+h2 {
+ border-bottom:2px solid #CCC;
+ margin:1em 0 0.4em 0;
+}
+h3 {
+ margin-bottom:0.4em;
+}
+p {
+ margin:0 0 1em 1em;
+ text-align:justify;
+}
+ol {
+ margin:0 0 1.2em 1em;
+ padding:0;
+ list-style-type:none;
+}
+ol li {
+ margin:0.2em 0;
+}
+pre, code {
+ font-size:100%;
+ font-family:"Courier New", Courier, mono;
+ background-color: #CCCCCC;
+ border:1px solid #999;
+ padding:0.2em 1em;
+ margin: 0.4em 0;
+ display:block;
+}
+form {
+ margin:0 0 0 1em;
+}
+span.key {
+ color: #006600;
+}
+#install {
+ display:none
+}
+#languages ul {
+ display:inline;
+ list-style-type:none;
+ margin:0;
+ padding:0;
+}
+#languages li {
+ display:inline;
+ margin:0;
+ padding:0;
+ vertical-align:bottom;
+}
+p.nobottom {
+ margin:1em 0 0 1em;
+}
\ No newline at end of file
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/fckplugin.js b/main/inc/lib/fckeditor/editor/plugins/imgmap/fckplugin.js
new file mode 100644
index 0000000000..75aa6a0b89
--- /dev/null
+++ b/main/inc/lib/fckeditor/editor/plugins/imgmap/fckplugin.js
@@ -0,0 +1,108 @@
+/*
+ ImgMap plugin for FCKeditor
+ version 0.4 14/12/2007
+
+ See docs/install.html
+
+
+*/
+
+imgmapCommand_GetState = function() {
+ if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
+ return FCK_TRISTATE_DISABLED;
+
+ var oImage = FCK.Selection.GetSelectedElement() ;
+ if ( oImage && oImage.tagName == 'IMG' )
+ {
+ // Does it has an assigned map?
+ if (oImage.getAttribute( 'usemap' ))
+ return FCK_TRISTATE_ON;
+
+ // Plain image
+ return FCK_TRISTATE_OFF;
+ }
+ // No image selected
+ return FCK_TRISTATE_DISABLED;
+}
+
+
+FCKCommands.RegisterCommand( 'imgmapPopup',
+ new FCKDialogCommand( FCKLang.imgmapDlgName, FCKLang.imgmapDlgTitle, FCKPlugins.Items['imgmap'].Path + 'popup.html', 700, 620, imgmapCommand_GetState ) ) ;
+
+
+// create imgmap toolbar button.
+var imgmapButton = new FCKToolbarButton('imgmapPopup', FCKLang.imgmapBtn, null, null, false, true);
+// Use the proper icon according to the skin:
+if ( /\/editor\/skins\/(.*)\//.test(FCKConfig.SkinPath) )
+ imgmapButton.IconPath = FCKPlugins.Items['imgmap'].Path + 'images/icon_' + RegExp.$1 + '.gif';
+else
+ imgmapButton.IconPath = FCKPlugins.Items['imgmap'].Path + 'images/editor_icon.gif';
+
+FCKToolbarItems.RegisterItem('imgmapPopup', imgmapButton);
+
+// register new contextmenu
+FCK.ContextMenu.RegisterListener({
+ AddItems : function( menu, tag, tagName ) {
+ // under what circumstances do we display this option
+ if (tagName == 'IMG') {
+ // when the option is displayed, show a separator the command
+ menu.AddSeparator();
+ // the command needs the registered command name, the title for the context menu, and the icon path
+ menu.AddItem('imgmapPopup', FCKLang.imgmapDlgTitle, imgmapButton.IconPath);
+ }
+ }
+});
+
+
+// The code has been added in FCKeditor 2.5, so we only need it here for previous versions.
+if ( !FCKRegexLib.ProtectUrlsArea )
+{
+ if ( FCKBrowserInfo.IsIE )
+ {
+ // Fix behavior for IE, it doesn't read back the .name on newly created maps
+ FCKXHtml.TagProcessors['map'] = function( node, htmlNode )
+ {
+ if ( ! node.attributes.getNamedItem( 'name' ) )
+ {
+ var name = htmlNode.name ;
+ if ( name )
+ FCKXHtml._AppendAttribute( node, 'name', name ) ;
+ }
+
+ node = FCKXHtml._AppendChildNodes( node, htmlNode, true ) ;
+
+ return node ;
+ }
+ }
+
+ // The href in the areas might get distorted by the browser.
+
+ // Keep a reference to the default processsor:
+ var imgmap_OldAreaProcessor = FCKXHtml.TagProcessors['area'] ;
+
+ FCKXHtml.TagProcessors['area'] = function( node, htmlNode )
+ {
+ var sSavedUrl = htmlNode.getAttribute( '_fcksavedurl' ) ;
+ if ( sSavedUrl != null )
+ FCKXHtml._AppendAttribute( node, 'href', sSavedUrl ) ;
+
+ // Call the default processor
+ if (typeof imgmap_OldAreaProcessor == 'function')
+ node = imgmap_OldAreaProcessor ( node, htmlNode ) ;
+
+ return node ;
+ }
+
+ // Saves URLs on links and images on special attributes, so they don't change when
+ // moving around.
+ var imgmap_OldProtectUrls = FCK.ProtectUrls ;
+ FCK.ProtectUrls = function( html )
+ {
+ html = imgmap_OldProtectUrls( html ) ;
+
+ // href
+ html = html.replace( / ]+))/gi , '$& _fcksavedurl=$1' ) ;
+
+ return html ;
+ }
+}
\ No newline at end of file
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/accept.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/accept.gif
new file mode 100644
index 0000000000..29f3ed7c97
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/accept.gif differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/add.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/add.gif
new file mode 100644
index 0000000000..48ee701b98
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/add.gif differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/bullet_green.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/bullet_green.gif
new file mode 100644
index 0000000000..c29051c5de
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/bullet_green.gif differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/bullet_orange.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/bullet_orange.gif
new file mode 100644
index 0000000000..2b567fbf70
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/bullet_orange.gif differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/circle.png b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/circle.png
new file mode 100644
index 0000000000..fa772e5429
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/circle.png differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/clipboard.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/clipboard.gif
new file mode 100644
index 0000000000..013c9ecb76
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/clipboard.gif differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/delete.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/delete.gif
new file mode 100644
index 0000000000..0d37c9bd70
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/delete.gif differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/edit.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/edit.gif
new file mode 100644
index 0000000000..be24b456bc
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/edit.gif differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/html.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/html.gif
new file mode 100644
index 0000000000..b936efe13b
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/html.gif differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/icon_default.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/icon_default.gif
new file mode 100644
index 0000000000..92ac8b4c3a
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/icon_default.gif differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/icon_office2003.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/icon_office2003.gif
new file mode 100644
index 0000000000..be98ae815d
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/icon_office2003.gif differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/icon_silver.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/icon_silver.gif
new file mode 100644
index 0000000000..92ac8b4c3a
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/icon_silver.gif differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/pointer.png b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/pointer.png
new file mode 100644
index 0000000000..7563bad9e0
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/pointer.png differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/poly.png b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/poly.png
new file mode 100644
index 0000000000..88329dfd32
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/poly.png differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/rect.png b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/rect.png
new file mode 100644
index 0000000000..eab32d0c76
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/rect.png differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/images/zoom.gif b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/zoom.gif
new file mode 100644
index 0000000000..cda330bb7e
Binary files /dev/null and b/main/inc/lib/fckeditor/editor/plugins/imgmap/images/zoom.gif differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/excanvas.js b/main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/excanvas.js
new file mode 100644
index 0000000000..9d71658add
--- /dev/null
+++ b/main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/excanvas.js
@@ -0,0 +1,19 @@
+if(!window.CanvasRenderingContext2D){(function(){var I=Math,i=I.round,L=I.sin,M=I.cos,m=10,A=m/2,Q={init:function(a){var b=a||document;if(/MSIE/.test(navigator.userAgent)&&!window.opera){var c=this;b.attachEvent("onreadystatechange",function(){c.r(b)})}},r:function(a){if(a.readyState=="complete"){if(!a.namespaces["s"]){a.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml")}var b=a.createStyleSheet();b.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}";
+var c=a.getElementsByTagName("canvas");for(var d=0;d"){var d="/"+a.tagName,e;while((e=a.nextSibling)&&e.tagName!=d){e.removeNode()}if(e){e.removeNode()}}a.parentNode.replaceChild(c,a);return c},initElement:function(a){a=this.q(a);a.getContext=function(){if(this.l){return this.l}return this.l=new K(this)};a.attachEvent("onpropertychange",V);a.attachEvent("onresize",
+W);var b=a.attributes;if(b.width&&b.width.specified){a.style.width=b.width.nodeValue+"px"}else{a.width=a.clientWidth}if(b.height&&b.height.specified){a.style.height=b.height.nodeValue+"px"}else{a.height=a.clientHeight}return a}};function V(a){var b=a.srcElement;switch(a.propertyName){case "width":b.style.width=b.attributes.width.nodeValue+"px";b.getContext().clearRect();break;case "height":b.style.height=b.attributes.height.nodeValue+"px";b.getContext().clearRect();break}}function W(a){var b=a.srcElement;
+if(b.firstChild){b.firstChild.style.width=b.clientWidth+"px";b.firstChild.style.height=b.clientHeight+"px"}}Q.init();var R=[];for(var E=0;E<16;E++){for(var F=0;F<16;F++){R[E*16+F]=E.toString(16)+F.toString(16)}}function J(){return[[1,0,0],[0,1,0],[0,0,1]]}function G(a,b){var c=J();for(var d=0;d<3;d++){for(var e=0;e<3;e++){var g=0;for(var h=0;h<3;h++){g+=a[d][h]*b[h][e]}c[d][e]=g}}return c}function N(a,b){b.fillStyle=a.fillStyle;b.lineCap=a.lineCap;b.lineJoin=a.lineJoin;b.lineWidth=a.lineWidth;b.miterLimit=
+a.miterLimit;b.shadowBlur=a.shadowBlur;b.shadowColor=a.shadowColor;b.shadowOffsetX=a.shadowOffsetX;b.shadowOffsetY=a.shadowOffsetY;b.strokeStyle=a.strokeStyle;b.d=a.d;b.e=a.e}function O(a){var b,c=1;a=String(a);if(a.substring(0,3)=="rgb"){var d=a.indexOf("(",3),e=a.indexOf(")",d+1),g=a.substring(d+1,e).split(",");b="#";for(var h=0;h<3;h++){b+=R[Number(g[h])]}if(g.length==4&&a.substr(3,1)=="a"){c=g[3]}}else{b=a}return[b,c]}function S(a){switch(a){case "butt":return"flat";case "round":return"round";
+case "square":default:return"square"}}function K(a){this.a=J();this.m=[];this.k=[];this.c=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=m*1;this.globalAlpha=1;this.canvas=a;var b=a.ownerDocument.createElement("div");b.style.width=a.clientWidth+"px";b.style.height=a.clientHeight+"px";b.style.overflow="hidden";b.style.position="absolute";a.appendChild(b);this.j=b;this.d=1;this.e=1}var j=K.prototype;j.clearRect=function(){this.j.innerHTML=
+"";this.c=[]};j.beginPath=function(){this.c=[]};j.moveTo=function(a,b){this.c.push({type:"moveTo",x:a,y:b});this.f=a;this.g=b};j.lineTo=function(a,b){this.c.push({type:"lineTo",x:a,y:b});this.f=a;this.g=b};j.bezierCurveTo=function(a,b,c,d,e,g){this.c.push({type:"bezierCurveTo",cp1x:a,cp1y:b,cp2x:c,cp2y:d,x:e,y:g});this.f=e;this.g=g};j.quadraticCurveTo=function(a,b,c,d){var e=this.f+0.6666666666666666*(a-this.f),g=this.g+0.6666666666666666*(b-this.g),h=e+(c-this.f)/3,l=g+(d-this.g)/3;this.bezierCurveTo(e,
+g,h,l,c,d)};j.arc=function(a,b,c,d,e,g){c*=m;var h=g?"at":"wa",l=a+M(d)*c-A,n=b+L(d)*c-A,o=a+M(e)*c-A,f=b+L(e)*c-A;if(l==o&&!g){l+=0.125}this.c.push({type:h,x:a,y:b,radius:c,xStart:l,yStart:n,xEnd:o,yEnd:f})};j.rect=function(a,b,c,d){this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+d);this.lineTo(a,b+d);this.closePath()};j.strokeRect=function(a,b,c,d){this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+d);this.lineTo(a,b+d);this.closePath();this.stroke()};j.fillRect=function(a,
+b,c,d){this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+d);this.lineTo(a,b+d);this.closePath();this.fill()};j.createLinearGradient=function(a,b,c,d){var e=new H("gradient");return e};j.createRadialGradient=function(a,b,c,d,e,g){var h=new H("gradientradial");h.n=c;h.o=g;h.i.x=a;h.i.y=b;return h};j.drawImage=function(a,b){var c,d,e,g,h,l,n,o,f=a.runtimeStyle.width,k=a.runtimeStyle.height;a.runtimeStyle.width="auto";a.runtimeStyle.height="auto";var q=a.width,r=a.height;a.runtimeStyle.width=
+f;a.runtimeStyle.height=k;if(arguments.length==3){c=arguments[1];d=arguments[2];h=(l=0);n=(e=q);o=(g=r)}else if(arguments.length==5){c=arguments[1];d=arguments[2];e=arguments[3];g=arguments[4];h=(l=0);n=q;o=r}else if(arguments.length==9){h=arguments[1];l=arguments[2];n=arguments[3];o=arguments[4];c=arguments[5];d=arguments[6];e=arguments[7];g=arguments[8]}else{throw"Invalid number of arguments";}var s=this.b(c,d),t=[],v=10,w=10;t.push(" ',' "," ");this.j.insertAdjacentHTML("BeforeEnd",t.join(""))};j.stroke=function(a){var b=[],c=O(a?this.fillStyle:this.strokeStyle),d=c[0],e=c[1]*this.globalAlpha,g=10,h=10;b.push("n.x){n.x=k.x}if(l.y==
+null||k.yn.y){n.y=k.y}}}b.push(' ">');if(typeof this.fillStyle=="object"){var v={x:"50%",y:"50%"},w=n.x-l.x,x=n.y-l.y,p=w>x?w:x;v.x=i(this.fillStyle.i.x/w*100+50)+"%";v.y=i(this.fillStyle.i.y/x*100+50)+"%";var y=[];if(this.fillStyle.p=="gradientradial"){var z=this.fillStyle.n/p*100,B=this.fillStyle.o/p*100-z}else{var z=0,B=100}var C={offset:null,color:null},D={offset:null,color:null};this.fillStyle.h.sort(function(T,U){return T.offset-U.offset});for(var o=0;oC.offset||C.offset==null){C.offset=u.offset;C.color=u.color}if(u.offset ')}else if(a){b.push(' ')}else{b.push(" ')}b.push(" ");this.j.insertAdjacentHTML("beforeEnd",b.join(""));this.c=[]};j.fill=function(){this.stroke(true)};j.closePath=function(){this.c.push({type:"close"})};j.b=function(a,b){return{x:m*(a*this.a[0][0]+b*this.a[1][0]+this.a[2][0])-A,y:m*(a*this.a[0][1]+b*this.a[1][1]+this.a[2][1])-A}};j.save=function(){var a={};N(this,a);
+this.k.push(a);this.m.push(this.a);this.a=G(J(),this.a)};j.restore=function(){N(this.k.pop(),this);this.a=this.m.pop()};j.translate=function(a,b){var c=[[1,0,0],[0,1,0],[a,b,1]];this.a=G(c,this.a)};j.rotate=function(a){var b=M(a),c=L(a),d=[[b,c,0],[-c,b,0],[0,0,1]];this.a=G(d,this.a)};j.scale=function(a,b){this.d*=a;this.e*=b;var c=[[a,0,0],[0,b,0],[0,0,1]];this.a=G(c,this.a)};j.clip=function(){};j.arcTo=function(){};j.createPattern=function(){return new P};function H(a){this.p=a;this.n=0;this.o=
+0;this.h=[];this.i={x:0,y:0}}H.prototype.addColorStop=function(a,b){b=O(b);this.h.push({offset:1-a,color:b})};function P(){}G_vmlCanvasManager=Q;CanvasRenderingContext2D=K;CanvasGradient=H;CanvasPattern=P})()};
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/functions.js b/main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/functions.js
new file mode 100644
index 0000000000..9504e56bf2
--- /dev/null
+++ b/main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/functions.js
@@ -0,0 +1,375 @@
+var myimgmap;
+var img_obj = null;
+var map_obj = null;
+
+// Less boring code
+window.$ = function( id )
+{
+ return this.document.getElementById( id ) ;
+} ;
+
+var oEditor = window.parent.InnerDialogLoaded();
+var FCKConfig = oEditor.FCKConfig ;
+var FCKLang = oEditor.FCKLang ;
+
+document.write('');
+
+
+window.onload = function()
+{
+ window.parent.SetOkButton(true);
+// window.parent.SetAutoSize(true);
+
+ //translate page elements
+ oEditor.FCKLanguageManager.TranslatePage(document);
+ oEditor.FCKLanguageManager.TranslateElements(document, 'A', 'innerHTML');
+
+ var btn;
+ btn = $('imgpointer') ;
+ btn.alt = btn.title = FCKLang.imgmapPointer ;
+ btn = $('imgrectangle') ;
+ btn.alt = btn.title = FCKLang.imgmapRectangle ;
+ btn = $('imgcircle') ;
+ btn.alt = btn.title = FCKLang.imgmapCircle ;
+ btn = $('imgpolygon') ;
+ btn.alt = btn.title = FCKLang.imgmapPolygon ;
+
+
+ img_obj = oEditor.FCK.Selection.GetSelectedElement() ;
+
+ // On rare situations it's possible to launch the dialog without an image selected
+ // -> in IE select an image, click outside the editor and the button will remain enabled,
+ // but img_obj will be null
+ if ( !img_obj )
+ {
+ alert( FCKLang.msgImageNotSelected ) ;
+ window.parent.close() ;
+ return ;
+ }
+
+ // Autoselect the language based on the current FCKeditor language
+ // Check if the plugin has the language file for the active language.
+ var sLang ;
+ if ( oEditor.FCKPlugins.Items['imgmap'].AvailableLangs.IndexOf( oEditor.FCKLanguageManager.ActiveLanguage.Code ) >= 0 )
+ sLang = oEditor.FCKLanguageManager.ActiveLanguage.Code ;
+ else
+ // Load the english language file if the prefered by the user is not available.
+ sLang = "en" ;
+
+ //late init
+ myimgmap = new imgmap({
+ mode : "editor2",
+ button_container: $('button_container'),
+ imgroot: 'images/',
+ buttons : ['delete'],
+ custom_callbacks : {
+ 'onSelectArea' : onSelectArea,
+ 'onRemoveArea' : onRemoveArea
+ },
+ html_container: null,
+ pic_container: $('pic_container'),
+ status_container: $('status_container'),
+ form_container: null, // $('form_container'),
+ bounding_box : false,
+ lang : sLang
+ });
+
+ //we need this to load languages
+ myimgmap.onLoad();
+
+ myimgmap.loadImage(img_obj);
+
+ //check if the image has a valid map already assigned
+ var mapname = img_obj.getAttribute('usemap', 2) || img_obj.usemap ;
+ //console.log(mapname);
+ if ( typeof mapname == 'string' && mapname !== '') {
+ mapname = mapname.substr(1);
+ var maps = oEditor.FCK.EditorDocument.getElementsByTagName('MAP');
+ //console.log(maps);
+ for (var i=0; i < maps.length; i++) {
+ if (maps[i].name == mapname) {
+ map_obj = maps[i];
+ myimgmap.setMapHTML(map_obj);
+
+ $('MapName').value = mapname ;
+ break;
+ }
+ }
+ }
+
+ // We must set up this listener only after the current data has been read
+ myimgmap.config.custom_callbacks.onAddArea = onAddArea ;
+
+ $('btnBrowse').style.display = FCKConfig.LinkBrowser ? '' : 'none' ;
+
+ if ( map_obj !== null )
+ {
+ // Select the first area:
+ myimgmap.selectedId = 0 ;
+ onSelectArea( myimgmap.areas[0] ) ;
+
+ setMode( 'pointer' ) ;
+ }
+ else
+ hightlightMode( 'rectangle' ) ;
+
+ RefreshSize() ;
+} ;
+
+function Ok() {
+ updateAreaValues() ;
+
+ if (img_obj !== null && img_obj.nodeName == "IMG") {
+ var MapInnerHTML = getMapInnerHTML(myimgmap);
+
+ // If there are no areas, then exit (and remove if neccesary the map).
+ if (MapInnerHTML == '')
+ {
+ removeMap();
+ return ;
+ }
+
+ oEditor.FCKUndo.SaveUndoStep();
+
+ if (typeof map_obj == 'undefined' || map_obj === null) {
+ map_obj = oEditor.FCK.EditorDocument.createElement('MAP');
+ img_obj.parentNode.appendChild(map_obj);
+ }
+
+ myimgmap.mapid = myimgmap.mapname = $('MapName').value ;
+
+ map_obj.innerHTML = MapInnerHTML ;
+
+ // IE bug: it's not possible to directly assing the name and make it work easily
+ // We remove the previous name
+ if ( map_obj.name )
+ map_obj.removeAttribute( 'name' ) ;
+
+ map_obj.name = myimgmap.getMapName();
+ map_obj.id = myimgmap.getMapId();
+
+ img_obj.setAttribute('usemap', "#" + myimgmap.getMapName(), 0);
+ }
+
+ return true;
+}
+
+//remove the map object and unset the usemap attribute
+function removeMap() {
+ oEditor.FCKUndo.SaveUndoStep();
+ if (img_obj !== null && img_obj.nodeName == "IMG") {
+ img_obj.removeAttribute('usemap', 0);
+ }
+ if (typeof map_obj != 'undefined' && map_obj !== null) {
+ map_obj.parentNode.removeChild(map_obj);
+ }
+
+ window.parent.close();
+}
+
+
+function changelabeling(obj) {
+ myimgmap.config.label = obj.value;
+ myimgmap._repaintAll();
+}
+
+function toggleFieldset(fieldset, on) {
+ if (fieldset) {
+ if (fieldset.className == 'fieldset_off' || on == 1) {
+ fieldset.className = '';
+ RefreshSize();
+ }
+ else {
+ fieldset.className = 'fieldset_off';
+ }
+ }
+}
+
+// We need to store here the area id because if the user clicks on an area,
+// then the onSelectArea event will fire before the onchange or onblur of the editing inputs
+var currentAreaId = null ;
+
+// An area has been selected in the image
+function onSelectArea(obj) {
+ $( 'properties' ).style.visibility = '';
+
+ updateAreaValues() ;
+
+ currentAreaId = obj.aid ;
+ $( 'txtUrl' ).value = obj.ahref ;
+ $( 'cmbTarget' ).value = obj.atarget ;
+ $( 'txtAlt' ).value = obj.aalt ;
+ $( 'txtAttTitle' ).value = obj.atitle ;
+}
+
+// A new area has been added
+function onAddArea(id) {
+ $( 'properties' ).style.visibility = '';
+
+ updateAreaValues() ;
+
+ currentAreaId = id ;
+ $( 'txtUrl' ).value = '' ;
+ $( 'cmbTarget' ).value = '' ;
+ $( 'txtAlt' ).value = '' ;
+ $( 'txtAttTitle' ).value = '' ;
+}
+
+function onRemoveArea()
+{
+ currentAreaId = null ;
+ $( 'properties' ).style.visibility = 'hidden' ;
+}
+
+function updateAreaValues()
+{
+ if (currentAreaId !== null)
+ {
+ myimgmap.areas[currentAreaId].ahref = $( 'txtUrl' ).value ;
+ myimgmap.areas[currentAreaId].aalt = $( 'txtAlt' ).value ;
+ myimgmap.areas[currentAreaId].atitle = $( 'txtAttTitle' ).value ;
+ myimgmap._recalculate(currentAreaId);
+ }
+}
+
+// We use our own resizing because the default doesn't take into account Standards rendering mode.
+function RefreshSize()
+{
+ var oInnerDoc = document ;
+
+ var iFrameHeight ;
+ if ( document.all )
+ iFrameHeight = oInnerDoc.documentElement.offsetHeight ;
+ else
+ iFrameHeight = window.innerHeight ;
+
+ var iInnerHeight = oInnerDoc.body.scrollHeight ;
+
+ var iDiff = iInnerHeight - iFrameHeight ;
+
+ if ( iDiff !== 0 )
+ {
+ if ( document.all )
+ window.parent.dialogHeight = ( parseInt( window.parent.dialogHeight, 10 ) + iDiff ) + 'px' ;
+ else
+ window.parent.resizeBy( 0, iDiff ) ;
+ }
+}
+
+function setMode(mode) {
+ if (mode == 'pointer') {
+ myimgmap.is_drawing = 0;
+ myimgmap.nextShape = '';
+ }
+ else {
+ myimgmap.nextShape = mode;
+ }
+
+ hightlightMode(mode);
+}
+
+var previousModeImg = null ;
+function hightlightMode(mode) {
+ // Reset previous button
+ if ( previousModeImg )
+ previousModeImg.className = '';
+
+ // Highlight new mode
+ previousModeImg = $( 'img' + mode );
+ previousModeImg.className = 'ActiveMode' ;
+}
+
+
+
+/* Call our custom version to protect URLs */
+
+function getMapInnerHTML( imgmap )
+{
+ var html = '' ;
+ //foreach area properties
+ for (var i=0; i< imgmap.areas.length; i++) {
+ html+= getAreaHtml( imgmap.areas[i] ) ;
+ }
+ return(html);
+}
+// Protect urls and add only the used attributes
+function getAreaHtml(area)
+{
+ if ( !area || area.shape == '')
+ return '';
+
+ var html = ' ';
+ return html;
+}
+
+/* edit the properties of an area */
+
+function SetUrl(value)
+{
+ var id = currentAreaId ;
+ if ( id !== null)
+ {
+ myimgmap.areas[id].ahref = value ;
+ myimgmap._recalculate(id);
+ }
+}
+
+
+function SetTarget(value)
+{
+ var id = currentAreaId ;
+ if ( id !== null)
+ {
+ myimgmap.areas[id].atarget = value ;
+ myimgmap._recalculate(id);
+ }
+}
+
+
+function SetAlt(value)
+{
+ var id = currentAreaId ;
+ if ( id !== null)
+ {
+ myimgmap.areas[id].aalt = value ;
+ myimgmap._recalculate(id);
+ }
+}
+
+
+function SetTitle(value)
+{
+ var id = currentAreaId ;
+ if ( id !== null)
+ {
+ myimgmap.areas[id].atitle = value ;
+ myimgmap._recalculate(id);
+ }
+}
+
+
+/* Browse server */
+
+function BrowseServer()
+{
+ OpenFileBrowser(
+ FCKConfig.LinkBrowserURL,
+ FCKConfig.LinkBrowserWindowWidth,
+ FCKConfig.LinkBrowserWindowHeight ) ;
+}
+
+function SetUrl( url, width, height, alt )
+{
+ GetE('txtUrl').value = url ;
+
+ if ( alt )
+ GetE('txtAlt').value = alt;
+}
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/imgmap.js b/main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/imgmap.js
new file mode 100644
index 0000000000..cacfcf32f6
--- /dev/null
+++ b/main/inc/lib/fckeditor/editor/plugins/imgmap/jscripts/imgmap.js
@@ -0,0 +1,2020 @@
+function imgmap(_1){
+this.version="2.0beta3";
+this.buildDate="03-12-2007";
+this.buildNumber="29";
+this.config=new Object();
+this.is_drawing=0;
+this.strings=new Array();
+this.memory=new Array();
+this.areas=new Array();
+this.props=new Array();
+this.logStore=new Array();
+this.currentid=0;
+this.draggedId=null;
+this.selectedId=null;
+this.nextShape="rectangle";
+this.viewmode=0;
+this.loadedScripts=new Array();
+this.isLoaded=false;
+this.cntReloads=0;
+this.mapname="";
+this.mapid="";
+this.DM_RECTANGLE_DRAW=1;
+this.DM_RECTANGLE_MOVE=11;
+this.DM_RECTANGLE_RESIZE_TOP=12;
+this.DM_RECTANGLE_RESIZE_RIGHT=13;
+this.DM_RECTANGLE_RESIZE_BOTTOM=14;
+this.DM_RECTANGLE_RESIZE_LEFT=15;
+this.DM_SQUARE_DRAW=2;
+this.DM_SQUARE_MOVE=21;
+this.DM_SQUARE_RESIZE_TOP=22;
+this.DM_SQUARE_RESIZE_RIGHT=23;
+this.DM_SQUARE_RESIZE_BOTTOM=24;
+this.DM_SQUARE_RESIZE_LEFT=25;
+this.DM_POLYGON_DRAW=3;
+this.DM_POLYGON_LASTDRAW=30;
+this.DM_POLYGON_MOVE=31;
+this.config.mode="editor";
+this.config.imgroot="";
+this.config.baseroot="";
+this.config.lang="en";
+this.config.loglevel=0;
+this.config.buttons=["add","delete","preview","html"];
+this.config.custom_callbacks=new Object();
+this.config.CL_DRAW_BOX="#dd2400";
+this.config.CL_DRAW_SHAPE="#d00";
+this.config.CL_DRAW_BG="#fff";
+this.config.CL_NORM_BOX="#dd2400";
+this.config.CL_NORM_SHAPE="#d00";
+this.config.CL_NORM_BG="#fff";
+this.config.CL_HIGHLIGHT_BOX="#dd2400";
+this.config.CL_HIGHLIGHT_SHAPE="#d00";
+this.config.CL_HIGHLIGHT_BG="#fff";
+this.config.CL_KNOB="#ffeeee";
+this.config.CL_HIGHLIGHT_PROPS="#e7e7e7";
+this.config.bounding_box=true;
+this.config.label="%n";
+this.config.label_class="imgmap_label";
+this.config.label_style="font: bold 10px Arial";
+this.config.hint="#%n %h";
+this.config.draw_opacity="35";
+this.config.norm_opacity="50";
+this.config.highlight_opacity="65";
+this.config.cursor_default="crosshair";
+var ua=navigator.userAgent;
+this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");
+this.isMSIE5=this.isMSIE&&(ua.indexOf("MSIE 5")!=-1);
+this.isMSIE5_0=this.isMSIE&&(ua.indexOf("MSIE 5.0")!=-1);
+this.isMSIE7=this.isMSIE&&(ua.indexOf("MSIE 7")!=-1);
+this.isGecko=ua.indexOf("Gecko")!=-1;
+this.isSafari=ua.indexOf("Safari")!=-1;
+this.isOpera=(typeof window.opera!="undefined");
+this.addEvent(document,"keydown",this.doc_keydown.bind(this));
+this.addEvent(document,"keyup",this.doc_keyup.bind(this));
+this.addEvent(document,"mousedown",this.doc_mousedown.bind(this));
+if(_1){
+this.setup(_1);
+}
+}
+imgmap.prototype.assignOID=function(_3){
+try{
+if(typeof _3=="undefined"){
+this.log("Undefined object passed to assignOID.");
+return null;
+}else{
+if(typeof _3=="object"){
+return _3;
+}else{
+if(typeof _3=="string"){
+return document.getElementById(_3);
+}
+}
+}
+}
+catch(err){
+this.log("Error in assignOID",1);
+}
+return null;
+};
+imgmap.prototype.setup=function(_4){
+for(var i in _4){
+this.config[i]=_4[i];
+}
+if(_4){
+this.pic_container=this.assignOID(_4.pic_container);
+if(this.pic_container){
+this.preview=document.createElement("DIV");
+this.pic_container.appendChild(this.preview);
+}
+this.form_container=this.assignOID(_4.form_container);
+this.html_container=this.assignOID(_4.html_container);
+if(this.html_container){
+this.addEvent(this.html_container,"blur",this.html_container_blur.bind(this));
+this.addEvent(this.html_container,"focus",this.html_container_focus.bind(this));
+}
+this.status_container=this.assignOID(_4.status_container);
+this.button_container=this.assignOID(_4.button_container);
+}
+if(!this.config.baseroot){
+var _6=document.getElementsByTagName("base");
+var _7="";
+for(var i=0;i<_6.length;i++){
+if(_6[i].href!=""){
+_7=_6[i].href;
+if(_7.charAt(_7.length-1)!="/"){
+_7+="/";
+}
+break;
+}
+}
+var _8=document.getElementsByTagName("script");
+for(var i=0;i<_8.length;i++){
+if(_8[i].src&&_8[i].src.match(/imgmap\w*\.js(\?.*?)?$/)){
+var _9=_8[i].src;
+_9=_9.substring(0,_9.lastIndexOf("/")+1);
+if(_7!=""&&_9.indexOf("://")==-1){
+this.config.baseroot=_7+_9;
+}else{
+this.config.baseroot=_9;
+}
+break;
+}
+}
+}
+if(this.isMSIE&&typeof window.CanvasRenderingContext2D=="undefined"&&typeof G_vmlCanvasManager=="undefined"){
+this.loadScript(this.config.baseroot+"excanvas.js");
+}
+if(this.config.lang==""){
+this.config.lang="en";
+}
+this.loadScript(this.config.baseroot+"lang_"+this.config.lang+".js");
+if(!this.config.imgroot){
+this.config.imgroot=this.config.baseroot;
+}
+this.addEvent(window,"load",this.onLoad.bind(this));
+return true;
+};
+imgmap.prototype.retryDelayed=function(fn,_b,_c){
+if(typeof fn.tries=="undefined"){
+fn.tries=0;
+}
+if(fn.tries++<_c){
+window.setTimeout(function(){
+fn.apply(this);
+},_b);
+}
+};
+imgmap.prototype.onLoad=function(e){
+if(this.isLoaded){
+return true;
+}
+if(typeof imgmapStrings=="undefined"){
+if(this.cntReloads++<5){
+var _e=this;
+window.setTimeout(function(){
+_e.onLoad(e);
+},1200);
+this.log("Delaying onload (language not loaded, try: "+this.cntReloads+")");
+return false;
+}
+}
+try{
+this.loadStrings(imgmapStrings);
+}
+catch(err){
+this.log("Unable to load language strings",1);
+}
+if(this.isMSIE){
+if(typeof window.CanvasRenderingContext2D=="undefined"&&typeof G_vmlCanvasManager=="undefined"){
+this.log(this.strings["ERR_EXCANVAS_LOAD"],2);
+}
+}
+if(this.config.mode=="highlighter"){
+imgmap_spawnObjects(this.config);
+}else{
+if(this.button_container){
+for(var i=0;i0){
+this.pic.setAttribute("width",_23);
+}
+if(_24&&_24>0){
+this.pic.setAttribute("height",_24);
+}
+this.fireEvent("onLoadImage",this.pic);
+}else{
+if(typeof img=="object"){
+var src=img.src;
+if(src==""&&img.getAttribute("mce_src")!=""){
+src=img.getAttribute("mce_src");
+}else{
+if(src==""&&img.getAttribute("_fcksavedurl")!=""){
+src=img.getAttribute("_fcksavedurl");
+}
+}
+if(!_23){
+_23=img.clientWidth;
+}
+if(!_24){
+_24=img.clientHeight;
+}
+this.loadImage(src,_23,_24);
+}
+}
+};
+imgmap.prototype.useImage=function(img){
+this.removeAllAreas();
+if(!this._getLastArea()){
+if(this.config.mode!="editor2"){
+this.addNewArea();
+}
+}
+img=this.assignOID(img);
+if(typeof img=="object"){
+this.pic=img;
+this.addEvent(this.pic,"mousedown",this.img_mousedown.bind(this));
+this.addEvent(this.pic,"mouseup",this.img_mouseup.bind(this));
+this.addEvent(this.pic,"mousemove",this.img_mousemove.bind(this));
+this.pic.style.cursor=this.config.cursor_default;
+this.pic_container=this.pic.parentNode;
+this.fireEvent("onLoadImage",this.pic);
+}
+};
+imgmap.prototype.statusMessage=function(str){
+if(this.status_container){
+this.status_container.innerHTML=str;
+}
+window.defaultStatus=str;
+};
+imgmap.prototype.log=function(obj,_29){
+if(_29==""||typeof _29=="undefined"){
+_29=0;
+}
+if(this.config.loglevel!=-1&&_29>=this.config.loglevel){
+this.logStore.push({level:_29,obj:obj});
+}
+if(typeof console=="object"){
+console.log(obj);
+}else{
+if(this.isOpera){
+opera.postError(_29+": "+obj);
+}else{
+if(_29>1){
+var msg="";
+for(var i=0;i"+this.getMapInnerHTML()+"";
+this.fireEvent("onGetMap",_2c);
+return (_2c);
+};
+imgmap.prototype.getMapInnerHTML=function(){
+var _2d="";
+for(var i=0;i ";
+}
+}
+}
+return (_2d);
+};
+imgmap.prototype.getMapName=function(){
+if(this.mapname==""){
+if(this.mapid!=""){
+return this.mapid;
+}
+var now=new Date();
+this.mapname="imgmap"+now.getFullYear()+(now.getMonth()+1)+now.getDate()+now.getHours()+now.getMinutes()+now.getSeconds();
+}
+return this.mapname;
+};
+imgmap.prototype.getMapId=function(){
+if(this.mapid==""){
+this.mapid=this.getMapName();
+}
+return this.mapid;
+};
+imgmap.prototype._normCoords=function(_30,_31){
+_30=_30.replace(/(\d)(\D)+(\d)/g,"$1,$3");
+_30=_30.replace(/,(\D|0)+(\d)/g,",$2");
+_30=_30.replace(/(\d)(\D)+,/g,"$1,");
+_30=_30.replace(/^(\D|0)+(\d)/g,"$2");
+var _32=_30.split(",");
+if(_31=="rectangle"){
+if(!(parseInt(_32[1])>0)){
+_32[1]=_32[0];
+}
+if(!(parseInt(_32[2])>0)){
+_32[2]=parseInt(_32[0])+10;
+}
+if(!(parseInt(_32[3])>0)){
+_32[3]=parseInt(_32[1])+10;
+}
+if(parseInt(_32[0])>parseInt(_32[2])){
+var _33=_32[0];
+_32[0]=_32[2];
+_32[2]=_33;
+}
+if(parseInt(_32[1])>parseInt(_32[3])){
+var _33=_32[1];
+_32[1]=_32[3];
+_32[3]=_33;
+}
+_30=_32[0]+","+_32[1]+","+_32[2]+","+_32[3];
+}else{
+if(_31=="circle"){
+if(!(parseInt(_32[1])>0)){
+_32[1]=_32[0];
+}
+if(!(parseInt(_32[2])>0)){
+_32[2]=10;
+}
+_30=_32[0]+","+_32[1]+","+_32[2];
+}
+}
+return _30;
+};
+imgmap.prototype.setMapHTML=function(map){
+this.fireEvent("onSetMap",map);
+this.removeAllAreas();
+var _35;
+if(typeof map=="string"){
+var _36=document.createElement("DIV");
+_36.innerHTML=map;
+_35=_36.firstChild;
+}else{
+if(typeof map=="object"){
+_35=map;
+}
+}
+if(!_35||_35.nodeName.toLowerCase()!=="map"){
+return false;
+}
+this.mapname=_35.name;
+this.mapid=_35.id;
+var _37=_35.getElementsByTagName("area");
+for(var i=0;i<_37.length;i++){
+id=this.addNewArea();
+if(_37[i].getAttribute("shape",2)){
+shape=_37[i].getAttribute("shape",2).toLowerCase();
+if(shape=="rect"){
+shape="rectangle";
+}else{
+if(shape=="circ"){
+shape="circle";
+}else{
+if(shape=="poly"){
+shape="polygon";
+}
+}
+}
+}else{
+shape="rectangle";
+}
+if(this.props[id]){
+this.props[id].getElementsByTagName("select")[0].value=shape;
+}
+this.initArea(id,shape);
+if(_37[i].getAttribute("coords",2)){
+var _39=this._normCoords(_37[i].getAttribute("coords",2),shape);
+if(this.props[id]){
+this.props[id].getElementsByTagName("input")[2].value=_39;
+}
+this.areas[id].lastInput=_39;
+}
+var _3a=_37[i].getAttribute("href",2);
+var _3b=_37[i].getAttribute("_fcksavedurl");
+if(_3b!=null){
+_3a=_3b;
+}
+if(_3a){
+if(this.props[id]){
+this.props[id].getElementsByTagName("input")[3].value=_3a;
+}
+this.areas[id].ahref=_3a;
+}
+var alt=_37[i].getAttribute("alt");
+if(alt){
+if(this.props[id]){
+this.props[id].getElementsByTagName("input")[4].value=alt;
+}
+this.areas[id].aalt=alt;
+}
+var _3d=_37[i].getAttribute("title");
+if(!_3d){
+_3d=alt;
+}
+if(_3d){
+this.areas[id].atitle=_3d;
+}
+var _3e=_37[i].getAttribute("target");
+if(_3e){
+_3e=_3e.toLowerCase();
+}
+if(this.props[id]){
+this.props[id].getElementsByTagName("select")[1].value=_3e;
+}
+this.areas[id].atarget=_3e;
+this._recalculate(id);
+this.relaxArea(id);
+if(this.html_container){
+this.html_container.value=this.getMapHTML();
+}
+}
+};
+imgmap.prototype.clickHtml=function(){
+this.fireEvent("onHtml");
+return true;
+};
+imgmap.prototype.togglePreview=function(){
+if(!this.pic){
+return false;
+}
+if(this.viewmode==0){
+this.fireEvent("onPreview");
+for(var i=0;i\t\t\t\t \t\t\t\tShape:\t\t\t\t\t\trectangle \t\t\t\t\tcircle \t\t\t\t\tpolygon \t\t\t\t\t \t\t\t\tCoords: \t\t\t\tHref: \t\t\t\tAlt: \t\t\t\tTarget:\t\t\t\t\t\t<not set> \t\t\t\t\tthis window \t\t\t\t\tnew window \t\t\t\t\ttop window \t\t\t\t\t ";
+this.addEvent(this.props[id].getElementsByTagName("input")[1],"keydown",this.img_area_keydown.bind(this));
+this.addEvent(this.props[id].getElementsByTagName("input")[2],"keydown",this.img_coords_keydown.bind(this));
+this.addEvent(this.props[id].getElementsByTagName("input")[2],"blur",this.img_area_blur.bind(this));
+this.addEvent(this.props[id].getElementsByTagName("input")[3],"blur",this.img_area_blur.bind(this));
+this.addEvent(this.props[id].getElementsByTagName("input")[4],"blur",this.img_area_blur.bind(this));
+this.addEvent(this.props[id].getElementsByTagName("select")[0],"blur",this.img_area_blur.bind(this));
+this.addEvent(this.props[id].getElementsByTagName("select")[1],"blur",this.img_area_blur.bind(this));
+if(this.isSafari){
+this.addEvent(this.props[id].getElementsByTagName("select")[0],"change",this.img_area_click.bind(this));
+this.addEvent(this.props[id].getElementsByTagName("select")[1],"change",this.img_area_click.bind(this));
+}
+if(_41&&this.config.mode=="editor"){
+this.props[id].getElementsByTagName("select")[0].value=_41.shape;
+}else{
+if(this.nextShape){
+this.props[id].getElementsByTagName("select")[0].value=this.nextShape;
+}
+}
+this.form_selectRow(id,true);
+}
+this.currentid=id;
+return (id);
+};
+imgmap.prototype.initArea=function(id,_44){
+if(!this.areas[id]){
+return false;
+}
+if(this.areas[id].parentNode){
+this.areas[id].parentNode.removeChild(this.areas[id]);
+}
+if(this.areas[id].label){
+this.areas[id].label.parentNode.removeChild(this.areas[id].label);
+}
+this.areas[id]=null;
+this.areas[id]=document.createElement("CANVAS");
+this.pic.parentNode.appendChild(this.areas[id]);
+this.pic.parentNode.style.position="relative";
+if(typeof G_vmlCanvasManager!="undefined"){
+this.areas[id]=G_vmlCanvasManager.initElement(this.areas[id]);
+}
+this.areas[id].id=this.mapname+"area"+id;
+this.areas[id].aid=id;
+this.areas[id].shape=_44;
+this.areas[id].ahref="";
+this.areas[id].atitle="";
+this.areas[id].aalt="";
+this.areas[id].atarget="";
+this.areas[id].style.position="absolute";
+this.areas[id].style.top=this.pic.offsetTop+"px";
+this.areas[id].style.left=this.pic.offsetLeft+"px";
+this._setopacity(this.areas[id],this.config.CL_DRAW_BG,this.config.draw_opacity);
+this.areas[id].onmousedown=this.area_mousedown.bind(this);
+this.areas[id].onmouseup=this.area_mouseup.bind(this);
+this.areas[id].onmousemove=this.area_mousemove.bind(this);
+this.memory[id]=new Object();
+this.memory[id].downx=0;
+this.memory[id].downy=0;
+this.memory[id].left=0;
+this.memory[id].top=0;
+this.memory[id].width=0;
+this.memory[id].height=0;
+this.memory[id].xpoints=new Array();
+this.memory[id].ypoints=new Array();
+this.areas[id].label=document.createElement("DIV");
+this.pic.parentNode.appendChild(this.areas[id].label);
+this.areas[id].label.className=this.config.label_class;
+this.assignCSS(this.areas[id].label,this.config.label_style);
+this.areas[id].label.style.position="absolute";
+};
+imgmap.prototype.relaxArea=function(id){
+if(!this.areas[id]){
+return;
+}
+this.fireEvent("onRelaxArea",id);
+if(this.areas[id].shape=="rectangle"){
+this.areas[id].style.borderWidth="1px";
+this.areas[id].style.borderStyle="solid";
+this.areas[id].style.borderColor=this.config.CL_NORM_SHAPE;
+}else{
+if(this.areas[id].shape=="circle"||this.areas[id].shape=="polygon"){
+if(this.config.bounding_box==true){
+this.areas[id].style.borderWidth="1px";
+this.areas[id].style.borderStyle="solid";
+this.areas[id].style.borderColor=this.config.CL_NORM_BOX;
+}else{
+this.areas[id].style.border="";
+}
+}
+}
+this._setopacity(this.areas[id],this.config.CL_NORM_BG,this.config.norm_opacity);
+};
+imgmap.prototype.relaxAllAreas=function(){
+for(var i=0;i0&&this.props[i]){
+this.form_selectRow((this.props.length-1),true);
+}
+}
+}
+};
+imgmap.prototype._putlabel=function(id){
+if(this.viewmode==1){
+return;
+}
+if(!this.areas[id].label){
+return;
+}
+try{
+if(this.config.label==""||this.config.label==false){
+this.areas[id].label.innerHTML="";
+this.areas[id].label.style.display="none";
+}else{
+this.areas[id].label.style.display="";
+var _4f=this.config.label;
+_4f=_4f.replace(/%n/g,String(id));
+_4f=_4f.replace(/%c/g,String(this.areas[id].lastInput));
+_4f=_4f.replace(/%h/g,String(this.areas[id].ahref));
+_4f=_4f.replace(/%a/g,String(this.areas[id].aalt));
+_4f=_4f.replace(/%t/g,String(this.areas[id].atitle));
+this.areas[id].label.innerHTML=_4f;
+}
+this.areas[id].label.style.top=this.areas[id].style.top;
+this.areas[id].label.style.left=this.areas[id].style.left;
+}
+catch(err){
+this.log("Error putting label",1);
+}
+};
+imgmap.prototype._puthint=function(id){
+try{
+if(this.config.hint==""||this.config.hint==false){
+this.areas[id].title="";
+this.areas[id].alt="";
+}else{
+var _51=this.config.hint;
+_51=_51.replace(/%n/g,String(id));
+_51=_51.replace(/%c/g,String(this.areas[id].lastInput));
+_51=_51.replace(/%h/g,String(this.areas[id].ahref));
+_51=_51.replace(/%a/g,String(this.areas[id].aalt));
+_51=_51.replace(/%t/g,String(this.areas[id].atitle));
+this.areas[id].title=_51;
+this.areas[id].alt=_51;
+}
+}
+catch(err){
+this.log("Error putting hint",1);
+}
+};
+imgmap.prototype._repaintAll=function(){
+for(var i=0;iparseInt(_68[2])){
+throw "invalid coords";
+}
+if(parseInt(_68[1])>parseInt(_68[3])){
+throw "invalid coords";
+}
+this.areas[id].style.left=this.pic.offsetLeft+parseInt(_68[0])+"px";
+this.areas[id].style.top=this.pic.offsetTop+parseInt(_68[1])+"px";
+this.areas[id].style.width=(_68[2]-_68[0])+"px";
+this.areas[id].style.height=(_68[3]-_68[1])+"px";
+this.areas[id].setAttribute("width",(_68[2]-_68[0]));
+this.areas[id].setAttribute("height",(_68[3]-_68[1]));
+this._repaint(this.areas[id],this.config.CL_NORM_SHAPE);
+}else{
+if(this.areas[id].shape=="circle"){
+if(_68.length!=3){
+throw "invalid coords";
+}
+if(parseInt(_68[2])<0){
+throw "invalid coords";
+}
+var _69=2*(1*_68[2]+1);
+this.areas[id].style.width=_69+"px";
+this.areas[id].style.height=_69+"px";
+this.areas[id].setAttribute("width",_69);
+this.areas[id].setAttribute("height",_69);
+this.areas[id].style.left=this.pic.offsetLeft+parseInt(_68[0])-_69/2+"px";
+this.areas[id].style.top=this.pic.offsetTop+parseInt(_68[1])-_69/2+"px";
+this._repaint(this.areas[id],this.config.CL_NORM_SHAPE);
+}else{
+if(this.areas[id].shape=="polygon"){
+if(_68.length<2){
+throw "invalid coords";
+}
+this.areas[id].xpoints=new Array();
+this.areas[id].ypoints=new Array();
+for(var i=0;i<_68.length;i+=2){
+this.areas[id].xpoints[this.areas[id].xpoints.length]=this.pic.offsetLeft+parseInt(_68[i]);
+this.areas[id].ypoints[this.areas[id].ypoints.length]=this.pic.offsetTop+parseInt(_68[i+1]);
+this._polygongrow(this.areas[id],_68[i],_68[i+1]);
+}
+this._polygonshrink(this.areas[id]);
+}
+}
+}
+}
+catch(err){
+this.log(err.message,1);
+this.statusMessage(this.strings["ERR_INVALID_COORDS"]);
+if(this.areas[id].lastInput&&_67){
+_67.value=this.areas[id].lastInput;
+}
+this._repaint(this.areas[id],this.config.CL_NORM_SHAPE);
+return;
+}
+this.areas[id].lastInput=_66;
+};
+imgmap.prototype._polygongrow=function(_6b,_6c,_6d){
+var _6e=_6c-parseInt(_6b.style.left);
+var _6f=_6d-parseInt(_6b.style.top);
+var pad=2;
+var _71=pad*2;
+if(_6cparseInt(_6b.style.left)+parseInt(_6b.style.width)){
+_6b.style.width=_6c-parseInt(_6b.style.left)+_71+"px";
+_6b.setAttribute("width",parseInt(_6b.style.width));
+}
+if(_6d>parseInt(_6b.style.top)+parseInt(_6b.style.height)){
+_6b.style.height=_6d-parseInt(_6b.style.top)+_71+"px";
+_6b.setAttribute("height",parseInt(_6b.style.height));
+}
+};
+imgmap.prototype._polygonshrink=function(_72){
+_72.style.left=(_72.xpoints[0]+1)+"px";
+_72.style.top=(_72.ypoints[0]+1)+"px";
+_72.style.height="0px";
+_72.style.width="0px";
+_72.setAttribute("height","0");
+_72.setAttribute("width","0");
+for(var i=0;i<_72.xpoints.length;i++){
+this._polygongrow(_72,_72.xpoints[i],_72.ypoints[i]);
+}
+this._repaint(_72,this.config.CL_NORM_SHAPE);
+};
+imgmap.prototype.img_mousemove=function(e){
+if(this.viewmode==1){
+return;
+}
+var pos=this._getPos(this.pic);
+var x=(this.isMSIE)?(window.event.x-this.pic.offsetLeft):(e.pageX-pos.x);
+var y=(this.isMSIE)?(window.event.y-this.pic.offsetTop):(e.pageY-pos.y);
+x=x+this.pic_container.scrollLeft;
+y=y+this.pic_container.scrollTop;
+if(x<0||y<0||x>this.pic.width||y>this.pic.height){
+return;
+}
+if(this.memory[this.currentid]){
+var top=this.memory[this.currentid].top;
+var _79=this.memory[this.currentid].left;
+var _7a=this.memory[this.currentid].height;
+var _7b=this.memory[this.currentid].width;
+}
+if(this.isSafari){
+if(e.shiftKey){
+if(this.is_drawing==this.DM_RECTANGLE_DRAW){
+this.is_drawing=this.DM_SQUARE_DRAW;
+this.statusMessage(this.strings["SQUARE2_DRAW"]);
+}
+}else{
+if(this.is_drawing==this.DM_SQUARE_DRAW&&this.areas[this.currentid].shape=="rectangle"){
+this.is_drawing=this.DM_RECTANGLE_DRAW;
+this.statusMessage(this.strings["RECTANGLE_DRAW"]);
+}
+}
+}
+if(this.is_drawing==this.DM_RECTANGLE_DRAW){
+this.fireEvent("onDrawArea",this.currentid);
+var _7c=x-this.memory[this.currentid].downx;
+var _7d=y-this.memory[this.currentid].downy;
+this.areas[this.currentid].style.width=Math.abs(_7c)+"px";
+this.areas[this.currentid].style.height=Math.abs(_7d)+"px";
+this.areas[this.currentid].setAttribute("width",Math.abs(_7c));
+this.areas[this.currentid].setAttribute("height",Math.abs(_7d));
+if(_7c<0){
+this.areas[this.currentid].style.left=(x+1)+"px";
+}
+if(_7d<0){
+this.areas[this.currentid].style.top=(y+1)+"px";
+}
+}else{
+if(this.is_drawing==this.DM_SQUARE_DRAW){
+this.fireEvent("onDrawArea",this.currentid);
+var _7c=x-this.memory[this.currentid].downx;
+var _7d=y-this.memory[this.currentid].downy;
+var _7e;
+if(Math.abs(_7c)this.pic.width||y+_7a>this.pic.height){
+return;
+}
+if(x<0||y<0){
+return;
+}
+this.areas[this.currentid].style.left=x+1+"px";
+this.areas[this.currentid].style.top=y+1+"px";
+}else{
+if(this.is_drawing==this.DM_POLYGON_MOVE){
+this.fireEvent("onMoveArea",this.currentid);
+var x=x-this.memory[this.currentid].rdownx;
+var y=y-this.memory[this.currentid].rdowny;
+if(x+_7b>this.pic.width||y+_7a>this.pic.height){
+return;
+}
+if(x<0||y<0){
+return;
+}
+var _7c=x-_79;
+var _7d=y-top;
+for(var i=0;i0){
+this.areas[this.currentid].style.left=x+1+"px";
+this.areas[this.currentid].style.top=(top+(_7e/2))+"px";
+this.areas[this.currentid].style.width=(_7b+(-1*_7e))+"px";
+this.areas[this.currentid].style.height=(_7a+(-1*_7e))+"px";
+this.areas[this.currentid].setAttribute("width",parseInt(this.areas[this.currentid].style.width));
+this.areas[this.currentid].setAttribute("height",parseInt(this.areas[this.currentid].style.height));
+}else{
+this.memory[this.currentid].width=0;
+this.memory[this.currentid].height=0;
+this.memory[this.currentid].left=x;
+this.memory[this.currentid].top=y;
+this.is_drawing=this.DM_SQUARE_RESIZE_RIGHT;
+}
+}else{
+if(this.is_drawing==this.DM_SQUARE_RESIZE_RIGHT){
+this.fireEvent("onResizeArea",this.currentid);
+var _7e=x-_79-_7b;
+if((_7b+(_7e))-1>0){
+this.areas[this.currentid].style.top=(top+(-1*_7e/2))+"px";
+this.areas[this.currentid].style.width=(_7b+(_7e))-1+"px";
+this.areas[this.currentid].style.height=(_7a+(_7e))+"px";
+this.areas[this.currentid].setAttribute("width",parseInt(this.areas[this.currentid].style.width));
+this.areas[this.currentid].setAttribute("height",parseInt(this.areas[this.currentid].style.height));
+}else{
+this.memory[this.currentid].width=0;
+this.memory[this.currentid].height=0;
+this.memory[this.currentid].left=x;
+this.memory[this.currentid].top=y;
+this.is_drawing=this.DM_SQUARE_RESIZE_LEFT;
+}
+}else{
+if(this.is_drawing==this.DM_SQUARE_RESIZE_TOP){
+this.fireEvent("onResizeArea",this.currentid);
+var _7e=y-top;
+if((_7b+(-1*_7e))>0){
+this.areas[this.currentid].style.top=y+1+"px";
+this.areas[this.currentid].style.left=(_79+(_7e/2))+"px";
+this.areas[this.currentid].style.width=(_7b+(-1*_7e))+"px";
+this.areas[this.currentid].style.height=(_7a+(-1*_7e))+"px";
+this.areas[this.currentid].setAttribute("width",parseInt(this.areas[this.currentid].style.width));
+this.areas[this.currentid].setAttribute("height",parseInt(this.areas[this.currentid].style.height));
+}else{
+this.memory[this.currentid].width=0;
+this.memory[this.currentid].height=0;
+this.memory[this.currentid].left=x;
+this.memory[this.currentid].top=y;
+this.is_drawing=this.DM_SQUARE_RESIZE_BOTTOM;
+}
+}else{
+if(this.is_drawing==this.DM_SQUARE_RESIZE_BOTTOM){
+this.fireEvent("onResizeArea",this.currentid);
+var _7e=y-top-_7a;
+if((_7b+(_7e))-1>0){
+this.areas[this.currentid].style.left=(_79+(-1*_7e/2))+"px";
+this.areas[this.currentid].style.width=(_7b+(_7e))-1+"px";
+this.areas[this.currentid].style.height=(_7a+(_7e))-1+"px";
+this.areas[this.currentid].setAttribute("width",parseInt(this.areas[this.currentid].style.width));
+this.areas[this.currentid].setAttribute("height",parseInt(this.areas[this.currentid].style.height));
+}else{
+this.memory[this.currentid].width=0;
+this.memory[this.currentid].height=0;
+this.memory[this.currentid].left=x;
+this.memory[this.currentid].top=y;
+this.is_drawing=this.DM_SQUARE_RESIZE_TOP;
+}
+}else{
+if(this.is_drawing==this.DM_RECTANGLE_RESIZE_LEFT){
+this.fireEvent("onResizeArea",this.currentid);
+var _7c=x-_79;
+if(_7b+(-1*_7c)>0){
+this.areas[this.currentid].style.left=x+1+"px";
+this.areas[this.currentid].style.width=_7b+(-1*_7c)+"px";
+this.areas[this.currentid].setAttribute("width",parseInt(this.areas[this.currentid].style.width));
+}else{
+this.memory[this.currentid].width=0;
+this.memory[this.currentid].left=x;
+this.is_drawing=this.DM_RECTANGLE_RESIZE_RIGHT;
+}
+}else{
+if(this.is_drawing==this.DM_RECTANGLE_RESIZE_RIGHT){
+this.fireEvent("onResizeArea",this.currentid);
+var _7c=x-_79-_7b;
+if((_7b+(_7c))-1>0){
+this.areas[this.currentid].style.width=(_7b+(_7c))-1+"px";
+this.areas[this.currentid].setAttribute("width",parseInt(this.areas[this.currentid].style.width));
+}else{
+this.memory[this.currentid].width=0;
+this.memory[this.currentid].left=x;
+this.is_drawing=this.DM_RECTANGLE_RESIZE_LEFT;
+}
+}else{
+if(this.is_drawing==this.DM_RECTANGLE_RESIZE_TOP){
+this.fireEvent("onResizeArea",this.currentid);
+var _7d=y-top;
+if((_7a+(-1*_7d))>0){
+this.areas[this.currentid].style.top=y+1+"px";
+this.areas[this.currentid].style.height=(_7a+(-1*_7d))+"px";
+this.areas[this.currentid].setAttribute("height",parseInt(this.areas[this.currentid].style.height));
+}else{
+this.memory[this.currentid].height=0;
+this.memory[this.currentid].top=y;
+this.is_drawing=this.DM_RECTANGLE_RESIZE_BOTTOM;
+}
+}else{
+if(this.is_drawing==this.DM_RECTANGLE_RESIZE_BOTTOM){
+this.fireEvent("onResizeArea",this.currentid);
+var _7d=y-top-_7a;
+if((_7a+(_7d))-1>0){
+this.areas[this.currentid].style.height=(_7a+(_7d))-1+"px";
+this.areas[this.currentid].setAttribute("height",parseInt(this.areas[this.currentid].style.height));
+}else{
+this.memory[this.currentid].height=0;
+this.memory[this.currentid].top=y;
+this.is_drawing=this.DM_RECTANGLE_RESIZE_TOP;
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+}
+if(this.is_drawing){
+this._repaint(this.areas[this.currentid],this.config.CL_DRAW_SHAPE,x,y);
+this._updatecoords();
+}
+};
+imgmap.prototype.img_mouseup=function(e){
+if(this.viewmode==1){
+return;
+}
+var pos=this._getPos(this.pic);
+var x=(this.isMSIE)?(window.event.x-this.pic.offsetLeft):(e.pageX-pos.x);
+var y=(this.isMSIE)?(window.event.y-this.pic.offsetTop):(e.pageY-pos.y);
+x=x+this.pic_container.scrollLeft;
+y=y+this.pic_container.scrollTop;
+if(this.is_drawing!=this.DM_RECTANGLE_DRAW&&this.is_drawing!=this.DM_SQUARE_DRAW&&this.is_drawing!=this.DM_POLYGON_DRAW&&this.is_drawing!=this.DM_POLYGON_LASTDRAW){
+this.draggedId=null;
+this.is_drawing=0;
+this.statusMessage(this.strings["READY"]);
+this.relaxArea(this.currentid);
+if(this.areas[this.currentid]==this._getLastArea()){
+return;
+}
+this.memory[this.currentid].downx=x;
+this.memory[this.currentid].downy=y;
+}
+};
+imgmap.prototype.img_mousedown=function(e){
+if(this.viewmode==1){
+return;
+}
+if(!this.areas[this.currentid]&&this.config.mode!="editor2"){
+return;
+}
+var pos=this._getPos(this.pic);
+var x=(this.isMSIE)?(window.event.x-this.pic.offsetLeft):(e.pageX-pos.x);
+var y=(this.isMSIE)?(window.event.y-this.pic.offsetTop):(e.pageY-pos.y);
+x=x+this.pic_container.scrollLeft;
+y=y+this.pic_container.scrollTop;
+if(!e){
+e=window.event;
+}
+if(e.shiftKey){
+if(this.is_drawing==this.DM_POLYGON_DRAW){
+this.is_drawing=this.DM_POLYGON_LASTDRAW;
+}
+}
+if(this.is_drawing==this.DM_POLYGON_DRAW){
+this.areas[this.currentid].xpoints[this.areas[this.currentid].xpoints.length]=x-5;
+this.areas[this.currentid].ypoints[this.areas[this.currentid].ypoints.length]=y-5;
+this.memory[this.currentid].downx=x;
+this.memory[this.currentid].downy=y;
+return;
+}else{
+if(this.is_drawing&&this.is_drawing!=this.DM_POLYGON_DRAW){
+if(this.is_drawing==this.DM_POLYGON_LASTDRAW){
+this.areas[this.currentid].xpoints[this.areas[this.currentid].xpoints.length]=x-5;
+this.areas[this.currentid].ypoints[this.areas[this.currentid].ypoints.length]=y-5;
+this._updatecoords();
+this.is_drawing=0;
+this._polygonshrink(this.areas[this.currentid]);
+}
+this.is_drawing=0;
+this.statusMessage(this.strings["READY"]);
+this.relaxArea(this.currentid);
+if(this.areas[this.currentid]==this._getLastArea()){
+if(this.config.mode!="editor2"){
+this.addNewArea();
+}
+return;
+}
+return;
+}
+}
+if(this.config.mode=="editor2"){
+if(this.nextShape==""){
+return;
+}
+this.addNewArea();
+this.initArea(this.currentid,this.nextShape);
+}else{
+var _88=(this.props[this.currentid])?this.props[this.currentid].getElementsByTagName("select")[0].value:this.nextShape;
+if(_88==""){
+_88="rectangle";
+}
+this.initArea(this.currentid,_88);
+}
+if(this.areas[this.currentid].shape=="polygon"){
+this.is_drawing=this.DM_POLYGON_DRAW;
+this.statusMessage(this.strings["POLYGON_DRAW"]);
+this.areas[this.currentid].style.left=x+"px";
+this.areas[this.currentid].style.top=y+"px";
+if(this.config.bounding_box==true){
+this.areas[this.currentid].style.borderWidth="1px";
+this.areas[this.currentid].style.borderStyle="dotted";
+this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX;
+}
+this.areas[this.currentid].style.width=0;
+this.areas[this.currentid].style.height=0;
+this.areas[this.currentid].xpoints=new Array();
+this.areas[this.currentid].ypoints=new Array();
+this.areas[this.currentid].xpoints[0]=x;
+this.areas[this.currentid].ypoints[0]=y;
+}else{
+if(this.areas[this.currentid].shape=="rectangle"){
+this.is_drawing=this.DM_RECTANGLE_DRAW;
+this.statusMessage(this.strings["RECTANGLE_DRAW"]);
+this.areas[this.currentid].style.left=x+"px";
+this.areas[this.currentid].style.top=y+"px";
+this.areas[this.currentid].style.borderWidth="1px";
+this.areas[this.currentid].style.borderStyle="dotted";
+this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_SHAPE;
+this.areas[this.currentid].style.width=0;
+this.areas[this.currentid].style.height=0;
+}else{
+if(this.areas[this.currentid].shape=="circle"){
+this.is_drawing=this.DM_SQUARE_DRAW;
+this.statusMessage(this.strings["SQUARE_DRAW"]);
+this.areas[this.currentid].style.left=x+"px";
+this.areas[this.currentid].style.top=y+"px";
+if(this.config.bounding_box==true){
+this.areas[this.currentid].style.borderWidth="1px";
+this.areas[this.currentid].style.borderStyle="dotted";
+this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX;
+}
+this.areas[this.currentid].style.width=0;
+this.areas[this.currentid].style.height=0;
+}
+}
+}
+this.memory[this.currentid].downx=x;
+this.memory[this.currentid].downy=y;
+};
+imgmap.prototype.img_area_mouseover=function(e){
+if(this.is_drawing){
+return;
+}
+if(this.viewmode==1){
+return;
+}
+var obj=(this.isMSIE)?window.event.srcElement:e.currentTarget;
+if(typeof obj.aid=="undefined"){
+obj=obj.parentNode;
+}
+var id=obj.aid;
+if(this.areas[id]&&this.areas[id].shape!="undefined"){
+this.fireEvent("onFocusArea",this.areas[id]);
+if(this.areas[id].shape=="rectangle"){
+this.areas[id].style.borderWidth="1px";
+this.areas[id].style.borderStyle="solid";
+this.areas[id].style.borderColor=this.config.CL_HIGHLIGHT_SHAPE;
+}else{
+if(this.areas[id].shape=="circle"||this.areas[id].shape=="polygon"){
+if(this.config.bounding_box==true){
+this.areas[id].style.borderWidth="1px";
+this.areas[id].style.borderStyle="solid";
+this.areas[id].style.borderColor=this.config.CL_HIGHLIGHT_BOX;
+}
+}
+}
+this._setopacity(this.areas[id],this.config.CL_HIGHLIGHT_BG,this.config.highlight_opacity);
+this._repaint(this.areas[id],this.config.CL_HIGHLIGHT_SHAPE);
+}
+};
+imgmap.prototype.img_area_mouseout=function(e){
+if(this.is_drawing){
+return;
+}
+if(this.viewmode==1){
+return;
+}
+var obj=(this.isMSIE)?window.event.srcElement:e.currentTarget;
+if(typeof obj.aid=="undefined"){
+obj=obj.parentNode;
+}
+var id=obj.aid;
+if(this.areas[id]&&this.areas[id].shape!="undefined"){
+this.fireEvent("onBlurArea",this.areas[id]);
+if(this.areas[id].shape=="rectangle"){
+this.areas[id].style.borderWidth="1px";
+this.areas[id].style.borderStyle="solid";
+this.areas[id].style.borderColor=this.config.CL_NORM_SHAPE;
+}else{
+if(this.areas[id].shape=="circle"||this.areas[id].shape=="polygon"){
+if(this.config.bounding_box==true){
+this.areas[id].style.borderWidth="1px";
+this.areas[id].style.borderStyle="solid";
+this.areas[id].style.borderColor=this.config.CL_NORM_BOX;
+}
+}
+}
+this._setopacity(this.areas[id],this.config.CL_NORM_BG,this.config.norm_opacity);
+this._repaint(this.areas[id],this.config.CL_NORM_SHAPE);
+}
+};
+imgmap.prototype.img_area_click=function(e){
+if(this.viewmode==1){
+return;
+}
+var obj=(this.isMSIE)?window.event.srcElement:e.currentTarget;
+if(typeof obj.aid=="undefined"){
+obj=obj.parentNode;
+}
+this.form_selectRow(obj.aid,false);
+this.currentid=obj.aid;
+};
+imgmap.prototype.form_selectRow=function(id,_92){
+if(this.is_drawing){
+return;
+}
+if(this.viewmode==1){
+return;
+}
+if(!this.form_container){
+return;
+}
+if(!document.getElementById("img_active_"+id)){
+return;
+}
+document.getElementById("img_active_"+id).checked=1;
+if(_92){
+document.getElementById("img_active_"+id).focus();
+}
+for(var i=0;i6){
+if(obj.shape!="polygon"){
+obj.style.cursor="w-resize";
+}
+}else{
+if(_9e>parseInt(obj.style.width)-6&&_9f>6){
+if(obj.shape!="polygon"){
+obj.style.cursor="e-resize";
+}
+}else{
+if(_9e>6&&_9f<6){
+if(obj.shape!="polygon"){
+obj.style.cursor="n-resize";
+}
+}else{
+if(_9f>parseInt(obj.style.height)-6&&_9e>6){
+if(obj.shape!="polygon"){
+obj.style.cursor="s-resize";
+}
+}else{
+obj.style.cursor="move";
+}
+}
+}
+}
+if(obj.aid!=this.draggedId){
+if(obj.style.cursor=="move"){
+obj.style.cursor="default";
+}
+return;
+}
+if(_9e<6&&_9f>6){
+if(this.areas[this.currentid].shape=="circle"){
+this.is_drawing=this.DM_SQUARE_RESIZE_LEFT;
+this.statusMessage(this.strings["SQUARE_RESIZE_LEFT"]);
+if(this.config.bounding_box==true){
+this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX;
+}
+}else{
+if(this.areas[this.currentid].shape=="rectangle"){
+this.is_drawing=this.DM_RECTANGLE_RESIZE_LEFT;
+this.statusMessage(this.strings["RECTANGLE_RESIZE_LEFT"]);
+this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_SHAPE;
+}
+}
+}else{
+if(_9e>parseInt(this.areas[this.currentid].style.width)-6&&_9f>6){
+if(this.areas[this.currentid].shape=="circle"){
+this.is_drawing=this.DM_SQUARE_RESIZE_RIGHT;
+this.statusMessage(this.strings["SQUARE_RESIZE_RIGHT"]);
+if(this.config.bounding_box==true){
+this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX;
+}
+}else{
+if(this.areas[this.currentid].shape=="rectangle"){
+this.is_drawing=this.DM_RECTANGLE_RESIZE_RIGHT;
+this.statusMessage(this.strings["RECTANGLE_RESIZE_RIGHT"]);
+this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_SHAPE;
+}
+}
+}else{
+if(_9e>6&&_9f<6){
+if(this.areas[this.currentid].shape=="circle"){
+this.is_drawing=this.DM_SQUARE_RESIZE_TOP;
+this.statusMessage(this.strings["SQUARE_RESIZE_TOP"]);
+if(this.config.bounding_box==true){
+this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX;
+}
+}else{
+if(this.areas[this.currentid].shape=="rectangle"){
+this.is_drawing=this.DM_RECTANGLE_RESIZE_TOP;
+this.statusMessage(this.strings["RECTANGLE_RESIZE_TOP"]);
+this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_SHAPE;
+}
+}
+}else{
+if(_9f>parseInt(this.areas[this.currentid].style.height)-6&&_9e>6){
+if(this.areas[this.currentid].shape=="circle"){
+this.is_drawing=this.DM_SQUARE_RESIZE_BOTTOM;
+this.statusMessage(this.strings["SQUARE_RESIZE_BOTTOM"]);
+if(this.config.bounding_box==true){
+this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX;
+}
+}else{
+if(this.areas[this.currentid].shape=="rectangle"){
+this.is_drawing=this.DM_RECTANGLE_RESIZE_BOTTOM;
+this.statusMessage(this.strings["RECTANGLE_RESIZE_BOTTOM"]);
+this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_SHAPE;
+}
+}
+}else{
+if(this.areas[this.currentid].shape=="circle"){
+this.is_drawing=this.DM_SQUARE_MOVE;
+this.statusMessage(this.strings["SQUARE_MOVE"]);
+if(this.config.bounding_box==true){
+this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_BOX;
+}
+this.memory[this.currentid].rdownx=_9e;
+this.memory[this.currentid].rdowny=_9f;
+}else{
+if(this.areas[this.currentid].shape=="rectangle"){
+this.is_drawing=this.DM_RECTANGLE_MOVE;
+this.statusMessage(this.strings["RECTANGLE_MOVE"]);
+this.areas[this.currentid].style.borderColor=this.config.CL_DRAW_SHAPE;
+this.memory[this.currentid].rdownx=_9e;
+this.memory[this.currentid].rdowny=_9f;
+}else{
+if(this.areas[this.currentid].shape=="polygon"){
+for(var i=0;is){
+if(key==40&&_ae[i]>0){
+_ae[i]--;
+}
+if(key==38){
+_ae[i]++;
+}
+this._recalculate(this.currentid);
+break;
+}
+j++;
+}
+obj.value=_ae.join(",");
+this.setSelectionRange(obj,s);
+return true;
+}
+};
+imgmap.prototype.doc_keydown=function(e){
+if(this.viewmode==1){
+return;
+}
+var key=(this.isMSIE)?event.keyCode:e.keyCode;
+if(key==46){
+if(this.selectedId!=null&&!this.is_drawing){
+this.removeArea();
+}
+}else{
+if(key==16){
+if(this.is_drawing==this.DM_RECTANGLE_DRAW){
+this.is_drawing=this.DM_SQUARE_DRAW;
+this.statusMessage(this.strings["SQUARE2_DRAW"]);
+}
+}
+}
+};
+imgmap.prototype.doc_keyup=function(e){
+var key=(this.isMSIE)?event.keyCode:e.keyCode;
+if(key==16){
+if(this.is_drawing==this.DM_SQUARE_DRAW&&this.areas[this.currentid].shape=="rectangle"){
+this.is_drawing=this.DM_RECTANGLE_DRAW;
+this.statusMessage(this.strings["RECTANGLE_DRAW"]);
+}
+}
+};
+imgmap.prototype.doc_mousedown=function(e){
+if(this.viewmode==1){
+return;
+}
+if(this.is_drawing==0){
+this.selectedId=null;
+}
+};
+imgmap.prototype._getPos=function(_b7){
+var _b8=0;
+var _b9=0;
+if(_b7){
+var _ba=_b7.offsetParent;
+if(_ba){
+while((_ba=_b7.offsetParent)!=null){
+_b8+=_b7.offsetLeft;
+_b9+=_b7.offsetTop;
+_b7=_ba;
+}
+}else{
+_b8=_b7.offsetLeft;
+_b9=_b7.offsetTop;
+}
+}
+return new Object({x:_b8,y:_b9});
+};
+imgmap.prototype._getLastArea=function(){
+for(var i=this.areas.length-1;i>=0;i--){
+if(this.areas[i]){
+return this.areas[i];
+}
+}
+return null;
+};
+imgmap.prototype.toClipBoard=function(_bc){
+this.fireEvent("onClipboard",_bc);
+if(typeof _bc=="undefined"){
+_bc=this.getMapHTML();
+}
+try{
+if(window.clipboardData){
+window.clipboardData.setData("Text",_bc);
+}else{
+if(window.netscape){
+netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+var str=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
+if(!str){
+return false;
+}
+str.data=_bc;
+var _be=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);
+if(!_be){
+return false;
+}
+_be.addDataFlavor("text/unicode");
+_be.setTransferData("text/unicode",str,_bc.length*2);
+var _bf=Components.interfaces.nsIClipboard;
+var _c0=Components.classes["@mozilla.org/widget/clipboard;1"].getService(_bf);
+if(!_c0){
+return false;
+}
+_c0.setData(_be,null,_bf.kGlobalClipboard);
+}
+}
+}
+catch(err){
+this.log("Unable to set clipboard data",1);
+}
+};
+imgmap.prototype.assignCSS=function(obj,_c2){
+var _c3=_c2.split(";");
+for(var i=0;i<_c3.length;i++){
+var p=_c3[i].split(":");
+var pp=p[0].trim().split("-");
+var _c7=pp[0];
+for(var j=1;j
+
+
+ Image Map Editor
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/main/inc/lib/fckeditor/editor/plugins/imgmap/readme.html b/main/inc/lib/fckeditor/editor/plugins/imgmap/readme.html
new file mode 100644
index 0000000000..161d74f094
--- /dev/null
+++ b/main/inc/lib/fckeditor/editor/plugins/imgmap/readme.html
@@ -0,0 +1,11 @@
+
+
+
+ imgmap plugin index
+
+
+
+ You should have been redirected to the documentation
+
+
\ No newline at end of file