CreateLink._pluginInfo={name:"CreateLink",origin:"Xinha Core",version:"$LastChangedRevision:990 $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL:http://svn.xinha.webfactional.com/trunk/modules/CreateLink/link.js $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"};function CreateLink(A){}Xinha.prototype._createLink=function(F){var E=this;var D=null;if(typeof F=="undefined"){F=this.getParentElement();if(F){while(F&&!/^a$/i.test(F.tagName)){F=F.parentNode}}}if(!F){var C=E.getSelection();var B=E.createRange(C);var A=0;if(Xinha.is_ie){if(C.type=="Control"){A=B.length}else{A=B.compareEndPoints("StartToEnd",B)}}else{A=B.compareBoundaryPoints(B.START_TO_END,B)}if(A===0){alert(Xinha._lc("You need to select some text before creating a link"));return}D={f_href:"",f_title:"",f_target:"",f_usetarget:E.config.makeLinkShowsTarget}}else{D={f_href:Xinha.is_ie?E.stripBaseURL(F.href):F.getAttribute("href"),f_title:F.title,f_target:F.target,f_usetarget:E.config.makeLinkShowsTarget}}Dialog(E.config.URIs.link,function(J){if(!J){return false}var I=F;if(!I){try{var N=Xinha.uniq("http://www.example.com/Link");E._doc.execCommand("createlink",false,N);var K=E._doc.getElementsByTagName("a");for(var M=0;M<K.length;M++){var H=K[M];if(H.href==N){if(!I){I=H}H.href=J.f_href;if(J.f_target){H.target=J.f_target}if(J.f_title){H.title=J.f_title}}}}catch(L){}}else{var G=J.f_href.trim();E.selectNodeContents(I);if(G===""){E._doc.execCommand("unlink",false,null);E.updateToolbar();return false}else{I.href=G}}if(!(I&&I.tagName.toLowerCase()=="a")){return false}I.target=J.f_target.trim();I.title=J.f_title.trim();E.selectNodeContents(I);E.updateToolbar()},D)};