diff --git a/classes/actions/ActionBlog.class.php b/classes/actions/ActionBlog.class.php index bf18504b..25e508fa 100644 --- a/classes/actions/ActionBlog.class.php +++ b/classes/actions/ActionBlog.class.php @@ -1200,6 +1200,13 @@ class ActionBlog extends Action { $this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error')); return; } + /** + * Есть доступ к комментариям этого топика? Закрытый блог? + */ + if (!$this->ACL_IsAllowShowBlog($oTopic->getBlog(),$this->oUserCurrent)) { + $this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error')); + return; + } $idCommentLast=getRequestStr('idCommentLast',null,'post'); $selfIdComment=getRequestStr('selfIdComment',null,'post'); diff --git a/classes/actions/ActionLink.class.php b/classes/actions/ActionLink.class.php index 83d9e8db..0289a012 100644 --- a/classes/actions/ActionLink.class.php +++ b/classes/actions/ActionLink.class.php @@ -317,7 +317,7 @@ class ActionLink extends Action { /** * Добавляем автора топика в подписчики на новые комментарии к этому топику */ - $this->Subscribe_AddSubscribeSimple('topic_new_comment',$oTopic->getId(),$this->oUserCurrent->getMail()); + $this->Subscribe_AddSubscribeSimple('topic_new_comment',$oTopic->getId(),$this->oUserCurrent->getMail(),$this->oUserCurrent->getId()); //Делаем рассылку спама всем, кто состоит в этом блоге if ($oTopic->getPublish()==1 and $oBlog->getType()!='personal') { $this->Topic_SendNotifyTopicNew($oBlog,$oTopic,$this->oUserCurrent); diff --git a/classes/actions/ActionPhotoset.class.php b/classes/actions/ActionPhotoset.class.php index 6c14ae9f..2877eaa7 100644 --- a/classes/actions/ActionPhotoset.class.php +++ b/classes/actions/ActionPhotoset.class.php @@ -539,7 +539,7 @@ class ActionPhotoset extends Action { /** * Добавляем автора топика в подписчики на новые комментарии к этому топику */ - $this->Subscribe_AddSubscribeSimple('topic_new_comment',$oTopic->getId(),$this->oUserCurrent->getMail()); + $this->Subscribe_AddSubscribeSimple('topic_new_comment',$oTopic->getId(),$this->oUserCurrent->getMail(),$this->oUserCurrent->getId()); /** * Делаем рассылку спама всем, кто состоит в этом блоге */ diff --git a/classes/actions/ActionProfile.class.php b/classes/actions/ActionProfile.class.php index 1f68936b..843c3ec8 100644 --- a/classes/actions/ActionProfile.class.php +++ b/classes/actions/ActionProfile.class.php @@ -1250,6 +1250,13 @@ class ActionProfile extends Action { $oUser->setMail($oChangemail->getMailTo()); $this->User_Update($oUser); + /** + * Меняем емайл в подписках + */ + if ($oChangemail->getMailFrom()) { + $this->Subscribe_ChangeSubscribeMail($oChangemail->getMailFrom(),$oChangemail->getMailTo(),$oUser->getId()); + } + $this->Viewer_Assign('sText',$this->Lang_Get('settings_profile_mail_change_ok',array('mail'=>htmlspecialchars($oChangemail->getMailTo())))); $this->SetTemplateAction('changemail_confirm'); } diff --git a/classes/actions/ActionQuestion.class.php b/classes/actions/ActionQuestion.class.php index c9ac0030..cb6ea5bd 100644 --- a/classes/actions/ActionQuestion.class.php +++ b/classes/actions/ActionQuestion.class.php @@ -294,7 +294,7 @@ class ActionQuestion extends Action { /** * Добавляем автора топика в подписчики на новые комментарии к этому топику */ - $this->Subscribe_AddSubscribeSimple('topic_new_comment',$oTopic->getId(),$this->oUserCurrent->getMail()); + $this->Subscribe_AddSubscribeSimple('topic_new_comment',$oTopic->getId(),$this->oUserCurrent->getMail(),$this->oUserCurrent->getId()); //Делаем рассылку спама всем, кто состоит в этом блоге if ($oTopic->getPublish()==1 and $oBlog->getType()!='personal') { $this->Topic_SendNotifyTopicNew($oBlog,$oTopic,$this->oUserCurrent); diff --git a/classes/actions/ActionSubscribe.class.php b/classes/actions/ActionSubscribe.class.php index b8f4f6ac..8c96eca6 100644 --- a/classes/actions/ActionSubscribe.class.php +++ b/classes/actions/ActionSubscribe.class.php @@ -125,7 +125,7 @@ class ActionSubscribe extends Action { /** * Если подписка еще не существовала, то создаем её */ - if ($oSubscribe=$this->Subscribe_AddSubscribeSimple($sTargetType,$sTargetId,$sMail)) { + if ($oSubscribe=$this->Subscribe_AddSubscribeSimple($sTargetType,$sTargetId,$sMail,$this->oUserCurrent ? $this->oUserCurrent->getId() : null)) { $oSubscribe->setStatus($iValue); $this->Subscribe_UpdateSubscribe($oSubscribe); $this->Message_AddNotice($this->Lang_Get('subscribe_change_ok'),$this->Lang_Get('attention')); diff --git a/classes/actions/ActionTopic.class.php b/classes/actions/ActionTopic.class.php index cd881f8e..ee2bbaa8 100644 --- a/classes/actions/ActionTopic.class.php +++ b/classes/actions/ActionTopic.class.php @@ -341,7 +341,7 @@ class ActionTopic extends Action { /** * Добавляем автора топика в подписчики на новые комментарии к этому топику */ - $this->Subscribe_AddSubscribeSimple('topic_new_comment',$oTopic->getId(),$this->oUserCurrent->getMail()); + $this->Subscribe_AddSubscribeSimple('topic_new_comment',$oTopic->getId(),$this->oUserCurrent->getMail(),$this->oUserCurrent->getId()); /** * Делаем рассылку спама всем, кто состоит в этом блоге */ diff --git a/classes/modules/acl/ACL.class.php b/classes/modules/acl/ACL.class.php index 32f15e02..4cdcade9 100644 --- a/classes/modules/acl/ACL.class.php +++ b/classes/modules/acl/ACL.class.php @@ -83,7 +83,13 @@ class ModuleACL extends Module { * @param ModuleUser_EntityUser $oUser Пользователь * @return bool */ - public function CanPostComment(ModuleUser_EntityUser $oUser) { + public function CanPostComment(ModuleUser_EntityUser $oUser,$oTopic=null) { + /** + * Проверяем на закрытый блог + */ + if ($oTopic and !$this->IsAllowShowBlog($oTopic->getBlog(),$oUser)) { + return false; + } if ($oUser->getRating()>=Config::Get('acl.create.comment.rating')) { return true; } @@ -270,6 +276,7 @@ class ModuleACL extends Module { * * @param ModuleBlog_EntityBlog $oBlog Блог * @param ModuleUser_EntityUser $oUser Пользователь + * @return bool */ public function IsAllowBlog($oBlog,$oUser) { if ($oUser->isAdministrator()) { @@ -288,6 +295,28 @@ class ModuleACL extends Module { } return false; } + /** + * Проверяет можно или нет юзеру просматривать блог + * + * @param ModuleBlog_EntityBlog $oBlog Блог + * @param ModuleUser_EntityUser $oUser Пользователь + * @return bool + */ + public function IsAllowShowBlog($oBlog,$oUser) { + if ($oBlog->getType()!='close') { + return true; + } + if ($oUser->isAdministrator()) { + return true; + } + if ($oBlog->getOwnerId()==$oUser->getId()) { + return true; + } + if ($oBlogUser=$this->Blog_GetBlogUserByBlogIdAndUserId($oBlog->getId(),$oUser->getId()) and $oBlogUser->getUserRole()>ModuleBlog::BLOG_USER_ROLE_GUEST) { + return true; + } + return false; + } /** * Проверяет можно или нет пользователю редактировать данный топик * diff --git a/classes/modules/blog/Blog.class.php b/classes/modules/blog/Blog.class.php index a799bb6f..60416508 100644 --- a/classes/modules/blog/Blog.class.php +++ b/classes/modules/blog/Blog.class.php @@ -782,21 +782,13 @@ class ModuleBlog extends Module { * Удаляем топики */ foreach ($aTopicIds as $iTopicId) { - $this->Cache_Delete("topic_{$iTopicId}"); - if(Config::Get('db.tables.engine')=="InnoDB") { - $this->Topic_DeleteTopicAdditionalData($iTopicId); - } else { - $this->Topic_DeleteTopic($iTopicId); - } + $this->Topic_DeleteTopic($iTopicId); } - } /** * Удаляем связи пользователей блога. */ - if(Config::Get('db.tables.engine')!="InnoDB"){ - $this->oMapperBlog->DeleteBlogUsersByBlogId($iBlogId); - } + $this->oMapperBlog->DeleteBlogUsersByBlogId($iBlogId); /** * Удаляем голосование за блог */ diff --git a/classes/modules/notify/Notify.class.php b/classes/modules/notify/Notify.class.php index 3ae13cca..ec53e05a 100644 --- a/classes/modules/notify/Notify.class.php +++ b/classes/modules/notify/Notify.class.php @@ -154,7 +154,7 @@ class ModuleNotify extends Module { $this->Lang_Get('notify_subject_reactvation'), array( 'oUser' => $oUser, - ) + ),null,true ); } /** @@ -171,7 +171,7 @@ class ModuleNotify extends Module { array( 'oUser' => $oUser, 'sPassword' => $sPassword, - ) + ),null,true ); } /** @@ -188,7 +188,7 @@ class ModuleNotify extends Module { array( 'oUser' => $oUser, 'sPassword' => $sPassword, - ) + ),null,true ); } /** @@ -330,7 +330,7 @@ class ModuleNotify extends Module { array( 'oUser' => $oUser, 'oReminder' => $oReminder, - ) + ),null,true ); } /** @@ -347,7 +347,7 @@ class ModuleNotify extends Module { array( 'oUser' => $oUser, 'sNewPassword' => $sNewPassword, - ) + ),null,true ); } /** @@ -398,8 +398,9 @@ class ModuleNotify extends Module { * @param string $sSubject Тема письма * @param array $aAssign Ассоциативный массив для загрузки переменных в шаблон письма * @param string|null $sPluginName Плагин из которого происходит отправка + * @param bool $bForceSend Отправлять сразу, даже при опции module.notify.delayed = true */ - public function Send($oUserTo,$sTemplate,$sSubject,$aAssign=array(),$sPluginName=null) { + public function Send($oUserTo,$sTemplate,$sSubject,$aAssign=array(),$sPluginName=null,$bForceSend=false) { if ($oUserTo instanceof ModuleUser_EntityUser) { $sMail=$oUserTo->getMail(); $sName=$oUserTo->getLogin(); @@ -422,7 +423,7 @@ class ModuleNotify extends Module { * то добавляем задание в массив. В противном случае, * сразу отсылаем на email */ - if(Config::Get('module.notify.delayed')) { + if(Config::Get('module.notify.delayed') and !$bForceSend) { $oNotifyTask=Engine::GetEntity( 'Notify_Task', array( diff --git a/classes/modules/subscribe/Subscribe.class.php b/classes/modules/subscribe/Subscribe.class.php index a62a4519..aca43c4f 100644 --- a/classes/modules/subscribe/Subscribe.class.php +++ b/classes/modules/subscribe/Subscribe.class.php @@ -148,7 +148,7 @@ class ModuleSubscribe extends Module { * @param string $sMail Емайл * @return ModuleSubscribe_EntitySubscribe|bool */ - public function AddSubscribeSimple($sTargetType,$sTargetId,$sMail) { + public function AddSubscribeSimple($sTargetType,$sTargetId,$sMail,$sUserId=null) { if (!$sMail) { return false; } @@ -161,6 +161,12 @@ class ModuleSubscribe extends Module { $oSubscribe->setKey(func_generator(32)); $oSubscribe->setIp(func_getIp()); $oSubscribe->setStatus(1); + /** + * Если только для авторизованных, то добавляем user_id + */ + if ($sUserId and !$this->IsAllowTargetForGuest($sTargetType)) { + $oSubscribe->setUserId($sUserId); + } $this->Subscribe_AddSubscribe($oSubscribe); } return $oSubscribe; @@ -174,6 +180,18 @@ class ModuleSubscribe extends Module { public function UpdateSubscribe($oSubscribe) { return $this->oMapper->UpdateSubscribe($oSubscribe); } + /** + * Смена емайла в подписках + * + * @param string $sMailOld Старый емайл + * @param string $sMailNew Новый емайл + * @param int|null $iUserId Id пользователя + * + * @return int + */ + public function ChangeSubscribeMail($sMailOld,$sMailNew,$iUserId=null) { + return $this->oMapper->ChangeSubscribeMail($sMailOld,$sMailNew,$iUserId); + } /** * Возвращает список подписок по фильтру * diff --git a/classes/modules/subscribe/mapper/Subscribe.mapper.class.php b/classes/modules/subscribe/mapper/Subscribe.mapper.class.php index 6c80e795..4ff7a0bc 100644 --- a/classes/modules/subscribe/mapper/Subscribe.mapper.class.php +++ b/classes/modules/subscribe/mapper/Subscribe.mapper.class.php @@ -66,6 +66,23 @@ class ModuleSubscribe_MapperSubscribe extends Mapper { $oSubscribe->getDateRemove(), $oSubscribe->getId()); } + /** + * Смена емайла в подписках + * + * @param string $sMailOld Старый емайл + * @param string $sMailNew Новый емайл + * @param int|null $iUserId Id пользователя + * + * @return int + */ + public function ChangeSubscribeMail($sMailOld,$sMailNew,$iUserId=null) { + $sql = "UPDATE ".Config::Get('db.table.subscribe')." + SET + mail = ? + WHERE mail = ? { and user_id = ?d } + "; + return $this->oDb->query($sql,$sMailNew,$sMailOld,$iUserId ? $iUserId : DBSIMPLE_SKIP); + } /** * Возвращает список подписок по фильтру * diff --git a/classes/modules/topic/Topic.class.php b/classes/modules/topic/Topic.class.php index dbee54dc..9778f1e8 100644 --- a/classes/modules/topic/Topic.class.php +++ b/classes/modules/topic/Topic.class.php @@ -255,7 +255,7 @@ class ModuleTopic extends Module { /** * Если топик успешно удален, удаляем связанные данные */ - if($bResult=$this->oMapperTopic->DeleteTopic($sTopicId)){ + if($this->oMapperTopic->DeleteTopic($sTopicId)){ return $this->DeleteTopicAdditionalData($sTopicId,$aPhotos); } diff --git a/classes/modules/topic/mapper/Topic.mapper.class.php b/classes/modules/topic/mapper/Topic.mapper.class.php index 21495884..589792fd 100644 --- a/classes/modules/topic/mapper/Topic.mapper.class.php +++ b/classes/modules/topic/mapper/Topic.mapper.class.php @@ -140,10 +140,8 @@ class ModuleTopic_MapperTopic extends Mapper { WHERE topic_id = ?d "; - if ($this->oDb->query($sql,$sTopicId)) { - return true; - } - return false; + $res=$this->oDb->query($sql,$sTopicId); + return $res===false or is_null($res) ? false : true; } /** * Получает топик по уникальному хешу(текст топика) diff --git a/engine/lib/external/html5shiv.js b/engine/lib/external/html5shiv.js deleted file mode 100644 index 8dab2e1e..00000000 --- a/engine/lib/external/html5shiv.js +++ /dev/null @@ -1,220 +0,0 @@ -/*! HTML5 Shiv vpre3.6 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed */ -;(function(window, document) { - - /** Preset options */ - var options = window.html5 || {}; - - /** Used to skip problem elements */ - var reSkip = /^<|^(?:button|form|map|select|textarea|object|iframe|option|optgroup)$/i; - - /** Not all elements can be cloned in IE (this list can be shortend) **/ - var saveClones = /^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i; - - /** Detect whether the browser supports default html5 styles */ - var supportsHtml5Styles; - - /** Detect whether the browser supports unknown elements */ - var supportsUnknownElements; - - (function() { - var a = document.createElement('a'); - - a.innerHTML = ''; - - //if the hidden property is implemented we can assume, that the browser supports HTML5 Styles | this fails in Chrome 8 - supportsHtml5Styles = ('hidden' in a); - //if we are part of Modernizr, we do an additional test to solve the Chrome 8 fail - if(supportsHtml5Styles && typeof injectElementWithStyles == 'function'){ - injectElementWithStyles('#modernizr{}', function(node){ - node.hidden = true; - supportsHtml5Styles = (window.getComputedStyle ? - getComputedStyle(node, null) : - node.currentStyle).display == 'none'; - }); - } - - supportsUnknownElements = a.childNodes.length == 1 || (function() { - // assign a false positive if unable to shiv - try { - (document.createElement)('a'); - } catch(e) { - return true; - } - var frag = document.createDocumentFragment(); - return ( - typeof frag.cloneNode == 'undefined' || - typeof frag.createDocumentFragment == 'undefined' || - typeof frag.createElement == 'undefined' - ); - }()); - - }()); - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a style sheet with the given CSS text and adds it to the document. - * @private - * @param {Document} ownerDocument The document. - * @param {String} cssText The CSS text. - * @returns {StyleSheet} The style element. - */ - function addStyleSheet(ownerDocument, cssText) { - var p = ownerDocument.createElement('p'), - parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; - - p.innerHTML = 'x'; - return parent.insertBefore(p.lastChild, parent.firstChild); - } - - /** - * Returns the value of `html5.elements` as an array. - * @private - * @returns {Array} An array of shived element node names. - */ - function getElements() { - var elements = html5.elements; - return typeof elements == 'string' ? elements.split(' ') : elements; - } - - /** - * Shivs the `createElement` and `createDocumentFragment` methods of the document. - * @private - * @param {Document|DocumentFragment} ownerDocument The document. - */ - function shivMethods(ownerDocument) { - var cache = {}, - docCreateElement = ownerDocument.createElement, - docCreateFragment = ownerDocument.createDocumentFragment, - frag = docCreateFragment(); - - ownerDocument.createElement = function(nodeName) { - //abort shiv - if(!html5.shivMethods){ - return docCreateElement(nodeName); - } - - var node; - - if(cache[nodeName]){ - node = cache[nodeName].cloneNode(); - } else if(saveClones.test(nodeName)){ - node = (cache[nodeName] = docCreateElement(nodeName)).cloneNode(); - } else { - node = docCreateElement(nodeName); - } - - // Avoid adding some elements to fragments in IE < 9 because - // * Attributes like `name` or `type` cannot be set/changed once an element - // is inserted into a document/fragment - // * Link elements with `src` attributes that are inaccessible, as with - // a 403 response, will cause the tab/window to crash - // * Script elements appended to fragments will execute when their `src` - // or `text` property is set - return node.canHaveChildren && !reSkip.test(nodeName) ? frag.appendChild(node) : node; - }; - - ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' + - 'var n=f.cloneNode(),c=n.createElement;' + - 'h.shivMethods&&(' + - // unroll the `createElement` calls - getElements().join().replace(/\w+/g, function(nodeName) { - docCreateElement(nodeName); - frag.createElement(nodeName); - return 'c("' + nodeName + '")'; - }) + - ');return n}' - )(html5, frag); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Shivs the given document. - * @memberOf html5 - * @param {Document} ownerDocument The document to shiv. - * @returns {Document} The shived document. - */ - function shivDocument(ownerDocument) { - var shived; - if (ownerDocument.documentShived) { - return ownerDocument; - } - if (html5.shivCSS && !supportsHtml5Styles) { - shived = !!addStyleSheet(ownerDocument, - // corrects block display not defined in IE6/7/8/9 - 'article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}' + - // corrects audio display not defined in IE6/7/8/9 - 'audio{display:none}' + - // corrects canvas and video display not defined in IE6/7/8/9 - 'canvas,video{display:inline-block;*display:inline;*zoom:1}' + - // corrects 'hidden' attribute and audio[controls] display not present in IE7/8/9 - '[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}' + - // adds styling not present in IE6/7/8/9 - 'mark{background:#FF0;color:#000}' - ); - } - if (!supportsUnknownElements) { - shived = !shivMethods(ownerDocument); - } - if (shived) { - ownerDocument.documentShived = shived; - } - return ownerDocument; - } - - /*--------------------------------------------------------------------------*/ - - /** - * The `html5` object is exposed so that more elements can be shived and - * existing shiving can be detected on iframes. - * @type Object - * @example - * - * // options can be changed before the script is included - * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false }; - */ - var html5 = { - - /** - * An array or space separated string of node names of the elements to shiv. - * @memberOf html5 - * @type Array|String - */ - 'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video', - - /** - * A flag to indicate that the HTML5 style sheet should be inserted. - * @memberOf html5 - * @type Boolean - */ - 'shivCSS': !(options.shivCSS === false), - - /** - * A flag to indicate that the document's `createElement` and `createDocumentFragment` - * methods should be overwritten. - * @memberOf html5 - * @type Boolean - */ - 'shivMethods': !(options.shivMethods === false), - - /** - * A string to describe the type of `html5` object ("default" or "default print"). - * @memberOf html5 - * @type String - */ - 'type': 'default', - - // shivs the document according to the specified `html5` object options - 'shivDocument': shivDocument - }; - - /*--------------------------------------------------------------------------*/ - - // expose html5 - window.html5 = html5; - - // shiv the document - shivDocument(document); - -}(this, document)); \ No newline at end of file diff --git a/engine/modules/mail/Mail.class.php b/engine/modules/mail/Mail.class.php index 2e3d2364..becf20d9 100644 --- a/engine/modules/mail/Mail.class.php +++ b/engine/modules/mail/Mail.class.php @@ -173,6 +173,7 @@ class ModuleMail extends Module { $this->oMailer->CharSet=$this->sCharSet; $this->oMailer->From=$this->sFrom; + $this->oMailer->Sender=$this->sFrom; $this->oMailer->FromName=$this->sFromName; } /** diff --git a/engine/modules/viewer/Viewer.class.php b/engine/modules/viewer/Viewer.class.php index cbe59543..ee1dd0b3 100644 --- a/engine/modules/viewer/Viewer.class.php +++ b/engine/modules/viewer/Viewer.class.php @@ -731,7 +731,7 @@ class ModuleViewer extends Module { * Сортируем блоки по приоритетности */ foreach($this->aBlocks as $sGroup=>$aBlocks) { - uasort($aBlocks,array(&$this,'_SortBlocks')); + uasort($aBlocks,array($this,'_SortBlocks')); $this->aBlocks[$sGroup] = array_reverse($aBlocks); } } diff --git a/engine/modules/viewer/plugs/function.date_format.php b/engine/modules/viewer/plugs/function.date_format.php index fc163c92..57cdd8d3 100644 --- a/engine/modules/viewer/plugs/function.date_format.php +++ b/engine/modules/viewer/plugs/function.date_format.php @@ -29,6 +29,8 @@ * В указанном формате 'day' будет заменено на соответствующее значение. * minutes_back* [int] Количество минут, в течении которых событие имеет статус "... минут назад" * hours_back* [int] Количество часов, в течении которых событие имеет статус "... часов назад" + * tz* [float] Временная зона + * notz* [bool] Не учитывать зону * * (* - параметр является необязательным) * @@ -39,15 +41,25 @@ function smarty_function_date_format($aParams,&$oSmarty) { require_once(Config::Get('path.root.engine').'/classes/Engine.class.php'); $oEngine = Engine::getInstance(); - $oUserCurrent=$oEngine->User_GetUserCurrent(); $sFormatDefault = "d F Y, H:i"; // формат даты по умолчанию $iDeclinationDefault = 1; // индекс склонения по умолчанию /** * Текущая дата и сдвиг времени для пользователя */ - if ($oUserCurrent and $oUserCurrent->getSettingsTimezone()) { - $iDiff=(date('I') + $oUserCurrent->getSettingsTimezone() - (strtotime(date("Y-m-d H:i:s"))-strtotime(gmdate("Y-m-d H:i:s")))/3600)*3600; + $iTz=false; + if (!isset($aParams['notz'])) { + if (isset($aParams['tz'])) { + $iTz=$aParams['tz']; + } + if ($iTz===false) { + if ($oUserCurrent=$oEngine->User_GetUserCurrent() and $oUserCurrent->getSettingsTimezone()) { + $iTz=$oUserCurrent->getSettingsTimezone(); + } + } + } + if ($iTz!==false) { + $iDiff=(date('I') + $iTz - (strtotime(date("Y-m-d H:i:s"))-strtotime(gmdate("Y-m-d H:i:s")))/3600)*3600; } else { $iDiff=0; // пользователю показываем время от зоны из основного конфига } @@ -55,7 +67,7 @@ function smarty_function_date_format($aParams,&$oSmarty) { /** * Определяем дату */ - $sDate = (empty($aParams['date'])) ? $iNow : $aParams['date']; + $sDate = (empty($aParams['date'])) ? time() : $aParams['date']; $iDeclination = (!isset($aParams['declination'])) ? $iDeclinationDefault : $aParams['declination']; $sFormat = (empty($aParams['format'])) ? $sFormatDefault : $aParams['format']; /** diff --git a/install/build.sh b/install/build.sh deleted file mode 100644 index 8da99a07..00000000 --- a/install/build.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -ABSOLUTE_FILENAME=`readlink -e "$0"` -DIRECTORY=`dirname "$ABSOLUTE_FILENAME"` - -if [ ! -e "$DIRECTORY/../config/config.local.php" ]; then - cp $DIRECTORY/../config/config.local.dist.php $DIRECTORY/../config/config.local.php -fi - -chmod 777 $DIRECTORY/../config/config.local.php -chmod 777 $DIRECTORY/../tmp -chmod 777 $DIRECTORY/../logs -chmod 777 $DIRECTORY/../uploads -chmod 777 $DIRECTORY/../templates/compiled -chmod 777 $DIRECTORY/../templates/cache -chmod 777 $DIRECTORY/../plugins diff --git a/install/convert_0.5.1_to_1.0.1.sql b/install/convert_0.5.1_to_1.0.1.sql deleted file mode 100644 index 66d71d36..00000000 --- a/install/convert_0.5.1_to_1.0.1.sql +++ /dev/null @@ -1,139 +0,0 @@ -ALTER TABLE `prefix_topic` ADD `topic_count_favourite` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `topic_count_comment`; -ALTER TABLE `prefix_comment` ADD `comment_count_favourite` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `comment_count_vote`; - -ALTER TABLE `prefix_topic` ADD `topic_count_vote_up` INT NOT NULL DEFAULT '0' AFTER `topic_count_vote` , -ADD `topic_count_vote_down` INT NOT NULL DEFAULT '0' AFTER `topic_count_vote_up` , -ADD `topic_count_vote_abstain` INT NOT NULL DEFAULT '0' AFTER `topic_count_vote_down`; - -ALTER TABLE `prefix_blog` ADD `blog_count_topic` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `blog_count_user` , -ADD INDEX ( `blog_count_topic` ); - -CREATE TABLE IF NOT EXISTS `prefix_subscribe` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `target_type` varchar(20) NOT NULL, - `target_id` int(11) DEFAULT NULL, - `mail` varchar(50) NOT NULL, - `date_add` datetime NOT NULL, - `date_remove` datetime DEFAULT NULL, - `ip` varchar(20) NOT NULL, - `key` varchar(32) DEFAULT NULL, - `status` tinyint(1) NOT NULL DEFAULT '1', - PRIMARY KEY (`id`), - KEY `type` (`target_type`), - KEY `mail` (`mail`), - KEY `status` (`status`), - KEY `key` (`key`), - KEY `target_id` (`target_id`), - KEY `ip` (`ip`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `prefix_wall` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `pid` int(11) DEFAULT NULL, - `wall_user_id` int(11) unsigned NOT NULL, - `user_id` int(11) unsigned NOT NULL, - `count_reply` int(11) NOT NULL DEFAULT '0', - `last_reply` varchar(100) NOT NULL, - `date_add` datetime NOT NULL, - `ip` varchar(20) NOT NULL, - `text` text NOT NULL, - PRIMARY KEY (`id`), - KEY `pid` (`pid`), - KEY `wall_user_id` (`wall_user_id`), - KEY `ip` (`ip`), - KEY `user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `prefix_wall` - ADD CONSTRAINT `prefix_wall_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_wall_ibfk_1` FOREIGN KEY (`wall_user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - - -ALTER TABLE `prefix_user_field` ADD `type` VARCHAR( 50 ) NOT NULL AFTER `id` , -ADD INDEX ( `type` ); - - -CREATE TABLE IF NOT EXISTS `prefix_user_note` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `target_user_id` int(11) unsigned NOT NULL, - `user_id` int(11) unsigned NOT NULL, - `text` text NOT NULL, - `date_add` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `user_id` (`user_id`), - KEY `target_user_id` (`target_user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `prefix_user_note` - ADD CONSTRAINT `prefix_user_note_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_user_note_ibfk_1` FOREIGN KEY (`target_user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - - - -ALTER TABLE `prefix_favourite` ADD `tags` VARCHAR( 250 ) NOT NULL; -CREATE TABLE IF NOT EXISTS `prefix_favourite_tag` ( - `user_id` int(10) unsigned NOT NULL, - `target_id` int(11) NOT NULL, - `target_type` enum('topic','comment','talk') NOT NULL, - `is_user` tinyint(1) NOT NULL DEFAULT '0', - `text` varchar(50) NOT NULL, - KEY `user_id_target_type_id` (`user_id`,`target_type`,`target_id`), - KEY `target_type_id` (`target_type`,`target_id`), - KEY `is_user` (`is_user`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `prefix_favourite_tag` - ADD CONSTRAINT `prefix_favourite_tag_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - - -ALTER TABLE `prefix_topic` ADD INDEX ( `topic_count_comment` ); - -ALTER TABLE `prefix_talk` ADD `talk_user_id_last` INT NOT NULL AFTER `talk_date_last` , -ADD INDEX ( `talk_user_id_last` ); - -ALTER TABLE `prefix_talk` ADD `talk_comment_id_last` INT NULL DEFAULT NULL AFTER `talk_user_ip`; -ALTER TABLE `prefix_talk_user` ADD INDEX ( `comment_count_new` ); - -DROP TABLE `prefix_country_user`; -DROP TABLE `prefix_country`; -DROP TABLE `prefix_city_user`; -DROP TABLE `prefix_city`; - -INSERT INTO `prefix_user_field` (`type`, `name`, `title`, `pattern`) VALUES -('contact', 'phone', 'Телефон', ''), -('contact', 'mail', 'E-mail', '{*}'), -('contact', 'skype', 'Skype', '{*}'), -('contact', 'icq', 'ICQ', '{*}'), -('contact', 'www', 'Сайт', '{*}'), -('social', 'twitter', 'Twitter', '{*}'), -('social', 'facebook', 'Facebook', '{*}'), -('social', 'vkontakte', 'ВКонтакте', '{*}'), -('social', 'odnoklassniki', 'Одноклассники', '{*}'); - -ALTER TABLE `prefix_favourite_tag` ADD INDEX ( `text` ); - -ALTER TABLE `prefix_vote` ADD `vote_ip` VARCHAR( 15 ) NOT NULL DEFAULT '', -ADD INDEX ( `vote_ip` ); - -ALTER TABLE `prefix_user` ADD `user_settings_timezone` VARCHAR( 6 ) NULL DEFAULT NULL AFTER `user_settings_notice_new_friend`; - -CREATE TABLE IF NOT EXISTS `prefix_user_changemail` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) unsigned NOT NULL, - `date_add` datetime NOT NULL, - `date_used` datetime DEFAULT NULL, - `date_expired` datetime NOT NULL, - `mail_from` varchar(50) NOT NULL, - `mail_to` varchar(50) NOT NULL, - `code_from` varchar(32) NOT NULL, - `code_to` varchar(32) NOT NULL, - `confirm_from` tinyint(1) NOT NULL DEFAULT '0', - `confirm_to` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - KEY `user_id` (`user_id`), - KEY `code_from` (`code_from`), - KEY `code_to` (`code_to`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `prefix_user_changemail` - ADD CONSTRAINT `prefix_user_changemail_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; \ No newline at end of file diff --git a/install/convert_1.0_to_1.0.1.sql b/install/convert_1.0_to_1.0.1.sql deleted file mode 100644 index 751225c8..00000000 --- a/install/convert_1.0_to_1.0.1.sql +++ /dev/null @@ -1,33 +0,0 @@ -ALTER TABLE `prefix_user` ADD `user_settings_timezone` VARCHAR( 6 ) NULL DEFAULT NULL AFTER `user_settings_notice_new_friend`; - --- --- Структура таблицы `prefix_user_changemail` --- - -CREATE TABLE IF NOT EXISTS `prefix_user_changemail` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) unsigned NOT NULL, - `date_add` datetime NOT NULL, - `date_used` datetime DEFAULT NULL, - `date_expired` datetime NOT NULL, - `mail_from` varchar(50) NOT NULL, - `mail_to` varchar(50) NOT NULL, - `code_from` varchar(32) NOT NULL, - `code_to` varchar(32) NOT NULL, - `confirm_from` tinyint(1) NOT NULL DEFAULT '0', - `confirm_to` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - KEY `user_id` (`user_id`), - KEY `code_from` (`code_from`), - KEY `code_to` (`code_to`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Ограничения внешнего ключа сохраненных таблиц --- - --- --- Ограничения внешнего ключа таблицы `prefix_user_changemail` --- -ALTER TABLE `prefix_user_changemail` - ADD CONSTRAINT `prefix_user_changemail_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; \ No newline at end of file diff --git a/install/geo_base.sql b/install/geo_base.sql deleted file mode 100644 index 93f0706c..00000000 --- a/install/geo_base.sql +++ /dev/null @@ -1,19561 +0,0 @@ --- --- Структура таблицы `prefix_geo_city` --- - -CREATE TABLE IF NOT EXISTS `prefix_geo_city` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `country_id` int(11) NOT NULL, - `region_id` int(11) NOT NULL, - `name_ru` varchar(50) NOT NULL, - `name_en` varchar(50) NOT NULL, - `sort` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - KEY `sort` (`sort`), - KEY `country_id` (`country_id`), - KEY `region_id` (`region_id`), - KEY `name_ru` (`name_ru`), - KEY `name_en` (`name_en`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=17590 ; - --- --- Дамп данных таблицы `prefix_geo_city` --- - -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(1, 1, 1, 'Авадхара', 'Авадхара', 100), -(2, 1, 1, 'Гагра', 'Гагра', 200), -(3, 1, 1, 'Гали', 'Гали', 300), -(4, 1, 1, 'Гудаута', 'Гудаута', 400), -(5, 1, 1, 'Гульрипш', 'Гульрипш', 500), -(6, 1, 1, 'Новый Афон', 'Новый Афон', 600), -(7, 1, 1, 'Очамчир', 'Очамчир', 700), -(8, 1, 1, 'Пицунда', 'Пицунда', 800), -(9, 1, 1, 'Сухуми', 'Сухуми', 900), -(10, 1, 1, 'Ткварчели', 'Ткварчели', 1000), -(11, 2, 2, 'Belconnen', 'Belconnen', 100), -(12, 2, 2, 'Canberra', 'Canberra', 200), -(13, 2, 2, 'Duntroon', 'Duntroon', 300), -(14, 2, 2, 'Fyshwick', 'Fyshwick', 400), -(15, 2, 2, 'Gibraltar', 'Gibraltar', 500), -(16, 2, 2, 'Gudgenby', 'Gudgenby', 600), -(17, 2, 2, 'Hall', 'Hall', 700), -(18, 2, 2, 'Harman', 'Harman', 800), -(19, 2, 2, 'Jervis Bay', 'Jervis Bay', 900), -(20, 2, 2, 'Majura', 'Majura', 1000), -(21, 2, 2, 'Molonglo', 'Molonglo', 1100), -(22, 2, 2, 'Weston Creek', 'Weston Creek', 1200), -(23, 2, 3, 'Abbotsford', 'Abbotsford', 100), -(24, 2, 3, 'Abercrombie', 'Abercrombie', 200), -(25, 2, 3, 'Aberdeen', 'Aberdeen', 300), -(26, 2, 3, 'Aberfoyle', 'Aberfoyle', 400), -(27, 2, 3, 'Aberglasslyn', 'Aberglasslyn', 500), -(28, 2, 3, 'Acacia Creek', 'Acacia Creek', 600), -(29, 2, 3, 'Adaminaby', 'Adaminaby', 700), -(30, 2, 3, 'Alagala', 'Alagala', 800), -(31, 2, 3, 'Albion Park', 'Albion Park', 900), -(32, 2, 3, 'Alice', 'Alice', 1000), -(33, 2, 3, 'Alpine', 'Alpine', 1100), -(34, 2, 3, 'Alstonville', 'Alstonville', 1200), -(35, 2, 3, 'Artarman', 'Artarman', 1300), -(36, 2, 3, 'Auburn', 'Auburn', 1400), -(37, 2, 3, 'Bear Hill', 'Bear Hill', 1500), -(38, 2, 3, 'Campbelltown', 'Campbelltown', 1600), -(39, 2, 3, 'Casino', 'Casino', 1700), -(40, 2, 3, 'Coffs Harbour', 'Coffs Harbour', 1800), -(41, 2, 3, 'Cowra', 'Cowra', 1900), -(42, 2, 3, 'Ladysmith', 'Ladysmith', 2000), -(43, 2, 3, 'Liverpool', 'Liverpool', 2100), -(44, 2, 3, 'Macksville', 'Macksville', 2200), -(45, 2, 3, 'Meldrum', 'Meldrum', 2300), -(46, 2, 3, 'Moonee Beach', 'Moonee Beach', 2400), -(47, 2, 3, 'Moss Vale', 'Moss Vale', 2500), -(48, 2, 3, 'Muswellbrook', 'Muswellbrook', 2600), -(49, 2, 3, 'Newcastle', 'Newcastle', 2700), -(50, 2, 3, 'Peelwood', 'Peelwood', 2800), -(51, 2, 3, 'Scone', 'Scone', 2900), -(52, 2, 3, 'Sidney', 'Sidney', 3000), -(53, 2, 3, 'South Sydney Municipality', 'South Sydney Municipality', 3100), -(54, 2, 3, 'Sydney', 'Sydney', 3200), -(55, 2, 3, 'Tamworth', 'Tamworth', 3300), -(56, 2, 3, 'Wollongong', 'Wollongong', 3400), -(57, 2, 4, 'Cascade Station', 'Cascade Station', 100), -(58, 2, 4, 'Longridge', 'Longridge', 200), -(59, 2, 4, 'Longridge Station', 'Longridge Station', 300), -(60, 2, 5, 'Adelaide River', 'Adelaide River', 100), -(61, 2, 5, 'Alice Springs', 'Alice Springs', 200), -(62, 2, 5, 'Arltunga', 'Arltunga', 300), -(63, 2, 5, 'Arltunga Mission', 'Arltunga Mission', 400), -(64, 2, 5, 'Bagot', 'Bagot', 500), -(65, 2, 5, 'Barrow Creek', 'Barrow Creek', 600), -(66, 2, 5, 'Borroloola', 'Borroloola', 700), -(67, 2, 5, 'Daly Waters', 'Daly Waters', 800), -(68, 2, 5, 'Darwin', 'Darwin', 900), -(69, 2, 5, 'Finke Siding', 'Finke Siding', 1000), -(70, 2, 5, 'Glen Helen', 'Glen Helen', 1100), -(71, 2, 5, 'Gove', 'Gove', 1200), -(72, 2, 5, 'Nullumbuy', 'Nullumbuy', 1300), -(73, 2, 5, 'Stuart', 'Stuart', 1400), -(74, 2, 6, 'Abercorn', 'Abercorn', 100), -(75, 2, 6, 'Abermain', 'Abermain', 200), -(76, 2, 6, 'Ackland', 'Ackland', 300), -(77, 2, 6, 'Advancetown', 'Advancetown', 400), -(78, 2, 6, 'Albany Creek', 'Albany Creek', 500), -(79, 2, 6, 'Alberton', 'Alberton', 600), -(80, 2, 6, 'Alexandra', 'Alexandra', 700), -(81, 2, 6, 'Alexandra-Mooloolaba', 'Alexandra-Mooloolaba', 800), -(82, 2, 6, 'Allan', 'Allan', 900), -(83, 2, 6, 'Allingham', 'Allingham', 1000), -(84, 2, 6, 'Alma Creek', 'Alma Creek', 1100), -(85, 2, 6, 'Alpha', 'Alpha', 1200), -(86, 2, 6, 'Aramara', 'Aramara', 1300), -(87, 2, 6, 'Belgian Gardens', 'Belgian Gardens', 1400), -(88, 2, 6, 'Brisbane', 'Brisbane', 1500), -(89, 2, 6, 'Bucasia', 'Bucasia', 1600), -(90, 2, 6, 'Bundaberg', 'Bundaberg', 1700), -(91, 2, 6, 'Cairns', 'Cairns', 1800), -(92, 2, 6, 'Caloundra', 'Caloundra', 1900), -(93, 2, 6, 'Coorparoo', 'Coorparoo', 2000), -(94, 2, 6, 'Cynthia', 'Cynthia', 2100), -(95, 2, 6, 'Emerald', 'Emerald', 2200), -(96, 2, 6, 'Gladstone', 'Gladstone', 2300), -(97, 2, 6, 'Gold Coast', 'Gold Coast', 2400), -(98, 2, 6, 'Gympie', 'Gympie', 2500), -(99, 2, 6, 'Howard', 'Howard', 2600), -(100, 2, 6, 'Ipswich', 'Ipswich', 2700), -(101, 2, 6, 'Nindigully', 'Nindigully', 2800), -(102, 2, 6, 'Oakenden', 'Oakenden', 2900), -(103, 2, 6, 'Quamby', 'Quamby', 3000), -(104, 2, 6, 'Redcliffe', 'Redcliffe', 3100), -(105, 2, 6, 'Rockhampton', 'Rockhampton', 3200), -(106, 2, 6, 'Surfers Paradise', 'Surfers Paradise', 3300), -(107, 2, 6, 'Townsville', 'Townsville', 3400), -(108, 2, 7, 'Adelaide', 'Adelaide', 100), -(109, 2, 7, 'Altona', 'Altona', 200), -(110, 2, 7, 'Amata', 'Amata', 300), -(111, 2, 7, 'Angas Plains', 'Angas Plains', 400), -(112, 2, 7, 'Angle Vale', 'Angle Vale', 500), -(113, 2, 7, 'Appila', 'Appila', 600), -(114, 2, 7, 'Ardrossan', 'Ardrossan', 700), -(115, 2, 7, 'Arno Bay', 'Arno Bay', 800), -(116, 2, 7, 'Athenna', 'Athenna', 900), -(117, 2, 7, 'Australia Plains', 'Australia Plains', 1000), -(118, 2, 7, 'Avon', 'Avon', 1100), -(119, 2, 7, 'Bakara', 'Bakara', 1200), -(120, 2, 7, 'Black Rock', 'Black Rock', 1300), -(121, 2, 7, 'Buccleuch', 'Buccleuch', 1400), -(122, 2, 7, 'Caroline', 'Caroline', 1500), -(123, 2, 7, 'Dublin', 'Dublin', 1600), -(124, 2, 7, 'McLachlan', 'McLachlan', 1700), -(125, 2, 7, 'Meningie', 'Meningie', 1800), -(126, 2, 7, 'Paratoo', 'Paratoo', 1900), -(127, 2, 7, 'Phillip', 'Phillip', 2000), -(128, 2, 7, 'Sunny Hill', 'Sunny Hill', 2100), -(129, 2, 7, 'Whyalla', 'Whyalla', 2200), -(130, 2, 8, 'Abbotsham', 'Abbotsham', 100), -(131, 2, 8, 'Alanvale', 'Alanvale', 200), -(132, 2, 8, 'Alcomie', 'Alcomie', 300), -(133, 2, 8, 'Allen Siding', 'Allen Siding', 400), -(134, 2, 8, 'Alonnah', 'Alonnah', 500), -(135, 2, 8, 'Andover', 'Andover', 600), -(136, 2, 8, 'Austins Ferry', 'Austins Ferry', 700), -(137, 2, 8, 'Back Creek', 'Back Creek', 800), -(138, 2, 8, 'Baden', 'Baden', 900), -(139, 2, 8, 'Bagdad', 'Bagdad', 1000), -(140, 2, 8, 'Bangor', 'Bangor', 1100), -(141, 2, 8, 'Beauty Point', 'Beauty Point', 1200), -(142, 2, 8, 'Bell Bay', 'Bell Bay', 1300), -(143, 2, 8, 'Bellerive', 'Bellerive', 1400), -(144, 2, 8, 'Birralee', 'Birralee', 1500), -(145, 2, 8, 'Cygnet', 'Cygnet', 1600), -(146, 2, 8, 'Fingal', 'Fingal', 1700), -(147, 2, 8, 'Forest', 'Forest', 1800), -(148, 2, 8, 'Hobart', 'Hobart', 1900), -(149, 2, 8, 'Kingston', 'Kingston', 2000), -(150, 2, 8, 'Launceston', 'Launceston', 2100), -(151, 2, 8, 'Myalla', 'Myalla', 2200), -(152, 2, 8, 'Paradise', 'Paradise', 2300), -(153, 2, 8, 'Saltwater River', 'Saltwater River', 2400), -(154, 2, 9, 'Aberfeldy', 'Aberfeldy', 100), -(155, 2, 9, 'Acheron', 'Acheron', 200), -(156, 2, 9, 'Adelaide Lead', 'Adelaide Lead', 300), -(157, 2, 9, 'Ailsa', 'Ailsa', 400), -(158, 2, 9, 'Aireys Inlet', 'Aireys Inlet', 500), -(159, 2, 9, 'Airly', 'Airly', 600), -(160, 2, 9, 'Alambee', 'Alambee', 700), -(161, 2, 9, 'Alberton West', 'Alberton West', 800), -(162, 2, 9, 'Albion', 'Albion', 900), -(163, 2, 9, 'Alexandra', 'Alexandra', 1000), -(164, 2, 9, 'Alfredton', 'Alfredton', 1100), -(165, 2, 9, 'Alma', 'Alma', 1200), -(166, 2, 9, 'Alvie', 'Alvie', 1300), -(167, 2, 9, 'Ancona', 'Ancona', 1400), -(168, 2, 9, 'Anderson', 'Anderson', 1500), -(169, 2, 9, 'Antwerp', 'Antwerp', 1600), -(170, 2, 9, 'Armadale', 'Armadale', 1700), -(171, 2, 9, 'Arnold', 'Arnold', 1800), -(172, 2, 9, 'Ballam Park', 'Ballam Park', 1900), -(173, 2, 9, 'Balook', 'Balook', 2000), -(174, 2, 9, 'Barmah', 'Barmah', 2100), -(175, 2, 9, 'Bass', 'Bass', 2200), -(176, 2, 9, 'Bayswater', 'Bayswater', 2300), -(177, 2, 9, 'Bolton', 'Bolton', 2400), -(178, 2, 9, 'Boolite', 'Boolite', 2500), -(179, 2, 9, 'Brighton', 'Brighton', 2600), -(180, 2, 9, 'Colac', 'Colac', 2700), -(181, 2, 9, 'Geelong', 'Geelong', 2800), -(182, 2, 9, 'Horsham', 'Horsham', 2900), -(183, 2, 9, 'Lubeck', 'Lubeck', 3000), -(184, 2, 9, 'Melbourne', 'Melbourne', 3100), -(185, 2, 9, 'Moorabbin', 'Moorabbin', 3200), -(186, 2, 9, 'San Remo', 'San Remo', 3300), -(187, 2, 9, 'Silver Creek', 'Silver Creek', 3400), -(188, 2, 9, 'Snake Valley', 'Snake Valley', 3500), -(189, 2, 9, 'South Yarra', 'South Yarra', 3600), -(190, 2, 9, 'Stalker', 'Stalker', 3700), -(191, 2, 9, 'Syndal', 'Syndal', 3800), -(192, 2, 9, 'Victoria Valley', 'Victoria Valley', 3900), -(193, 2, 9, 'Warragul', 'Warragul', 4000), -(194, 2, 9, 'Wheelers Hill', 'Wheelers Hill', 4100), -(195, 2, 9, 'Yarrawonga', 'Yarrawonga', 4200), -(196, 2, 10, 'Abbotts', 'Abbotts', 100), -(197, 2, 10, 'Agnew', 'Agnew', 200), -(198, 2, 10, 'Australind', 'Australind', 300), -(199, 2, 10, 'Babakin', 'Babakin', 400), -(200, 2, 10, 'Baddera', 'Baddera', 500), -(201, 2, 10, 'Balgarri', 'Balgarri', 600), -(202, 2, 10, 'Balgo', 'Balgo', 700), -(203, 2, 10, 'Belka', 'Belka', 800), -(204, 2, 10, 'Big Bell', 'Big Bell', 900), -(205, 2, 10, 'Canna', 'Canna', 1000), -(206, 2, 10, 'Denmark', 'Denmark', 1100), -(207, 2, 10, 'Devans Find Mining Centre', 'Devans Find Mining Centre', 1200), -(208, 2, 10, 'East Fremantle', 'East Fremantle', 1300), -(209, 2, 10, 'Kalbarri', 'Kalbarri', 1400), -(210, 2, 10, 'Koojan', 'Koojan', 1500), -(211, 2, 10, 'Lancelin', 'Lancelin', 1600), -(212, 2, 10, 'Narra Tarra', 'Narra Tarra', 1700), -(213, 2, 10, 'Perth', 'Perth', 1800), -(214, 2, 10, 'Perth City', 'Perth City', 1900), -(215, 2, 10, 'Sawyers Valley', 'Sawyers Valley', 2000), -(216, 2, 10, 'Seabird', 'Seabird', 2100), -(217, 2, 10, 'Station Peak Mining Centre', 'Station Peak Mining Centre', 2200), -(218, 2, 10, 'York', 'York', 2300), -(219, 3, 11, 'Andau', 'Andau', 100), -(220, 3, 11, 'Deutsch Kaltenbrunn', 'Deutsch Kaltenbrunn', 200), -(221, 3, 11, 'Eberau', 'Eberau', 300), -(222, 3, 11, 'Eisenstadt', 'Eisenstadt', 400), -(223, 3, 11, 'Forchtenstein', 'Forchtenstein', 500), -(224, 3, 11, 'Gssing', 'Gssing', 600), -(225, 3, 11, 'Horitschon', 'Horitschon', 700), -(226, 3, 11, 'Jois', 'Jois', 800), -(227, 3, 11, 'Lackenbach', 'Lackenbach', 900), -(228, 3, 11, 'Marz', 'Marz', 1000), -(229, 3, 11, 'Neufeld an der Leitha', 'Neufeld an der Leitha', 1100), -(230, 3, 11, 'Neusiedl am See', 'Neusiedl am See', 1200), -(231, 3, 11, 'Oberpullendorf', 'Oberpullendorf', 1300), -(232, 3, 11, 'Oberwart', 'Oberwart', 1400), -(233, 3, 11, 'Oslip', 'Oslip', 1500), -(234, 3, 11, 'Zurndorf', 'Zurndorf', 1600), -(235, 3, 12, 'Afritz', 'Afritz', 100), -(236, 3, 12, 'Arnoldstein', 'Arnoldstein', 200), -(237, 3, 12, 'Arriach', 'Arriach', 300), -(238, 3, 12, 'Bad Kleinkirchheim', 'Bad Kleinkirchheim', 400), -(239, 3, 12, 'Birnbaum', 'Birnbaum', 500), -(240, 3, 12, 'Diex', 'Diex', 600), -(241, 3, 12, 'Eberstein', 'Eberstein', 700), -(242, 3, 12, 'Faak am See', 'Faak am See', 800), -(243, 3, 12, 'Feistritz im Rosental', 'Feistritz im Rosental', 900), -(244, 3, 12, 'Ferlach', 'Ferlach', 1000), -(245, 3, 12, 'Klagenfurt', 'Klagenfurt', 1100), -(246, 3, 12, 'Spittal an der Drau', 'Spittal an der Drau', 1200), -(247, 3, 12, 'Strau', 'Strau', 1300), -(248, 3, 12, 'Villach', 'Villach', 1400), -(249, 3, 12, 'Vlkermarkt', 'Vlkermarkt', 1500), -(250, 3, 13, 'Aggsbach Dorf', 'Aggsbach Dorf', 100), -(251, 3, 13, 'Amstetten', 'Amstetten', 200), -(252, 3, 13, 'Aschbach Markt', 'Aschbach Markt', 300), -(253, 3, 13, 'Bad Schnau', 'Bad Schnau', 400), -(254, 3, 13, 'Bad Vslau', 'Bad Vslau', 500), -(255, 3, 13, 'Bheimkirchen', 'Bheimkirchen', 600), -(256, 3, 13, 'Bisamberg', 'Bisamberg', 700), -(257, 3, 13, 'Ebenfurth', 'Ebenfurth', 800), -(258, 3, 13, 'Eckartsau', 'Eckartsau', 900), -(259, 3, 13, 'Ernstbrunn', 'Ernstbrunn', 1000), -(260, 3, 13, 'Frankenfels', 'Frankenfels', 1100), -(261, 3, 13, 'Friedersbach', 'Friedersbach', 1200), -(262, 3, 13, 'Gablitz', 'Gablitz', 1300), -(263, 3, 13, 'Gerasdorf bei Wien', 'Gerasdorf bei Wien', 1400), -(264, 3, 13, 'Gloggnitz', 'Gloggnitz', 1500), -(265, 3, 13, 'Gnserndorf', 'Gnserndorf', 1600), -(266, 3, 13, 'Herzogenburg', 'Herzogenburg', 1700), -(267, 3, 13, 'Hollabrunn', 'Hollabrunn', 1800), -(268, 3, 13, 'Korneuburg', 'Korneuburg', 1900), -(269, 3, 13, 'Kottingbrunn', 'Kottingbrunn', 2000), -(270, 3, 13, 'Krems an der Donau', 'Krems an der Donau', 2100), -(271, 3, 13, 'Langenzersdorf', 'Langenzersdorf', 2200), -(272, 3, 13, 'Leobersdorf', 'Leobersdorf', 2300), -(273, 3, 13, 'Lilienfeld', 'Lilienfeld', 2400), -(274, 3, 13, 'Lunz am See', 'Lunz am See', 2500), -(275, 3, 13, 'Mdling', 'Mdling', 2600), -(276, 3, 13, 'Melk', 'Melk', 2700), -(277, 3, 13, 'Mistelbach an der Zaya', 'Mistelbach an der Zaya', 2800), -(278, 3, 13, 'Oberwaltersdorf', 'Oberwaltersdorf', 2900), -(279, 3, 13, 'Prinzersdorf', 'Prinzersdorf', 3000), -(280, 3, 13, 'Stetteldorf am Wagram', 'Stetteldorf am Wagram', 3100), -(281, 3, 13, 'Stssing', 'Stssing', 3200), -(282, 3, 13, 'Ternitz', 'Ternitz', 3300), -(283, 3, 13, 'Traisen', 'Traisen', 3400), -(284, 3, 13, 'Traismauer', 'Traismauer', 3500), -(285, 3, 13, 'Waidhofen an der Ybbs', 'Waidhofen an der Ybbs', 3600), -(286, 3, 13, 'Wiener Neudorf', 'Wiener Neudorf', 3700), -(287, 3, 13, 'Wiener Neustadt', 'Wiener Neustadt', 3800), -(288, 3, 14, 'Ach', 'Ach', 100), -(289, 3, 14, 'Aistersheim', 'Aistersheim', 200), -(290, 3, 14, 'Alberndorf in der Riedmark', 'Alberndorf in der Riedmark', 300), -(291, 3, 14, 'Alkoven', 'Alkoven', 400), -(292, 3, 14, 'Altenberg bei Linz', 'Altenberg bei Linz', 500), -(293, 3, 14, 'Altmnster', 'Altmnster', 600), -(294, 3, 14, 'Ansfelden', 'Ansfelden', 700), -(295, 3, 14, 'Aschach an der Steyr', 'Aschach an der Steyr', 800), -(296, 3, 14, 'Attersee', 'Attersee', 900), -(297, 3, 14, 'Attnang-Puchheim', 'Attnang-Puchheim', 1000), -(298, 3, 14, 'Braunau am Inn', 'Braunau am Inn', 1100), -(299, 3, 14, 'Ebensee', 'Ebensee', 1200), -(300, 3, 14, 'Enns', 'Enns', 1300), -(301, 3, 14, 'Gallneukirchen', 'Gallneukirchen', 1400), -(302, 3, 14, 'Gmunden', 'Gmunden', 1500), -(303, 3, 14, 'Gramastetten', 'Gramastetten', 1600), -(304, 3, 14, 'Hallstatt', 'Hallstatt', 1700), -(305, 3, 14, 'Hrsching', 'Hrsching', 1800), -(306, 3, 14, 'Laakirchen', 'Laakirchen', 1900), -(307, 3, 14, 'Leopoldschlag', 'Leopoldschlag', 2000), -(308, 3, 14, 'Linz', 'Linz', 2100), -(309, 3, 14, 'Marchtrenk', 'Marchtrenk', 2200), -(310, 3, 14, 'Mondsee', 'Mondsee', 2300), -(311, 3, 14, 'Ottensheim', 'Ottensheim', 2400), -(312, 3, 14, 'Pregarten', 'Pregarten', 2500), -(313, 3, 14, 'Ried im Innkreis', 'Ried im Innkreis', 2600), -(314, 3, 14, 'Rohrbach in Obersterreich', 'Rohrbach in Obersterreich', 2700), -(315, 3, 14, 'Scharnstein', 'Scharnstein', 2800), -(316, 3, 14, 'Scharten', 'Scharten', 2900), -(317, 3, 14, 'Steyr', 'Steyr', 3000), -(318, 3, 14, 'Thalheim bei Wels', 'Thalheim bei Wels', 3100), -(319, 3, 14, 'Traun', 'Traun', 3200), -(320, 3, 14, 'Vcklabruck', 'Vcklabruck', 3300), -(321, 3, 14, 'Wels', 'Wels', 3400), -(322, 3, 15, 'Adnet', 'Adnet', 100), -(323, 3, 15, 'Altenmarkt im Pongau', 'Altenmarkt im Pongau', 200), -(324, 3, 15, 'Anif', 'Anif', 300), -(325, 3, 15, 'Annaberg', 'Annaberg', 400), -(326, 3, 15, 'Bad Hofgastein', 'Bad Hofgastein', 500), -(327, 3, 15, 'Berndorf bei Salzburg', 'Berndorf bei Salzburg', 600), -(328, 3, 15, 'Bischofshofen', 'Bischofshofen', 700), -(329, 3, 15, 'Bramberg am Wildkogel', 'Bramberg am Wildkogel', 800), -(330, 3, 15, 'Bruck an der Groglocknerstrae', 'Bruck an der Groglocknerstrae', 900), -(331, 3, 15, 'Dienten am Hochknig', 'Dienten am Hochknig', 1000), -(332, 3, 15, 'Ebenau', 'Ebenau', 1100), -(333, 3, 15, 'Elixhausen', 'Elixhausen', 1200), -(334, 3, 15, 'Fuschl am See', 'Fuschl am See', 1300), -(335, 3, 15, 'Grdig', 'Grdig', 1400), -(336, 3, 15, 'Hallein', 'Hallein', 1500), -(337, 3, 15, 'Henndorf am Wallersee', 'Henndorf am Wallersee', 1600), -(338, 3, 15, 'Hinterglemm', 'Hinterglemm', 1700), -(339, 3, 15, 'Hof bei Salzburg', 'Hof bei Salzburg', 1800), -(340, 3, 15, 'Lofer', 'Lofer', 1900), -(341, 3, 15, 'Oberalm', 'Oberalm', 2000), -(342, 3, 15, 'Saalbach', 'Saalbach', 2100), -(343, 3, 15, 'Saalfelden am Steinernen Meer', 'Saalfelden am Steinernen Meer', 2200), -(344, 3, 15, 'Salzburg', 'Salzburg', 2300), -(345, 3, 15, 'Tamsweg', 'Tamsweg', 2400), -(346, 3, 15, 'Zell am See', 'Zell am See', 2500), -(347, 3, 16, 'Admont', 'Admont', 100), -(348, 3, 16, 'Bad Gams', 'Bad Gams', 200), -(349, 3, 16, 'Bruck an der Mur', 'Bruck an der Mur', 300), -(350, 3, 16, 'Burgau', 'Burgau', 400), -(351, 3, 16, 'Deutschlandsberg', 'Deutschlandsberg', 500), -(352, 3, 16, 'Eggersdorf bei Graz', 'Eggersdorf bei Graz', 600), -(353, 3, 16, 'Gleisdorf', 'Gleisdorf', 700), -(354, 3, 16, 'Graz', 'Graz', 800), -(355, 3, 16, 'Hartberg', 'Hartberg', 900), -(356, 3, 16, 'Judenburg', 'Judenburg', 1000), -(357, 3, 16, 'Kapfenberg', 'Kapfenberg', 1100), -(358, 3, 16, 'Knittelfeld', 'Knittelfeld', 1200), -(359, 3, 16, 'Leoben', 'Leoben', 1300), -(360, 3, 16, 'Liezen', 'Liezen', 1400), -(361, 3, 16, 'Mrzzuschlag', 'Mrzzuschlag', 1500), -(362, 3, 16, 'Murau', 'Murau', 1600), -(363, 3, 16, 'Schffern', 'Schffern', 1700), -(364, 3, 16, 'Trofaiach', 'Trofaiach', 1800), -(365, 3, 16, 'Voitsberg', 'Voitsberg', 1900), -(366, 3, 16, 'Waldstein', 'Waldstein', 2000), -(367, 3, 17, 'Absam', 'Absam', 100), -(368, 3, 17, 'Achenkirch', 'Achenkirch', 200), -(369, 3, 17, 'Ainet', 'Ainet', 300), -(370, 3, 17, 'Aldrans', 'Aldrans', 400), -(371, 3, 17, 'Axams', 'Axams', 500), -(372, 3, 17, 'Biberwier', 'Biberwier', 600), -(373, 3, 17, 'Bichlbach', 'Bichlbach', 700), -(374, 3, 17, 'Brandenberg', 'Brandenberg', 800), -(375, 3, 17, 'Brixlegg', 'Brixlegg', 900), -(376, 3, 17, 'Dlsach', 'Dlsach', 1000), -(377, 3, 17, 'Elmen', 'Elmen', 1100), -(378, 3, 17, 'Erl', 'Erl', 1200), -(379, 3, 17, 'Finkenberg', 'Finkenberg', 1300), -(380, 3, 17, 'Flirsch', 'Flirsch', 1400), -(381, 3, 17, 'Hall in Tirol', 'Hall in Tirol', 1500), -(382, 3, 17, 'Hopfgarten im Brixental', 'Hopfgarten im Brixental', 1600), -(383, 3, 17, 'Innsbruck', 'Innsbruck', 1700), -(384, 3, 17, 'Jenbach', 'Jenbach', 1800), -(385, 3, 17, 'Kirchdorf in Tirol', 'Kirchdorf in Tirol', 1900), -(386, 3, 17, 'Kitzbhel', 'Kitzbhel', 2000), -(387, 3, 17, 'Kssen', 'Kssen', 2100), -(388, 3, 17, 'Kufstein', 'Kufstein', 2200), -(389, 3, 17, 'Mayrhofen', 'Mayrhofen', 2300), -(390, 3, 17, 'Nauders', 'Nauders', 2400), -(391, 3, 17, 'Seefeld in Tirol', 'Seefeld in Tirol', 2500), -(392, 3, 17, 'Slden', 'Slden', 2600), -(393, 3, 17, 'Vls', 'Vls', 2700), -(394, 3, 17, 'Wenns', 'Wenns', 2800), -(395, 3, 17, 'Zirl', 'Zirl', 2900), -(396, 3, 18, 'Alberschwende', 'Alberschwende', 100), -(397, 3, 18, 'Bludenz', 'Bludenz', 200), -(398, 3, 18, 'Bregenz', 'Bregenz', 300), -(399, 3, 18, 'Dalaas', 'Dalaas', 400), -(400, 3, 18, 'Dornbirn', 'Dornbirn', 500), -(401, 3, 18, 'Feldkirch', 'Feldkirch', 600), -(402, 3, 18, 'Lech', 'Lech', 700), -(403, 3, 18, 'Mellau', 'Mellau', 800), -(404, 3, 19, 'Wien', 'Wien', 100), -(405, 4, 20, 'Агдам', 'Агдам', 100), -(406, 4, 20, 'Агдаш', 'Агдаш', 200), -(407, 4, 20, 'Агджабеди', 'Агджабеди', 300), -(408, 4, 20, 'Аджикенд', 'Аджикенд', 400), -(409, 4, 20, 'Акстафа', 'Акстафа', 500), -(410, 4, 20, 'Али-Байрамлы', 'Али-Байрамлы', 600), -(411, 4, 20, 'Алунитаг', 'Алунитаг', 700), -(412, 4, 20, 'Артем-Остров', 'Артем-Остров', 800), -(413, 4, 20, 'Астара', 'Астара', 900), -(414, 4, 20, 'Ахсу', 'Ахсу', 1000), -(415, 4, 20, 'Баку', 'Баку', 1100), -(416, 4, 20, 'Балаханы', 'Балаханы', 1200), -(417, 4, 20, 'Банк', 'Банк', 1300), -(418, 4, 20, 'Барда', 'Барда', 1400), -(419, 4, 20, 'Белоканы', 'Белоканы', 1500), -(420, 4, 20, 'Биласувар', 'Биласувар', 1600), -(421, 4, 20, 'Бинагади', 'Бинагади', 1700), -(422, 4, 20, 'Бузовна', 'Бузовна', 1800), -(423, 4, 20, 'Варташен', 'Варташен', 1900), -(424, 4, 20, 'Гадрут', 'Гадрут', 2000), -(425, 4, 20, 'Геокчай', 'Геокчай', 2100), -(426, 4, 20, 'Гобустан', 'Гобустан', 2200), -(427, 4, 20, 'Горадиз', 'Горадиз', 2300), -(428, 4, 20, 'Гянджа (Кировобад)', 'Гянджа (Кировобад)', 2400), -(429, 4, 20, 'Дальмамедли', 'Дальмамедли', 2500), -(430, 4, 20, 'Дашкесан', 'Дашкесан', 2600), -(431, 4, 20, 'Джалилабад', 'Джалилабад', 2700), -(432, 4, 20, 'Джебраил', 'Джебраил', 2800), -(433, 4, 20, 'Дивичи', 'Дивичи', 2900), -(434, 4, 20, 'Евлах', 'Евлах', 3000), -(435, 4, 20, 'Ждановск', 'Ждановск', 3100), -(436, 4, 20, 'Закаталы', 'Закаталы', 3200), -(437, 4, 20, 'Зардоб', 'Зардоб', 3300), -(438, 4, 20, 'Имишли', 'Имишли', 3400), -(439, 4, 20, 'Исмаиллы', 'Исмаиллы', 3500), -(440, 4, 20, 'Истису', 'Истису', 3600), -(441, 4, 20, 'Казах', 'Казах', 3700), -(442, 4, 20, 'Кази-Магомед', 'Кази-Магомед', 3800), -(443, 4, 20, 'Касум-Исмаилов', 'Касум-Исмаилов', 3900), -(444, 4, 20, 'Кахи', 'Кахи', 4000), -(445, 4, 20, 'Кедабек', 'Кедабек', 4100), -(446, 4, 20, 'Кельбаджар', 'Кельбаджар', 4200), -(447, 4, 20, 'Куба', 'Куба', 4300), -(448, 4, 20, 'Кубатлы', 'Кубатлы', 4400), -(449, 4, 20, 'Кусары', 'Кусары', 4500), -(450, 4, 20, 'Куткашен', 'Куткашен', 4600), -(451, 4, 20, 'Кюрдамир', 'Кюрдамир', 4700), -(452, 4, 20, 'Ленкорань', 'Ленкорань', 4800), -(453, 4, 20, 'Лерик', 'Лерик', 4900), -(454, 4, 20, 'Масаллы', 'Масаллы', 5000), -(455, 4, 20, 'Мингечаур', 'Мингечаур', 5100), -(456, 4, 20, 'Мир-Башир', 'Мир-Башир', 5200), -(457, 4, 20, 'Нафталан', 'Нафталан', 5300), -(458, 4, 20, 'Нефтечала', 'Нефтечала', 5400), -(459, 4, 20, 'Саатлы', 'Саатлы', 5500), -(460, 4, 20, 'Сабирабад', 'Сабирабад', 5600), -(461, 4, 20, 'Сабуичи', 'Сабуичи', 5700), -(462, 4, 20, 'Сальяны', 'Сальяны', 5800), -(463, 4, 20, 'Сиазань', 'Сиазань', 5900), -(464, 4, 20, 'Сумгаит', 'Сумгаит', 6000), -(465, 4, 20, 'Тауз', 'Тауз', 6100), -(466, 4, 20, 'Уджары', 'Уджары', 6200), -(467, 4, 20, 'Физули', 'Физули', 6300), -(468, 4, 20, 'Ханлар', 'Ханлар', 6400), -(469, 4, 20, 'Хачмас', 'Хачмас', 6500), -(470, 4, 20, 'Худат', 'Худат', 6600), -(471, 4, 20, 'Шамхор', 'Шамхор', 6700), -(472, 4, 20, 'Шеки', 'Шеки', 6800), -(473, 4, 20, 'Шемаха', 'Шемаха', 6900), -(474, 4, 21, 'Степанокерт', 'Степанокерт', 100), -(475, 4, 21, 'Шуша', 'Шуша', 200), -(476, 4, 22, 'Джульфа', 'Джульфа', 100), -(477, 4, 22, 'Ильичевск', 'Ильичевск', 200), -(478, 4, 22, 'Нахичевань', 'Нахичевань', 300), -(479, 4, 22, 'Ордубад', 'Ордубад', 400), -(480, 4, 22, 'Шахбуз', 'Шахбуз', 500), -(481, 5, 23, 'Agalli', 'Agalli', 100), -(482, 5, 23, 'Agim', 'Agim', 200), -(483, 5, 23, 'Baka', 'Baka', 300), -(484, 5, 23, 'Kakos', 'Kakos', 400), -(485, 5, 24, 'Ali Hanit', 'Ali Hanit', 100), -(486, 5, 24, 'Arapaj e Eperme', 'Arapaj e Eperme', 200), -(487, 5, 24, 'Arn i Eprm', 'Arn i Eprm', 300), -(488, 5, 24, 'Arras', 'Arras', 400), -(489, 5, 24, 'Doma', 'Doma', 500), -(490, 5, 25, 'Dures', 'Dures', 100), -(491, 5, 25, 'Durrs', 'Durrs', 200), -(492, 5, 26, 'Abazaj', 'Abazaj', 100), -(493, 5, 26, 'Algjin', 'Algjin', 200), -(494, 5, 26, 'Algjinaj', 'Algjinaj', 300), -(495, 5, 26, 'Allaj', 'Allaj', 400), -(496, 5, 26, 'Arov', 'Arov', 500), -(497, 5, 26, 'Ars', 'Ars', 600), -(498, 5, 26, 'Zibraca', 'Zibraca', 700), -(499, 5, 27, 'Ad Bunac', 'Ad Bunac', 100), -(500, 5, 27, 'Ada', 'Ada', 200), -(501, 5, 28, 'Ajios Nikolaos', 'Ajios Nikolaos', 100), -(502, 5, 28, 'Beishti', 'Beishti', 200), -(503, 5, 28, 'Suka', 'Suka', 300), -(504, 5, 29, 'Alemas', 'Alemas', 100), -(505, 5, 29, 'Ano Selce', 'Ano Selce', 200), -(506, 5, 29, 'Bar', 'Bar', 300), -(507, 5, 30, 'Arn', 'Arn', 100), -(508, 5, 30, 'Arrza', 'Arrza', 200), -(509, 5, 30, 'Bajani', 'Bajani', 300), -(510, 5, 31, 'Goxhaj', 'Goxhaj', 100), -(511, 5, 32, 'Apripa e Parava', 'Apripa e Parava', 100), -(512, 5, 32, 'Boboti', 'Boboti', 200), -(513, 5, 32, 'Dobre', 'Dobre', 300), -(514, 5, 33, 'Ahmedaj', 'Ahmedaj', 100), -(515, 5, 33, 'Arban', 'Arban', 200), -(516, 5, 33, 'Tiran', 'Tiran', 300), -(517, 5, 33, 'Tirana', 'Tirana', 400), -(518, 5, 33, 'Tyranna', 'Tyranna', 500), -(519, 5, 33, 'Zalli i Herit', 'Zalli i Herit', 600), -(520, 5, 34, 'Aliban', 'Aliban', 100), -(521, 5, 34, 'Alicu', 'Alicu', 200), -(522, 6, 35, 'Адрар', 'Adrar', 100), -(523, 6, 35, 'Алжир', 'Algeria', 200), -(524, 6, 35, 'Аннаба', 'Annaba', 300), -(525, 6, 35, 'Бешвар', 'Beshvar', 400), -(526, 6, 35, 'Джельфа', 'Djel''fa', 500), -(527, 6, 35, 'Ин-Салах', 'In-Salah', 600), -(528, 6, 35, 'Оран', 'Oran', 700), -(529, 6, 35, 'Таманрассет', 'Tamanrasset', 800), -(530, 6, 35, 'Туггурт', 'Tuggurt', 900), -(531, 6, 35, 'Эль-Голеа', 'El''-Golea', 1000), -(532, 7, 36, 'Бенгела', 'Bengela', 100), -(533, 7, 36, 'Лобиту', 'Lobitu', 200), -(534, 7, 36, 'Луанда', 'Luanda', 300), -(535, 7, 36, 'Лубанго', 'Lubango', 400), -(536, 7, 36, 'Маланже', 'Malanzhe', 500), -(537, 7, 36, 'Менноге', 'Mennoge', 600), -(538, 7, 36, 'Намибе', 'Namibe', 700), -(539, 8, 37, 'Ангилья', 'Anguilla', 100), -(540, 8, 37, 'Сомбреро', 'Sombrero', 200), -(541, 9, 38, 'Andorra', 'Andorra', 100), -(542, 9, 38, 'Andorra la Vella', 'Andorra la Vella', 200), -(543, 9, 38, 'Andorra-Vieille', 'Andorra-Vieille', 300), -(544, 9, 39, 'Canillo', 'Canillo', 100), -(545, 9, 40, 'Encamp', 'Encamp', 100), -(546, 9, 41, 'Escaldes', 'Escaldes', 100), -(547, 9, 41, 'Las Escadas', 'Las Escadas', 200), -(548, 9, 41, 'Les Escaldes', 'Les Escaldes', 300), -(549, 9, 42, 'La Maana', 'La Maana', 100), -(550, 9, 42, 'La Massana', 'La Massana', 200), -(551, 9, 43, 'Biisarri', 'Biisarri', 100), -(552, 9, 43, 'El Pui', 'El Pui', 200), -(553, 9, 43, 'Erez', 'Erez', 300), -(554, 9, 43, 'Juberri', 'Juberri', 400), -(555, 9, 43, 'Pas de la Casa', 'Pas de la Casa', 500), -(556, 9, 43, 'Vila', 'Vila', 600), -(557, 9, 44, 'Ordino', 'Ordino', 100), -(558, 9, 45, 'San Juli', 'San Juli', 100), -(559, 9, 45, 'Santa Juli de Loria', 'Santa Juli de Loria', 200), -(560, 10, 46, 'Бастер', 'Baster', 100), -(561, 10, 46, 'Бриджтаун', 'Bridgetown', 200), -(562, 10, 46, 'Кастри', 'Kastri', 300), -(563, 10, 46, 'Кингстаун', 'Kingstown', 400), -(564, 10, 46, 'Розо', 'Rozo', 500), -(565, 10, 46, 'Сан-Хуан', 'San-Huan', 600), -(566, 10, 46, 'Сент-Джонс', 'Sent-Djons', 700), -(567, 10, 46, 'Сент-Джорджес', 'Sent-Djordjes', 800), -(568, 11, 47, 'Виллемстад', 'Willemstad', 100), -(569, 12, 48, '12 de Agosto', '12 de Agosto', 100), -(570, 12, 48, '16 de Julio', '16 de Julio', 200), -(571, 12, 48, '17 de Agosto', '17 de Agosto', 300), -(572, 12, 48, '24 de Febrero', '24 de Febrero', 400), -(573, 12, 48, '25 de Mayo', '25 de Mayo', 500), -(574, 12, 48, '30 de Agosto', '30 de Agosto', 600), -(575, 12, 48, '9 de Julio', '9 de Julio', 700), -(576, 12, 48, 'A. Brown', 'A. Brown', 800), -(577, 12, 48, 'A. Carboni', 'A. Carboni', 900), -(578, 12, 48, 'A. Corti', 'A. Corti', 1000), -(579, 12, 48, 'A. de la Cruz', 'A. de la Cruz', 1100), -(580, 12, 48, 'A. de Toledo', 'A. de Toledo', 1200), -(581, 12, 48, 'A. Gascn', 'A. Gascn', 1300), -(582, 12, 48, 'A. Roca', 'A. Roca', 1400), -(583, 12, 48, 'Abasto', 'Abasto', 1500), -(584, 12, 48, 'Abel', 'Abel', 1600), -(585, 12, 48, 'Acassuso', 'Acassuso', 1700), -(586, 12, 48, 'Acevedo', 'Acevedo', 1800), -(587, 12, 48, 'Adolfo Alsina', 'Adolfo Alsina', 1900), -(588, 12, 48, 'Agote', 'Agote', 2000), -(589, 12, 48, 'Aldea Romana', 'Aldea Romana', 2100), -(590, 12, 48, 'Alegre', 'Alegre', 2200), -(591, 12, 48, 'Almirante Brown', 'Almirante Brown', 2300), -(592, 12, 48, 'Aragn', 'Aragn', 2400), -(593, 12, 48, 'Arenales', 'Arenales', 2500), -(594, 12, 48, 'Atalaya', 'Atalaya', 2600), -(595, 12, 48, 'Avellaneda', 'Avellaneda', 2700), -(596, 12, 48, 'Baha Blanca', 'Baha Blanca', 2800), -(597, 12, 48, 'Ballester', 'Ballester', 2900), -(598, 12, 48, 'Balneario Pinamar', 'Balneario Pinamar', 3000), -(599, 12, 48, 'Balneario Santa Teresa', 'Balneario Santa Teresa', 3100), -(600, 12, 48, 'Balneario Sauce Grande', 'Balneario Sauce Grande', 3200), -(601, 12, 48, 'Baradero', 'Baradero', 3300), -(602, 12, 48, 'Bariloche', 'Bariloche', 3400), -(603, 12, 48, 'Beln de Escobar', 'Beln de Escobar', 3500), -(604, 12, 48, 'Bordenave', 'Bordenave', 3600), -(605, 12, 48, 'Buena Vista', 'Buena Vista', 3700), -(606, 12, 48, 'Cabildo', 'Cabildo', 3800), -(607, 12, 48, 'Cangallo', 'Cangallo', 3900), -(608, 12, 48, 'Caseros', 'Caseros', 4000), -(609, 12, 48, 'Ciudadela', 'Ciudadela', 4100), -(610, 12, 48, 'Delgado', 'Delgado', 4200), -(611, 12, 48, 'Diamante', 'Diamante', 4300), -(612, 12, 48, 'Ensenada', 'Ensenada', 4400), -(613, 12, 48, 'General Rodrguez', 'General Rodrguez', 4500), -(614, 12, 48, 'Ingeniero Maschwitz', 'Ingeniero Maschwitz', 4600), -(615, 12, 48, 'Jos L. Surez', 'Jos L. Surez', 4700), -(616, 12, 48, 'Juan Jos Paso', 'Juan Jos Paso', 4800), -(617, 12, 48, 'Krabb', 'Krabb', 4900), -(618, 12, 48, 'La Plata', 'La Plata', 5000), -(619, 12, 48, 'lamos', 'lamos', 5100), -(620, 12, 48, 'Lans', 'Lans', 5200), -(621, 12, 48, 'Lezama', 'Lezama', 5300), -(622, 12, 48, 'Lincoln', 'Lincoln', 5400), -(623, 12, 48, 'Llavallol', 'Llavallol', 5500), -(624, 12, 48, 'Los Indios', 'Los Indios', 5600), -(625, 12, 48, 'Manzone', 'Manzone', 5700), -(626, 12, 48, 'Mar Chiquita', 'Mar Chiquita', 5800), -(627, 12, 48, 'Mar de Plata', 'Mar de Plata', 5900), -(628, 12, 48, 'Mar del Plata', 'Mar del Plata', 6000), -(629, 12, 48, 'Marcos Paz', 'Marcos Paz', 6100), -(630, 12, 48, 'Mariano Acosta', 'Mariano Acosta', 6200), -(631, 12, 48, 'Marucha', 'Marucha', 6300), -(632, 12, 48, 'Mercedes', 'Mercedes', 6400), -(633, 12, 48, 'Monte Grande', 'Monte Grande', 6500), -(634, 12, 48, 'Morn', 'Morn', 6600), -(635, 12, 48, 'Olivos', 'Olivos', 6700), -(636, 12, 48, 'Palemn Huergo', 'Palemn Huergo', 6800), -(637, 12, 48, 'Primera Junta', 'Primera Junta', 6900), -(638, 12, 48, 'Punta Alta', 'Punta Alta', 7000), -(639, 12, 48, 'Ramos Meja', 'Ramos Meja', 7100), -(640, 12, 48, 'Rivadavia', 'Rivadavia', 7200), -(641, 12, 48, 'San Martn', 'San Martn', 7300), -(642, 12, 48, 'San Miguel', 'San Miguel', 7400), -(643, 12, 48, 'San Vicente', 'San Vicente', 7500), -(644, 12, 48, 'Tandil', 'Tandil', 7600), -(645, 12, 48, 'Temperley', 'Temperley', 7700), -(646, 12, 48, 'Tigre', 'Tigre', 7800), -(647, 12, 48, 'Trenque Lauquen', 'Trenque Lauquen', 7900), -(648, 12, 48, 'Tres Arroyos', 'Tres Arroyos', 8000), -(649, 12, 48, 'V. Lpez', 'V. Lpez', 8100), -(650, 12, 48, 'Vicente Lpez', 'Vicente Lpez', 8200), -(651, 12, 48, 'Villa Ballester', 'Villa Ballester', 8300), -(652, 12, 48, 'Villa General Savio', 'Villa General Savio', 8400), -(653, 12, 48, 'Wilde', 'Wilde', 8500), -(654, 12, 49, 'Adolfo E. Carranza', 'Adolfo E. Carranza', 100), -(655, 12, 49, 'Majada', 'Majada', 200), -(656, 12, 49, 'San Fernando del Valle de Catamarca', 'San Fernando del Valle de Catamarca', 300), -(657, 12, 49, 'Tinogasta', 'Tinogasta', 400), -(658, 12, 50, 'Basail', 'Basail', 100), -(659, 12, 50, 'Charatas', 'Charatas', 200), -(660, 12, 50, 'Loma Florida', 'Loma Florida', 300), -(661, 12, 50, 'Presidente Roque Senz Pea', 'Presidente Roque Senz Pea', 400), -(662, 12, 50, 'Resistencia', 'Resistencia', 500), -(663, 12, 51, 'Puelo', 'Puelo', 100), -(664, 12, 51, 'Rada Tilly', 'Rada Tilly', 200), -(665, 12, 51, 'Rawson', 'Rawson', 300), -(666, 12, 52, 'Corrientes', 'Corrientes', 100), -(667, 12, 53, 'Agua de Ramn', 'Agua de Ramn', 100), -(668, 12, 53, 'Alto Cordoba', 'Alto Cordoba', 200), -(669, 12, 53, 'Barrio Monte Grande', 'Barrio Monte Grande', 300), -(670, 12, 53, 'Crdoba', 'Crdoba', 400), -(671, 12, 53, 'Jess Mara', 'Jess Mara', 500), -(672, 12, 53, 'Ro Cuarto', 'Ro Cuarto', 600), -(673, 12, 53, 'San Francisco', 'San Francisco', 700), -(674, 12, 53, 'Villa Carlos Paz', 'Villa Carlos Paz', 800), -(675, 12, 54, 'Buenos Aires', 'Buenos Aires', 100), -(676, 12, 54, 'Centro', 'Centro', 200), -(677, 12, 54, 'Colegiales', 'Colegiales', 300), -(678, 12, 54, 'Congreso', 'Congreso', 400), -(679, 12, 54, 'Flores', 'Flores', 500), -(680, 12, 54, 'Floresta', 'Floresta', 600), -(681, 12, 54, 'Nez', 'Nez', 700), -(682, 12, 54, 'Palermo', 'Palermo', 800), -(683, 12, 54, 'Recoleta', 'Recoleta', 900), -(684, 12, 54, 'San Cristbal', 'San Cristbal', 1000), -(685, 12, 54, 'Villa Crespo', 'Villa Crespo', 1100), -(686, 12, 54, 'Villa Devoto', 'Villa Devoto', 1200), -(687, 12, 54, 'Villa Urquiza', 'Villa Urquiza', 1300), -(688, 12, 55, 'Concepcin del Uruguay', 'Concepcin del Uruguay', 100), -(689, 12, 55, 'Paran', 'Paran', 200), -(690, 12, 56, 'Formosa', 'Formosa', 100), -(691, 12, 56, 'Herradura', 'Herradura', 200), -(692, 12, 57, 'Cangrejilla', 'Cangrejilla', 100), -(693, 12, 57, 'Jujuy', 'Jujuy', 200), -(694, 12, 57, 'Oratorio', 'Oratorio', 300), -(695, 12, 58, 'Abramo', 'Abramo', 100), -(696, 12, 58, 'Alta Italia', 'Alta Italia', 200), -(697, 12, 58, 'Chical-C', 'Chical-C', 300), -(698, 12, 58, 'La Maruja', 'La Maruja', 400), -(699, 12, 58, 'Santa Rosa', 'Santa Rosa', 500), -(700, 12, 59, 'Agua Colorada', 'Agua Colorada', 100), -(701, 12, 59, 'Alanices', 'Alanices', 200), -(702, 12, 59, 'Algarrobo Grande', 'Algarrobo Grande', 300), -(703, 12, 59, 'Milagro', 'Milagro', 400), -(704, 12, 60, 'Alto Verde', 'Alto Verde', 100), -(705, 12, 60, 'Barcala', 'Barcala', 200), -(706, 12, 60, 'Buena Nueva', 'Buena Nueva', 300), -(707, 12, 60, 'General Alvear', 'General Alvear', 400), -(708, 12, 60, 'Guaymalln', 'Guaymalln', 500), -(709, 12, 60, 'La Consulta', 'La Consulta', 600), -(710, 12, 60, 'La Mora', 'La Mora', 700), -(711, 12, 60, 'Maip', 'Maip', 800), -(712, 12, 60, 'Mendoza', 'Mendoza', 900), -(713, 12, 60, 'San Rafael', 'San Rafael', 1000), -(714, 12, 60, 'Tunuyn', 'Tunuyn', 1100), -(715, 12, 61, 'Barra de Concepcin', 'Barra de Concepcin', 100), -(716, 12, 61, 'Iguaz', 'Iguaz', 200), -(717, 12, 61, 'Ober', 'Ober', 300), -(718, 12, 61, 'Posadas', 'Posadas', 400), -(719, 12, 62, 'Astra', 'Astra', 100), -(720, 12, 62, 'Neuqun', 'Neuqun', 200), -(721, 12, 63, 'Allen', 'Allen', 100), -(722, 12, 63, 'Bariloche', 'Bariloche', 200), -(723, 12, 63, 'Benjamn Zorrilla', 'Benjamn Zorrilla', 300), -(724, 12, 63, 'Boliche', 'Boliche', 400), -(725, 12, 63, 'General Roca', 'General Roca', 500), -(726, 12, 63, 'Viedma', 'Viedma', 600), -(727, 12, 63, 'Villa Regina', 'Villa Regina', 700), -(728, 12, 64, 'Orn', 'Orn', 100), -(729, 12, 65, 'Alto de Sierra', 'Alto de Sierra', 100), -(730, 12, 65, 'Bella Vista', 'Bella Vista', 200), -(731, 12, 65, 'Rivadavia', 'Rivadavia', 300), -(732, 12, 65, 'Villa Krause', 'Villa Krause', 400), -(733, 12, 66, 'Arizona', 'Arizona', 100), -(734, 12, 66, 'Saladillo', 'Saladillo', 200), -(735, 12, 67, 'Antonio de Biedma', 'Antonio de Biedma', 100), -(736, 12, 67, 'Carrera', 'Carrera', 200), -(737, 12, 67, 'El Paso', 'El Paso', 300), -(738, 12, 67, 'Estancia La Aragonesa', 'Estancia La Aragonesa', 400), -(739, 12, 67, 'Ro Gallegos', 'Ro Gallegos', 500), -(740, 12, 68, 'Arminda', 'Arminda', 100), -(741, 12, 68, 'lvarez', 'lvarez', 200), -(742, 12, 68, 'Rafaela', 'Rafaela', 300), -(743, 12, 68, 'Rosario', 'Rosario', 400), -(744, 12, 68, 'Santa Fe', 'Santa Fe', 500), -(745, 12, 69, 'La Banda', 'La Banda', 100), -(746, 12, 70, 'La Sara', 'La Sara', 100), -(747, 12, 70, 'Ro Grande', 'Ro Grande', 200), -(748, 12, 70, 'Tolhuin', 'Tolhuin', 300), -(749, 12, 70, 'Ushuaia', 'Ushuaia', 400), -(750, 12, 71, 'Alderetes', 'Alderetes', 100), -(751, 12, 71, 'San Andrs', 'San Andrs', 200), -(752, 12, 71, 'San Miguel de Tucumn', 'San Miguel de Tucumn', 300), -(753, 13, 72, 'Abaran', 'Abaran', 100), -(754, 13, 72, 'Achtarak', 'Achtarak', 200), -(755, 13, 72, 'Agarak', 'Agarak', 300), -(756, 13, 72, 'Aghts''k''', 'Aghts''k''', 400), -(757, 13, 72, 'Alagyaz', 'Alagyaz', 500), -(758, 13, 72, 'Aparan', 'Aparan', 600), -(759, 13, 72, 'Aragats', 'Aragats', 700), -(760, 13, 72, 'Aragatsotn', 'Aragatsotn', 800), -(761, 13, 72, 'Ashtarak', 'Ashtarak', 900), -(762, 13, 72, 'Dzhamushlu', 'Dzhamushlu', 1000), -(763, 13, 72, 'Oganavan', 'Oganavan', 1100), -(764, 13, 72, 'Persi', 'Persi', 1200), -(765, 13, 72, 'Talin', 'Talin', 1300), -(766, 13, 72, 'Ujan', 'Ujan', 1400), -(767, 13, 72, 'Yerindzhatap', 'Yerindzhatap', 1500), -(768, 13, 73, 'Ablkend', 'Ablkend', 100), -(769, 13, 73, 'Abovyan', 'Abovyan', 200), -(770, 13, 73, 'Agbash', 'Agbash', 300), -(771, 13, 73, 'Aralek', 'Aralek', 400), -(772, 13, 73, 'Ararat', 'Ararat', 500), -(773, 13, 73, 'Arevshat', 'Arevshat', 600), -(774, 13, 73, 'Artashat', 'Artashat', 700), -(775, 13, 73, 'Dimitrov', 'Dimitrov', 800), -(776, 13, 73, 'Dvin Armyanskiy', 'Dvin Armyanskiy', 900), -(777, 13, 73, 'Kakhtsrashen', 'Kakhtsrashen', 1000), -(778, 13, 73, 'Masis', 'Masis', 1100), -(779, 13, 73, 'Urts''adzor', 'Urts''adzor', 1200), -(780, 13, 73, 'Vedi', 'Vedi', 1300), -(781, 13, 73, 'Verin Artashat', 'Verin Artashat', 1400), -(782, 13, 73, 'Vosketap''', 'Vosketap''', 1500), -(783, 13, 73, 'Zorak', 'Zorak', 1600), -(784, 13, 74, 'Agdzharkh', 'Agdzharkh', 100), -(785, 13, 74, 'Aknalich', 'Aknalich', 200), -(786, 13, 74, 'Amasiya', 'Amasiya', 300), -(787, 13, 74, 'Apaga', 'Apaga', 400), -(788, 13, 74, 'Arevik', 'Arevik', 500), -(789, 13, 74, 'Argavand', 'Argavand', 600), -(790, 13, 74, 'Armavir', 'Armavir', 700), -(791, 13, 74, 'Armutlu', 'Armutlu', 800), -(792, 13, 74, 'Aygek', 'Aygek', 900), -(793, 13, 74, 'Aygeshat', 'Aygeshat', 1000), -(794, 13, 74, 'Bambakashat', 'Bambakashat', 1100), -(795, 13, 74, 'Echmiadzin', 'Echmiadzin', 1200), -(796, 13, 74, 'Echmiatsin', 'Echmiatsin', 1300), -(797, 13, 74, 'Ejmiatsin', 'Ejmiatsin', 1400), -(798, 13, 74, 'Hoktemberyan', 'Hoktemberyan', 1500), -(799, 13, 74, 'Iejmiatsin', 'Iejmiatsin', 1600), -(800, 13, 74, 'Janfida', 'Janfida', 1700), -(801, 13, 74, 'Metsamor', 'Metsamor', 1800), -(802, 13, 74, 'Mrgashat', 'Mrgashat', 1900), -(803, 13, 74, 'Musaler', 'Musaler', 2000), -(804, 13, 74, 'Oktemberyan', 'Oktemberyan', 2100), -(805, 13, 74, 'P''arak''ar', 'P''arak''ar', 2200), -(806, 13, 74, 'Vagharshapat', 'Vagharshapat', 2300), -(807, 13, 74, 'Zeyva', 'Zeyva', 2400), -(808, 13, 75, 'Agbulalakh', 'Agbulalakh', 100), -(809, 13, 75, 'Agexus', 'Agexus', 200), -(810, 13, 75, 'Akunk''', 'Akunk''', 300), -(811, 13, 75, 'Amirkher', 'Amirkher', 400), -(812, 13, 75, 'Areguni', 'Areguni', 500), -(813, 13, 75, 'Azat', 'Azat', 600), -(814, 13, 75, 'Chambarak', 'Chambarak', 700), -(815, 13, 75, 'Gavar', 'Gavar', 800), -(816, 13, 75, 'Gavarr', 'Gavarr', 900), -(817, 13, 75, 'Kamo', 'Kamo', 1000), -(818, 13, 75, 'Krasnosel''sk', 'Krasnosel''sk', 1100), -(819, 13, 75, 'Kyavar', 'Kyavar', 1200), -(820, 13, 75, 'Martuni', 'Martuni', 1300), -(821, 13, 75, 'Martuny', 'Martuny', 1400), -(822, 13, 75, 'Noraduz', 'Noraduz', 1500), -(823, 13, 75, 'Norakert', 'Norakert', 1600), -(824, 13, 75, 'Noratus', 'Noratus', 1700), -(825, 13, 75, 'Sevan', 'Sevan', 1800), -(826, 13, 75, 'T''azagyugh', 'T''azagyugh', 1900), -(827, 13, 75, 'Vardenis', 'Vardenis', 2000), -(828, 13, 75, 'Verkhnyaya Gezaldara', 'Verkhnyaya Gezaldara', 2100), -(829, 13, 76, 'Abovyan', 'Abovyan', 100), -(830, 13, 76, 'Akhundov', 'Akhundov', 200), -(831, 13, 76, 'Alap''ars', 'Alap''ars', 300), -(832, 13, 76, 'Aragyugh', 'Aragyugh', 400), -(833, 13, 76, 'Arindzh', 'Arindzh', 500), -(834, 13, 76, 'Arrinj', 'Arrinj', 600), -(835, 13, 76, 'Arzakan', 'Arzakan', 700), -(836, 13, 76, 'Arzni', 'Arzni', 800), -(837, 13, 76, 'Byuregavan', 'Byuregavan', 900), -(838, 13, 76, 'Ch''arants''avan', 'Ch''arants''avan', 1000), -(839, 13, 76, 'Ch''arents''avan', 'Ch''arents''avan', 1100), -(840, 13, 76, 'Choentsavan', 'Choentsavan', 1200), -(841, 13, 76, 'Garni', 'Garni', 1300), -(842, 13, 76, 'Hrazdan', 'Hrazdan', 1400), -(843, 13, 76, 'Jegward', 'Jegward', 1500), -(844, 13, 76, 'Lernanist', 'Lernanist', 1600), -(845, 13, 76, 'Megradzor', 'Megradzor', 1700), -(846, 13, 76, 'Nor Achin', 'Nor Achin', 1800), -(847, 13, 76, 'Nor Geghi', 'Nor Geghi', 1900), -(848, 13, 76, 'Nor Hachyn', 'Nor Hachyn', 2000), -(849, 13, 76, 'Proshyan', 'Proshyan', 2100), -(850, 13, 76, 'Razdan', 'Razdan', 2200), -(851, 13, 76, 'Rndamal', 'Rndamal', 2300), -(852, 13, 76, 'Tsaghkadzor', 'Tsaghkadzor', 2400), -(853, 13, 76, 'Tsakhkadzor', 'Tsakhkadzor', 2500), -(854, 13, 76, 'Yegvard', 'Yegvard', 2600), -(855, 13, 76, 'Yevgard', 'Yevgard', 2700), -(856, 13, 77, 'Agarak', 'Agarak', 100), -(857, 13, 77, 'Agvi', 'Agvi', 200), -(858, 13, 77, 'Ak''ori', 'Ak''ori', 300), -(859, 13, 77, 'Akner', 'Akner', 400), -(860, 13, 77, 'Alavar', 'Alavar', 500), -(861, 13, 77, 'Alaverdi', 'Alaverdi', 600), -(862, 13, 77, 'Alaverdy', 'Alaverdy', 700), -(863, 13, 77, 'Allaverdy', 'Allaverdy', 800), -(864, 13, 77, 'Archut', 'Archut', 900), -(865, 13, 77, 'Arevashogh', 'Arevashogh', 1000), -(866, 13, 77, 'Ayrum', 'Ayrum', 1100), -(867, 13, 77, 'Blagodarnoye', 'Blagodarnoye', 1200), -(868, 13, 77, 'Bzovdal', 'Bzovdal', 1300), -(869, 13, 77, 'Dzagidzor', 'Dzagidzor', 1400), -(870, 13, 77, 'Dzyunashogh', 'Dzyunashogh', 1500), -(871, 13, 77, 'Gogavan', 'Gogavan', 1600), -(872, 13, 77, 'Jiliza', 'Jiliza', 1700), -(873, 13, 77, 'Kalinino', 'Kalinino', 1800), -(874, 13, 77, 'Karakilisa', 'Karakilisa', 1900), -(875, 13, 77, 'Karaklis', 'Karaklis', 2000), -(876, 13, 77, 'Kirovakan', 'Kirovakan', 2100), -(877, 13, 77, 'Kyzloran', 'Kyzloran', 2200), -(878, 13, 77, 'Margahovit', 'Margahovit', 2300), -(879, 13, 77, 'Norashen', 'Norashen', 2400), -(880, 13, 77, 'Odzun', 'Odzun', 2500), -(881, 13, 77, 'Step''anavan', 'Step''anavan', 2600), -(882, 13, 77, 'Stepahavan', 'Stepahavan', 2700), -(883, 13, 77, 'Stepanawan-Lori', 'Stepanawan-Lori', 2800), -(884, 13, 77, 'Sverdlov', 'Sverdlov', 2900), -(885, 13, 77, 'Tashir', 'Tashir', 3000), -(886, 13, 77, 'Tekhut', 'Tekhut', 3100), -(887, 13, 77, 'Tumanyan', 'Tumanyan', 3200), -(888, 13, 77, 'Tyrchkhan', 'Tyrchkhan', 3300), -(889, 13, 77, 'Vanadzor', 'Vanadzor', 3400), -(890, 13, 78, 'Adzhilu', 'Adzhilu', 100), -(891, 13, 78, 'Ajlu', 'Ajlu', 200), -(892, 13, 78, 'Aregnadem', 'Aregnadem', 300), -(893, 13, 78, 'Aygeat', 'Aygeat', 400), -(894, 13, 78, 'Berd', 'Berd', 500), -(895, 13, 78, 'Chubuliki', 'Chubuliki', 600), -(896, 13, 78, 'Karakilisa', 'Karakilisa', 700), -(897, 13, 78, 'Spitak', 'Spitak', 800), -(898, 13, 78, 'Voskehask', 'Voskehask', 900), -(899, 13, 78, 'Yeniky', 'Yeniky', 1000), -(900, 13, 79, 'Alakilisa', 'Alakilisa', 100), -(901, 13, 79, 'Aleksandropol''', 'Aleksandropol''', 200), -(902, 13, 79, 'Alexandropol''', 'Alexandropol''', 300), -(903, 13, 79, 'Amasia', 'Amasia', 400), -(904, 13, 79, 'Art''ik', 'Art''ik', 500), -(905, 13, 79, 'Ashots''k''', 'Ashots''k''', 600), -(906, 13, 79, 'Gekhanist', 'Gekhanist', 700), -(907, 13, 79, 'Gyumri', 'Gyumri', 800), -(908, 13, 79, 'Hayrenyats''', 'Hayrenyats''', 900), -(909, 13, 79, 'Leninakan', 'Leninakan', 1000), -(910, 13, 79, 'Maralik', 'Maralik', 1100), -(911, 13, 79, 'Mets Kyapanak', 'Mets Kyapanak', 1200), -(912, 13, 79, 'Salut', 'Salut', 1300), -(913, 13, 79, 'Saratak', 'Saratak', 1400), -(914, 13, 80, 'Agarak', 'Agarak', 100), -(915, 13, 80, 'Akhlat''yan', 'Akhlat''yan', 200), -(916, 13, 80, 'Artsvenik', 'Artsvenik', 300), -(917, 13, 80, 'Goris', 'Goris', 400), -(918, 13, 80, 'K''ajaran', 'K''ajaran', 500), -(919, 13, 80, 'Kadzharan', 'Kadzharan', 600), -(920, 13, 80, 'Kafan', 'Kafan', 700), -(921, 13, 80, 'Kapan', 'Kapan', 800), -(922, 13, 80, 'Meghri', 'Meghri', 900), -(923, 13, 80, 'Megri', 'Megri', 1000), -(924, 13, 80, 'Megry', 'Megry', 1100), -(925, 13, 80, 'Sisian', 'Sisian', 1200), -(926, 13, 80, 'Tegh', 'Tegh', 1300), -(927, 13, 81, 'Aghavnavank''', 'Aghavnavank''', 100), -(928, 13, 81, 'Ayrum', 'Ayrum', 200), -(929, 13, 81, 'Azatamut', 'Azatamut', 300), -(930, 13, 81, 'Bagratashen', 'Bagratashen', 400), -(931, 13, 81, 'Berdavan', 'Berdavan', 500), -(932, 13, 81, 'Ch''inari', 'Ch''inari', 600), -(933, 13, 81, 'Delijan', 'Delijan', 700), -(934, 13, 81, 'Dilijan', 'Dilijan', 800), -(935, 13, 81, 'Dilizhan', 'Dilizhan', 900), -(936, 13, 81, 'Gandzak''ar', 'Gandzak''ar', 1000), -(937, 13, 81, 'Idzhevan', 'Idzhevan', 1100), -(938, 13, 81, 'Ijevan', 'Ijevan', 1200), -(939, 13, 81, 'Kozman', 'Kozman', 1300), -(940, 13, 81, 'Noyemberyan', 'Noyemberyan', 1400), -(941, 13, 81, 'Pkhtavan', 'Pkhtavan', 1500), -(942, 13, 81, 'Sevk''ar', 'Sevk''ar', 1600), -(943, 13, 82, 'Agarakadzor', 'Agarakadzor', 100), -(944, 13, 82, 'Akhavnadzor', 'Akhavnadzor', 200), -(945, 13, 82, 'Dzhermuk', 'Dzhermuk', 300), -(946, 13, 82, 'Gladzor', 'Gladzor', 400), -(947, 13, 82, 'Jermuk', 'Jermuk', 500), -(948, 13, 82, 'Malishka', 'Malishka', 600), -(949, 13, 82, 'Vayk''', 'Vayk''', 700), -(950, 13, 82, 'Yeghegnadzor', 'Yeghegnadzor', 800), -(951, 13, 82, 'Yekhegnadzor', 'Yekhegnadzor', 900), -(952, 13, 83, 'Agdzhakishlag', 'Agdzhakishlag', 100), -(953, 13, 83, 'Aj''ap''nyak', 'Aj''ap''nyak', 200), -(954, 13, 83, 'Akhtanak', 'Akhtanak', 300), -(955, 13, 83, 'Anastasavan', 'Anastasavan', 400), -(956, 13, 83, 'Arabkir', 'Arabkir', 500), -(957, 13, 83, 'Avan', 'Avan', 600), -(958, 13, 83, 'Avan-Arrinj', 'Avan-Arrinj', 700), -(959, 13, 83, 'Ayrivan', 'Ayrivan', 800), -(960, 13, 83, 'Charbakh', 'Charbakh', 900), -(961, 13, 83, 'Dzhrashen', 'Dzhrashen', 1000), -(962, 13, 83, 'Erebuni', 'Erebuni', 1100), -(963, 13, 83, 'Ereun', 'Ereun', 1200), -(964, 13, 83, 'Erevan', 'Erevan', 1300), -(965, 13, 83, 'Erewan', 'Erewan', 1400), -(966, 13, 83, 'Erivan', 'Erivan', 1500), -(967, 13, 83, 'Haght''anak', 'Haght''anak', 1600), -(968, 13, 83, 'Imeni Shaumyana', 'Imeni Shaumyana', 1700), -(969, 13, 83, 'Imeni Tairova', 'Imeni Tairova', 1800), -(970, 13, 83, 'Iravan', 'Iravan', 1900), -(971, 13, 83, 'Jrvezh', 'Jrvezh', 2000), -(972, 13, 83, 'Kanaker', 'Kanaker', 2100), -(973, 13, 83, 'Kanakeravan', 'Kanakeravan', 2200), -(974, 13, 83, 'Kond', 'Kond', 2300), -(975, 13, 83, 'Malatiya', 'Malatiya', 2400), -(976, 13, 83, 'Nor Arabkir', 'Nor Arabkir', 2500), -(977, 13, 83, 'Nor Aresh', 'Nor Aresh', 2600), -(978, 13, 83, 'Nor Byut''ania', 'Nor Byut''ania', 2700), -(979, 13, 83, 'Nor Marash', 'Nor Marash', 2800), -(980, 13, 83, 'Nor Nork''', 'Nor Nork''', 2900), -(981, 13, 83, 'Nor Zeyt''un', 'Nor Zeyt''un', 3000), -(982, 13, 83, 'Nor-Norka', 'Nor-Norka', 3100), -(983, 13, 83, 'Noragavit''', 'Noragavit''', 3200), -(984, 13, 83, 'Nork''', 'Nork''', 3300), -(985, 13, 83, 'Nubarashen', 'Nubarashen', 3400), -(986, 13, 83, 'Sari Tag', 'Sari Tag', 3500), -(987, 13, 83, 'Sarit''agh', 'Sarit''agh', 3600), -(988, 13, 83, 'Shahumyan', 'Shahumyan', 3700), -(989, 13, 83, 'Shaumyan', 'Shaumyan', 3800), -(990, 13, 83, 'Shengavit', 'Shengavit', 3900), -(991, 13, 83, 'Sovetashen', 'Sovetashen', 4000), -(992, 13, 83, 'Spandaryan', 'Spandaryan', 4100), -(993, 13, 83, 'Tolk', 'Tolk', 4200), -(994, 13, 83, 'Vardadzor', 'Vardadzor', 4300), -(995, 13, 83, 'Vardashen', 'Vardashen', 4400), -(996, 13, 83, 'Verin Ch''arbakh', 'Verin Ch''arbakh', 4500), -(997, 13, 83, 'Yengidzha', 'Yengidzha', 4600), -(998, 13, 83, 'Yerevan', 'Yerevan', 4700), -(999, 13, 83, 'Zeytun', 'Zeytun', 4800), -(1000, 14, 84, 'Балайм', 'Балайм', 100), -(1001, 15, 85, 'Баглан', 'Baglan', 100), -(1002, 15, 85, 'Герат', 'Gerat', 200), -(1003, 15, 85, 'Кабул', 'Kabul', 300), -(1004, 15, 85, 'Кандагар', 'Kandagar', 400), -(1005, 15, 85, 'Кундуз', 'Kyndyz', 500), -(1006, 15, 85, 'Чарикар', 'Charikar', 600), -(1007, 16, 86, 'Нассау', 'Нассау', 100), -(1008, 17, 87, 'Дакка', 'Dakka', 100), -(1009, 17, 87, 'Читтагонг', 'Chittangong', 200), -(1010, 18, 88, 'Бриджтаун', 'Bridgestown', 100), -(1011, 19, 89, 'Доха', 'Doha', 100), -(1012, 19, 89, 'Манама', 'Mahama', 200), -(1013, 20, 90, 'Антополь', 'Antopol', 100), -(1014, 20, 90, 'Барановичи', 'Baranovichi', 200), -(1015, 20, 90, 'Белоозерск', 'Beloozersk', 300), -(1016, 20, 90, 'Береза', 'Bereza', 400), -(1017, 20, 90, 'Береза Картуска', 'Bereza Kartuska', 500), -(1018, 20, 90, 'Брест', 'Brest', 600), -(1019, 20, 90, 'Высокое', 'Vysokoe', 700), -(1020, 20, 90, 'Ганцевичи', 'Gantsevichi', 800), -(1021, 20, 90, 'Городище', 'Gorodishche', 900), -(1022, 20, 90, 'Давид-Городок', 'David-Gorodok', 1000), -(1023, 20, 90, 'Домачево', 'Domachevo', 1100), -(1024, 20, 90, 'Дрогичин', 'Drogichin', 1200), -(1025, 20, 90, 'Жабинка', 'Zhabinka', 1300), -(1026, 20, 90, 'Ивацевичи', 'Ivatsevichi', 1400), -(1027, 20, 90, 'Каменец', 'Kamenets', 1500), -(1028, 20, 90, 'Кобрин', 'Kobrin', 1600), -(1029, 20, 90, 'Лунинец', 'Luninets', 1700), -(1030, 20, 90, 'Ляховичи', 'Lyahovichi', 1800), -(1031, 20, 90, 'Малорита', 'Malorita', 1900), -(1032, 20, 90, 'Новолукомль', 'Новолукомль', 2000), -(1033, 20, 90, 'Пинск', 'Pinsk', 2100), -(1034, 20, 90, 'Пружаны', 'Pruzhany', 2200), -(1035, 20, 90, 'Столин', 'Stolin', 2300), -(1036, 20, 91, 'Барань', 'Baran', 100), -(1037, 20, 91, 'Бегомль', 'Begoml', 200), -(1038, 20, 91, 'Бешенковичи', 'Beshenkovichi', 300), -(1039, 20, 91, 'Богушевск', 'Bogushevsk', 400), -(1040, 20, 91, 'Браслав', 'Braslav', 500), -(1041, 20, 91, 'Верхнедвинск', 'Verhnedvinsk', 600), -(1042, 20, 91, 'Ветрино', 'Vetrino', 700), -(1043, 20, 91, 'Видзы', 'Vidzy', 800), -(1044, 20, 91, 'Витебск', 'Vitebsk', 900), -(1045, 20, 91, 'Воропаево', 'Voropaevo', 1000), -(1046, 20, 91, 'Глубокое', 'Glubokoe', 1100), -(1047, 20, 91, 'Городок', 'Gorodok', 1200), -(1048, 20, 91, 'Дисна', 'Disna', 1300), -(1049, 20, 91, 'Докшицы', 'Dokshitsy', 1400), -(1050, 20, 91, 'Друя', 'Druya', 1500), -(1051, 20, 91, 'Дубровно', 'Dubrovno', 1600), -(1052, 20, 91, 'Езерище', 'Ezerishche', 1700), -(1053, 20, 91, 'Лепель', 'Lepel', 1800), -(1054, 20, 91, 'Лиозно', 'Liozno', 1900), -(1055, 20, 91, 'Миоры', 'Miory', 2000), -(1056, 20, 91, 'Новополоцк', 'Novopolotsk', 2100), -(1057, 20, 91, 'Орша', 'Orsha', 2200), -(1058, 20, 91, 'Полоцк', 'Polotsk', 2300), -(1059, 20, 91, 'Поставы', 'Postavy', 2400), -(1060, 20, 91, 'Россоны', 'Rossony', 2500), -(1061, 20, 91, 'Сенно', 'Senno', 2600), -(1062, 20, 91, 'Толочин', 'Tolochin', 2700), -(1063, 20, 91, 'Ушачи', 'Ushachi', 2800), -(1064, 20, 91, 'Чашники', 'Chashniki', 2900), -(1065, 20, 91, 'Шарковщина', 'Sharkovshchina', 3000), -(1066, 20, 91, 'Шумилино', 'Shumilino', 3100), -(1067, 20, 92, 'Белицк', 'Belitsk', 100), -(1068, 20, 92, 'Большевик', 'Bolshevik', 200), -(1069, 20, 92, 'Брагин', 'Bragin', 300), -(1070, 20, 92, 'Буда-Кошелево', 'Buda-Koshelevo', 400), -(1071, 20, 92, 'Василевичи', 'Vasilevichi', 500), -(1072, 20, 92, 'Васильевка', 'Vasilevka', 600), -(1073, 20, 92, 'Ветка', 'Vetka', 700), -(1074, 20, 92, 'Гомель', 'Gomel', 800), -(1075, 20, 92, 'Добруш', 'Dobrush', 900), -(1076, 20, 92, 'Ельск', 'Elsk', 1000), -(1077, 20, 92, 'Житковичи', 'Zhitkovichi', 1100), -(1078, 20, 92, 'Жлобин', 'Zhlobin', 1200), -(1079, 20, 92, 'Калинковичи', 'Kalinkovichi', 1300), -(1080, 20, 92, 'Корма', 'Korma', 1400), -(1081, 20, 92, 'Лельчицы', 'Lelchitsy', 1500), -(1082, 20, 92, 'Лоев', 'Loev', 1600), -(1083, 20, 92, 'Мозырь', 'Mozyr', 1700), -(1084, 20, 92, 'Наровля', 'Narovlya', 1800), -(1085, 20, 92, 'Октябрьский', 'Oktyabrskii', 1900), -(1086, 20, 92, 'Петриков', 'Petrikov', 2000), -(1087, 20, 92, 'Речица', 'Rechitsa', 2100), -(1088, 20, 92, 'Речица', 'Rechitsa', 2200), -(1089, 20, 92, 'Речица', 'Rechitsya', 2300), -(1090, 20, 92, 'Рогачев', 'Rogachev', 2400), -(1091, 20, 92, 'Светлогорск', 'Svetlogorsk', 2500), -(1092, 20, 92, 'Туров', 'Туров', 2600), -(1093, 20, 92, 'Хойники', 'Hoiniki', 2700), -(1094, 20, 92, 'Чечерск', 'Chechersk', 2800), -(1095, 20, 93, 'Большая Берестовица', 'Bolshaya Berestovitsa', 100), -(1096, 20, 93, 'Волковыск', 'Volkovysk', 200), -(1097, 20, 93, 'Вороново', 'Voronovo', 300), -(1098, 20, 93, 'Гродно', 'Grodno', 400); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(1099, 20, 93, 'Дятлово', 'Dyatlovo', 500), -(1100, 20, 93, 'Желудок', 'Zheludok', 600), -(1101, 20, 93, 'Зельва', 'Zelva', 700), -(1102, 20, 93, 'Ивье', 'Ive', 800), -(1103, 20, 93, 'Козловщина', 'Kozlovshchina', 900), -(1104, 20, 93, 'Кореличи', 'Korelichi', 1000), -(1105, 20, 93, 'Лида', 'Lida', 1100), -(1106, 20, 93, 'Мосты', 'Mosty', 1200), -(1107, 20, 93, 'Новогрудок', 'Novogrudok', 1300), -(1108, 20, 93, 'Островец', 'Ostrovets', 1400), -(1109, 20, 93, 'Ошмяны', 'Oshmyany', 1500), -(1110, 20, 93, 'Свислочь', 'Svisloch', 1600), -(1111, 20, 93, 'Слоним', 'Slonim', 1700), -(1112, 20, 93, 'Сморгонь', 'Smorgon', 1800), -(1113, 20, 93, 'Щучин', 'Shchuchin', 1900), -(1114, 20, 94, 'Березино', 'Berezino', 100), -(1115, 20, 94, 'Бобр', 'Bobr', 200), -(1116, 20, 94, 'Борисов', 'Borisov', 300), -(1117, 20, 94, 'Вилейка', 'Vileika', 400), -(1118, 20, 94, 'Воложин', 'Volozhin', 500), -(1119, 20, 94, 'Городея', 'Gorodeya', 600), -(1120, 20, 94, 'Дзержинск', 'Dzerzhinsk', 700), -(1121, 20, 94, 'Жодино', 'Zhodino', 800), -(1122, 20, 94, 'Заславль', 'Zaslavl', 900), -(1123, 20, 94, 'Зеленый Бор', 'Zelenyi Bor', 1000), -(1124, 20, 94, 'Ивенец', 'Ivenets', 1100), -(1125, 20, 94, 'Клецк', 'Kletsk', 1200), -(1126, 20, 94, 'Копыль', 'Kopyl', 1300), -(1127, 20, 94, 'Крупки', 'Krupki', 1400), -(1128, 20, 94, 'Логойск', 'Logoisk', 1500), -(1129, 20, 94, 'Любань', 'Любань', 1600), -(1130, 20, 94, 'Марьина Горка', 'Marina Gorka', 1700), -(1131, 20, 94, 'Минск', 'Minsk', 1800), -(1132, 20, 94, 'Молодечно', 'Molodechno', 1900), -(1133, 20, 94, 'Мядель', 'Myadel', 2000), -(1134, 20, 94, 'Несвиж', 'Nesvizh', 2100), -(1135, 20, 94, 'Слуцк', 'Slutsk', 2200), -(1136, 20, 94, 'Смолевичи', 'Smolevichi', 2300), -(1137, 20, 94, 'Солигорск', 'Soligorsk', 2400), -(1138, 20, 94, 'Старые Дороги', 'Starye Dorogi', 2500), -(1139, 20, 94, 'Столбцы', 'Stolbtsy', 2600), -(1140, 20, 94, 'Узда', 'Uzda', 2700), -(1141, 20, 94, 'Фаниполь', 'Fanipol', 2800), -(1142, 20, 94, 'Червень', 'Cherven', 2900), -(1143, 20, 95, 'Белыничи', 'Belynichi', 100), -(1144, 20, 95, 'Бобруйск', 'Bobruisk', 200), -(1145, 20, 95, 'Быхов', 'Byhov', 300), -(1146, 20, 95, 'Глуск', 'Glusk', 400), -(1147, 20, 95, 'Глуша', 'Glusha', 500), -(1148, 20, 95, 'Горки', 'Gorki', 600), -(1149, 20, 95, 'Гродзянка', 'Grodzyanka', 700), -(1150, 20, 95, 'Елизово', 'Elizovo', 800), -(1151, 20, 95, 'Кировск', 'Kirovsk', 900), -(1152, 20, 95, 'Климовичи', 'Klimovichi', 1000), -(1153, 20, 95, 'Кличев', 'Klichev', 1100), -(1154, 20, 95, 'Костюковичи', 'Kostyukovichi', 1200), -(1155, 20, 95, 'Краснополье', 'Krasnopole', 1300), -(1156, 20, 95, 'Кричев', 'Krichev', 1400), -(1157, 20, 95, 'Круглое', 'Krugloe', 1500), -(1158, 20, 95, 'Могилев', 'Mogilev', 1600), -(1159, 20, 95, 'Мстиславль', 'Mstislavl', 1700), -(1160, 20, 95, 'Осиповичи', 'Osipovichi', 1800), -(1161, 20, 95, 'Славгород', 'Slavgorod', 1900), -(1162, 20, 95, 'Хотимск', 'Hotimsk', 2000), -(1163, 20, 95, 'Чаусы', 'Chausy', 2100), -(1164, 20, 95, 'Чериков', 'Cherikov', 2200), -(1165, 20, 95, 'Шклов', 'Shklov', 2300), -(1166, 21, 96, 'Белиз-Сити', 'Белиз-Сити', 100), -(1167, 22, 97, 'Aartselaar', 'Aartselaar', 100), -(1168, 22, 97, 'Antwerpen', 'Antwerpen', 200), -(1169, 22, 97, 'Balen', 'Balen', 300), -(1170, 22, 97, 'Boom', 'Boom', 400), -(1171, 22, 97, 'Brasschaat', 'Brasschaat', 500), -(1172, 22, 97, 'Duffel', 'Duffel', 600), -(1173, 22, 97, 'Essen', 'Essen', 700), -(1174, 22, 97, 'Geel', 'Geel', 800), -(1175, 22, 97, 'Heist-op-den-Berg', 'Heist-op-den-Berg', 900), -(1176, 22, 97, 'Herentals', 'Herentals', 1000), -(1177, 22, 97, 'Herenthout', 'Herenthout', 1100), -(1178, 22, 97, 'Herselt', 'Herselt', 1200), -(1179, 22, 97, 'Kapellen', 'Kapellen', 1300), -(1180, 22, 97, 'Lier', 'Lier', 1400), -(1181, 22, 97, 'Lint', 'Lint', 1500), -(1182, 22, 97, 'Mechelen', 'Mechelen', 1600), -(1183, 22, 97, 'Mol', 'Mol', 1700), -(1184, 22, 97, 'Mortsel', 'Mortsel', 1800), -(1185, 22, 97, 'Olen', 'Olen', 1900), -(1186, 22, 97, 'Putte', 'Putte', 2000), -(1187, 22, 97, 'Schilde', 'Schilde', 2100), -(1188, 22, 97, 'Schoten', 'Schoten', 2200), -(1189, 22, 97, 'Turnhout', 'Turnhout', 2300), -(1190, 22, 97, 'Zwijndrecht', 'Zwijndrecht', 2400), -(1191, 22, 98, 'Beauvechain', 'Beauvechain', 100), -(1192, 22, 98, 'Braine-l''Alleud', 'Braine-l''Alleud', 200), -(1193, 22, 98, 'Chastre', 'Chastre', 300), -(1194, 22, 98, 'Jodoigne', 'Jodoigne', 400), -(1195, 22, 98, 'Lasne', 'Lasne', 500), -(1196, 22, 98, 'Nivelles', 'Nivelles', 600), -(1197, 22, 98, 'Ottignies-Louvain-la-Neuve', 'Ottignies-Louvain-la-Neuve', 700), -(1198, 22, 98, 'Rixensart', 'Rixensart', 800), -(1199, 22, 98, 'Tubize', 'Tubize', 900), -(1200, 22, 98, 'Villers-la-Ville', 'Villers-la-Ville', 1000), -(1201, 22, 98, 'Walhain', 'Walhain', 1100), -(1202, 22, 98, 'Waterloo', 'Waterloo', 1200), -(1203, 22, 98, 'Wavre', 'Wavre', 1300), -(1204, 22, 99, 'Bruxelles', 'Bruxelles', 100), -(1205, 22, 100, 'Ath', 'Ath', 100), -(1206, 22, 100, 'Binche', 'Binche', 200), -(1207, 22, 100, 'Charleroi', 'Charleroi', 300), -(1208, 22, 100, 'Chtelet', 'Chtelet', 400), -(1209, 22, 100, 'Comines-Warneton', 'Comines-Warneton', 500), -(1210, 22, 100, 'Courcelles', 'Courcelles', 600), -(1211, 22, 100, 'Dour', 'Dour', 700), -(1212, 22, 100, 'Ellezelles', 'Ellezelles', 800), -(1213, 22, 100, 'Fleurus', 'Fleurus', 900), -(1214, 22, 100, 'Fontaine-l''Evque', 'Fontaine-l''Evque', 1000), -(1215, 22, 100, 'Frameries', 'Frameries', 1100), -(1216, 22, 100, 'Gerpinnes', 'Gerpinnes', 1200), -(1217, 22, 100, 'La Louvire', 'La Louvire', 1300), -(1218, 22, 100, 'Manage', 'Manage', 1400), -(1219, 22, 100, 'Mons', 'Mons', 1500), -(1220, 22, 100, 'Mouscron', 'Mouscron', 1600), -(1221, 22, 101, 'Amay', 'Amay', 100), -(1222, 22, 101, 'Ans', 'Ans', 200), -(1223, 22, 101, 'Awans', 'Awans', 300), -(1224, 22, 101, 'Aywaille', 'Aywaille', 400), -(1225, 22, 101, 'Baelen', 'Baelen', 500), -(1226, 22, 101, 'Berloz', 'Berloz', 600), -(1227, 22, 101, 'Bllingen', 'Bllingen', 700), -(1228, 22, 101, 'Brunehaut', 'Brunehaut', 800), -(1229, 22, 101, 'Celles', 'Celles', 900), -(1230, 22, 101, 'Chaudfontaine', 'Chaudfontaine', 1000), -(1231, 22, 101, 'Dison', 'Dison', 1100), -(1232, 22, 101, 'Eupen', 'Eupen', 1200), -(1233, 22, 101, 'Kelmis', 'Kelmis', 1300), -(1234, 22, 101, 'Lige', 'Lige', 1400), -(1235, 22, 101, 'Malmedy', 'Malmedy', 1500), -(1236, 22, 101, 'Oreye', 'Oreye', 1600), -(1237, 22, 101, 'Raeren', 'Raeren', 1700), -(1238, 22, 101, 'Saint-Nicolas', 'Saint-Nicolas', 1800), -(1239, 22, 101, 'Sankt Vith', 'Sankt Vith', 1900), -(1240, 22, 101, 'Spa', 'Spa', 2000), -(1241, 22, 101, 'Tournai', 'Tournai', 2100), -(1242, 22, 101, 'Verviers', 'Verviers', 2200), -(1243, 22, 101, 'Waimes', 'Waimes', 2300), -(1244, 22, 102, 'Alken', 'Alken', 100), -(1245, 22, 102, 'As', 'As', 200), -(1246, 22, 102, 'Beringen', 'Beringen', 300), -(1247, 22, 102, 'Bilzen', 'Bilzen', 400), -(1248, 22, 102, 'Borgloon', 'Borgloon', 500), -(1249, 22, 102, 'Bree', 'Bree', 600), -(1250, 22, 102, 'Dilsen-Stokkem', 'Dilsen-Stokkem', 700), -(1251, 22, 102, 'Halen', 'Halen', 800), -(1252, 22, 102, 'Ham', 'Ham', 900), -(1253, 22, 102, 'Hasselt', 'Hasselt', 1000), -(1254, 22, 102, 'Heers', 'Heers', 1100), -(1255, 22, 102, 'Heusden-Zolder', 'Heusden-Zolder', 1200), -(1256, 22, 102, 'Hoeselt', 'Hoeselt', 1300), -(1257, 22, 102, 'Houthalen-Helchteren', 'Houthalen-Helchteren', 1400), -(1258, 22, 102, 'Lanaken', 'Lanaken', 1500), -(1259, 22, 102, 'Leopoldsburg', 'Leopoldsburg', 1600), -(1260, 22, 102, 'Lommel', 'Lommel', 1700), -(1261, 22, 102, 'Lummen', 'Lummen', 1800), -(1262, 22, 102, 'Maaseik', 'Maaseik', 1900), -(1263, 22, 102, 'Maasmechelen', 'Maasmechelen', 2000), -(1264, 22, 102, 'Neerpelt', 'Neerpelt', 2100), -(1265, 22, 102, 'Overpelt', 'Overpelt', 2200), -(1266, 22, 102, 'Peer', 'Peer', 2300), -(1267, 22, 102, 'Sint-Truiden', 'Sint-Truiden', 2400), -(1268, 22, 102, 'Tessenderlo', 'Tessenderlo', 2500), -(1269, 22, 102, 'Tongeren', 'Tongeren', 2600), -(1270, 22, 102, 'Wellen', 'Wellen', 2700), -(1271, 22, 102, 'Zonhoven', 'Zonhoven', 2800), -(1272, 22, 103, 'Arlon', 'Arlon', 100), -(1273, 22, 103, 'Aubange', 'Aubange', 200), -(1274, 22, 103, 'Bastogne', 'Bastogne', 300), -(1275, 22, 103, 'Bertrix', 'Bertrix', 400), -(1276, 22, 103, 'Bouillon', 'Bouillon', 500), -(1277, 22, 103, 'Chiny', 'Chiny', 600), -(1278, 22, 103, 'Durbuy', 'Durbuy', 700), -(1279, 22, 103, 'Etalle', 'Etalle', 800), -(1280, 22, 103, 'Florenville', 'Florenville', 900), -(1281, 22, 103, 'Habay', 'Habay', 1000), -(1282, 22, 103, 'La Roche-en-Ardenne', 'La Roche-en-Ardenne', 1100), -(1283, 22, 103, 'Lglise', 'Lglise', 1200), -(1284, 22, 103, 'Libin', 'Libin', 1300), -(1285, 22, 103, 'Manhay', 'Manhay', 1400), -(1286, 22, 103, 'Marche-en-Famenne', 'Marche-en-Famenne', 1500), -(1287, 22, 103, 'Messancy', 'Messancy', 1600), -(1288, 22, 103, 'Rendeux', 'Rendeux', 1700), -(1289, 22, 103, 'Tellin', 'Tellin', 1800), -(1290, 22, 103, 'Tenneville', 'Tenneville', 1900), -(1291, 22, 103, 'Tintigny', 'Tintigny', 2000), -(1292, 22, 103, 'Virton', 'Virton', 2100), -(1293, 22, 103, 'Wellin', 'Wellin', 2200), -(1294, 22, 104, 'Andenne', 'Andenne', 100), -(1295, 22, 104, 'Anhe', 'Anhe', 200), -(1296, 22, 104, 'Cerfontaine', 'Cerfontaine', 300), -(1297, 22, 104, 'Dinant', 'Dinant', 400), -(1298, 22, 104, 'Doische', 'Doische', 500), -(1299, 22, 104, 'Fosses-la-Ville', 'Fosses-la-Ville', 600), -(1300, 22, 104, 'Mettet', 'Mettet', 700), -(1301, 22, 104, 'Namur', 'Namur', 800), -(1302, 22, 104, 'Philippeville', 'Philippeville', 900), -(1303, 22, 104, 'Viroinval', 'Viroinval', 1000), -(1304, 22, 104, 'Yvoir', 'Yvoir', 1100), -(1305, 22, 105, 'Aalst', 'Aalst', 100), -(1306, 22, 105, 'Berlare', 'Berlare', 200), -(1307, 22, 105, 'Beveren', 'Beveren', 300), -(1308, 22, 105, 'De Pinte', 'De Pinte', 400), -(1309, 22, 105, 'Deinze', 'Deinze', 500), -(1310, 22, 105, 'Denderleeuw', 'Denderleeuw', 600), -(1311, 22, 105, 'Dendermonde', 'Dendermonde', 700), -(1312, 22, 105, 'Erpe-Mere', 'Erpe-Mere', 800), -(1313, 22, 105, 'Gent', 'Gent', 900), -(1314, 22, 105, 'Geraardsbergen', 'Geraardsbergen', 1000), -(1315, 22, 105, 'Hamme', 'Hamme', 1100), -(1316, 22, 105, 'Lebbeke', 'Lebbeke', 1200), -(1317, 22, 105, 'Lede', 'Lede', 1300), -(1318, 22, 105, 'Lierde', 'Lierde', 1400), -(1319, 22, 105, 'Melle', 'Melle', 1500), -(1320, 22, 105, 'Merelbeke', 'Merelbeke', 1600), -(1321, 22, 105, 'Ninove', 'Ninove', 1700), -(1322, 22, 105, 'Oudenaarde', 'Oudenaarde', 1800), -(1323, 22, 105, 'Ronse', 'Ronse', 1900), -(1324, 22, 105, 'Sint-Niklaas', 'Sint-Niklaas', 2000), -(1325, 22, 105, 'Temse', 'Temse', 2100), -(1326, 22, 106, 'Asse', 'Asse', 100), -(1327, 22, 106, 'Bekkevoort', 'Bekkevoort', 200), -(1328, 22, 106, 'Diest', 'Diest', 300), -(1329, 22, 106, 'Glabbeek', 'Glabbeek', 400), -(1330, 22, 106, 'Halle', 'Halle', 500), -(1331, 22, 106, 'Herent', 'Herent', 600), -(1332, 22, 106, 'Herne', 'Herne', 700), -(1333, 22, 106, 'Kapelle-op-den-Bos', 'Kapelle-op-den-Bos', 800), -(1334, 22, 106, 'Kortenaken', 'Kortenaken', 900), -(1335, 22, 106, 'Leuven', 'Leuven', 1000), -(1336, 22, 106, 'Tervuren', 'Tervuren', 1100), -(1337, 22, 106, 'Tienen', 'Tienen', 1200), -(1338, 22, 106, 'Vilvoorde', 'Vilvoorde', 1300), -(1339, 22, 106, 'Zaventem', 'Zaventem', 1400), -(1340, 22, 106, 'Zemst', 'Zemst', 1500), -(1341, 22, 106, 'Zoutleeuw', 'Zoutleeuw', 1600), -(1342, 22, 107, 'Ardooie', 'Ardooie', 100), -(1343, 22, 107, 'Beernem', 'Beernem', 200), -(1344, 22, 107, 'Blankenberge', 'Blankenberge', 300), -(1345, 22, 107, 'Bredene', 'Bredene', 400), -(1346, 22, 107, 'Brugge', 'Brugge', 500), -(1347, 22, 107, 'De Haan', 'De Haan', 600), -(1348, 22, 107, 'De Panne', 'De Panne', 700), -(1349, 22, 107, 'Diksmuide', 'Diksmuide', 800), -(1350, 22, 107, 'Harelbeke', 'Harelbeke', 900), -(1351, 22, 107, 'Ieper', 'Ieper', 1000), -(1352, 22, 107, 'Izegem', 'Izegem', 1100), -(1353, 22, 107, 'Jabbeke', 'Jabbeke', 1200), -(1354, 22, 107, 'Knokke-Heist', 'Knokke-Heist', 1300), -(1355, 22, 107, 'Koksijde', 'Koksijde', 1400), -(1356, 22, 107, 'Kortrijk', 'Kortrijk', 1500), -(1357, 22, 107, 'Kuurne', 'Kuurne', 1600), -(1358, 22, 107, 'Menen', 'Menen', 1700), -(1359, 22, 107, 'Middelkerke', 'Middelkerke', 1800), -(1360, 22, 107, 'Oostende', 'Oostende', 1900), -(1361, 22, 107, 'Oostrozebeke', 'Oostrozebeke', 2000), -(1362, 22, 107, 'Pittem', 'Pittem', 2100), -(1363, 22, 107, 'Roeselare', 'Roeselare', 2200), -(1364, 22, 107, 'Tielt', 'Tielt', 2300), -(1365, 22, 107, 'Torhout', 'Torhout', 2400), -(1366, 22, 107, 'Veurne', 'Veurne', 2500), -(1367, 22, 107, 'Wervik', 'Wervik', 2600), -(1368, 22, 107, 'Zedelgem', 'Zedelgem', 2700), -(1369, 22, 107, 'Zonnebeke', 'Zonnebeke', 2800), -(1370, 23, 108, 'Порто-Ново', 'Porto-Novo', 100), -(1371, 24, 109, 'Гамильтон', 'Гамильтон', 100), -(1372, 25, 110, 'Bahnhof Pirin', 'Bahnhof Pirin', 100), -(1373, 25, 110, 'Bansko', 'Bansko', 200), -(1374, 25, 110, 'Belitsa', 'Belitsa', 300), -(1375, 25, 110, 'Blagoevgrad', 'Blagoevgrad', 400), -(1376, 25, 110, 'Gotse Delchev', 'Gotse Delchev', 500), -(1377, 25, 110, 'Petric', 'Petric', 600), -(1378, 25, 110, 'Petrich', 'Petrich', 700), -(1379, 25, 110, 'Sandanski', 'Sandanski', 800), -(1380, 25, 110, 'Strumyani', 'Strumyani', 900), -(1381, 25, 111, 'Abdioglu K''oy', 'Abdioglu K''oy', 100), -(1382, 25, 111, 'Abtarazak', 'Abtarazak', 200), -(1383, 25, 111, 'Achlare', 'Achlare', 300), -(1384, 25, 111, 'Achtopol', 'Achtopol', 400), -(1385, 25, 111, 'Aclari', 'Aclari', 500), -(1386, 25, 111, 'Aclart', 'Aclart', 600), -(1387, 25, 111, 'Ahiolo', 'Ahiolo', 700), -(1388, 25, 111, 'Aitos', 'Aitos', 800), -(1389, 25, 111, 'Ajtos', 'Ajtos', 900), -(1390, 25, 111, 'Balgari', 'Balgari', 1000), -(1391, 25, 111, 'Bourgas', 'Bourgas', 1100), -(1392, 25, 111, 'Burgas', 'Burgas', 1200), -(1393, 25, 111, 'Burgaz', 'Burgaz', 1300), -(1394, 25, 111, 'Burghaz', 'Burghaz', 1400), -(1395, 25, 111, 'Cerni Vruch', 'Cerni Vruch', 1500), -(1396, 25, 111, 'Chernomorets', 'Chernomorets', 1600), -(1397, 25, 111, 'Chibuklii', 'Chibuklii', 1700), -(1398, 25, 111, 'Gyulyuvitsa', 'Gyulyuvitsa', 1800), -(1399, 25, 111, 'Kameno', 'Kameno', 1900), -(1400, 25, 111, 'Karnabat', 'Karnabat', 2000), -(1401, 25, 111, 'Karnobat', 'Karnobat', 2100), -(1402, 25, 111, 'Losenez', 'Losenez', 2200), -(1403, 25, 111, 'Nesebar', 'Nesebar', 2300), -(1404, 25, 111, 'Neseber', 'Neseber', 2400), -(1405, 25, 111, 'Nesebr', 'Nesebr', 2500), -(1406, 25, 111, 'Nessebar', 'Nessebar', 2600), -(1407, 25, 111, 'Obzor', 'Obzor', 2700), -(1408, 25, 111, 'Pomorie', 'Pomorie', 2800), -(1409, 25, 111, 'Pomoriye', 'Pomoriye', 2900), -(1410, 25, 111, 'Primorsko', 'Primorsko', 3000), -(1411, 25, 111, 'Sarafovo', 'Sarafovo', 3100), -(1412, 25, 111, 'Sarefovo', 'Sarefovo', 3200), -(1413, 25, 111, 'Sizopol', 'Sizopol', 3300), -(1414, 25, 111, 'Sosopol', 'Sosopol', 3400), -(1415, 25, 111, 'Sozopol', 'Sozopol', 3500), -(1416, 25, 111, 'Sveti Vlas', 'Sveti Vlas', 3600), -(1417, 25, 112, 'Balchik', 'Balchik', 100), -(1418, 25, 112, 'Dobric', 'Dobric', 200), -(1419, 25, 112, 'Dobrich', 'Dobrich', 300), -(1420, 25, 112, 'Dobritch', 'Dobritch', 400), -(1421, 25, 112, 'General Tosevo', 'General Tosevo', 500), -(1422, 25, 112, 'Kavarna', 'Kavarna', 600), -(1423, 25, 112, 'Krusari', 'Krusari', 700), -(1424, 25, 112, 'Krushari', 'Krushari', 800), -(1425, 25, 113, 'Dryanovo', 'Dryanovo', 100), -(1426, 25, 113, 'Gabrovo', 'Gabrovo', 200), -(1427, 25, 113, 'Gabrowo', 'Gabrowo', 300), -(1428, 25, 113, 'Sevlievo', 'Sevlievo', 400), -(1429, 25, 113, 'Trevna', 'Trevna', 500), -(1430, 25, 113, 'Trjavna', 'Trjavna', 600), -(1431, 25, 113, 'Tryavna', 'Tryavna', 700), -(1432, 25, 114, 'Aleksandur Voykov', 'Aleksandur Voykov', 100), -(1433, 25, 114, 'Banki', 'Banki', 200), -(1434, 25, 114, 'Bankia', 'Bankia', 300), -(1435, 25, 114, 'Bankja', 'Bankja', 400), -(1436, 25, 114, 'Benkovski', 'Benkovski', 500), -(1437, 25, 114, 'Boyana', 'Boyana', 600), -(1438, 25, 114, 'Bussmanzi', 'Bussmanzi', 700), -(1439, 25, 114, 'Celopecene', 'Celopecene', 800), -(1440, 25, 114, 'Gorubljane', 'Gorubljane', 900), -(1441, 25, 114, 'Gradska Chast', 'Gradska Chast', 1000), -(1442, 25, 114, 'Obelya', 'Obelya', 1100), -(1443, 25, 114, 'Sofia', 'Sofia', 1200), -(1444, 25, 114, 'Sofija', 'Sofija', 1300), -(1445, 25, 114, 'Sofiya', 'Sofiya', 1400), -(1446, 25, 114, 'Yana', 'Yana', 1500), -(1447, 25, 115, 'Bakulur', 'Bakulur', 100), -(1448, 25, 115, 'Chaskovo', 'Chaskovo', 200), -(1449, 25, 115, 'Derviska-Mogila', 'Derviska-Mogila', 300), -(1450, 25, 115, 'Dimitrovgrad', 'Dimitrovgrad', 400), -(1451, 25, 115, 'Harmanli', 'Harmanli', 500), -(1452, 25, 115, 'Harmanly', 'Harmanly', 600), -(1453, 25, 115, 'Haskovo', 'Haskovo', 700), -(1454, 25, 115, 'Ivaylovgrad', 'Ivaylovgrad', 800), -(1455, 25, 115, 'Khaskovo', 'Khaskovo', 900), -(1456, 25, 115, 'Khrastovo', 'Khrastovo', 1000), -(1457, 25, 115, 'Malevo', 'Malevo', 1100), -(1458, 25, 115, 'Simeonovgrad', 'Simeonovgrad', 1200), -(1459, 25, 115, 'Slivengrad', 'Slivengrad', 1300), -(1460, 25, 115, 'Svilengrad', 'Svilengrad', 1400), -(1461, 25, 115, 'Svilengrade', 'Svilengrade', 1500), -(1462, 25, 115, 'Topolowgrad', 'Topolowgrad', 1600), -(1463, 25, 116, 'Ardino', 'Ardino', 100), -(1464, 25, 116, 'Kardzhali', 'Kardzhali', 200), -(1465, 25, 116, 'Kircaali', 'Kircaali', 300), -(1466, 25, 116, 'Kirdzali', 'Kirdzali', 400), -(1467, 25, 116, 'Kirdzalu', 'Kirdzalu', 500), -(1468, 25, 116, 'Kirjali', 'Kirjali', 600), -(1469, 25, 116, 'Koshu-Kavak', 'Koshu-Kavak', 700), -(1470, 25, 116, 'Krdjali', 'Krdjali', 800), -(1471, 25, 116, 'Kroumovgrade', 'Kroumovgrade', 900), -(1472, 25, 116, 'Kurdzali', 'Kurdzali', 1000), -(1473, 25, 116, 'Mastanl', 'Mastanl', 1100), -(1474, 25, 116, 'Momchilgrad', 'Momchilgrad', 1200), -(1475, 25, 117, 'Bobov Dol', 'Bobov Dol', 100), -(1476, 25, 117, 'Dupnitsa', 'Dupnitsa', 200), -(1477, 25, 117, 'Keustendil', 'Keustendil', 300), -(1478, 25, 117, 'Kioustndil', 'Kioustndil', 400), -(1479, 25, 117, 'Kjustendil', 'Kjustendil', 500), -(1480, 25, 117, 'Kyustendil', 'Kyustendil', 600), -(1481, 25, 118, 'Ablanica', 'Ablanica', 100), -(1482, 25, 118, 'Bahovica', 'Bahovica', 200), -(1483, 25, 118, 'Gradezhnitsa', 'Gradezhnitsa', 300), -(1484, 25, 118, 'Letniza', 'Letniza', 400), -(1485, 25, 118, 'Loukovit', 'Loukovit', 500), -(1486, 25, 118, 'Lovec', 'Lovec', 600), -(1487, 25, 118, 'Lovech', 'Lovech', 700), -(1488, 25, 118, 'Lovetch', 'Lovetch', 800), -(1489, 25, 118, 'Lukowit', 'Lukowit', 900), -(1490, 25, 118, 'Teteven', 'Teteven', 1000), -(1491, 25, 118, 'Troan', 'Troan', 1100), -(1492, 25, 118, 'Trojan', 'Trojan', 1200), -(1493, 25, 118, 'Troyan', 'Troyan', 1300), -(1494, 25, 118, 'Ugarchin', 'Ugarchin', 1400), -(1495, 25, 119, 'Berkovica', 'Berkovica', 100), -(1496, 25, 119, 'Berkovitza', 'Berkovitza', 200), -(1497, 25, 119, 'Chiprovtsi', 'Chiprovtsi', 300), -(1498, 25, 119, 'Evdokiya', 'Evdokiya', 400), -(1499, 25, 119, 'Lom', 'Lom', 500), -(1500, 25, 119, 'Montana', 'Montana', 600), -(1501, 25, 119, 'Valtchedram', 'Valtchedram', 700), -(1502, 25, 120, 'Kum Dervent Dere', 'Kum Dervent Dere', 100), -(1503, 25, 120, 'Simen', 'Simen', 200), -(1504, 25, 121, 'Belovo', 'Belovo', 100), -(1505, 25, 121, 'Bracigovo', 'Bracigovo', 200), -(1506, 25, 121, 'Lesicovo', 'Lesicovo', 300), -(1507, 25, 121, 'Panagiuriste', 'Panagiuriste', 400), -(1508, 25, 121, 'Panagjurischte', 'Panagjurischte', 500), -(1509, 25, 121, 'Panagyurishte', 'Panagyurishte', 600), -(1510, 25, 121, 'Pasardshik', 'Pasardshik', 700), -(1511, 25, 121, 'Pazardjik', 'Pazardjik', 800), -(1512, 25, 121, 'Pazardzhik', 'Pazardzhik', 900), -(1513, 25, 121, 'Rakitovo', 'Rakitovo', 1000), -(1514, 25, 121, 'Septemvri', 'Septemvri', 1100), -(1515, 25, 121, 'Velingrad', 'Velingrad', 1200), -(1516, 25, 122, 'Pernik', 'Pernik', 100), -(1517, 25, 122, 'Radomir', 'Radomir', 200), -(1518, 25, 123, 'Belene', 'Belene', 100), -(1519, 25, 123, 'Byelene', 'Byelene', 200), -(1520, 25, 123, 'Cherven Bryag', 'Cherven Bryag', 300), -(1521, 25, 123, 'Cherveni-Bjerg', 'Cherveni-Bjerg', 400), -(1522, 25, 123, 'Dolna Mitropolia', 'Dolna Mitropolia', 500), -(1523, 25, 123, 'Galyantsi', 'Galyantsi', 600), -(1524, 25, 123, 'Levski', 'Levski', 700), -(1525, 25, 123, 'Nicopol', 'Nicopol', 800), -(1526, 25, 123, 'Nikopol', 'Nikopol', 900), -(1527, 25, 123, 'Pleven', 'Pleven', 1000), -(1528, 25, 123, 'Plevna', 'Plevna', 1100), -(1529, 25, 123, 'Plewen', 'Plewen', 1200), -(1530, 25, 123, 'Pordime', 'Pordime', 1300), -(1531, 25, 124, 'Akhatlar Segair', 'Akhatlar Segair', 100), -(1532, 25, 124, 'Alamovtsi', 'Alamovtsi', 200), -(1533, 25, 124, 'Arapovo', 'Arapovo', 300), -(1534, 25, 124, 'Asenovgrad', 'Asenovgrad', 400), -(1535, 25, 124, 'Assenovgrad', 'Assenovgrad', 500), -(1536, 25, 124, 'Awramowzi', 'Awramowzi', 600), -(1537, 25, 124, 'Baldevo', 'Baldevo', 700), -(1538, 25, 124, 'Bania', 'Bania', 800), -(1539, 25, 124, 'Banja', 'Banja', 900), -(1540, 25, 124, 'Chamla', 'Chamla', 1000), -(1541, 25, 124, 'Filippopol', 'Filippopol', 1100), -(1542, 25, 124, 'Karlovo', 'Karlovo', 1200), -(1543, 25, 124, 'Karlowo', 'Karlowo', 1300), -(1544, 25, 124, 'Peshtera', 'Peshtera', 1400), -(1545, 25, 124, 'Petrov Dol', 'Petrov Dol', 1500), -(1546, 25, 124, 'Philippopolis', 'Philippopolis', 1600), -(1547, 25, 124, 'Plovdin', 'Plovdin', 1700), -(1548, 25, 124, 'Plovdiv', 'Plovdiv', 1800), -(1549, 25, 124, 'Purvomai', 'Purvomai', 1900), -(1550, 25, 124, 'Sopot', 'Sopot', 2000), -(1551, 25, 124, 'Taran', 'Taran', 2100), -(1552, 25, 125, 'Akmekhmedkioy', 'Akmekhmedkioy', 100), -(1553, 25, 125, 'Alekowo', 'Alekowo', 200), -(1554, 25, 125, 'Dustabak', 'Dustabak', 300), -(1555, 25, 125, 'Isperich', 'Isperich', 400), -(1556, 25, 125, 'Kubrat', 'Kubrat', 500), -(1557, 25, 125, 'Rasgrad', 'Rasgrad', 600), -(1558, 25, 125, 'Razgrad', 'Razgrad', 700), -(1559, 25, 125, 'Todorovo', 'Todorovo', 800), -(1560, 25, 125, 'Zelena Morava', 'Zelena Morava', 900), -(1561, 25, 126, 'Bela', 'Bela', 100), -(1562, 25, 126, 'Bjala', 'Bjala', 200), -(1563, 25, 126, 'Byala', 'Byala', 300), -(1564, 25, 126, 'Gorna-Monastir', 'Gorna-Monastir', 400), -(1565, 25, 126, 'Ivanovo', 'Ivanovo', 500), -(1566, 25, 126, 'Iwanowo', 'Iwanowo', 600), -(1567, 25, 126, 'Rouss', 'Rouss', 700), -(1568, 25, 126, 'Ruse', 'Ruse', 800), -(1569, 25, 126, 'Russe', 'Russe', 900), -(1570, 25, 127, 'Choumn', 'Choumn', 100), -(1571, 25, 127, 'Eni Pazar', 'Eni Pazar', 200), -(1572, 25, 127, 'Gara Sheytandzhik', 'Gara Sheytandzhik', 300), -(1573, 25, 127, 'Novi Pazar', 'Novi Pazar', 400), -(1574, 25, 127, 'Preslav', 'Preslav', 500), -(1575, 25, 127, 'Schumen', 'Schumen', 600), -(1576, 25, 127, 'Shumen', 'Shumen', 700), -(1577, 25, 127, 'Sumen', 'Sumen', 800), -(1578, 25, 127, 'Veliki Preslav', 'Veliki Preslav', 900), -(1579, 25, 128, 'Acadanlar', 'Acadanlar', 100), -(1580, 25, 128, 'Dulovo', 'Dulovo', 200), -(1581, 25, 128, 'Dulowo', 'Dulowo', 300), -(1582, 25, 128, 'Glavinitsa', 'Glavinitsa', 400), -(1583, 25, 128, 'Glawinica', 'Glawinica', 500), -(1584, 25, 128, 'Silistra', 'Silistra', 600), -(1585, 25, 128, 'Turtukai', 'Turtukai', 700), -(1586, 25, 128, 'Tutrakan', 'Tutrakan', 800), -(1587, 25, 129, 'Kotel', 'Kotel', 100), -(1588, 25, 129, 'Nova Zagora', 'Nova Zagora', 200), -(1589, 25, 129, 'Sliven', 'Sliven', 300), -(1590, 25, 129, 'Sliwen', 'Sliwen', 400), -(1591, 25, 130, 'Devin', 'Devin', 100), -(1592, 25, 130, 'Dospat', 'Dospat', 200), -(1593, 25, 130, 'Kara-Bulak', 'Kara-Bulak', 300), -(1594, 25, 130, 'Karlukovo', 'Karlukovo', 400), -(1595, 25, 130, 'Ledzha', 'Ledzha', 500), -(1596, 25, 130, 'Ludzha', 'Ludzha', 600), -(1597, 25, 130, 'Nedelio', 'Nedelio', 700), -(1598, 25, 130, 'Rudozem', 'Rudozem', 800), -(1599, 25, 130, 'Smolian', 'Smolian', 900), -(1600, 25, 130, 'Smolyan', 'Smolyan', 1000), -(1601, 25, 130, 'Zlatograd', 'Zlatograd', 1100), -(1602, 25, 131, 'Ablanitsa', 'Ablanitsa', 100), -(1603, 25, 131, 'Ablaniza', 'Ablaniza', 200), -(1604, 25, 131, 'Al''ovgrob', 'Al''ovgrob', 300), -(1605, 25, 131, 'Alag''ozitsa', 'Alag''ozitsa', 400), -(1606, 25, 131, 'Aldomiro', 'Aldomiro', 500), -(1607, 25, 131, 'Alino', 'Alino', 600), -(1608, 25, 131, 'Angelov Dol', 'Angelov Dol', 700), -(1609, 25, 131, 'Arsan', 'Arsan', 800), -(1610, 25, 131, 'Arzan', 'Arzan', 900), -(1611, 25, 131, 'Avli K''oy', 'Avli K''oy', 1000), -(1612, 25, 131, 'Babino', 'Babino', 1100), -(1613, 25, 131, 'Babinoka Reka', 'Babinoka Reka', 1200), -(1614, 25, 131, 'Babitsa', 'Babitsa', 1300), -(1615, 25, 131, 'Banishor', 'Banishor', 1400), -(1616, 25, 131, 'Bankja', 'Bankja', 1500), -(1617, 25, 131, 'Bankya', 'Bankya', 1600), -(1618, 25, 131, 'Belaniza', 'Belaniza', 1700), -(1619, 25, 131, 'Beli Iskur', 'Beli Iskur', 1800), -(1620, 25, 131, 'Bistrica', 'Bistrica', 1900), -(1621, 25, 131, 'Bistritsa', 'Bistritsa', 2000), -(1622, 25, 131, 'Borovets', 'Borovets', 2100), -(1623, 25, 131, 'Borovo', 'Borovo', 2200), -(1624, 25, 131, 'Botevgrad', 'Botevgrad', 2300), -(1625, 25, 131, 'Botewgrad', 'Botewgrad', 2400), -(1626, 25, 131, 'Burdo', 'Burdo', 2500), -(1627, 25, 131, 'Druvnitsa', 'Druvnitsa', 2600), -(1628, 25, 131, 'G''ola', 'G''ola', 2700), -(1629, 25, 131, 'Gol''ovitsa', 'Gol''ovitsa', 2800), -(1630, 25, 131, 'Ihtiman', 'Ihtiman', 2900), -(1631, 25, 131, 'Ilinden', 'Ilinden', 3000), -(1632, 25, 131, 'Izvor', 'Izvor', 3100), -(1633, 25, 131, 'Lozenets', 'Lozenets', 3200), -(1634, 25, 131, 'Lozenitsa', 'Lozenitsa', 3300), -(1635, 25, 131, 'Lyulin', 'Lyulin', 3400), -(1636, 25, 131, 'Momin Prokhod', 'Momin Prokhod', 3500), -(1637, 25, 131, 'Obel', 'Obel', 3600), -(1638, 25, 131, 'Pancharevo', 'Pancharevo', 3700), -(1639, 25, 131, 'Pirin', 'Pirin', 3800), -(1640, 25, 131, 'Prawez', 'Prawez', 3900), -(1641, 25, 131, 'S''kirna Gorna', 'S''kirna Gorna', 4000), -(1642, 25, 131, 'Sabol', 'Sabol', 4100), -(1643, 25, 131, 'Samokov', 'Samokov', 4200), -(1644, 25, 131, 'Samokow', 'Samokow', 4300), -(1645, 25, 131, 'Slatina', 'Slatina', 4400), -(1646, 25, 131, 'Slatino', 'Slatino', 4500), -(1647, 25, 131, 'Slivnitsa', 'Slivnitsa', 4600), -(1648, 25, 131, 'Slivnitza', 'Slivnitza', 4700), -(1649, 25, 131, 'Sofiya', 'Sofiya', 4800), -(1650, 25, 131, 'Sopitsa', 'Sopitsa', 4900), -(1651, 25, 131, 'Sopiza', 'Sopiza', 5000), -(1652, 25, 131, 'Sopovo', 'Sopovo', 5100), -(1653, 25, 131, 'Srednogorie', 'Srednogorie', 5200), -(1654, 25, 131, 'Srubsko Selo', 'Srubsko Selo', 5300), -(1655, 25, 131, 'Stara Kresna', 'Stara Kresna', 5400), -(1656, 25, 131, 'Stargel', 'Stargel', 5500), -(1657, 25, 131, 'Stari Dol', 'Stari Dol', 5600), -(1658, 25, 131, 'Stolnik', 'Stolnik', 5700), -(1659, 25, 131, 'Strzimirovtzi', 'Strzimirovtzi', 5800), -(1660, 25, 131, 'Svoboda', 'Svoboda', 5900), -(1661, 25, 131, 'Svoge', 'Svoge', 6000), -(1662, 25, 131, 'Trap', 'Trap', 6100), -(1663, 25, 131, 'Vranya', 'Vranya', 6200), -(1664, 25, 131, 'Zilinci', 'Zilinci', 6300), -(1665, 25, 131, 'Zlatitsa', 'Zlatitsa', 6400), -(1666, 25, 131, 'Zlatusa', 'Zlatusa', 6500), -(1667, 25, 131, 'Zlatusha', 'Zlatusha', 6600), -(1668, 25, 131, 'Zvyarska Makhala', 'Zvyarska Makhala', 6700), -(1669, 25, 132, 'Chirpan', 'Chirpan', 100), -(1670, 25, 132, 'Gulubovo', 'Gulubovo', 200), -(1671, 25, 132, 'Kasanlak', 'Kasanlak', 300), -(1672, 25, 132, 'Kazanlak', 'Kazanlak', 400), -(1673, 25, 132, 'Kazanlik', 'Kazanlik', 500), -(1674, 25, 132, 'Kazanluk', 'Kazanluk', 600), -(1675, 25, 132, 'Radnevo', 'Radnevo', 700), -(1676, 25, 132, 'Radnewo', 'Radnewo', 800), -(1677, 25, 132, 'Stara Sagora', 'Stara Sagora', 900), -(1678, 25, 132, 'Stara Zagora', 'Stara Zagora', 1000), -(1679, 25, 133, 'Omurtag', 'Omurtag', 100), -(1680, 25, 133, 'Popovo', 'Popovo', 200), -(1681, 25, 133, 'Targovishte', 'Targovishte', 300), -(1682, 25, 133, 'Targowischte', 'Targowischte', 400), -(1683, 25, 133, 'Turgovishte', 'Turgovishte', 500), -(1684, 25, 133, 'Turgoviste', 'Turgoviste', 600), -(1685, 25, 134, 'Abdi K''oy', 'Abdi K''oy', 100), -(1686, 25, 134, 'Acangiz', 'Acangiz', 200), -(1687, 25, 134, 'Aidantschucha', 'Aidantschucha', 300), -(1688, 25, 134, 'Ak Baba', 'Ak Baba', 400), -(1689, 25, 134, 'Aksakovo', 'Aksakovo', 500), -(1690, 25, 134, 'Asparukhovo', 'Asparukhovo', 600), -(1691, 25, 134, 'Balik', 'Balik', 700), -(1692, 25, 134, 'Bartsi', 'Bartsi', 800), -(1693, 25, 134, 'Bogdali', 'Bogdali', 900), -(1694, 25, 134, 'Boyana', 'Boyana', 1000), -(1695, 25, 134, 'Cherkovna', 'Cherkovna', 1100), -(1696, 25, 134, 'Dobrotich', 'Dobrotich', 1200), -(1697, 25, 134, 'Konstantinovo', 'Konstantinovo', 1300), -(1698, 25, 134, 'Kranevo', 'Kranevo', 1400), -(1699, 25, 134, 'Povelyanovo', 'Povelyanovo', 1500), -(1700, 25, 134, 'Provadia', 'Provadia', 1600), -(1701, 25, 134, 'Provadija', 'Provadija', 1700), -(1702, 25, 134, 'Provadiya', 'Provadiya', 1800), -(1703, 25, 134, 'Varna', 'Varna', 1900), -(1704, 25, 134, 'Vladislavovo', 'Vladislavovo', 2000), -(1705, 25, 134, 'Warna', 'Warna', 2100), -(1706, 25, 134, 'Yasu-Tepe', 'Yasu-Tepe', 2200), -(1707, 25, 134, 'Zvezditsa', 'Zvezditsa', 2300), -(1708, 25, 134, 'Zvunets', 'Zvunets', 2400), -(1709, 25, 135, 'Elena', 'Elena', 100), -(1710, 25, 135, 'Gorna Orehovica', 'Gorna Orehovica', 200), -(1711, 25, 135, 'Gorna Oriahovica', 'Gorna Oriahovica', 300), -(1712, 25, 135, 'Ljaskovec', 'Ljaskovec', 400), -(1713, 25, 135, 'Pavlikeni', 'Pavlikeni', 500), -(1714, 25, 135, 'Polsk Trumbesh', 'Polsk Trumbesh', 600), -(1715, 25, 135, 'Polski Trambech', 'Polski Trambech', 700), -(1716, 25, 135, 'Polski Trambesh', 'Polski Trambesh', 800), -(1717, 25, 135, 'Svishtov', 'Svishtov', 900), -(1718, 25, 135, 'Svistov', 'Svistov', 1000), -(1719, 25, 135, 'Tarnovo', 'Tarnovo', 1100), -(1720, 25, 135, 'Tarnowo', 'Tarnowo', 1200), -(1721, 25, 135, 'Turnovo', 'Turnovo', 1300), -(1722, 25, 135, 'Veliko Turnovo', 'Veliko Turnovo', 1400), -(1723, 25, 136, 'Belogradchik', 'Belogradchik', 100), -(1724, 25, 136, 'Bojniza', 'Bojniza', 200), -(1725, 25, 136, 'Borovica', 'Borovica', 300), -(1726, 25, 136, 'Vidin', 'Vidin', 400), -(1727, 25, 137, 'Bela Slatina', 'Bela Slatina', 100), -(1728, 25, 137, 'Borovan', 'Borovan', 200), -(1729, 25, 137, 'Byala Slatina', 'Byala Slatina', 300), -(1730, 25, 137, 'Koslodui', 'Koslodui', 400), -(1731, 25, 137, 'Kozlodui', 'Kozlodui', 500), -(1732, 25, 137, 'Kozloduy', 'Kozloduy', 600), -(1733, 25, 137, 'Krivdol', 'Krivdol', 700), -(1734, 25, 137, 'Krivodol', 'Krivodol', 800), -(1735, 25, 137, 'Mezdra', 'Mezdra', 900), -(1736, 25, 137, 'Vraca', 'Vraca', 1000), -(1737, 25, 137, 'Vratca', 'Vratca', 1100), -(1738, 25, 137, 'Vratsa', 'Vratsa', 1200), -(1739, 25, 137, 'Vrattsa', 'Vrattsa', 1300), -(1740, 25, 137, 'Vratza', 'Vratza', 1400), -(1741, 25, 138, 'Jambol', 'Jambol', 100), -(1742, 25, 138, 'Yambol', 'Yambol', 200), -(1743, 26, 139, 'Alcautal', 'Alcautal', 100), -(1744, 26, 139, 'Algodonal', 'Algodonal', 200), -(1745, 26, 139, 'Allangua', 'Allangua', 300), -(1746, 26, 139, 'Amachuma', 'Amachuma', 400), -(1747, 26, 139, 'Ciudad Sucre', 'Ciudad Sucre', 500), -(1748, 26, 140, 'Abra', 'Abra', 100), -(1749, 26, 140, 'Andenpampa', 'Andenpampa', 200), -(1750, 26, 140, 'Ciudad Cochabamba', 'Ciudad Cochabamba', 300), -(1751, 26, 140, 'Cochabamba', 'Cochabamba', 400), -(1752, 26, 140, 'Quillacollo', 'Quillacollo', 500), -(1753, 26, 140, 'Sipe Sipe', 'Sipe Sipe', 600), -(1754, 26, 141, 'Aparejos', 'Aparejos', 100), -(1755, 26, 141, 'Asociega', 'Asociega', 200), -(1756, 26, 141, 'Libertad', 'Libertad', 300), -(1757, 26, 142, 'Abara', 'Abara', 100), -(1758, 26, 142, 'Achacachi', 'Achacachi', 200), -(1759, 26, 142, 'Achicuiri', 'Achicuiri', 300), -(1760, 26, 142, 'Achila', 'Achila', 400), -(1761, 26, 142, 'Achumani', 'Achumani', 500), -(1762, 26, 142, 'Caranavi', 'Caranavi', 600), -(1763, 26, 142, 'Ciudad La Paz', 'Ciudad La Paz', 700), -(1764, 26, 142, 'La Paz', 'La Paz', 800), -(1765, 26, 142, 'Pipini', 'Pipini', 900), -(1766, 26, 142, 'Puerto Rico', 'Puerto Rico', 1000), -(1767, 26, 143, 'Yumao', 'Yumao', 100), -(1768, 26, 144, 'Oruro', 'Oruro', 100), -(1769, 26, 145, 'Potos', 'Potos', 100), -(1770, 26, 146, 'Agua Caliente', 'Agua Caliente', 100), -(1771, 26, 146, 'Andrs', 'Andrs', 200), -(1772, 26, 146, 'Arenales', 'Arenales', 300), -(1773, 26, 146, 'Asabi', 'Asabi', 400), -(1774, 26, 146, 'Bolvar', 'Bolvar', 500), -(1775, 26, 146, 'Ciudad Santa Cruz', 'Ciudad Santa Cruz', 600), -(1776, 26, 146, 'Santa Cruz de la Sierra', 'Santa Cruz de la Sierra', 700), -(1777, 27, 147, 'Abdakovici', 'Abdakovici', 100), -(1778, 27, 147, 'Alipasino Polje', 'Alipasino Polje', 200), -(1779, 27, 147, 'Arapi', 'Arapi', 300), -(1780, 27, 147, 'Jelah', 'Jelah', 400), -(1781, 27, 147, 'Mandiri', 'Mandiri', 500), -(1782, 27, 147, 'Mostar', 'Mostar', 600), -(1783, 27, 147, 'Tuzlanska', 'Tuzlanska', 700), -(1784, 27, 147, 'Visoko', 'Visoko', 800), -(1785, 27, 147, 'Vitez', 'Vitez', 900), -(1786, 27, 147, 'Zenica', 'Zenica', 1000), -(1787, 27, 148, 'Alici', 'Alici', 100), -(1788, 27, 148, 'Begovac', 'Begovac', 200), -(1789, 27, 148, 'Dobrinja', 'Dobrinja', 300), -(1790, 27, 148, 'Kraljevo Polje', 'Kraljevo Polje', 400), -(1791, 27, 148, 'Litva', 'Litva', 500), -(1792, 27, 148, 'Sarajevo', 'Sarajevo', 600), -(1793, 27, 148, 'Tuzla', 'Tuzla', 700), -(1794, 27, 149, 'Alici', 'Alici', 100), -(1795, 27, 149, 'Banialuca', 'Banialuca', 200), -(1796, 27, 149, 'Banja Luka', 'Banja Luka', 300), -(1797, 27, 149, 'Bijeljani', 'Bijeljani', 400), -(1798, 27, 149, 'Bijeljina', 'Bijeljina', 500), -(1799, 27, 149, 'Doboj', 'Doboj', 600), -(1800, 27, 149, 'Pristina', 'Pristina', 700), -(1801, 27, 149, 'Srebrnica', 'Srebrnica', 800), -(1802, 27, 149, 'Trebinje', 'Trebinje', 900), -(1803, 28, 150, 'Габороне', 'Gaborone', 100), -(1804, 28, 150, 'Серове', 'Serove', 200), -(1805, 28, 150, 'Шакаве', 'Shakave', 300), -(1806, 29, 151, 'Alto Alegre', 'Alto Alegre', 100), -(1807, 29, 151, 'Athenas', 'Athenas', 200), -(1808, 29, 151, 'Rio Branco', 'Rio Branco', 300), -(1809, 29, 152, 'Agreste', 'Agreste', 100), -(1810, 29, 152, 'Macei', 'Macei', 200), -(1811, 29, 153, 'Abacate', 'Abacate', 100), -(1812, 29, 153, 'Amap', 'Amap', 200), -(1813, 29, 153, 'Macap', 'Macap', 300), -(1814, 29, 154, 'Abufari', 'Abufari', 100), -(1815, 29, 154, 'Aru', 'Aru', 200), -(1816, 29, 154, 'Axioma', 'Axioma', 300), -(1817, 29, 155, 'Abara', 'Abara', 100), -(1818, 29, 155, 'Acari', 'Acari', 200), -(1819, 29, 155, 'Barra da Estiva', 'Barra da Estiva', 300), -(1820, 29, 155, 'Lagoa do Boi', 'Lagoa do Boi', 400), -(1821, 29, 155, 'Salvador', 'Salvador', 500), -(1822, 29, 156, 'Acopiara', 'Acopiara', 100), -(1823, 29, 157, 'Boa Vista', 'Boa Vista', 100), -(1824, 29, 157, 'Braslia', 'Braslia', 200), -(1825, 29, 158, 'Vitria', 'Vitria', 100), -(1826, 29, 159, 'Anpolis', 'Anpolis', 100), -(1827, 29, 159, 'Bela Vista de Gois', 'Bela Vista de Gois', 200), -(1828, 29, 159, 'Goinia', 'Goinia', 300), -(1829, 29, 160, 'So Luiz de Maranho', 'So Luiz de Maranho', 100), -(1830, 29, 161, 'Abreus', 'Abreus', 100), -(1831, 29, 161, 'Bello Horizonte', 'Bello Horizonte', 200), -(1832, 29, 161, 'Belo Horizonte', 'Belo Horizonte', 300), -(1833, 29, 161, 'Juiz de Fora', 'Juiz de Fora', 400), -(1834, 29, 161, 'Montes Claros', 'Montes Claros', 500), -(1835, 29, 162, 'Aba', 'Aba', 100), -(1836, 29, 162, 'Alaga Nova', 'Alaga Nova', 200), -(1837, 29, 163, 'Altaneira', 'Altaneira', 100), -(1838, 29, 163, 'Curitiba', 'Curitiba', 200), -(1839, 29, 163, 'Curytiba', 'Curytiba', 300), -(1840, 29, 163, 'Maring', 'Maring', 400), -(1841, 29, 164, 'Abadia', 'Abadia', 100), -(1842, 29, 164, 'Afonso', 'Afonso', 200), -(1843, 29, 164, 'Agua Santa', 'Agua Santa', 300), -(1844, 29, 164, 'Aldeia do Cabo', 'Aldeia do Cabo', 400), -(1845, 29, 164, 'Angola', 'Angola', 500), -(1846, 29, 164, 'Angra', 'Angra', 600), -(1847, 29, 164, 'Antnio Mariano', 'Antnio Mariano', 700), -(1848, 29, 164, 'Barcelos', 'Barcelos', 800), -(1849, 29, 164, 'Barreira', 'Barreira', 900), -(1850, 29, 164, 'Boa Vida', 'Boa Vida', 1000), -(1851, 29, 164, 'Botafogo', 'Botafogo', 1100), -(1852, 29, 164, 'Bueno de Andrade', 'Bueno de Andrade', 1200), -(1853, 29, 164, 'Bzios', 'Bzios', 1300), -(1854, 29, 164, 'Cambota', 'Cambota', 1400), -(1855, 29, 164, 'Copacabana', 'Copacabana', 1500), -(1856, 29, 164, 'Costa', 'Costa', 1600), -(1857, 29, 164, 'gua Ferro', 'gua Ferro', 1700), -(1858, 29, 164, 'Ipanema', 'Ipanema', 1800), -(1859, 29, 164, 'Italva', 'Italva', 1900), -(1860, 29, 164, 'Margarida', 'Margarida', 2000), -(1861, 29, 164, 'Nictheroy', 'Nictheroy', 2100), -(1862, 29, 164, 'Paraty', 'Paraty', 2200), -(1863, 29, 164, 'Porto Novo', 'Porto Novo', 2300), -(1864, 29, 164, 'Ramos', 'Ramos', 2400), -(1865, 29, 164, 'Ribeiro da Divisa', 'Ribeiro da Divisa', 2500), -(1866, 29, 164, 'Rio', 'Rio', 2600), -(1867, 29, 164, 'Rio de Janeiro', 'Rio de Janeiro', 2700), -(1868, 29, 164, 'Santa Brbara', 'Santa Brbara', 2800), -(1869, 29, 164, 'Santa Cruz', 'Santa Cruz', 2900), -(1870, 29, 164, 'So Jos', 'So Jos', 3000), -(1871, 29, 165, 'Alemo', 'Alemo', 100), -(1872, 29, 165, 'Lagoa de Cima', 'Lagoa de Cima', 200), -(1873, 29, 166, 'guas Brancas', 'guas Brancas', 100), -(1874, 29, 166, 'Porto Alegre', 'Porto Alegre', 200), -(1875, 29, 166, 'Santa Barbara', 'Santa Barbara', 300), -(1876, 29, 166, 'Viamo', 'Viamo', 400), -(1877, 29, 167, 'Bananeira', 'Bananeira', 100), -(1878, 29, 168, 'Barro', 'Barro', 100), -(1879, 29, 169, 'Aguti', 'Aguti', 100), -(1880, 29, 169, 'Albertina', 'Albertina', 200), -(1881, 29, 169, 'Aleixo', 'Aleixo', 300), -(1882, 29, 169, 'Alto Perimb', 'Alto Perimb', 400), -(1883, 29, 169, 'Balnerio de Cambori', 'Balnerio de Cambori', 500), -(1884, 29, 169, 'Bonito', 'Bonito', 600), -(1885, 29, 169, 'Florianpolis', 'Florianpolis', 700), -(1886, 29, 169, 'guas Brancas', 'guas Brancas', 800), -(1887, 29, 169, 'Marema', 'Marema', 900), -(1888, 29, 170, 'Aa', 'Aa', 100), -(1889, 29, 170, 'Arab', 'Arab', 200), -(1890, 29, 170, 'Arabela', 'Arabela', 300), -(1891, 29, 170, 'Atibaia', 'Atibaia', 400), -(1892, 29, 170, 'Benfica', 'Benfica', 500), -(1893, 29, 170, 'Campinas', 'Campinas', 600), -(1894, 29, 170, 'Campos do Jordo', 'Campos do Jordo', 700), -(1895, 29, 170, 'Caraguatatuba', 'Caraguatatuba', 800), -(1896, 29, 170, 'guas da Prata', 'guas da Prata', 900), -(1897, 29, 170, 'San Paulo', 'San Paulo', 1000), -(1898, 29, 170, 'Santos', 'Santos', 1100), -(1899, 29, 170, 'So Jos dos Campos', 'So Jos dos Campos', 1200), -(1900, 29, 170, 'So Paulo', 'So Paulo', 1300), -(1901, 29, 170, 'Taubat', 'Taubat', 1400), -(1902, 29, 170, 'Yep', 'Yep', 1500), -(1903, 29, 171, 'Aracaju', 'Aracaju', 100), -(1904, 29, 171, 'Baixada do Burgo', 'Baixada do Burgo', 200), -(1905, 30, 172, 'Род-Таун', 'Род-Таун', 100), -(1906, 31, 173, 'Бандар-Сери-Бегаван', 'Bandar-Seri-Begavan', 100), -(1907, 32, 174, 'Бобо Диуласо', 'Bobo Liulaso', 100), -(1908, 32, 174, 'Уагадугу', 'Uagadugu', 200), -(1909, 33, 175, 'Бужумбура', 'Buzhumbura', 100), -(1910, 34, 176, 'Тхимпху', 'Thimphu', 100), -(1911, 35, 177, 'Мата-Уту', 'Mata-Utu', 100), -(1912, 36, 178, 'Нумеа', 'Numea', 100), -(1913, 36, 178, 'Порт-Вила', 'Port-Vila', 200), -(1914, 37, 179, 'Guernsey', 'Guernsey', 100), -(1915, 37, 179, 'Jersey', 'Jersey', 200), -(1916, 37, 180, 'Abbots Langley', 'Abbots Langley', 100), -(1917, 37, 180, 'Arlesey', 'Arlesey', 200), -(1918, 37, 180, 'Barnet', 'Barnet', 300), -(1919, 37, 180, 'Basildon', 'Basildon', 400), -(1920, 37, 180, 'Beccles', 'Beccles', 500), -(1921, 37, 180, 'Bedford', 'Bedford', 600), -(1922, 37, 180, 'Biggleswade', 'Biggleswade', 700), -(1923, 37, 180, 'Billericay', 'Billericay', 800), -(1924, 37, 180, 'Braintree', 'Braintree', 900), -(1925, 37, 180, 'Brandon', 'Brandon', 1000), -(1926, 37, 180, 'Brentwood', 'Brentwood', 1100), -(1927, 37, 180, 'Bungay', 'Bungay', 1200), -(1928, 37, 180, 'Buntingford', 'Buntingford', 1300), -(1929, 37, 180, 'Bures', 'Bures', 1400), -(1930, 37, 180, 'Bury St Edmunds', 'Bury St Edmunds', 1500), -(1931, 37, 180, 'Cambridge', 'Cambridge', 1600), -(1932, 37, 180, 'Canvey Island', 'Canvey Island', 1700), -(1933, 37, 180, 'Chelmsford', 'Chelmsford', 1800), -(1934, 37, 180, 'Clacton-On-Sea', 'Clacton-On-Sea', 1900), -(1935, 37, 180, 'Colchester', 'Colchester', 2000), -(1936, 37, 180, 'Diss', 'Diss', 2100), -(1937, 37, 180, 'Downham Market', 'Downham Market', 2200), -(1938, 37, 180, 'Dunmow', 'Dunmow', 2300), -(1939, 37, 180, 'Ely', 'Ely', 2400), -(1940, 37, 180, 'Felixstowe', 'Felixstowe', 2500), -(1941, 37, 180, 'Great Yarmouth', 'Great Yarmouth', 2600), -(1942, 37, 180, 'Harlow', 'Harlow', 2700), -(1943, 37, 180, 'Hemel Hempstead', 'Hemel Hempstead', 2800), -(1944, 37, 180, 'Huntingdon', 'Huntingdon', 2900), -(1945, 37, 180, 'Ipswich', 'Ipswich', 3000), -(1946, 37, 180, 'King''s Lynn', 'King''s Lynn', 3100), -(1947, 37, 180, 'Leiston', 'Leiston', 3200), -(1948, 37, 180, 'Lowestoft', 'Lowestoft', 3300), -(1949, 37, 180, 'Luton', 'Luton', 3400), -(1950, 37, 180, 'March', 'March', 3500), -(1951, 37, 180, 'Milton Keynes', 'Milton Keynes', 3600), -(1952, 37, 180, 'Newmarket', 'Newmarket', 3700), -(1953, 37, 180, 'Northwood', 'Northwood', 3800), -(1954, 37, 180, 'Norwich', 'Norwich', 3900), -(1955, 37, 180, 'Peterborough', 'Peterborough', 4000), -(1956, 37, 180, 'Radlett', 'Radlett', 4100), -(1957, 37, 180, 'Romford', 'Romford', 4200), -(1958, 37, 180, 'Southend-On-Sea', 'Southend-On-Sea', 4300), -(1959, 37, 180, 'St Albans', 'St Albans', 4400), -(1960, 37, 180, 'Stevenage', 'Stevenage', 4500), -(1961, 37, 180, 'Sudbury', 'Sudbury', 4600), -(1962, 37, 180, 'Thetford', 'Thetford', 4700), -(1963, 37, 180, 'Upminster', 'Upminster', 4800), -(1964, 37, 180, 'Watford', 'Watford', 4900), -(1965, 37, 180, 'Westcliff-On-Sea', 'Westcliff-On-Sea', 5000), -(1966, 37, 180, 'Wisbech', 'Wisbech', 5100), -(1967, 37, 180, 'Witham', 'Witham', 5200), -(1968, 37, 181, 'Alford', 'Alford', 100), -(1969, 37, 181, 'Alfreton', 'Alfreton', 200), -(1970, 37, 181, 'Ashbourne', 'Ashbourne', 300), -(1971, 37, 181, 'Banbury', 'Banbury', 400), -(1972, 37, 181, 'Barton-Upon-Humber', 'Barton-Upon-Humber', 500), -(1973, 37, 181, 'Boston', 'Boston', 600), -(1974, 37, 181, 'Burton-On-Trent', 'Burton-On-Trent', 700), -(1975, 37, 181, 'Chesterfield', 'Chesterfield', 800), -(1976, 37, 181, 'Corby', 'Corby', 900), -(1977, 37, 181, 'Daventry', 'Daventry', 1000), -(1978, 37, 181, 'Derby', 'Derby', 1100), -(1979, 37, 181, 'Doncaster', 'Doncaster', 1200), -(1980, 37, 181, 'Gainsborough', 'Gainsborough', 1300), -(1981, 37, 181, 'Glossop', 'Glossop', 1400), -(1982, 37, 181, 'Grantham', 'Grantham', 1500), -(1983, 37, 181, 'Grimsby', 'Grimsby', 1600), -(1984, 37, 181, 'Kettering', 'Kettering', 1700), -(1985, 37, 181, 'Leicester', 'Leicester', 1800), -(1986, 37, 181, 'Lincoln', 'Lincoln', 1900), -(1987, 37, 181, 'Loughborough', 'Loughborough', 2000), -(1988, 37, 181, 'Mansfield', 'Mansfield', 2100), -(1989, 37, 181, 'Milton Keynes', 'Milton Keynes', 2200), -(1990, 37, 181, 'Newark', 'Newark', 2300), -(1991, 37, 181, 'Northampton', 'Northampton', 2400), -(1992, 37, 181, 'Nottingham', 'Nottingham', 2500), -(1993, 37, 181, 'Nuneaton', 'Nuneaton', 2600), -(1994, 37, 181, 'Peterborough', 'Peterborough', 2700), -(1995, 37, 181, 'Rushden', 'Rushden', 2800), -(1996, 37, 181, 'Scunthorpe', 'Scunthorpe', 2900), -(1997, 37, 181, 'Sheffield', 'Sheffield', 3000), -(1998, 37, 181, 'Sleaford', 'Sleaford', 3100), -(1999, 37, 181, 'Spalding', 'Spalding', 3200), -(2000, 37, 181, 'Stamford', 'Stamford', 3300), -(2001, 37, 181, 'Wellingborough', 'Wellingborough', 3400), -(2002, 37, 182, 'Barking', 'Barking', 100), -(2003, 37, 182, 'Barnet', 'Barnet', 200), -(2004, 37, 182, 'Beckenham', 'Beckenham', 300), -(2005, 37, 182, 'Bexley', 'Bexley', 400), -(2006, 37, 182, 'Bexleyheath', 'Bexleyheath', 500), -(2007, 37, 182, 'Brentford', 'Brentford', 600), -(2008, 37, 182, 'Bromley', 'Bromley', 700), -(2009, 37, 182, 'Carshalton', 'Carshalton', 800), -(2010, 37, 182, 'Chessington', 'Chessington', 900), -(2011, 37, 182, 'Chigwell', 'Chigwell', 1000), -(2012, 37, 182, 'Coulsdon', 'Coulsdon', 1100), -(2013, 37, 182, 'Croydon', 'Croydon', 1200), -(2014, 37, 182, 'Dagenham', 'Dagenham', 1300), -(2015, 37, 182, 'Dartford', 'Dartford', 1400), -(2016, 37, 182, 'East Molesey', 'East Molesey', 1500), -(2017, 37, 182, 'Edgware', 'Edgware', 1600), -(2018, 37, 182, 'Enfield', 'Enfield', 1700), -(2019, 37, 182, 'Feltham', 'Feltham', 1800), -(2020, 37, 182, 'Greenford', 'Greenford', 1900), -(2021, 37, 182, 'Hampton', 'Hampton', 2000), -(2022, 37, 182, 'Harrow', 'Harrow', 2100), -(2023, 37, 182, 'Hayes', 'Hayes', 2200), -(2024, 37, 182, 'Hornchurch', 'Hornchurch', 2300), -(2025, 37, 182, 'Hounslow', 'Hounslow', 2400), -(2026, 37, 182, 'Ilford', 'Ilford', 2500), -(2027, 37, 182, 'Isleworth', 'Isleworth', 2600), -(2028, 37, 182, 'Kingston Upon Thames', 'Kingston Upon Thames', 2700), -(2029, 37, 182, 'London', 'London', 2800), -(2030, 37, 182, 'Northolt', 'Northolt', 2900), -(2031, 37, 182, 'Northwood', 'Northwood', 3000), -(2032, 37, 182, 'Orpington', 'Orpington', 3100), -(2033, 37, 182, 'Pinner', 'Pinner', 3200), -(2034, 37, 182, 'Purley', 'Purley', 3300), -(2035, 37, 182, 'Richmond', 'Richmond', 3400), -(2036, 37, 182, 'Romford', 'Romford', 3500), -(2037, 37, 182, 'South Croydon', 'South Croydon', 3600), -(2038, 37, 182, 'Southall', 'Southall', 3700), -(2039, 37, 182, 'Stanmore', 'Stanmore', 3800), -(2040, 37, 182, 'Surbiton', 'Surbiton', 3900), -(2041, 37, 182, 'Sutton', 'Sutton', 4000), -(2042, 37, 182, 'Twickenham', 'Twickenham', 4100), -(2043, 37, 182, 'Uxbridge', 'Uxbridge', 4200), -(2044, 37, 182, 'Welling', 'Welling', 4300), -(2045, 37, 182, 'Wembley', 'Wembley', 4400), -(2046, 37, 182, 'West Wickham', 'West Wickham', 4500), -(2047, 37, 182, 'Westerham', 'Westerham', 4600), -(2048, 37, 182, 'Woodford Green', 'Woodford Green', 4700), -(2049, 37, 182, 'Worcester Park', 'Worcester Park', 4800), -(2050, 37, 183, 'Belford', 'Belford', 100), -(2051, 37, 183, 'Berwick-Upon-Tweed', 'Berwick-Upon-Tweed', 200), -(2052, 37, 183, 'Billingham', 'Billingham', 300), -(2053, 37, 183, 'Blyth', 'Blyth', 400), -(2054, 37, 183, 'Corbridge', 'Corbridge', 500), -(2055, 37, 183, 'Darlington', 'Darlington', 600), -(2056, 37, 183, 'Durham', 'Durham', 700), -(2057, 37, 183, 'East Boldon', 'East Boldon', 800), -(2058, 37, 183, 'Gateshead', 'Gateshead', 900), -(2059, 37, 183, 'Haltwhistle', 'Haltwhistle', 1000), -(2060, 37, 183, 'Hartlepool', 'Hartlepool', 1100), -(2061, 37, 183, 'Houghton Le Spring', 'Houghton Le Spring', 1200), -(2062, 37, 183, 'Middlesbrough', 'Middlesbrough', 1300), -(2063, 37, 183, 'Newcastle Upon Tyne', 'Newcastle Upon Tyne', 1400), -(2064, 37, 183, 'Riding Mill', 'Riding Mill', 1500), -(2065, 37, 183, 'South Shields', 'South Shields', 1600), -(2066, 37, 183, 'Stockton-On-Tees', 'Stockton-On-Tees', 1700), -(2067, 37, 183, 'Sunderland', 'Sunderland', 1800), -(2068, 37, 183, 'Washington', 'Washington', 1900), -(2069, 37, 183, 'Yarm', 'Yarm', 2000), -(2070, 37, 184, 'Accrington', 'Accrington', 100), -(2071, 37, 184, 'Bacup', 'Bacup', 200), -(2072, 37, 184, 'Blackburn', 'Blackburn', 300), -(2073, 37, 184, 'Blackpool', 'Blackpool', 400), -(2074, 37, 184, 'Bolton', 'Bolton', 500), -(2075, 37, 184, 'Burnley', 'Burnley', 600), -(2076, 37, 184, 'Bury', 'Bury', 700), -(2077, 37, 184, 'Carlisle', 'Carlisle', 800), -(2078, 37, 184, 'Chester', 'Chester', 900), -(2079, 37, 184, 'Chorley', 'Chorley', 1000), -(2080, 37, 184, 'Crewe', 'Crewe', 1100), -(2081, 37, 184, 'Kendal', 'Kendal', 1200), -(2082, 37, 184, 'Lancaster', 'Lancaster', 1300), -(2083, 37, 184, 'Liverpool', 'Liverpool', 1400), -(2084, 37, 184, 'Manchester', 'Manchester', 1500), -(2085, 37, 184, 'Morecambe', 'Morecambe', 1600), -(2086, 37, 184, 'Nelson', 'Nelson', 1700), -(2087, 37, 184, 'Northwich', 'Northwich', 1800), -(2088, 37, 184, 'Preston', 'Preston', 1900), -(2089, 37, 184, 'Runcorn', 'Runcorn', 2000), -(2090, 37, 184, 'Sale', 'Sale', 2100), -(2091, 37, 184, 'Skelmersdale', 'Skelmersdale', 2200), -(2092, 37, 184, 'Southport', 'Southport', 2300), -(2093, 37, 184, 'St Helens', 'St Helens', 2400), -(2094, 37, 184, 'Stockport', 'Stockport', 2500), -(2095, 37, 184, 'Stoke-On-Trent', 'Stoke-On-Trent', 2600), -(2096, 37, 184, 'Wallasey', 'Wallasey', 2700), -(2097, 37, 184, 'Warrington', 'Warrington', 2800), -(2098, 37, 184, 'Whitehaven', 'Whitehaven', 2900), -(2099, 37, 184, 'Wigan', 'Wigan', 3000), -(2100, 37, 185, 'Abingdon', 'Abingdon', 100), -(2101, 37, 185, 'Alton', 'Alton', 200), -(2102, 37, 185, 'Amersham', 'Amersham', 300), -(2103, 37, 185, 'Andover', 'Andover', 400), -(2104, 37, 185, 'Ascot', 'Ascot', 500), -(2105, 37, 185, 'Ashford', 'Ashford', 600), -(2106, 37, 185, 'Aylesbury', 'Aylesbury', 700), -(2107, 37, 185, 'Banbury', 'Banbury', 800), -(2108, 37, 185, 'Basingstoke', 'Basingstoke', 900), -(2109, 37, 185, 'Bexhill-On-Sea', 'Bexhill-On-Sea', 1000), -(2110, 37, 185, 'Bicester', 'Bicester', 1100), -(2111, 37, 185, 'Bognor Regis', 'Bognor Regis', 1200), -(2112, 37, 185, 'Bournemouth', 'Bournemouth', 1300), -(2113, 37, 185, 'Bracknell', 'Bracknell', 1400), -(2114, 37, 185, 'Brighton', 'Brighton', 1500), -(2115, 37, 185, 'Broadstairs', 'Broadstairs', 1600), -(2116, 37, 185, 'Burford', 'Burford', 1700), -(2117, 37, 185, 'Camberley', 'Camberley', 1800), -(2118, 37, 185, 'Canterbury', 'Canterbury', 1900), -(2119, 37, 185, 'Chatham', 'Chatham', 2000), -(2120, 37, 185, 'Chichester', 'Chichester', 2100), -(2121, 37, 185, 'Chipping Norton', 'Chipping Norton', 2200), -(2122, 37, 185, 'Cobham', 'Cobham', 2300), -(2123, 37, 185, 'Crawley', 'Crawley', 2400), -(2124, 37, 185, 'Dartford', 'Dartford', 2500), -(2125, 37, 185, 'Dorking', 'Dorking', 2600), -(2126, 37, 185, 'Dover', 'Dover', 2700), -(2127, 37, 185, 'East Grinstead', 'East Grinstead', 2800), -(2128, 37, 185, 'Eastbourne', 'Eastbourne', 2900), -(2129, 37, 185, 'Farnham', 'Farnham', 3000), -(2130, 37, 185, 'Faversham', 'Faversham', 3100), -(2131, 37, 185, 'Fleet', 'Fleet', 3200), -(2132, 37, 185, 'Folkestone', 'Folkestone', 3300), -(2133, 37, 185, 'Gillingham', 'Gillingham', 3400), -(2134, 37, 185, 'Godstone', 'Godstone', 3500), -(2135, 37, 185, 'Gosport', 'Gosport', 3600), -(2136, 37, 185, 'Gravesend', 'Gravesend', 3700), -(2137, 37, 185, 'Guildford', 'Guildford', 3800), -(2138, 37, 185, 'Hastings', 'Hastings', 3900), -(2139, 37, 185, 'Henley-On-Thames', 'Henley-On-Thames', 4000), -(2140, 37, 185, 'Hook', 'Hook', 4100), -(2141, 37, 185, 'Horley', 'Horley', 4200), -(2142, 37, 185, 'Horsham', 'Horsham', 4300), -(2143, 37, 185, 'Hungerford', 'Hungerford', 4400), -(2144, 37, 185, 'Littlehampton', 'Littlehampton', 4500), -(2145, 37, 185, 'Lymington', 'Lymington', 4600), -(2146, 37, 185, 'Maidenhead', 'Maidenhead', 4700), -(2147, 37, 185, 'Maidstone', 'Maidstone', 4800), -(2148, 37, 185, 'Margate', 'Margate', 4900), -(2149, 37, 185, 'Marlow', 'Marlow', 5000), -(2150, 37, 185, 'Milton Keynes', 'Milton Keynes', 5100), -(2151, 37, 185, 'Newbury', 'Newbury', 5200), -(2152, 37, 185, 'Newport', 'Newport', 5300), -(2153, 37, 185, 'Oxford', 'Oxford', 5400), -(2154, 37, 185, 'Portsmouth', 'Portsmouth', 5500), -(2155, 37, 185, 'Reading', 'Reading', 5600), -(2156, 37, 185, 'Redhill', 'Redhill', 5700), -(2157, 37, 185, 'Rochester', 'Rochester', 5800), -(2158, 37, 185, 'Rye', 'Rye', 5900), -(2159, 37, 185, 'Sevenoaks', 'Sevenoaks', 6000), -(2160, 37, 185, 'Shanklin', 'Shanklin', 6100), -(2161, 37, 185, 'Sheerness', 'Sheerness', 6200), -(2162, 37, 185, 'Shoreham-By-Sea', 'Shoreham-By-Sea', 6300), -(2163, 37, 185, 'Sittingbourne', 'Sittingbourne', 6400), -(2164, 37, 185, 'Slough', 'Slough', 6500), -(2165, 37, 185, 'Southampton', 'Southampton', 6600), -(2166, 37, 185, 'Southsea', 'Southsea', 6700), -(2167, 37, 185, 'Staines', 'Staines', 6800), -(2168, 37, 185, 'Sutton', 'Sutton', 6900), -(2169, 37, 185, 'Swanley', 'Swanley', 7000), -(2170, 37, 185, 'Swindon', 'Swindon', 7100), -(2171, 37, 185, 'Tonbridge', 'Tonbridge', 7200), -(2172, 37, 185, 'Tunbridge Wells', 'Tunbridge Wells', 7300), -(2173, 37, 185, 'Walton-On-Thames', 'Walton-On-Thames', 7400), -(2174, 37, 185, 'West Malling', 'West Malling', 7500), -(2175, 37, 185, 'Weybridge', 'Weybridge', 7600), -(2176, 37, 185, 'Winchester', 'Winchester', 7700), -(2177, 37, 185, 'Windsor', 'Windsor', 7800), -(2178, 37, 185, 'Woking', 'Woking', 7900), -(2179, 37, 185, 'Wokingham', 'Wokingham', 8000), -(2180, 37, 185, 'Worthing', 'Worthing', 8100), -(2181, 37, 185, 'Yarmouth', 'Yarmouth', 8200), -(2182, 37, 186, 'Andover', 'Andover', 100), -(2183, 37, 186, 'Barnstaple', 'Barnstaple', 200), -(2184, 37, 186, 'Bath', 'Bath', 300), -(2185, 37, 186, 'Bideford', 'Bideford', 400), -(2186, 37, 186, 'Bodmin', 'Bodmin', 500), -(2187, 37, 186, 'Bradford-On-Avon', 'Bradford-On-Avon', 600), -(2188, 37, 186, 'Bridgwater', 'Bridgwater', 700), -(2189, 37, 186, 'Bristol', 'Bristol', 800), -(2190, 37, 186, 'Brixham', 'Brixham', 900), -(2191, 37, 186, 'Callington', 'Callington', 1000); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(2192, 37, 186, 'Camborne', 'Camborne', 1100), -(2193, 37, 186, 'Cheltenham', 'Cheltenham', 1200), -(2194, 37, 186, 'Chippenham', 'Chippenham', 1300), -(2195, 37, 186, 'Clevedon', 'Clevedon', 1400), -(2196, 37, 186, 'Crewkerne', 'Crewkerne', 1500), -(2197, 37, 186, 'Dorchester', 'Dorchester', 1600), -(2198, 37, 186, 'Exeter', 'Exeter', 1700), -(2199, 37, 186, 'Exmouth', 'Exmouth', 1800), -(2200, 37, 186, 'Falmouth', 'Falmouth', 1900), -(2201, 37, 186, 'Gloucester', 'Gloucester', 2000), -(2202, 37, 186, 'Helston', 'Helston', 2100), -(2203, 37, 186, 'Lynmouth', 'Lynmouth', 2200), -(2204, 37, 186, 'Newquay', 'Newquay', 2300), -(2205, 37, 186, 'Paignton', 'Paignton', 2400), -(2206, 37, 186, 'Penzance', 'Penzance', 2500), -(2207, 37, 186, 'Plymouth', 'Plymouth', 2600), -(2208, 37, 186, 'Poole', 'Poole', 2700), -(2209, 37, 186, 'Redruth', 'Redruth', 2800), -(2210, 37, 186, 'Salisbury', 'Salisbury', 2900), -(2211, 37, 186, 'Saltash', 'Saltash', 3000), -(2212, 37, 186, 'St Ives', 'St Ives', 3100), -(2213, 37, 186, 'Stroud', 'Stroud', 3200), -(2214, 37, 186, 'Swindon', 'Swindon', 3300), -(2215, 37, 186, 'Taunton', 'Taunton', 3400), -(2216, 37, 186, 'Teignmouth', 'Teignmouth', 3500), -(2217, 37, 186, 'Torquay', 'Torquay', 3600), -(2218, 37, 186, 'Truro', 'Truro', 3700), -(2219, 37, 186, 'Warminster', 'Warminster', 3800), -(2220, 37, 186, 'Wells', 'Wells', 3900), -(2221, 37, 186, 'Westbury', 'Westbury', 4000), -(2222, 37, 186, 'Weston-Super-Mare', 'Weston-Super-Mare', 4100), -(2223, 37, 186, 'Weymouth', 'Weymouth', 4200), -(2224, 37, 186, 'Yeovil', 'Yeovil', 4300), -(2225, 37, 187, 'Ashbourne', 'Ashbourne', 100), -(2226, 37, 187, 'Bewdley', 'Bewdley', 200), -(2227, 37, 187, 'Bilston', 'Bilston', 300), -(2228, 37, 187, 'Birmingham', 'Birmingham', 400), -(2229, 37, 187, 'Burton-On-Trent', 'Burton-On-Trent', 500), -(2230, 37, 187, 'Coventry', 'Coventry', 600), -(2231, 37, 187, 'Craven Arms', 'Craven Arms', 700), -(2232, 37, 187, 'Crewe', 'Crewe', 800), -(2233, 37, 187, 'Daventry', 'Daventry', 900), -(2234, 37, 187, 'Droitwich', 'Droitwich', 1000), -(2235, 37, 187, 'Dudley', 'Dudley', 1100), -(2236, 37, 187, 'Evesham', 'Evesham', 1200), -(2237, 37, 187, 'Hereford', 'Hereford', 1300), -(2238, 37, 187, 'Leamington Spa', 'Leamington Spa', 1400), -(2239, 37, 187, 'Lichfield', 'Lichfield', 1500), -(2240, 37, 187, 'Newcastle', 'Newcastle', 1600), -(2241, 37, 187, 'Newport', 'Newport', 1700), -(2242, 37, 187, 'Nuneaton', 'Nuneaton', 1800), -(2243, 37, 187, 'Rugby', 'Rugby', 1900), -(2244, 37, 187, 'Shrewsbury', 'Shrewsbury', 2000), -(2245, 37, 187, 'Stafford', 'Stafford', 2100), -(2246, 37, 187, 'Stoke-On-Trent', 'Stoke-On-Trent', 2200), -(2247, 37, 187, 'Stourbridge', 'Stourbridge', 2300), -(2248, 37, 187, 'Stratford-Upon-Avon', 'Stratford-Upon-Avon', 2400), -(2249, 37, 187, 'Tamworth', 'Tamworth', 2500), -(2250, 37, 187, 'Telford', 'Telford', 2600), -(2251, 37, 187, 'Tenbury Wells', 'Tenbury Wells', 2700), -(2252, 37, 187, 'Walsall', 'Walsall', 2800), -(2253, 37, 187, 'Warwick', 'Warwick', 2900), -(2254, 37, 187, 'West Bromwich', 'West Bromwich', 3000), -(2255, 37, 187, 'Whitchurch', 'Whitchurch', 3100), -(2256, 37, 187, 'Wolverhampton', 'Wolverhampton', 3200), -(2257, 37, 187, 'Worcester', 'Worcester', 3300), -(2258, 37, 188, 'Barnsley', 'Barnsley', 100), -(2259, 37, 188, 'Bradford', 'Bradford', 200), -(2260, 37, 188, 'Cottingham', 'Cottingham', 300), -(2261, 37, 188, 'Dewsbury', 'Dewsbury', 400), -(2262, 37, 188, 'Doncaster', 'Doncaster', 500), -(2263, 37, 188, 'Goole', 'Goole', 600), -(2264, 37, 188, 'Halifax', 'Halifax', 700), -(2265, 37, 188, 'Harrogate', 'Harrogate', 800), -(2266, 37, 188, 'Holmfirth', 'Holmfirth', 900), -(2267, 37, 188, 'Hornsea', 'Hornsea', 1000), -(2268, 37, 188, 'Huddersfield', 'Huddersfield', 1100), -(2269, 37, 188, 'Hull', 'Hull', 1200), -(2270, 37, 188, 'Keighley', 'Keighley', 1300), -(2271, 37, 188, 'Knottingley', 'Knottingley', 1400), -(2272, 37, 188, 'Lancaster', 'Lancaster', 1500), -(2273, 37, 188, 'Leeds', 'Leeds', 1600), -(2274, 37, 188, 'Middlesbrough', 'Middlesbrough', 1700), -(2275, 37, 188, 'Normanton', 'Normanton', 1800), -(2276, 37, 188, 'Ripon', 'Ripon', 1900), -(2277, 37, 188, 'Rotherham', 'Rotherham', 2000), -(2278, 37, 188, 'Scarborough', 'Scarborough', 2100), -(2279, 37, 188, 'Selby', 'Selby', 2200), -(2280, 37, 188, 'Sheffield', 'Sheffield', 2300), -(2281, 37, 188, 'Shipley', 'Shipley', 2400), -(2282, 37, 188, 'Wakefield', 'Wakefield', 2500), -(2283, 37, 188, 'York', 'York', 2600), -(2284, 37, 189, 'Isle of Man', 'Isle of Man', 100), -(2285, 37, 190, 'Antrim', 'Antrim', 100), -(2286, 37, 190, 'Armagh', 'Armagh', 200), -(2287, 37, 190, 'Aughnacloy', 'Aughnacloy', 300), -(2288, 37, 190, 'Ballymena', 'Ballymena', 400), -(2289, 37, 190, 'Bangor', 'Bangor', 500), -(2290, 37, 190, 'Belfast', 'Belfast', 600), -(2291, 37, 190, 'Cookstown', 'Cookstown', 700), -(2292, 37, 190, 'Craigavon', 'Craigavon', 800), -(2293, 37, 190, 'Downpatrick', 'Downpatrick', 900), -(2294, 37, 190, 'Dromore', 'Dromore', 1000), -(2295, 37, 190, 'Dungannon', 'Dungannon', 1100), -(2296, 37, 190, 'Enniskillen', 'Enniskillen', 1200), -(2297, 37, 190, 'Hillsborough', 'Hillsborough', 1300), -(2298, 37, 190, 'Holywood', 'Holywood', 1400), -(2299, 37, 190, 'Limavady', 'Limavady', 1500), -(2300, 37, 190, 'Lisburn', 'Lisburn', 1600), -(2301, 37, 190, 'Londonderry', 'Londonderry', 1700), -(2302, 37, 190, 'Magherafelt', 'Magherafelt', 1800), -(2303, 37, 190, 'Newcastle', 'Newcastle', 1900), -(2304, 37, 190, 'Newry', 'Newry', 2000), -(2305, 37, 190, 'Newtownabbey', 'Newtownabbey', 2100), -(2306, 37, 190, 'Newtownards', 'Newtownards', 2200), -(2307, 37, 190, 'Omagh', 'Omagh', 2300), -(2308, 37, 190, 'Portadown', 'Portadown', 2400), -(2309, 37, 191, 'Alexandria', 'Alexandria', 100), -(2310, 37, 191, 'Alva', 'Alva', 200), -(2311, 37, 191, 'Arbroath', 'Arbroath', 300), -(2312, 37, 191, 'Arrochar', 'Arrochar', 400), -(2313, 37, 191, 'Ayr', 'Ayr', 500), -(2314, 37, 191, 'Brechin', 'Brechin', 600), -(2315, 37, 191, 'Clydebank', 'Clydebank', 700), -(2316, 37, 191, 'Cupar', 'Cupar', 800), -(2317, 37, 191, 'Dollar', 'Dollar', 900), -(2318, 37, 191, 'Dumbarton', 'Dumbarton', 1000), -(2319, 37, 191, 'Dundee', 'Dundee', 1100), -(2320, 37, 191, 'Dunfermline', 'Dunfermline', 1200), -(2321, 37, 191, 'Falkirk', 'Falkirk', 1300), -(2322, 37, 191, 'Forfar', 'Forfar', 1400), -(2323, 37, 191, 'Glenrothes', 'Glenrothes', 1500), -(2324, 37, 191, 'Kirkcaldy', 'Kirkcaldy', 1600), -(2325, 37, 191, 'Leven', 'Leven', 1700), -(2326, 37, 191, 'Montrose', 'Montrose', 1800), -(2327, 37, 191, 'Perth', 'Perth', 1900), -(2328, 37, 191, 'Stirling', 'Stirling', 2000), -(2329, 37, 192, 'Aberdeen', 'Aberdeen', 100), -(2330, 37, 192, 'Aberlour', 'Aberlour', 200), -(2331, 37, 192, 'Avoch', 'Avoch', 300), -(2332, 37, 192, 'Banchory', 'Banchory', 400), -(2333, 37, 192, 'Banff', 'Banff', 500), -(2334, 37, 192, 'Buckie', 'Buckie', 600), -(2335, 37, 192, 'Dingwall', 'Dingwall', 700), -(2336, 37, 192, 'Fort William', 'Fort William', 800), -(2337, 37, 192, 'Fraserburgh', 'Fraserburgh', 900), -(2338, 37, 192, 'Inverness', 'Inverness', 1000), -(2339, 37, 192, 'Isle Of Lewis', 'Isle Of Lewis', 1100), -(2340, 37, 192, 'Peterhead', 'Peterhead', 1200), -(2341, 37, 192, 'Stonehaven', 'Stonehaven', 1300), -(2342, 37, 192, 'Stromness', 'Stromness', 1400), -(2343, 37, 192, 'Thurso', 'Thurso', 1500), -(2344, 37, 192, 'Ullapool', 'Ullapool', 1600), -(2345, 37, 193, 'Ardrossan', 'Ardrossan', 100), -(2346, 37, 193, 'Ayr', 'Ayr', 200), -(2347, 37, 193, 'Bathgate', 'Bathgate', 300), -(2348, 37, 193, 'Beith', 'Beith', 400), -(2349, 37, 193, 'Berwick-Upon-Tweed', 'Berwick-Upon-Tweed', 500), -(2350, 37, 193, 'Bo''Ness', 'Bo''Ness', 600), -(2351, 37, 193, 'Coatbridge', 'Coatbridge', 700), -(2352, 37, 193, 'Dumfries', 'Dumfries', 800), -(2353, 37, 193, 'Edinburgh', 'Edinburgh', 900), -(2354, 37, 193, 'Glasgow', 'Glasgow', 1000), -(2355, 37, 193, 'Hamilton', 'Hamilton', 1100), -(2356, 37, 193, 'Irvine', 'Irvine', 1200), -(2357, 37, 193, 'Motherwell', 'Motherwell', 1300), -(2358, 37, 193, 'Musselburgh', 'Musselburgh', 1400), -(2359, 37, 193, 'Wishaw', 'Wishaw', 1500), -(2360, 37, 194, 'Abergele', 'Abergele', 100), -(2361, 37, 194, 'Bagillt', 'Bagillt', 200), -(2362, 37, 194, 'Bala', 'Bala', 300), -(2363, 37, 194, 'Bangor', 'Bangor', 400), -(2364, 37, 194, 'Chester', 'Chester', 500), -(2365, 37, 194, 'Colwyn Bay', 'Colwyn Bay', 600), -(2366, 37, 194, 'Deeside', 'Deeside', 700), -(2367, 37, 194, 'Holyhead', 'Holyhead', 800), -(2368, 37, 194, 'Llandudno', 'Llandudno', 900), -(2369, 37, 194, 'Prestatyn', 'Prestatyn', 1000), -(2370, 37, 194, 'Rhyl', 'Rhyl', 1100), -(2371, 37, 194, 'Wrexham', 'Wrexham', 1200), -(2372, 37, 195, 'Barry', 'Barry', 100), -(2373, 37, 195, 'Blackwood', 'Blackwood', 200), -(2374, 37, 195, 'Bridgend', 'Bridgend', 300), -(2375, 37, 195, 'Cardiff', 'Cardiff', 400), -(2376, 37, 195, 'Carmarthen', 'Carmarthen', 500), -(2377, 37, 195, 'Lampeter', 'Lampeter', 600), -(2378, 37, 195, 'Llanelli', 'Llanelli', 700), -(2379, 37, 195, 'Newport', 'Newport', 800), -(2380, 37, 195, 'Port Talbot', 'Port Talbot', 900), -(2381, 37, 195, 'Swansea', 'Swansea', 1000), -(2382, 38, 196, 'Alsodabasi Dulo', 'Alsodabasi Dulo', 100), -(2383, 38, 196, 'Kecskemt', 'Kecskemt', 200), -(2384, 38, 196, 'Kiskunhalas', 'Kiskunhalas', 300), -(2385, 38, 197, 'Aklos', 'Aklos', 100), -(2386, 38, 197, 'Almr', 'Almr', 200), -(2387, 38, 197, 'Bkscsaba', 'Bkscsaba', 300), -(2388, 38, 197, 'Gyula', 'Gyula', 400), -(2389, 38, 197, 'Szarvas', 'Szarvas', 500), -(2390, 38, 198, 'Tiszajvros', 'Tiszajvros', 100), -(2391, 38, 199, 'Adyliget', 'Adyliget', 100), -(2392, 38, 199, 'Angyalfld', 'Angyalfld', 200), -(2393, 38, 199, 'Buda', 'Buda', 300), -(2394, 38, 199, 'Budafok', 'Budafok', 400), -(2395, 38, 199, 'Budapest', 'Budapest', 500), -(2396, 38, 199, 'Chepel', 'Chepel', 600), -(2397, 38, 199, 'Erzsbetvros', 'Erzsbetvros', 700), -(2398, 38, 199, 'Gellert', 'Gellert', 800), -(2399, 38, 199, 'Kobanya', 'Kobanya', 900), -(2400, 38, 199, 'Pest', 'Pest', 1000), -(2401, 38, 200, 'Szkkutas', 'Szkkutas', 100), -(2402, 38, 201, 'Debrecen', 'Debrecen', 100), -(2403, 38, 201, 'Debreczen', 'Debreczen', 200), -(2404, 38, 202, 'Bicske', 'Bicske', 100), -(2405, 38, 202, 'Dunajvros', 'Dunajvros', 200), -(2406, 38, 202, 'Szkesfehrvr', 'Szkesfehrvr', 300), -(2407, 38, 203, 'Gyor', 'Gyor', 100), -(2408, 38, 204, 'Fertoboz', 'Fertoboz', 100), -(2409, 38, 204, 'Fertod', 'Fertod', 200), -(2410, 38, 204, 'Gyr', 'Gyr', 300), -(2411, 38, 204, 'Kapuvr', 'Kapuvr', 400), -(2412, 38, 204, 'Mosonmagyarvr', 'Mosonmagyarvr', 500), -(2413, 38, 204, 'Sopron', 'Sopron', 600), -(2414, 38, 205, 'Eger', 'Eger', 100), -(2415, 38, 206, 'Kenderes', 'Kenderes', 100), -(2416, 38, 206, 'Kunhegyes', 'Kunhegyes', 200), -(2417, 38, 206, 'Szolnok', 'Szolnok', 300), -(2418, 38, 207, 'Esztergom', 'Esztergom', 100), -(2419, 38, 207, 'szr', 'szr', 200), -(2420, 38, 208, 'Miskolc', 'Miskolc', 100), -(2421, 38, 209, 'Alsutaspuszta', 'Alsutaspuszta', 100), -(2422, 38, 209, 'Salgtarjn', 'Salgtarjn', 200), -(2423, 38, 210, 'Fnfkirchen', 'Fnfkirchen', 100), -(2424, 38, 210, 'Fuenfkirchen', 'Fuenfkirchen', 200), -(2425, 38, 210, 'Fuzesdulo', 'Fuzesdulo', 300), -(2426, 38, 210, 'Gyrgytelep', 'Gyrgytelep', 400), -(2427, 38, 210, 'Haviboldogasszonydulo', 'Haviboldogasszonydulo', 500), -(2428, 38, 210, 'Pcs', 'Pcs', 600), -(2429, 38, 211, 'Alsodabasi Szolok', 'Alsodabasi Szolok', 100), -(2430, 38, 211, 'Bag', 'Bag', 200), -(2431, 38, 211, 'Budakeszi', 'Budakeszi', 300), -(2432, 38, 211, 'Budars', 'Budars', 400), -(2433, 38, 211, 'Cegld', 'Cegld', 500), -(2434, 38, 211, 'Monor', 'Monor', 600), -(2435, 38, 211, 'Nagykoros', 'Nagykoros', 700), -(2436, 38, 211, 'Nagykta', 'Nagykta', 800), -(2437, 38, 211, 'Pilisszentkereszt', 'Pilisszentkereszt', 900), -(2438, 38, 211, 'rd', 'rd', 1000), -(2439, 38, 211, 'Selekta', 'Selekta', 1100), -(2440, 38, 211, 'Vc', 'Vc', 1200), -(2441, 38, 212, 'Kaposvr', 'Kaposvr', 100), -(2442, 38, 212, 'llskt', 'llskt', 200), -(2443, 38, 212, 'Sifok', 'Sifok', 300), -(2444, 38, 212, 'Tab', 'Tab', 400), -(2445, 38, 213, 'Kisvrda', 'Kisvrda', 100), -(2446, 38, 213, 'Mtszalka', 'Mtszalka', 200), -(2447, 38, 213, 'Nyregyhza', 'Nyregyhza', 300), -(2448, 38, 214, 'Kiskundorozsma', 'Kiskundorozsma', 100), -(2449, 38, 214, 'Szeged', 'Szeged', 200), -(2450, 38, 215, 'Alshdvg', 'Alshdvg', 100), -(2451, 38, 215, 'Bonyhd', 'Bonyhd', 200), -(2452, 38, 215, 'Dombvr', 'Dombvr', 300), -(2453, 38, 215, 'Szekszrd', 'Szekszrd', 400), -(2454, 38, 216, 'Alsnyrvrimajor', 'Alsnyrvrimajor', 100), -(2455, 38, 216, 'Srvr', 'Srvr', 200), -(2456, 38, 216, 'Szombathely', 'Szombathely', 300), -(2457, 38, 216, 'Zanat', 'Zanat', 400), -(2458, 38, 217, 'Ajka', 'Ajka', 100), -(2459, 38, 217, 'Balatonalmdi', 'Balatonalmdi', 200), -(2460, 38, 217, 'Balatonfred', 'Balatonfred', 300), -(2461, 38, 217, 'Szentkirlyszabadja', 'Szentkirlyszabadja', 400), -(2462, 38, 217, 'Veszprm', 'Veszprm', 500), -(2463, 38, 217, 'Vrpalota', 'Vrpalota', 600), -(2464, 38, 218, 'Zalaegerszeg', 'Zalaegerszeg', 100), -(2465, 39, 219, 'Amauca', 'Amauca', 100), -(2466, 39, 220, 'Anaco', 'Anaco', 100), -(2467, 39, 220, 'Barcelona', 'Barcelona', 200), -(2468, 39, 220, 'Pozuelos', 'Pozuelos', 300), -(2469, 39, 220, 'Puerto de La Cruz', 'Puerto de La Cruz', 400), -(2470, 39, 220, 'Puerto La Cruz', 'Puerto La Cruz', 500), -(2471, 39, 221, 'frica', 'frica', 100), -(2472, 39, 221, 'San Fernando de Apure', 'San Fernando de Apure', 200), -(2473, 39, 222, 'El Limn', 'El Limn', 100), -(2474, 39, 222, 'Maracay', 'Maracay', 200), -(2475, 39, 222, 'Villa de Cura', 'Villa de Cura', 300), -(2476, 39, 223, 'Barinas', 'Barinas', 100), -(2477, 39, 223, 'Pedraza Vieja', 'Pedraza Vieja', 200), -(2478, 39, 224, 'Agua Blanca', 'Agua Blanca', 100), -(2479, 39, 224, 'Balchises', 'Balchises', 200), -(2480, 39, 224, 'Bolvar', 'Bolvar', 300), -(2481, 39, 224, 'Botuta', 'Botuta', 400), -(2482, 39, 224, 'Guayana City', 'Guayana City', 500), -(2483, 39, 224, 'Portachuelo', 'Portachuelo', 600), -(2484, 39, 224, 'Puerto de Ordaz', 'Puerto de Ordaz', 700), -(2485, 39, 224, 'Puerto Ordaz', 'Puerto Ordaz', 800), -(2486, 39, 225, 'Puerto Cabello', 'Puerto Cabello', 100), -(2487, 39, 225, 'Valencia', 'Valencia', 200), -(2488, 39, 226, 'La Corcovada', 'La Corcovada', 100), -(2489, 39, 227, 'Tucupita', 'Tucupita', 100), -(2490, 39, 228, 'Caracas', 'Caracas', 100), -(2491, 39, 228, 'Caricuao', 'Caricuao', 200), -(2492, 39, 228, 'Coche', 'Coche', 300), -(2493, 39, 228, 'Colinas de Santa Monica', 'Colinas de Santa Monica', 400), -(2494, 39, 228, 'San Antonio', 'San Antonio', 500), -(2495, 39, 229, 'Chichiriviche', 'Chichiriviche', 100), -(2496, 39, 229, 'Punto Fijo', 'Punto Fijo', 200), -(2497, 39, 229, 'Valle de Mara', 'Valle de Mara', 300), -(2498, 39, 230, 'Calabozo', 'Calabozo', 100), -(2499, 39, 230, 'San Juan de los Moros', 'San Juan de los Moros', 200), -(2500, 39, 230, 'Valle de La Pascua', 'Valle de La Pascua', 300), -(2501, 39, 231, 'Alemn', 'Alemn', 100), -(2502, 39, 231, 'Barquisimeto', 'Barquisimeto', 200), -(2503, 39, 231, 'Cabudare', 'Cabudare', 300), -(2504, 39, 232, 'Boca de Taguay', 'Boca de Taguay', 100), -(2505, 39, 232, 'Ca', 'Ca', 200), -(2506, 39, 232, 'Cabeza de Tigre', 'Cabeza de Tigre', 300), -(2507, 39, 232, 'Los Teques', 'Los Teques', 400), -(2508, 39, 232, 'Petare', 'Petare', 500), -(2509, 39, 233, 'Amana', 'Amana', 100), -(2510, 39, 233, 'Maturn', 'Maturn', 200), -(2511, 39, 233, 'Puente Punceres', 'Puente Punceres', 300), -(2512, 39, 234, 'Bailadores', 'Bailadores', 100), -(2513, 39, 234, 'La Azulita', 'La Azulita', 200), -(2514, 39, 234, 'Mrida', 'Mrida', 300), -(2515, 39, 235, 'La Brea', 'La Brea', 100), -(2516, 39, 236, 'Agua de Vaca', 'Agua de Vaca', 100), -(2517, 39, 236, 'Bella Vista', 'Bella Vista', 200), -(2518, 39, 236, 'El Agua', 'El Agua', 300), -(2519, 39, 236, 'El Pilar', 'El Pilar', 400), -(2520, 39, 236, 'El Valle', 'El Valle', 500), -(2521, 39, 236, 'Porlamar', 'Porlamar', 600), -(2522, 39, 237, 'Acarigua', 'Acarigua', 100), -(2523, 39, 238, 'Carpano', 'Carpano', 100), -(2524, 39, 238, 'Cuman', 'Cuman', 200), -(2525, 39, 239, 'Rubio', 'Rubio', 100), -(2526, 39, 239, 'San Antonio del Tchira', 'San Antonio del Tchira', 200), -(2527, 39, 239, 'San Cristbal', 'San Cristbal', 300), -(2528, 39, 240, 'Banco Bonito', 'Banco Bonito', 100), -(2529, 39, 240, 'Cocorote', 'Cocorote', 200), -(2530, 39, 240, 'San Felipe', 'San Felipe', 300), -(2531, 39, 240, 'Tamboral', 'Tamboral', 400), -(2532, 39, 241, 'Cabimas', 'Cabimas', 100), -(2533, 39, 241, 'Ciudad Ojeda', 'Ciudad Ojeda', 200), -(2534, 39, 241, 'Fundo El Len', 'Fundo El Len', 300), -(2535, 39, 241, 'Maracaibo', 'Maracaibo', 400), -(2536, 39, 241, 'Santa Rita', 'Santa Rita', 500), -(2537, 40, 242, 'Дили', 'Dili', 100), -(2538, 41, 243, 'Нам-Динх', 'Nam Dinh', 100), -(2539, 41, 243, 'Хайфон', 'Hai Phong', 200), -(2540, 41, 243, 'Ханой', 'Hanoi', 300), -(2541, 41, 244, 'Вунг-Тау', 'Vung Tau', 100), -(2542, 41, 244, 'Сайгон', 'Saigon', 200), -(2543, 41, 245, 'Нячанг', 'Nha Trang', 100), -(2544, 41, 245, 'Пхан-Тхит', 'Phan Tiet', 200), -(2545, 41, 246, 'Винь', 'Vinh', 100), -(2546, 41, 246, 'Хуэ', 'Hue', 200), -(2547, 41, 247, 'Хон-Гаи', 'Hon Gai', 100), -(2548, 41, 248, 'Плейку', 'Pleiku', 100), -(2549, 42, 249, 'Либревиль', 'Librevil''', 100), -(2550, 42, 249, 'Порт-Жантиль', 'Port-Zhantil''', 200), -(2551, 43, 250, 'Гонаивес', 'Гонаивес', 100), -(2552, 43, 251, 'Джереми', 'Джереми', 100), -(2553, 43, 252, 'Порт-де-Пакс', 'Порт-де-Пакс', 100), -(2554, 43, 253, 'Порт-о-Пренс', 'Порт-о-Пренс', 100), -(2555, 43, 254, 'Лес-Кайес', 'Лес-Кайес', 100), -(2556, 43, 255, 'Джакмель', 'Джакмель', 100), -(2557, 44, 256, 'Джорджтаун', 'Djordjtown', 100), -(2558, 45, 257, 'Банжул', 'Banzhul', 100), -(2559, 46, 258, 'Аккра', 'Akkra', 100), -(2560, 47, 259, 'Пойнт-а-Питр', 'Пойнт-а-Питр', 100), -(2561, 47, 260, 'Бассе-Терре', 'Бассе-Терре', 100), -(2562, 48, 261, 'Cobn', 'Cobn', 100), -(2563, 48, 262, 'Chisantiago', 'Chisantiago', 100), -(2564, 48, 263, 'Chimaltenango', 'Chimaltenango', 100), -(2565, 48, 264, 'Anguiat', 'Anguiat', 100), -(2566, 48, 265, 'Amaya', 'Amaya', 100), -(2567, 48, 265, 'Atitancito', 'Atitancito', 200), -(2568, 48, 266, 'Brigada', 'Brigada', 100), -(2569, 48, 266, 'Ciudad de Guatemala', 'Ciudad de Guatemala', 200), -(2570, 48, 266, 'Guatemala', 'Guatemala', 300), -(2571, 48, 266, 'Guatemala City', 'Guatemala City', 400), -(2572, 48, 266, 'Petapa', 'Petapa', 500), -(2573, 48, 266, 'San Juan Sacatepquez', 'San Juan Sacatepquez', 600), -(2574, 48, 266, 'San Miguel Petapa', 'San Miguel Petapa', 700), -(2575, 48, 267, 'Amate Blanco', 'Amate Blanco', 100), -(2576, 48, 268, 'Can', 'Can', 100), -(2577, 48, 269, 'Quetzaltenango', 'Quetzaltenango', 100), -(2578, 48, 270, 'Cinaga', 'Cinaga', 100), -(2579, 48, 270, 'San Cristbal', 'San Cristbal', 200), -(2580, 48, 270, 'Totonicapn', 'Totonicapn', 300), -(2581, 48, 271, 'Casas de Pinto', 'Casas de Pinto', 100), -(2582, 49, 272, 'Канкан', 'Kankan', 100), -(2583, 49, 272, 'Конакри', 'Konakri', 200), -(2584, 50, 273, 'Бисау', 'Бисау', 100), -(2585, 51, 274, 'Aach', 'Aach', 100), -(2586, 51, 274, 'Aalen', 'Aalen', 200), -(2587, 51, 274, 'Abstatt', 'Abstatt', 300), -(2588, 51, 274, 'Achberg', 'Achberg', 400), -(2589, 51, 274, 'Achern', 'Achern', 500), -(2590, 51, 274, 'Achstetten', 'Achstetten', 600), -(2591, 51, 274, 'Adelberg', 'Adelberg', 700), -(2592, 51, 274, 'Adelmannsfelden', 'Adelmannsfelden', 800), -(2593, 51, 274, 'Adelsheim', 'Adelsheim', 900), -(2594, 51, 274, 'Aglasterhausen', 'Aglasterhausen', 1000), -(2595, 51, 274, 'Ahorn', 'Ahorn', 1100), -(2596, 51, 274, 'Aichelberg', 'Aichelberg', 1200), -(2597, 51, 274, 'Aichstetten', 'Aichstetten', 1300), -(2598, 51, 274, 'Aichwald', 'Aichwald', 1400), -(2599, 51, 274, 'Aitern', 'Aitern', 1500), -(2600, 51, 274, 'Aitrach', 'Aitrach', 1600), -(2601, 51, 274, 'Albbruck', 'Albbruck', 1700), -(2602, 51, 274, 'Albstadt', 'Albstadt', 1800), -(2603, 51, 274, 'Aldingen', 'Aldingen', 1900), -(2604, 51, 274, 'Alfdorf', 'Alfdorf', 2000), -(2605, 51, 274, 'Allensbach', 'Allensbach', 2100), -(2606, 51, 274, 'Alleshausen', 'Alleshausen', 2200), -(2607, 51, 274, 'Allmannsweiler', 'Allmannsweiler', 2300), -(2608, 51, 274, 'Alpirsbach', 'Alpirsbach', 2400), -(2609, 51, 274, 'Altbach', 'Altbach', 2500), -(2610, 51, 274, 'Altensteig', 'Altensteig', 2600), -(2611, 51, 274, 'Altluheim', 'Altluheim', 2700), -(2612, 51, 274, 'Altshausen', 'Altshausen', 2800), -(2613, 51, 274, 'Amstetten', 'Amstetten', 2900), -(2614, 51, 274, 'Appenweier', 'Appenweier', 3000), -(2615, 51, 274, 'Asperg', 'Asperg', 3100), -(2616, 51, 274, 'Assamstadt', 'Assamstadt', 3200), -(2617, 51, 274, 'Au', 'Au', 3300), -(2618, 51, 274, 'Au am Rhein', 'Au am Rhein', 3400), -(2619, 51, 274, 'Aulendorf', 'Aulendorf', 3500), -(2620, 51, 274, 'Backnang', 'Backnang', 3600), -(2621, 51, 274, 'Bad Bellingen', 'Bad Bellingen', 3700), -(2622, 51, 274, 'Bad Buchau', 'Bad Buchau', 3800), -(2623, 51, 274, 'Bad Drrheim', 'Bad Drrheim', 3900), -(2624, 51, 274, 'Bad Friedrichshall', 'Bad Friedrichshall', 4000), -(2625, 51, 274, 'Bad Herrenalb', 'Bad Herrenalb', 4100), -(2626, 51, 274, 'Bad Krozingen', 'Bad Krozingen', 4200), -(2627, 51, 274, 'Bad Mergentheim', 'Bad Mergentheim', 4300), -(2628, 51, 274, 'Bad Peterstal-Griesbach', 'Bad Peterstal-Griesbach', 4400), -(2629, 51, 274, 'Bad Rappenau', 'Bad Rappenau', 4500), -(2630, 51, 274, 'Bad Rippoldsau-Schapbach', 'Bad Rippoldsau-Schapbach', 4600), -(2631, 51, 274, 'Bad Saulgau', 'Bad Saulgau', 4700), -(2632, 51, 274, 'Bad Schnborn', 'Bad Schnborn', 4800), -(2633, 51, 274, 'Bad Schussenried', 'Bad Schussenried', 4900), -(2634, 51, 274, 'Bad Sckingen', 'Bad Sckingen', 5000), -(2635, 51, 274, 'Bad Urach', 'Bad Urach', 5100), -(2636, 51, 274, 'Bad Waldsee', 'Bad Waldsee', 5200), -(2637, 51, 274, 'Bad Wildbad im Schwarzwald', 'Bad Wildbad im Schwarzwald', 5300), -(2638, 51, 274, 'Bad Wimpfen', 'Bad Wimpfen', 5400), -(2639, 51, 274, 'Bad Wurzach', 'Bad Wurzach', 5500), -(2640, 51, 274, 'Baden-Baden', 'Baden-Baden', 5600), -(2641, 51, 274, 'Bahlingen am Kaiserstuhl', 'Bahlingen am Kaiserstuhl', 5700), -(2642, 51, 274, 'Baienfurt', 'Baienfurt', 5800), -(2643, 51, 274, 'Baiersbronn', 'Baiersbronn', 5900), -(2644, 51, 274, 'Baindt', 'Baindt', 6000), -(2645, 51, 274, 'Balingen', 'Balingen', 6100), -(2646, 51, 274, 'Bammental', 'Bammental', 6200), -(2647, 51, 274, 'Bartholom', 'Bartholom', 6300), -(2648, 51, 274, 'Bblingen', 'Bblingen', 6400), -(2649, 51, 274, 'Berg', 'Berg', 6500), -(2650, 51, 274, 'Bergatreute', 'Bergatreute', 6600), -(2651, 51, 274, 'berlingen', 'berlingen', 6700), -(2652, 51, 274, 'Besigheim', 'Besigheim', 6800), -(2653, 51, 274, 'Bhl', 'Bhl', 6900), -(2654, 51, 274, 'Bhlertal', 'Bhlertal', 7000), -(2655, 51, 274, 'Biberach', 'Biberach', 7100), -(2656, 51, 274, 'Biberach an der Ri', 'Biberach an der Ri', 7200), -(2657, 51, 274, 'Biederbach', 'Biederbach', 7300), -(2658, 51, 274, 'Bietigheim', 'Bietigheim', 7400), -(2659, 51, 274, 'Bietigheim-Bissingen', 'Bietigheim-Bissingen', 7500), -(2660, 51, 274, 'Binzen', 'Binzen', 7600), -(2661, 51, 274, 'Bisingen', 'Bisingen', 7700), -(2662, 51, 274, 'Bitz', 'Bitz', 7800), -(2663, 51, 274, 'Blaubeuren', 'Blaubeuren', 7900), -(2664, 51, 274, 'Blaufelden', 'Blaufelden', 8000), -(2665, 51, 274, 'Blaustein', 'Blaustein', 8100), -(2666, 51, 274, 'Blumberg', 'Blumberg', 8200), -(2667, 51, 274, 'Bodelshausen', 'Bodelshausen', 8300), -(2668, 51, 274, 'Bodman-Ludwigshafen', 'Bodman-Ludwigshafen', 8400), -(2669, 51, 274, 'Bondorf', 'Bondorf', 8500), -(2670, 51, 274, 'Bonndorf im Schwarzwald', 'Bonndorf im Schwarzwald', 8600), -(2671, 51, 274, 'Bopfingen', 'Bopfingen', 8700), -(2672, 51, 274, 'Boxberg', 'Boxberg', 8800), -(2673, 51, 274, 'Breisach am Rhein', 'Breisach am Rhein', 8900), -(2674, 51, 274, 'Bretten', 'Bretten', 9000), -(2675, 51, 274, 'Brhl', 'Brhl', 9100), -(2676, 51, 274, 'Bruchsal', 'Bruchsal', 9200), -(2677, 51, 274, 'Bttingen', 'Bttingen', 9300), -(2678, 51, 274, 'Buchen (Odenwald)', 'Buchen (Odenwald)', 9400), -(2679, 51, 274, 'Buggingen', 'Buggingen', 9500), -(2680, 51, 274, 'Burladingen', 'Burladingen', 9600), -(2681, 51, 274, 'Calw', 'Calw', 9700), -(2682, 51, 274, 'Crailsheim', 'Crailsheim', 9800), -(2683, 51, 274, 'Deggingen', 'Deggingen', 9900), -(2684, 51, 274, 'Deizisau', 'Deizisau', 10000), -(2685, 51, 274, 'Denkingen', 'Denkingen', 10100), -(2686, 51, 274, 'Denzlingen', 'Denzlingen', 10200), -(2687, 51, 274, 'Dettenheim', 'Dettenheim', 10300), -(2688, 51, 274, 'Dettingen an der Iller', 'Dettingen an der Iller', 10400), -(2689, 51, 274, 'Dettingen unter Teck', 'Dettingen unter Teck', 10500), -(2690, 51, 274, 'Dietenheim', 'Dietenheim', 10600), -(2691, 51, 274, 'Dietingen', 'Dietingen', 10700), -(2692, 51, 274, 'Dobel', 'Dobel', 10800), -(2693, 51, 274, 'Donaueschingen', 'Donaueschingen', 10900), -(2694, 51, 274, 'Dornhan', 'Dornhan', 11000), -(2695, 51, 274, 'Dornstetten', 'Dornstetten', 11100), -(2696, 51, 274, 'Drbheim', 'Drbheim', 11200), -(2697, 51, 274, 'Drmentingen', 'Drmentingen', 11300), -(2698, 51, 274, 'Drzbach', 'Drzbach', 11400), -(2699, 51, 274, 'Dulingen', 'Dulingen', 11500), -(2700, 51, 274, 'Dunningen', 'Dunningen', 11600), -(2701, 51, 274, 'Eberbach', 'Eberbach', 11700), -(2702, 51, 274, 'Ebhausen', 'Ebhausen', 11800), -(2703, 51, 274, 'Edingen-Neckarhausen', 'Edingen-Neckarhausen', 11900), -(2704, 51, 274, 'Efringen-Kirchen', 'Efringen-Kirchen', 12000), -(2705, 51, 274, 'Eggenstein-Leopoldshafen', 'Eggenstein-Leopoldshafen', 12100), -(2706, 51, 274, 'Ehingen an der Donau', 'Ehingen an der Donau', 12200), -(2707, 51, 274, 'Ehningen', 'Ehningen', 12300), -(2708, 51, 274, 'Eisingen', 'Eisingen', 12400), -(2709, 51, 274, 'Eislingen/Fils', 'Eislingen/Fils', 12500), -(2710, 51, 274, 'Ellwangen (Jagst)', 'Ellwangen (Jagst)', 12600), -(2711, 51, 274, 'Emmendingen', 'Emmendingen', 12700), -(2712, 51, 274, 'Empfingen', 'Empfingen', 12800), -(2713, 51, 274, 'Endingen am Kaiserstuhl', 'Endingen am Kaiserstuhl', 12900), -(2714, 51, 274, 'Engen', 'Engen', 13000), -(2715, 51, 274, 'Eppingen', 'Eppingen', 13100), -(2716, 51, 274, 'Erbach', 'Erbach', 13200), -(2717, 51, 274, 'Eriskirch', 'Eriskirch', 13300), -(2718, 51, 274, 'Erlenmoos', 'Erlenmoos', 13400), -(2719, 51, 274, 'Ertingen', 'Ertingen', 13500), -(2720, 51, 274, 'Eschelbronn', 'Eschelbronn', 13600), -(2721, 51, 274, 'Essingen', 'Essingen', 13700), -(2722, 51, 274, 'Esslingen am Neckar', 'Esslingen am Neckar', 13800), -(2723, 51, 274, 'Ettenheim', 'Ettenheim', 13900), -(2724, 51, 274, 'Ettlingen', 'Ettlingen', 14000), -(2725, 51, 274, 'Fellbach', 'Fellbach', 14100), -(2726, 51, 274, 'Filderstadt', 'Filderstadt', 14200), -(2727, 51, 274, 'Fischingen', 'Fischingen', 14300), -(2728, 51, 274, 'Forst', 'Forst', 14400), -(2729, 51, 274, 'Frankenhardt', 'Frankenhardt', 14500), -(2730, 51, 274, 'Freiberg am Neckar', 'Freiberg am Neckar', 14600), -(2731, 51, 274, 'Freiburg im Breisgau', 'Freiburg im Breisgau', 14700), -(2732, 51, 274, 'Freudenberg', 'Freudenberg', 14800), -(2733, 51, 274, 'Freudenstadt', 'Freudenstadt', 14900), -(2734, 51, 274, 'Frickingen', 'Frickingen', 15000), -(2735, 51, 274, 'Friedrichshafen', 'Friedrichshafen', 15100), -(2736, 51, 274, 'Friesenheim', 'Friesenheim', 15200), -(2737, 51, 274, 'Frittlingen', 'Frittlingen', 15300), -(2738, 51, 274, 'Furtwangen im Schwarzwald', 'Furtwangen im Schwarzwald', 15400), -(2739, 51, 274, 'Gaggenau', 'Gaggenau', 15500), -(2740, 51, 274, 'Gaildorf', 'Gaildorf', 15600), -(2741, 51, 274, 'Gailingen am Hochrhein', 'Gailingen am Hochrhein', 15700), -(2742, 51, 274, 'Geisingen', 'Geisingen', 15800), -(2743, 51, 274, 'Geislingen', 'Geislingen', 15900), -(2744, 51, 274, 'Geislingen an der Steige', 'Geislingen an der Steige', 16000), -(2745, 51, 274, 'Gengenbach', 'Gengenbach', 16100), -(2746, 51, 274, 'Gerabronn', 'Gerabronn', 16200), -(2747, 51, 274, 'Giengen an der Brenz', 'Giengen an der Brenz', 16300), -(2748, 51, 274, 'Gingen an der Fils', 'Gingen an der Fils', 16400), -(2749, 51, 274, 'Gosheim', 'Gosheim', 16500), -(2750, 51, 274, 'Gottmadingen', 'Gottmadingen', 16600), -(2751, 51, 274, 'Gppingen', 'Gppingen', 16700), -(2752, 51, 274, 'Graben-Neudorf', 'Graben-Neudorf', 16800), -(2753, 51, 274, 'Grafenhausen', 'Grafenhausen', 16900), -(2754, 51, 274, 'Grenzach-Wyhlen', 'Grenzach-Wyhlen', 17000), -(2755, 51, 274, 'Haigerloch', 'Haigerloch', 17100), -(2756, 51, 274, 'Hardheim', 'Hardheim', 17200), -(2757, 51, 274, 'Haslach im Kinzigtal', 'Haslach im Kinzigtal', 17300), -(2758, 51, 274, 'Hausach', 'Hausach', 17400), -(2759, 51, 274, 'Hechingen', 'Hechingen', 17500), -(2760, 51, 274, 'Heddesheim', 'Heddesheim', 17600), -(2761, 51, 274, 'Heidelberg', 'Heidelberg', 17700), -(2762, 51, 274, 'Heidenheim an der Brenz', 'Heidenheim an der Brenz', 17800), -(2763, 51, 274, 'Heilbronn', 'Heilbronn', 17900), -(2764, 51, 274, 'Heiningen', 'Heiningen', 18000), -(2765, 51, 274, 'Helmstadt-Bargen', 'Helmstadt-Bargen', 18100), -(2766, 51, 274, 'Hemsbach', 'Hemsbach', 18200), -(2767, 51, 274, 'Herbertingen', 'Herbertingen', 18300), -(2768, 51, 274, 'Herbolzheim', 'Herbolzheim', 18400), -(2769, 51, 274, 'Herbrechtingen', 'Herbrechtingen', 18500), -(2770, 51, 274, 'Herrenberg', 'Herrenberg', 18600), -(2771, 51, 274, 'Hfen an der Enz', 'Hfen an der Enz', 18700), -(2772, 51, 274, 'Hg-Ehrsberg', 'Hg-Ehrsberg', 18800), -(2773, 51, 274, 'Hgelsheim', 'Hgelsheim', 18900), -(2774, 51, 274, 'hningen', 'hningen', 19000), -(2775, 51, 274, 'Hockenheim', 'Hockenheim', 19100), -(2776, 51, 274, 'Holzgerlingen', 'Holzgerlingen', 19200), -(2777, 51, 274, 'Horb am Neckar', 'Horb am Neckar', 19300), -(2778, 51, 274, 'Horgenzell', 'Horgenzell', 19400), -(2779, 51, 274, 'Hpfingen', 'Hpfingen', 19500), -(2780, 51, 274, 'hringen', 'hringen', 19600), -(2781, 51, 274, 'Ihringen', 'Ihringen', 19700), -(2782, 51, 274, 'Illerkirchberg', 'Illerkirchberg', 19800), -(2783, 51, 274, 'Illingen', 'Illingen', 19900), -(2784, 51, 274, 'Illmensee', 'Illmensee', 20000), -(2785, 51, 274, 'Ilvesheim', 'Ilvesheim', 20100), -(2786, 51, 274, 'Immendingen', 'Immendingen', 20200), -(2787, 51, 274, 'Immenstaad am Bodensee', 'Immenstaad am Bodensee', 20300), -(2788, 51, 274, 'Ingelfingen', 'Ingelfingen', 20400), -(2789, 51, 274, 'Inzigkofen', 'Inzigkofen', 20500), -(2790, 51, 274, 'Isny im Allgu', 'Isny im Allgu', 20600), -(2791, 51, 274, 'Ispringen', 'Ispringen', 20700), -(2792, 51, 274, 'Jestetten', 'Jestetten', 20800), -(2793, 51, 274, 'Kappelrodeck', 'Kappelrodeck', 20900), -(2794, 51, 274, 'Karlsbad', 'Karlsbad', 21000), -(2795, 51, 274, 'Karlsruhe', 'Karlsruhe', 21100), -(2796, 51, 274, 'Kehl', 'Kehl', 21200), -(2797, 51, 274, 'Keltern', 'Keltern', 21300), -(2798, 51, 274, 'Kenzingen', 'Kenzingen', 21400), -(2799, 51, 274, 'Ketsch', 'Ketsch', 21500), -(2800, 51, 274, 'Kieselbronn', 'Kieselbronn', 21600), -(2801, 51, 274, 'Kippenheim', 'Kippenheim', 21700), -(2802, 51, 274, 'Kirchheim unter Teck', 'Kirchheim unter Teck', 21800), -(2803, 51, 274, 'Klettgau', 'Klettgau', 21900), -(2804, 51, 274, 'Klsheim', 'Klsheim', 22000), -(2805, 51, 274, 'Kngen', 'Kngen', 22100), -(2806, 51, 274, 'Knigsbronn', 'Knigsbronn', 22200), -(2807, 51, 274, 'Knigsfeld im Schwarzwald', 'Knigsfeld im Schwarzwald', 22300), -(2808, 51, 274, 'Knittlingen', 'Knittlingen', 22400), -(2809, 51, 274, 'Knzelsau', 'Knzelsau', 22500), -(2810, 51, 274, 'Kolbingen', 'Kolbingen', 22600), -(2811, 51, 274, 'Konstanz', 'Konstanz', 22700), -(2812, 51, 274, 'Kornwestheim', 'Kornwestheim', 22800), -(2813, 51, 274, 'Krauchenwies', 'Krauchenwies', 22900), -(2814, 51, 274, 'Krautheim', 'Krautheim', 23000), -(2815, 51, 274, 'Kressbronn am Bodensee', 'Kressbronn am Bodensee', 23100), -(2816, 51, 274, 'Kronau', 'Kronau', 23200), -(2817, 51, 274, 'Kssaberg', 'Kssaberg', 23300), -(2818, 51, 274, 'Kuppenheim', 'Kuppenheim', 23400), -(2819, 51, 274, 'Lahr/Schwarzwald', 'Lahr/Schwarzwald', 23500), -(2820, 51, 274, 'Laichingen', 'Laichingen', 23600), -(2821, 51, 274, 'Langenau', 'Langenau', 23700), -(2822, 51, 274, 'Lauchringen', 'Lauchringen', 23800), -(2823, 51, 274, 'Lauda-Knigshofen', 'Lauda-Knigshofen', 23900), -(2824, 51, 274, 'Lauf', 'Lauf', 24000), -(2825, 51, 274, 'Laufenburg', 'Laufenburg', 24100), -(2826, 51, 274, 'Laupheim', 'Laupheim', 24200), -(2827, 51, 274, 'Leimen', 'Leimen', 24300), -(2828, 51, 274, 'Leonberg', 'Leonberg', 24400), -(2829, 51, 274, 'Leutkirch im Allgu', 'Leutkirch im Allgu', 24500), -(2830, 51, 274, 'Lffingen', 'Lffingen', 24600), -(2831, 51, 274, 'Lottstetten', 'Lottstetten', 24700), -(2832, 51, 274, 'Lrrach', 'Lrrach', 24800), -(2833, 51, 274, 'Ludwigsburg', 'Ludwigsburg', 24900), -(2834, 51, 274, 'Lwenstein', 'Lwenstein', 25000), -(2835, 51, 274, 'Mahlberg', 'Mahlberg', 25100), -(2836, 51, 274, 'Mainhardt', 'Mainhardt', 25200), -(2837, 51, 274, 'Mannheim', 'Mannheim', 25300), -(2838, 51, 274, 'Markdorf', 'Markdorf', 25400), -(2839, 51, 274, 'Maulbronn', 'Maulbronn', 25500), -(2840, 51, 274, 'Mckmhl', 'Mckmhl', 25600), -(2841, 51, 274, 'Meckenbeuren', 'Meckenbeuren', 25700), -(2842, 51, 274, 'Meersburg', 'Meersburg', 25800), -(2843, 51, 274, 'Mekirch', 'Mekirch', 25900), -(2844, 51, 274, 'Mengen', 'Mengen', 26000), -(2845, 51, 274, 'Merzhausen', 'Merzhausen', 26100), -(2846, 51, 274, 'Mestetten', 'Mestetten', 26200), -(2847, 51, 274, 'Metzingen', 'Metzingen', 26300), -(2848, 51, 274, 'Mgglingen', 'Mgglingen', 26400), -(2849, 51, 274, 'Mhlacker', 'Mhlacker', 26500), -(2850, 51, 274, 'Mhlhausen', 'Mhlhausen', 26600), -(2851, 51, 274, 'Mllheim', 'Mllheim', 26700), -(2852, 51, 274, 'Mnsingen', 'Mnsingen', 26800), -(2853, 51, 274, 'Mosbach', 'Mosbach', 26900), -(2854, 51, 274, 'Mssingen', 'Mssingen', 27000), -(2855, 51, 274, 'Mtzingen', 'Mtzingen', 27100), -(2856, 51, 274, 'Mulfingen', 'Mulfingen', 27200), -(2857, 51, 274, 'Munderkingen', 'Munderkingen', 27300), -(2858, 51, 274, 'Nagold', 'Nagold', 27400), -(2859, 51, 274, 'Neckargemnd', 'Neckargemnd', 27500), -(2860, 51, 274, 'Neckarsulm', 'Neckarsulm', 27600), -(2861, 51, 274, 'Neresheim', 'Neresheim', 27700), -(2862, 51, 274, 'Neubulach', 'Neubulach', 27800), -(2863, 51, 274, 'Neuenbrg', 'Neuenbrg', 27900), -(2864, 51, 274, 'Neuenburg am Rhein', 'Neuenburg am Rhein', 28000), -(2865, 51, 274, 'Neuenstadt am Kocher', 'Neuenstadt am Kocher', 28100), -(2866, 51, 274, 'Neuenstein', 'Neuenstein', 28200), -(2867, 51, 274, 'Niedernhall', 'Niedernhall', 28300), -(2868, 51, 274, 'Niefern-schelbronn', 'Niefern-schelbronn', 28400), -(2869, 51, 274, 'Nordheim', 'Nordheim', 28500), -(2870, 51, 274, 'Nrtingen', 'Nrtingen', 28600), -(2871, 51, 274, 'Oberderdingen', 'Oberderdingen', 28700), -(2872, 51, 274, 'Oberhausen-Rheinhausen', 'Oberhausen-Rheinhausen', 28800), -(2873, 51, 274, 'Oberkirch', 'Oberkirch', 28900), -(2874, 51, 274, 'Oberndorf am Neckar', 'Oberndorf am Neckar', 29000), -(2875, 51, 274, 'Oberteuringen', 'Oberteuringen', 29100), -(2876, 51, 274, 'Ochsenhausen', 'Ochsenhausen', 29200), -(2877, 51, 274, 'Offenburg', 'Offenburg', 29300), -(2878, 51, 274, 'Ofterdingen', 'Ofterdingen', 29400), -(2879, 51, 274, 'Oftersheim', 'Oftersheim', 29500), -(2880, 51, 274, 'Oppenau', 'Oppenau', 29600), -(2881, 51, 274, 'Ortenberg', 'Ortenberg', 29700), -(2882, 51, 274, 'Osterburken', 'Osterburken', 29800), -(2883, 51, 274, 'Ostrach', 'Ostrach', 29900), -(2884, 51, 274, 'Ottenhfen im Schwarzwald', 'Ottenhfen im Schwarzwald', 30000), -(2885, 51, 274, 'Pfalzgrafenweiler', 'Pfalzgrafenweiler', 30100), -(2886, 51, 274, 'Pfinztal', 'Pfinztal', 30200), -(2887, 51, 274, 'Pforzheim', 'Pforzheim', 30300), -(2888, 51, 274, 'Pfullendorf', 'Pfullendorf', 30400), -(2889, 51, 274, 'Philippsburg', 'Philippsburg', 30500), -(2890, 51, 274, 'Plankstadt', 'Plankstadt', 30600), -(2891, 51, 274, 'Plochingen', 'Plochingen', 30700), -(2892, 51, 274, 'Radolfzell am Bodensee', 'Radolfzell am Bodensee', 30800), -(2893, 51, 274, 'Raich', 'Raich', 30900), -(2894, 51, 274, 'Rammingen', 'Rammingen', 31000), -(2895, 51, 274, 'Rastatt', 'Rastatt', 31100), -(2896, 51, 274, 'Ravensburg', 'Ravensburg', 31200), -(2897, 51, 274, 'Ravenstein', 'Ravenstein', 31300), -(2898, 51, 274, 'Reichenbach am Heuberg', 'Reichenbach am Heuberg', 31400), -(2899, 51, 274, 'Reichenbach an der Fils', 'Reichenbach an der Fils', 31500), -(2900, 51, 274, 'Reilingen', 'Reilingen', 31600), -(2901, 51, 274, 'Remchingen', 'Remchingen', 31700), -(2902, 51, 274, 'Renchen', 'Renchen', 31800), -(2903, 51, 274, 'Renningen', 'Renningen', 31900), -(2904, 51, 274, 'Reutlingen', 'Reutlingen', 32000), -(2905, 51, 274, 'Rheinfelden', 'Rheinfelden', 32100), -(2906, 51, 274, 'Riederich', 'Riederich', 32200), -(2907, 51, 274, 'Riedlingen', 'Riedlingen', 32300), -(2908, 51, 274, 'Rielasingen-Worblingen', 'Rielasingen-Worblingen', 32400), -(2909, 51, 274, 'Rmmingen', 'Rmmingen', 32500), -(2910, 51, 274, 'Rosenberg (73494)', 'Rosenberg (73494)', 32600), -(2911, 51, 274, 'Rosenfeld', 'Rosenfeld', 32700), -(2912, 51, 274, 'Rosengarten', 'Rosengarten', 32800), -(2913, 51, 274, 'Rottenburg am Neckar', 'Rottenburg am Neckar', 32900), -(2914, 51, 274, 'Rottweil', 'Rottweil', 33000), -(2915, 51, 274, 'Rust', 'Rust', 33100), -(2916, 51, 274, 'Sandhausen', 'Sandhausen', 33200), -(2917, 51, 274, 'Sankt Georgen im Schwarzwald', 'Sankt Georgen im Schwarzwald', 33300), -(2918, 51, 274, 'Sankt Leon-Rot', 'Sankt Leon-Rot', 33400), -(2919, 51, 274, 'Schelklingen', 'Schelklingen', 33500), -(2920, 51, 274, 'Schlier', 'Schlier', 33600), -(2921, 51, 274, 'Schluchsee', 'Schluchsee', 33700), -(2922, 51, 274, 'Schnau im Schwarzwald', 'Schnau im Schwarzwald', 33800), -(2923, 51, 274, 'Schopfheim', 'Schopfheim', 33900), -(2924, 51, 274, 'Schopfloch', 'Schopfloch', 34000), -(2925, 51, 274, 'Schorndorf', 'Schorndorf', 34100), -(2926, 51, 274, 'Schramberg', 'Schramberg', 34200), -(2927, 51, 274, 'Schrozberg', 'Schrozberg', 34300), -(2928, 51, 274, 'Schwaikheim', 'Schwaikheim', 34400), -(2929, 51, 274, 'Schwbisch Gmnd', 'Schwbisch Gmnd', 34500), -(2930, 51, 274, 'Schwbisch Hall', 'Schwbisch Hall', 34600), -(2931, 51, 274, 'Schwendi', 'Schwendi', 34700), -(2932, 51, 274, 'Schwenningen', 'Schwenningen', 34800), -(2933, 51, 274, 'Schwetzingen', 'Schwetzingen', 34900), -(2934, 51, 274, 'Sen', 'Sen', 35000), -(2935, 51, 274, 'Sexau', 'Sexau', 35100), -(2936, 51, 274, 'Sigmaringen', 'Sigmaringen', 35200), -(2937, 51, 274, 'Sindelfingen', 'Sindelfingen', 35300), -(2938, 51, 274, 'Singen', 'Singen', 35400), -(2939, 51, 274, 'Sinsheim', 'Sinsheim', 35500), -(2940, 51, 274, 'Spaichingen', 'Spaichingen', 35600), -(2941, 51, 274, 'Stdtlen', 'Stdtlen', 35700), -(2942, 51, 274, 'Steinenbronn', 'Steinenbronn', 35800), -(2943, 51, 274, 'Stockach', 'Stockach', 35900), -(2944, 51, 274, 'Straubenhardt', 'Straubenhardt', 36000), -(2945, 51, 274, 'stringen', 'stringen', 36100), -(2946, 51, 274, 'Stutensee', 'Stutensee', 36200), -(2947, 51, 274, 'Stuttgart', 'Stuttgart', 36300), -(2948, 51, 274, 'Sulz am Neckar', 'Sulz am Neckar', 36400), -(2949, 51, 274, 'Sulzbach-Laufen', 'Sulzbach-Laufen', 36500), -(2950, 51, 274, 'Talheim (74388)', 'Talheim (74388)', 36600), -(2951, 51, 274, 'Tauberbischofsheim', 'Tauberbischofsheim', 36700), -(2952, 51, 274, 'Tbingen', 'Tbingen', 36800), -(2953, 51, 274, 'Teningen', 'Teningen', 36900), -(2954, 51, 274, 'Tettnang', 'Tettnang', 37000), -(2955, 51, 274, 'tisheim', 'tisheim', 37100), -(2956, 51, 274, 'Titisee-Neustadt', 'Titisee-Neustadt', 37200), -(2957, 51, 274, 'Triberg', 'Triberg', 37300), -(2958, 51, 274, 'Trossingen', 'Trossingen', 37400), -(2959, 51, 274, 'Tuttlingen', 'Tuttlingen', 37500), -(2960, 51, 274, 'Ulm', 'Ulm', 37600), -(2961, 51, 274, 'Ummendorf', 'Ummendorf', 37700), -(2962, 51, 274, 'Unterkirnach', 'Unterkirnach', 37800), -(2963, 51, 274, 'Unterwachingen', 'Unterwachingen', 37900), -(2964, 51, 274, 'Urbach', 'Urbach', 38000), -(2965, 51, 274, 'Vaihingen an der Enz', 'Vaihingen an der Enz', 38100), -(2966, 51, 274, 'Vellberg', 'Vellberg', 38200), -(2967, 51, 274, 'Villingen-Schwenningen', 'Villingen-Schwenningen', 38300), -(2968, 51, 274, 'Volkertshausen', 'Volkertshausen', 38400), -(2969, 51, 274, 'Waghusel', 'Waghusel', 38500), -(2970, 51, 274, 'Waiblingen', 'Waiblingen', 38600), -(2971, 51, 274, 'Wain', 'Wain', 38700), -(2972, 51, 274, 'Wald', 'Wald', 38800), -(2973, 51, 274, 'Waldbronn', 'Waldbronn', 38900), -(2974, 51, 274, 'Waldenburg', 'Waldenburg', 39000), -(2975, 51, 274, 'Waldkirch', 'Waldkirch', 39100), -(2976, 51, 274, 'Waldshut-Tiengen', 'Waldshut-Tiengen', 39200), -(2977, 51, 274, 'Walldrn', 'Walldrn', 39300), -(2978, 51, 274, 'Wangen', 'Wangen', 39400), -(2979, 51, 274, 'Wangen im Allgu', 'Wangen im Allgu', 39500), -(2980, 51, 274, 'Wehingen', 'Wehingen', 39600), -(2981, 51, 274, 'Wehr', 'Wehr', 39700), -(2982, 51, 274, 'Weikersheim', 'Weikersheim', 39800), -(2983, 51, 274, 'Weil am Rhein', 'Weil am Rhein', 39900), -(2984, 51, 274, 'Weil der Stadt', 'Weil der Stadt', 40000), -(2985, 51, 274, 'Weingarten (76356)', 'Weingarten (76356)', 40100), -(2986, 51, 274, 'Weingarten (88250)', 'Weingarten (88250)', 40200), -(2987, 51, 274, 'Weinheim', 'Weinheim', 40300), -(2988, 51, 274, 'Weinsberg', 'Weinsberg', 40400), -(2989, 51, 274, 'Weinstadt', 'Weinstadt', 40500), -(2990, 51, 274, 'Welzheim', 'Welzheim', 40600), -(2991, 51, 274, 'Wendlingen am Neckar', 'Wendlingen am Neckar', 40700), -(2992, 51, 274, 'Wertheim', 'Wertheim', 40800), -(2993, 51, 274, 'Wiesloch', 'Wiesloch', 40900), -(2994, 51, 274, 'Wilhelmsfeld', 'Wilhelmsfeld', 41000), -(2995, 51, 274, 'Willsttt', 'Willsttt', 41100), -(2996, 51, 274, 'Wimsheim', 'Wimsheim', 41200), -(2997, 51, 274, 'Winnenden', 'Winnenden', 41300), -(2998, 51, 274, 'Wolfach', 'Wolfach', 41400), -(2999, 51, 274, 'Wrt', 'Wrt', 41500), -(3000, 51, 274, 'Wyhl am Kaiserstuhl', 'Wyhl am Kaiserstuhl', 41600), -(3001, 51, 274, 'Zaberfeld', 'Zaberfeld', 41700), -(3002, 51, 274, 'Zell am Harmersbach', 'Zell am Harmersbach', 41800), -(3003, 51, 274, 'Zell im Wiesental', 'Zell im Wiesental', 41900), -(3004, 51, 274, 'Zell unter Aichelberg', 'Zell unter Aichelberg', 42000), -(3005, 51, 274, 'Zuzenhausen', 'Zuzenhausen', 42100), -(3006, 51, 275, 'Abenberg', 'Abenberg', 100), -(3007, 51, 275, 'Abensberg', 'Abensberg', 200), -(3008, 51, 275, 'Absberg', 'Absberg', 300), -(3009, 51, 275, 'Abtswind', 'Abtswind', 400), -(3010, 51, 275, 'Achslach', 'Achslach', 500), -(3011, 51, 275, 'Adelschlag', 'Adelschlag', 600), -(3012, 51, 275, 'Adelsried', 'Adelsried', 700), -(3013, 51, 275, 'Affing', 'Affing', 800), -(3014, 51, 275, 'Aham', 'Aham', 900), -(3015, 51, 275, 'Aholfing', 'Aholfing', 1000), -(3016, 51, 275, 'Ahorn', 'Ahorn', 1100), -(3017, 51, 275, 'Aicha vorm Wald', 'Aicha vorm Wald', 1200), -(3018, 51, 275, 'Aichach', 'Aichach', 1300), -(3019, 51, 275, 'Aichen', 'Aichen', 1400), -(3020, 51, 275, 'Aidenbach', 'Aidenbach', 1500), -(3021, 51, 275, 'Aidhausen', 'Aidhausen', 1600), -(3022, 51, 275, 'Aiglsbach', 'Aiglsbach', 1700), -(3023, 51, 275, 'Aindling', 'Aindling', 1800), -(3024, 51, 275, 'Ainring', 'Ainring', 1900), -(3025, 51, 275, 'Aislingen', 'Aislingen', 2000), -(3026, 51, 275, 'Alesheim', 'Alesheim', 2100), -(3027, 51, 275, 'Allershausen', 'Allershausen', 2200), -(3028, 51, 275, 'Altdorf (84032)', 'Altdorf (84032)', 2300), -(3029, 51, 275, 'Altdorf (90518)', 'Altdorf (90518)', 2400), -(3030, 51, 275, 'Altenbuch', 'Altenbuch', 2500), -(3031, 51, 275, 'Altendorf (96146)', 'Altendorf (96146)', 2600), -(3032, 51, 275, 'Altenmarkt an der Alz', 'Altenmarkt an der Alz', 2700), -(3033, 51, 275, 'Altenmnster', 'Altenmnster', 2800), -(3034, 51, 275, 'Altenstadt an der Waldnaab', 'Altenstadt an der Waldnaab', 2900), -(3035, 51, 275, 'Altertheim', 'Altertheim', 3000), -(3036, 51, 275, 'Alttting', 'Alttting', 3100), -(3037, 51, 275, 'Amberg (86854)', 'Amberg (86854)', 3200), -(3038, 51, 275, 'Amberg (92224)', 'Amberg (92224)', 3300), -(3039, 51, 275, 'Ansbach', 'Ansbach', 3400), -(3040, 51, 275, 'Antdorf', 'Antdorf', 3500), -(3041, 51, 275, 'Arnstorf', 'Arnstorf', 3600), -(3042, 51, 275, 'Asbach-Bumenheim', 'Asbach-Bumenheim', 3700), -(3043, 51, 275, 'Ascha', 'Ascha', 3800), -(3044, 51, 275, 'Aschaffenburg', 'Aschaffenburg', 3900), -(3045, 51, 275, 'Auerbach', 'Auerbach', 4000), -(3046, 51, 275, 'Augsburg', 'Augsburg', 4100), -(3047, 51, 275, 'Baar-Ebenhausen', 'Baar-Ebenhausen', 4200), -(3048, 51, 275, 'Babenhausen', 'Babenhausen', 4300), -(3049, 51, 275, 'Bach an der Donau', 'Bach an der Donau', 4400), -(3050, 51, 275, 'Bachhagel', 'Bachhagel', 4500), -(3051, 51, 275, 'Bad Abbach', 'Bad Abbach', 4600), -(3052, 51, 275, 'Bad Aibling', 'Bad Aibling', 4700), -(3053, 51, 275, 'Bad Alexandersbad', 'Bad Alexandersbad', 4800), -(3054, 51, 275, 'Bad Berneck im Fichtelgebirge', 'Bad Berneck im Fichtelgebirge', 4900), -(3055, 51, 275, 'Bad Birnbach', 'Bad Birnbach', 5000), -(3056, 51, 275, 'Bad Bocklet', 'Bad Bocklet', 5100), -(3057, 51, 275, 'Bad Brckenau', 'Bad Brckenau', 5200), -(3058, 51, 275, 'Bad Fssing', 'Bad Fssing', 5300), -(3059, 51, 275, 'Bad Griesbach im Rottal', 'Bad Griesbach im Rottal', 5400), -(3060, 51, 275, 'Bad Grnenbach', 'Bad Grnenbach', 5500), -(3061, 51, 275, 'Bad Kissingen', 'Bad Kissingen', 5600), -(3062, 51, 275, 'Bad Knigshofen im Grabfeld', 'Bad Knigshofen im Grabfeld', 5700), -(3063, 51, 275, 'Bad Neustadt an der Saale', 'Bad Neustadt an der Saale', 5800), -(3064, 51, 275, 'Bad Reichenhall', 'Bad Reichenhall', 5900), -(3065, 51, 275, 'Bad Rodach', 'Bad Rodach', 6000), -(3066, 51, 275, 'Bad Tlz', 'Bad Tlz', 6100), -(3067, 51, 275, 'Bad Windsheim', 'Bad Windsheim', 6200), -(3068, 51, 275, 'Bad Wrishofen', 'Bad Wrishofen', 6300), -(3069, 51, 275, 'Baiern', 'Baiern', 6400), -(3070, 51, 275, 'Bamberg', 'Bamberg', 6500), -(3071, 51, 275, 'Baunach', 'Baunach', 6600), -(3072, 51, 275, 'Bayerisch Eisenstein', 'Bayerisch Eisenstein', 6700), -(3073, 51, 275, 'Bayerisch Gmain', 'Bayerisch Gmain', 6800), -(3074, 51, 275, 'Bayreuth', 'Bayreuth', 6900), -(3075, 51, 275, 'Bbing', 'Bbing', 7000), -(3076, 51, 275, 'Berchtesgaden', 'Berchtesgaden', 7100), -(3077, 51, 275, 'Berg (82335)', 'Berg (82335)', 7200), -(3078, 51, 275, 'Berg bei Neumarkt in der Oberpfalz', 'Berg bei Neumarkt in der Oberpfalz', 7300), -(3079, 51, 275, 'Bindlach', 'Bindlach', 7400), -(3080, 51, 275, 'Bischofsheim an der Rhn', 'Bischofsheim an der Rhn', 7500), -(3081, 51, 275, 'Bobingen', 'Bobingen', 7600), -(3082, 51, 275, 'Bodenkirchen', 'Bodenkirchen', 7700), -(3083, 51, 275, 'Bodenwhr', 'Bodenwhr', 7800), -(3084, 51, 275, 'Bogen', 'Bogen', 7900), -(3085, 51, 275, 'Bonstetten', 'Bonstetten', 8000), -(3086, 51, 275, 'Boos', 'Boos', 8100), -(3087, 51, 275, 'Brnau', 'Brnau', 8200), -(3088, 51, 275, 'Bruck', 'Bruck', 8300), -(3089, 51, 275, 'Bruckmhl', 'Bruckmhl', 8400), -(3090, 51, 275, 'Buchloe', 'Buchloe', 8500), -(3091, 51, 275, 'Burgau', 'Burgau', 8600), -(3092, 51, 275, 'Burghausen', 'Burghausen', 8700), -(3093, 51, 275, 'Burgkirchen an der Alz', 'Burgkirchen an der Alz', 8800), -(3094, 51, 275, 'Burgkunstadt', 'Burgkunstadt', 8900), -(3095, 51, 275, 'Burglengenfeld', 'Burglengenfeld', 9000), -(3096, 51, 275, 'Cadolzburg', 'Cadolzburg', 9100), -(3097, 51, 275, 'Cham', 'Cham', 9200), -(3098, 51, 275, 'Chamerau', 'Chamerau', 9300), -(3099, 51, 275, 'Coburg', 'Coburg', 9400), -(3100, 51, 275, 'Creuen', 'Creuen', 9500), -(3101, 51, 275, 'Dachau', 'Dachau', 9600), -(3102, 51, 275, 'Dasing', 'Dasing', 9700), -(3103, 51, 275, 'Deggendorf', 'Deggendorf', 9800), -(3104, 51, 275, 'Denkendorf', 'Denkendorf', 9900), -(3105, 51, 275, 'Dillingen an der Donau', 'Dillingen an der Donau', 10000), -(3106, 51, 275, 'Dingolfing', 'Dingolfing', 10100), -(3107, 51, 275, 'Dinkelsbhl', 'Dinkelsbhl', 10200), -(3108, 51, 275, 'Dittelbrunn', 'Dittelbrunn', 10300), -(3109, 51, 275, 'Donauwrth', 'Donauwrth', 10400), -(3110, 51, 275, 'Drfles-Esbach', 'Drfles-Esbach', 10500), -(3111, 51, 275, 'Duggendorf', 'Duggendorf', 10600), -(3112, 51, 275, 'Durach', 'Durach', 10700), -(3113, 51, 275, 'Eching (84174)', 'Eching (84174)', 10800), -(3114, 51, 275, 'Eggenfelden', 'Eggenfelden', 10900), -(3115, 51, 275, 'Eichsttt', 'Eichsttt', 11000), -(3116, 51, 275, 'Eiselfing', 'Eiselfing', 11100), -(3117, 51, 275, 'Elsenfeld', 'Elsenfeld', 11200), -(3118, 51, 275, 'Eltmann', 'Eltmann', 11300), -(3119, 51, 275, 'Erding', 'Erding', 11400), -(3120, 51, 275, 'Ergersheim', 'Ergersheim', 11500), -(3121, 51, 275, 'Erlangen', 'Erlangen', 11600), -(3122, 51, 275, 'Erlenbach am Main', 'Erlenbach am Main', 11700), -(3123, 51, 275, 'Essenbach', 'Essenbach', 11800), -(3124, 51, 275, 'Feucht', 'Feucht', 11900), -(3125, 51, 275, 'Feuchtwangen', 'Feuchtwangen', 12000), -(3126, 51, 275, 'Fichtelberg', 'Fichtelberg', 12100), -(3127, 51, 275, 'Forchheim', 'Forchheim', 12200), -(3128, 51, 275, 'Forheim', 'Forheim', 12300), -(3129, 51, 275, 'Freilassing', 'Freilassing', 12400), -(3130, 51, 275, 'Freising', 'Freising', 12500), -(3131, 51, 275, 'Frickenhausen am Main', 'Frickenhausen am Main', 12600), -(3132, 51, 275, 'Friedberg', 'Friedberg', 12700), -(3133, 51, 275, 'Frstenfeldbruck', 'Frstenfeldbruck', 12800), -(3134, 51, 275, 'Frth', 'Frth', 12900), -(3135, 51, 275, 'Fssen', 'Fssen', 13000), -(3136, 51, 275, 'Fuchsstadt', 'Fuchsstadt', 13100), -(3137, 51, 275, 'Furth', 'Furth', 13200), -(3138, 51, 275, 'Furth im Wald', 'Furth im Wald', 13300), -(3139, 51, 275, 'Gaimersheim', 'Gaimersheim', 13400), -(3140, 51, 275, 'Garching an der Alz', 'Garching an der Alz', 13500), -(3141, 51, 275, 'Garmisch-Partenkirchen', 'Garmisch-Partenkirchen', 13600), -(3142, 51, 275, 'Gdheim', 'Gdheim', 13700), -(3143, 51, 275, 'Gefrees', 'Gefrees', 13800), -(3144, 51, 275, 'Geiselwind', 'Geiselwind', 13900), -(3145, 51, 275, 'Gemnden am Main', 'Gemnden am Main', 14000), -(3146, 51, 275, 'Geretsried', 'Geretsried', 14100), -(3147, 51, 275, 'Germering', 'Germering', 14200), -(3148, 51, 275, 'Geroda', 'Geroda', 14300), -(3149, 51, 275, 'Gerolzhofen', 'Gerolzhofen', 14400), -(3150, 51, 275, 'Gersthofen', 'Gersthofen', 14500), -(3151, 51, 275, 'Glonn', 'Glonn', 14600), -(3152, 51, 275, 'Gnzburg', 'Gnzburg', 14700), -(3153, 51, 275, 'Gochsheim', 'Gochsheim', 14800), -(3154, 51, 275, 'Graben', 'Graben', 14900), -(3155, 51, 275, 'Grafenau', 'Grafenau', 15000), -(3156, 51, 275, 'Grafenrheinfeld', 'Grafenrheinfeld', 15100), -(3157, 51, 275, 'Grafenwhr', 'Grafenwhr', 15200), -(3158, 51, 275, 'Grnwald', 'Grnwald', 15300), -(3159, 51, 275, 'Groenseebach', 'Groenseebach', 15400), -(3160, 51, 275, 'Gromehring', 'Gromehring', 15500), -(3161, 51, 275, 'Groostheim', 'Groostheim', 15600), -(3162, 51, 275, 'Gunzenhausen', 'Gunzenhausen', 15700), -(3163, 51, 275, 'Haag', 'Haag', 15800), -(3164, 51, 275, 'Hafurt', 'Hafurt', 15900), -(3165, 51, 275, 'Hahnbach', 'Hahnbach', 16000), -(3166, 51, 275, 'Hammelburg', 'Hammelburg', 16100), -(3167, 51, 275, 'Hausham', 'Hausham', 16200), -(3168, 51, 275, 'Hchstadt an der Aisch', 'Hchstadt an der Aisch', 16300), -(3169, 51, 275, 'Hchstdt an der Donau', 'Hchstdt an der Donau', 16400), -(3170, 51, 275, 'Heilsbronn', 'Heilsbronn', 16500), -(3171, 51, 275, 'Heimenkirch', 'Heimenkirch', 16600), -(3172, 51, 275, 'Hemau', 'Hemau', 16700), -(3173, 51, 275, 'Hengersberg', 'Hengersberg', 16800), -(3174, 51, 275, 'Heroldsberg', 'Heroldsberg', 16900), -(3175, 51, 275, 'Hersbruck', 'Hersbruck', 17000), -(3176, 51, 275, 'Herzogenaurach', 'Herzogenaurach', 17100), -(3177, 51, 275, 'Hilpoltstein', 'Hilpoltstein', 17200), -(3178, 51, 275, 'Himmelstadt', 'Himmelstadt', 17300), -(3179, 51, 275, 'Hirschaid', 'Hirschaid', 17400), -(3180, 51, 275, 'Hof', 'Hof', 17500), -(3181, 51, 275, 'Holzkirchen (83607)', 'Holzkirchen (83607)', 17600), -(3182, 51, 275, 'Ichenhausen', 'Ichenhausen', 17700), -(3183, 51, 275, 'Igling', 'Igling', 17800), -(3184, 51, 275, 'Illertissen', 'Illertissen', 17900), -(3185, 51, 275, 'Immenstadt im Allgu', 'Immenstadt im Allgu', 18000), -(3186, 51, 275, 'Ingolstadt', 'Ingolstadt', 18100), -(3187, 51, 275, 'Innernzell', 'Innernzell', 18200), -(3188, 51, 275, 'Iphofen', 'Iphofen', 18300), -(3189, 51, 275, 'Irschenberg', 'Irschenberg', 18400), -(3190, 51, 275, 'Kaisheim', 'Kaisheim', 18500), -(3191, 51, 275, 'Kammeltal', 'Kammeltal', 18600), -(3192, 51, 275, 'Karlstadt', 'Karlstadt', 18700), -(3193, 51, 275, 'Kaufbeuren', 'Kaufbeuren', 18800), -(3194, 51, 275, 'Kaufering', 'Kaufering', 18900), -(3195, 51, 275, 'Kelheim', 'Kelheim', 19000), -(3196, 51, 275, 'Kellmnz', 'Kellmnz', 19100), -(3197, 51, 275, 'Kempten', 'Kempten', 19200), -(3198, 51, 275, 'Kfering', 'Kfering', 19300), -(3199, 51, 275, 'Kinsau', 'Kinsau', 19400), -(3200, 51, 275, 'Kirchdorf am Inn', 'Kirchdorf am Inn', 19500), -(3201, 51, 275, 'Kirchheim in Schwaben', 'Kirchheim in Schwaben', 19600), -(3202, 51, 275, 'Kist', 'Kist', 19700), -(3203, 51, 275, 'Kitzingen', 'Kitzingen', 19800); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(3204, 51, 275, 'Knetzgau', 'Knetzgau', 19900), -(3205, 51, 275, 'Knigsbrunn', 'Knigsbrunn', 20000), -(3206, 51, 275, 'Kolbermoor', 'Kolbermoor', 20100), -(3207, 51, 275, 'Kps', 'Kps', 20200), -(3208, 51, 275, 'Kronach', 'Kronach', 20300), -(3209, 51, 275, 'Krumbach', 'Krumbach', 20400), -(3210, 51, 275, 'Ksching', 'Ksching', 20500), -(3211, 51, 275, 'Kulmbach', 'Kulmbach', 20600), -(3212, 51, 275, 'Lalling', 'Lalling', 20700), -(3213, 51, 275, 'Landau an der Isar', 'Landau an der Isar', 20800), -(3214, 51, 275, 'Landsberg am Lech', 'Landsberg am Lech', 20900), -(3215, 51, 275, 'Landshut', 'Landshut', 21000), -(3216, 51, 275, 'Langquaid', 'Langquaid', 21100), -(3217, 51, 275, 'Lauf an der Pegnitz', 'Lauf an der Pegnitz', 21200), -(3218, 51, 275, 'Lauingen (Donau)', 'Lauingen (Donau)', 21300), -(3219, 51, 275, 'Lehrberg', 'Lehrberg', 21400), -(3220, 51, 275, 'Leipheim', 'Leipheim', 21500), -(3221, 51, 275, 'Lichtenfels', 'Lichtenfels', 21600), -(3222, 51, 275, 'Lindau (Bodensee)', 'Lindau (Bodensee)', 21700), -(3223, 51, 275, 'Lindenberg im Allgu', 'Lindenberg im Allgu', 21800), -(3224, 51, 275, 'Mainaschaff', 'Mainaschaff', 21900), -(3225, 51, 275, 'Mainburg', 'Mainburg', 22000), -(3226, 51, 275, 'Mainleus', 'Mainleus', 22100), -(3227, 51, 275, 'Mallersdorf-Pfaffenberg', 'Mallersdorf-Pfaffenberg', 22200), -(3228, 51, 275, 'Mamming', 'Mamming', 22300), -(3229, 51, 275, 'Manching', 'Manching', 22400), -(3230, 51, 275, 'Marktheidenfeld', 'Marktheidenfeld', 22500), -(3231, 51, 275, 'Marktoberdorf', 'Marktoberdorf', 22600), -(3232, 51, 275, 'Marktredwitz', 'Marktredwitz', 22700), -(3233, 51, 275, 'Massing', 'Massing', 22800), -(3234, 51, 275, 'Mellrichstadt', 'Mellrichstadt', 22900), -(3235, 51, 275, 'Memmingen', 'Memmingen', 23000), -(3236, 51, 275, 'Memmingerberg', 'Memmingerberg', 23100), -(3237, 51, 275, 'Mering', 'Mering', 23200), -(3238, 51, 275, 'Merkendorf', 'Merkendorf', 23300), -(3239, 51, 275, 'Metten', 'Metten', 23400), -(3240, 51, 275, 'Mhldorf am Inn', 'Mhldorf am Inn', 23500), -(3241, 51, 275, 'Michelsneukirchen', 'Michelsneukirchen', 23600), -(3242, 51, 275, 'Miesbach', 'Miesbach', 23700), -(3243, 51, 275, 'Miltenberg', 'Miltenberg', 23800), -(3244, 51, 275, 'Mindelheim', 'Mindelheim', 23900), -(3245, 51, 275, 'Mitterteich', 'Mitterteich', 24000), -(3246, 51, 275, 'Mmbris', 'Mmbris', 24100), -(3247, 51, 275, 'Mnchberg', 'Mnchberg', 24200), -(3248, 51, 275, 'Mnchen', 'Mnchen', 24300), -(3249, 51, 275, 'Mnnerstadt', 'Mnnerstadt', 24400), -(3250, 51, 275, 'Mnster', 'Mnster', 24500), -(3251, 51, 275, 'Moorenweis', 'Moorenweis', 24600), -(3252, 51, 275, 'Nabburg', 'Nabburg', 24700), -(3253, 51, 275, 'Naila', 'Naila', 24800), -(3254, 51, 275, 'Ndlingen', 'Ndlingen', 24900), -(3255, 51, 275, 'Neu-Ulm', 'Neu-Ulm', 25000), -(3256, 51, 275, 'Neubiberg', 'Neubiberg', 25100), -(3257, 51, 275, 'Neuburg an der Donau', 'Neuburg an der Donau', 25200), -(3258, 51, 275, 'Neuendettelsau', 'Neuendettelsau', 25300), -(3259, 51, 275, 'Neumarkt in der Oberpfalz', 'Neumarkt in der Oberpfalz', 25400), -(3260, 51, 275, 'Neumarkt-Sankt Veit', 'Neumarkt-Sankt Veit', 25500), -(3261, 51, 275, 'Neunburg vorm Wald', 'Neunburg vorm Wald', 25600), -(3262, 51, 275, 'Neuried', 'Neuried', 25700), -(3263, 51, 275, 'Neus', 'Neus', 25800), -(3264, 51, 275, 'Neustadt an der Aisch', 'Neustadt an der Aisch', 25900), -(3265, 51, 275, 'Neustadt an der Donau', 'Neustadt an der Donau', 26000), -(3266, 51, 275, 'Neustadt an der Waldnaab', 'Neustadt an der Waldnaab', 26100), -(3267, 51, 275, 'Neustadt bei Coburg', 'Neustadt bei Coburg', 26200), -(3268, 51, 275, 'Neutraubling', 'Neutraubling', 26300), -(3269, 51, 275, 'Neutting', 'Neutting', 26400), -(3270, 51, 275, 'Niederwerrn', 'Niederwerrn', 26500), -(3271, 51, 275, 'Nittenau', 'Nittenau', 26600), -(3272, 51, 275, 'Nittendorf', 'Nittendorf', 26700), -(3273, 51, 275, 'Nrdlingen', 'Nrdlingen', 26800), -(3274, 51, 275, 'Nrnberg', 'Nrnberg', 26900), -(3275, 51, 275, 'Nudorf am Inn', 'Nudorf am Inn', 27000), -(3276, 51, 275, 'Oberaudorf', 'Oberaudorf', 27100), -(3277, 51, 275, 'Oberhaid', 'Oberhaid', 27200), -(3278, 51, 275, 'Obernbreit', 'Obernbreit', 27300), -(3279, 51, 275, 'Oberndorf am Lech', 'Oberndorf am Lech', 27400), -(3280, 51, 275, 'Obernzenn', 'Obernzenn', 27500), -(3281, 51, 275, 'Oberschleiheim', 'Oberschleiheim', 27600), -(3282, 51, 275, 'Oberstaufen', 'Oberstaufen', 27700), -(3283, 51, 275, 'Oberviechtach', 'Oberviechtach', 27800), -(3284, 51, 275, 'Ochsenfurt', 'Ochsenfurt', 27900), -(3285, 51, 275, 'Oerlenbach', 'Oerlenbach', 28000), -(3286, 51, 275, 'Oettingen in Bayern', 'Oettingen in Bayern', 28100), -(3287, 51, 275, 'Ottobeuren', 'Ottobeuren', 28200), -(3288, 51, 275, 'Ottobrunn', 'Ottobrunn', 28300), -(3289, 51, 275, 'Passau', 'Passau', 28400), -(3290, 51, 275, 'Pegnitz', 'Pegnitz', 28500), -(3291, 51, 275, 'Peiting', 'Peiting', 28600), -(3292, 51, 275, 'Pentling', 'Pentling', 28700), -(3293, 51, 275, 'Penzberg', 'Penzberg', 28800), -(3294, 51, 275, 'Pfaffenhofen an der Ilm', 'Pfaffenhofen an der Ilm', 28900), -(3295, 51, 275, 'Pfarrkirchen', 'Pfarrkirchen', 29000), -(3296, 51, 275, 'Pilsach', 'Pilsach', 29100), -(3297, 51, 275, 'Plattling', 'Plattling', 29200), -(3298, 51, 275, 'Pocking', 'Pocking', 29300), -(3299, 51, 275, 'Prien am Chiemsee', 'Prien am Chiemsee', 29400), -(3300, 51, 275, 'Randersacker', 'Randersacker', 29500), -(3301, 51, 275, 'Rednitzhembach', 'Rednitzhembach', 29600), -(3302, 51, 275, 'Regen', 'Regen', 29700), -(3303, 51, 275, 'Regensburg', 'Regensburg', 29800), -(3304, 51, 275, 'Regenstauf', 'Regenstauf', 29900), -(3305, 51, 275, 'Reisbach', 'Reisbach', 30000), -(3306, 51, 275, 'Riedenburg', 'Riedenburg', 30100), -(3307, 51, 275, 'Robach', 'Robach', 30200), -(3308, 51, 275, 'Roding', 'Roding', 30300), -(3309, 51, 275, 'Rosenheim', 'Rosenheim', 30400), -(3310, 51, 275, 'Roth', 'Roth', 30500), -(3311, 51, 275, 'Rothenburg ob der Tauber', 'Rothenburg ob der Tauber', 30600), -(3312, 51, 275, 'Ruhstorf an der Rott', 'Ruhstorf an der Rott', 30700), -(3313, 51, 275, 'Scheinfeld', 'Scheinfeld', 30800), -(3314, 51, 275, 'Schlsselfeld', 'Schlsselfeld', 30900), -(3315, 51, 275, 'Schmidmhlen', 'Schmidmhlen', 31000), -(3316, 51, 275, 'Schnberg (94513)', 'Schnberg (94513)', 31100), -(3317, 51, 275, 'Schnsee', 'Schnsee', 31200), -(3318, 51, 275, 'Schongau', 'Schongau', 31300), -(3319, 51, 275, 'Schrobenhausen', 'Schrobenhausen', 31400), -(3320, 51, 275, 'Schwabach', 'Schwabach', 31500), -(3321, 51, 275, 'Schwabmnchen', 'Schwabmnchen', 31600), -(3322, 51, 275, 'Schwandorf', 'Schwandorf', 31700), -(3323, 51, 275, 'Schwanstetten', 'Schwanstetten', 31800), -(3324, 51, 275, 'Schwarzach', 'Schwarzach', 31900), -(3325, 51, 275, 'Schwarzenfeld', 'Schwarzenfeld', 32000), -(3326, 51, 275, 'Schwebheim', 'Schwebheim', 32100), -(3327, 51, 275, 'Schweinfurt', 'Schweinfurt', 32200), -(3328, 51, 275, 'Selb', 'Selb', 32300), -(3329, 51, 275, 'Senden', 'Senden', 32400), -(3330, 51, 275, 'Sennfeld', 'Sennfeld', 32500), -(3331, 51, 275, 'Simbach am Inn', 'Simbach am Inn', 32600), -(3332, 51, 275, 'Sommerhausen', 'Sommerhausen', 32700), -(3333, 51, 275, 'Sonthofen', 'Sonthofen', 32800), -(3334, 51, 275, 'Stammham (84533)', 'Stammham (84533)', 32900), -(3335, 51, 275, 'Starnberg', 'Starnberg', 33000), -(3336, 51, 275, 'Stein bei Nrnberg', 'Stein bei Nrnberg', 33100), -(3337, 51, 275, 'Straubing', 'Straubing', 33200), -(3338, 51, 275, 'Sulzbach am Main', 'Sulzbach am Main', 33300), -(3339, 51, 275, 'Sulzbach-Rosenberg', 'Sulzbach-Rosenberg', 33400), -(3340, 51, 275, 'Tacherting', 'Tacherting', 33500), -(3341, 51, 275, 'Teisnach', 'Teisnach', 33600), -(3342, 51, 275, 'Tging am Inn', 'Tging am Inn', 33700), -(3343, 51, 275, 'Thannhausen', 'Thannhausen', 33800), -(3344, 51, 275, 'Thanstein', 'Thanstein', 33900), -(3345, 51, 275, 'Tirschenreuth', 'Tirschenreuth', 34000), -(3346, 51, 275, 'Tittmoning', 'Tittmoning', 34100), -(3347, 51, 275, 'Traunreut', 'Traunreut', 34200), -(3348, 51, 275, 'Traunstein', 'Traunstein', 34300), -(3349, 51, 275, 'Treuchtlingen', 'Treuchtlingen', 34400), -(3350, 51, 275, 'Trkheim', 'Trkheim', 34500), -(3351, 51, 275, 'Trostberg', 'Trostberg', 34600), -(3352, 51, 275, 'Tussenhausen', 'Tussenhausen', 34700), -(3353, 51, 275, 'Uffenheim', 'Uffenheim', 34800), -(3354, 51, 275, 'Unterhaching', 'Unterhaching', 34900), -(3355, 51, 275, 'Untersteinach', 'Untersteinach', 35000), -(3356, 51, 275, 'Vhringen', 'Vhringen', 35100), -(3357, 51, 275, 'Viechtach', 'Viechtach', 35200), -(3358, 51, 275, 'Vilseck', 'Vilseck', 35300), -(3359, 51, 275, 'Vilshofen', 'Vilshofen', 35400), -(3360, 51, 275, 'Vohenstrau', 'Vohenstrau', 35500), -(3361, 51, 275, 'Waldkraiburg', 'Waldkraiburg', 35600), -(3362, 51, 275, 'Wallersdorf', 'Wallersdorf', 35700), -(3363, 51, 275, 'Wasserburg am Inn', 'Wasserburg am Inn', 35800), -(3364, 51, 275, 'Wassertrdingen', 'Wassertrdingen', 35900), -(3365, 51, 275, 'Weiden', 'Weiden', 36000), -(3366, 51, 275, 'Weienburg in Bayern', 'Weienburg in Bayern', 36100), -(3367, 51, 275, 'Weienhorn', 'Weienhorn', 36200), -(3368, 51, 275, 'Weiensberg', 'Weiensberg', 36300), -(3369, 51, 275, 'Weilheim in Oberbayern', 'Weilheim in Oberbayern', 36400), -(3370, 51, 275, 'Welden', 'Welden', 36500), -(3371, 51, 275, 'Wemding', 'Wemding', 36600), -(3372, 51, 275, 'Wernberg-Kblitz', 'Wernberg-Kblitz', 36700), -(3373, 51, 275, 'Wertach', 'Wertach', 36800), -(3374, 51, 275, 'Wiggensbach', 'Wiggensbach', 36900), -(3375, 51, 275, 'Wildflecken', 'Wildflecken', 37000), -(3376, 51, 275, 'Windsbach', 'Windsbach', 37100), -(3377, 51, 275, 'Winhring', 'Winhring', 37200), -(3378, 51, 275, 'Wittibreut', 'Wittibreut', 37300), -(3379, 51, 275, 'Wolnzach', 'Wolnzach', 37400), -(3380, 51, 275, 'Wrth an der Donau', 'Wrth an der Donau', 37500), -(3381, 51, 275, 'Wrzburg', 'Wrzburg', 37600), -(3382, 51, 275, 'Wunsiedel', 'Wunsiedel', 37700), -(3383, 51, 275, 'Zeil am Main', 'Zeil am Main', 37800), -(3384, 51, 275, 'Zell am Main', 'Zell am Main', 37900), -(3385, 51, 275, 'Zellingen', 'Zellingen', 38000), -(3386, 51, 275, 'Zirndorf', 'Zirndorf', 38100), -(3387, 51, 275, 'Zwiesel', 'Zwiesel', 38200), -(3388, 51, 276, 'Berlin', 'Berlin', 100), -(3389, 51, 277, 'Ahrensfelde', 'Ahrensfelde', 100), -(3390, 51, 277, 'Alt Tucheband', 'Alt Tucheband', 200), -(3391, 51, 277, 'Alt Zauche', 'Alt Zauche', 300), -(3392, 51, 277, 'Altenhof', 'Altenhof', 400), -(3393, 51, 277, 'Altglietzen', 'Altglietzen', 500), -(3394, 51, 277, 'Altlandsberg', 'Altlandsberg', 600), -(3395, 51, 277, 'Arenzhain', 'Arenzhain', 700), -(3396, 51, 277, 'Babben', 'Babben', 800), -(3397, 51, 277, 'Bad Freienwalde', 'Bad Freienwalde', 900), -(3398, 51, 277, 'Bad Liebenwerda', 'Bad Liebenwerda', 1000), -(3399, 51, 277, 'Bad Saarow', 'Bad Saarow', 1100), -(3400, 51, 277, 'Bad Wilsnack', 'Bad Wilsnack', 1200), -(3401, 51, 277, 'Basdorf', 'Basdorf', 1300), -(3402, 51, 277, 'Beelitz', 'Beelitz', 1400), -(3403, 51, 277, 'Beiersdorf-Freudenberg', 'Beiersdorf-Freudenberg', 1500), -(3404, 51, 277, 'Belzig', 'Belzig', 1600), -(3405, 51, 277, 'Bernau', 'Bernau', 1700), -(3406, 51, 277, 'Bliesdorf', 'Bliesdorf', 1800), -(3407, 51, 277, 'Brandenburg an der Havel', 'Brandenburg an der Havel', 1900), -(3408, 51, 277, 'Brenklau', 'Brenklau', 2000), -(3409, 51, 277, 'Cottbus', 'Cottbus', 2100), -(3410, 51, 277, 'Doberlug-Kirchhain', 'Doberlug-Kirchhain', 2200), -(3411, 51, 277, 'Drewitz', 'Drewitz', 2300), -(3412, 51, 277, 'Eberswalde', 'Eberswalde', 2400), -(3413, 51, 277, 'Eisenhttenstadt', 'Eisenhttenstadt', 2500), -(3414, 51, 277, 'Elsterwerda', 'Elsterwerda', 2600), -(3415, 51, 277, 'Fahrland', 'Fahrland', 2700), -(3416, 51, 277, 'Falkensee', 'Falkensee', 2800), -(3417, 51, 277, 'Finsterwalde', 'Finsterwalde', 2900), -(3418, 51, 277, 'Forst (Lausitz)', 'Forst (Lausitz)', 3000), -(3419, 51, 277, 'Frankfurt (Oder)', 'Frankfurt (Oder)', 3100), -(3420, 51, 277, 'Frstenwalde/Spree', 'Frstenwalde/Spree', 3200), -(3421, 51, 277, 'Gartz (Oder)', 'Gartz (Oder)', 3300), -(3422, 51, 277, 'Grobeeren', 'Grobeeren', 3400), -(3423, 51, 277, 'Grorschen', 'Grorschen', 3500), -(3424, 51, 277, 'Guben', 'Guben', 3600), -(3425, 51, 277, 'Guhrow', 'Guhrow', 3700), -(3426, 51, 277, 'Helle', 'Helle', 3800), -(3427, 51, 277, 'Hermsdorf', 'Hermsdorf', 3900), -(3428, 51, 277, 'Herzberg (Elster)', 'Herzberg (Elster)', 4000), -(3429, 51, 277, 'Hohen Neuendorf', 'Hohen Neuendorf', 4100), -(3430, 51, 277, 'Jterbog', 'Jterbog', 4200), -(3431, 51, 277, 'Kasel-Golzig', 'Kasel-Golzig', 4300), -(3432, 51, 277, 'Kehrberg', 'Kehrberg', 4400), -(3433, 51, 277, 'Kloster Lehnin', 'Kloster Lehnin', 4500), -(3434, 51, 277, 'Knigs Wusterhausen', 'Knigs Wusterhausen', 4600), -(3435, 51, 277, 'Kyritz', 'Kyritz', 4700), -(3436, 51, 277, 'Kyritz', 'Kyritz', 4800), -(3437, 51, 277, 'Lauchhammer', 'Lauchhammer', 4900), -(3438, 51, 277, 'Lbben (Spreewald)', 'Lbben (Spreewald)', 5000), -(3439, 51, 277, 'Lbbenau/Spreewald', 'Lbbenau/Spreewald', 5100), -(3440, 51, 277, 'Luckau', 'Luckau', 5200), -(3441, 51, 277, 'Luckenwalde', 'Luckenwalde', 5300), -(3442, 51, 277, 'Neuhardenberg', 'Neuhardenberg', 5400), -(3443, 51, 277, 'Neuruppin', 'Neuruppin', 5500), -(3444, 51, 277, 'Oranienburg', 'Oranienburg', 5600), -(3445, 51, 277, 'Ponnsdorf', 'Ponnsdorf', 5700), -(3446, 51, 277, 'Potsdam', 'Potsdam', 5800), -(3447, 51, 277, 'Prenzlau', 'Prenzlau', 5900), -(3448, 51, 277, 'Rathenow', 'Rathenow', 6000), -(3449, 51, 277, 'Schlieben', 'Schlieben', 6100), -(3450, 51, 277, 'Schneiche', 'Schneiche', 6200), -(3451, 51, 277, 'Schwarzheide', 'Schwarzheide', 6300), -(3452, 51, 277, 'Schwedt/Oder', 'Schwedt/Oder', 6400), -(3453, 51, 277, 'Seelow', 'Seelow', 6500), -(3454, 51, 277, 'Senftenberg', 'Senftenberg', 6600), -(3455, 51, 277, 'Sonnenberg', 'Sonnenberg', 6700), -(3456, 51, 277, 'Spremberg', 'Spremberg', 6800), -(3457, 51, 277, 'Strausberg', 'Strausberg', 6900), -(3458, 51, 277, 'Teltow', 'Teltow', 7000), -(3459, 51, 277, 'Templin', 'Templin', 7100), -(3460, 51, 277, 'Wittenberge', 'Wittenberge', 7200), -(3461, 51, 277, 'Wittstock/Dosse', 'Wittstock/Dosse', 7300), -(3462, 51, 277, 'Wusterhausen (Dosse)', 'Wusterhausen (Dosse)', 7400), -(3463, 51, 277, 'Zehdenick', 'Zehdenick', 7500), -(3464, 51, 277, 'Zossen', 'Zossen', 7600), -(3465, 51, 278, 'Bremen', 'Bremen', 100), -(3466, 51, 278, 'Bremerhaven', 'Bremerhaven', 200), -(3467, 51, 279, 'Hamburg', 'Hamburg', 100), -(3468, 51, 280, 'Ahnatal', 'Ahnatal', 100), -(3469, 51, 280, 'Alar', 'Alar', 200), -(3470, 51, 280, 'Alheim', 'Alheim', 300), -(3471, 51, 280, 'Allendorf (Eder)', 'Allendorf (Eder)', 400), -(3472, 51, 280, 'Allendorf (Lumda)', 'Allendorf (Lumda)', 500), -(3473, 51, 280, 'Alsbach-Hhnlein', 'Alsbach-Hhnlein', 600), -(3474, 51, 280, 'Alsfeld', 'Alsfeld', 700), -(3475, 51, 280, 'Altenstadt', 'Altenstadt', 800), -(3476, 51, 280, 'Angelburg', 'Angelburg', 900), -(3477, 51, 280, 'Antrifttal', 'Antrifttal', 1000), -(3478, 51, 280, 'Babenhausen', 'Babenhausen', 1100), -(3479, 51, 280, 'Bad Arolsen', 'Bad Arolsen', 1200), -(3480, 51, 280, 'Bad Camberg', 'Bad Camberg', 1300), -(3481, 51, 280, 'Bad Emstal', 'Bad Emstal', 1400), -(3482, 51, 280, 'Bad Endbach', 'Bad Endbach', 1500), -(3483, 51, 280, 'Bad Hersfeld', 'Bad Hersfeld', 1600), -(3484, 51, 280, 'Bad Homburg vor der Hhe', 'Bad Homburg vor der Hhe', 1700), -(3485, 51, 280, 'Bad Knig', 'Bad Knig', 1800), -(3486, 51, 280, 'Bad Nauheim', 'Bad Nauheim', 1900), -(3487, 51, 280, 'Bad Orb', 'Bad Orb', 2000), -(3488, 51, 280, 'Bad Schwalbach', 'Bad Schwalbach', 2100), -(3489, 51, 280, 'Bad Soden am Taunus', 'Bad Soden am Taunus', 2200), -(3490, 51, 280, 'Bad Soden-Salmnster', 'Bad Soden-Salmnster', 2300), -(3491, 51, 280, 'Bad Sooden-Allendorf', 'Bad Sooden-Allendorf', 2400), -(3492, 51, 280, 'Bad Vilbel', 'Bad Vilbel', 2500), -(3493, 51, 280, 'Bad Wildungen', 'Bad Wildungen', 2600), -(3494, 51, 280, 'Bad Zwesten', 'Bad Zwesten', 2700), -(3495, 51, 280, 'Battenberg (Eder)', 'Battenberg (Eder)', 2800), -(3496, 51, 280, 'Baunatal', 'Baunatal', 2900), -(3497, 51, 280, 'Bdingen', 'Bdingen', 3000), -(3498, 51, 280, 'Bebra', 'Bebra', 3100), -(3499, 51, 280, 'Bensheim', 'Bensheim', 3200), -(3500, 51, 280, 'Berkatal', 'Berkatal', 3300), -(3501, 51, 280, 'Beselich', 'Beselich', 3400), -(3502, 51, 280, 'Biblis', 'Biblis', 3500), -(3503, 51, 280, 'Biebergemnd', 'Biebergemnd', 3600), -(3504, 51, 280, 'Biebesheim am Rhein', 'Biebesheim am Rhein', 3700), -(3505, 51, 280, 'Biedenkopf', 'Biedenkopf', 3800), -(3506, 51, 280, 'Birkenau', 'Birkenau', 3900), -(3507, 51, 280, 'Birstein', 'Birstein', 4000), -(3508, 51, 280, 'Bischofsheim', 'Bischofsheim', 4100), -(3509, 51, 280, 'Borken', 'Borken', 4200), -(3510, 51, 280, 'Brachttal', 'Brachttal', 4300), -(3511, 51, 280, 'Braunfels', 'Braunfels', 4400), -(3512, 51, 280, 'Breidenbach', 'Breidenbach', 4500), -(3513, 51, 280, 'Brstadt', 'Brstadt', 4600), -(3514, 51, 280, 'Bruchkbel', 'Bruchkbel', 4700), -(3515, 51, 280, 'Buseck', 'Buseck', 4800), -(3516, 51, 280, 'Butzbach', 'Butzbach', 4900), -(3517, 51, 280, 'Clbe', 'Clbe', 5000), -(3518, 51, 280, 'Darmstadt', 'Darmstadt', 5100), -(3519, 51, 280, 'Dieburg', 'Dieburg', 5200), -(3520, 51, 280, 'Dietzenbach', 'Dietzenbach', 5300), -(3521, 51, 280, 'Dillenburg', 'Dillenburg', 5400), -(3522, 51, 280, 'Dipperz', 'Dipperz', 5500), -(3523, 51, 280, 'Dornburg', 'Dornburg', 5600), -(3524, 51, 280, 'Edertal', 'Edertal', 5700), -(3525, 51, 280, 'Ehringshausen', 'Ehringshausen', 5800), -(3526, 51, 280, 'Elbtal', 'Elbtal', 5900), -(3527, 51, 280, 'Eltville am Rhein', 'Eltville am Rhein', 6000), -(3528, 51, 280, 'Elz', 'Elz', 6100), -(3529, 51, 280, 'Erbach', 'Erbach', 6200), -(3530, 51, 280, 'Erlensee', 'Erlensee', 6300), -(3531, 51, 280, 'Eschborn', 'Eschborn', 6400), -(3532, 51, 280, 'Eschwege', 'Eschwege', 6500), -(3533, 51, 280, 'Felsberg', 'Felsberg', 6600), -(3534, 51, 280, 'Flieden', 'Flieden', 6700), -(3535, 51, 280, 'Florstadt', 'Florstadt', 6800), -(3536, 51, 280, 'Flrsheim', 'Flrsheim', 6900), -(3537, 51, 280, 'Frankenau', 'Frankenau', 7000), -(3538, 51, 280, 'Frankenberg (Eder)', 'Frankenberg (Eder)', 7100), -(3539, 51, 280, 'Frankfurt am Main', 'Frankfurt am Main', 7200), -(3540, 51, 280, 'Friedberg', 'Friedberg', 7300), -(3541, 51, 280, 'Friedrichsdorf', 'Friedrichsdorf', 7400), -(3542, 51, 280, 'Fritzlar', 'Fritzlar', 7500), -(3543, 51, 280, 'Frth', 'Frth', 7600), -(3544, 51, 280, 'Fulda', 'Fulda', 7700), -(3545, 51, 280, 'Fuldabrck', 'Fuldabrck', 7800), -(3546, 51, 280, 'Fuldatal', 'Fuldatal', 7900), -(3547, 51, 280, 'Gedern', 'Gedern', 8000), -(3548, 51, 280, 'Geisenheim', 'Geisenheim', 8100), -(3549, 51, 280, 'Gelnhausen', 'Gelnhausen', 8200), -(3550, 51, 280, 'Gemnden (Wohra)', 'Gemnden (Wohra)', 8300), -(3551, 51, 280, 'Gernsheim', 'Gernsheim', 8400), -(3552, 51, 280, 'Gersfeld', 'Gersfeld', 8500), -(3553, 51, 280, 'Gieen', 'Gieen', 8600), -(3554, 51, 280, 'Ginsheim-Gustavsburg', 'Ginsheim-Gustavsburg', 8700), -(3555, 51, 280, 'Gladenbach', 'Gladenbach', 8800), -(3556, 51, 280, 'Grebenstein', 'Grebenstein', 8900), -(3557, 51, 280, 'Greifenstein', 'Greifenstein', 9000), -(3558, 51, 280, 'Grnberg', 'Grnberg', 9100), -(3559, 51, 280, 'Grndau', 'Grndau', 9200), -(3560, 51, 280, 'Gro-Gerau', 'Gro-Gerau', 9300), -(3561, 51, 280, 'Groalmerode', 'Groalmerode', 9400), -(3562, 51, 280, 'Grvenwiesbach', 'Grvenwiesbach', 9500), -(3563, 51, 280, 'Hadamar', 'Hadamar', 9600), -(3564, 51, 280, 'Haiger', 'Haiger', 9700), -(3565, 51, 280, 'Hainburg', 'Hainburg', 9800), -(3566, 51, 280, 'Hanau', 'Hanau', 9900), -(3567, 51, 280, 'Hattersheim', 'Hattersheim', 10000), -(3568, 51, 280, 'Helsa', 'Helsa', 10100), -(3569, 51, 280, 'Heppenheim (Bergstrae)', 'Heppenheim (Bergstrae)', 10200), -(3570, 51, 280, 'Herborn', 'Herborn', 10300), -(3571, 51, 280, 'Herbstein', 'Herbstein', 10400), -(3572, 51, 280, 'Heuchelheim', 'Heuchelheim', 10500), -(3573, 51, 280, 'Hilders', 'Hilders', 10600), -(3574, 51, 280, 'Hnfeld', 'Hnfeld', 10700), -(3575, 51, 280, 'Hochheim am Main', 'Hochheim am Main', 10800), -(3576, 51, 280, 'Hofgeismar', 'Hofgeismar', 10900), -(3577, 51, 280, 'Hofheim am Taunus', 'Hofheim am Taunus', 11000), -(3578, 51, 280, 'Homberg (Efze)', 'Homberg (Efze)', 11100), -(3579, 51, 280, 'Homberg (Ohm)', 'Homberg (Ohm)', 11200), -(3580, 51, 280, 'Httenberg', 'Httenberg', 11300), -(3581, 51, 280, 'Idstein', 'Idstein', 11400), -(3582, 51, 280, 'Immenhausen', 'Immenhausen', 11500), -(3583, 51, 280, 'Kassel', 'Kassel', 11600), -(3584, 51, 280, 'Kaufungen', 'Kaufungen', 11700), -(3585, 51, 280, 'Kelkheim (Taunus)', 'Kelkheim (Taunus)', 11800), -(3586, 51, 280, 'Kirchhain', 'Kirchhain', 11900), -(3587, 51, 280, 'Kirchheim', 'Kirchheim', 12000), -(3588, 51, 280, 'Knigstein im Taunus', 'Knigstein im Taunus', 12100), -(3589, 51, 280, 'Korbach', 'Korbach', 12200), -(3590, 51, 280, 'Kriftel', 'Kriftel', 12300), -(3591, 51, 280, 'Krle', 'Krle', 12400), -(3592, 51, 280, 'Kronberg im Taunus', 'Kronberg im Taunus', 12500), -(3593, 51, 280, 'Lahnau', 'Lahnau', 12600), -(3594, 51, 280, 'Lampertheim', 'Lampertheim', 12700), -(3595, 51, 280, 'Langen', 'Langen', 12800), -(3596, 51, 280, 'Langgns', 'Langgns', 12900), -(3597, 51, 280, 'Lauterbach', 'Lauterbach', 13000), -(3598, 51, 280, 'Leun', 'Leun', 13100), -(3599, 51, 280, 'Lich', 'Lich', 13200), -(3600, 51, 280, 'Limburg an der Lahn', 'Limburg an der Lahn', 13300), -(3601, 51, 280, 'Linden', 'Linden', 13400), -(3602, 51, 280, 'Lindenfels', 'Lindenfels', 13500), -(3603, 51, 280, 'Lollar', 'Lollar', 13600), -(3604, 51, 280, 'Lorch', 'Lorch', 13700), -(3605, 51, 280, 'Marburg', 'Marburg', 13800), -(3606, 51, 280, 'Mcke', 'Mcke', 13900), -(3607, 51, 280, 'Melsungen', 'Melsungen', 14000), -(3608, 51, 280, 'Mhlheim', 'Mhlheim', 14100), -(3609, 51, 280, 'Michelstadt', 'Michelstadt', 14200), -(3610, 51, 280, 'Mnster', 'Mnster', 14300), -(3611, 51, 280, 'Mrfelden-Walldorf', 'Mrfelden-Walldorf', 14400), -(3612, 51, 280, 'Mrlenbach', 'Mrlenbach', 14500), -(3613, 51, 280, 'Neu-Isenburg', 'Neu-Isenburg', 14600), -(3614, 51, 280, 'Neuenstein', 'Neuenstein', 14700), -(3615, 51, 280, 'Neuhof', 'Neuhof', 14800), -(3616, 51, 280, 'Neukirchen', 'Neukirchen', 14900), -(3617, 51, 280, 'Neustadt (Hessen)', 'Neustadt (Hessen)', 15000), -(3618, 51, 280, 'Nidda', 'Nidda', 15100), -(3619, 51, 280, 'Ober-Ramstadt', 'Ober-Ramstadt', 15200), -(3620, 51, 280, 'Oberaula', 'Oberaula', 15300), -(3621, 51, 280, 'Obertshausen', 'Obertshausen', 15400), -(3622, 51, 280, 'Oberursel', 'Oberursel', 15500), -(3623, 51, 280, 'Oestrich-Winkel', 'Oestrich-Winkel', 15600), -(3624, 51, 280, 'Offenbach', 'Offenbach', 15700), -(3625, 51, 280, 'Petersberg', 'Petersberg', 15800), -(3626, 51, 280, 'Pfungstadt', 'Pfungstadt', 15900), -(3627, 51, 280, 'Ranstadt', 'Ranstadt', 16000), -(3628, 51, 280, 'Raunheim', 'Raunheim', 16100), -(3629, 51, 280, 'Rauschenberg', 'Rauschenberg', 16200), -(3630, 51, 280, 'Rdermark', 'Rdermark', 16300), -(3631, 51, 280, 'Rdesheim am Rhein', 'Rdesheim am Rhein', 16400), -(3632, 51, 280, 'Reiskirchen', 'Reiskirchen', 16500), -(3633, 51, 280, 'Rimbach', 'Rimbach', 16600), -(3634, 51, 280, 'Rodgau', 'Rodgau', 16700), -(3635, 51, 280, 'Rotenburg an der Fulda', 'Rotenburg an der Fulda', 16800), -(3636, 51, 280, 'Rsselsheim', 'Rsselsheim', 16900), -(3637, 51, 280, 'Schffengrund', 'Schffengrund', 17000), -(3638, 51, 280, 'Schlchtern', 'Schlchtern', 17100), -(3639, 51, 280, 'Schlitz', 'Schlitz', 17200), -(3640, 51, 280, 'Schotten', 'Schotten', 17300), -(3641, 51, 280, 'Schwalbach am Taunus', 'Schwalbach am Taunus', 17400), -(3642, 51, 280, 'Schwalmstadt', 'Schwalmstadt', 17500), -(3643, 51, 280, 'Seligenstadt', 'Seligenstadt', 17600), -(3644, 51, 280, 'Sinn', 'Sinn', 17700), -(3645, 51, 280, 'Solms', 'Solms', 17800), -(3646, 51, 280, 'Stadtallendorf', 'Stadtallendorf', 17900), -(3647, 51, 280, 'Steinau an der Strae', 'Steinau an der Strae', 18000), -(3648, 51, 280, 'Sulzbach', 'Sulzbach', 18100), -(3649, 51, 280, 'Tann', 'Tann', 18200), -(3650, 51, 280, 'Taunusstein', 'Taunusstein', 18300), -(3651, 51, 280, 'Trebur', 'Trebur', 18400), -(3652, 51, 280, 'Usingen', 'Usingen', 18500), -(3653, 51, 280, 'Vellmar', 'Vellmar', 18600), -(3654, 51, 280, 'Viernheim', 'Viernheim', 18700), -(3655, 51, 280, 'Villmar', 'Villmar', 18800), -(3656, 51, 280, 'Waldbrunn (Westerwald)', 'Waldbrunn (Westerwald)', 18900), -(3657, 51, 280, 'Wchtersbach', 'Wchtersbach', 19000), -(3658, 51, 280, 'Wehrheim', 'Wehrheim', 19100), -(3659, 51, 280, 'Weilburg', 'Weilburg', 19200), -(3660, 51, 280, 'Wettenberg', 'Wettenberg', 19300), -(3661, 51, 280, 'Wetter', 'Wetter', 19400), -(3662, 51, 280, 'Wetzlar', 'Wetzlar', 19500), -(3663, 51, 280, 'Wiesbaden', 'Wiesbaden', 19600), -(3664, 51, 280, 'Witzenhausen', 'Witzenhausen', 19700), -(3665, 51, 280, 'Wlfersheim', 'Wlfersheim', 19800), -(3666, 51, 280, 'Wolfhagen', 'Wolfhagen', 19900), -(3667, 51, 280, 'Zierenberg', 'Zierenberg', 20000), -(3668, 51, 281, 'Adamshoffnung', 'Adamshoffnung', 100), -(3669, 51, 281, 'Ahrenshoop', 'Ahrenshoop', 200), -(3670, 51, 281, 'Alt Krenzlin', 'Alt Krenzlin', 300), -(3671, 51, 281, 'Alt Schwerin', 'Alt Schwerin', 400), -(3672, 51, 281, 'Alt Tellin', 'Alt Tellin', 500), -(3673, 51, 281, 'Altefhr', 'Altefhr', 600), -(3674, 51, 281, 'Altenhagen (18236)', 'Altenhagen (18236)', 700), -(3675, 51, 281, 'Altenhof', 'Altenhof', 800), -(3676, 51, 281, 'Altentreptow', 'Altentreptow', 900), -(3677, 51, 281, 'Anklam', 'Anklam', 1000), -(3678, 51, 281, 'Bad Doberan', 'Bad Doberan', 1100), -(3679, 51, 281, 'Bad Slze', 'Bad Slze', 1200), -(3680, 51, 281, 'Balow', 'Balow', 1300), -(3681, 51, 281, 'Barth', 'Barth', 1400), -(3682, 51, 281, 'Bellin', 'Bellin', 1500), -(3683, 51, 281, 'Bergen auf Rgen', 'Bergen auf Rgen', 1600), -(3684, 51, 281, 'Binz', 'Binz', 1700), -(3685, 51, 281, 'Boizenburg', 'Boizenburg', 1800), -(3686, 51, 281, 'Brzow', 'Brzow', 1900), -(3687, 51, 281, 'Demmin', 'Demmin', 2000), -(3688, 51, 281, 'Eggesin', 'Eggesin', 2100), -(3689, 51, 281, 'Friedland', 'Friedland', 2200), -(3690, 51, 281, 'Gadebusch', 'Gadebusch', 2300), -(3691, 51, 281, 'Greifswald', 'Greifswald', 2400), -(3692, 51, 281, 'Grevesmhlen', 'Grevesmhlen', 2500), -(3693, 51, 281, 'Gstrow', 'Gstrow', 2600), -(3694, 51, 281, 'Hagenow', 'Hagenow', 2700), -(3695, 51, 281, 'Hohen Sprenz', 'Hohen Sprenz', 2800), -(3696, 51, 281, 'Koblentz', 'Koblentz', 2900), -(3697, 51, 281, 'Krakow am See', 'Krakow am See', 3000), -(3698, 51, 281, 'Lbz', 'Lbz', 3100), -(3699, 51, 281, 'Lcknitz', 'Lcknitz', 3200), -(3700, 51, 281, 'Ludwigslust', 'Ludwigslust', 3300), -(3701, 51, 281, 'Malchow', 'Malchow', 3400), -(3702, 51, 281, 'Matgendorf', 'Matgendorf', 3500), -(3703, 51, 281, 'Mnkebude', 'Mnkebude', 3600), -(3704, 51, 281, 'Neu Gaarz', 'Neu Gaarz', 3700), -(3705, 51, 281, 'Neubrandenburg', 'Neubrandenburg', 3800), -(3706, 51, 281, 'Neustrelitz', 'Neustrelitz', 3900), -(3707, 51, 281, 'Parchim', 'Parchim', 4000), -(3708, 51, 281, 'Rbel/Mritz', 'Rbel/Mritz', 4100), -(3709, 51, 281, 'Reuterstadt Stavenhagen', 'Reuterstadt Stavenhagen', 4200), -(3710, 51, 281, 'Ribnitz-Damgarten', 'Ribnitz-Damgarten', 4300), -(3711, 51, 281, 'Ritzerow', 'Ritzerow', 4400), -(3712, 51, 281, 'Rostock', 'Rostock', 4500), -(3713, 51, 281, 'Schnbeck', 'Schnbeck', 4600), -(3714, 51, 281, 'Schnberg', 'Schnberg', 4700), -(3715, 51, 281, 'Schwerin', 'Schwerin', 4800), -(3716, 51, 281, 'Sponholz', 'Sponholz', 4900), -(3717, 51, 281, 'Stralsund', 'Stralsund', 5000), -(3718, 51, 281, 'Tessin', 'Tessin', 5100), -(3719, 51, 281, 'Teterow', 'Teterow', 5200), -(3720, 51, 281, 'Torgelow', 'Torgelow', 5300), -(3721, 51, 281, 'Waren (Mritz)', 'Waren (Mritz)', 5400), -(3722, 51, 281, 'Wilmshagen', 'Wilmshagen', 5500), -(3723, 51, 281, 'Wismar', 'Wismar', 5600), -(3724, 51, 281, 'Wolgast', 'Wolgast', 5700), -(3725, 51, 281, 'Zarrendorf', 'Zarrendorf', 5800), -(3726, 51, 283, 'Aachen', 'Aachen', 100), -(3727, 51, 283, 'Ahaus', 'Ahaus', 200), -(3728, 51, 283, 'Ahlen', 'Ahlen', 300), -(3729, 51, 283, 'Aldenhoven', 'Aldenhoven', 400), -(3730, 51, 283, 'Alfter', 'Alfter', 500), -(3731, 51, 283, 'Alpen', 'Alpen', 600), -(3732, 51, 283, 'Alsdorf', 'Alsdorf', 700), -(3733, 51, 283, 'Altena', 'Altena', 800), -(3734, 51, 283, 'Altenbeken', 'Altenbeken', 900), -(3735, 51, 283, 'Altenberge', 'Altenberge', 1000), -(3736, 51, 283, 'Anrchte', 'Anrchte', 1100), -(3737, 51, 283, 'Arnsberg', 'Arnsberg', 1200), -(3738, 51, 283, 'Ascheberg', 'Ascheberg', 1300), -(3739, 51, 283, 'Attendorn', 'Attendorn', 1400), -(3740, 51, 283, 'Augustdorf', 'Augustdorf', 1500), -(3741, 51, 283, 'bach-Palenberg', 'bach-Palenberg', 1600), -(3742, 51, 283, 'Bad Berleburg', 'Bad Berleburg', 1700), -(3743, 51, 283, 'Bad Driburg', 'Bad Driburg', 1800), -(3744, 51, 283, 'Bad Honnef', 'Bad Honnef', 1900), -(3745, 51, 283, 'Bad Laasphe', 'Bad Laasphe', 2000), -(3746, 51, 283, 'Bad Lippspringe', 'Bad Lippspringe', 2100), -(3747, 51, 283, 'Bad Mnstereifel', 'Bad Mnstereifel', 2200), -(3748, 51, 283, 'Bad Oeynhausen', 'Bad Oeynhausen', 2300), -(3749, 51, 283, 'Bad Salzuflen', 'Bad Salzuflen', 2400), -(3750, 51, 283, 'Bad Sassendorf', 'Bad Sassendorf', 2500), -(3751, 51, 283, 'Bad Wnnenberg', 'Bad Wnnenberg', 2600), -(3752, 51, 283, 'Baesweiler', 'Baesweiler', 2700), -(3753, 51, 283, 'Balve', 'Balve', 2800), -(3754, 51, 283, 'Barntrup', 'Barntrup', 2900), -(3755, 51, 283, 'Beckum', 'Beckum', 3000), -(3756, 51, 283, 'Beelen', 'Beelen', 3100), -(3757, 51, 283, 'Bergheim', 'Bergheim', 3200), -(3758, 51, 283, 'Bergisch Gladbach', 'Bergisch Gladbach', 3300), -(3759, 51, 283, 'Bergkamen', 'Bergkamen', 3400), -(3760, 51, 283, 'Bergneustadt', 'Bergneustadt', 3500), -(3761, 51, 283, 'Bestwig', 'Bestwig', 3600), -(3762, 51, 283, 'Beverungen', 'Beverungen', 3700), -(3763, 51, 283, 'Bielefeld', 'Bielefeld', 3800), -(3764, 51, 283, 'Billerbeck', 'Billerbeck', 3900), -(3765, 51, 283, 'Blomberg', 'Blomberg', 4000), -(3766, 51, 283, 'Bnde', 'Bnde', 4100), -(3767, 51, 283, 'Bnen', 'Bnen', 4200), -(3768, 51, 283, 'Bocholt', 'Bocholt', 4300), -(3769, 51, 283, 'Bochum', 'Bochum', 4400), -(3770, 51, 283, 'Bonn', 'Bonn', 4500), -(3771, 51, 283, 'Borchen', 'Borchen', 4600), -(3772, 51, 283, 'Borgentreich', 'Borgentreich', 4700), -(3773, 51, 283, 'Borgholzhausen', 'Borgholzhausen', 4800), -(3774, 51, 283, 'Borken', 'Borken', 4900), -(3775, 51, 283, 'Bornheim', 'Bornheim', 5000), -(3776, 51, 283, 'Bottrop', 'Bottrop', 5100), -(3777, 51, 283, 'Brakel', 'Brakel', 5200), -(3778, 51, 283, 'Breckerfeld', 'Breckerfeld', 5300), -(3779, 51, 283, 'Bren', 'Bren', 5400), -(3780, 51, 283, 'Brggen', 'Brggen', 5500), -(3781, 51, 283, 'Brhl', 'Brhl', 5600), -(3782, 51, 283, 'Brilon', 'Brilon', 5700), -(3783, 51, 283, 'Burbach', 'Burbach', 5800), -(3784, 51, 283, 'Burscheid', 'Burscheid', 5900), -(3785, 51, 283, 'Castrop-Rauxel', 'Castrop-Rauxel', 6000), -(3786, 51, 283, 'Coesfeld', 'Coesfeld', 6100), -(3787, 51, 283, 'Datteln', 'Datteln', 6200), -(3788, 51, 283, 'Delbrck', 'Delbrck', 6300), -(3789, 51, 283, 'Detmold', 'Detmold', 6400), -(3790, 51, 283, 'Dinslaken', 'Dinslaken', 6500), -(3791, 51, 283, 'Dlmen', 'Dlmen', 6600), -(3792, 51, 283, 'Dormagen', 'Dormagen', 6700), -(3793, 51, 283, 'Dorsten', 'Dorsten', 6800), -(3794, 51, 283, 'Dortmund', 'Dortmund', 6900), -(3795, 51, 283, 'Dren', 'Dren', 7000), -(3796, 51, 283, 'Drensteinfurt', 'Drensteinfurt', 7100), -(3797, 51, 283, 'Drentrup', 'Drentrup', 7200), -(3798, 51, 283, 'Drolshagen', 'Drolshagen', 7300), -(3799, 51, 283, 'Dsseldorf', 'Dsseldorf', 7400), -(3800, 51, 283, 'Duisburg', 'Duisburg', 7500), -(3801, 51, 283, 'Eitorf', 'Eitorf', 7600), -(3802, 51, 283, 'Elsdorf', 'Elsdorf', 7700), -(3803, 51, 283, 'Emmerich', 'Emmerich', 7800), -(3804, 51, 283, 'Emsdetten', 'Emsdetten', 7900), -(3805, 51, 283, 'Engelskirchen', 'Engelskirchen', 8000), -(3806, 51, 283, 'Enger', 'Enger', 8100), -(3807, 51, 283, 'Ennepetal', 'Ennepetal', 8200), -(3808, 51, 283, 'Ennigerloh', 'Ennigerloh', 8300), -(3809, 51, 283, 'Erftstadt', 'Erftstadt', 8400), -(3810, 51, 283, 'Erkelenz', 'Erkelenz', 8500), -(3811, 51, 283, 'Erkrath', 'Erkrath', 8600), -(3812, 51, 283, 'Erwitte', 'Erwitte', 8700), -(3813, 51, 283, 'Eschweiler', 'Eschweiler', 8800), -(3814, 51, 283, 'Espelkamp', 'Espelkamp', 8900), -(3815, 51, 283, 'Essen', 'Essen', 9000), -(3816, 51, 283, 'Euskirchen', 'Euskirchen', 9100), -(3817, 51, 283, 'Everswinkel', 'Everswinkel', 9200), -(3818, 51, 283, 'Extertal', 'Extertal', 9300), -(3819, 51, 283, 'Finnentrop', 'Finnentrop', 9400), -(3820, 51, 283, 'Frechen', 'Frechen', 9500), -(3821, 51, 283, 'Freudenberg', 'Freudenberg', 9600), -(3822, 51, 283, 'Frndenberg', 'Frndenberg', 9700), -(3823, 51, 283, 'Gangelt', 'Gangelt', 9800), -(3824, 51, 283, 'Geilenkirchen', 'Geilenkirchen', 9900), -(3825, 51, 283, 'Geldern', 'Geldern', 10000), -(3826, 51, 283, 'Gelsenkirchen', 'Gelsenkirchen', 10100), -(3827, 51, 283, 'Gescher', 'Gescher', 10200), -(3828, 51, 283, 'Geseke', 'Geseke', 10300), -(3829, 51, 283, 'Gevelsberg', 'Gevelsberg', 10400), -(3830, 51, 283, 'Gladbeck', 'Gladbeck', 10500), -(3831, 51, 283, 'Goch', 'Goch', 10600), -(3832, 51, 283, 'Greven', 'Greven', 10700), -(3833, 51, 283, 'Grevenbroich', 'Grevenbroich', 10800), -(3834, 51, 283, 'Gronau (Westfalen)', 'Gronau (Westfalen)', 10900), -(3835, 51, 283, 'Gtersloh', 'Gtersloh', 11000), -(3836, 51, 283, 'Gummersbach', 'Gummersbach', 11100), -(3837, 51, 283, 'Haan', 'Haan', 11200), -(3838, 51, 283, 'Hagen', 'Hagen', 11300), -(3839, 51, 283, 'Halle', 'Halle', 11400), -(3840, 51, 283, 'Haltern am See', 'Haltern am See', 11500), -(3841, 51, 283, 'Halver', 'Halver', 11600), -(3842, 51, 283, 'Hamm', 'Hamm', 11700), -(3843, 51, 283, 'Hamminkeln', 'Hamminkeln', 11800), -(3844, 51, 283, 'Harsewinkel', 'Harsewinkel', 11900), -(3845, 51, 283, 'Hattingen', 'Hattingen', 12000), -(3846, 51, 283, 'Havixbeck', 'Havixbeck', 12100), -(3847, 51, 283, 'Hckelhoven', 'Hckelhoven', 12200), -(3848, 51, 283, 'Hckeswagen', 'Hckeswagen', 12300), -(3849, 51, 283, 'Heiden', 'Heiden', 12400), -(3850, 51, 283, 'Heiligenhaus', 'Heiligenhaus', 12500), -(3851, 51, 283, 'Heimbach', 'Heimbach', 12600), -(3852, 51, 283, 'Heinsberg', 'Heinsberg', 12700), -(3853, 51, 283, 'Hemer', 'Hemer', 12800), -(3854, 51, 283, 'Hennef', 'Hennef', 12900), -(3855, 51, 283, 'Herdecke', 'Herdecke', 13000), -(3856, 51, 283, 'Herford', 'Herford', 13100), -(3857, 51, 283, 'Herne', 'Herne', 13200), -(3858, 51, 283, 'Herscheid', 'Herscheid', 13300), -(3859, 51, 283, 'Herten', 'Herten', 13400), -(3860, 51, 283, 'Herzebrock-Clarholz', 'Herzebrock-Clarholz', 13500), -(3861, 51, 283, 'Herzogenrath', 'Herzogenrath', 13600), -(3862, 51, 283, 'Hiddenhausen', 'Hiddenhausen', 13700), -(3863, 51, 283, 'Hilden', 'Hilden', 13800), -(3864, 51, 283, 'Hille', 'Hille', 13900), -(3865, 51, 283, 'Hllhorst', 'Hllhorst', 14000), -(3866, 51, 283, 'Holzwickede', 'Holzwickede', 14100), -(3867, 51, 283, 'Hopsten', 'Hopsten', 14200), -(3868, 51, 283, 'Horn-Bad Meinberg', 'Horn-Bad Meinberg', 14300), -(3869, 51, 283, 'Hrstel', 'Hrstel', 14400), -(3870, 51, 283, 'Hrth', 'Hrth', 14500), -(3871, 51, 283, 'Hvelhof', 'Hvelhof', 14600), -(3872, 51, 283, 'Hxter', 'Hxter', 14700), -(3873, 51, 283, 'Ibbenbren', 'Ibbenbren', 14800), -(3874, 51, 283, 'Iserlohn', 'Iserlohn', 14900), -(3875, 51, 283, 'Jchen', 'Jchen', 15000), -(3876, 51, 283, 'Jlich', 'Jlich', 15100), -(3877, 51, 283, 'Kaarst', 'Kaarst', 15200), -(3878, 51, 283, 'Kalkar', 'Kalkar', 15300), -(3879, 51, 283, 'Kall', 'Kall', 15400), -(3880, 51, 283, 'Kalletal', 'Kalletal', 15500), -(3881, 51, 283, 'Kamen', 'Kamen', 15600), -(3882, 51, 283, 'Kamp-Lintfort', 'Kamp-Lintfort', 15700), -(3883, 51, 283, 'Kempen', 'Kempen', 15800), -(3884, 51, 283, 'Kerpen', 'Kerpen', 15900), -(3885, 51, 283, 'Kevelaer', 'Kevelaer', 16000), -(3886, 51, 283, 'Kierspe', 'Kierspe', 16100), -(3887, 51, 283, 'Kirchlengern', 'Kirchlengern', 16200), -(3888, 51, 283, 'Kleve', 'Kleve', 16300), -(3889, 51, 283, 'Kln', 'Kln', 16400), -(3890, 51, 283, 'Knigswinter', 'Knigswinter', 16500), -(3891, 51, 283, 'Korschenbroich', 'Korschenbroich', 16600), -(3892, 51, 283, 'Krefeld', 'Krefeld', 16700), -(3893, 51, 283, 'Kreuztal', 'Kreuztal', 16800), -(3894, 51, 283, 'Ladbergen', 'Ladbergen', 16900), -(3895, 51, 283, 'Lage', 'Lage', 17000), -(3896, 51, 283, 'Langenberg', 'Langenberg', 17100), -(3897, 51, 283, 'Langenfeld', 'Langenfeld', 17200), -(3898, 51, 283, 'Langerwehe', 'Langerwehe', 17300), -(3899, 51, 283, 'Lbbecke', 'Lbbecke', 17400), -(3900, 51, 283, 'Ldenscheid', 'Ldenscheid', 17500), -(3901, 51, 283, 'Ldinghausen', 'Ldinghausen', 17600), -(3902, 51, 283, 'Legden', 'Legden', 17700), -(3903, 51, 283, 'Leichlingen', 'Leichlingen', 17800), -(3904, 51, 283, 'Lemgo', 'Lemgo', 17900), -(3905, 51, 283, 'Lengerich', 'Lengerich', 18000), -(3906, 51, 283, 'Lennestadt', 'Lennestadt', 18100), -(3907, 51, 283, 'Leopoldshhe', 'Leopoldshhe', 18200), -(3908, 51, 283, 'Leverkusen', 'Leverkusen', 18300), -(3909, 51, 283, 'Lgde', 'Lgde', 18400), -(3910, 51, 283, 'Lhne', 'Lhne', 18500), -(3911, 51, 283, 'Lienen', 'Lienen', 18600), -(3912, 51, 283, 'Lindlar', 'Lindlar', 18700), -(3913, 51, 283, 'Linnich', 'Linnich', 18800), -(3914, 51, 283, 'Lippetal', 'Lippetal', 18900), -(3915, 51, 283, 'Lippstadt', 'Lippstadt', 19000), -(3916, 51, 283, 'Lnen', 'Lnen', 19100), -(3917, 51, 283, 'Lohmar', 'Lohmar', 19200), -(3918, 51, 283, 'Lotte', 'Lotte', 19300), -(3919, 51, 283, 'Marienheide', 'Marienheide', 19400), -(3920, 51, 283, 'Marienmnster', 'Marienmnster', 19500), -(3921, 51, 283, 'Marl', 'Marl', 19600), -(3922, 51, 283, 'Marsberg', 'Marsberg', 19700), -(3923, 51, 283, 'Mechernich', 'Mechernich', 19800), -(3924, 51, 283, 'Meckenheim', 'Meckenheim', 19900), -(3925, 51, 283, 'Medebach', 'Medebach', 20000), -(3926, 51, 283, 'Meerbusch', 'Meerbusch', 20100), -(3927, 51, 283, 'Meinerzhagen', 'Meinerzhagen', 20200), -(3928, 51, 283, 'Menden', 'Menden', 20300), -(3929, 51, 283, 'Meschede', 'Meschede', 20400), -(3930, 51, 283, 'Mettingen', 'Mettingen', 20500), -(3931, 51, 283, 'Mettmann', 'Mettmann', 20600), -(3932, 51, 283, 'Mhnesee', 'Mhnesee', 20700), -(3933, 51, 283, 'Minden', 'Minden', 20800), -(3934, 51, 283, 'Mlheim an der Ruhr', 'Mlheim an der Ruhr', 20900), -(3935, 51, 283, 'Mnchengladbach', 'Mnchengladbach', 21000), -(3936, 51, 283, 'Mnster', 'Mnster', 21100), -(3937, 51, 283, 'Moers', 'Moers', 21200), -(3938, 51, 283, 'Monheim am Rhein', 'Monheim am Rhein', 21300), -(3939, 51, 283, 'Morsbach', 'Morsbach', 21400), -(3940, 51, 283, 'Much', 'Much', 21500), -(3941, 51, 283, 'Netphen', 'Netphen', 21600), -(3942, 51, 283, 'Nettetal', 'Nettetal', 21700), -(3943, 51, 283, 'Neuenkirchen', 'Neuenkirchen', 21800), -(3944, 51, 283, 'Neuenrade', 'Neuenrade', 21900), -(3945, 51, 283, 'Neukirchen-Vluyn', 'Neukirchen-Vluyn', 22000), -(3946, 51, 283, 'Neunkirchen', 'Neunkirchen', 22100), -(3947, 51, 283, 'Neunkirchen-Seelscheid', 'Neunkirchen-Seelscheid', 22200), -(3948, 51, 283, 'Neuss', 'Neuss', 22300), -(3949, 51, 283, 'Nideggen', 'Nideggen', 22400), -(3950, 51, 283, 'Niederkassel', 'Niederkassel', 22500), -(3951, 51, 283, 'Niederkrchten', 'Niederkrchten', 22600), -(3952, 51, 283, 'Nieheim', 'Nieheim', 22700), -(3953, 51, 283, 'Nmbrecht', 'Nmbrecht', 22800), -(3954, 51, 283, 'Nordwalde', 'Nordwalde', 22900), -(3955, 51, 283, 'Oberhausen', 'Oberhausen', 23000), -(3956, 51, 283, 'Ochtrup', 'Ochtrup', 23100), -(3957, 51, 283, 'Oelde', 'Oelde', 23200), -(3958, 51, 283, 'Oer-Erkenschwick', 'Oer-Erkenschwick', 23300), -(3959, 51, 283, 'Oerlinghausen', 'Oerlinghausen', 23400), -(3960, 51, 283, 'Olfen', 'Olfen', 23500), -(3961, 51, 283, 'Olpe', 'Olpe', 23600), -(3962, 51, 283, 'Olsberg', 'Olsberg', 23700), -(3963, 51, 283, 'Ostbevern', 'Ostbevern', 23800), -(3964, 51, 283, 'Overath', 'Overath', 23900), -(3965, 51, 283, 'Paderborn', 'Paderborn', 24000), -(3966, 51, 283, 'Petershagen', 'Petershagen', 24100), -(3967, 51, 283, 'Plettenberg', 'Plettenberg', 24200), -(3968, 51, 283, 'Porta Westfalica', 'Porta Westfalica', 24300), -(3969, 51, 283, 'Preuisch Oldendorf', 'Preuisch Oldendorf', 24400), -(3970, 51, 283, 'Pulheim', 'Pulheim', 24500), -(3971, 51, 283, 'Radevormwald', 'Radevormwald', 24600), -(3972, 51, 283, 'Rahden', 'Rahden', 24700), -(3973, 51, 283, 'Ratingen', 'Ratingen', 24800), -(3974, 51, 283, 'Rdinghausen', 'Rdinghausen', 24900), -(3975, 51, 283, 'Recke', 'Recke', 25000), -(3976, 51, 283, 'Recklinghausen', 'Recklinghausen', 25100), -(3977, 51, 283, 'Rees', 'Rees', 25200), -(3978, 51, 283, 'Reichshof', 'Reichshof', 25300), -(3979, 51, 283, 'Remscheid', 'Remscheid', 25400), -(3980, 51, 283, 'Rheda-Wiedenbrck', 'Rheda-Wiedenbrck', 25500), -(3981, 51, 283, 'Rhede', 'Rhede', 25600), -(3982, 51, 283, 'Rheinbach', 'Rheinbach', 25700), -(3983, 51, 283, 'Rheinberg', 'Rheinberg', 25800), -(3984, 51, 283, 'Rheine', 'Rheine', 25900), -(3985, 51, 283, 'Rietberg', 'Rietberg', 26000), -(3986, 51, 283, 'Rosendahl', 'Rosendahl', 26100), -(3987, 51, 283, 'Rsrath', 'Rsrath', 26200), -(3988, 51, 283, 'Rthen', 'Rthen', 26300), -(3989, 51, 283, 'Ruppichteroth', 'Ruppichteroth', 26400), -(3990, 51, 283, 'Saerbeck', 'Saerbeck', 26500), -(3991, 51, 283, 'Salzkotten', 'Salzkotten', 26600), -(3992, 51, 283, 'Sankt Augustin', 'Sankt Augustin', 26700), -(3993, 51, 283, 'Sassenberg', 'Sassenberg', 26800), -(3994, 51, 283, 'Schalksmhle', 'Schalksmhle', 26900), -(3995, 51, 283, 'Schieder-Schwalenberg', 'Schieder-Schwalenberg', 27000), -(3996, 51, 283, 'Schlangen', 'Schlangen', 27100), -(3997, 51, 283, 'Schlo Holte-Stukenbrock', 'Schlo Holte-Stukenbrock', 27200), -(3998, 51, 283, 'Schmallenberg', 'Schmallenberg', 27300), -(3999, 51, 283, 'Schwelm', 'Schwelm', 27400), -(4000, 51, 283, 'Schwerte', 'Schwerte', 27500), -(4001, 51, 283, 'Selfkant', 'Selfkant', 27600), -(4002, 51, 283, 'Selm', 'Selm', 27700), -(4003, 51, 283, 'Senden', 'Senden', 27800), -(4004, 51, 283, 'Sendenhorst', 'Sendenhorst', 27900), -(4005, 51, 283, 'Siegburg', 'Siegburg', 28000), -(4006, 51, 283, 'Siegen', 'Siegen', 28100), -(4007, 51, 283, 'Simmerath', 'Simmerath', 28200), -(4008, 51, 283, 'Soest', 'Soest', 28300), -(4009, 51, 283, 'Solingen', 'Solingen', 28400), -(4010, 51, 283, 'Spenge', 'Spenge', 28500), -(4011, 51, 283, 'Sprockhvel', 'Sprockhvel', 28600), -(4012, 51, 283, 'Stadtlohn', 'Stadtlohn', 28700), -(4013, 51, 283, 'Steinfurt', 'Steinfurt', 28800), -(4014, 51, 283, 'Steinhagen', 'Steinhagen', 28900), -(4015, 51, 283, 'Steinheim', 'Steinheim', 29000), -(4016, 51, 283, 'Stemwede', 'Stemwede', 29100), -(4017, 51, 283, 'Stolberg (Rheinland)', 'Stolberg (Rheinland)', 29200), -(4018, 51, 283, 'Straelen', 'Straelen', 29300), -(4019, 51, 283, 'Sundern', 'Sundern', 29400), -(4020, 51, 283, 'Telgte', 'Telgte', 29500), -(4021, 51, 283, 'Tnisvorst', 'Tnisvorst', 29600), -(4022, 51, 283, 'Troisdorf', 'Troisdorf', 29700), -(4023, 51, 283, 'Uedem', 'Uedem', 29800), -(4024, 51, 283, 'Unna', 'Unna', 29900), -(4025, 51, 283, 'Velbert', 'Velbert', 30000), -(4026, 51, 283, 'Verl', 'Verl', 30100), -(4027, 51, 283, 'Versmold', 'Versmold', 30200), -(4028, 51, 283, 'Viersen', 'Viersen', 30300), -(4029, 51, 283, 'Vlotho', 'Vlotho', 30400), -(4030, 51, 283, 'Voerde', 'Voerde', 30500), -(4031, 51, 283, 'Vreden', 'Vreden', 30600), -(4032, 51, 283, 'Waldbrl', 'Waldbrl', 30700), -(4033, 51, 283, 'Waldfeucht', 'Waldfeucht', 30800), -(4034, 51, 283, 'Waltrop', 'Waltrop', 30900), -(4035, 51, 283, 'Warburg', 'Warburg', 31000), -(4036, 51, 283, 'Warendorf', 'Warendorf', 31100), -(4037, 51, 283, 'Warstein', 'Warstein', 31200), -(4038, 51, 283, 'Wassenberg', 'Wassenberg', 31300), -(4039, 51, 283, 'Weeze', 'Weeze', 31400), -(4040, 51, 283, 'Wegberg', 'Wegberg', 31500), -(4041, 51, 283, 'Weilerswist', 'Weilerswist', 31600), -(4042, 51, 283, 'Werdohl', 'Werdohl', 31700), -(4043, 51, 283, 'Werl', 'Werl', 31800), -(4044, 51, 283, 'Wermelskirchen', 'Wermelskirchen', 31900), -(4045, 51, 283, 'Werne', 'Werne', 32000), -(4046, 51, 283, 'Wesel', 'Wesel', 32100), -(4047, 51, 283, 'Wesseling', 'Wesseling', 32200), -(4048, 51, 283, 'Westerkappeln', 'Westerkappeln', 32300), -(4049, 51, 283, 'Wetter (Ruhr)', 'Wetter (Ruhr)', 32400), -(4050, 51, 283, 'Wettringen', 'Wettringen', 32500), -(4051, 51, 283, 'Wickede', 'Wickede', 32600), -(4052, 51, 283, 'Wiehl', 'Wiehl', 32700), -(4053, 51, 283, 'Willebadessen', 'Willebadessen', 32800), -(4054, 51, 283, 'Willich', 'Willich', 32900), -(4055, 51, 283, 'Wilnsdorf', 'Wilnsdorf', 33000), -(4056, 51, 283, 'Winterberg', 'Winterberg', 33100), -(4057, 51, 283, 'Wipperfrth', 'Wipperfrth', 33200), -(4058, 51, 283, 'Witten', 'Witten', 33300), -(4059, 51, 283, 'Wlfrath', 'Wlfrath', 33400), -(4060, 51, 283, 'Wrselen', 'Wrselen', 33500), -(4061, 51, 283, 'Wuppertal', 'Wuppertal', 33600), -(4062, 51, 283, 'Xanten', 'Xanten', 33700), -(4063, 51, 283, 'Zlpich', 'Zlpich', 33800), -(4064, 51, 284, 'Aach', 'Aach', 100), -(4065, 51, 284, 'Abentheuer', 'Abentheuer', 200), -(4066, 51, 284, 'Abtweiler', 'Abtweiler', 300), -(4067, 51, 284, 'Adenau', 'Adenau', 400), -(4068, 51, 284, 'Adenbach', 'Adenbach', 500), -(4069, 51, 284, 'Ailertchen', 'Ailertchen', 600), -(4070, 51, 284, 'Albig', 'Albig', 700), -(4071, 51, 284, 'Albisheim (Pfrimm)', 'Albisheim (Pfrimm)', 800), -(4072, 51, 284, 'Alf', 'Alf', 900), -(4073, 51, 284, 'Allenbach', 'Allenbach', 1000), -(4074, 51, 284, 'Allendorf', 'Allendorf', 1100), -(4075, 51, 284, 'Alpenrod', 'Alpenrod', 1200), -(4076, 51, 284, 'Alsdorf (54668)', 'Alsdorf (54668)', 1300), -(4077, 51, 284, 'Alsenz', 'Alsenz', 1400), -(4078, 51, 284, 'Alsheim', 'Alsheim', 1500), -(4079, 51, 284, 'Altenkirchen (57610)', 'Altenkirchen (57610)', 1600), -(4080, 51, 284, 'Altenkirchen (66903)', 'Altenkirchen (66903)', 1700), -(4081, 51, 284, 'Alterklz', 'Alterklz', 1800), -(4082, 51, 284, 'Altleiningen', 'Altleiningen', 1900), -(4083, 51, 284, 'Alzey', 'Alzey', 2000), -(4084, 51, 284, 'Andernach', 'Andernach', 2100), -(4085, 51, 284, 'Annweiler am Trifels', 'Annweiler am Trifels', 2200), -(4086, 51, 284, 'Asbach (53567)', 'Asbach (53567)', 2300), -(4087, 51, 284, 'Auderath', 'Auderath', 2400), -(4088, 51, 284, 'Ayl', 'Ayl', 2500), -(4089, 51, 284, 'Baar', 'Baar', 2600), -(4090, 51, 284, 'Bad Bergzabern', 'Bad Bergzabern', 2700), -(4091, 51, 284, 'Bad Breisig', 'Bad Breisig', 2800), -(4092, 51, 284, 'Bad Drkheim', 'Bad Drkheim', 2900), -(4093, 51, 284, 'Bad Ems', 'Bad Ems', 3000), -(4094, 51, 284, 'Bad Hnningen', 'Bad Hnningen', 3100), -(4095, 51, 284, 'Bad Kreuznach', 'Bad Kreuznach', 3200), -(4096, 51, 284, 'Bad Marienberg', 'Bad Marienberg', 3300), -(4097, 51, 284, 'Bad Mnster am Stein-Ebernburg', 'Bad Mnster am Stein-Ebernburg', 3400), -(4098, 51, 284, 'Bad Neuenahr-Ahrweiler', 'Bad Neuenahr-Ahrweiler', 3500), -(4099, 51, 284, 'Bad Sobernheim', 'Bad Sobernheim', 3600), -(4100, 51, 284, 'Baumholder', 'Baumholder', 3700), -(4101, 51, 284, 'Bausendorf', 'Bausendorf', 3800), -(4102, 51, 284, 'Bchenbeuren', 'Bchenbeuren', 3900), -(4103, 51, 284, 'Bell (56288)', 'Bell (56288)', 4000), -(4104, 51, 284, 'Bellheim', 'Bellheim', 4100), -(4105, 51, 284, 'Bendorf', 'Bendorf', 4200), -(4106, 51, 284, 'Berlingen', 'Berlingen', 4300), -(4107, 51, 284, 'Bernkastel-Kues', 'Bernkastel-Kues', 4400), -(4108, 51, 284, 'Berzhahn', 'Berzhahn', 4500), -(4109, 51, 284, 'Betzdorf', 'Betzdorf', 4600), -(4110, 51, 284, 'Bhl-Iggelheim', 'Bhl-Iggelheim', 4700), -(4111, 51, 284, 'Bingen am Rhein', 'Bingen am Rhein', 4800), -(4112, 51, 284, 'Birkenfeld', 'Birkenfeld', 4900), -(4113, 51, 284, 'Birlenbach', 'Birlenbach', 5000), -(4114, 51, 284, 'Bitburg', 'Bitburg', 5100), -(4115, 51, 284, 'Bitzen', 'Bitzen', 5200), -(4116, 51, 284, 'Blankenrath', 'Blankenrath', 5300), -(4117, 51, 284, 'Bobenheim-Roxheim', 'Bobenheim-Roxheim', 5400), -(4118, 51, 284, 'Bogel', 'Bogel', 5500), -(4119, 51, 284, 'Boppard', 'Boppard', 5600), -(4120, 51, 284, 'Braubach', 'Braubach', 5700), -(4121, 51, 284, 'Brcken (66904)', 'Brcken (66904)', 5800), -(4122, 51, 284, 'Brenbach (55483)', 'Brenbach (55483)', 5900), -(4123, 51, 284, 'Bruchmhlbach-Miesau', 'Bruchmhlbach-Miesau', 6000), -(4124, 51, 284, 'Burgen (56332)', 'Burgen (56332)', 6100), -(4125, 51, 284, 'Cochem', 'Cochem', 6200), -(4126, 51, 284, 'Contwig', 'Contwig', 6300), -(4127, 51, 284, 'Daaden', 'Daaden', 6400), -(4128, 51, 284, 'Dahn', 'Dahn', 6500), -(4129, 51, 284, 'Daun', 'Daun', 6600), -(4130, 51, 284, 'Deidesheim', 'Deidesheim', 6700), -(4131, 51, 284, 'Dellfeld', 'Dellfeld', 6800), -(4132, 51, 284, 'Dierbach', 'Dierbach', 6900), -(4133, 51, 284, 'Dierdorf', 'Dierdorf', 7000), -(4134, 51, 284, 'Diez', 'Diez', 7100), -(4135, 51, 284, 'Dreisen', 'Dreisen', 7200), -(4136, 51, 284, 'Dudenhofen', 'Dudenhofen', 7300), -(4137, 51, 284, 'Eckfeld', 'Eckfeld', 7400), -(4138, 51, 284, 'Edenkoben', 'Edenkoben', 7500), -(4139, 51, 284, 'Eich', 'Eich', 7600), -(4140, 51, 284, 'Einig', 'Einig', 7700), -(4141, 51, 284, 'Einselthum', 'Einselthum', 7800), -(4142, 51, 284, 'Eisenberg', 'Eisenberg', 7900), -(4143, 51, 284, 'Elingen', 'Elingen', 8000), -(4144, 51, 284, 'Emmelshausen', 'Emmelshausen', 8100), -(4145, 51, 284, 'Enkenbach-Alsenborn', 'Enkenbach-Alsenborn', 8200), -(4146, 51, 284, 'Fell', 'Fell', 8300), -(4147, 51, 284, 'Fischbach (67693)', 'Fischbach (67693)', 8400), -(4148, 51, 284, 'Forst (Hunsrck)', 'Forst (Hunsrck)', 8500), -(4149, 51, 284, 'Forst an der Weinstrae', 'Forst an der Weinstrae', 8600), -(4150, 51, 284, 'Frankenthal (Pfalz)', 'Frankenthal (Pfalz)', 8700), -(4151, 51, 284, 'Gau-Algesheim', 'Gau-Algesheim', 8800), -(4152, 51, 284, 'Gensingen', 'Gensingen', 8900), -(4153, 51, 284, 'Germersheim', 'Germersheim', 9000), -(4154, 51, 284, 'Gerolstein', 'Gerolstein', 9100), -(4155, 51, 284, 'Gillenfeld', 'Gillenfeld', 9200), -(4156, 51, 284, 'Glan-Mnchweiler', 'Glan-Mnchweiler', 9300), -(4157, 51, 284, 'Gleisweiler', 'Gleisweiler', 9400), -(4158, 51, 284, 'Grnstadt', 'Grnstadt', 9500), -(4159, 51, 284, 'Groniedesheim', 'Groniedesheim', 9600), -(4160, 51, 284, 'Gundheim', 'Gundheim', 9700), -(4161, 51, 284, 'Hachenburg', 'Hachenburg', 9800), -(4162, 51, 284, 'Hahn', 'Hahn', 9900), -(4163, 51, 284, 'Haloch', 'Haloch', 10000), -(4164, 51, 284, 'Hamm (57577)', 'Hamm (57577)', 10100), -(4165, 51, 284, 'Hasselbach (56288)', 'Hasselbach (56288)', 10200), -(4166, 51, 284, 'Heimbach', 'Heimbach', 10300), -(4167, 51, 284, 'Hermeskeil', 'Hermeskeil', 10400), -(4168, 51, 284, 'Herxheim bei Landau/Pfalz', 'Herxheim bei Landau/Pfalz', 10500), -(4169, 51, 284, 'Hettenleidelheim', 'Hettenleidelheim', 10600), -(4170, 51, 284, 'Hhr-Grenzhausen', 'Hhr-Grenzhausen', 10700), -(4171, 51, 284, 'Hochspeyer', 'Hochspeyer', 10800), -(4172, 51, 284, 'Hof', 'Hof', 10900), -(4173, 51, 284, 'Holzappel', 'Holzappel', 11000), -(4174, 51, 284, 'Homberg (67744)', 'Homberg (67744)', 11100), -(4175, 51, 284, 'Horhausen (56593)', 'Horhausen (56593)', 11200), -(4176, 51, 284, 'Idar-Oberstein', 'Idar-Oberstein', 11300), -(4177, 51, 284, 'Ingelheim am Rhein', 'Ingelheim am Rhein', 11400), -(4178, 51, 284, 'Kaisersesch', 'Kaisersesch', 11500), -(4179, 51, 284, 'Kaiserslautern', 'Kaiserslautern', 11600), -(4180, 51, 284, 'Kalt', 'Kalt', 11700), -(4181, 51, 284, 'Kandel', 'Kandel', 11800), -(4182, 51, 284, 'Karlshausen', 'Karlshausen', 11900), -(4183, 51, 284, 'Kasel', 'Kasel', 12000), -(4184, 51, 284, 'Kastellaun', 'Kastellaun', 12100), -(4185, 51, 284, 'Kelberg', 'Kelberg', 12200), -(4186, 51, 284, 'Kestert', 'Kestert', 12300), -(4187, 51, 284, 'Kirchberg', 'Kirchberg', 12400), -(4188, 51, 284, 'Kirchen', 'Kirchen', 12500), -(4189, 51, 284, 'Kirchheimbolanden', 'Kirchheimbolanden', 12600), -(4190, 51, 284, 'Kirn', 'Kirn', 12700), -(4191, 51, 284, 'Koblenz', 'Koblenz', 12800), -(4192, 51, 284, 'Konz', 'Konz', 12900), -(4193, 51, 284, 'Kruft', 'Kruft', 13000), -(4194, 51, 284, 'Krv', 'Krv', 13100), -(4195, 51, 284, 'Kusel', 'Kusel', 13200), -(4196, 51, 284, 'Lahnstein', 'Lahnstein', 13300), -(4197, 51, 284, 'Lambsheim', 'Lambsheim', 13400), -(4198, 51, 284, 'Landau in der Pfalz', 'Landau in der Pfalz', 13500), -(4199, 51, 284, 'Landstuhl', 'Landstuhl', 13600), -(4200, 51, 284, 'Lemberg', 'Lemberg', 13700), -(4201, 51, 284, 'Limburgerhof', 'Limburgerhof', 13800), -(4202, 51, 284, 'Linz am Rhein', 'Linz am Rhein', 13900), -(4203, 51, 284, 'Ludwigshafen am Rhein', 'Ludwigshafen am Rhein', 14000), -(4204, 51, 284, 'Ludwigshhe', 'Ludwigshhe', 14100), -(4205, 51, 284, 'Lutzerath', 'Lutzerath', 14200), -(4206, 51, 284, 'Mainz', 'Mainz', 14300), -(4207, 51, 284, 'Manderscheid (54531)', 'Manderscheid (54531)', 14400), -(4208, 51, 284, 'Marnheim', 'Marnheim', 14500), -(4209, 51, 284, 'Mayen', 'Mayen', 14600), -(4210, 51, 284, 'Mden', 'Mden', 14700), -(4211, 51, 284, 'Meckenheim', 'Meckenheim', 14800), -(4212, 51, 284, 'Meinborn', 'Meinborn', 14900), -(4213, 51, 284, 'Mendig', 'Mendig', 15000), -(4214, 51, 284, 'Miellen', 'Miellen', 15100), -(4215, 51, 284, 'Mlheim', 'Mlheim', 15200), -(4216, 51, 284, 'Mlheim-Krlich', 'Mlheim-Krlich', 15300), -(4217, 51, 284, 'Montabaur', 'Montabaur', 15400), -(4218, 51, 284, 'Morbach', 'Morbach', 15500), -(4219, 51, 284, 'Mrsbach', 'Mrsbach', 15600), -(4220, 51, 284, 'Mutterstadt', 'Mutterstadt', 15700), -(4221, 51, 284, 'Nassau', 'Nassau', 15800), -(4222, 51, 284, 'Nasttten', 'Nasttten', 15900); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(4223, 51, 284, 'Neuerburg', 'Neuerburg', 16000), -(4224, 51, 284, 'Neuerkirch', 'Neuerkirch', 16100), -(4225, 51, 284, 'Neuhofen', 'Neuhofen', 16200), -(4226, 51, 284, 'Neustadt (Westerwald)', 'Neustadt (Westerwald)', 16300), -(4227, 51, 284, 'Neustadt (Wied)', 'Neustadt (Wied)', 16400), -(4228, 51, 284, 'Neustadt an der Weinstrae', 'Neustadt an der Weinstrae', 16500), -(4229, 51, 284, 'Neuwied', 'Neuwied', 16600), -(4230, 51, 284, 'Nieder-Olm', 'Nieder-Olm', 16700), -(4231, 51, 284, 'Niedersohren', 'Niedersohren', 16800), -(4232, 51, 284, 'Oberhonnefeld-Gierend', 'Oberhonnefeld-Gierend', 16900), -(4233, 51, 284, 'Oberwesel', 'Oberwesel', 17000), -(4234, 51, 284, 'Offenbach an der Queich', 'Offenbach an der Queich', 17100), -(4235, 51, 284, 'Oppenheim', 'Oppenheim', 17200), -(4236, 51, 284, 'Osthofen', 'Osthofen', 17300), -(4237, 51, 284, 'Otterberg', 'Otterberg', 17400), -(4238, 51, 284, 'Pirmasens', 'Pirmasens', 17500), -(4239, 51, 284, 'Polch', 'Polch', 17600), -(4240, 51, 284, 'Prm', 'Prm', 17700), -(4241, 51, 284, 'Puderbach', 'Puderbach', 17800), -(4242, 51, 284, 'Ramstein-Miesenbach', 'Ramstein-Miesenbach', 17900), -(4243, 51, 284, 'Ransbach-Baumbach', 'Ransbach-Baumbach', 18000), -(4244, 51, 284, 'Remagen', 'Remagen', 18100), -(4245, 51, 284, 'Rennerod', 'Rennerod', 18200), -(4246, 51, 284, 'Rheinbrohl', 'Rheinbrohl', 18300), -(4247, 51, 284, 'Rlzheim', 'Rlzheim', 18400), -(4248, 51, 284, 'Rockenhausen', 'Rockenhausen', 18500), -(4249, 51, 284, 'Rosenheim', 'Rosenheim', 18600), -(4250, 51, 284, 'Roth (57539)', 'Roth (57539)', 18700), -(4251, 51, 284, 'Saarburg', 'Saarburg', 18800), -(4252, 51, 284, 'Sankt Julian', 'Sankt Julian', 18900), -(4253, 51, 284, 'Schifferstadt', 'Schifferstadt', 19000), -(4254, 51, 284, 'Schnenberg-Kbelberg', 'Schnenberg-Kbelberg', 19100), -(4255, 51, 284, 'Schwegenheim', 'Schwegenheim', 19200), -(4256, 51, 284, 'Sellerich', 'Sellerich', 19300), -(4257, 51, 284, 'Selters', 'Selters', 19400), -(4258, 51, 284, 'Sessenhausen', 'Sessenhausen', 19500), -(4259, 51, 284, 'Simmern (55469)', 'Simmern (55469)', 19600), -(4260, 51, 284, 'Simmertal', 'Simmertal', 19700), -(4261, 51, 284, 'Sinzig', 'Sinzig', 19800), -(4262, 51, 284, 'Sohren', 'Sohren', 19900), -(4263, 51, 284, 'Speyer', 'Speyer', 20000), -(4264, 51, 284, 'Trier', 'Trier', 20100), -(4265, 51, 284, 'Trimbs', 'Trimbs', 20200), -(4266, 51, 284, 'Ulmen', 'Ulmen', 20300), -(4267, 51, 284, 'Vallendar', 'Vallendar', 20400), -(4268, 51, 284, 'Waldmohr', 'Waldmohr', 20500), -(4269, 51, 284, 'Wallmerod', 'Wallmerod', 20600), -(4270, 51, 284, 'Walsdorf', 'Walsdorf', 20700), -(4271, 51, 284, 'Weiden', 'Weiden', 20800), -(4272, 51, 284, 'Weienthurm', 'Weienthurm', 20900), -(4273, 51, 284, 'Weilerbach', 'Weilerbach', 21000), -(4274, 51, 284, 'Westerburg', 'Westerburg', 21100), -(4275, 51, 284, 'Windhagen', 'Windhagen', 21200), -(4276, 51, 284, 'Winnweiler', 'Winnweiler', 21300), -(4277, 51, 284, 'Wirges', 'Wirges', 21400), -(4278, 51, 284, 'Wissen', 'Wissen', 21500), -(4279, 51, 284, 'Wittlich', 'Wittlich', 21600), -(4280, 51, 284, 'Worms', 'Worms', 21700), -(4281, 51, 284, 'Wrth am Rhein', 'Wrth am Rhein', 21800), -(4282, 51, 284, 'Zell', 'Zell', 21900), -(4283, 51, 284, 'Zerf', 'Zerf', 22000), -(4284, 51, 284, 'Zweibrcken', 'Zweibrcken', 22100), -(4285, 51, 284, 'Zweifelscheid', 'Zweifelscheid', 22200), -(4286, 51, 285, 'Beckingen', 'Beckingen', 100), -(4287, 51, 285, 'berherrn', 'berherrn', 200), -(4288, 51, 285, 'Bexbach', 'Bexbach', 300), -(4289, 51, 285, 'Blieskastel', 'Blieskastel', 400), -(4290, 51, 285, 'Bous', 'Bous', 500), -(4291, 51, 285, 'Dillingen', 'Dillingen', 600), -(4292, 51, 285, 'Ensdorf', 'Ensdorf', 700), -(4293, 51, 285, 'Eppelborn', 'Eppelborn', 800), -(4294, 51, 285, 'Friedrichsthal', 'Friedrichsthal', 900), -(4295, 51, 285, 'Gersheim', 'Gersheim', 1000), -(4296, 51, 285, 'Heusweiler', 'Heusweiler', 1100), -(4297, 51, 285, 'Homburg', 'Homburg', 1200), -(4298, 51, 285, 'Illingen', 'Illingen', 1300), -(4299, 51, 285, 'Kirkel', 'Kirkel', 1400), -(4300, 51, 285, 'Kleinblittersdorf', 'Kleinblittersdorf', 1500), -(4301, 51, 285, 'Lebach', 'Lebach', 1600), -(4302, 51, 285, 'Losheim am See', 'Losheim am See', 1700), -(4303, 51, 285, 'Mandelbachtal', 'Mandelbachtal', 1800), -(4304, 51, 285, 'Marpingen', 'Marpingen', 1900), -(4305, 51, 285, 'Merchweiler', 'Merchweiler', 2000), -(4306, 51, 285, 'Merzig', 'Merzig', 2100), -(4307, 51, 285, 'Mettlach', 'Mettlach', 2200), -(4308, 51, 285, 'Nalbach', 'Nalbach', 2300), -(4309, 51, 285, 'Namborn', 'Namborn', 2400), -(4310, 51, 285, 'Neunkirchen/Saar', 'Neunkirchen/Saar', 2500), -(4311, 51, 285, 'Nonnweiler', 'Nonnweiler', 2600), -(4312, 51, 285, 'Oberthal', 'Oberthal', 2700), -(4313, 51, 285, 'Ottweiler', 'Ottweiler', 2800), -(4314, 51, 285, 'Perl', 'Perl', 2900), -(4315, 51, 285, 'Pttlingen', 'Pttlingen', 3000), -(4316, 51, 285, 'Quierschied', 'Quierschied', 3100), -(4317, 51, 285, 'Rehlingen-Siersburg', 'Rehlingen-Siersburg', 3200), -(4318, 51, 285, 'Riegelsberg', 'Riegelsberg', 3300), -(4319, 51, 285, 'Saarbrcken', 'Saarbrcken', 3400), -(4320, 51, 285, 'Saarlouis', 'Saarlouis', 3500), -(4321, 51, 285, 'Saarwellingen', 'Saarwellingen', 3600), -(4322, 51, 285, 'Sankt Ingbert', 'Sankt Ingbert', 3700), -(4323, 51, 285, 'Sankt Wendel', 'Sankt Wendel', 3800), -(4324, 51, 285, 'Schmelz', 'Schmelz', 3900), -(4325, 51, 285, 'Schwalbach', 'Schwalbach', 4000), -(4326, 51, 285, 'Spiesen-Elversberg', 'Spiesen-Elversberg', 4100), -(4327, 51, 285, 'Sulzbach/Saar', 'Sulzbach/Saar', 4200), -(4328, 51, 285, 'Tholey', 'Tholey', 4300), -(4329, 51, 285, 'Vlklingen', 'Vlklingen', 4400), -(4330, 51, 285, 'Wadern', 'Wadern', 4500), -(4331, 51, 285, 'Wadgassen', 'Wadgassen', 4600), -(4332, 51, 285, 'Wallerfangen', 'Wallerfangen', 4700), -(4333, 51, 285, 'Weiskirchen', 'Weiskirchen', 4800), -(4334, 51, 286, 'Adorf', 'Adorf', 100), -(4335, 51, 286, 'Altenberg', 'Altenberg', 200), -(4336, 51, 286, 'Altmittweida', 'Altmittweida', 300), -(4337, 51, 286, 'Amtsberg', 'Amtsberg', 400), -(4338, 51, 286, 'Annaberg-Buchholz', 'Annaberg-Buchholz', 500), -(4339, 51, 286, 'Aue', 'Aue', 600), -(4340, 51, 286, 'Auerbach', 'Auerbach', 700), -(4341, 51, 286, 'Auerbach/Vogtland', 'Auerbach/Vogtland', 800), -(4342, 51, 286, 'Augustusburg', 'Augustusburg', 900), -(4343, 51, 286, 'Bad Dben', 'Bad Dben', 1000), -(4344, 51, 286, 'Bad Elster', 'Bad Elster', 1100), -(4345, 51, 286, 'Bad Muskau', 'Bad Muskau', 1200), -(4346, 51, 286, 'Bahretal', 'Bahretal', 1300), -(4347, 51, 286, 'Bannewitz', 'Bannewitz', 1400), -(4348, 51, 286, 'Bautzen', 'Bautzen', 1500), -(4349, 51, 286, 'Beiersdorf', 'Beiersdorf', 1600), -(4350, 51, 286, 'Beilrode', 'Beilrode', 1700), -(4351, 51, 286, 'Belgershain', 'Belgershain', 1800), -(4352, 51, 286, 'Bischofswerda', 'Bischofswerda', 1900), -(4353, 51, 286, 'Bockelwitz', 'Bockelwitz', 2000), -(4354, 51, 286, 'Borna', 'Borna', 2100), -(4355, 51, 286, 'Brnichen/Erzgebirge', 'Brnichen/Erzgebirge', 2200), -(4356, 51, 286, 'Burgstdt', 'Burgstdt', 2300), -(4357, 51, 286, 'Burkau', 'Burkau', 2400), -(4358, 51, 286, 'Cavertitz', 'Cavertitz', 2500), -(4359, 51, 286, 'Chemnitz', 'Chemnitz', 2600), -(4360, 51, 286, 'Claunitz', 'Claunitz', 2700), -(4361, 51, 286, 'Coswig', 'Coswig', 2800), -(4362, 51, 286, 'Crimmitschau', 'Crimmitschau', 2900), -(4363, 51, 286, 'Dbeln', 'Dbeln', 3000), -(4364, 51, 286, 'Delitzsch', 'Delitzsch', 3100), -(4365, 51, 286, 'Dennheritz', 'Dennheritz', 3200), -(4366, 51, 286, 'Deutschneudorf', 'Deutschneudorf', 3300), -(4367, 51, 286, 'Dippoldiswalde', 'Dippoldiswalde', 3400), -(4368, 51, 286, 'Dresden', 'Dresden', 3500), -(4369, 51, 286, 'Drrrhrsdorf-Dittersbach', 'Drrrhrsdorf-Dittersbach', 3600), -(4370, 51, 286, 'Falkenstein/Vogtland', 'Falkenstein/Vogtland', 3700), -(4371, 51, 286, 'Flha', 'Flha', 3800), -(4372, 51, 286, 'Freiberg', 'Freiberg', 3900), -(4373, 51, 286, 'Freital', 'Freital', 4000), -(4374, 51, 286, 'Glauchau', 'Glauchau', 4100), -(4375, 51, 286, 'Grditz', 'Grditz', 4200), -(4376, 51, 286, 'Grimma', 'Grimma', 4300), -(4377, 51, 286, 'Grlitz', 'Grlitz', 4400), -(4378, 51, 286, 'Groenhain', 'Groenhain', 4500), -(4379, 51, 286, 'Heidenau', 'Heidenau', 4600), -(4380, 51, 286, 'Hoyerswerda', 'Hoyerswerda', 4700), -(4381, 51, 286, 'Johanngeorgenstadt', 'Johanngeorgenstadt', 4800), -(4382, 51, 286, 'Jonsdorf', 'Jonsdorf', 4900), -(4383, 51, 286, 'Kamenz', 'Kamenz', 5000), -(4384, 51, 286, 'Klingenthal/Sachsen', 'Klingenthal/Sachsen', 5100), -(4385, 51, 286, 'Lauig', 'Lauig', 5200), -(4386, 51, 286, 'Lbau', 'Lbau', 5300), -(4387, 51, 286, 'Leipzig', 'Leipzig', 5400), -(4388, 51, 286, 'Limbach-Oberfrohna', 'Limbach-Oberfrohna', 5500), -(4389, 51, 286, 'Lnitz', 'Lnitz', 5600), -(4390, 51, 286, 'Lugau/Erzgebirge', 'Lugau/Erzgebirge', 5700), -(4391, 51, 286, 'Marienberg', 'Marienberg', 5800), -(4392, 51, 286, 'Markkleeberg', 'Markkleeberg', 5900), -(4393, 51, 286, 'Meerane', 'Meerane', 6000), -(4394, 51, 286, 'Meien', 'Meien', 6100), -(4395, 51, 286, 'Mittweida', 'Mittweida', 6200), -(4396, 51, 286, 'Neusalza-Spremberg', 'Neusalza-Spremberg', 6300), -(4397, 51, 286, 'Neustadt in Sachsen', 'Neustadt in Sachsen', 6400), -(4398, 51, 286, 'Niesky', 'Niesky', 6500), -(4399, 51, 286, 'Oelsnitz', 'Oelsnitz', 6600), -(4400, 51, 286, 'Ohorn', 'Ohorn', 6700), -(4401, 51, 286, 'Otterwisch', 'Otterwisch', 6800), -(4402, 51, 286, 'Pirna', 'Pirna', 6900), -(4403, 51, 286, 'Plauen', 'Plauen', 7000), -(4404, 51, 286, 'Pulsnitz', 'Pulsnitz', 7100), -(4405, 51, 286, 'Radeberg', 'Radeberg', 7200), -(4406, 51, 286, 'Radebeul', 'Radebeul', 7300), -(4407, 51, 286, 'Reichenbach/Vogtland', 'Reichenbach/Vogtland', 7400), -(4408, 51, 286, 'Riesa', 'Riesa', 7500), -(4409, 51, 286, 'Rodewisch', 'Rodewisch', 7600), -(4410, 51, 286, 'Rothenburg/Oberlausitz', 'Rothenburg/Oberlausitz', 7700), -(4411, 51, 286, 'Schlema', 'Schlema', 7800), -(4412, 51, 286, 'Schneeberg', 'Schneeberg', 7900), -(4413, 51, 286, 'Stollberg/Erzgebirge', 'Stollberg/Erzgebirge', 8000), -(4414, 51, 286, 'Syrau', 'Syrau', 8100), -(4415, 51, 286, 'Torgau', 'Torgau', 8200), -(4416, 51, 286, 'Treuen', 'Treuen', 8300), -(4417, 51, 286, 'Waldheim', 'Waldheim', 8400), -(4418, 51, 286, 'Weiwasser', 'Weiwasser', 8500), -(4419, 51, 286, 'Werdau', 'Werdau', 8600), -(4420, 51, 286, 'Wilkau-Halau', 'Wilkau-Halau', 8700), -(4421, 51, 286, 'Wurzen', 'Wurzen', 8800), -(4422, 51, 286, 'Zittau', 'Zittau', 8900), -(4423, 51, 286, 'Zschopau', 'Zschopau', 9000), -(4424, 51, 286, 'Zwickau', 'Zwickau', 9100), -(4425, 51, 287, 'Abbenrode', 'Abbenrode', 100), -(4426, 51, 287, 'Ahlsdorf', 'Ahlsdorf', 200), -(4427, 51, 287, 'Allrode', 'Allrode', 300), -(4428, 51, 287, 'Alterode', 'Alterode', 400), -(4429, 51, 287, 'Aschersleben', 'Aschersleben', 500), -(4430, 51, 287, 'Bad Drrenberg', 'Bad Drrenberg', 600), -(4431, 51, 287, 'Bad Ksen', 'Bad Ksen', 700), -(4432, 51, 287, 'Barby', 'Barby', 800), -(4433, 51, 287, 'Beelitz', 'Beelitz', 900), -(4434, 51, 287, 'Bernburg', 'Bernburg', 1000), -(4435, 51, 287, 'Bitterfeld', 'Bitterfeld', 1100), -(4436, 51, 287, 'Blankenburg', 'Blankenburg', 1200), -(4437, 51, 287, 'Born', 'Born', 1300), -(4438, 51, 287, 'Braunsbedra', 'Braunsbedra', 1400), -(4439, 51, 287, 'Burg', 'Burg', 1500), -(4440, 51, 287, 'Dessau', 'Dessau', 1600), -(4441, 51, 287, 'Ditfurt', 'Ditfurt', 1700), -(4442, 51, 287, 'Domnitz', 'Domnitz', 1800), -(4443, 51, 287, 'Eilsleben', 'Eilsleben', 1900), -(4444, 51, 287, 'Gardelegen', 'Gardelegen', 2000), -(4445, 51, 287, 'Genthin', 'Genthin', 2100), -(4446, 51, 287, 'Grana', 'Grana', 2200), -(4447, 51, 287, 'Grfenhainichen', 'Grfenhainichen', 2300), -(4448, 51, 287, 'Gsten', 'Gsten', 2400), -(4449, 51, 287, 'Halberstadt', 'Halberstadt', 2500), -(4450, 51, 287, 'Haldensleben', 'Haldensleben', 2600), -(4451, 51, 287, 'Halle', 'Halle', 2700), -(4452, 51, 287, 'Hettstedt', 'Hettstedt', 2800), -(4453, 51, 287, 'Hohenmlsen', 'Hohenmlsen', 2900), -(4454, 51, 287, 'Hohenthurm', 'Hohenthurm', 3000), -(4455, 51, 287, 'Htensleben', 'Htensleben', 3100), -(4456, 51, 287, 'Jenitz', 'Jenitz', 3200), -(4457, 51, 287, 'Jessen (Elster)', 'Jessen (Elster)', 3300), -(4458, 51, 287, 'Kthen', 'Kthen', 3400), -(4459, 51, 287, 'Kthen', 'Kthen', 3500), -(4460, 51, 287, 'Leuna', 'Leuna', 3600), -(4461, 51, 287, 'Luso', 'Luso', 3700), -(4462, 51, 287, 'Lutherstadt Eisleben', 'Lutherstadt Eisleben', 3800), -(4463, 51, 287, 'Lutherstadt Wittenberg', 'Lutherstadt Wittenberg', 3900), -(4464, 51, 287, 'Magdeburg', 'Magdeburg', 4000), -(4465, 51, 287, 'Menz', 'Menz', 4100), -(4466, 51, 287, 'Merseburg', 'Merseburg', 4200), -(4467, 51, 287, 'Milzau', 'Milzau', 4300), -(4468, 51, 287, 'Naumburg', 'Naumburg', 4400), -(4469, 51, 287, 'Nessa', 'Nessa', 4500), -(4470, 51, 287, 'Oschersleben', 'Oschersleben', 4600), -(4471, 51, 287, 'Quedlinburg', 'Quedlinburg', 4700), -(4472, 51, 287, 'Salzwedel', 'Salzwedel', 4800), -(4473, 51, 287, 'Sangerhausen', 'Sangerhausen', 4900), -(4474, 51, 287, 'Schnebeck (Elbe)', 'Schnebeck (Elbe)', 5000), -(4475, 51, 287, 'Stafurt', 'Stafurt', 5100), -(4476, 51, 287, 'Sten', 'Sten', 5200), -(4477, 51, 287, 'Stendal', 'Stendal', 5300), -(4478, 51, 287, 'Thale', 'Thale', 5400), -(4479, 51, 287, 'Weienfels', 'Weienfels', 5500), -(4480, 51, 287, 'Wernigerode', 'Wernigerode', 5600), -(4481, 51, 287, 'Wohlmirstedt', 'Wohlmirstedt', 5700), -(4482, 51, 287, 'Wolfen', 'Wolfen', 5800), -(4483, 51, 287, 'Wolmirstedt', 'Wolmirstedt', 5900), -(4484, 51, 287, 'Zeitz', 'Zeitz', 6000), -(4485, 51, 287, 'Zerbst', 'Zerbst', 6100), -(4486, 51, 287, 'Zrbig', 'Zrbig', 6200), -(4487, 51, 288, 'Ahneby', 'Ahneby', 100), -(4488, 51, 288, 'Ahrensbk', 'Ahrensbk', 200), -(4489, 51, 288, 'Ahrensburg', 'Ahrensburg', 300), -(4490, 51, 288, 'Albersdorf', 'Albersdorf', 400), -(4491, 51, 288, 'Almdorf', 'Almdorf', 500), -(4492, 51, 288, 'Alt Duvenstedt', 'Alt Duvenstedt', 600), -(4493, 51, 288, 'Alt Mlln', 'Alt Mlln', 700), -(4494, 51, 288, 'Altenholz', 'Altenholz', 800), -(4495, 51, 288, 'Averlak', 'Averlak', 900), -(4496, 51, 288, 'Bad Bramstedt', 'Bad Bramstedt', 1000), -(4497, 51, 288, 'Bad Oldesloe', 'Bad Oldesloe', 1100), -(4498, 51, 288, 'Bad Schwartau', 'Bad Schwartau', 1200), -(4499, 51, 288, 'Bad Segeberg', 'Bad Segeberg', 1300), -(4500, 51, 288, 'Barmstedt', 'Barmstedt', 1400), -(4501, 51, 288, 'Bdelsdorf', 'Bdelsdorf', 1500), -(4502, 51, 288, 'Bk', 'Bk', 1600), -(4503, 51, 288, 'Bklund', 'Bklund', 1700), -(4504, 51, 288, 'Blunk', 'Blunk', 1800), -(4505, 51, 288, 'Bokel (24802)', 'Bokel (24802)', 1900), -(4506, 51, 288, 'Bordesholm', 'Bordesholm', 2000), -(4507, 51, 288, 'Bornhved', 'Bornhved', 2100), -(4508, 51, 288, 'Breiholz', 'Breiholz', 2200), -(4509, 51, 288, 'Brunsbttel', 'Brunsbttel', 2300), -(4510, 51, 288, 'Bsum', 'Bsum', 2400), -(4511, 51, 288, 'Burg (Dithmarschen)', 'Burg (Dithmarschen)', 2500), -(4512, 51, 288, 'Dagebll', 'Dagebll', 2600), -(4513, 51, 288, 'Dannewerk', 'Dannewerk', 2700), -(4514, 51, 288, 'Dchelsdorf', 'Dchelsdorf', 2800), -(4515, 51, 288, 'Dgeling', 'Dgeling', 2900), -(4516, 51, 288, 'Eckernfrde', 'Eckernfrde', 3000), -(4517, 51, 288, 'Elmenhorst (23869)', 'Elmenhorst (23869)', 3100), -(4518, 51, 288, 'Elmshorn', 'Elmshorn', 3200), -(4519, 51, 288, 'Eutin', 'Eutin', 3300), -(4520, 51, 288, 'Fahrdorf', 'Fahrdorf', 3400), -(4521, 51, 288, 'Flensburg', 'Flensburg', 3500), -(4522, 51, 288, 'Glcksburg', 'Glcksburg', 3600), -(4523, 51, 288, 'Glckstadt', 'Glckstadt', 3700), -(4524, 51, 288, 'Grmitz', 'Grmitz', 3800), -(4525, 51, 288, 'Gro Grnau', 'Gro Grnau', 3900), -(4526, 51, 288, 'Handewitt', 'Handewitt', 4000), -(4527, 51, 288, 'Harrislee', 'Harrislee', 4100), -(4528, 51, 288, 'Heide', 'Heide', 4200), -(4529, 51, 288, 'Heiligenhafen', 'Heiligenhafen', 4300), -(4530, 51, 288, 'Henstedt-Ulzburg', 'Henstedt-Ulzburg', 4400), -(4531, 51, 288, 'Hohenwestedt', 'Hohenwestedt', 4500), -(4532, 51, 288, 'Hohn', 'Hohn', 4600), -(4533, 51, 288, 'Husum', 'Husum', 4700), -(4534, 51, 288, 'Itzehoe', 'Itzehoe', 4800), -(4535, 51, 288, 'Kaltenkirchen', 'Kaltenkirchen', 4900), -(4536, 51, 288, 'Kampen', 'Kampen', 5000), -(4537, 51, 288, 'Kappeln', 'Kappeln', 5100), -(4538, 51, 288, 'Kiel', 'Kiel', 5200), -(4539, 51, 288, 'Krempe', 'Krempe', 5300), -(4540, 51, 288, 'Kropp', 'Kropp', 5400), -(4541, 51, 288, 'Lbeck', 'Lbeck', 5500), -(4542, 51, 288, 'Leck', 'Leck', 5600), -(4543, 51, 288, 'Ltjenburg', 'Ltjenburg', 5700), -(4544, 51, 288, 'Malente', 'Malente', 5800), -(4545, 51, 288, 'Marne', 'Marne', 5900), -(4546, 51, 288, 'Meldorf', 'Meldorf', 6000), -(4547, 51, 288, 'Mlln', 'Mlln', 6100), -(4548, 51, 288, 'Neukirchen (23779)', 'Neukirchen (23779)', 6200), -(4549, 51, 288, 'Neumnster', 'Neumnster', 6300), -(4550, 51, 288, 'Neustadt in Holstein', 'Neustadt in Holstein', 6400), -(4551, 51, 288, 'Niebll', 'Niebll', 6500), -(4552, 51, 288, 'Norderstedt', 'Norderstedt', 6600), -(4553, 51, 288, 'Nortorf (24589)', 'Nortorf (24589)', 6700), -(4554, 51, 288, 'Oldenburg in Holstein', 'Oldenburg in Holstein', 6800), -(4555, 51, 288, 'Padenstedt', 'Padenstedt', 6900), -(4556, 51, 288, 'Pinneberg', 'Pinneberg', 7000), -(4557, 51, 288, 'Pln', 'Pln', 7100), -(4558, 51, 288, 'Preetz', 'Preetz', 7200), -(4559, 51, 288, 'Raisdorf', 'Raisdorf', 7300), -(4560, 51, 288, 'Ratekau', 'Ratekau', 7400), -(4561, 51, 288, 'Ratzeburg', 'Ratzeburg', 7500), -(4562, 51, 288, 'Reinbek', 'Reinbek', 7600), -(4563, 51, 288, 'Reinfeld (Holstein)', 'Reinfeld (Holstein)', 7700), -(4564, 51, 288, 'Rendsburg', 'Rendsburg', 7800), -(4565, 51, 288, 'Satrup', 'Satrup', 7900), -(4566, 51, 288, 'Schacht-Audorf', 'Schacht-Audorf', 8000), -(4567, 51, 288, 'Scharbeutz', 'Scharbeutz', 8100), -(4568, 51, 288, 'Schierensee', 'Schierensee', 8200), -(4569, 51, 288, 'Schleswig', 'Schleswig', 8300), -(4570, 51, 288, 'Schwarzenbek', 'Schwarzenbek', 8400), -(4571, 51, 288, 'Sderbrarup', 'Sderbrarup', 8500), -(4572, 51, 288, 'Sterup', 'Sterup', 8600), -(4573, 51, 288, 'Stockelsdorf', 'Stockelsdorf', 8700), -(4574, 51, 288, 'Tarp', 'Tarp', 8800), -(4575, 51, 288, 'Timmendorfer Strand', 'Timmendorfer Strand', 8900), -(4576, 51, 288, 'Tornesch', 'Tornesch', 9000), -(4577, 51, 288, 'Trappenkamp', 'Trappenkamp', 9100), -(4578, 51, 288, 'Uetersen', 'Uetersen', 9200), -(4579, 51, 288, 'Wahlstedt', 'Wahlstedt', 9300), -(4580, 51, 288, 'Warnau', 'Warnau', 9400), -(4581, 51, 288, 'Wedel', 'Wedel', 9500), -(4582, 51, 288, 'Westerland', 'Westerland', 9600), -(4583, 51, 288, 'Wilster', 'Wilster', 9700), -(4584, 51, 288, 'Wyk auf Fhr', 'Wyk auf Fhr', 9800), -(4585, 51, 289, 'Abtsbessingen', 'Abtsbessingen', 100), -(4586, 51, 289, 'Ahlstdt', 'Ahlstdt', 200), -(4587, 51, 289, 'Albersdorf', 'Albersdorf', 300), -(4588, 51, 289, 'Allendorf', 'Allendorf', 400), -(4589, 51, 289, 'Altenburg', 'Altenburg', 500), -(4590, 51, 289, 'Altkirchen', 'Altkirchen', 600), -(4591, 51, 289, 'Anrode', 'Anrode', 700), -(4592, 51, 289, 'Apolda', 'Apolda', 800), -(4593, 51, 289, 'Arnsgereuth', 'Arnsgereuth', 900), -(4594, 51, 289, 'Arnstadt', 'Arnstadt', 1000), -(4595, 51, 289, 'Artern', 'Artern', 1100), -(4596, 51, 289, 'Aspach', 'Aspach', 1200), -(4597, 51, 289, 'Auleben', 'Auleben', 1300), -(4598, 51, 289, 'Bachfeld', 'Bachfeld', 1400), -(4599, 51, 289, 'Bad Berka', 'Bad Berka', 1500), -(4600, 51, 289, 'Bad Blankenburg', 'Bad Blankenburg', 1600), -(4601, 51, 289, 'Bad Langensalza', 'Bad Langensalza', 1700), -(4602, 51, 289, 'Bad Liebenstein', 'Bad Liebenstein', 1800), -(4603, 51, 289, 'Bad Salzungen', 'Bad Salzungen', 1900), -(4604, 51, 289, 'Bad Sulza', 'Bad Sulza', 2000), -(4605, 51, 289, 'Ballstdt', 'Ballstdt', 2100), -(4606, 51, 289, 'Ballstedt', 'Ballstedt', 2200), -(4607, 51, 289, 'Bischofferode', 'Bischofferode', 2300), -(4608, 51, 289, 'Creuzburg', 'Creuzburg', 2400), -(4609, 51, 289, 'Dingelstdt', 'Dingelstdt', 2500), -(4610, 51, 289, 'Drogen', 'Drogen', 2600), -(4611, 51, 289, 'Eisenach', 'Eisenach', 2700), -(4612, 51, 289, 'Eisenberg', 'Eisenberg', 2800), -(4613, 51, 289, 'Eisfeld', 'Eisfeld', 2900), -(4614, 51, 289, 'Erbenhausen', 'Erbenhausen', 3000), -(4615, 51, 289, 'Erfurt', 'Erfurt', 3100), -(4616, 51, 289, 'Gera', 'Gera', 3200), -(4617, 51, 289, 'Gotha', 'Gotha', 3300), -(4618, 51, 289, 'Greiz', 'Greiz', 3400), -(4619, 51, 289, 'Hausen', 'Hausen', 3500), -(4620, 51, 289, 'Heilbad Heiligenstadt', 'Heilbad Heiligenstadt', 3600), -(4621, 51, 289, 'Hermsdorf', 'Hermsdorf', 3700), -(4622, 51, 289, 'Hildburghausen', 'Hildburghausen', 3800), -(4623, 51, 289, 'Ilmenau', 'Ilmenau', 3900), -(4624, 51, 289, 'Jena', 'Jena', 4000), -(4625, 51, 289, 'Kahla', 'Kahla', 4100), -(4626, 51, 289, 'Kamsdorf', 'Kamsdorf', 4200), -(4627, 51, 289, 'Klleda', 'Klleda', 4300), -(4628, 51, 289, 'Krlpa', 'Krlpa', 4400), -(4629, 51, 289, 'Leinefelde', 'Leinefelde', 4500), -(4630, 51, 289, 'Leutenberg', 'Leutenberg', 4600), -(4631, 51, 289, 'Lobenstein', 'Lobenstein', 4700), -(4632, 51, 289, 'Meiningen', 'Meiningen', 4800), -(4633, 51, 289, 'Meuselwitz', 'Meuselwitz', 4900), -(4634, 51, 289, 'Mhlberg', 'Mhlberg', 5000), -(4635, 51, 289, 'Mhlhausen', 'Mhlhausen', 5100), -(4636, 51, 289, 'Mlverstedt', 'Mlverstedt', 5200), -(4637, 51, 289, 'Nordhausen', 'Nordhausen', 5300), -(4638, 51, 289, 'Pneck', 'Pneck', 5400), -(4639, 51, 289, 'Ringleben (99189)', 'Ringleben (99189)', 5500), -(4640, 51, 289, 'Rosendorf', 'Rosendorf', 5600), -(4641, 51, 289, 'Rudolstadt', 'Rudolstadt', 5700), -(4642, 51, 289, 'Ruhla', 'Ruhla', 5800), -(4643, 51, 289, 'Saalfeld/Saale', 'Saalfeld/Saale', 5900), -(4644, 51, 289, 'Schklen', 'Schklen', 6000), -(4645, 51, 289, 'Schleiz', 'Schleiz', 6100), -(4646, 51, 289, 'Schmalkalden', 'Schmalkalden', 6200), -(4647, 51, 289, 'Schmlln', 'Schmlln', 6300), -(4648, 51, 289, 'Sitzendorf', 'Sitzendorf', 6400), -(4649, 51, 289, 'Smmerda', 'Smmerda', 6500), -(4650, 51, 289, 'Sondershausen', 'Sondershausen', 6600), -(4651, 51, 289, 'Sonneberg', 'Sonneberg', 6700), -(4652, 51, 289, 'Stadtilm', 'Stadtilm', 6800), -(4653, 51, 289, 'Steinbach-Hallenberg', 'Steinbach-Hallenberg', 6900), -(4654, 51, 289, 'Suhl', 'Suhl', 7000), -(4655, 51, 289, 'Vachdorf', 'Vachdorf', 7100), -(4656, 51, 289, 'Veilsdorf', 'Veilsdorf', 7200), -(4657, 51, 289, 'Weida', 'Weida', 7300), -(4658, 51, 289, 'Weimar', 'Weimar', 7400), -(4659, 51, 289, 'Zella', 'Zella', 7500), -(4660, 51, 289, 'Zella-Mehlis', 'Zella-Mehlis', 7600), -(4661, 51, 289, 'Zeulenroda', 'Zeulenroda', 7700), -(4662, 51, 289, 'Zimmern', 'Zimmern', 7800), -(4663, 51, 289, 'Zwinge', 'Zwinge', 7900), -(4664, 52, 290, 'Сент-Питер-Порт', 'Сент-Питер-Порт', 100), -(4665, 53, 291, 'Caleta', 'Caleta', 100), -(4666, 53, 291, 'Catalan', 'Catalan', 200), -(4667, 53, 291, 'Catalan Bay', 'Catalan Bay', 300), -(4668, 53, 291, 'Gibraltar', 'Gibraltar', 400), -(4669, 53, 291, 'Rosia', 'Rosia', 500), -(4670, 53, 291, 'Waterport', 'Waterport', 600), -(4671, 54, 292, 'Тегусигальпа', 'Тегусигальпа', 100), -(4672, 55, 293, 'Гонконг', 'Гонконг', 100), -(4673, 56, 294, 'Сент-Джорджес', 'Сент-Джорджес', 100), -(4674, 57, 295, 'Нуука', 'Нуука', 100), -(4675, 58, 296, 'Aga Sotra', 'Aga Sotra', 100), -(4676, 58, 296, 'Aga Trida', 'Aga Trida', 200), -(4677, 58, 296, 'Agrnio', 'Agrnio', 300), -(4678, 58, 296, 'Aspropili', 'Aspropili', 400), -(4679, 58, 296, 'Astako', 'Astako', 500), -(4680, 58, 296, 'Avlki', 'Avlki', 600), -(4681, 58, 296, 'Nvpaktos', 'Nvpaktos', 700), -(4682, 58, 296, 'Provan', 'Provan', 800), -(4683, 58, 297, 'Aegion', 'Aegion', 100), -(4684, 58, 297, 'Agio', 'Agio', 200), -(4685, 58, 297, 'Agion', 'Agion', 300), -(4686, 58, 297, 'Aighion', 'Aighion', 400), -(4687, 58, 297, 'Ayion', 'Ayion', 500), -(4688, 58, 297, 'Egion', 'Egion', 600), -(4689, 58, 297, 'Kalvrita', 'Kalvrita', 700), -(4690, 58, 297, 'Patras', 'Patras', 800), -(4691, 58, 297, 'Ptra', 'Ptra', 900), -(4692, 58, 298, 'Ermini', 'Ermini', 100), -(4693, 58, 298, 'Krandi', 'Krandi', 200), -(4694, 58, 298, 'Nauplion', 'Nauplion', 300), -(4695, 58, 298, 'Nfplio', 'Nfplio', 400), -(4696, 58, 298, 'Nfplion', 'Nfplion', 500), -(4697, 58, 298, 'Nvplio', 'Nvplio', 600), -(4698, 58, 298, 'Nvplion', 'Nvplion', 700), -(4699, 58, 298, 'Prto-Khli', 'Prto-Khli', 800), -(4700, 58, 298, 'rgos', 'rgos', 900), -(4701, 58, 299, 'Leondi', 'Leondi', 100), -(4702, 58, 299, 'Megalpolis', 'Megalpolis', 200), -(4703, 58, 299, 'stros', 'stros', 300), -(4704, 58, 299, 'Trpoli', 'Trpoli', 400), -(4705, 58, 299, 'Trpolis', 'Trpolis', 500), -(4706, 58, 300, 'Aga Trida', 'Aga Trida', 100), -(4707, 58, 300, 'Aga Tris', 'Aga Tris', 200), -(4708, 58, 300, 'Alni', 'Alni', 300), -(4709, 58, 300, 'Gianntsi', 'Gianntsi', 400), -(4710, 58, 300, 'gios Ionnis', 'gios Ionnis', 500), -(4711, 58, 300, 'Mlos Pap', 'Mlos Pap', 600), -(4712, 58, 300, 'rta', 'rta', 700), -(4713, 58, 301, 'Aegina', 'Aegina', 100), -(4714, 58, 301, 'Afini', 'Afini', 200), -(4715, 58, 301, 'Agina', 'Agina', 300), -(4716, 58, 301, 'Arpis', 'Arpis', 400), -(4717, 58, 301, 'Atene', 'Atene', 500), -(4718, 58, 301, 'Athen', 'Athen', 600), -(4719, 58, 301, 'Athenai', 'Athenai', 700), -(4720, 58, 301, 'Athens', 'Athens', 800), -(4721, 58, 301, 'Athinia', 'Athinia', 900), -(4722, 58, 301, 'Athna', 'Athna', 1000), -(4723, 58, 301, 'Athnai', 'Athnai', 1100), -(4724, 58, 301, 'Athnes', 'Athnes', 1200), -(4725, 58, 301, 'Elefsna', 'Elefsna', 1300), -(4726, 58, 301, 'Elefss', 'Elefss', 1400), -(4727, 58, 301, 'Eleusis', 'Eleusis', 1500), -(4728, 58, 301, 'gioi', 'gioi', 1600), -(4729, 58, 301, 'Glifdha', 'Glifdha', 1700), -(4730, 58, 301, 'Glyfda', 'Glyfda', 1800), -(4731, 58, 301, 'kalithea', 'kalithea', 1900), -(4732, 58, 301, 'Keratsinou', 'Keratsinou', 2000), -(4733, 58, 301, 'Keratsni', 'Keratsni', 2100), -(4734, 58, 301, 'Palokia', 'Palokia', 2200), -(4735, 58, 301, 'Peiraeus', 'Peiraeus', 2300), -(4736, 58, 301, 'Peirai', 'Peirai', 2400), -(4737, 58, 301, 'Piraeus', 'Piraeus', 2500), -(4738, 58, 301, 'Pireo', 'Pireo', 2600), -(4739, 58, 301, 'Potams', 'Potams', 2700), -(4740, 58, 301, 'Prama', 'Prama', 2800), -(4741, 58, 301, 'Pros', 'Pros', 2900), -(4742, 58, 302, 'Afntou', 'Afntou', 100), -(4743, 58, 302, 'Kos', 'Kos', 200), -(4744, 58, 302, 'Krpathos', 'Krpathos', 300), -(4745, 58, 302, 'Rdhos', 'Rdhos', 400), -(4746, 58, 302, 'Rdos', 'Rdos', 500), -(4747, 58, 302, 'Smi', 'Smi', 600), -(4748, 58, 303, 'Dhrma', 'Dhrma', 100), -(4749, 58, 303, 'Drma', 'Drma', 200), -(4750, 58, 303, 'Exoch', 'Exoch', 300), -(4751, 58, 303, 'Exokh', 'Exokh', 400), -(4752, 58, 304, 'gios Antnios', 'gios Antnios', 100), -(4753, 58, 304, 'grafa', 'grafa', 200), -(4754, 58, 305, 'Alexandhropolis', 'Alexandhropolis', 100), -(4755, 58, 305, 'Alexandropoli', 'Alexandropoli', 200), -(4756, 58, 305, 'Alexandropolis', 'Alexandropolis', 300), -(4757, 58, 305, 'Dhidhimtikhon', 'Dhidhimtikhon', 400), -(4758, 58, 305, 'Didymteicho', 'Didymteicho', 500), -(4759, 58, 305, 'Dlofos', 'Dlofos', 600), -(4760, 58, 305, 'Fres', 'Fres', 700), -(4761, 58, 305, 'Orestida', 'Orestida', 800), -(4762, 58, 305, 'Soufl', 'Soufl', 900), -(4763, 58, 306, 'Chalkda', 'Chalkda', 100), -(4764, 58, 306, 'Chalks', 'Chalks', 200), -(4765, 58, 306, 'Istiaa', 'Istiaa', 300), -(4766, 58, 306, 'Kristos', 'Kristos', 400), -(4767, 58, 306, 'Mantodion', 'Mantodion', 500), -(4768, 58, 307, 'Flrina', 'Flrina', 100), -(4769, 58, 307, 'Nvista', 'Nvista', 200), -(4770, 58, 307, 'Opa', 'Opa', 300), -(4771, 58, 307, 'Plorina', 'Plorina', 400), -(4772, 58, 307, 'Vvani', 'Vvani', 500), -(4773, 58, 308, 'Atalnti', 'Atalnti', 100), -(4774, 58, 308, 'Lama', 'Lama', 200), -(4775, 58, 309, 'Arpi', 'Arpi', 100), -(4776, 58, 309, 'Georgtsa', 'Georgtsa', 200), -(4777, 58, 309, 'Greven', 'Greven', 300), -(4778, 58, 310, 'Amalida', 'Amalida', 100), -(4779, 58, 310, 'Katkolon', 'Katkolon', 200), -(4780, 58, 310, 'Killni', 'Killni', 300), -(4781, 58, 310, 'Kyllni', 'Kyllni', 400), -(4782, 58, 310, 'Manolda', 'Manolda', 500), -(4783, 58, 310, 'no Manols', 'no Manols', 600), -(4784, 58, 310, 'Prgos', 'Prgos', 700), -(4785, 58, 311, 'Alexndreia', 'Alexndreia', 100), -(4786, 58, 311, 'Alexndria', 'Alexndria', 200), -(4787, 58, 311, 'Kra Vrsi', 'Kra Vrsi', 300), -(4788, 58, 311, 'Makrokhri', 'Makrokhri', 400), -(4789, 58, 311, 'Nousa', 'Nousa', 500), -(4790, 58, 311, 'rachos', 'rachos', 600), -(4791, 58, 311, 'Veria', 'Veria', 700), -(4792, 58, 311, 'Vroia', 'Vroia', 800), -(4793, 58, 312, 'Iliokhrion', 'Iliokhrion', 100), -(4794, 58, 312, 'Ionnina', 'Ionnina', 200), -(4795, 58, 313, 'Alikarnasss', 'Alikarnasss', 100), -(4796, 58, 313, 'Erakleion', 'Erakleion', 200), -(4797, 58, 313, 'Govai', 'Govai', 300), -(4798, 58, 313, 'Heraklion', 'Heraklion', 400), -(4799, 58, 313, 'Herkleion', 'Herkleion', 500), -(4800, 58, 313, 'Iraclion', 'Iraclion', 600), -(4801, 58, 313, 'Irkleio', 'Irkleio', 700), -(4802, 58, 313, 'Irkleion', 'Irkleion', 800), -(4803, 58, 313, 'Irklion', 'Irklion', 900), -(4804, 58, 313, 'Mores', 'Mores', 1000), -(4805, 58, 314, 'Kardtsa', 'Kardtsa', 100), -(4806, 58, 314, 'Kotsouron', 'Kotsouron', 200), -(4807, 58, 315, 'Aga nna', 'Aga nna', 100), -(4808, 58, 315, 'Fteli', 'Fteli', 200), -(4809, 58, 315, 'Kastori', 'Kastori', 300), -(4810, 58, 315, 'Nki', 'Nki', 400), -(4811, 58, 316, 'Agasma', 'Agasma', 100), -(4812, 58, 316, 'Cavalla', 'Cavalla', 200), -(4813, 58, 316, 'Chrysopoli', 'Chrysopoli', 300), -(4814, 58, 316, 'Kaballa', 'Kaballa', 400), -(4815, 58, 316, 'Kalvai', 'Kalvai', 500), -(4816, 58, 316, 'Kavla', 'Kavla', 600), -(4817, 58, 316, 'Kavlla', 'Kavlla', 700), -(4818, 58, 316, 'Na Pramos', 'Na Pramos', 800), -(4819, 58, 316, 'Thsos', 'Thsos', 900), -(4820, 58, 317, 'Argostli', 'Argostli', 100), -(4821, 58, 317, 'Argostlion', 'Argostlion', 200), -(4822, 58, 318, 'Achlleion', 'Achlleion', 100), -(4823, 58, 318, 'Athinio', 'Athinio', 200), -(4824, 58, 318, 'Corfu', 'Corfu', 300), -(4825, 58, 318, 'fra', 'fra', 400), -(4826, 58, 318, 'Korfu', 'Korfu', 500), -(4827, 58, 318, 'Krkira', 'Krkira', 600), -(4828, 58, 318, 'Krkyra', 'Krkyra', 700), -(4829, 58, 319, 'Arnaa', 'Arnaa', 100), -(4830, 58, 319, 'Dfni', 'Dfni', 200), -(4831, 58, 319, 'Hierissos', 'Hierissos', 300), -(4832, 58, 319, 'Laringvi', 'Laringvi', 400), -(4833, 58, 319, 'Pilyiros', 'Pilyiros', 500), -(4834, 58, 319, 'Polgyros', 'Polgyros', 600), -(4835, 58, 319, 'Polyiros', 'Polyiros', 700), -(4836, 58, 320, 'Canea', 'Canea', 100), -(4837, 58, 320, 'Chani', 'Chani', 200), -(4838, 58, 320, 'Khani', 'Khani', 300), -(4839, 58, 320, 'Kssamos', 'Kssamos', 400), -(4840, 58, 320, 'Loutr', 'Loutr', 500), -(4841, 58, 320, 'Palaiochra', 'Palaiochra', 600), -(4842, 58, 320, 'Sphinari', 'Sphinari', 700), -(4843, 58, 321, 'Afrodsia', 'Afrodsia', 100), -(4844, 58, 321, 'Chalkein', 'Chalkein', 200), -(4845, 58, 321, 'Hios', 'Hios', 300), -(4846, 58, 321, 'Karfs', 'Karfs', 400), -(4847, 58, 321, 'Karia', 'Karia', 500), -(4848, 58, 322, 'Admas', 'Admas', 100), -(4849, 58, 322, 'Fir', 'Fir', 200), -(4850, 58, 322, 'Mkonos', 'Mkonos', 300), -(4851, 58, 322, 'Mkonos', 'Mkonos', 400), -(4852, 58, 322, 'Mlos', 'Mlos', 500), -(4853, 58, 322, 'Nxos', 'Nxos', 600), -(4854, 58, 322, 'Pros', 'Pros', 700), -(4855, 58, 322, 'Thra', 'Thra', 800), -(4856, 58, 323, 'Atl', 'Atl', 100), -(4857, 58, 323, 'Axiopoli', 'Axiopoli', 200), -(4858, 58, 323, 'Galliks', 'Galliks', 300), -(4859, 58, 323, 'Kalndhria', 'Kalndhria', 400), -(4860, 58, 323, 'Kilks', 'Kilks', 500), -(4861, 58, 323, 'Libhovon', 'Libhovon', 600), -(4862, 58, 323, 'Polkastro', 'Polkastro', 700), -(4863, 58, 323, 'Skhovon', 'Skhovon', 800), -(4864, 58, 324, 'Corinth', 'Corinth', 100), -(4865, 58, 324, 'Kito', 'Kito', 200), -(4866, 58, 324, 'Kiton', 'Kiton', 300), -(4867, 58, 324, 'Krinthos', 'Krinthos', 400), -(4868, 58, 325, 'Kozni', 'Kozni', 100), -(4869, 58, 325, 'Ptolemaida', 'Ptolemaida', 200), -(4870, 58, 326, 'Arepolis', 'Arepolis', 100), -(4871, 58, 326, 'Lacedaemon', 'Lacedaemon', 200), -(4872, 58, 326, 'Nepolis', 'Nepolis', 300), -(4873, 58, 326, 'Skla', 'Skla', 400), -(4874, 58, 326, 'Sparta', 'Sparta', 500), -(4875, 58, 326, 'Sparte', 'Sparte', 600), -(4876, 58, 326, 'Sprti', 'Sprti', 700), -(4877, 58, 327, 'Anatol', 'Anatol', 100), -(4878, 58, 327, 'Asarlk', 'Asarlk', 200), -(4879, 58, 327, 'Elassna', 'Elassna', 300), -(4880, 58, 327, 'Frsala', 'Frsala', 400), -(4881, 58, 327, 'Ita', 'Ita', 500), -(4882, 58, 327, 'Kypselochri', 'Kypselochri', 600), -(4883, 58, 327, 'Livdi', 'Livdi', 700), -(4884, 58, 327, 'Lrisa', 'Lrisa', 800), -(4885, 58, 327, 'Lrissa', 'Lrissa', 900), -(4886, 58, 328, 'gios Niklaos', 'gios Niklaos', 100), -(4887, 58, 328, 'Lntas', 'Lntas', 200), -(4888, 58, 329, 'Kallon', 'Kallon', 100), -(4889, 58, 329, 'Loutr', 'Loutr', 200), -(4890, 58, 329, 'Mitilni', 'Mitilni', 300), -(4891, 58, 329, 'Mitylene', 'Mitylene', 400), -(4892, 58, 329, 'Mrina', 'Mrina', 500), -(4893, 58, 329, 'Mthymna', 'Mthymna', 600), -(4894, 58, 330, 'Lefkda', 'Lefkda', 100), -(4895, 58, 330, 'Levks', 'Levks', 200), -(4896, 58, 331, 'Vlos', 'Vlos', 100), -(4897, 58, 331, 'Volo', 'Volo', 200), -(4898, 58, 332, 'Gargalinoi', 'Gargalinoi', 100), -(4899, 58, 332, 'Kalamatas', 'Kalamatas', 200), -(4900, 58, 332, 'Kalamta', 'Kalamta', 300), -(4901, 58, 332, 'Kalmata', 'Kalmata', 400), -(4902, 58, 332, 'Messeni', 'Messeni', 500), -(4903, 58, 333, 'Ads', 'Ads', 100), -(4904, 58, 333, 'Anaphi', 'Anaphi', 200), -(4905, 58, 333, 'Xina', 'Xina', 300), -(4906, 58, 333, 'Zaimi', 'Zaimi', 400), -(4907, 58, 334, 'Aridea', 'Aridea', 100), -(4908, 58, 334, 'dessa', 'dessa', 200), -(4909, 58, 334, 'dhessa', 'dhessa', 300), -(4910, 58, 334, 'Giannits', 'Giannits', 400), -(4911, 58, 334, 'Skdra', 'Skdra', 500), -(4912, 58, 335, 'Alnia', 'Alnia', 100), -(4913, 58, 335, 'Kalitea', 'Kalitea', 200), -(4914, 58, 335, 'Katerina', 'Katerina', 300), -(4915, 58, 335, 'Katerni', 'Katerni', 400), -(4916, 58, 335, 'Leptokary', 'Leptokary', 500), -(4917, 58, 335, 'Parala', 'Parala', 600), -(4918, 58, 335, 'Ptra', 'Ptra', 700), -(4919, 58, 336, 'Prveza', 'Prveza', 100), -(4920, 58, 337, 'Prama', 'Prama', 100), -(4921, 58, 337, 'Rthimnon', 'Rthimnon', 200), -(4922, 58, 337, 'Rthymno', 'Rthymno', 300), -(4923, 58, 337, 'Rthymnon', 'Rthymnon', 400), -(4924, 58, 338, 'Gmlcine', 'Gmlcine', 100), -(4925, 58, 338, 'Komotin', 'Komotin', 200), -(4926, 58, 338, 'Komotine', 'Komotine', 300), -(4927, 58, 338, 'Spes', 'Spes', 400), -(4928, 58, 339, 'Aga Kyriak', 'Aga Kyriak', 100), -(4929, 58, 339, 'Rva', 'Rva', 200), -(4930, 58, 339, 'Smos', 'Smos', 300), -(4931, 58, 339, 'Vath', 'Vath', 400), -(4932, 58, 340, 'Rodpoli', 'Rodpoli', 100), -(4933, 58, 340, 'Seres', 'Seres', 200), -(4934, 58, 340, 'Sidhirkastron', 'Sidhirkastron', 300), -(4935, 58, 340, 'Sidirkastro', 'Sidirkastro', 400), -(4936, 58, 340, 'Srres', 'Srres', 500), -(4937, 58, 341, 'gios Dimtrios', 'gios Dimtrios', 100), -(4938, 58, 341, 'Trikrifon', 'Trikrifon', 200), -(4939, 58, 342, 'Aga Trida', 'Aga Trida', 100), -(4940, 58, 342, 'Ampeln', 'Ampeln', 200), -(4941, 58, 342, 'Anatolik', 'Anatolik', 300), -(4942, 58, 342, 'Angelokhri', 'Angelokhri', 400), -(4943, 58, 342, 'Angelokhrion', 'Angelokhrion', 500), -(4944, 58, 342, 'Ankhalos', 'Ankhalos', 600), -(4945, 58, 342, 'Arapl', 'Arapl', 700), -(4946, 58, 342, 'Asprvrysi', 'Asprvrysi', 800), -(4947, 58, 342, 'Avtion', 'Avtion', 900), -(4948, 58, 342, 'Bal', 'Bal', 1000), -(4949, 58, 342, 'dendro', 'dendro', 1100), -(4950, 58, 342, 'dendron', 'dendron', 1200), -(4951, 58, 342, 'Dhiavat', 'Dhiavat', 1300), -(4952, 58, 342, 'Diavat', 'Diavat', 1400), -(4953, 58, 342, 'Efkarpa', 'Efkarpa', 1500), -(4954, 58, 342, 'Evkarpa', 'Evkarpa', 1600), -(4955, 58, 342, 'Galni', 'Galni', 1700), -(4956, 58, 342, 'Gfyra', 'Gfyra', 1800), -(4957, 58, 342, 'gios Athansios', 'gios Athansios', 1900), -(4958, 58, 342, 'gios Pvlos', 'gios Pvlos', 2000), -(4959, 58, 342, 'Kalamari', 'Kalamari', 2100), -(4960, 58, 342, 'Kalochri', 'Kalochri', 2200), -(4961, 58, 342, 'Kamra', 'Kamra', 2300), -(4962, 58, 342, 'Kardi', 'Kardi', 2400), -(4963, 58, 342, 'Kastani', 'Kastani', 2500), -(4964, 58, 342, 'Kerasi', 'Kerasi', 2600), -(4965, 58, 342, 'Kordhelin', 'Kordhelin', 2700), -(4966, 58, 342, 'Lagkads', 'Lagkads', 2800), -(4967, 58, 342, 'Lagyn', 'Lagyn', 2900), -(4968, 58, 342, 'Menemni', 'Menemni', 3000), -(4969, 58, 342, 'Na Ioni', 'Na Ioni', 3100), -(4970, 58, 342, 'Na Michanina', 'Na Michanina', 3200), -(4971, 58, 342, 'Na Mikhanina', 'Na Mikhanina', 3300), -(4972, 58, 342, 'Na Zo', 'Na Zo', 3400), -(4973, 58, 342, 'Non Kordelin', 'Non Kordelin', 3500), -(4974, 58, 342, 'Non Kordhelin', 'Non Kordhelin', 3600), -(4975, 58, 342, 'Oraikastro', 'Oraikastro', 3700), -(4976, 58, 342, 'Palikastro', 'Palikastro', 3800), -(4977, 58, 342, 'Palikastron', 'Palikastron', 3900), -(4978, 58, 342, 'Peraa', 'Peraa', 4000), -(4979, 58, 342, 'Polchni', 'Polchni', 4100), -(4980, 58, 342, 'Salonica', 'Salonica', 4200), -(4981, 58, 342, 'Salonika', 'Salonika', 4300), -(4982, 58, 342, 'Salonki', 'Salonki', 4400), -(4983, 58, 342, 'Selanik', 'Selanik', 4500), -(4984, 58, 342, 'Sikai', 'Sikai', 4600), -(4985, 58, 342, 'Sndos', 'Sndos', 4700), -(4986, 58, 342, 'Stavropoli', 'Stavropoli', 4800), -(4987, 58, 342, 'Sykai', 'Sykai', 4900), -(4988, 58, 342, 'Thessalonike', 'Thessalonike', 5000), -(4989, 58, 342, 'Thessalonki', 'Thessalonki', 5100), -(4990, 58, 342, 'vosmo', 'vosmo', 5200), -(4991, 58, 342, 'vosmon', 'vosmon', 5300), -(4992, 58, 342, 'Xirokhrion', 'Xirokhrion', 5400), -(4993, 58, 343, 'Achladi', 'Achladi', 100), -(4994, 58, 343, 'Apostolaka', 'Apostolaka', 200), -(4995, 58, 343, 'Borovkos', 'Borovkos', 300), -(4996, 58, 343, 'Kalampka', 'Kalampka', 400), -(4997, 58, 343, 'Trkala', 'Trkala', 500), -(4998, 58, 344, 'Levdeia', 'Levdeia', 100), -(4999, 58, 344, 'Livadei', 'Livadei', 200), -(5000, 58, 344, 'Thva', 'Thva', 300), -(5001, 58, 345, 'Xanthe', 'Xanthe', 100), -(5002, 58, 345, 'Xnthi', 'Xnthi', 200), -(5003, 58, 345, 'Номос Ксанти', 'Номос Ксанти', 300), -(5004, 58, 346, 'yios Niklaos', 'yios Niklaos', 100), -(5005, 58, 346, 'Zante', 'Zante', 200), -(5006, 58, 346, 'Zkinthos', 'Zkinthos', 300), -(5007, 58, 346, 'Zkynthos', 'Zkynthos', 400), -(5008, 59, 347, 'Батуми', 'Батуми', 100), -(5009, 59, 347, 'Кобулети', 'Кобулети', 200), -(5010, 59, 347, 'Хуло', 'Хуло', 300), -(5011, 59, 348, 'Абастумани', 'Абастумани', 100), -(5012, 59, 348, 'Абаша', 'Абаша', 200), -(5013, 59, 348, 'Агара', 'Агара', 300), -(5014, 59, 348, 'Амбролаури', 'Амбролаури', 400), -(5015, 59, 348, 'Аспиндза', 'Аспиндза', 500), -(5016, 59, 348, 'Ахалкалаки', 'Ахалкалаки', 600), -(5017, 59, 348, 'Ахалцихе', 'Ахалцихе', 700), -(5018, 59, 348, 'Ахмета', 'Ахмета', 800), -(5019, 59, 348, 'Бакуриани', 'Бакуриани', 900), -(5020, 59, 348, 'Богдановка', 'Богдановка', 1000), -(5021, 59, 348, 'Болниси', 'Болниси', 1100), -(5022, 59, 348, 'Боржоми', 'Боржоми', 1200), -(5023, 59, 348, 'Вани', 'Вани', 1300), -(5024, 59, 348, 'Гардабани', 'Гардабани', 1400), -(5025, 59, 348, 'Гегечкори', 'Гегечкори', 1500), -(5026, 59, 348, 'Гори', 'Гори', 1600), -(5027, 59, 348, 'Гурджаани', 'Гурджаани', 1700), -(5028, 59, 348, 'Джвари', 'Джвари', 1800), -(5029, 59, 348, 'Дманиси', 'Дманиси', 1900), -(5030, 59, 348, 'Душети', 'Душети', 2000), -(5031, 59, 348, 'Зестафони', 'Зестафони', 2100), -(5032, 59, 348, 'Зугдиди', 'Зугдиди', 2200), -(5033, 59, 348, 'Казбеги', 'Казбеги', 2300), -(5034, 59, 348, 'Карели', 'Карели', 2400), -(5035, 59, 348, 'Каспи', 'Каспи', 2500), -(5036, 59, 348, 'Кваиси', 'Кваиси', 2600), -(5037, 59, 348, 'Кварели', 'Кварели', 2700), -(5038, 59, 348, 'Коджори', 'Коджори', 2800), -(5039, 59, 348, 'Кутаиси', 'Кутаиси', 2900), -(5040, 59, 348, 'Лагодехи', 'Лагодехи', 3000), -(5041, 59, 348, 'Ланчхути', 'Ланчхути', 3100), -(5042, 59, 348, 'Ленингори', 'Ленингори', 3200), -(5043, 59, 348, 'Лентехи', 'Лентехи', 3300), -(5044, 59, 348, 'Марнеули', 'Марнеули', 3400), -(5045, 59, 348, 'Махарадзе', 'Махарадзе', 3500), -(5046, 59, 348, 'Маяковский', 'Маяковский', 3600), -(5047, 59, 348, 'Местиа', 'Местиа', 3700), -(5048, 59, 348, 'Они', 'Они', 3800), -(5049, 59, 348, 'Орджоникидзе', 'Орджоникидзе', 3900), -(5050, 59, 348, 'Поти', 'Поти', 4000), -(5051, 59, 348, 'Рустави', 'Рустави', 4100), -(5052, 59, 348, 'Сагареджо', 'Сагареджо', 4200), -(5053, 59, 348, 'Самтредиа', 'Самтредиа', 4300), -(5054, 59, 348, 'Сачхере', 'Сачхере', 4400), -(5055, 59, 348, 'Сигнахи', 'Сигнахи', 4500), -(5056, 59, 348, 'Тбилиси', 'Тбилиси', 4600), -(5057, 59, 348, 'Телави', 'Телави', 4700), -(5058, 59, 348, 'Тержола', 'Тержола', 4800), -(5059, 59, 348, 'Тетри-Цкаро', 'Тетри-Цкаро', 4900), -(5060, 59, 348, 'Тианети', 'Тианети', 5000), -(5061, 59, 348, 'Ткибули', 'Ткибули', 5100), -(5062, 59, 348, 'Хашури', 'Хашури', 5200), -(5063, 59, 348, 'Хоби', 'Хоби', 5300), -(5064, 59, 348, 'Цагери', 'Цагери', 5400), -(5065, 59, 348, 'Цаленджиха', 'Цаленджиха', 5500), -(5066, 59, 348, 'Цалка', 'Цалка', 5600), -(5067, 59, 348, 'Цители-Цкаро', 'Цители-Цкаро', 5700), -(5068, 59, 348, 'Цнори', 'Цнори', 5800), -(5069, 59, 348, 'Цхакая', 'Цхакая', 5900), -(5070, 59, 348, 'Цхалтубо', 'Цхалтубо', 6000), -(5071, 59, 348, 'Чиатура', 'Чиатура', 6100), -(5072, 59, 348, 'Чохатаури', 'Чохатаури', 6200), -(5073, 59, 348, 'Чхороцку', 'Чхороцку', 6300), -(5074, 60, 349, 'Aabo', 'Aabo', 100), -(5075, 60, 349, 'Aaby', 'Aaby', 200), -(5076, 60, 349, 'Aalum', 'Aalum', 300), -(5077, 60, 349, 'Aarhus', 'Aarhus', 400), -(5078, 60, 349, 'Adslev', 'Adslev', 500), -(5079, 60, 349, 'Albge', 'Albge', 600), -(5080, 60, 349, 'Alling', 'Alling', 700), -(5081, 60, 349, 'Auning', 'Auning', 800), -(5082, 60, 349, 'Brabrand', 'Brabrand', 900), -(5083, 60, 349, 'Ebeltoft', 'Ebeltoft', 1000), -(5084, 60, 349, 'Gram', 'Gram', 1100), -(5085, 60, 349, 'Gren', 'Gren', 1200), -(5086, 60, 349, 'Grenaa', 'Grenaa', 1300), -(5087, 60, 349, 'Gylling', 'Gylling', 1400), -(5088, 60, 349, 'Hadsten', 'Hadsten', 1500), -(5089, 60, 349, 'Krajbjrg', 'Krajbjrg', 1600), -(5090, 60, 349, 'Lang', 'Lang', 1700), -(5091, 60, 349, 'Nimtofte', 'Nimtofte', 1800), -(5092, 60, 349, 'Norup', 'Norup', 1900), -(5093, 60, 349, 'Nrbk', 'Nrbk', 2000), -(5094, 60, 349, 'Odder', 'Odder', 2100), -(5095, 60, 349, 'Randers', 'Randers', 2200), -(5096, 60, 349, 'rhus', 'rhus', 2300), -(5097, 60, 349, 'Risskov', 'Risskov', 2400), -(5098, 60, 349, 'Rnde', 'Rnde', 2500), -(5099, 60, 349, 'rsted', 'rsted', 2600), -(5100, 60, 349, 'Rye', 'Rye', 2700), -(5101, 60, 349, 'Silkeborg', 'Silkeborg', 2800), -(5102, 60, 349, 'Skanderborg', 'Skanderborg', 2900), -(5103, 60, 349, 'Thors', 'Thors', 3000), -(5104, 60, 349, 'Ulstrup', 'Ulstrup', 3100), -(5105, 60, 350, 'Aakirkeby', 'Aakirkeby', 100), -(5106, 60, 350, 'Aalse', 'Aalse', 200), -(5107, 60, 350, 'Aarsballe', 'Aarsballe', 300), -(5108, 60, 350, 'Blshavn', 'Blshavn', 400), -(5109, 60, 350, 'Bodilskirke', 'Bodilskirke', 500), -(5110, 60, 350, 'Brohuse', 'Brohuse', 600), -(5111, 60, 350, 'lse', 'lse', 700), -(5112, 60, 350, 'Sletteenge', 'Sletteenge', 800), -(5113, 60, 350, 'Svaneke', 'Svaneke', 900), -(5114, 60, 351, 'Allerd', 'Allerd', 100), -(5115, 60, 351, 'Bastrup', 'Bastrup', 200), -(5116, 60, 351, 'Birkerd', 'Birkerd', 300), -(5117, 60, 351, 'Dronningmlle', 'Dronningmlle', 400), -(5118, 60, 351, 'Fredensborg', 'Fredensborg', 500), -(5119, 60, 351, 'Frederikssund', 'Frederikssund', 600), -(5120, 60, 351, 'Frederiksvrk', 'Frederiksvrk', 700), -(5121, 60, 351, 'Gilleleje', 'Gilleleje', 800), -(5122, 60, 351, 'Helsinge', 'Helsinge', 900), -(5123, 60, 351, 'Helsingr', 'Helsingr', 1000), -(5124, 60, 351, 'Herlev', 'Herlev', 1100), -(5125, 60, 351, 'Hillerd', 'Hillerd', 1200), -(5126, 60, 351, 'Hundested', 'Hundested', 1300), -(5127, 60, 351, 'lstykke', 'lstykke', 1400), -(5128, 60, 352, '', '', 100), -(5129, 60, 352, 'Aarslev', 'Aarslev', 200), -(5130, 60, 352, 'Assens', 'Assens', 300), -(5131, 60, 352, 'Bogense', 'Bogense', 400), -(5132, 60, 352, 'Brenderup', 'Brenderup', 500), -(5133, 60, 352, 'Faaborg', 'Faaborg', 600), -(5134, 60, 352, 'Gislev Holme', 'Gislev Holme', 700), -(5135, 60, 352, 'Horne', 'Horne', 800), -(5136, 60, 352, 'Korinth', 'Korinth', 900), -(5137, 60, 352, 'Middelfart', 'Middelfart', 1000), -(5138, 60, 352, 'Nyborg', 'Nyborg', 1100), -(5139, 60, 352, 'Odense', 'Odense', 1200), -(5140, 60, 352, 'Ringe', 'Ringe', 1300), -(5141, 60, 352, 'rslev', 'rslev', 1400), -(5142, 60, 352, 'rsted', 'rsted', 1500), -(5143, 60, 352, 'Rudkbing', 'Rudkbing', 1600), -(5144, 60, 352, 'sum', 'sum', 1700), -(5145, 60, 352, 'Svendborg', 'Svendborg', 1800), -(5146, 60, 352, 'Svindinge', 'Svindinge', 1900), -(5147, 60, 352, 'Tommerup', 'Tommerup', 2000), -(5148, 60, 352, 'Vester Hsinge', 'Vester Hsinge', 2100), -(5149, 60, 353, 'Aagerup', 'Aagerup', 100), -(5150, 60, 353, 'Avedre', 'Avedre', 200), -(5151, 60, 353, 'Ballerup', 'Ballerup', 300), -(5152, 60, 353, 'Brndby Strand', 'Brndby Strand', 400), -(5153, 60, 353, 'Buddinge', 'Buddinge', 500), -(5154, 60, 353, 'Charlottenlund', 'Charlottenlund', 600), -(5155, 60, 353, 'Dragr', 'Dragr', 700), -(5156, 60, 353, 'Gentofte', 'Gentofte', 800), -(5157, 60, 353, 'gerup', 'gerup', 900), -(5158, 60, 353, 'Gladsakse', 'Gladsakse', 1000), -(5159, 60, 353, 'Gladsaxe', 'Gladsaxe', 1100), -(5160, 60, 353, 'Glostrup', 'Glostrup', 1200), -(5161, 60, 353, 'Hedehusene', 'Hedehusene', 1300), -(5162, 60, 353, 'Hellerup', 'Hellerup', 1400), -(5163, 60, 353, 'Hje Tstrup', 'Hje Tstrup', 1500), -(5164, 60, 353, 'Holte', 'Holte', 1600), -(5165, 60, 353, 'Hvidovre', 'Hvidovre', 1700), -(5166, 60, 353, 'Ishj', 'Ishj', 1800), -(5167, 60, 353, 'Jgersborg', 'Jgersborg', 1900), -(5168, 60, 353, 'Kallerup', 'Kallerup', 2000), -(5169, 60, 353, 'Kastrup', 'Kastrup', 2100), -(5170, 60, 353, 'Klampenborg', 'Klampenborg', 2200), -(5171, 60, 353, 'Kongens Lyngby', 'Kongens Lyngby', 2300), -(5172, 60, 353, 'Lyngby', 'Lyngby', 2400), -(5173, 60, 353, 'Rdovre', 'Rdovre', 2500), -(5174, 60, 353, 'Risby', 'Risby', 2600), -(5175, 60, 353, 'Sborg', 'Sborg', 2700), -(5176, 60, 353, 'Skodsborg', 'Skodsborg', 2800), -(5177, 60, 353, 'Taastrup', 'Taastrup', 2900), -(5178, 60, 353, 'Taastrup Valby', 'Taastrup Valby', 3000), -(5179, 60, 353, 'Torslunde', 'Torslunde', 3100), -(5180, 60, 353, 'Vrlse', 'Vrlse', 3200), -(5181, 60, 353, 'West Brndby', 'West Brndby', 3300), -(5182, 60, 354, 'Smidstrup', 'Smidstrup', 100), -(5183, 60, 355, 'Aalbk', 'Aalbk', 100), -(5184, 60, 355, 'Aalborg', 'Aalborg', 200), -(5185, 60, 355, 'Aars', 'Aars', 300), -(5186, 60, 355, 'Arden', 'Arden', 400), -(5187, 60, 355, 'Brnderslev', 'Brnderslev', 500), -(5188, 60, 355, 'Brovst', 'Brovst', 600), -(5189, 60, 355, 'Fars', 'Fars', 700), -(5190, 60, 355, 'Fjerritslev', 'Fjerritslev', 800), -(5191, 60, 355, 'Frederikshavn', 'Frederikshavn', 900), -(5192, 60, 355, 'Grindsted', 'Grindsted', 1000), -(5193, 60, 355, 'Hadsund', 'Hadsund', 1100), -(5194, 60, 355, 'Hirtshals', 'Hirtshals', 1200), -(5195, 60, 355, 'Hjrring', 'Hjrring', 1300), -(5196, 60, 355, 'Hobro', 'Hobro', 1400), -(5197, 60, 355, 'Hornum', 'Hornum', 1500), -(5198, 60, 355, 'Horsens', 'Horsens', 1600), -(5199, 60, 355, 'Hurup', 'Hurup', 1700), -(5200, 60, 355, 'Jerslev', 'Jerslev', 1800), -(5201, 60, 355, 'lborg', 'lborg', 1900), -(5202, 60, 355, 'Lgstr', 'Lgstr', 2000), -(5203, 60, 355, 'Lkken', 'Lkken', 2100), -(5204, 60, 355, 'Nibe', 'Nibe', 2200), -(5205, 60, 355, 'Rebild', 'Rebild', 2300), -(5206, 60, 355, 'rs', 'rs', 2400), -(5207, 60, 355, 'Saltum', 'Saltum', 2500), -(5208, 60, 355, 'Sby', 'Sby', 2600), -(5209, 60, 355, 'Skagen', 'Skagen', 2700), -(5210, 60, 355, 'Tisted', 'Tisted', 2800), -(5211, 60, 355, 'Vegger', 'Vegger', 2900), -(5212, 60, 356, 'Astrup', 'Astrup', 100), -(5213, 60, 356, 'Billund', 'Billund', 200), -(5214, 60, 356, 'Bramming', 'Bramming', 300), -(5215, 60, 356, 'Bryndumdam', 'Bryndumdam', 400), -(5216, 60, 356, 'dal', 'dal', 500), -(5217, 60, 356, 'Donslund', 'Donslund', 600), -(5218, 60, 356, 'Esbjerg', 'Esbjerg', 700), -(5219, 60, 356, 'Esbjrg', 'Esbjrg', 800), -(5220, 60, 356, 'Grding', 'Grding', 900), -(5221, 60, 356, 'Grindsted', 'Grindsted', 1000), -(5222, 60, 356, 'Holsted', 'Holsted', 1100), -(5223, 60, 356, 'Hovborg', 'Hovborg', 1200), -(5224, 60, 356, 'lgod', 'lgod', 1300), -(5225, 60, 356, 'Lintrup', 'Lintrup', 1400), -(5226, 60, 356, 'Lunde', 'Lunde', 1500), -(5227, 60, 356, 'Nrre Nebel', 'Nrre Nebel', 1600), -(5228, 60, 356, 'Ribe', 'Ribe', 1700), -(5229, 60, 356, 'Roager', 'Roager', 1800), -(5230, 60, 356, 'rre', 'rre', 1900), -(5231, 60, 356, 'Store Darum', 'Store Darum', 2000), -(5232, 60, 356, 'Varde', 'Varde', 2100), -(5233, 60, 356, 'Vejen', 'Vejen', 2200), -(5234, 60, 356, 'Vester Vejrup', 'Vester Vejrup', 2300), -(5235, 60, 357, 'Agerskov', 'Agerskov', 100), -(5236, 60, 357, 'Aulum', 'Aulum', 200), -(5237, 60, 357, 'Barde', 'Barde', 300), -(5238, 60, 357, 'Borris', 'Borris', 400), -(5239, 60, 357, 'Brande', 'Brande', 500), -(5240, 60, 357, 'Brorstrup', 'Brorstrup', 600), -(5241, 60, 357, 'Bvlingbjerg', 'Bvlingbjerg', 700), -(5242, 60, 357, 'dum', 'dum', 800), -(5243, 60, 357, 'Finderup', 'Finderup', 900), -(5244, 60, 357, 'Herborg', 'Herborg', 1000), -(5245, 60, 357, 'Herning', 'Herning', 1100), -(5246, 60, 357, 'Holstebro', 'Holstebro', 1200), -(5247, 60, 357, 'Hoven', 'Hoven', 1300), -(5248, 60, 357, 'Hvide Sande', 'Hvide Sande', 1400), -(5249, 60, 357, 'Kibk', 'Kibk', 1500), -(5250, 60, 357, 'Lem', 'Lem', 1600), -(5251, 60, 357, 'Lemvig', 'Lemvig', 1700), -(5252, 60, 357, 'Lind', 'Lind', 1800), -(5253, 60, 357, 'Lnborg', 'Lnborg', 1900), -(5254, 60, 357, 'Mborg', 'Mborg', 2000), -(5255, 60, 357, 'Ringkbing', 'Ringkbing', 2100), -(5256, 60, 357, 'Ringkjbing', 'Ringkjbing', 2200), -(5257, 60, 357, 'rnhj', 'rnhj', 2300), -(5258, 60, 357, 'Skern', 'Skern', 2400), -(5259, 60, 357, 'Skjern', 'Skjern', 2500), -(5260, 60, 357, 'Struer', 'Struer', 2600), -(5261, 60, 357, 'Tarm', 'Tarm', 2700), -(5262, 60, 357, 'Tim', 'Tim', 2800), -(5263, 60, 357, 'Ulfborg', 'Ulfborg', 2900), -(5264, 60, 357, 'Videbk', 'Videbk', 3000), -(5265, 60, 357, 'Vilbjerg', 'Vilbjerg', 3100), -(5266, 60, 357, 'Vildbjerg', 'Vildbjerg', 3200), -(5267, 60, 357, 'Vinderup', 'Vinderup', 3300), -(5268, 60, 358, 'Algestrup', 'Algestrup', 100), -(5269, 60, 358, 'Assendlse', 'Assendlse', 200), -(5270, 60, 358, 'Gadstrup', 'Gadstrup', 300), -(5271, 60, 358, 'Hvals', 'Hvals', 400), -(5272, 60, 358, 'Kge', 'Kge', 500), -(5273, 60, 358, 'Kirke Sonnerup', 'Kirke Sonnerup', 600), -(5274, 60, 358, 'Lidemark', 'Lidemark', 700), -(5275, 60, 358, 'Lyngby', 'Lyngby', 800), -(5276, 60, 358, 'Roskilde', 'Roskilde', 900), -(5277, 60, 358, 'Solrd Strand', 'Solrd Strand', 1000), -(5278, 60, 358, 'Viby', 'Viby', 1100), -(5279, 60, 359, 'Aabenraa', 'Aabenraa', 100), -(5280, 60, 359, 'Aller', 'Aller', 200), -(5281, 60, 359, 'Ballum', 'Ballum', 300), -(5282, 60, 359, 'benr', 'benr', 400), -(5283, 60, 359, 'Bevtoft', 'Bevtoft', 500), -(5284, 60, 359, 'Branderup', 'Branderup', 600), -(5285, 60, 359, 'Bredebro', 'Bredebro', 700), -(5286, 60, 359, 'Drengsted', 'Drengsted', 800), -(5287, 60, 359, 'Grsten', 'Grsten', 900), -(5288, 60, 359, 'Haderslev', 'Haderslev', 1000), -(5289, 60, 359, 'Hjrup', 'Hjrup', 1100), -(5290, 60, 359, 'Kliplev', 'Kliplev', 1200), -(5291, 60, 359, 'Magstrup', 'Magstrup', 1300), -(5292, 60, 359, 'Nordborg', 'Nordborg', 1400), -(5293, 60, 359, 'Padborg', 'Padborg', 1500), -(5294, 60, 359, 'Randerup', 'Randerup', 1600), -(5295, 60, 359, 'Rangstrup', 'Rangstrup', 1700), -(5296, 60, 359, 'Rdding', 'Rdding', 1800), -(5297, 60, 359, 'Rdekro', 'Rdekro', 1900), -(5298, 60, 359, 'Snderborg', 'Snderborg', 2000), -(5299, 60, 359, 'Tinglev', 'Tinglev', 2100), -(5300, 60, 359, 'Tnder', 'Tnder', 2200), -(5301, 60, 359, 'Toftlund', 'Toftlund', 2300), -(5302, 60, 359, 'Visby', 'Visby', 2400), -(5303, 60, 359, 'Vojens', 'Vojens', 2500), -(5304, 60, 360, 'Amager Flled', 'Amager Flled', 100), -(5305, 60, 360, 'Amagerbro', 'Amagerbro', 200), -(5306, 60, 360, 'Copenhagen', 'Copenhagen', 300), -(5307, 60, 360, 'Kbenhavn', 'Kbenhavn', 400), -(5308, 60, 360, 'Kjobenhavn', 'Kjobenhavn', 500), -(5309, 60, 360, 'Vanlse', 'Vanlse', 600), -(5310, 60, 361, 'Dannemare', 'Dannemare', 100), -(5311, 60, 361, 'Eskilstrup', 'Eskilstrup', 200), -(5312, 60, 361, 'geby', 'geby', 300), -(5313, 60, 361, 'Maribo', 'Maribo', 400), -(5314, 60, 361, 'Nakskov', 'Nakskov', 500), -(5315, 60, 361, 'Nrre Alslev', 'Nrre Alslev', 600), -(5316, 60, 361, 'Nstved', 'Nstved', 700), -(5317, 60, 361, 'Nykbing', 'Nykbing', 800), -(5318, 60, 361, 'Nykjobing', 'Nykjobing', 900); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(5319, 60, 361, 'Stege', 'Stege', 1000), -(5320, 60, 361, 'Stokkemarke', 'Stokkemarke', 1100), -(5321, 60, 361, 'Vinderup', 'Vinderup', 1200), -(5322, 60, 361, 'Vordingborg', 'Vordingborg', 1300), -(5323, 60, 362, 'Aadal', 'Aadal', 100), -(5324, 60, 362, 'Aagaard', 'Aagaard', 200), -(5325, 60, 362, 'Agtrup', 'Agtrup', 300), -(5326, 60, 362, 'Barrit', 'Barrit', 400), -(5327, 60, 362, 'Blling', 'Blling', 500), -(5328, 60, 362, 'Brkop', 'Brkop', 600), -(5329, 60, 362, 'Brunde', 'Brunde', 700), -(5330, 60, 362, 'Egtved', 'Egtved', 800), -(5331, 60, 362, 'Ejstrupholm', 'Ejstrupholm', 900), -(5332, 60, 362, 'Fredericia', 'Fredericia', 1000), -(5333, 60, 362, 'Give', 'Give', 1100), -(5334, 60, 362, 'Herslev', 'Herslev', 1200), -(5335, 60, 362, 'Horsens', 'Horsens', 1300), -(5336, 60, 362, 'Hosby', 'Hosby', 1400), -(5337, 60, 362, 'Jelling', 'Jelling', 1500), -(5338, 60, 362, 'Kolding', 'Kolding', 1600), -(5339, 60, 362, 'Thyregod', 'Thyregod', 1700), -(5340, 60, 362, 'Vamdrup', 'Vamdrup', 1800), -(5341, 60, 362, 'Vejle', 'Vejle', 1900), -(5342, 60, 362, 'Viv', 'Viv', 2000), -(5343, 60, 363, 'Dalby', 'Dalby', 100), -(5344, 60, 363, 'Godthaab', 'Godthaab', 200), -(5345, 60, 363, 'Hng', 'Hng', 300), -(5346, 60, 363, 'Holbk', 'Holbk', 400), -(5347, 60, 363, 'Hollbk', 'Hollbk', 500), -(5348, 60, 363, 'Jyderup', 'Jyderup', 600), -(5349, 60, 363, 'Kallundborg', 'Kallundborg', 700), -(5350, 60, 363, 'Kalundborg', 'Kalundborg', 800), -(5351, 60, 363, 'Kastrup', 'Kastrup', 900), -(5352, 60, 363, 'Korsr', 'Korsr', 1000), -(5353, 60, 363, 'Ringsted', 'Ringsted', 1100), -(5354, 60, 363, 'rslev', 'rslev', 1200), -(5355, 60, 363, 'Slagelse', 'Slagelse', 1300), -(5356, 60, 363, 'Sor', 'Sor', 1400), -(5357, 60, 363, 'Uglerup', 'Uglerup', 1500), -(5358, 60, 364, 'Agerskov', 'Agerskov', 100), -(5359, 60, 364, 'Balling', 'Balling', 200), -(5360, 60, 364, 'Bjerregrav', 'Bjerregrav', 300), -(5361, 60, 364, 'Bjerringbro', 'Bjerringbro', 400), -(5362, 60, 364, 'Bodum', 'Bodum', 500), -(5363, 60, 364, 'Dover', 'Dover', 600), -(5364, 60, 364, 'Durup', 'Durup', 700), -(5365, 60, 364, 'Foulum', 'Foulum', 800), -(5366, 60, 364, 'Frederiks', 'Frederiks', 900), -(5367, 60, 364, 'Frstrup', 'Frstrup', 1000), -(5368, 60, 364, 'Glyngre', 'Glyngre', 1100), -(5369, 60, 364, 'Grnhj', 'Grnhj', 1200), -(5370, 60, 364, 'Hvidding', 'Hvidding', 1300), -(5371, 60, 364, 'Jebjerg', 'Jebjerg', 1400), -(5372, 60, 364, 'Karup', 'Karup', 1500), -(5373, 60, 364, 'Kjellerup', 'Kjellerup', 1600), -(5374, 60, 364, 'lestrup', 'lestrup', 1700), -(5375, 60, 364, 'Lvskal', 'Lvskal', 1800), -(5376, 60, 364, 'Nykbing', 'Nykbing', 1900), -(5377, 60, 364, 'Nykbing Mors', 'Nykbing Mors', 2000), -(5378, 60, 364, 'Oddense', 'Oddense', 2100), -(5379, 60, 364, 'Ravnstrup', 'Ravnstrup', 2200), -(5380, 60, 364, 'Simested', 'Simested', 2300), -(5381, 60, 364, 'Sjrup', 'Sjrup', 2400), -(5382, 60, 364, 'Skals', 'Skals', 2500), -(5383, 60, 364, 'Skive', 'Skive', 2600), -(5384, 60, 364, 'Solbjerg', 'Solbjerg', 2700), -(5385, 60, 364, 'ster Assels', 'ster Assels', 2800), -(5386, 60, 364, 'Stoholm', 'Stoholm', 2900), -(5387, 60, 364, 'Thisted', 'Thisted', 3000), -(5388, 60, 364, 'Tisted', 'Tisted', 3100), -(5389, 60, 364, 'Ulstrup', 'Ulstrup', 3200), -(5390, 60, 364, 'Vellev', 'Vellev', 3300), -(5391, 60, 364, 'Viborg', 'Viborg', 3400), -(5392, 61, 365, 'Сент-Элье', 'Сент-Элье', 100), -(5393, 62, 366, 'Джибути', 'Djibouti', 100), -(5394, 63, 367, 'Санто-доминго', 'Санто-доминго', 100), -(5395, 64, 368, 'Каир', 'Cairo', 100), -(5396, 64, 369, 'Асуан', 'Aswan', 100), -(5397, 64, 370, 'Асыут', 'Asyut', 100), -(5398, 64, 371, 'Бени Суэф', 'Beni Suef', 100), -(5399, 64, 372, 'Танта', 'Tanta', 100), -(5400, 64, 373, 'Думият', 'Damietta', 100), -(5401, 64, 374, 'Александрия', 'Alexandria', 100), -(5402, 64, 374, 'Хургада', 'Hurghada', 200), -(5403, 64, 375, 'Дахаб', 'Дахаб', 100), -(5404, 64, 375, 'Шарм эль шейх', 'Charm el-Cheikh', 200), -(5405, 65, 376, 'Китве-Нкана', 'Kitve-Nkana', 100), -(5406, 65, 376, 'Лусака', 'Lusaka', 200), -(5407, 65, 376, 'Ндола', 'Ndola', 300), -(5408, 66, 377, 'Нуадибу', 'Nuadibu', 100), -(5409, 66, 377, 'Эль-Аюн', 'El''-Auyn', 200), -(5410, 67, 378, 'Булавайо', 'Bulavayio', 100), -(5411, 67, 378, 'Хараре', 'Harare', 200), -(5412, 68, 379, ' Хариш', ' Хариш', 100), -(5413, 68, 379, 'Кацир', 'Кацир', 200), -(5414, 68, 380, 'Бейт-шемеш', 'Бейт-шемеш', 100), -(5415, 68, 380, 'Иерусалим', 'Иерусалим', 200), -(5416, 68, 380, 'Модиин', 'Модиин', 300), -(5417, 68, 381, 'Невве-Атив', 'Невве-Атив', 100), -(5418, 68, 382, 'Бат-Ям', 'Бат-Ям', 100), -(5419, 68, 382, 'Герцелия', 'Герцелия', 200), -(5420, 68, 382, 'Гиватаим', 'Гиватаим', 300), -(5421, 68, 382, 'Кирьят-Оно', 'Кирьят-Оно', 400), -(5422, 68, 382, 'Лод', 'Лод', 500), -(5423, 68, 382, 'Петах Тиква', 'Петах Тиква', 600), -(5424, 68, 382, 'Рамат-Ган', 'Рамат-Ган', 700), -(5425, 68, 382, 'Рамат-Хашарон', 'Рамат-Хашарон', 800), -(5426, 68, 382, 'Тель-Авив', 'Тель-Авив', 900), -(5427, 68, 382, 'Холон', 'Холон', 1000), -(5428, 68, 383, 'Арад', 'Арад', 100), -(5429, 68, 383, 'Ашдод', 'Ашдод', 200), -(5430, 68, 383, 'Ашкелон', 'Ашкелон', 300), -(5431, 68, 383, 'Бээр-Шева', 'Бээр-Шева', 400), -(5432, 68, 383, 'Димона', 'Димона', 500), -(5433, 68, 383, 'Кирьят-Гат', 'Кирьят-Гат', 600), -(5434, 68, 383, 'Кирьят-Малахи', 'Кирьят-Малахи', 700), -(5435, 68, 383, 'Нетивот', 'Нетивот', 800), -(5436, 68, 383, 'Сдерот', 'Сдерот', 900), -(5437, 68, 383, 'Эйлат', 'Эйлат', 1000), -(5438, 68, 384, 'Далият-Эль-Кармэль', 'Далият-Эль-Кармэль', 100), -(5439, 68, 384, 'Зихрон-Яаков', 'Зихрон-Яаков', 200), -(5440, 68, 384, 'Кирьят-Бялик', 'Кирьят-Бялик', 300), -(5441, 68, 384, 'Кирьят-Моцкин', 'Кирьят-Моцкин', 400), -(5442, 68, 384, 'Кирьят-Ям', 'Кирьят-Ям', 500), -(5443, 68, 384, 'Наария', 'Наария', 600), -(5444, 68, 384, 'Нэшэр', 'Нэшэр', 700), -(5445, 68, 384, 'Ор-Акива', 'Ор-Акива', 800), -(5446, 68, 384, 'Пардэс-Ханна', 'Пардэс-Ханна', 900), -(5447, 68, 384, 'Тират-Кармэль', 'Тират-Кармэль', 1000), -(5448, 68, 384, 'Хайфа', 'Хайфа', 1100), -(5449, 68, 384, 'Хефа-Хариш', 'Хефа-Хариш', 1200), -(5450, 68, 384, 'Хэдэра', 'Хэдэра', 1300), -(5451, 68, 385, 'Ариэль', 'Ариэль', 100), -(5452, 68, 385, 'Бнэй-Брак', 'Бнэй-Брак', 200), -(5453, 68, 385, 'Гэдера', 'Гэдера', 300), -(5454, 68, 385, 'Кфар Саба', 'Кфар Саба', 400), -(5455, 68, 385, 'Лод', 'Лод', 500), -(5456, 68, 385, 'Натания', 'Натания', 600), -(5457, 68, 385, 'Нэс-Циона', 'Нэс-Циона', 700), -(5458, 68, 385, 'Од-а Шарон', 'Од-а Шарон', 800), -(5459, 68, 385, 'Пэтах-Тиква', 'Пэтах-Тиква', 900), -(5460, 68, 385, 'Раанана', 'Раанана', 1000), -(5461, 68, 385, 'Рамла', 'Рамла', 1100), -(5462, 68, 385, 'Реховот', 'Реховот', 1200), -(5463, 68, 385, 'Ришон-ЛеЦион', 'Ришон-ЛеЦион', 1300), -(5464, 68, 385, 'Рош-ха-Аин', 'Рош-ха-Аин', 1400), -(5465, 68, 385, 'Явне', 'Явне', 1500), -(5466, 68, 386, 'Акко', 'Акко', 100), -(5467, 68, 386, 'Акко (порт)', 'Акко (порт)', 200), -(5468, 68, 386, 'Афула', 'Афула', 300), -(5469, 68, 386, 'Кармиэль', 'Кармиэль', 400), -(5470, 68, 386, 'Кацрин', 'Кацрин', 500), -(5471, 68, 386, 'Кирьят-Ата', 'Кирьят-Ата', 600), -(5472, 68, 386, 'Кирьят-Ата', 'Кирьят-Ата', 700), -(5473, 68, 386, 'Кирьят-Тивон', 'Кирьят-Тивон', 800), -(5474, 68, 386, 'Кирьят-Шмона', 'Кирьят-Шмона', 900), -(5475, 68, 386, 'Мигдаль аЭмек', 'Мигдаль аЭмек', 1000), -(5476, 68, 386, 'Нагария', 'Нагария', 1100), -(5477, 68, 386, 'Нацэрэт', 'Нацэрэт', 1200), -(5478, 68, 386, 'Сахнин', 'Сахнин', 1300), -(5479, 68, 386, 'Тверия', 'Тверия', 1400), -(5480, 68, 386, 'Хадера', 'Хадера', 1500), -(5481, 68, 386, 'Хайфа', 'Хайфа', 1600), -(5482, 68, 386, 'Цфат', 'Цфат', 1700), -(5483, 69, 387, 'Асансол', 'Асансол', 100), -(5484, 69, 387, 'Байдьябати', 'Байдьябати', 200), -(5485, 69, 387, 'Даржилинг', 'Даржилинг', 300), -(5486, 69, 387, 'Дум-Дум', 'Дум-Дум', 400), -(5487, 69, 387, 'Кришнанагар', 'Кришнанагар', 500), -(5488, 69, 388, 'Биласпур', 'Биласпур', 100), -(5489, 69, 388, 'Раипур', 'Раипур', 200), -(5490, 69, 389, 'Багалкот', 'Багалкот', 100), -(5491, 69, 389, 'Банглори', 'Банглори', 200), -(5492, 69, 389, 'Мангалор', 'Мангалор', 300), -(5493, 69, 390, 'Анакапал', 'Анакапал', 100), -(5494, 69, 390, 'Анантапур', 'Анантапур', 200), -(5495, 69, 390, 'Визианагарам', 'Визианагарам', 300), -(5496, 69, 390, 'Вияиавада', 'Вияиавада', 400), -(5497, 69, 390, 'Гунтур', 'Гунтур', 500), -(5498, 69, 390, 'Элуру', 'Элуру', 600), -(5499, 69, 391, 'Дибругарх', 'Дибругарх', 100), -(5500, 69, 391, 'Силчар', 'Силчар', 200), -(5501, 69, 392, 'Патна', 'Патна', 100), -(5502, 69, 393, 'Ахмадабад', 'Ахмадабад', 100), -(5503, 69, 393, 'Сурат', 'Сурат', 200), -(5504, 69, 393, 'Сурендранагар', 'Сурендранагар', 300), -(5505, 69, 394, 'Ранчи', 'Ранчи', 100), -(5506, 69, 394, 'Сринагар', 'Сринагар', 200), -(5507, 69, 394, 'Ямму', 'Ямму', 300), -(5508, 69, 394, 'Ямшедпур', 'Ямшедпур', 400), -(5509, 69, 395, 'Бангалор', 'Бангалор', 100), -(5510, 69, 395, 'Бомбей', 'Бомбей', 200), -(5511, 69, 395, 'Дели', 'Дели', 300), -(5512, 69, 395, 'Калькутта', 'Калькутта', 400), -(5513, 69, 395, 'Мадрас', 'Мадрас', 500), -(5514, 69, 395, 'Пуна', 'Пуна', 600), -(5515, 69, 395, 'Хайдарабад', 'Хайдарабад', 700), -(5516, 69, 396, 'Кожикод', 'Кожикод', 100), -(5517, 69, 396, 'Коттэйам', 'Коттэйам', 200), -(5518, 69, 397, 'Бхопал', 'Бхопал', 100), -(5519, 69, 397, 'Мау', 'Мау', 200), -(5520, 69, 398, 'Имфал', 'Имфал', 100), -(5521, 69, 399, 'Акола', 'Акола', 100), -(5522, 69, 399, 'Ахмаднагар', 'Ахмаднагар', 200), -(5523, 69, 399, 'Вардха', 'Вардха', 300), -(5524, 69, 399, 'Колхапур', 'Колхапур', 400), -(5525, 69, 399, 'Нагпур', 'Нагпур', 500), -(5526, 69, 399, 'Тана', 'Тана', 600), -(5527, 69, 400, 'Пури', 'Пури', 100), -(5528, 69, 400, 'Рауркела', 'Рауркела', 200), -(5529, 69, 401, 'Амритсар', 'Амритсар', 100), -(5530, 69, 401, 'Лудхиана', 'Лудхиана', 200), -(5531, 69, 402, 'Пондичерри', 'Пондичерри', 100), -(5532, 69, 403, 'Аймер', 'Аймер', 100), -(5533, 69, 403, 'Альвар', 'Альвар', 200), -(5534, 69, 403, 'Кота', 'Кота', 300), -(5535, 69, 403, 'Удаипур', 'Удаипур', 400), -(5536, 69, 404, 'Мадурай', 'Мадурай', 100), -(5537, 69, 405, 'Агартала', 'Агартала', 100), -(5538, 69, 406, 'Агра', 'Агра', 100), -(5539, 69, 406, 'Аллахабад', 'Аллахабад', 200), -(5540, 69, 406, 'Варанаси', 'Варанаси', 300), -(5541, 69, 406, 'Гхазиабад', 'Гхазиабад', 400), -(5542, 69, 406, 'Канпур', 'Канпур', 500), -(5543, 69, 407, 'Gurgaon', 'Gurgaon', 100), -(5544, 69, 407, 'Амбала', 'Амбала', 200), -(5545, 69, 408, 'Чандигарх', 'Чандигарх', 100), -(5546, 70, 409, 'Джакарта', 'Джакарта', 100), -(5547, 71, 410, 'Амман', 'Амман', 100), -(5548, 72, 411, 'Багдад', 'Багдад', 100), -(5549, 72, 412, 'Басра', 'Басра', 100), -(5550, 72, 413, 'Мосул', 'Мосул', 100), -(5551, 73, 414, 'Марагех', 'Марагех', 100), -(5552, 73, 414, 'Тебриз', 'Тебриз', 200), -(5553, 73, 415, 'Кашан', 'Кашан', 100), -(5554, 73, 416, 'Хамадан', 'Хамадан', 100), -(5555, 73, 417, 'Санандай', 'Санандай', 100), -(5556, 73, 418, 'Иезд', 'Иезд', 100), -(5557, 73, 419, 'Керман', 'Керман', 100), -(5558, 73, 420, 'Керманшах', 'Керманшах', 100), -(5559, 73, 421, 'Бабол', 'Бабол', 100), -(5560, 73, 421, 'Сари', 'Сари', 200), -(5561, 73, 422, 'Тегеран', 'Тегеран', 100), -(5562, 73, 423, 'Абадан', 'Абадан', 100), -(5563, 73, 423, 'Шираз', 'Шираз', 200), -(5564, 73, 424, 'Бендер-Аббас', 'Бендер-Аббас', 100), -(5565, 73, 425, 'Ахваз', 'Ахваз', 100), -(5566, 73, 425, 'Хоррамшахр', 'Хоррамшахр', 200), -(5567, 74, 426, 'Carlow', 'Carlow', 100), -(5568, 74, 426, 'Muine Bheag', 'Muine Bheag', 200), -(5569, 74, 426, 'Tullow', 'Tullow', 300), -(5570, 74, 427, 'Bailieborough', 'Bailieborough', 100), -(5571, 74, 427, 'Belturbet', 'Belturbet', 200), -(5572, 74, 427, 'Cavan', 'Cavan', 300), -(5573, 74, 427, 'Cootehill', 'Cootehill', 400), -(5574, 74, 427, 'Kingscourt', 'Kingscourt', 500), -(5575, 74, 428, 'Ennis', 'Ennis', 100), -(5576, 74, 428, 'Shannon', 'Shannon', 200), -(5577, 74, 429, 'Bandon', 'Bandon', 100), -(5578, 74, 429, 'Bantry', 'Bantry', 200), -(5579, 74, 429, 'Blarney', 'Blarney', 300), -(5580, 74, 429, 'Clonakilty', 'Clonakilty', 400), -(5581, 74, 429, 'Cork', 'Cork', 500), -(5582, 74, 429, 'Dunmanway', 'Dunmanway', 600), -(5583, 74, 429, 'Fermoy', 'Fermoy', 700), -(5584, 74, 429, 'Kinsale', 'Kinsale', 800), -(5585, 74, 429, 'Mallow', 'Mallow', 900), -(5586, 74, 429, 'Midleton', 'Midleton', 1000), -(5587, 74, 429, 'Mitchelstown', 'Mitchelstown', 1100), -(5588, 74, 429, 'Skibbereen', 'Skibbereen', 1200), -(5589, 74, 429, 'Youghal', 'Youghal', 1300), -(5590, 74, 430, 'Ballybofey', 'Ballybofey', 100), -(5591, 74, 430, 'Ballyshannon', 'Ballyshannon', 200), -(5592, 74, 430, 'Buncrana', 'Buncrana', 300), -(5593, 74, 430, 'Carndonagh', 'Carndonagh', 400), -(5594, 74, 430, 'Donegal', 'Donegal', 500), -(5595, 74, 430, 'Killybegs', 'Killybegs', 600), -(5596, 74, 430, 'Letterkenny', 'Letterkenny', 700), -(5597, 74, 430, 'Lifford', 'Lifford', 800), -(5598, 74, 431, 'Balbriggan', 'Balbriggan', 100), -(5599, 74, 431, 'Dublin', 'Dublin', 200), -(5600, 74, 431, 'Dun Laoghaire', 'Dun Laoghaire', 300), -(5601, 74, 431, 'Lucan', 'Lucan', 400), -(5602, 74, 431, 'Lusk', 'Lusk', 500), -(5603, 74, 431, 'Malahide', 'Malahide', 600), -(5604, 74, 431, 'Newcastle', 'Newcastle', 700), -(5605, 74, 431, 'Portmarnock', 'Portmarnock', 800), -(5606, 74, 431, 'Rush', 'Rush', 900), -(5607, 74, 431, 'Skerries', 'Skerries', 1000), -(5608, 74, 431, 'Swords', 'Swords', 1100), -(5609, 74, 432, 'Athenry', 'Athenry', 100), -(5610, 74, 432, 'Ballinasloe', 'Ballinasloe', 200), -(5611, 74, 432, 'Galway', 'Galway', 300), -(5612, 74, 432, 'Gort', 'Gort', 400), -(5613, 74, 432, 'Oranmore', 'Oranmore', 500), -(5614, 74, 432, 'Tuam', 'Tuam', 600), -(5615, 74, 433, 'Ballybunion', 'Ballybunion', 100), -(5616, 74, 433, 'Dingle', 'Dingle', 200), -(5617, 74, 433, 'Killarney', 'Killarney', 300), -(5618, 74, 433, 'Killorglin', 'Killorglin', 400), -(5619, 74, 433, 'Listowel', 'Listowel', 500), -(5620, 74, 433, 'Tralee', 'Tralee', 600), -(5621, 74, 434, 'Athy', 'Athy', 100), -(5622, 74, 434, 'Celbridge', 'Celbridge', 200), -(5623, 74, 434, 'Clane', 'Clane', 300), -(5624, 74, 434, 'Kilcullen', 'Kilcullen', 400), -(5625, 74, 434, 'Kildare', 'Kildare', 500), -(5626, 74, 434, 'Leixlip', 'Leixlip', 600), -(5627, 74, 434, 'Maynooth', 'Maynooth', 700), -(5628, 74, 434, 'Naas', 'Naas', 800), -(5629, 74, 434, 'Newbridge', 'Newbridge', 900), -(5630, 74, 435, 'Kilkenny', 'Kilkenny', 100), -(5631, 74, 436, 'Abbeyleix', 'Abbeyleix', 100), -(5632, 74, 436, 'Mountmellick', 'Mountmellick', 200), -(5633, 74, 436, 'Mountrath', 'Mountrath', 300), -(5634, 74, 436, 'Portarlington', 'Portarlington', 400), -(5635, 74, 436, 'Portlaoise', 'Portlaoise', 500), -(5636, 74, 436, 'Rathdowney', 'Rathdowney', 600), -(5637, 74, 436, 'Stradbally', 'Stradbally', 700), -(5638, 74, 437, 'Carrick on Shannon', 'Carrick on Shannon', 100), -(5639, 74, 438, 'Croom', 'Croom', 100), -(5640, 74, 438, 'Limerick', 'Limerick', 200), -(5641, 74, 438, 'Newcastle', 'Newcastle', 300), -(5642, 74, 438, 'Patrickswell', 'Patrickswell', 400), -(5643, 74, 439, 'Granard', 'Granard', 100), -(5644, 74, 439, 'Longford', 'Longford', 200), -(5645, 74, 440, 'Ardee', 'Ardee', 100), -(5646, 74, 440, 'Drogheda', 'Drogheda', 200), -(5647, 74, 440, 'Dundalk', 'Dundalk', 300), -(5648, 74, 440, 'Dunleer', 'Dunleer', 400), -(5649, 74, 441, 'Ballina', 'Ballina', 100), -(5650, 74, 441, 'Ballinrobe', 'Ballinrobe', 200), -(5651, 74, 441, 'Castlebar', 'Castlebar', 300), -(5652, 74, 441, 'Claremorris', 'Claremorris', 400), -(5653, 74, 441, 'Crossmolina', 'Crossmolina', 500), -(5654, 74, 441, 'Westport', 'Westport', 600), -(5655, 74, 442, 'Ashbourne', 'Ashbourne', 100), -(5656, 74, 442, 'Athboy', 'Athboy', 200), -(5657, 74, 442, 'Dunboyne', 'Dunboyne', 300), -(5658, 74, 442, 'Julianstown', 'Julianstown', 400), -(5659, 74, 442, 'Kells', 'Kells', 500), -(5660, 74, 442, 'Navan', 'Navan', 600), -(5661, 74, 442, 'Trim', 'Trim', 700), -(5662, 74, 443, 'Ballybay', 'Ballybay', 100), -(5663, 74, 443, 'Carrickmacross', 'Carrickmacross', 200), -(5664, 74, 443, 'Castleblayney', 'Castleblayney', 300), -(5665, 74, 443, 'Clones', 'Clones', 400), -(5666, 74, 443, 'Monaghan', 'Monaghan', 500), -(5667, 74, 444, 'Birr', 'Birr', 100), -(5668, 74, 444, 'Edenderry', 'Edenderry', 200), -(5669, 74, 444, 'Tullamore', 'Tullamore', 300), -(5670, 74, 445, 'Boyle', 'Boyle', 100), -(5671, 74, 445, 'Roscommon', 'Roscommon', 200), -(5672, 74, 446, 'Ballymote', 'Ballymote', 100), -(5673, 74, 446, 'Sligo', 'Sligo', 200), -(5674, 74, 447, 'Cahir', 'Cahir', 100), -(5675, 74, 447, 'Cashel', 'Cashel', 200), -(5676, 74, 447, 'Clonmel', 'Clonmel', 300), -(5677, 74, 447, 'Fethard', 'Fethard', 400), -(5678, 74, 447, 'Nenagh', 'Nenagh', 500), -(5679, 74, 447, 'Roscrea', 'Roscrea', 600), -(5680, 74, 447, 'Thurles', 'Thurles', 700), -(5681, 74, 447, 'Tipperary', 'Tipperary', 800), -(5682, 74, 448, 'Dungarvan', 'Dungarvan', 100), -(5683, 74, 448, 'Lismore', 'Lismore', 200), -(5684, 74, 448, 'Waterford', 'Waterford', 300), -(5685, 74, 449, 'Athlone', 'Athlone', 100), -(5686, 74, 449, 'Moate', 'Moate', 200), -(5687, 74, 449, 'Mullingar', 'Mullingar', 300), -(5688, 74, 450, 'Bunclody', 'Bunclody', 100), -(5689, 74, 450, 'Enniscorthy', 'Enniscorthy', 200), -(5690, 74, 450, 'Gorey', 'Gorey', 300), -(5691, 74, 450, 'New Ross', 'New Ross', 400), -(5692, 74, 450, 'Wexford', 'Wexford', 500), -(5693, 74, 451, 'Arklow', 'Arklow', 100), -(5694, 74, 451, 'Blessington', 'Blessington', 200), -(5695, 74, 451, 'Bray', 'Bray', 300), -(5696, 74, 451, 'Enniskerry', 'Enniskerry', 400), -(5697, 74, 451, 'Wicklow', 'Wicklow', 500), -(5698, 75, 452, 'Brfell', 'Brfell', 100), -(5699, 75, 452, 'Selfoss', 'Selfoss', 200), -(5700, 75, 453, 'Hof', 'Hof', 100), -(5701, 75, 454, 'Akranes', 'Akranes', 100), -(5702, 75, 455, 'Akureyri', 'Akureyri', 100), -(5703, 75, 455, 'Migarar', 'Migarar', 200), -(5704, 75, 456, 'Kpavogur', 'Kpavogur', 100), -(5705, 75, 456, 'Reykjavk', 'Reykjavk', 200), -(5706, 75, 457, 'Alttanes', 'Alttanes', 100), -(5707, 75, 458, 'br', 'br', 100), -(5708, 75, 458, 'gur', 'gur', 200), -(5709, 75, 459, 'Saudhanes', 'Saudhanes', 100), -(5710, 75, 460, 'Norurfjrur', 'Norurfjrur', 100), -(5711, 75, 460, 'Reykjarnes', 'Reykjarnes', 200), -(5712, 75, 460, 'rnes', 'rnes', 300), -(5713, 75, 461, 'Reyarfjrur', 'Reyarfjrur', 100), -(5714, 75, 462, 'Vatneyri', 'Vatneyri', 100), -(5715, 76, 463, 'A Baa', 'A Baa', 100), -(5716, 76, 463, 'A Barqueira', 'A Barqueira', 200), -(5717, 76, 463, 'A Brea', 'A Brea', 300), -(5718, 76, 463, 'A Corua', 'A Corua', 400), -(5719, 76, 463, 'A Via', 'A Via', 500), -(5720, 76, 463, 'Carballo', 'Carballo', 600), -(5721, 76, 463, 'Cario', 'Cario', 700), -(5722, 76, 463, 'Ferrol', 'Ferrol', 800), -(5723, 76, 463, 'Padrn', 'Padrn', 900), -(5724, 76, 463, 'Rois', 'Rois', 1000), -(5725, 76, 463, 'San Marcos', 'San Marcos', 1100), -(5726, 76, 463, 'Santiago de Compostela', 'Santiago de Compostela', 1200), -(5727, 76, 463, 'Vigo', 'Vigo', 1300), -(5728, 76, 463, 'Vimianzo', 'Vimianzo', 1400), -(5729, 76, 464, 'Aguas Nuevas', 'Aguas Nuevas', 100), -(5730, 76, 464, 'Albacete', 'Albacete', 200), -(5731, 76, 464, 'Almansa', 'Almansa', 300), -(5732, 76, 464, 'Helln', 'Helln', 400), -(5733, 76, 464, 'Turilla', 'Turilla', 500), -(5734, 76, 464, 'Villamalea', 'Villamalea', 600), -(5735, 76, 464, 'Villarrobledo', 'Villarrobledo', 700), -(5736, 76, 465, 'Abio', 'Abio', 100), -(5737, 76, 465, 'Agost', 'Agost', 200), -(5738, 76, 465, 'Agres', 'Agres', 300), -(5739, 76, 465, 'Albatera', 'Albatera', 400), -(5740, 76, 465, 'Albir', 'Albir', 500), -(5741, 76, 465, 'Alborada', 'Alborada', 600), -(5742, 76, 465, 'Albufereta', 'Albufereta', 700), -(5743, 76, 465, 'Alcoy', 'Alcoy', 800), -(5744, 76, 465, 'Alicante', 'Alicante', 900), -(5745, 76, 465, 'Almorad', 'Almorad', 1000), -(5746, 76, 465, 'Altabix', 'Altabix', 1100), -(5747, 76, 465, 'Altea', 'Altea', 1200), -(5748, 76, 465, 'Aspe', 'Aspe', 1300), -(5749, 76, 465, 'Benejzar', 'Benejzar', 1400), -(5750, 76, 465, 'Benidorm', 'Benidorm', 1500), -(5751, 76, 465, 'Benitachell', 'Benitachell', 1600), -(5752, 76, 465, 'Calpe', 'Calpe', 1700), -(5753, 76, 465, 'Casas del Seor', 'Casas del Seor', 1800), -(5754, 76, 465, 'Castalla', 'Castalla', 1900), -(5755, 76, 465, 'Dnia', 'Dnia', 2000), -(5756, 76, 465, 'Dolores', 'Dolores', 2100), -(5757, 76, 465, 'Elche', 'Elche', 2200), -(5758, 76, 465, 'Elda', 'Elda', 2300), -(5759, 76, 465, 'Guardamar del Segura', 'Guardamar del Segura', 2400), -(5760, 76, 465, 'Jvea', 'Jvea', 2500), -(5761, 76, 465, 'La Zenia', 'La Zenia', 2600), -(5762, 76, 465, 'Los Montesinos', 'Los Montesinos', 2700), -(5763, 76, 465, 'Ondara', 'Ondara', 2800), -(5764, 76, 465, 'Onil', 'Onil', 2900), -(5765, 76, 465, 'Orihuela', 'Orihuela', 3000), -(5766, 76, 465, 'Pilar de la Horadada', 'Pilar de la Horadada', 3100), -(5767, 76, 465, 'San Juan de Alicante', 'San Juan de Alicante', 3200), -(5768, 76, 465, 'Santa Pola', 'Santa Pola', 3300), -(5769, 76, 465, 'Torrevieja', 'Torrevieja', 3400), -(5770, 76, 466, 'Adra', 'Adra', 100), -(5771, 76, 466, 'Aguadulce', 'Aguadulce', 200), -(5772, 76, 466, 'Albox', 'Albox', 300), -(5773, 76, 466, 'Alcaudique', 'Alcaudique', 400), -(5774, 76, 466, 'Alhama de Almera', 'Alhama de Almera', 500), -(5775, 76, 466, 'Almera', 'Almera', 600), -(5776, 76, 466, 'Almerimar', 'Almerimar', 700), -(5777, 76, 466, 'Arboleas', 'Arboleas', 800), -(5778, 76, 466, 'Balanegra', 'Balanegra', 900), -(5779, 76, 466, 'Balerma', 'Balerma', 1000), -(5780, 76, 466, 'Campohermoso', 'Campohermoso', 1100), -(5781, 76, 466, 'Cuevas de Almanzora', 'Cuevas de Almanzora', 1200), -(5782, 76, 466, 'El Alquian', 'El Alquian', 1300), -(5783, 76, 466, 'El Cabo de Gata', 'El Cabo de Gata', 1400), -(5784, 76, 466, 'El Ejido', 'El Ejido', 1500), -(5785, 76, 466, 'El Parador', 'El Parador', 1600), -(5786, 76, 466, 'Garrucha', 'Garrucha', 1700), -(5787, 76, 466, 'La Caada de San Urbano', 'La Caada de San Urbano', 1800), -(5788, 76, 466, 'Mojcar', 'Mojcar', 1900), -(5789, 76, 466, 'Olula del Ro', 'Olula del Ro', 2000), -(5790, 76, 466, 'Roquetas de Mar', 'Roquetas de Mar', 2100), -(5791, 76, 466, 'San Isidro de Njar', 'San Isidro de Njar', 2200), -(5792, 76, 466, 'Vcar', 'Vcar', 2300), -(5793, 76, 466, 'Vera', 'Vera', 2400), -(5794, 76, 467, 'Armada', 'Armada', 100), -(5795, 76, 467, 'Avils', 'Avils', 200), -(5796, 76, 467, 'Cedemonio', 'Cedemonio', 300), -(5797, 76, 467, 'Gijn', 'Gijn', 400), -(5798, 76, 467, 'Luanco', 'Luanco', 500), -(5799, 76, 467, 'Lugones', 'Lugones', 600), -(5800, 76, 467, 'Mieres', 'Mieres', 700), -(5801, 76, 467, 'Oviedo', 'Oviedo', 800), -(5802, 76, 467, 'Pravia', 'Pravia', 900), -(5803, 76, 467, 'Villaviciosa', 'Villaviciosa', 1000), -(5804, 76, 468, 'Almendralejo', 'Almendralejo', 100), -(5805, 76, 468, 'Badajoz', 'Badajoz', 200), -(5806, 76, 468, 'Don Benito', 'Don Benito', 300), -(5807, 76, 468, 'Mrida', 'Mrida', 400), -(5808, 76, 468, 'Talarrubias', 'Talarrubias', 500), -(5809, 76, 469, 'Abrera', 'Abrera', 100), -(5810, 76, 469, 'Aiguafreda (1)', 'Aiguafreda (1)', 200), -(5811, 76, 469, 'Alou', 'Alou', 300), -(5812, 76, 469, 'Antius', 'Antius', 400), -(5813, 76, 469, 'Arenys de Munt', 'Arenys de Munt', 500), -(5814, 76, 469, 'Avi', 'Avi', 600), -(5815, 76, 469, 'Badalona', 'Badalona', 700), -(5816, 76, 469, 'Balsareny', 'Balsareny', 800), -(5817, 76, 469, 'Barcelona', 'Barcelona', 900), -(5818, 76, 469, 'Begues', 'Begues', 1000), -(5819, 76, 469, 'Berga', 'Berga', 1100), -(5820, 76, 469, 'Bergus', 'Bergus', 1200), -(5821, 76, 469, 'Bonavista', 'Bonavista', 1300), -(5822, 76, 469, 'Cabrils', 'Cabrils', 1400), -(5823, 76, 469, 'Calaf', 'Calaf', 1500), -(5824, 76, 469, 'Calella', 'Calella', 1600), -(5825, 76, 469, 'Camps', 'Camps', 1700), -(5826, 76, 469, 'Cardona', 'Cardona', 1800), -(5827, 76, 469, 'Castellar de n''hug', 'Castellar de n''hug', 1900), -(5828, 76, 469, 'Castelldefels', 'Castelldefels', 2000), -(5829, 76, 469, 'Cerdanyola', 'Cerdanyola', 2100), -(5830, 76, 469, 'Clint el', 'Clint el', 2200), -(5831, 76, 469, 'Granollers', 'Granollers', 2300), -(5832, 76, 469, 'L'' Hospitalet de Llobregat', 'L'' Hospitalet de Llobregat', 2400), -(5833, 76, 469, 'La Molina', 'La Molina', 2500), -(5834, 76, 469, 'La Panadella', 'La Panadella', 2600), -(5835, 76, 469, 'Malgrat de Mar', 'Malgrat de Mar', 2700), -(5836, 76, 469, 'Manresa', 'Manresa', 2800), -(5837, 76, 469, 'Matar', 'Matar', 2900), -(5838, 76, 469, 'Mollet', 'Mollet', 3000), -(5839, 76, 469, 'Montcada i Reixac', 'Montcada i Reixac', 3100), -(5840, 76, 469, 'Poliny', 'Poliny', 3200), -(5841, 76, 469, 'Sabadell', 'Sabadell', 3300), -(5842, 76, 469, 'Sant Boi de Llobregat', 'Sant Boi de Llobregat', 3400), -(5843, 76, 469, 'Sant Juli de Vilatorta', 'Sant Juli de Vilatorta', 3500), -(5844, 76, 469, 'Sant Pol de Mar', 'Sant Pol de Mar', 3600), -(5845, 76, 469, 'Santa Susanna', 'Santa Susanna', 3700), -(5846, 76, 469, 'Sitges', 'Sitges', 3800), -(5847, 76, 469, 'Terrassa', 'Terrassa', 3900), -(5848, 76, 469, 'Vic', 'Vic', 4000), -(5849, 76, 469, 'Vilafranca del Peneds', 'Vilafranca del Peneds', 4100), -(5850, 76, 469, 'Vilanova i la Geltr', 'Vilanova i la Geltr', 4200), -(5851, 76, 469, 'Viver', 'Viver', 4300), -(5852, 76, 470, 'Ages', 'Ages', 100), -(5853, 76, 470, 'Alba', 'Alba', 200), -(5854, 76, 470, 'Alcocero de mola', 'Alcocero de mola', 300), -(5855, 76, 470, 'Aranda de Duero', 'Aranda de Duero', 400), -(5856, 76, 470, 'Burgos', 'Burgos', 500), -(5857, 76, 470, 'Caizar de amaya', 'Caizar de amaya', 600), -(5858, 76, 470, 'Covarrubias', 'Covarrubias', 700), -(5859, 76, 470, 'Miranda de Ebro', 'Miranda de Ebro', 800), -(5860, 76, 471, 'Agsero', 'Agsero', 100), -(5861, 76, 471, 'Ajanedo', 'Ajanedo', 200), -(5862, 76, 471, 'Alcomba', 'Alcomba', 300), -(5863, 76, 471, 'Comillas', 'Comillas', 400), -(5864, 76, 471, 'Ganzo', 'Ganzo', 500), -(5865, 76, 471, 'Lamedo', 'Lamedo', 600), -(5866, 76, 471, 'Laredo', 'Laredo', 700), -(5867, 76, 471, 'Muriedas', 'Muriedas', 800), -(5868, 76, 471, 'Potes', 'Potes', 900), -(5869, 76, 471, 'Puente san miguel', 'Puente san miguel', 1000), -(5870, 76, 471, 'Reinosa', 'Reinosa', 1100), -(5871, 76, 471, 'San miguel', 'San miguel', 1200), -(5872, 76, 471, 'Santa Cruz de Bezana', 'Santa Cruz de Bezana', 1300), -(5873, 76, 471, 'Santander', 'Santander', 1400), -(5874, 76, 471, 'Santoa', 'Santoa', 1500), -(5875, 76, 471, 'Solares', 'Solares', 1600), -(5876, 76, 471, 'Torrelavega', 'Torrelavega', 1700), -(5877, 76, 472, 'Ahin', 'Ahin', 100), -(5878, 76, 472, 'Albocacer', 'Albocacer', 200), -(5879, 76, 472, 'Benicarl', 'Benicarl', 300), -(5880, 76, 472, 'Castelln de la Plana', 'Castelln de la Plana', 400), -(5881, 76, 472, 'La Vall d''Uix', 'La Vall d''Uix', 500), -(5882, 76, 472, 'Moncofar', 'Moncofar', 600), -(5883, 76, 472, 'Nules', 'Nules', 700), -(5884, 76, 472, 'Oropesa', 'Oropesa', 800), -(5885, 76, 472, 'Pescola', 'Pescola', 900), -(5886, 76, 472, 'Segorbe', 'Segorbe', 1000), -(5887, 76, 472, 'Villarreal', 'Villarreal', 1100), -(5888, 76, 472, 'Vinars', 'Vinars', 1200), -(5889, 76, 473, 'Cceres', 'Cceres', 100), -(5890, 76, 473, 'Coria', 'Coria', 200), -(5891, 76, 474, 'Algeciras', 'Algeciras', 100), -(5892, 76, 474, 'Cdiz', 'Cdiz', 200), -(5893, 76, 474, 'Chiclana de la Frontera', 'Chiclana de la Frontera', 300), -(5894, 76, 474, 'El Puerto de Santa Mara', 'El Puerto de Santa Mara', 400), -(5895, 76, 474, 'Jerez de la Frontera', 'Jerez de la Frontera', 500), -(5896, 76, 474, 'La Lnea de la Concepcin', 'La Lnea de la Concepcin', 600), -(5897, 76, 474, 'Los Barrios', 'Los Barrios', 700), -(5898, 76, 474, 'Palmones', 'Palmones', 800), -(5899, 76, 474, 'Puerto Real', 'Puerto Real', 900), -(5900, 76, 474, 'Rota', 'Rota', 1000), -(5901, 76, 474, 'San Fernando', 'San Fernando', 1100), -(5902, 76, 474, 'San Roque', 'San Roque', 1200), -(5903, 76, 474, 'Sanlcar de Barrameda', 'Sanlcar de Barrameda', 1300), -(5904, 76, 474, 'Sotogrande', 'Sotogrande', 1400), -(5905, 76, 474, 'Tarifa', 'Tarifa', 1500), -(5906, 76, 475, 'Ceuta', 'Ceuta', 100), -(5907, 76, 476, 'Alczar de San Juan', 'Alczar de San Juan', 100), -(5908, 76, 476, 'Calzada de Calatrava', 'Calzada de Calatrava', 200), -(5909, 76, 476, 'Ciudad Real', 'Ciudad Real', 300), -(5910, 76, 476, 'Puertollano', 'Puertollano', 400), -(5911, 76, 476, 'Socullamos', 'Socullamos', 500), -(5912, 76, 476, 'Tomelloso', 'Tomelloso', 600), -(5913, 76, 476, 'Valdepeas', 'Valdepeas', 700), -(5914, 76, 477, 'Almedinilla', 'Almedinilla', 100), -(5915, 76, 477, 'Aora', 'Aora', 200), -(5916, 76, 477, 'Azuel', 'Azuel', 300), -(5917, 76, 477, 'Castellar el', 'Castellar el', 400), -(5918, 76, 477, 'Crdoba', 'Crdoba', 500), -(5919, 76, 477, 'Llanos de don juan', 'Llanos de don juan', 600), -(5920, 76, 477, 'Lucena', 'Lucena', 700), -(5921, 76, 477, 'Moriles', 'Moriles', 800), -(5922, 76, 477, 'Palma del Ro', 'Palma del Ro', 900), -(5923, 76, 477, 'Pozoblanco', 'Pozoblanco', 1000), -(5924, 76, 477, 'Puente Genil', 'Puente Genil', 1100), -(5925, 76, 477, 'Villa del Ro', 'Villa del Ro', 1200), -(5926, 76, 477, 'Villarrubia', 'Villarrubia', 1300), -(5927, 76, 478, 'Alarcon', 'Alarcon', 100), -(5928, 76, 478, 'Cuenca', 'Cuenca', 200), -(5929, 76, 478, 'Minglanilla', 'Minglanilla', 300), -(5930, 76, 478, 'Tarancn', 'Tarancn', 400), -(5931, 76, 479, 'Banyoles', 'Banyoles', 100), -(5932, 76, 479, 'Bellcaire d''emporda', 'Bellcaire d''emporda', 200), -(5933, 76, 479, 'Besal', 'Besal', 300), -(5934, 76, 479, 'Blanes', 'Blanes', 400), -(5935, 76, 479, 'Calella', 'Calella', 500), -(5936, 76, 479, 'Calonge', 'Calonge', 600), -(5937, 76, 479, 'Castell d''Empries', 'Castell d''Empries', 700), -(5938, 76, 479, 'Empuria brava', 'Empuria brava', 800), -(5939, 76, 479, 'Figueres', 'Figueres', 900), -(5940, 76, 479, 'Girona', 'Girona', 1000), -(5941, 76, 479, 'L''Escala', 'L''Escala', 1100), -(5942, 76, 479, 'La Jonquera', 'La Jonquera', 1200), -(5943, 76, 479, 'Lloret de Mar', 'Lloret de Mar', 1300), -(5944, 76, 479, 'Olot', 'Olot', 1400), -(5945, 76, 479, 'Palafrugell', 'Palafrugell', 1500), -(5946, 76, 479, 'Palams', 'Palams', 1600), -(5947, 76, 479, 'Pals', 'Pals', 1700), -(5948, 76, 479, 'Platja d''haro', 'Platja d''haro', 1800), -(5949, 76, 479, 'Puigcerd', 'Puigcerd', 1900), -(5950, 76, 479, 'Roses', 'Roses', 2000), -(5951, 76, 479, 'Salt', 'Salt', 2100), -(5952, 76, 479, 'Sant antoni de calonge', 'Sant antoni de calonge', 2200), -(5953, 76, 479, 'Sant Feliu de Guxols', 'Sant Feliu de Guxols', 2300), -(5954, 76, 479, 'Sant Juli de Ramis', 'Sant Juli de Ramis', 2400), -(5955, 76, 479, 'Santa Coloma de Farners', 'Santa Coloma de Farners', 2500), -(5956, 76, 479, 'Tossa de Mar', 'Tossa de Mar', 2600), -(5957, 76, 479, 'Vidrieres', 'Vidrieres', 2700), -(5958, 76, 480, 'Acula', 'Acula', 100), -(5959, 76, 480, 'Albolote', 'Albolote', 200), -(5960, 76, 480, 'Aldeilla', 'Aldeilla', 300), -(5961, 76, 480, 'Almucar', 'Almucar', 400), -(5962, 76, 480, 'Armilla', 'Armilla', 500), -(5963, 76, 480, 'Baza', 'Baza', 600), -(5964, 76, 480, 'Fuente Vaqueros', 'Fuente Vaqueros', 700), -(5965, 76, 480, 'Gorafe', 'Gorafe', 800), -(5966, 76, 480, 'Granada', 'Granada', 900), -(5967, 76, 480, 'Maracena', 'Maracena', 1000), -(5968, 76, 480, 'Motril', 'Motril', 1100), -(5969, 76, 480, 'Otura', 'Otura', 1200), -(5970, 76, 480, 'Santa Fe', 'Santa Fe', 1300), -(5971, 76, 481, 'Guadalajara', 'Guadalajara', 100), -(5972, 76, 481, 'Villares de jadraque', 'Villares de jadraque', 200), -(5973, 76, 482, 'Andoain', 'Andoain', 100), -(5974, 76, 482, 'Arrasate/Mondragn', 'Arrasate/Mondragn', 200), -(5975, 76, 482, 'Beasain', 'Beasain', 300), -(5976, 76, 482, 'Hernani', 'Hernani', 400), -(5977, 76, 482, 'Irun', 'Irun', 500), -(5978, 76, 482, 'Irura', 'Irura', 600), -(5979, 76, 482, 'Ormaiztegi', 'Ormaiztegi', 700), -(5980, 76, 482, 'Renteria', 'Renteria', 800), -(5981, 76, 482, 'San Sebastin', 'San Sebastin', 900), -(5982, 76, 482, 'Tolosa', 'Tolosa', 1000), -(5983, 76, 482, 'Txikierdi', 'Txikierdi', 1100), -(5984, 76, 483, 'Aljaraque', 'Aljaraque', 100), -(5985, 76, 483, 'Almonte', 'Almonte', 200), -(5986, 76, 483, 'Alto de la mesa', 'Alto de la mesa', 300), -(5987, 76, 483, 'Bollullos Par del Condado', 'Bollullos Par del Condado', 400), -(5988, 76, 483, 'Cartaya', 'Cartaya', 500), -(5989, 76, 483, 'Huelva', 'Huelva', 600), -(5990, 76, 483, 'Lepe', 'Lepe', 700), -(5991, 76, 483, 'Palos de la Frontera', 'Palos de la Frontera', 800), -(5992, 76, 483, 'Punta Umbra', 'Punta Umbra', 900), -(5993, 76, 484, 'Fraga', 'Fraga', 100), -(5994, 76, 484, 'Huesca', 'Huesca', 200), -(5995, 76, 484, 'Jaca', 'Jaca', 300), -(5996, 76, 484, 'Monzn', 'Monzn', 400), -(5997, 76, 484, 'Zaidin', 'Zaidin', 500), -(5998, 76, 485, 'Arenal s''', 'Arenal s''', 100), -(5999, 76, 485, 'Art', 'Art', 200), -(6000, 76, 485, 'Binissalem', 'Binissalem', 300), -(6001, 76, 485, 'Can pastilla', 'Can pastilla', 400), -(6002, 76, 485, 'Ciutadella de Menorca', 'Ciutadella de Menorca', 500), -(6003, 76, 485, 'Eivissa', 'Eivissa', 600), -(6004, 76, 485, 'Inca', 'Inca', 700), -(6005, 76, 485, 'Mahon', 'Mahon', 800), -(6006, 76, 485, 'Muro', 'Muro', 900), -(6007, 76, 485, 'Palma de Mallorca', 'Palma de Mallorca', 1000), -(6008, 76, 485, 'Palma nova', 'Palma nova', 1100), -(6009, 76, 485, 'Sant antoni abat', 'Sant antoni abat', 1200), -(6010, 76, 485, 'Santa Eulalia des Riu', 'Santa Eulalia des Riu', 1300), -(6011, 76, 485, 'Santa pona', 'Santa pona', 1400), -(6012, 76, 485, 'Talamanca', 'Talamanca', 1500), -(6013, 76, 486, 'Arroyo del Ojanco', 'Arroyo del Ojanco', 100), -(6014, 76, 486, 'Aulabar', 'Aulabar', 200), -(6015, 76, 486, 'Baeza', 'Baeza', 300), -(6016, 76, 486, 'beda', 'beda', 400), -(6017, 76, 486, 'Coto rios', 'Coto rios', 500), -(6018, 76, 486, 'Jan', 'Jan', 600), -(6019, 76, 486, 'Linares', 'Linares', 700), -(6020, 76, 486, 'Mengbar', 'Mengbar', 800), -(6021, 76, 486, 'Torres', 'Torres', 900), -(6022, 76, 487, 'Arnedo', 'Arnedo', 100), -(6023, 76, 487, 'Calahorra', 'Calahorra', 200), -(6024, 76, 487, 'Logroo', 'Logroo', 300), -(6025, 76, 488, 'Agaete', 'Agaete', 100), -(6026, 76, 488, 'Arrecife', 'Arrecife', 200), -(6027, 76, 488, 'Arucas', 'Arucas', 300), -(6028, 76, 488, 'Casillas del angel', 'Casillas del angel', 400), -(6029, 76, 488, 'Corralejo', 'Corralejo', 500), -(6030, 76, 488, 'Jinamar', 'Jinamar', 600), -(6031, 76, 488, 'Las Palmas', 'Las Palmas', 700), -(6032, 76, 488, 'Maspalomas', 'Maspalomas', 800), -(6033, 76, 488, 'Mogn', 'Mogn', 900), -(6034, 76, 488, 'Puerto del Rosario', 'Puerto del Rosario', 1000), -(6035, 76, 488, 'San Bartolom', 'San Bartolom', 1100), -(6036, 76, 488, 'San Bartolom de Tirajana', 'San Bartolom de Tirajana', 1200), -(6037, 76, 488, 'Santa Luca', 'Santa Luca', 1300), -(6038, 76, 488, 'Tafira alta', 'Tafira alta', 1400), -(6039, 76, 488, 'Yaiza', 'Yaiza', 1500), -(6040, 76, 489, 'Abechuco', 'Abechuco', 100), -(6041, 76, 489, 'Llodio', 'Llodio', 200), -(6042, 76, 489, 'Salvatierra', 'Salvatierra', 300), -(6043, 76, 489, 'Viloria', 'Viloria', 400), -(6044, 76, 489, 'Vitoria', 'Vitoria', 500), -(6045, 76, 490, 'Cubillos del sil', 'Cubillos del sil', 100), -(6046, 76, 490, 'Len', 'Len', 200), -(6047, 76, 491, 'Balaguer', 'Balaguer', 100), -(6048, 76, 491, 'Castellas', 'Castellas', 200), -(6049, 76, 491, 'Cervera', 'Cervera', 300), -(6050, 76, 491, 'El Pont de Suert', 'El Pont de Suert', 400), -(6051, 76, 491, 'Guissona', 'Guissona', 500), -(6052, 76, 491, 'La Seu d''Urgell', 'La Seu d''Urgell', 600), -(6053, 76, 491, 'Lleida', 'Lleida', 700), -(6054, 76, 491, 'Poal el', 'Poal el', 800), -(6055, 76, 491, 'Sidamon', 'Sidamon', 900), -(6056, 76, 491, 'Trrega', 'Trrega', 1000), -(6057, 76, 492, 'A Pobra do Brolln', 'A Pobra do Brolln', 100), -(6058, 76, 492, 'Lugo', 'Lugo', 200), -(6059, 76, 492, 'Rabade', 'Rabade', 300), -(6060, 76, 492, 'Ribadeo', 'Ribadeo', 400), -(6061, 76, 493, 'Ajalvir', 'Ajalvir', 100), -(6062, 76, 493, 'Alcal de Henares', 'Alcal de Henares', 200), -(6063, 76, 493, 'Alcobendas', 'Alcobendas', 300), -(6064, 76, 493, 'Alcorcn', 'Alcorcn', 400), -(6065, 76, 493, 'Anchuelo', 'Anchuelo', 500), -(6066, 76, 493, 'Barajas', 'Barajas', 600), -(6067, 76, 493, 'Berzosa del Lozoya', 'Berzosa del Lozoya', 700), -(6068, 76, 493, 'Carabaa', 'Carabaa', 800), -(6069, 76, 493, 'Collado Villalba', 'Collado Villalba', 900), -(6070, 76, 493, 'Colmenar Viejo', 'Colmenar Viejo', 1000), -(6071, 76, 493, 'El Escorial', 'El Escorial', 1100), -(6072, 76, 493, 'El Molar', 'El Molar', 1200), -(6073, 76, 493, 'Fuenlabrada', 'Fuenlabrada', 1300), -(6074, 76, 493, 'Galapagar', 'Galapagar', 1400), -(6075, 76, 493, 'Getafe', 'Getafe', 1500), -(6076, 76, 493, 'Humanes de Madrid', 'Humanes de Madrid', 1600), -(6077, 76, 493, 'Las Rozas', 'Las Rozas', 1700), -(6078, 76, 493, 'Legans', 'Legans', 1800), -(6079, 76, 493, 'Madarcos', 'Madarcos', 1900), -(6080, 76, 493, 'Madrid', 'Madrid', 2000), -(6081, 76, 493, 'Manjiron', 'Manjiron', 2100), -(6082, 76, 493, 'Mejorada del Campo', 'Mejorada del Campo', 2200), -(6083, 76, 493, 'Mstoles', 'Mstoles', 2300), -(6084, 76, 493, 'Navacerrada', 'Navacerrada', 2400), -(6085, 76, 493, 'Perales del Ro', 'Perales del Ro', 2500), -(6086, 76, 493, 'Rozas de Puerto Real', 'Rozas de Puerto Real', 2600), -(6087, 76, 493, 'San Agustn de Guadalix', 'San Agustn de Guadalix', 2700), -(6088, 76, 493, 'Torrejn de Ardoz', 'Torrejn de Ardoz', 2800), -(6089, 76, 493, 'Torrejn de la Calzada', 'Torrejn de la Calzada', 2900), -(6090, 76, 493, 'Valdemoro', 'Valdemoro', 3000), -(6091, 76, 493, 'Vallecas', 'Vallecas', 3100), -(6092, 76, 493, 'Villa del Prado', 'Villa del Prado', 3200), -(6093, 76, 493, 'Villanueva de la Caada', 'Villanueva de la Caada', 3300), -(6094, 76, 493, 'Villaviciosa de Odn', 'Villaviciosa de Odn', 3400), -(6095, 76, 493, 'Zarzalejo', 'Zarzalejo', 3500), -(6096, 76, 494, 'Melilla', 'Melilla', 100), -(6097, 76, 495, 'Alameda', 'Alameda', 100), -(6098, 76, 495, 'Alhaurn de la Torre', 'Alhaurn de la Torre', 200), -(6099, 76, 495, 'Arenas', 'Arenas', 300), -(6100, 76, 495, 'Benalmdena', 'Benalmdena', 400), -(6101, 76, 495, 'Con', 'Con', 500), -(6102, 76, 495, 'Estepona', 'Estepona', 600), -(6103, 76, 495, 'Fuengirola', 'Fuengirola', 700), -(6104, 76, 495, 'Manilva', 'Manilva', 800), -(6105, 76, 495, 'Marbella', 'Marbella', 900), -(6106, 76, 495, 'Mijas', 'Mijas', 1000), -(6107, 76, 495, 'Mlaga', 'Mlaga', 1100), -(6108, 76, 495, 'Nerja', 'Nerja', 1200), -(6109, 76, 495, 'Nueva andalucia', 'Nueva andalucia', 1300), -(6110, 76, 495, 'Rincn de la Victoria', 'Rincn de la Victoria', 1400), -(6111, 76, 495, 'Riogordo', 'Riogordo', 1500), -(6112, 76, 495, 'San pedro de alcantara', 'San pedro de alcantara', 1600), -(6113, 76, 495, 'Torre del mar', 'Torre del mar', 1700), -(6114, 76, 495, 'Torremolinos', 'Torremolinos', 1800), -(6115, 76, 495, 'Vlez-Mlaga', 'Vlez-Mlaga', 1900), -(6116, 76, 496, 'Abarn', 'Abarn', 100), -(6117, 76, 496, 'Alberca la', 'Alberca la', 200), -(6118, 76, 496, 'Alcantarilla', 'Alcantarilla', 300), -(6119, 76, 496, 'Aledo', 'Aledo', 400), -(6120, 76, 496, 'Archena', 'Archena', 500), -(6121, 76, 496, 'Beniel', 'Beniel', 600), -(6122, 76, 496, 'Cabo de palos', 'Cabo de palos', 700), -(6123, 76, 496, 'Caravaca de la Cruz', 'Caravaca de la Cruz', 800), -(6124, 76, 496, 'Cartagena', 'Cartagena', 900), -(6125, 76, 496, 'Cehegn', 'Cehegn', 1000), -(6126, 76, 496, 'Cieza', 'Cieza', 1100), -(6127, 76, 496, 'El Palmar', 'El Palmar', 1200), -(6128, 76, 496, 'Esparragal', 'Esparragal', 1300), -(6129, 76, 496, 'Espinardo', 'Espinardo', 1400), -(6130, 76, 496, 'guilas', 'guilas', 1500), -(6131, 76, 496, 'Lorca', 'Lorca', 1600), -(6132, 76, 496, 'Lorqu', 'Lorqu', 1700), -(6133, 76, 496, 'Los Alczares', 'Los Alczares', 1800), -(6134, 76, 496, 'Molina de Segura', 'Molina de Segura', 1900), -(6135, 76, 496, 'Mula', 'Mula', 2000), -(6136, 76, 496, 'Murcia', 'Murcia', 2100), -(6137, 76, 496, 'Puerto de mazarron', 'Puerto de mazarron', 2200), -(6138, 76, 496, 'San Pedro del Pinatar', 'San Pedro del Pinatar', 2300), -(6139, 76, 496, 'Santiago de la ribera', 'Santiago de la ribera', 2400), -(6140, 76, 496, 'Torreaguera', 'Torreaguera', 2500), -(6141, 76, 496, 'Totana', 'Totana', 2600), -(6142, 76, 497, 'Ansoin', 'Ansoin', 100), -(6143, 76, 497, 'Aurizberri espinal', 'Aurizberri espinal', 200), -(6144, 76, 497, 'Baraain', 'Baraain', 300), -(6145, 76, 497, 'Burlada/Burlata', 'Burlada/Burlata', 400), -(6146, 76, 497, 'Buuel', 'Buuel', 500), -(6147, 76, 497, 'Corella', 'Corella', 600), -(6148, 76, 497, 'Elizondo', 'Elizondo', 700), -(6149, 76, 497, 'Estella/Lizarra', 'Estella/Lizarra', 800), -(6150, 76, 497, 'Goizueta', 'Goizueta', 900), -(6151, 76, 497, 'Olite', 'Olite', 1000), -(6152, 76, 497, 'Pamplona/Irua', 'Pamplona/Irua', 1100), -(6153, 76, 497, 'Ribaforada', 'Ribaforada', 1200), -(6154, 76, 497, 'San Adrin', 'San Adrin', 1300), -(6155, 76, 497, 'Tafalla', 'Tafalla', 1400), -(6156, 76, 497, 'Tudela', 'Tudela', 1500), -(6157, 76, 498, 'A Merca', 'A Merca', 100), -(6158, 76, 498, 'Nogueira', 'Nogueira', 200), -(6159, 76, 498, 'Orense', 'Orense', 300), -(6160, 76, 498, 'San amaro', 'San amaro', 400), -(6161, 76, 499, 'Palencia', 'Palencia', 100), -(6162, 76, 499, 'Villamuriel de Cerrato', 'Villamuriel de Cerrato', 200), -(6163, 76, 500, 'Marn', 'Marn', 100), -(6164, 76, 500, 'Ponteareas', 'Ponteareas', 200), -(6165, 76, 500, 'Pontevedra', 'Pontevedra', 300), -(6166, 76, 500, 'Vigo', 'Vigo', 400), -(6167, 76, 501, 'Morasverdes', 'Morasverdes', 100), -(6168, 76, 501, 'Salamanca', 'Salamanca', 200), -(6169, 76, 501, 'Santa Marta de Tormes', 'Santa Marta de Tormes', 300), -(6170, 76, 502, 'Adeje', 'Adeje', 100), -(6171, 76, 502, 'Arico el Nuevo', 'Arico el Nuevo', 200), -(6172, 76, 502, 'Arona', 'Arona', 300), -(6173, 76, 502, 'Buenavista del Norte', 'Buenavista del Norte', 400), -(6174, 76, 502, 'Cabo Blanco', 'Cabo Blanco', 500), -(6175, 76, 502, 'Chio', 'Chio', 600), -(6176, 76, 502, 'Cruz Santa', 'Cruz Santa', 700), -(6177, 76, 502, 'El Mdano', 'El Mdano', 800), -(6178, 76, 502, 'El Sauzal', 'El Sauzal', 900), -(6179, 76, 502, 'Frontera', 'Frontera', 1000), -(6180, 76, 502, 'Granadilla de Abona', 'Granadilla de Abona', 1100), -(6181, 76, 502, 'Gua de Isora', 'Gua de Isora', 1200), -(6182, 76, 502, 'Guaza', 'Guaza', 1300), -(6183, 76, 502, 'Icod de los Vinos', 'Icod de los Vinos', 1400), -(6184, 76, 502, 'La Caleta', 'La Caleta', 1500), -(6185, 76, 502, 'La Laguna', 'La Laguna', 1600), -(6186, 76, 502, 'Las Galletas', 'Las Galletas', 1700), -(6187, 76, 502, 'Llanos los', 'Llanos los', 1800), -(6188, 76, 502, 'Los Cristianos', 'Los Cristianos', 1900), -(6189, 76, 502, 'Puerto de la Cruz', 'Puerto de la Cruz', 2000), -(6190, 76, 502, 'San Isidro', 'San Isidro', 2100), -(6191, 76, 502, 'San juan', 'San juan', 2200), -(6192, 76, 502, 'San Juan de la Rambla', 'San Juan de la Rambla', 2300), -(6193, 76, 502, 'Santa Cruz de la Palma', 'Santa Cruz de la Palma', 2400), -(6194, 76, 502, 'Santa Cruz de Tenerife', 'Santa Cruz de Tenerife', 2500), -(6195, 76, 502, 'Santa maria del mar', 'Santa maria del mar', 2600), -(6196, 76, 502, 'Urbanizacion playa de las amer', 'Urbanizacion playa de las amer', 2700), -(6197, 76, 503, 'San rafael', 'San rafael', 100), -(6198, 76, 503, 'Segovia', 'Segovia', 200), -(6199, 76, 503, 'Sepulveda', 'Sepulveda', 300), -(6200, 76, 504, 'Alcal de Guadara', 'Alcal de Guadara', 100), -(6201, 76, 504, 'Bellavista', 'Bellavista', 200), -(6202, 76, 504, 'Brenes', 'Brenes', 300), -(6203, 76, 504, 'Castilleja de la Cuesta', 'Castilleja de la Cuesta', 400), -(6204, 76, 504, 'Dos Hermanas', 'Dos Hermanas', 500), -(6205, 76, 504, 'Marchena', 'Marchena', 600), -(6206, 76, 504, 'Palmar de troya', 'Palmar de troya', 700), -(6207, 76, 504, 'Peroamigo', 'Peroamigo', 800), -(6208, 76, 504, 'Sevilla', 'Sevilla', 900), -(6209, 76, 505, 'Soria', 'Soria', 100), -(6210, 76, 506, 'Alcanar', 'Alcanar', 100), -(6211, 76, 506, 'Amposta', 'Amposta', 200), -(6212, 76, 506, 'Calafell', 'Calafell', 300), -(6213, 76, 506, 'Cambrils', 'Cambrils', 400), -(6214, 76, 506, 'El Perell', 'El Perell', 500), -(6215, 76, 506, 'El Vendrell', 'El Vendrell', 600), -(6216, 76, 506, 'Jesus i maria', 'Jesus i maria', 700), -(6217, 76, 506, 'L''Aldea', 'L''Aldea', 800), -(6218, 76, 506, 'L''Ametlla de Mar', 'L''Ametlla de Mar', 900), -(6219, 76, 506, 'L''Ampolla', 'L''Ampolla', 1000), -(6220, 76, 506, 'Les Cases d''Alcanar', 'Les Cases d''Alcanar', 1100), -(6221, 76, 506, 'Montblanc', 'Montblanc', 1200), -(6222, 76, 506, 'Pobla de montornes la', 'Pobla de montornes la', 1300), -(6223, 76, 506, 'Reus', 'Reus', 1400), -(6224, 76, 506, 'Riba-roja d''Ebre', 'Riba-roja d''Ebre', 1500), -(6225, 76, 506, 'Roquetes', 'Roquetes', 1600), -(6226, 76, 506, 'Salou', 'Salou', 1700), -(6227, 76, 506, 'Sant Carles de la Rpita', 'Sant Carles de la Rpita', 1800), -(6228, 76, 506, 'Tarragona', 'Tarragona', 1900), -(6229, 76, 506, 'Tivissa', 'Tivissa', 2000), -(6230, 76, 506, 'Torredembarra', 'Torredembarra', 2100), -(6231, 76, 506, 'Torreforta', 'Torreforta', 2200), -(6232, 76, 506, 'Tortosa', 'Tortosa', 2300), -(6233, 76, 506, 'Ulldecona', 'Ulldecona', 2400), -(6234, 76, 506, 'Valls', 'Valls', 2500), -(6235, 76, 506, 'Vilaseca', 'Vilaseca', 2600), -(6236, 76, 507, 'Alba', 'Alba', 100), -(6237, 76, 507, 'Alcaiz', 'Alcaiz', 200), -(6238, 76, 507, 'Teruel', 'Teruel', 300), -(6239, 76, 508, 'Alcaudete de la jara', 'Alcaudete de la jara', 100), -(6240, 76, 508, 'Chozas de canales', 'Chozas de canales', 200), -(6241, 76, 508, 'Cobeja', 'Cobeja', 300), -(6242, 76, 508, 'Tembleque', 'Tembleque', 400), -(6243, 76, 508, 'Toledo', 'Toledo', 500), -(6244, 76, 508, 'Urda', 'Urda', 600), -(6245, 76, 509, 'Laguna de Duero', 'Laguna de Duero', 100), -(6246, 76, 509, 'Medina del Campo', 'Medina del Campo', 200), -(6247, 76, 509, 'Olmedo', 'Olmedo', 300), -(6248, 76, 509, 'Santa eufemia del arroyo', 'Santa eufemia del arroyo', 400), -(6249, 76, 509, 'Valladolid', 'Valladolid', 500), -(6250, 76, 509, 'Wamba', 'Wamba', 600), -(6251, 76, 510, 'Alaqus', 'Alaqus', 100), -(6252, 76, 510, 'Albaida', 'Albaida', 200), -(6253, 76, 510, 'Alboraya', 'Alboraya', 300), -(6254, 76, 510, 'Alcsser', 'Alcsser', 400), -(6255, 76, 510, 'Algemes', 'Algemes', 500), -(6256, 76, 510, 'Alginet', 'Alginet', 600), -(6257, 76, 510, 'Alzira', 'Alzira', 700), -(6258, 76, 510, 'Anna', 'Anna', 800), -(6259, 76, 510, 'Canals', 'Canals', 900), -(6260, 76, 510, 'Casas del rio', 'Casas del rio', 1000), -(6261, 76, 510, 'Catarroja', 'Catarroja', 1100), -(6262, 76, 510, 'Cullera', 'Cullera', 1200), -(6263, 76, 510, 'Gandia', 'Gandia', 1300), -(6264, 76, 510, 'Guardamar', 'Guardamar', 1400), -(6265, 76, 510, 'L''Eliana', 'L''Eliana', 1500), -(6266, 76, 510, 'Mislata', 'Mislata', 1600), -(6267, 76, 510, 'Moncada', 'Moncada', 1700), -(6268, 76, 510, 'Ontinyent', 'Ontinyent', 1800), -(6269, 76, 510, 'Poliny de Xquer', 'Poliny de Xquer', 1900), -(6270, 76, 510, 'Puol', 'Puol', 2000), -(6271, 76, 510, 'Sagunto', 'Sagunto', 2100), -(6272, 76, 510, 'Sueca', 'Sueca', 2200), -(6273, 76, 510, 'Tavernes de la Valldigna', 'Tavernes de la Valldigna', 2300), -(6274, 76, 510, 'Torrebaja', 'Torrebaja', 2400), -(6275, 76, 510, 'Torrent', 'Torrent', 2500), -(6276, 76, 510, 'Valencia', 'Valencia', 2600), -(6277, 76, 510, 'Xtiva', 'Xtiva', 2700), -(6278, 76, 511, 'El Tiemblo', 'El Tiemblo', 100), -(6279, 76, 511, 'vila', 'vila', 200), -(6280, 76, 512, 'Amorebieta-Etxano', 'Amorebieta-Etxano', 100), -(6281, 76, 512, 'Arenas las', 'Arenas las', 200), -(6282, 76, 512, 'Barakaldo', 'Barakaldo', 300), -(6283, 76, 512, 'Basauri', 'Basauri', 400), -(6284, 76, 512, 'Bilbao', 'Bilbao', 500), -(6285, 76, 512, 'Durango', 'Durango', 600), -(6286, 76, 512, 'Ermua', 'Ermua', 700), -(6287, 76, 512, 'Gernika-Lumo', 'Gernika-Lumo', 800), -(6288, 76, 512, 'Markina-Xemein', 'Markina-Xemein', 900), -(6289, 76, 512, 'Portugalete', 'Portugalete', 1000), -(6290, 76, 512, 'Santurtzi', 'Santurtzi', 1100), -(6291, 76, 512, 'Sopelana', 'Sopelana', 1200), -(6292, 76, 513, 'Zamora', 'Zamora', 100), -(6293, 76, 514, 'Abanto', 'Abanto', 100), -(6294, 76, 514, 'Alagn', 'Alagn', 200), -(6295, 76, 514, 'Alera', 'Alera', 300), -(6296, 76, 514, 'Alfamn', 'Alfamn', 400), -(6297, 76, 514, 'Calatayud', 'Calatayud', 500), -(6298, 76, 514, 'Ejea de los Caballeros', 'Ejea de los Caballeros', 600), -(6299, 76, 514, 'El Burgo de Ebro', 'El Burgo de Ebro', 700), -(6300, 76, 514, 'Figueruelas', 'Figueruelas', 800), -(6301, 76, 514, 'Pedrola (1)', 'Pedrola (1)', 900), -(6302, 76, 514, 'San Mateo de Gllego', 'San Mateo de Gllego', 1000), -(6303, 76, 514, 'Tarazona', 'Tarazona', 1100), -(6304, 76, 514, 'Zaragoza', 'Zaragoza', 1200), -(6305, 77, 515, 'Altino', 'Altino', 100), -(6306, 77, 515, 'Archi', 'Archi', 200), -(6307, 77, 515, 'Ari', 'Ari', 300), -(6308, 77, 515, 'Atessa', 'Atessa', 400), -(6309, 77, 515, 'Borrello', 'Borrello', 500), -(6310, 77, 515, 'Casalincontrada', 'Casalincontrada', 600), -(6311, 77, 515, 'Casoli', 'Casoli', 700), -(6312, 77, 515, 'Chieti', 'Chieti', 800), -(6313, 77, 515, 'Lanciano', 'Lanciano', 900), -(6314, 77, 515, 'Rosello', 'Rosello', 1000), -(6315, 77, 515, 'San Buono', 'San Buono', 1100), -(6316, 77, 515, 'San Salvo', 'San Salvo', 1200), -(6317, 77, 515, 'Vasto', 'Vasto', 1300), -(6318, 77, 516, 'Avezzano', 'Avezzano', 100), -(6319, 77, 516, 'Canistro', 'Canistro', 200), -(6320, 77, 516, 'Celano', 'Celano', 300), -(6321, 77, 516, 'L''Aquila', 'L''Aquila', 400), -(6322, 77, 517, 'Abbateggio', 'Abbateggio', 100), -(6323, 77, 517, 'Citt Sant''Angelo', 'Citt Sant''Angelo', 200), -(6324, 77, 517, 'Cugnoli', 'Cugnoli', 300), -(6325, 77, 517, 'Loreto Aprutino', 'Loreto Aprutino', 400), -(6326, 77, 517, 'Montesilvano', 'Montesilvano', 500), -(6327, 77, 517, 'Penne', 'Penne', 600), -(6328, 77, 517, 'Pescara', 'Pescara', 700), -(6329, 77, 517, 'Pianella', 'Pianella', 800), -(6330, 77, 518, 'Alba Adriatica', 'Alba Adriatica', 100), -(6331, 77, 518, 'Ancarano', 'Ancarano', 200), -(6332, 77, 518, 'Bellante', 'Bellante', 300), -(6333, 77, 518, 'Castellalto', 'Castellalto', 400), -(6334, 77, 518, 'Giulianova', 'Giulianova', 500), -(6335, 77, 518, 'Martinsicuro', 'Martinsicuro', 600), -(6336, 77, 518, 'Montefino', 'Montefino', 700), -(6337, 77, 518, 'Nereto', 'Nereto', 800), -(6338, 77, 518, 'Silvi', 'Silvi', 900), -(6339, 77, 518, 'Teramo', 'Teramo', 1000), -(6340, 77, 518, 'Tortoreto', 'Tortoreto', 1100), -(6341, 77, 519, 'Colobraro', 'Colobraro', 100), -(6342, 77, 519, 'Ferrandina', 'Ferrandina', 200), -(6343, 77, 519, 'Matera', 'Matera', 300), -(6344, 77, 519, 'Policoro', 'Policoro', 400), -(6345, 77, 519, 'Salandra', 'Salandra', 500), -(6346, 77, 520, 'Baragiano', 'Baragiano', 100), -(6347, 77, 520, 'Bella', 'Bella', 200), -(6348, 77, 520, 'Calvera', 'Calvera', 300), -(6349, 77, 520, 'Maratea', 'Maratea', 400); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(6350, 77, 520, 'Melfi', 'Melfi', 500), -(6351, 77, 520, 'Potenza', 'Potenza', 600), -(6352, 77, 520, 'Rapolla', 'Rapolla', 700), -(6353, 77, 520, 'Sant''Arcangelo', 'Sant''Arcangelo', 800), -(6354, 77, 520, 'Venosa', 'Venosa', 900), -(6355, 77, 521, 'Amaroni', 'Amaroni', 100), -(6356, 77, 521, 'Catanzaro', 'Catanzaro', 200), -(6357, 77, 521, 'Jacurso', 'Jacurso', 300), -(6358, 77, 521, 'Lamezia Terme', 'Lamezia Terme', 400), -(6359, 77, 521, 'Satriano', 'Satriano', 500), -(6360, 77, 521, 'Soverato', 'Soverato', 600), -(6361, 77, 521, 'Taverna', 'Taverna', 700), -(6362, 77, 522, 'Acquappesa', 'Acquappesa', 100), -(6363, 77, 522, 'Acri', 'Acri', 200), -(6364, 77, 522, 'Amantea', 'Amantea', 300), -(6365, 77, 522, 'Belvedere Marittimo', 'Belvedere Marittimo', 400), -(6366, 77, 522, 'Bocchigliero', 'Bocchigliero', 500), -(6367, 77, 522, 'Cariati', 'Cariati', 600), -(6368, 77, 522, 'Corigliano Calabro', 'Corigliano Calabro', 700), -(6369, 77, 522, 'Cosenza', 'Cosenza', 800), -(6370, 77, 522, 'Crosia', 'Crosia', 900), -(6371, 77, 522, 'Fuscaldo', 'Fuscaldo', 1000), -(6372, 77, 522, 'Rende', 'Rende', 1100), -(6373, 77, 522, 'Rossano', 'Rossano', 1200), -(6374, 77, 522, 'San Lucido', 'San Lucido', 1300), -(6375, 77, 522, 'San Vincenzo La Costa', 'San Vincenzo La Costa', 1400), -(6376, 77, 522, 'Santa Maria del Cedro', 'Santa Maria del Cedro', 1500), -(6377, 77, 522, 'Scalea', 'Scalea', 1600), -(6378, 77, 522, 'Tortora', 'Tortora', 1700), -(6379, 77, 523, 'Crotone', 'Crotone', 100), -(6380, 77, 523, 'Crucoli', 'Crucoli', 200), -(6381, 77, 523, 'Isola di Capo Rizzuto', 'Isola di Capo Rizzuto', 300), -(6382, 77, 523, 'Melissa', 'Melissa', 400), -(6383, 77, 524, 'Bianco', 'Bianco', 100), -(6384, 77, 524, 'Calanna', 'Calanna', 200), -(6385, 77, 524, 'Caulonia', 'Caulonia', 300), -(6386, 77, 524, 'Gioia Tauro', 'Gioia Tauro', 400), -(6387, 77, 524, 'Gioiosa Ionica', 'Gioiosa Ionica', 500), -(6388, 77, 524, 'Monasterace', 'Monasterace', 600), -(6389, 77, 524, 'Reggio di Calabria', 'Reggio di Calabria', 700), -(6390, 77, 524, 'Rizziconi', 'Rizziconi', 800), -(6391, 77, 524, 'Roccella Ionica', 'Roccella Ionica', 900), -(6392, 77, 524, 'Rosarno', 'Rosarno', 1000), -(6393, 77, 524, 'Siderno', 'Siderno', 1100), -(6394, 77, 525, 'Das', 'Das', 100), -(6395, 77, 525, 'Fabrizia', 'Fabrizia', 200), -(6396, 77, 525, 'Pizzo', 'Pizzo', 300), -(6397, 77, 525, 'Soriano Calabro', 'Soriano Calabro', 400), -(6398, 77, 525, 'Vibo Valentia', 'Vibo Valentia', 500), -(6399, 77, 526, 'Altavilla Irpina', 'Altavilla Irpina', 100), -(6400, 77, 526, 'Avella', 'Avella', 200), -(6401, 77, 526, 'Avellino', 'Avellino', 300), -(6402, 77, 526, 'Calabritto', 'Calabritto', 400), -(6403, 77, 526, 'Fontanarosa', 'Fontanarosa', 500), -(6404, 77, 526, 'Forino', 'Forino', 600), -(6405, 77, 526, 'Frigento', 'Frigento', 700), -(6406, 77, 526, 'Gesualdo', 'Gesualdo', 800), -(6407, 77, 526, 'Lauro', 'Lauro', 900), -(6408, 77, 526, 'Mercogliano', 'Mercogliano', 1000), -(6409, 77, 526, 'Mirabella Eclano', 'Mirabella Eclano', 1100), -(6410, 77, 526, 'San Michele di Serino', 'San Michele di Serino', 1200), -(6411, 77, 527, 'Amorosi', 'Amorosi', 100), -(6412, 77, 527, 'Apice', 'Apice', 200), -(6413, 77, 527, 'Benevento', 'Benevento', 300), -(6414, 77, 527, 'Calvi', 'Calvi', 400), -(6415, 77, 527, 'Faicchio', 'Faicchio', 500), -(6416, 77, 527, 'San Giorgio La Molara', 'San Giorgio La Molara', 600), -(6417, 77, 528, 'Aversa', 'Aversa', 100), -(6418, 77, 528, 'Calvi Risorta', 'Calvi Risorta', 200), -(6419, 77, 528, 'Capua', 'Capua', 300), -(6420, 77, 528, 'Casal di Principe', 'Casal di Principe', 400), -(6421, 77, 528, 'Casapesenna', 'Casapesenna', 500), -(6422, 77, 528, 'Caserta', 'Caserta', 600), -(6423, 77, 528, 'Castel Volturno', 'Castel Volturno', 700), -(6424, 77, 528, 'Cellole', 'Cellole', 800), -(6425, 77, 528, 'Maddaloni', 'Maddaloni', 900), -(6426, 77, 528, 'Mondragone', 'Mondragone', 1000), -(6427, 77, 528, 'San Gregorio Matese', 'San Gregorio Matese', 1100), -(6428, 77, 528, 'San Marcellino', 'San Marcellino', 1200), -(6429, 77, 528, 'Sant''Arpino', 'Sant''Arpino', 1300), -(6430, 77, 528, 'Santa Maria Capua Vetere', 'Santa Maria Capua Vetere', 1400), -(6431, 77, 529, 'Acerra', 'Acerra', 100), -(6432, 77, 529, 'Afragola', 'Afragola', 200), -(6433, 77, 529, 'Bacoli', 'Bacoli', 300), -(6434, 77, 529, 'Boscoreale', 'Boscoreale', 400), -(6435, 77, 529, 'Brusciano', 'Brusciano', 500), -(6436, 77, 529, 'Caivano', 'Caivano', 600), -(6437, 77, 529, 'Camposano', 'Camposano', 700), -(6438, 77, 529, 'Capri', 'Capri', 800), -(6439, 77, 529, 'Casalnuovo di Napoli', 'Casalnuovo di Napoli', 900), -(6440, 77, 529, 'Casola di Napoli', 'Casola di Napoli', 1000), -(6441, 77, 529, 'Castellammare di Stabia', 'Castellammare di Stabia', 1100), -(6442, 77, 529, 'Forio', 'Forio', 1200), -(6443, 77, 529, 'Ischia', 'Ischia', 1300), -(6444, 77, 529, 'Marano di Napoli', 'Marano di Napoli', 1400), -(6445, 77, 529, 'Marigliano', 'Marigliano', 1500), -(6446, 77, 529, 'Meta', 'Meta', 1600), -(6447, 77, 529, 'Monte di Procida', 'Monte di Procida', 1700), -(6448, 77, 529, 'Mugnano di Napoli', 'Mugnano di Napoli', 1800), -(6449, 77, 529, 'Napoli', 'Napoli', 1900), -(6450, 77, 529, 'Nola', 'Nola', 2000), -(6451, 77, 529, 'Ottaviano', 'Ottaviano', 2100), -(6452, 77, 529, 'Palma Campania', 'Palma Campania', 2200), -(6453, 77, 529, 'Poggiomarino', 'Poggiomarino', 2300), -(6454, 77, 529, 'Pompei', 'Pompei', 2400), -(6455, 77, 529, 'Pozzuoli', 'Pozzuoli', 2500), -(6456, 77, 529, 'San Gennaro Vesuviano', 'San Gennaro Vesuviano', 2600), -(6457, 77, 529, 'San Giuseppe Vesuviano', 'San Giuseppe Vesuviano', 2700), -(6458, 77, 529, 'Sant''Antonio Abate', 'Sant''Antonio Abate', 2800), -(6459, 77, 529, 'Santa Maria la Carit', 'Santa Maria la Carit', 2900), -(6460, 77, 529, 'Saviano', 'Saviano', 3000), -(6461, 77, 529, 'Somma Vesuviana', 'Somma Vesuviana', 3100), -(6462, 77, 529, 'Sorrento', 'Sorrento', 3200), -(6463, 77, 529, 'Torre del Greco', 'Torre del Greco', 3300), -(6464, 77, 529, 'Vico Equense', 'Vico Equense', 3400), -(6465, 77, 530, 'Agropoli', 'Agropoli', 100), -(6466, 77, 530, 'Amalfi', 'Amalfi', 200), -(6467, 77, 530, 'Angri', 'Angri', 300), -(6468, 77, 530, 'Atrani', 'Atrani', 400), -(6469, 77, 530, 'Battipaglia', 'Battipaglia', 500), -(6470, 77, 530, 'Bellizzi', 'Bellizzi', 600), -(6471, 77, 530, 'Casal Velino', 'Casal Velino', 700), -(6472, 77, 530, 'Castel San Giorgio', 'Castel San Giorgio', 800), -(6473, 77, 530, 'Cava de'' Tirreni', 'Cava de'' Tirreni', 900), -(6474, 77, 530, 'Eboli', 'Eboli', 1000), -(6475, 77, 530, 'Felitto', 'Felitto', 1100), -(6476, 77, 530, 'Mercato San Severino', 'Mercato San Severino', 1200), -(6477, 77, 530, 'Nocera Inferiore', 'Nocera Inferiore', 1300), -(6478, 77, 530, 'Palomonte', 'Palomonte', 1400), -(6479, 77, 530, 'Positano', 'Positano', 1500), -(6480, 77, 530, 'Salento', 'Salento', 1600), -(6481, 77, 530, 'Salerno', 'Salerno', 1700), -(6482, 77, 530, 'San Valentino Torio', 'San Valentino Torio', 1800), -(6483, 77, 530, 'Sant''Egidio del Monte Albino', 'Sant''Egidio del Monte Albino', 1900), -(6484, 77, 530, 'Sapri', 'Sapri', 2000), -(6485, 77, 530, 'Sarno', 'Sarno', 2100), -(6486, 77, 530, 'Scafati', 'Scafati', 2200), -(6487, 77, 530, 'Stella Cilento', 'Stella Cilento', 2300), -(6488, 77, 530, 'Teggiano', 'Teggiano', 2400), -(6489, 77, 531, 'Bologna', 'Bologna', 100), -(6490, 77, 531, 'Borgo Tossignano', 'Borgo Tossignano', 200), -(6491, 77, 531, 'Casalecchio di Reno', 'Casalecchio di Reno', 300), -(6492, 77, 531, 'Castel Maggiore', 'Castel Maggiore', 400), -(6493, 77, 531, 'Castel San Pietro Terme', 'Castel San Pietro Terme', 500), -(6494, 77, 531, 'Castello d''Argile', 'Castello d''Argile', 600), -(6495, 77, 531, 'Castello di Serravalle', 'Castello di Serravalle', 700), -(6496, 77, 531, 'Imola', 'Imola', 800), -(6497, 77, 531, 'San Giovanni in Persiceto', 'San Giovanni in Persiceto', 900), -(6498, 77, 531, 'Vergato', 'Vergato', 1000), -(6499, 77, 531, 'Zola Predosa', 'Zola Predosa', 1100), -(6500, 77, 532, 'Bondeno', 'Bondeno', 100), -(6501, 77, 532, 'Cento', 'Cento', 200), -(6502, 77, 532, 'Codigoro', 'Codigoro', 300), -(6503, 77, 532, 'Ferrara', 'Ferrara', 400), -(6504, 77, 532, 'Ro', 'Ro', 500), -(6505, 77, 532, 'Voghiera', 'Voghiera', 600), -(6506, 77, 533, 'Bagno di Romagna', 'Bagno di Romagna', 100), -(6507, 77, 533, 'Borghi', 'Borghi', 200), -(6508, 77, 533, 'Cesena', 'Cesena', 300), -(6509, 77, 533, 'Cesenatico', 'Cesenatico', 400), -(6510, 77, 533, 'Forl', 'Forl', 500), -(6511, 77, 533, 'Forlimpopoli', 'Forlimpopoli', 600), -(6512, 77, 533, 'Predappio', 'Predappio', 700), -(6513, 77, 533, 'Sarsina', 'Sarsina', 800), -(6514, 77, 533, 'Savignano sul Rubicone', 'Savignano sul Rubicone', 900), -(6515, 77, 534, 'Carpi', 'Carpi', 100), -(6516, 77, 534, 'Castelvetro di Modena', 'Castelvetro di Modena', 200), -(6517, 77, 534, 'Fiorano Modenese', 'Fiorano Modenese', 300), -(6518, 77, 534, 'Maranello', 'Maranello', 400), -(6519, 77, 534, 'Mirandola', 'Mirandola', 500), -(6520, 77, 534, 'Modena', 'Modena', 600), -(6521, 77, 534, 'Montefiorino', 'Montefiorino', 700), -(6522, 77, 534, 'Pavullo nel Frignano', 'Pavullo nel Frignano', 800), -(6523, 77, 534, 'Polinago', 'Polinago', 900), -(6524, 77, 534, 'Ravarino', 'Ravarino', 1000), -(6525, 77, 534, 'Sassuolo', 'Sassuolo', 1100), -(6526, 77, 534, 'Soliera', 'Soliera', 1200), -(6527, 77, 534, 'Vignola', 'Vignola', 1300), -(6528, 77, 535, 'Albareto', 'Albareto', 100), -(6529, 77, 535, 'Collecchio', 'Collecchio', 200), -(6530, 77, 535, 'Colorno', 'Colorno', 300), -(6531, 77, 535, 'Fidenza', 'Fidenza', 400), -(6532, 77, 535, 'Fontevivo', 'Fontevivo', 500), -(6533, 77, 535, 'Fornovo di Taro', 'Fornovo di Taro', 600), -(6534, 77, 535, 'Parma', 'Parma', 700), -(6535, 77, 535, 'Salsomaggiore Terme', 'Salsomaggiore Terme', 800), -(6536, 77, 536, 'Alseno', 'Alseno', 100), -(6537, 77, 536, 'Besenzone', 'Besenzone', 200), -(6538, 77, 536, 'Farini', 'Farini', 300), -(6539, 77, 536, 'Lugagnano Val d''Arda', 'Lugagnano Val d''Arda', 400), -(6540, 77, 536, 'Piacenza', 'Piacenza', 500), -(6541, 77, 536, 'Sarmato', 'Sarmato', 600), -(6542, 77, 537, 'Alfonsine', 'Alfonsine', 100), -(6543, 77, 537, 'Cervia', 'Cervia', 200), -(6544, 77, 537, 'Conselice', 'Conselice', 300), -(6545, 77, 537, 'Faenza', 'Faenza', 400), -(6546, 77, 537, 'Lugo', 'Lugo', 500), -(6547, 77, 537, 'Massa Lombarda', 'Massa Lombarda', 600), -(6548, 77, 537, 'Ravenna', 'Ravenna', 700), -(6549, 77, 537, 'Russi', 'Russi', 800), -(6550, 77, 538, 'Albinea', 'Albinea', 100), -(6551, 77, 538, 'Brescello', 'Brescello', 200), -(6552, 77, 538, 'Cavriago', 'Cavriago', 300), -(6553, 77, 538, 'Correggio', 'Correggio', 400), -(6554, 77, 538, 'Fabbrico', 'Fabbrico', 500), -(6555, 77, 538, 'Guastalla', 'Guastalla', 600), -(6556, 77, 538, 'Reggio nell''Emilia', 'Reggio nell''Emilia', 700), -(6557, 77, 538, 'San Martino in Rio', 'San Martino in Rio', 800), -(6558, 77, 538, 'Viano', 'Viano', 900), -(6559, 77, 539, 'Bellaria-Igea Marina', 'Bellaria-Igea Marina', 100), -(6560, 77, 539, 'Cattolica', 'Cattolica', 200), -(6561, 77, 539, 'Mondaino', 'Mondaino', 300), -(6562, 77, 539, 'Morciano di Romagna', 'Morciano di Romagna', 400), -(6563, 77, 539, 'Riccione', 'Riccione', 500), -(6564, 77, 539, 'Rimini', 'Rimini', 600), -(6565, 77, 539, 'Santarcangelo di Romagna', 'Santarcangelo di Romagna', 700), -(6566, 77, 540, 'Farra d''Isonzo', 'Farra d''Isonzo', 100), -(6567, 77, 540, 'Gorizia', 'Gorizia', 200), -(6568, 77, 540, 'Gradisca d''Isonzo', 'Gradisca d''Isonzo', 300), -(6569, 77, 540, 'Grado', 'Grado', 400), -(6570, 77, 540, 'Monfalcone', 'Monfalcone', 500), -(6571, 77, 540, 'Ronchi dei Legionari', 'Ronchi dei Legionari', 600), -(6572, 77, 540, 'San Lorenzo Isontino', 'San Lorenzo Isontino', 700), -(6573, 77, 541, 'Aviano', 'Aviano', 100), -(6574, 77, 541, 'Azzano Decimo', 'Azzano Decimo', 200), -(6575, 77, 541, 'Montereale Valcellina', 'Montereale Valcellina', 300), -(6576, 77, 541, 'Porcia', 'Porcia', 400), -(6577, 77, 541, 'Pordenone', 'Pordenone', 500), -(6578, 77, 541, 'Pravisdomini', 'Pravisdomini', 600), -(6579, 77, 541, 'Sacile', 'Sacile', 700), -(6580, 77, 541, 'San Vito al Tagliamento', 'San Vito al Tagliamento', 800), -(6581, 77, 541, 'Spilimbergo', 'Spilimbergo', 900), -(6582, 77, 541, 'Travesio', 'Travesio', 1000), -(6583, 77, 541, 'Zoppola', 'Zoppola', 1100), -(6584, 77, 542, 'Duino-Aurisina', 'Duino-Aurisina', 100), -(6585, 77, 542, 'Trieste', 'Trieste', 200), -(6586, 77, 543, 'Aquileia', 'Aquileia', 100), -(6587, 77, 543, 'Latisana', 'Latisana', 200), -(6588, 77, 543, 'Paularo', 'Paularo', 300), -(6589, 77, 543, 'Pavia di Udine', 'Pavia di Udine', 400), -(6590, 77, 543, 'Pozzuolo del Friuli', 'Pozzuolo del Friuli', 500), -(6591, 77, 543, 'San Daniele del Friuli', 'San Daniele del Friuli', 600), -(6592, 77, 543, 'San Giovanni al Natisone', 'San Giovanni al Natisone', 700), -(6593, 77, 543, 'Tolmezzo', 'Tolmezzo', 800), -(6594, 77, 543, 'Treppo Grande', 'Treppo Grande', 900), -(6595, 77, 543, 'Udine', 'Udine', 1000), -(6596, 77, 544, 'Cassino', 'Cassino', 100), -(6597, 77, 544, 'Frosinone', 'Frosinone', 200), -(6598, 77, 544, 'Sant''Elia Fiumerapido', 'Sant''Elia Fiumerapido', 300), -(6599, 77, 544, 'Sora', 'Sora', 400), -(6600, 77, 545, 'Cisterna di Latina', 'Cisterna di Latina', 100), -(6601, 77, 545, 'Fondi', 'Fondi', 200), -(6602, 77, 545, 'Formia', 'Formia', 300), -(6603, 77, 545, 'Gaeta', 'Gaeta', 400), -(6604, 77, 545, 'Latina', 'Latina', 500), -(6605, 77, 545, 'Maenza', 'Maenza', 600), -(6606, 77, 545, 'Minturno', 'Minturno', 700), -(6607, 77, 545, 'Ponza', 'Ponza', 800), -(6608, 77, 546, 'Frasso Sabino', 'Frasso Sabino', 100), -(6609, 77, 546, 'Rieti', 'Rieti', 200), -(6610, 77, 547, 'Affile', 'Affile', 100), -(6611, 77, 547, 'Allumiere', 'Allumiere', 200), -(6612, 77, 547, 'Anzio', 'Anzio', 300), -(6613, 77, 547, 'Ardea', 'Ardea', 400), -(6614, 77, 547, 'Ariccia', 'Ariccia', 500), -(6615, 77, 547, 'Arsoli', 'Arsoli', 600), -(6616, 77, 547, 'Bracciano', 'Bracciano', 700), -(6617, 77, 547, 'Casape', 'Casape', 800), -(6618, 77, 547, 'Castel Gandolfo', 'Castel Gandolfo', 900), -(6619, 77, 547, 'Castel San Pietro Romano', 'Castel San Pietro Romano', 1000), -(6620, 77, 547, 'Cervara di Roma', 'Cervara di Roma', 1100), -(6621, 77, 547, 'Ciampino', 'Ciampino', 1200), -(6622, 77, 547, 'Cineto Romano', 'Cineto Romano', 1300), -(6623, 77, 547, 'Civitavecchia', 'Civitavecchia', 1400), -(6624, 77, 547, 'Colleferro', 'Colleferro', 1500), -(6625, 77, 547, 'Colonna', 'Colonna', 1600), -(6626, 77, 547, 'Fiumicino', 'Fiumicino', 1700), -(6627, 77, 547, 'Gallicano nel Lazio', 'Gallicano nel Lazio', 1800), -(6628, 77, 547, 'Genzano di Roma', 'Genzano di Roma', 1900), -(6629, 77, 547, 'Grottaferrata', 'Grottaferrata', 2000), -(6630, 77, 547, 'Licenza', 'Licenza', 2100), -(6631, 77, 547, 'Marino', 'Marino', 2200), -(6632, 77, 547, 'Monte Porzio Catone', 'Monte Porzio Catone', 2300), -(6633, 77, 547, 'Poli', 'Poli', 2400), -(6634, 77, 547, 'Pomezia', 'Pomezia', 2500), -(6635, 77, 547, 'Ponzano Romano', 'Ponzano Romano', 2600), -(6636, 77, 547, 'Roma', 'Roma', 2700), -(6637, 77, 547, 'Roviano', 'Roviano', 2800), -(6638, 77, 547, 'Santa Marinella', 'Santa Marinella', 2900), -(6639, 77, 547, 'Tivoli', 'Tivoli', 3000), -(6640, 77, 547, 'Velletri', 'Velletri', 3100), -(6641, 77, 547, 'Zagarolo', 'Zagarolo', 3200), -(6642, 77, 548, 'Acquapendente', 'Acquapendente', 100), -(6643, 77, 548, 'Bagnoregio', 'Bagnoregio', 200), -(6644, 77, 548, 'Montefiascone', 'Montefiascone', 300), -(6645, 77, 548, 'Soriano nel Cimino', 'Soriano nel Cimino', 400), -(6646, 77, 548, 'Vetralla', 'Vetralla', 500), -(6647, 77, 548, 'Viterbo', 'Viterbo', 600), -(6648, 77, 549, 'Arenzano', 'Arenzano', 100), -(6649, 77, 549, 'Casella', 'Casella', 200), -(6650, 77, 549, 'Chiavari', 'Chiavari', 300), -(6651, 77, 549, 'Genova', 'Genova', 400), -(6652, 77, 549, 'Portofino', 'Portofino', 500), -(6653, 77, 549, 'Rapallo', 'Rapallo', 600), -(6654, 77, 549, 'Santa Margherita Ligure', 'Santa Margherita Ligure', 700), -(6655, 77, 549, 'Sori', 'Sori', 800), -(6656, 77, 550, 'Bordighera', 'Bordighera', 100), -(6657, 77, 550, 'Ceriana', 'Ceriana', 200), -(6658, 77, 550, 'Diano Marina', 'Diano Marina', 300), -(6659, 77, 550, 'Imperia', 'Imperia', 400), -(6660, 77, 550, 'Pieve di Teco', 'Pieve di Teco', 500), -(6661, 77, 550, 'San Remo', 'San Remo', 600), -(6662, 77, 550, 'Vallecrosia', 'Vallecrosia', 700), -(6663, 77, 550, 'Ventimiglia', 'Ventimiglia', 800), -(6664, 77, 551, 'Bolano', 'Bolano', 100), -(6665, 77, 551, 'La Spezia', 'La Spezia', 200), -(6666, 77, 551, 'Sarzana', 'Sarzana', 300), -(6667, 77, 552, 'Alassio', 'Alassio', 100), -(6668, 77, 552, 'Albenga', 'Albenga', 200), -(6669, 77, 552, 'Cairo Montenotte', 'Cairo Montenotte', 300), -(6670, 77, 552, 'Cengio', 'Cengio', 400), -(6671, 77, 552, 'Finale Ligure', 'Finale Ligure', 500), -(6672, 77, 552, 'Loano', 'Loano', 600), -(6673, 77, 552, 'Savona', 'Savona', 700), -(6674, 77, 553, 'Albino', 'Albino', 100), -(6675, 77, 553, 'Arcene', 'Arcene', 200), -(6676, 77, 553, 'Bergamo', 'Bergamo', 300), -(6677, 77, 553, 'Calcinate', 'Calcinate', 400), -(6678, 77, 553, 'Caravaggio', 'Caravaggio', 500), -(6679, 77, 553, 'Carona', 'Carona', 600), -(6680, 77, 553, 'Chignolo d''Isola', 'Chignolo d''Isola', 700), -(6681, 77, 553, 'Clusone', 'Clusone', 800), -(6682, 77, 553, 'Lovere', 'Lovere', 900), -(6683, 77, 553, 'Treviglio', 'Treviglio', 1000), -(6684, 77, 553, 'Villongo', 'Villongo', 1100), -(6685, 77, 554, 'Berlingo', 'Berlingo', 100), -(6686, 77, 554, 'Brescia', 'Brescia', 200), -(6687, 77, 554, 'Darfo Boario Terme', 'Darfo Boario Terme', 300), -(6688, 77, 554, 'Desenzano del Garda', 'Desenzano del Garda', 400), -(6689, 77, 554, 'Gargnano', 'Gargnano', 500), -(6690, 77, 554, 'Gavardo', 'Gavardo', 600), -(6691, 77, 554, 'Gussago', 'Gussago', 700), -(6692, 77, 554, 'Iseo', 'Iseo', 800), -(6693, 77, 554, 'Limone sul Garda', 'Limone sul Garda', 900), -(6694, 77, 554, 'Lonato', 'Lonato', 1000), -(6695, 77, 554, 'Lumezzane', 'Lumezzane', 1100), -(6696, 77, 554, 'Manerbio', 'Manerbio', 1200), -(6697, 77, 554, 'Moniga del Garda', 'Moniga del Garda', 1300), -(6698, 77, 554, 'Montichiari', 'Montichiari', 1400), -(6699, 77, 554, 'Orzinuovi', 'Orzinuovi', 1500), -(6700, 77, 554, 'Orzivecchi', 'Orzivecchi', 1600), -(6701, 77, 554, 'Padenghe sul Garda', 'Padenghe sul Garda', 1700), -(6702, 77, 554, 'Palazzolo sull''Oglio', 'Palazzolo sull''Oglio', 1800), -(6703, 77, 554, 'Piancogno', 'Piancogno', 1900), -(6704, 77, 554, 'Ro Volciano', 'Ro Volciano', 2000), -(6705, 77, 554, 'Rovato', 'Rovato', 2100), -(6706, 77, 554, 'Sal', 'Sal', 2200), -(6707, 77, 554, 'Sarezzo', 'Sarezzo', 2300), -(6708, 77, 554, 'Sirmione', 'Sirmione', 2400), -(6709, 77, 554, 'Toscolano-Maderno', 'Toscolano-Maderno', 2500), -(6710, 77, 555, 'Casnate con Bernate', 'Casnate con Bernate', 100), -(6711, 77, 555, 'Como', 'Como', 200), -(6712, 77, 555, 'Consiglio di Rumo', 'Consiglio di Rumo', 300), -(6713, 77, 555, 'Lomazzo', 'Lomazzo', 400), -(6714, 77, 555, 'Magreglio', 'Magreglio', 500), -(6715, 77, 555, 'Nesso', 'Nesso', 600), -(6716, 77, 556, 'Casalmaggiore', 'Casalmaggiore', 100), -(6717, 77, 556, 'Crema', 'Crema', 200), -(6718, 77, 556, 'Cremona', 'Cremona', 300), -(6719, 77, 557, 'Calolziocorte', 'Calolziocorte', 100), -(6720, 77, 557, 'Lecco', 'Lecco', 200), -(6721, 77, 557, 'Valmadrera', 'Valmadrera', 300), -(6722, 77, 558, 'Castiraga Vidardo', 'Castiraga Vidardo', 100), -(6723, 77, 558, 'Graffignana', 'Graffignana', 200), -(6724, 77, 558, 'Lodi', 'Lodi', 300), -(6725, 77, 559, 'Asola', 'Asola', 100), -(6726, 77, 559, 'Borgoforte', 'Borgoforte', 200), -(6727, 77, 559, 'Canneto sull''Oglio', 'Canneto sull''Oglio', 300), -(6728, 77, 559, 'Castiglione delle Stiviere', 'Castiglione delle Stiviere', 400), -(6729, 77, 559, 'Goito', 'Goito', 500), -(6730, 77, 559, 'Mantova', 'Mantova', 600), -(6731, 77, 559, 'Marmirolo', 'Marmirolo', 700), -(6732, 77, 559, 'Poggio Rusco', 'Poggio Rusco', 800), -(6733, 77, 559, 'Quistello', 'Quistello', 900), -(6734, 77, 560, 'Arcore', 'Arcore', 100), -(6735, 77, 560, 'Arese', 'Arese', 200), -(6736, 77, 560, 'Assago', 'Assago', 300), -(6737, 77, 560, 'Bareggio', 'Bareggio', 400), -(6738, 77, 560, 'Biassono', 'Biassono', 500), -(6739, 77, 560, 'Bresso', 'Bresso', 600), -(6740, 77, 560, 'Briosco', 'Briosco', 700), -(6741, 77, 560, 'Cesano Maderno', 'Cesano Maderno', 800), -(6742, 77, 560, 'Cinisello Balsamo', 'Cinisello Balsamo', 900), -(6743, 77, 560, 'Cologno Monzese', 'Cologno Monzese', 1000), -(6744, 77, 560, 'Corbetta', 'Corbetta', 1100), -(6745, 77, 560, 'Corsico', 'Corsico', 1200), -(6746, 77, 560, 'Cusano Milanino', 'Cusano Milanino', 1300), -(6747, 77, 560, 'Desio', 'Desio', 1400), -(6748, 77, 560, 'Lainate', 'Lainate', 1500), -(6749, 77, 560, 'Legnano', 'Legnano', 1600), -(6750, 77, 560, 'Lissone', 'Lissone', 1700), -(6751, 77, 560, 'Locate di Triulzi', 'Locate di Triulzi', 1800), -(6752, 77, 560, 'Macherio', 'Macherio', 1900), -(6753, 77, 560, 'Melzo', 'Melzo', 2000), -(6754, 77, 560, 'Milano', 'Milano', 2100), -(6755, 77, 560, 'Monza', 'Monza', 2200), -(6756, 77, 560, 'Parabiago', 'Parabiago', 2300), -(6757, 77, 560, 'Paullo', 'Paullo', 2400), -(6758, 77, 560, 'Pero', 'Pero', 2500), -(6759, 77, 560, 'Pessano con Bornago', 'Pessano con Bornago', 2600), -(6760, 77, 560, 'Pioltello', 'Pioltello', 2700), -(6761, 77, 560, 'Pregnana Milanese', 'Pregnana Milanese', 2800), -(6762, 77, 560, 'Rho', 'Rho', 2900), -(6763, 77, 560, 'San Donato Milanese', 'San Donato Milanese', 3000), -(6764, 77, 560, 'San Giuliano Milanese', 'San Giuliano Milanese', 3100), -(6765, 77, 560, 'Sesto San Giovanni', 'Sesto San Giovanni', 3200), -(6766, 77, 560, 'Verano Brianza', 'Verano Brianza', 3300), -(6767, 77, 560, 'Vizzolo Predabissi', 'Vizzolo Predabissi', 3400), -(6768, 77, 561, 'Alagna', 'Alagna', 100), -(6769, 77, 561, 'Certosa di Pavia', 'Certosa di Pavia', 200), -(6770, 77, 561, 'Dorno', 'Dorno', 300), -(6771, 77, 561, 'Garlasco', 'Garlasco', 400), -(6772, 77, 561, 'Mortara', 'Mortara', 500), -(6773, 77, 561, 'Pavia', 'Pavia', 600), -(6774, 77, 561, 'Pietra de'' Giorgi', 'Pietra de'' Giorgi', 700), -(6775, 77, 561, 'Portalbera', 'Portalbera', 800), -(6776, 77, 561, 'San Martino Siccomario', 'San Martino Siccomario', 900), -(6777, 77, 561, 'Trivolzio', 'Trivolzio', 1000), -(6778, 77, 561, 'Voghera', 'Voghera', 1100), -(6779, 77, 562, 'Morbegno', 'Morbegno', 100), -(6780, 77, 562, 'Sondrio', 'Sondrio', 200), -(6781, 77, 563, 'Brissago-Valtravaglia', 'Brissago-Valtravaglia', 100), -(6782, 77, 563, 'Brusimpiano', 'Brusimpiano', 200), -(6783, 77, 563, 'Busto Arsizio', 'Busto Arsizio', 300), -(6784, 77, 563, 'Cislago', 'Cislago', 400), -(6785, 77, 563, 'Gallarate', 'Gallarate', 500), -(6786, 77, 563, 'Lavena Ponte Tresa', 'Lavena Ponte Tresa', 600), -(6787, 77, 563, 'Saronno', 'Saronno', 700), -(6788, 77, 563, 'Varese', 'Varese', 800), -(6789, 77, 563, 'Vedano Olona', 'Vedano Olona', 900), -(6790, 77, 564, 'Ancona', 'Ancona', 100), -(6791, 77, 564, 'Castelfidardo', 'Castelfidardo', 200), -(6792, 77, 564, 'Fabriano', 'Fabriano', 300), -(6793, 77, 564, 'Jesi', 'Jesi', 400), -(6794, 77, 564, 'Loreto', 'Loreto', 500), -(6795, 77, 564, 'Monte Roberto', 'Monte Roberto', 600), -(6796, 77, 564, 'Monterado', 'Monterado', 700), -(6797, 77, 564, 'Osimo', 'Osimo', 800), -(6798, 77, 564, 'Ostra', 'Ostra', 900), -(6799, 77, 564, 'Senigallia', 'Senigallia', 1000), -(6800, 77, 565, 'Ascoli Piceno', 'Ascoli Piceno', 100), -(6801, 77, 565, 'Falerone', 'Falerone', 200), -(6802, 77, 565, 'Fermo', 'Fermo', 300), -(6803, 77, 565, 'Montappone', 'Montappone', 400), -(6804, 77, 565, 'Pedaso', 'Pedaso', 500), -(6805, 77, 565, 'Porto San Giorgio', 'Porto San Giorgio', 600), -(6806, 77, 565, 'Porto Sant''Elpidio', 'Porto Sant''Elpidio', 700), -(6807, 77, 565, 'San Benedetto del Tronto', 'San Benedetto del Tronto', 800), -(6808, 77, 565, 'Sant''Elpidio a Mare', 'Sant''Elpidio a Mare', 900), -(6809, 77, 566, 'Castelraimondo', 'Castelraimondo', 100), -(6810, 77, 566, 'Civitanova Marche', 'Civitanova Marche', 200), -(6811, 77, 566, 'Macerata', 'Macerata', 300), -(6812, 77, 566, 'Montecosaro', 'Montecosaro', 400), -(6813, 77, 566, 'Petriolo', 'Petriolo', 500), -(6814, 77, 566, 'San Severino Marche', 'San Severino Marche', 600), -(6815, 77, 567, 'Fano', 'Fano', 100), -(6816, 77, 567, 'Fermignano', 'Fermignano', 200), -(6817, 77, 567, 'Pesaro', 'Pesaro', 300), -(6818, 77, 567, 'Tavoleto', 'Tavoleto', 400), -(6819, 77, 567, 'Urbino', 'Urbino', 500), -(6820, 77, 568, 'Campobasso', 'Campobasso', 100), -(6821, 77, 568, 'Riccia', 'Riccia', 200), -(6822, 77, 568, 'San Massimo', 'San Massimo', 300), -(6823, 77, 568, 'Termoli', 'Termoli', 400), -(6824, 77, 569, 'Civitanova del Sannio', 'Civitanova del Sannio', 100), -(6825, 77, 569, 'Isernia', 'Isernia', 200), -(6826, 77, 570, 'Acqui Terme', 'Acqui Terme', 100), -(6827, 77, 570, 'Alessandria', 'Alessandria', 200), -(6828, 77, 570, 'Balzola', 'Balzola', 300), -(6829, 77, 570, 'Novi Ligure', 'Novi Ligure', 400), -(6830, 77, 570, 'Strevi', 'Strevi', 500), -(6831, 77, 570, 'Tortona', 'Tortona', 600), -(6832, 77, 571, 'Biella', 'Biella', 100), -(6833, 77, 571, 'Mosso', 'Mosso', 200), -(6834, 77, 572, 'Alba', 'Alba', 100), -(6835, 77, 572, 'Bossolasco', 'Bossolasco', 200), -(6836, 77, 572, 'Bra', 'Bra', 300), -(6837, 77, 572, 'Cuneo', 'Cuneo', 400), -(6838, 77, 572, 'Fossano', 'Fossano', 500), -(6839, 77, 572, 'Prazzo', 'Prazzo', 600), -(6840, 77, 572, 'Villanova Mondov', 'Villanova Mondov', 700), -(6841, 77, 573, 'Arona', 'Arona', 100), -(6842, 77, 573, 'Borgomanero', 'Borgomanero', 200), -(6843, 77, 573, 'Invorio', 'Invorio', 300), -(6844, 77, 573, 'Nibbiola', 'Nibbiola', 400), -(6845, 77, 573, 'Novara', 'Novara', 500), -(6846, 77, 573, 'Oleggio', 'Oleggio', 600), -(6847, 77, 574, 'Albiano d''Ivrea', 'Albiano d''Ivrea', 100), -(6848, 77, 574, 'Bollengo', 'Bollengo', 200), -(6849, 77, 574, 'Carmagnola', 'Carmagnola', 300), -(6850, 77, 574, 'Castellamonte', 'Castellamonte', 400), -(6851, 77, 574, 'Chivasso', 'Chivasso', 500), -(6852, 77, 574, 'Ivrea', 'Ivrea', 600), -(6853, 77, 574, 'La Loggia', 'La Loggia', 700), -(6854, 77, 574, 'Macello', 'Macello', 800), -(6855, 77, 574, 'Pianezza', 'Pianezza', 900), -(6856, 77, 574, 'Pinerolo', 'Pinerolo', 1000), -(6857, 77, 574, 'Rivalta di Torino', 'Rivalta di Torino', 1100), -(6858, 77, 574, 'Settimo Torinese', 'Settimo Torinese', 1200), -(6859, 77, 574, 'Torino', 'Torino', 1300), -(6860, 77, 575, 'Domodossola', 'Domodossola', 100), -(6861, 77, 575, 'Gravellona Toce', 'Gravellona Toce', 200), -(6862, 77, 575, 'Stresa', 'Stresa', 300), -(6863, 77, 575, 'Verbania', 'Verbania', 400), -(6864, 77, 576, 'Borgosesia', 'Borgosesia', 100), -(6865, 77, 576, 'Vercelli', 'Vercelli', 200), -(6866, 77, 577, 'Acquaviva delle Fonti', 'Acquaviva delle Fonti', 100), -(6867, 77, 577, 'Altamura', 'Altamura', 200), -(6868, 77, 577, 'Andria', 'Andria', 300), -(6869, 77, 577, 'Bari', 'Bari', 400), -(6870, 77, 577, 'Casamassima', 'Casamassima', 500), -(6871, 77, 577, 'Modugno', 'Modugno', 600), -(6872, 77, 577, 'Valenzano', 'Valenzano', 700), -(6873, 77, 578, 'Brindisi', 'Brindisi', 100), -(6874, 77, 578, 'Ostuni', 'Ostuni', 200), -(6875, 77, 579, 'Apricena', 'Apricena', 100), -(6876, 77, 579, 'Cerignola', 'Cerignola', 200), -(6877, 77, 579, 'Foggia', 'Foggia', 300), -(6878, 77, 579, 'Manfredonia', 'Manfredonia', 400), -(6879, 77, 579, 'San Severo', 'San Severo', 500), -(6880, 77, 579, 'Stornarella', 'Stornarella', 600), -(6881, 77, 579, 'Vieste', 'Vieste', 700), -(6882, 77, 580, 'Gallipoli', 'Gallipoli', 100), -(6883, 77, 580, 'Lecce', 'Lecce', 200), -(6884, 77, 580, 'Muro Leccese', 'Muro Leccese', 300), -(6885, 77, 581, 'Avetrana', 'Avetrana', 100), -(6886, 77, 581, 'Massafra', 'Massafra', 200), -(6887, 77, 581, 'Palagiano', 'Palagiano', 300), -(6888, 77, 581, 'Taranto', 'Taranto', 400), -(6889, 77, 582, 'Cagliari', 'Cagliari', 100), -(6890, 77, 582, 'Collinas', 'Collinas', 200), -(6891, 77, 582, 'Elmas', 'Elmas', 300), -(6892, 77, 582, 'Gonnesa', 'Gonnesa', 400), -(6893, 77, 582, 'Quartu Sant''Elena', 'Quartu Sant''Elena', 500), -(6894, 77, 583, 'Nuoro', 'Nuoro', 100), -(6895, 77, 584, 'Milis', 'Milis', 100), -(6896, 77, 584, 'Oristano', 'Oristano', 200), -(6897, 77, 584, 'Pau', 'Pau', 300), -(6898, 77, 585, 'Olbia', 'Olbia', 100), -(6899, 77, 585, 'Sassari', 'Sassari', 200), -(6900, 77, 585, 'Tempio Pausania', 'Tempio Pausania', 300), -(6901, 77, 586, 'Agrigento', 'Agrigento', 100), -(6902, 77, 586, 'Licata', 'Licata', 200), -(6903, 77, 586, 'Siculiana', 'Siculiana', 300), -(6904, 77, 587, 'Aci Sant''Antonio', 'Aci Sant''Antonio', 100), -(6905, 77, 587, 'Acireale', 'Acireale', 200), -(6906, 77, 587, 'Biancavilla', 'Biancavilla', 300), -(6907, 77, 587, 'Castiglione di Sicilia', 'Castiglione di Sicilia', 400), -(6908, 77, 587, 'Catania', 'Catania', 500), -(6909, 77, 587, 'Giarre', 'Giarre', 600), -(6910, 77, 587, 'Linguaglossa', 'Linguaglossa', 700), -(6911, 77, 587, 'Maletto', 'Maletto', 800), -(6912, 77, 587, 'Mazzarrone', 'Mazzarrone', 900), -(6913, 77, 587, 'Randazzo', 'Randazzo', 1000), -(6914, 77, 587, 'Santa Venerina', 'Santa Venerina', 1100), -(6915, 77, 588, 'Capo d''Orlando', 'Capo d''Orlando', 100), -(6916, 77, 588, 'Capri Leone', 'Capri Leone', 200), -(6917, 77, 588, 'Giardini-Naxos', 'Giardini-Naxos', 300), -(6918, 77, 588, 'Lipari', 'Lipari', 400), -(6919, 77, 588, 'Malfa', 'Malfa', 500), -(6920, 77, 588, 'Messina', 'Messina', 600), -(6921, 77, 588, 'Milazzo', 'Milazzo', 700), -(6922, 77, 588, 'Militello Rosmarino', 'Militello Rosmarino', 800), -(6923, 77, 588, 'Santo Stefano di Camastra', 'Santo Stefano di Camastra', 900), -(6924, 77, 588, 'Taormina', 'Taormina', 1000), -(6925, 77, 589, 'Alimena', 'Alimena', 100), -(6926, 77, 589, 'Altofonte', 'Altofonte', 200), -(6927, 77, 589, 'Blufi', 'Blufi', 300), -(6928, 77, 589, 'Borgetto', 'Borgetto', 400), -(6929, 77, 589, 'Capaci', 'Capaci', 500), -(6930, 77, 589, 'Corleone', 'Corleone', 600), -(6931, 77, 589, 'Palermo', 'Palermo', 700), -(6932, 77, 589, 'Santa Cristina Gela', 'Santa Cristina Gela', 800), -(6933, 77, 589, 'Torretta', 'Torretta', 900), -(6934, 77, 589, 'Ventimiglia di Sicilia', 'Ventimiglia di Sicilia', 1000), -(6935, 77, 590, 'Pozzallo', 'Pozzallo', 100), -(6936, 77, 590, 'Ragusa', 'Ragusa', 200), -(6937, 77, 590, 'Scicli', 'Scicli', 300), -(6938, 77, 590, 'Vittoria', 'Vittoria', 400), -(6939, 77, 591, 'Augusta', 'Augusta', 100), -(6940, 77, 591, 'Pachino', 'Pachino', 200), -(6941, 77, 591, 'Siracusa', 'Siracusa', 300), -(6942, 77, 591, 'Solarino', 'Solarino', 400), -(6943, 77, 592, 'Marsala', 'Marsala', 100), -(6944, 77, 592, 'Trapani', 'Trapani', 200), -(6945, 77, 593, 'Anghiari', 'Anghiari', 100), -(6946, 77, 593, 'Arezzo', 'Arezzo', 200), -(6947, 77, 593, 'Castiglion Fiorentino', 'Castiglion Fiorentino', 300), -(6948, 77, 593, 'Pieve Santo Stefano', 'Pieve Santo Stefano', 400), -(6949, 77, 594, 'Bagno a Ripoli', 'Bagno a Ripoli', 100), -(6950, 77, 594, 'Castelfiorentino', 'Castelfiorentino', 200), -(6951, 77, 594, 'Empoli', 'Empoli', 300), -(6952, 77, 594, 'Fiesole', 'Fiesole', 400), -(6953, 77, 594, 'Figline Valdarno', 'Figline Valdarno', 500), -(6954, 77, 594, 'Firenze', 'Firenze', 600), -(6955, 77, 594, 'Fucecchio', 'Fucecchio', 700), -(6956, 77, 595, 'Castiglione della Pescaia', 'Castiglione della Pescaia', 100), -(6957, 77, 595, 'Follonica', 'Follonica', 200), -(6958, 77, 595, 'Gavorrano', 'Gavorrano', 300), -(6959, 77, 595, 'Grosseto', 'Grosseto', 400), -(6960, 77, 595, 'Roccastrada', 'Roccastrada', 500), -(6961, 77, 596, 'Campo nell''Elba', 'Campo nell''Elba', 100), -(6962, 77, 596, 'Cecina', 'Cecina', 200), -(6963, 77, 596, 'Livorno', 'Livorno', 300), -(6964, 77, 596, 'Marciana', 'Marciana', 400), -(6965, 77, 596, 'Piombino', 'Piombino', 500), -(6966, 77, 596, 'Portoferraio', 'Portoferraio', 600), -(6967, 77, 596, 'Rio nell''Elba', 'Rio nell''Elba', 700), -(6968, 77, 596, 'Rosignano Marittimo', 'Rosignano Marittimo', 800), -(6969, 77, 596, 'San Vincenzo', 'San Vincenzo', 900), -(6970, 77, 597, 'Forte dei Marmi', 'Forte dei Marmi', 100), -(6971, 77, 597, 'Lucca', 'Lucca', 200), -(6972, 77, 597, 'Porcari', 'Porcari', 300), -(6973, 77, 597, 'Viareggio', 'Viareggio', 400), -(6974, 77, 598, 'Carrara', 'Carrara', 100), -(6975, 77, 598, 'Massa', 'Massa', 200), -(6976, 77, 599, 'Buti', 'Buti', 100), -(6977, 77, 599, 'Calcinaia', 'Calcinaia', 200), -(6978, 77, 599, 'Casciana Terme', 'Casciana Terme', 300), -(6979, 77, 599, 'Cascina', 'Cascina', 400), -(6980, 77, 599, 'Guardistallo', 'Guardistallo', 500), -(6981, 77, 599, 'Orciano Pisano', 'Orciano Pisano', 600), -(6982, 77, 599, 'Pisa', 'Pisa', 700), -(6983, 77, 599, 'Pontedera', 'Pontedera', 800), -(6984, 77, 599, 'Santa Croce sull''Arno', 'Santa Croce sull''Arno', 900), -(6985, 77, 599, 'Volterra', 'Volterra', 1000), -(6986, 77, 600, 'Montecatini-Terme', 'Montecatini-Terme', 100), -(6987, 77, 600, 'Pescia', 'Pescia', 200), -(6988, 77, 600, 'Pistoia', 'Pistoia', 300), -(6989, 77, 600, 'Ponte Buggianese', 'Ponte Buggianese', 400), -(6990, 77, 600, 'Quarrata', 'Quarrata', 500), -(6991, 77, 601, 'Prato', 'Prato', 100), -(6992, 77, 602, 'Castellina in Chianti', 'Castellina in Chianti', 100), -(6993, 77, 602, 'Cetona', 'Cetona', 200), -(6994, 77, 602, 'Colle di Val d''Elsa', 'Colle di Val d''Elsa', 300), -(6995, 77, 602, 'Montepulciano', 'Montepulciano', 400), -(6996, 77, 602, 'Monteroni d''Arbia', 'Monteroni d''Arbia', 500), -(6997, 77, 602, 'Pienza', 'Pienza', 600), -(6998, 77, 602, 'Poggibonsi', 'Poggibonsi', 700), -(6999, 77, 602, 'Siena', 'Siena', 800), -(7000, 77, 603, 'Bolzano-Bozen', 'Bolzano-Bozen', 100), -(7001, 77, 603, 'Brennero-Brenner', 'Brennero-Brenner', 200), -(7002, 77, 603, 'Bressanone-Brixen', 'Bressanone-Brixen', 300), -(7003, 77, 603, 'Brunico-Bruneck', 'Brunico-Bruneck', 400), -(7004, 77, 603, 'Dobbiaco-Toblach', 'Dobbiaco-Toblach', 500), -(7005, 77, 603, 'Merano-Meran', 'Merano-Meran', 600), -(7006, 77, 603, 'Terento-Terenten', 'Terento-Terenten', 700), -(7007, 77, 604, 'Arco', 'Arco', 100), -(7008, 77, 604, 'Borgo Valsugana', 'Borgo Valsugana', 200), -(7009, 77, 604, 'Mezzocorona', 'Mezzocorona', 300), -(7010, 77, 604, 'Riva del Garda', 'Riva del Garda', 400), -(7011, 77, 604, 'Rovereto', 'Rovereto', 500), -(7012, 77, 604, 'Trento', 'Trento', 600), -(7013, 77, 604, 'Vigo di Fassa', 'Vigo di Fassa', 700), -(7014, 77, 605, 'Assisi', 'Assisi', 100), -(7015, 77, 605, 'Bastia Umbra', 'Bastia Umbra', 200), -(7016, 77, 605, 'Castiglione del Lago', 'Castiglione del Lago', 300), -(7017, 77, 605, 'Citt di Castello', 'Citt di Castello', 400), -(7018, 77, 605, 'Costacciaro', 'Costacciaro', 500), -(7019, 77, 605, 'Foligno', 'Foligno', 600), -(7020, 77, 605, 'Marsciano', 'Marsciano', 700), -(7021, 77, 605, 'Nocera Umbra', 'Nocera Umbra', 800), -(7022, 77, 605, 'Perugia', 'Perugia', 900), -(7023, 77, 605, 'Spoleto', 'Spoleto', 1000), -(7024, 77, 605, 'Todi', 'Todi', 1100), -(7025, 77, 606, 'Arrone', 'Arrone', 100), -(7026, 77, 606, 'Calvi dell''Umbria', 'Calvi dell''Umbria', 200), -(7027, 77, 606, 'Giove', 'Giove', 300), -(7028, 77, 606, 'Orvieto', 'Orvieto', 400), -(7029, 77, 606, 'Terni', 'Terni', 500), -(7030, 77, 607, 'Aosta', 'Aosta', 100), -(7031, 77, 607, 'Saint-Oyen', 'Saint-Oyen', 200), -(7032, 77, 608, 'Belluno', 'Belluno', 100), -(7033, 77, 608, 'Domegge di Cadore', 'Domegge di Cadore', 200), -(7034, 77, 608, 'Feltre', 'Feltre', 300), -(7035, 77, 608, 'Pieve di Cadore', 'Pieve di Cadore', 400), -(7036, 77, 609, 'Abano Terme', 'Abano Terme', 100), -(7037, 77, 609, 'Agna', 'Agna', 200), -(7038, 77, 609, 'Baone', 'Baone', 300), -(7039, 77, 609, 'Battaglia Terme', 'Battaglia Terme', 400), -(7040, 77, 609, 'Carmignano di Brenta', 'Carmignano di Brenta', 500), -(7041, 77, 609, 'Casale di Scodosia', 'Casale di Scodosia', 600), -(7042, 77, 609, 'Cittadella', 'Cittadella', 700), -(7043, 77, 609, 'Conselve', 'Conselve', 800), -(7044, 77, 609, 'Este', 'Este', 900), -(7045, 77, 609, 'Legnaro', 'Legnaro', 1000), -(7046, 77, 609, 'Maser di Padova', 'Maser di Padova', 1100), -(7047, 77, 609, 'Monselice', 'Monselice', 1200), -(7048, 77, 609, 'Montagnana', 'Montagnana', 1300), -(7049, 77, 609, 'Montegrotto Terme', 'Montegrotto Terme', 1400), -(7050, 77, 609, 'Padova', 'Padova', 1500), -(7051, 77, 609, 'Pozzonovo', 'Pozzonovo', 1600), -(7052, 77, 609, 'Rubano', 'Rubano', 1700), -(7053, 77, 609, 'San Martino di Lupari', 'San Martino di Lupari', 1800), -(7054, 77, 609, 'Saonara', 'Saonara', 1900), -(7055, 77, 609, 'Torreglia', 'Torreglia', 2000), -(7056, 77, 610, 'Occhiobello', 'Occhiobello', 100), -(7057, 77, 610, 'Rovigo', 'Rovigo', 200), -(7058, 77, 611, 'Castelfranco Veneto', 'Castelfranco Veneto', 100), -(7059, 77, 611, 'Conegliano', 'Conegliano', 200), -(7060, 77, 611, 'Giavera del Montello', 'Giavera del Montello', 300), -(7061, 77, 611, 'Mogliano Veneto', 'Mogliano Veneto', 400), -(7062, 77, 611, 'Montebelluna', 'Montebelluna', 500), -(7063, 77, 611, 'Oderzo', 'Oderzo', 600), -(7064, 77, 611, 'Orsago', 'Orsago', 700), -(7065, 77, 611, 'Paderno del Grappa', 'Paderno del Grappa', 800), -(7066, 77, 611, 'Pieve di Soligo', 'Pieve di Soligo', 900), -(7067, 77, 611, 'Quinto di Treviso', 'Quinto di Treviso', 1000), -(7068, 77, 611, 'Roncade', 'Roncade', 1100), -(7069, 77, 611, 'Treviso', 'Treviso', 1200), -(7070, 77, 611, 'Vittorio Veneto', 'Vittorio Veneto', 1300), -(7071, 77, 612, 'Annone Veneto', 'Annone Veneto', 100), -(7072, 77, 612, 'Cavarzere', 'Cavarzere', 200), -(7073, 77, 612, 'Chioggia', 'Chioggia', 300), -(7074, 77, 612, 'Dolo', 'Dolo', 400), -(7075, 77, 612, 'Eraclea', 'Eraclea', 500), -(7076, 77, 612, 'Iesolo', 'Iesolo', 600), -(7077, 77, 612, 'Marcon', 'Marcon', 700), -(7078, 77, 612, 'Mira', 'Mira', 800), -(7079, 77, 612, 'Mirano', 'Mirano', 900), -(7080, 77, 612, 'Pianiga', 'Pianiga', 1000), -(7081, 77, 612, 'Portogruaro', 'Portogruaro', 1100), -(7082, 77, 612, 'San Don di Piave', 'San Don di Piave', 1200), -(7083, 77, 612, 'Scorz', 'Scorz', 1300), -(7084, 77, 612, 'Spinea', 'Spinea', 1400), -(7085, 77, 612, 'Stra', 'Stra', 1500), -(7086, 77, 612, 'Venezia', 'Venezia', 1600), -(7087, 77, 613, 'Affi', 'Affi', 100), -(7088, 77, 613, 'Albaredo d''Adige', 'Albaredo d''Adige', 200), -(7089, 77, 613, 'Bardolino', 'Bardolino', 300), -(7090, 77, 613, 'Bovolone', 'Bovolone', 400), -(7091, 77, 613, 'Casaleone', 'Casaleone', 500), -(7092, 77, 613, 'Cologna Veneta', 'Cologna Veneta', 600), -(7093, 77, 613, 'Garda', 'Garda', 700), -(7094, 77, 613, 'Isola della Scala', 'Isola della Scala', 800), -(7095, 77, 613, 'Lazise', 'Lazise', 900), -(7096, 77, 613, 'Legnago', 'Legnago', 1000), -(7097, 77, 613, 'Nogarole Rocca', 'Nogarole Rocca', 1100), -(7098, 77, 613, 'Peschiera del Garda', 'Peschiera del Garda', 1200), -(7099, 77, 613, 'San Bonifacio', 'San Bonifacio', 1300), -(7100, 77, 613, 'San Giovanni Ilarione', 'San Giovanni Ilarione', 1400), -(7101, 77, 613, 'Sanguinetto', 'Sanguinetto', 1500), -(7102, 77, 613, 'Sant''Ambrogio di Valpolicella', 'Sant''Ambrogio di Valpolicella', 1600), -(7103, 77, 613, 'Verona', 'Verona', 1700), -(7104, 77, 613, 'Veronella', 'Veronella', 1800), -(7105, 77, 613, 'Villafranca di Verona', 'Villafranca di Verona', 1900), -(7106, 77, 614, 'Altissimo', 'Altissimo', 100), -(7107, 77, 614, 'Arzignano', 'Arzignano', 200), -(7108, 77, 614, 'Asiago', 'Asiago', 300), -(7109, 77, 614, 'Bassano del Grappa', 'Bassano del Grappa', 400), -(7110, 77, 614, 'Breganze', 'Breganze', 500), -(7111, 77, 614, 'Brendola', 'Brendola', 600), -(7112, 77, 614, 'Montecchio Maggiore', 'Montecchio Maggiore', 700), -(7113, 77, 614, 'Pianezze', 'Pianezze', 800), -(7114, 77, 614, 'Schio', 'Schio', 900), -(7115, 77, 614, 'Tezze sul Brenta', 'Tezze sul Brenta', 1000), -(7116, 77, 614, 'Thiene', 'Thiene', 1100), -(7117, 77, 614, 'Valdagno', 'Valdagno', 1200), -(7118, 77, 614, 'Vicenza', 'Vicenza', 1300), -(7119, 78, 615, 'Аден', 'Aden', 100), -(7120, 78, 615, 'Сана', 'Sana', 200), -(7121, 79, 616, 'Прая', 'Praya', 100), -(7122, 80, 617, 'Акбеит', 'Akbeit', 100), -(7123, 80, 617, 'Аксу', 'Aksu', 200), -(7124, 80, 617, 'Алексеевка', 'Alekseevka', 300), -(7125, 80, 617, 'Астана', 'Astana', 400), -(7126, 80, 617, 'Астраханка', 'Astrahanka', 500), -(7127, 80, 617, 'Атбасар', 'Atbasar', 600), -(7128, 80, 617, 'Балкашино', 'Balkashino', 700), -(7129, 80, 617, 'Бестобе', 'Bestobe', 800), -(7130, 80, 617, 'Вишневка', 'Vishnevka', 900), -(7131, 80, 617, 'Ерментау', 'Ermentau', 1000), -(7132, 80, 617, 'Жалтыр', 'Zhaltyr', 1100), -(7133, 80, 617, 'Жолымбет', 'Zholymbet', 1200), -(7134, 80, 617, 'Кургальджинский', 'Kurgaldzhinskii', 1300), -(7135, 80, 617, 'Макинск', 'Makinsk', 1400), -(7136, 80, 617, 'Степногорск', 'Stepnogorsk', 1500), -(7137, 80, 617, 'Шортанды', 'Shortandy', 1600), -(7138, 80, 618, 'Актобе (Актюбинск)', 'Aktobe (Aktyubinsk)', 100), -(7139, 80, 618, 'Акшам', 'Aksham', 200), -(7140, 80, 618, 'Алга', 'Alga', 300), -(7141, 80, 618, 'Байганин', 'Baiganin', 400), -(7142, 80, 618, 'Батамшинский', 'Batamshinskii', 500), -(7143, 80, 618, 'Иргиз', 'Irgiz', 600), -(7144, 80, 618, 'Карабутак', 'Karabutak', 700), -(7145, 80, 618, 'Мартук', 'Martuk', 800), -(7146, 80, 618, 'Новоалексеевка', 'Novoalekseevka', 900), -(7147, 80, 618, 'Октябрьск', 'Oktyabrsk', 1000), -(7148, 80, 618, 'Уил', 'Uil', 1100), -(7149, 80, 618, 'Хромтау', 'Hromtau', 1200), -(7150, 80, 618, 'Челкар', 'Chelkar', 1300), -(7151, 80, 618, 'Шубаркудук', 'Shubarkuduk', 1400), -(7152, 80, 618, 'Эмба', 'Emba', 1500), -(7153, 80, 619, 'Алматы (Алма-Ата)', 'Almaty (Alma-Ata)', 100), -(7154, 80, 619, 'Баканас', 'Bakanas', 200), -(7155, 80, 619, 'Бурундай', 'Burundai', 300), -(7156, 80, 619, 'Иссык', 'Issyk', 400), -(7157, 80, 619, 'Капчагай', 'Kapchagai', 500), -(7158, 80, 619, 'Каскелен', 'Kaskelen', 600), -(7159, 80, 619, 'Нарынкол', 'Narynkol', 700), -(7160, 80, 619, 'Талгар', 'Talgar', 800), -(7161, 80, 619, 'Узунагач', 'Uzunagach', 900), -(7162, 80, 619, 'Чилик', 'Chilik', 1000), -(7163, 80, 619, 'Чунджа', 'Chundzha', 1100), -(7164, 80, 620, 'Акжар', 'Akzhar', 100), -(7165, 80, 620, 'Аксуат', 'Aksuat', 200), -(7166, 80, 620, 'Асубулак', 'Asubulak', 300), -(7167, 80, 620, 'Ауэзов', 'Auezov', 400), -(7168, 80, 620, 'Аягуз', 'Ayaguz', 500), -(7169, 80, 620, 'Баршатас', 'Barshatas', 600), -(7170, 80, 620, 'Белогорский', 'Belogorskii', 700), -(7171, 80, 620, 'Боко', 'Boko', 800), -(7172, 80, 620, 'Большая Владимировка', 'Bolshaya Vladimirovka', 900), -(7173, 80, 620, 'Бородулиха', 'Boroduliha', 1000), -(7174, 80, 620, 'Верхнеберезовский', 'Verhneberezovskii', 1100), -(7175, 80, 620, 'Георгиевка', 'Georgievka', 1200), -(7176, 80, 620, 'Глубокое', 'Glubokoe', 1300), -(7177, 80, 620, 'Жангизтобе', 'Zhangiztobe', 1400), -(7178, 80, 620, 'Жарма', 'Zharma', 1500), -(7179, 80, 620, 'Жезкент', 'Жезкент', 1600), -(7180, 80, 620, 'Зайсан', 'Zaisan', 1700), -(7181, 80, 620, 'Зыряновск', 'Zyryanovsk', 1800), -(7182, 80, 620, 'Катон-Карагай', 'Katon-Karagai', 1900), -(7183, 80, 620, 'Кокпекты', 'Kokpekty', 2000), -(7184, 80, 620, 'Курчум', 'Kurchum', 2100), -(7185, 80, 620, 'Маканчи', 'Makanchi', 2200), -(7186, 80, 620, 'Новая Шульба', 'Novaya Shulba', 2300), -(7187, 80, 620, 'Риддер (Лениногорск)', 'Ridder (Leninogorsk)', 2400), -(7188, 80, 620, 'Самарское', 'Samarskoe', 2500), -(7189, 80, 620, 'Семипалатинск', 'Semipalatinsk', 2600), -(7190, 80, 620, 'Серебрянск', 'Serebryansk', 2700), -(7191, 80, 620, 'Таскескен', 'Taskesken', 2800), -(7192, 80, 620, 'Урджар', 'Urdzhar', 2900), -(7193, 80, 620, 'Усть-Каменогорск', 'Ust-Kamenogorsk', 3000), -(7194, 80, 620, 'Чарск', 'Charsk', 3100), -(7195, 80, 620, 'Шемонаиха', 'Shemonaiha', 3200), -(7196, 80, 620, 'Шульбинск', 'Шульбинск', 3300), -(7197, 80, 621, 'Атырау(Гурьев)', 'Atyrau(Gurev)', 100), -(7198, 80, 621, 'Байчунас', 'Baichunas', 200), -(7199, 80, 621, 'Балыкши', 'Balykshi', 300), -(7200, 80, 621, 'Ганюшкино', 'Ganyushkino', 400), -(7201, 80, 621, 'Доссор', 'Dossor', 500), -(7202, 80, 621, 'Индерборский', 'Inderborskii', 600), -(7203, 80, 621, 'Каратон', 'Karaton', 700), -(7204, 80, 621, 'Кульсары', 'Kulsary', 800), -(7205, 80, 621, 'Макат', 'Makat', 900), -(7206, 80, 621, 'Миялы', 'Miyaly', 1000), -(7207, 80, 622, 'Агадырь', 'Agadyr', 100), -(7208, 80, 622, 'Акжал', 'Akzhal', 200), -(7209, 80, 622, 'Атасу', 'Atasu', 300), -(7210, 80, 622, 'Балхаш', 'Balhash', 400), -(7211, 80, 622, 'Гульшад', 'Gulshad', 500), -(7212, 80, 622, 'Дарьинский', 'Darinskii', 600), -(7213, 80, 622, 'Джамбул', 'Dzhambul', 700), -(7214, 80, 622, 'Джезды', 'Dzhezdy', 800), -(7215, 80, 622, 'Джезказган', 'Dzhezkazgan', 900), -(7216, 80, 622, 'Жарык', 'Zharyk', 1000), -(7217, 80, 622, 'Каражал', 'Karazhal', 1100), -(7218, 80, 622, 'Приозерск', 'Приозерск', 1200), -(7219, 80, 622, 'Сатпаев (Никольский)', 'Satpaev (Nikolskii)', 1300), -(7220, 80, 622, 'Тараз', 'Taraz', 1400), -(7221, 80, 622, 'Улытау', 'Ulytau', 1500), -(7222, 80, 623, 'Акколь', 'Akkol', 100), -(7223, 80, 623, 'Байкадам', 'Baikadam', 200), -(7224, 80, 623, 'Бурное', 'Burnoe', 300), -(7225, 80, 623, 'Георгиевка', 'Georgievka', 400), -(7226, 80, 623, 'Гранитогорск', 'Granitogorsk', 500), -(7227, 80, 623, 'Жанатас', 'Zhanatas', 600), -(7228, 80, 623, 'Каратау', 'Karatau', 700), -(7229, 80, 623, 'Коктал', 'Koktal', 800), -(7230, 80, 623, 'Луговое', 'Lugovoe', 900), -(7231, 80, 623, 'Мерке', 'Merke', 1000), -(7232, 80, 623, 'Михайловка', 'Mihailovka', 1100), -(7233, 80, 623, 'Новотроицкое', 'Novotroitskoe', 1200), -(7234, 80, 623, 'Отар', 'Otar', 1300), -(7235, 80, 623, 'Тараз (Джамбул)', 'Taraz (Dzhambul)', 1400), -(7236, 80, 623, 'Фурмановка', 'Furmanovka', 1500), -(7237, 80, 623, 'Чиганак', 'Chiganak', 1600), -(7238, 80, 623, 'Чу', 'Chu', 1700), -(7239, 80, 624, 'Аксай', 'Aksai', 100), -(7240, 80, 624, 'Уральск', 'Uralsk', 200), -(7241, 80, 625, 'Ак-Коль', 'Ak-Kol', 100), -(7242, 80, 625, 'Акший', 'Akshii', 200), -(7243, 80, 625, 'Аршалы', 'Arshaly', 300), -(7244, 80, 625, 'Атбасар', 'Atbasar', 400), -(7245, 80, 625, 'Байконур', 'Baikonur', 500), -(7246, 80, 625, 'Балкашино', 'Balkashino', 600), -(7247, 80, 625, 'Жезказган', 'Zhezkazgan', 700), -(7248, 80, 625, 'Костанай', 'Kostanai', 800), -(7249, 80, 625, 'Курчатов', 'Kurchatov', 900), -(7250, 80, 625, 'Кызылорда', 'Kyzylorda', 1000), -(7251, 80, 625, 'Махамбет', 'Mahambet', 1100), -(7252, 80, 626, 'Абай', 'Abai', 100), -(7253, 80, 626, 'Актас', 'Aktas', 200), -(7254, 80, 626, 'Актау', 'Aktau', 300), -(7255, 80, 626, 'Егиндыбулак', 'Egindybulak', 400), -(7256, 80, 626, 'Карагайлы', 'Karagaily', 500), -(7257, 80, 626, 'Караганда', 'Karaganda', 600), -(7258, 80, 626, 'Каркаралинск', 'Karkaralinsk', 700), -(7259, 80, 626, 'Киевка', 'Kievka', 800), -(7260, 80, 626, 'Осакаровка', 'Osakarovka', 900), -(7261, 80, 626, 'Сарань', 'Saran', 1000), -(7262, 80, 626, 'Темиртау', 'Temirtau', 1100), -(7263, 80, 626, 'Токаревка', 'Tokarevka', 1200), -(7264, 80, 626, 'Топар', 'Topar', 1300), -(7265, 80, 626, 'Ульяновский', 'Ulyanovskii', 1400), -(7266, 80, 626, 'Шахтинск', 'Shahtinsk', 1500), -(7267, 80, 627, 'Аральск', 'Aralsk', 100), -(7268, 80, 627, 'Байконур', 'Байконур', 200), -(7269, 80, 627, 'Джалагаш', 'Dzhalagash', 300), -(7270, 80, 627, 'Джусалы', 'Dzhusaly', 400), -(7271, 80, 627, 'Казалинск', 'Kazalinsk', 500), -(7272, 80, 627, 'Кзылорда', 'Kzylorda', 600), -(7273, 80, 627, 'Новоказалинск', 'Novokazalinsk', 700), -(7274, 80, 627, 'Тасбугет', 'Tasbuget', 800), -(7275, 80, 627, 'Чиили', 'Chiili', 900), -(7276, 80, 627, 'Яныкурган', 'Yanykurgan', 1000), -(7277, 80, 628, 'Айдабул', 'Aidabul', 100), -(7278, 80, 628, 'Алексеевка', 'Alekseevka', 200), -(7279, 80, 628, 'Боровое', 'Borovoe', 300), -(7280, 80, 628, 'Володарское', 'Volodarskoe', 400), -(7281, 80, 628, 'Зеренда', 'Zerenda', 500), -(7282, 80, 628, 'Келлеровка', 'Kellerovka', 600), -(7283, 80, 628, 'Кзылту', 'Kzyltu', 700), -(7284, 80, 628, 'Кокчетав', 'Kokchetav', 800), -(7285, 80, 628, 'Красноармейск', 'Krasnoarmeisk', 900), -(7286, 80, 628, 'Красный Яр', 'Krasnyi Yar', 1000), -(7287, 80, 628, 'Куйбышевский', 'Kuibyshevskii', 1100), -(7288, 80, 628, 'Ленинградское', 'Leningradskoe', 1200), -(7289, 80, 628, 'Рузаевка', 'Ruzaevka', 1300), -(7290, 80, 628, 'Степняк', 'Stepnyak', 1400), -(7291, 80, 628, 'Талшик', 'Talshik', 1500), -(7292, 80, 628, 'Чистополье', 'Chistopole', 1600), -(7293, 80, 628, 'Чкалово', 'Chkalovo', 1700), -(7294, 80, 628, 'Щучинск', 'Shchuchinsk', 1800), -(7295, 80, 629, 'Боровской', 'Borovskoi', 100), -(7296, 80, 629, 'Джетыгара', 'Dzhetygara', 200), -(7297, 80, 629, 'Затобольск', 'Zatobolsk', 300), -(7298, 80, 629, 'Камышное', 'Kamyshnoe', 400), -(7299, 80, 629, 'Карасу', 'Karasu', 500), -(7300, 80, 629, 'Комсомолец', 'Komsomolets', 600), -(7301, 80, 629, 'Кустанай', 'Kustanai', 700), -(7302, 80, 629, 'Кушмурун', 'Kushmurun', 800), -(7303, 80, 629, 'Ленинское', 'Leninskoe', 900), -(7304, 80, 629, 'Лисаковск', 'Lisakovsk', 1000), -(7305, 80, 629, 'Орджоникидзе', 'Ordzhonikidze', 1100), -(7306, 80, 629, 'Рудный', 'Rudnyi', 1200), -(7307, 80, 629, 'Семиозерное', 'Semiozernoe', 1300), -(7308, 80, 629, 'Тобол', 'Tobol', 1400), -(7309, 80, 629, 'Урицкий', 'Uritskii', 1500), -(7310, 80, 629, 'Успеновка', 'Uspenowka', 1600), -(7311, 80, 630, 'Актау (Шевченко)', 'Aktau (Shevchenko)', 100), -(7312, 80, 630, 'Баутино', 'Bautino', 200), -(7313, 80, 630, 'Бейнеу', 'Beineu', 300), -(7314, 80, 630, 'Новый Узень', 'Novyi Uzen', 400), -(7315, 80, 630, 'Форт-Шевченко', 'Fort-Shevchenko', 500), -(7316, 80, 631, 'Аксу (Ермак)', 'Aksu (Ermak)', 100), -(7317, 80, 631, 'Баянаул', 'Bayanaul', 200), -(7318, 80, 631, 'Железинка', 'Zhelezinka', 300), -(7319, 80, 631, 'Иртышск', 'Irtyshsk', 400), -(7320, 80, 631, 'Калкаман', 'Kalkaman', 500), -(7321, 80, 631, 'Краснокутск', 'Krasnokutsk', 600), -(7322, 80, 631, 'Лебяжье', 'Lebyazhe', 700), -(7323, 80, 631, 'Майкаин', 'Maikain', 800), -(7324, 80, 631, 'Павлодар', 'Pavlodar', 900), -(7325, 80, 631, 'Успенка', 'Uspenka', 1000), -(7326, 80, 631, 'Щербакты', 'Shcherbakty', 1100), -(7327, 80, 631, 'Экибастуз', 'Ekibastuz', 1200), -(7328, 80, 632, 'Благовещенка', 'Blagoveshchenka', 100), -(7329, 80, 632, 'Булаево', 'Bulaevo', 200), -(7330, 80, 632, 'Корнеевка', 'Korneevka', 300), -(7331, 80, 632, 'Мамлютка', 'Mamlyutka', 400), -(7332, 80, 632, 'Петропавловск', 'Petropavlovsk', 500), -(7333, 80, 632, 'Пресновка', 'Presnovka', 600), -(7334, 80, 632, 'Сергеевка', 'Sergeevka', 700), -(7335, 80, 632, 'Соколовка', 'Sokolovka', 800), -(7336, 80, 632, 'Явленка', 'Yavlenka', 900), -(7337, 80, 633, 'Актогай', 'Aktogai', 100), -(7338, 80, 633, 'Андреевка', 'Andreevka', 200), -(7339, 80, 633, 'Джансугуров', 'Dzhansugurov', 300), -(7340, 80, 633, 'Капал', 'Kapal', 400), -(7341, 80, 633, 'Карабулак', 'Karabulak', 500), -(7342, 80, 633, 'Кировский', 'Kirovskii', 600), -(7343, 80, 633, 'Панфилов', 'Panfilov', 700), -(7344, 80, 633, 'Сарканд', 'Sarkand', 800), -(7345, 80, 633, 'Сарыозек', 'Saryozek', 900), -(7346, 80, 633, 'Талды-Курган', 'Taldy-Kurgan', 1000), -(7347, 80, 633, 'Текели', 'Tekeli', 1100), -(7348, 80, 633, 'Учарал', 'Ucharal', 1200), -(7349, 80, 633, 'Уштобе', 'Ushtobe', 1300); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(7350, 80, 634, 'Амангельды', 'Amangeldy', 100), -(7351, 80, 634, 'Аркалык', 'Arkalyk', 200), -(7352, 80, 634, 'Державинск', 'Derzhavinsk', 300), -(7353, 80, 634, 'Есиль', 'Esil', 400), -(7354, 80, 634, 'Жаксы', 'Zhaksy', 500), -(7355, 80, 634, 'Октябрьское', 'Oktyabrskoe', 600), -(7356, 80, 634, 'Тургай', 'Turgai', 700), -(7357, 80, 635, 'Арысь', 'Arys', 100), -(7358, 80, 635, 'Байжансай', 'Baizhansai', 200), -(7359, 80, 635, 'Белые Воды', 'Belye Vody', 300), -(7360, 80, 635, 'Ванновка', 'Vannovka', 400), -(7361, 80, 635, 'Джетысай', 'Dzhetysai', 500), -(7362, 80, 635, 'Кентау', 'Kentau', 600), -(7363, 80, 635, 'Ленгер', 'Lenger', 700), -(7364, 80, 635, 'Мырзакент', 'Myrzakent', 800), -(7365, 80, 635, 'Сарыагач', 'Saryagach', 900), -(7366, 80, 635, 'Темирлановка', 'Temirlanovka', 1000), -(7367, 80, 635, 'Туркестан', 'Turkestan', 1100), -(7368, 80, 635, 'Чардара', 'Chardara', 1200), -(7369, 80, 635, 'Чаян', 'Chayan', 1300), -(7370, 80, 635, 'Чулаккурган', 'Chulakkurgan', 1400), -(7371, 80, 635, 'Шаульдер', 'Shaulder', 1500), -(7372, 80, 635, 'Шымкент (Чимкент)', 'Chimkent', 1600), -(7373, 81, 636, 'Пномпень', 'Pnompen''', 100), -(7374, 82, 637, 'Дуала', 'Douala', 100), -(7375, 82, 638, 'Виктория', 'Victoria', 100), -(7376, 82, 639, 'Гаруа', 'Garoua', 100), -(7377, 82, 640, 'Яунде', 'Yaounde', 100), -(7378, 83, 641, 'Abee', 'Abee', 100), -(7379, 83, 641, 'Acadia Valley', 'Acadia Valley', 200), -(7380, 83, 641, 'Acme', 'Acme', 300), -(7381, 83, 641, 'Aden', 'Aden', 400), -(7382, 83, 641, 'Airdrie', 'Airdrie', 500), -(7383, 83, 641, 'Alberta Beach', 'Alberta Beach', 600), -(7384, 83, 641, 'Alix', 'Alix', 700), -(7385, 83, 641, 'Alliance', 'Alliance', 800), -(7386, 83, 641, 'Andrew', 'Andrew', 900), -(7387, 83, 641, 'Athabasca', 'Athabasca', 1000), -(7388, 83, 641, 'Atikameg', 'Atikameg', 1100), -(7389, 83, 641, 'Atmore', 'Atmore', 1200), -(7390, 83, 641, 'Balzac', 'Balzac', 1300), -(7391, 83, 641, 'Barrhead', 'Barrhead', 1400), -(7392, 83, 641, 'Blueberry Mountain', 'Blueberry Mountain', 1500), -(7393, 83, 641, 'Brooks', 'Brooks', 1600), -(7394, 83, 641, 'Buffalo', 'Buffalo', 1700), -(7395, 83, 641, 'Calgary', 'Calgary', 1800), -(7396, 83, 641, 'Camrose', 'Camrose', 1900), -(7397, 83, 641, 'Edmonton', 'Edmonton', 2000), -(7398, 83, 641, 'Eureka River', 'Eureka River', 2100), -(7399, 83, 641, 'Fort Mackay', 'Fort Mackay', 2200), -(7400, 83, 641, 'Fort McMurray', 'Fort McMurray', 2300), -(7401, 83, 641, 'Grande Prairie', 'Grande Prairie', 2400), -(7402, 83, 641, 'Hinton', 'Hinton', 2500), -(7403, 83, 641, 'Jasper', 'Jasper', 2600), -(7404, 83, 641, 'Leduc', 'Leduc', 2700), -(7405, 83, 641, 'Lethbridge', 'Lethbridge', 2800), -(7406, 83, 641, 'Medicine Hat', 'Medicine Hat', 2900), -(7407, 83, 641, 'Monarch', 'Monarch', 3000), -(7408, 83, 641, 'Nevis', 'Nevis', 3100), -(7409, 83, 641, 'Oyen', 'Oyen', 3200), -(7410, 83, 641, 'Red Deer', 'Red Deer', 3300), -(7411, 83, 641, 'Robb', 'Robb', 3400), -(7412, 83, 641, 'Sherwood Park', 'Sherwood Park', 3500), -(7413, 83, 641, 'Torrington', 'Torrington', 3600), -(7414, 83, 641, 'Vegreville', 'Vegreville', 3700), -(7415, 83, 642, '100 Mile House', '100 Mile House', 100), -(7416, 83, 642, 'Abbotsford', 'Abbotsford', 200), -(7417, 83, 642, 'Altona', 'Altona', 300), -(7418, 83, 642, 'Anahim Lake', 'Anahim Lake', 400), -(7419, 83, 642, 'Argenta', 'Argenta', 500), -(7420, 83, 642, 'Armstrong', 'Armstrong', 600), -(7421, 83, 642, 'Belcarra', 'Belcarra', 700), -(7422, 83, 642, 'Bella Bella', 'Bella Bella', 800), -(7423, 83, 642, 'Boston Bar', 'Boston Bar', 900), -(7424, 83, 642, 'Burnaby', 'Burnaby', 1000), -(7425, 83, 642, 'Burns Lake', 'Burns Lake', 1100), -(7426, 83, 642, 'Campbell River', 'Campbell River', 1200), -(7427, 83, 642, 'Coquitlam', 'Coquitlam', 1300), -(7428, 83, 642, 'Cranbrook', 'Cranbrook', 1400), -(7429, 83, 642, 'Duncan', 'Duncan', 1500), -(7430, 83, 642, 'Egmont', 'Egmont', 1600), -(7431, 83, 642, 'Falkland', 'Falkland', 1700), -(7432, 83, 642, 'Fort St John', 'Fort St John', 1800), -(7433, 83, 642, 'Kamloops', 'Kamloops', 1900), -(7434, 83, 642, 'Kelowna', 'Kelowna', 2000), -(7435, 83, 642, 'Kitimat', 'Kitimat', 2100), -(7436, 83, 642, 'Madeira Park', 'Madeira Park', 2200), -(7437, 83, 642, 'Nanaimo', 'Nanaimo', 2300), -(7438, 83, 642, 'Penticton', 'Penticton', 2400), -(7439, 83, 642, 'Prince George', 'Prince George', 2500), -(7440, 83, 642, 'Radium Hot Springs', 'Radium Hot Springs', 2600), -(7441, 83, 642, 'Revelstoke', 'Revelstoke', 2700), -(7442, 83, 642, 'Richmond', 'Richmond', 2800), -(7443, 83, 642, 'Sidney', 'Sidney', 2900), -(7444, 83, 642, 'Surrey', 'Surrey', 3000), -(7445, 83, 642, 'Tofino', 'Tofino', 3100), -(7446, 83, 642, 'Vancouver', 'Vancouver', 3200), -(7447, 83, 642, 'Victoria', 'Victoria', 3300), -(7448, 83, 642, 'West Vancouver', 'West Vancouver', 3400), -(7449, 83, 642, 'Whistler', 'Whistler', 3500), -(7450, 83, 643, 'Alexander', 'Alexander', 100), -(7451, 83, 643, 'Alonsa', 'Alonsa', 200), -(7452, 83, 643, 'Altona', 'Altona', 300), -(7453, 83, 643, 'Austin', 'Austin', 400), -(7454, 83, 643, 'Beaconia', 'Beaconia', 500), -(7455, 83, 643, 'Belmont', 'Belmont', 600), -(7456, 83, 643, 'Brandon', 'Brandon', 700), -(7457, 83, 643, 'Kenton', 'Kenton', 800), -(7458, 83, 643, 'Manson', 'Manson', 900), -(7459, 83, 643, 'Minitonas', 'Minitonas', 1000), -(7460, 83, 643, 'Morris', 'Morris', 1100), -(7461, 83, 643, 'Neepawa', 'Neepawa', 1200), -(7462, 83, 643, 'Roblin', 'Roblin', 1300), -(7463, 83, 643, 'Steinbach', 'Steinbach', 1400), -(7464, 83, 643, 'Wanipigow', 'Wanipigow', 1500), -(7465, 83, 643, 'Winkler', 'Winkler', 1600), -(7466, 83, 643, 'Winnipeg', 'Winnipeg', 1700), -(7467, 83, 644, 'Acadieville', 'Acadieville', 100), -(7468, 83, 644, 'Allainville', 'Allainville', 200), -(7469, 83, 644, 'Bas-Caraquet', 'Bas-Caraquet', 300), -(7470, 83, 644, 'Forest City', 'Forest City', 400), -(7471, 83, 644, 'Moncton', 'Moncton', 500), -(7472, 83, 644, 'Saint John', 'Saint John', 600), -(7473, 83, 645, 'Benton', 'Benton', 100), -(7474, 83, 645, 'Churchill Falls', 'Churchill Falls', 200), -(7475, 83, 645, 'Elliston', 'Elliston', 300), -(7476, 83, 645, 'St. John''s', 'St. John''s', 400), -(7477, 83, 646, 'Norman Wells', 'Norman Wells', 100), -(7478, 83, 646, 'Rae Edzo', 'Rae Edzo', 200), -(7479, 83, 646, 'Yellowknife', 'Yellowknife', 300), -(7480, 83, 647, 'Arcadia', 'Arcadia', 100), -(7481, 83, 647, 'Arichat', 'Arichat', 200), -(7482, 83, 647, 'Askilton', 'Askilton', 300), -(7483, 83, 647, 'Baddeck', 'Baddeck', 400), -(7484, 83, 647, 'Barton', 'Barton', 500), -(7485, 83, 647, 'Dartmouth', 'Dartmouth', 600), -(7486, 83, 647, 'Halifax', 'Halifax', 700), -(7487, 83, 647, 'Mira Road', 'Mira Road', 800), -(7488, 83, 647, 'Sydney', 'Sydney', 900), -(7489, 83, 647, 'Trenton', 'Trenton', 1000), -(7490, 83, 648, 'Hall Beach', 'Hall Beach', 100), -(7491, 83, 649, 'Acton', 'Acton', 100), -(7492, 83, 649, 'Addison', 'Addison', 200), -(7493, 83, 649, 'Ajax', 'Ajax', 300), -(7494, 83, 649, 'Alban', 'Alban', 400), -(7495, 83, 649, 'Alexandria', 'Alexandria', 500), -(7496, 83, 649, 'Alfred', 'Alfred', 600), -(7497, 83, 649, 'Algoma Mills', 'Algoma Mills', 700), -(7498, 83, 649, 'Allenford', 'Allenford', 800), -(7499, 83, 649, 'Alliston', 'Alliston', 900), -(7500, 83, 649, 'Alma', 'Alma', 1000), -(7501, 83, 649, 'Almonte', 'Almonte', 1100), -(7502, 83, 649, 'Alton', 'Alton', 1200), -(7503, 83, 649, 'Alvinston', 'Alvinston', 1300), -(7504, 83, 649, 'Ancaster', 'Ancaster', 1400), -(7505, 83, 649, 'Angus', 'Angus', 1500), -(7506, 83, 649, 'Annan', 'Annan', 1600), -(7507, 83, 649, 'Arnprior', 'Arnprior', 1700), -(7508, 83, 649, 'Astra', 'Astra', 1800), -(7509, 83, 649, 'Aurora', 'Aurora', 1900), -(7510, 83, 649, 'Baden', 'Baden', 2000), -(7511, 83, 649, 'Baltimore', 'Baltimore', 2100), -(7512, 83, 649, 'Barrie', 'Barrie', 2200), -(7513, 83, 649, 'Barwick', 'Barwick', 2300), -(7514, 83, 649, 'Bearskin Lake', 'Bearskin Lake', 2400), -(7515, 83, 649, 'Belle Vallee', 'Belle Vallee', 2500), -(7516, 83, 649, 'Brampton', 'Brampton', 2600), -(7517, 83, 649, 'Brockville', 'Brockville', 2700), -(7518, 83, 649, 'Burlington', 'Burlington', 2800), -(7519, 83, 649, 'Cambridge', 'Cambridge', 2900), -(7520, 83, 649, 'Cannington', 'Cannington', 3000), -(7521, 83, 649, 'Concord', 'Concord', 3100), -(7522, 83, 649, 'Courtland', 'Courtland', 3200), -(7523, 83, 649, 'Dundas', 'Dundas', 3300), -(7524, 83, 649, 'East York', 'East York', 3400), -(7525, 83, 649, 'Etobicoke', 'Etobicoke', 3500), -(7526, 83, 649, 'Fergus', 'Fergus', 3600), -(7527, 83, 649, 'Finch', 'Finch', 3700), -(7528, 83, 649, 'Guelph', 'Guelph', 3800), -(7529, 83, 649, 'Hamilton', 'Hamilton', 3900), -(7530, 83, 649, 'Kanata', 'Kanata', 4000), -(7531, 83, 649, 'Kingston', 'Kingston', 4100), -(7532, 83, 649, 'Kitchener', 'Kitchener', 4200), -(7533, 83, 649, 'Lindsay', 'Lindsay', 4300), -(7534, 83, 649, 'London', 'London', 4400), -(7535, 83, 649, 'Mactier', 'Mactier', 4500), -(7536, 83, 649, 'Maple', 'Maple', 4600), -(7537, 83, 649, 'Melbourne', 'Melbourne', 4700), -(7538, 83, 649, 'Migisi Sahgaigan', 'Migisi Sahgaigan', 4800), -(7539, 83, 649, 'Milton', 'Milton', 4900), -(7540, 83, 649, 'Mississauga', 'Mississauga', 5000), -(7541, 83, 649, 'Monkton', 'Monkton', 5100), -(7542, 83, 649, 'Montreal River Harbour', 'Montreal River Harbour', 5200), -(7543, 83, 649, 'Nepean', 'Nepean', 5300), -(7544, 83, 649, 'Newmarket', 'Newmarket', 5400), -(7545, 83, 649, 'Niagara Falls', 'Niagara Falls', 5500), -(7546, 83, 649, 'North Bay', 'North Bay', 5600), -(7547, 83, 649, 'North York', 'North York', 5700), -(7548, 83, 649, 'Oakland', 'Oakland', 5800), -(7549, 83, 649, 'Oakville', 'Oakville', 5900), -(7550, 83, 649, 'Odessa', 'Odessa', 6000), -(7551, 83, 649, 'Oshawa', 'Oshawa', 6100), -(7552, 83, 649, 'Ottawa', 'Ottawa', 6200), -(7553, 83, 649, 'Owen Sound', 'Owen Sound', 6300), -(7554, 83, 649, 'Pembroke', 'Pembroke', 6400), -(7555, 83, 649, 'Richmond Hill', 'Richmond Hill', 6500), -(7556, 83, 649, 'Scarborough', 'Scarborough', 6600), -(7557, 83, 649, 'St Catharines', 'St Catharines', 6700), -(7558, 83, 649, 'Stoney Creek', 'Stoney Creek', 6800), -(7559, 83, 649, 'Stouffville', 'Stouffville', 6900), -(7560, 83, 649, 'Sudbury', 'Sudbury', 7000), -(7561, 83, 649, 'Thornhill', 'Thornhill', 7100), -(7562, 83, 649, 'Thornton', 'Thornton', 7200), -(7563, 83, 649, 'Toronto', 'Toronto', 7300), -(7564, 83, 649, 'Vaughan', 'Vaughan', 7400), -(7565, 83, 649, 'Warsaw', 'Warsaw', 7500), -(7566, 83, 649, 'Waterloo', 'Waterloo', 7600), -(7567, 83, 649, 'Wawa', 'Wawa', 7700), -(7568, 83, 649, 'Welland', 'Welland', 7800), -(7569, 83, 649, 'Wellington', 'Wellington', 7900), -(7570, 83, 649, 'Windsor', 'Windsor', 8000), -(7571, 83, 649, 'Woodbridge', 'Woodbridge', 8100), -(7572, 83, 649, 'Woodstock', 'Woodstock', 8200), -(7573, 83, 649, 'York', 'York', 8300), -(7574, 83, 650, 'Albany', 'Albany', 100), -(7575, 83, 650, 'Charlottetown', 'Charlottetown', 200), -(7576, 83, 650, 'Elmira', 'Elmira', 300), -(7577, 83, 650, 'Georgetown', 'Georgetown', 400), -(7578, 83, 650, 'Montague', 'Montague', 500), -(7579, 83, 650, 'Morell', 'Morell', 600), -(7580, 83, 650, 'Vernon Bridge', 'Vernon Bridge', 700), -(7581, 83, 651, 'Abercorn', 'Abercorn', 100), -(7582, 83, 651, 'Alma', 'Alma', 200), -(7583, 83, 651, 'Ange-Gardien', 'Ange-Gardien', 300), -(7584, 83, 651, 'Ascot Corner', 'Ascot Corner', 400), -(7585, 83, 651, 'Chelsea', 'Chelsea', 500), -(7586, 83, 651, 'Clermont', 'Clermont', 600), -(7587, 83, 651, 'Dollard-des-Ormeaux', 'Dollard-des-Ormeaux', 700), -(7588, 83, 651, 'Gatineau', 'Gatineau', 800), -(7589, 83, 651, 'Laval', 'Laval', 900), -(7590, 83, 651, 'Longueuil', 'Longueuil', 1000), -(7591, 83, 651, 'Matane', 'Matane', 1100), -(7592, 83, 651, 'Mont-Royal', 'Mont-Royal', 1200), -(7593, 83, 651, 'Mont-Tremblant', 'Mont-Tremblant', 1300), -(7594, 83, 651, 'Montreal', 'Montreal', 1400), -(7595, 83, 651, 'Montreal-Est', 'Montreal-Est', 1500), -(7596, 83, 651, 'Montreal-Nord', 'Montreal-Nord', 1600), -(7597, 83, 651, 'Montreal-Ouest', 'Montreal-Ouest', 1700), -(7598, 83, 651, 'North Hatley', 'North Hatley', 1800), -(7599, 83, 651, 'Ottawa', 'Ottawa', 1900), -(7600, 83, 651, 'Pierrefonds', 'Pierrefonds', 2000), -(7601, 83, 651, 'Quebec', 'Quebec', 2100), -(7602, 83, 651, 'Richmond', 'Richmond', 2200), -(7603, 83, 651, 'Saint-Adrien', 'Saint-Adrien', 2300), -(7604, 83, 651, 'Saint-Laurent', 'Saint-Laurent', 2400), -(7605, 83, 651, 'Sept-Iles', 'Sept-Iles', 2500), -(7606, 83, 651, 'Sherbrooke', 'Sherbrooke', 2600), -(7607, 83, 651, 'Sillery', 'Sillery', 2700), -(7608, 83, 651, 'Victoriaville', 'Victoriaville', 2800), -(7609, 83, 651, 'Westmount', 'Westmount', 2900), -(7610, 83, 651, 'Yamaska', 'Yamaska', 3000), -(7611, 83, 652, 'Alameda', 'Alameda', 100), -(7612, 83, 652, 'Estevan', 'Estevan', 200), -(7613, 83, 652, 'Moose Jaw', 'Moose Jaw', 300), -(7614, 83, 652, 'North Battleford', 'North Battleford', 400), -(7615, 83, 652, 'Regina', 'Regina', 500), -(7616, 83, 652, 'Saskatoon', 'Saskatoon', 600), -(7617, 83, 652, 'Tisdale', 'Tisdale', 700), -(7618, 83, 652, 'Warman', 'Warman', 800), -(7619, 83, 652, 'Weyburn', 'Weyburn', 900), -(7620, 83, 652, 'Windthorst', 'Windthorst', 1000), -(7621, 83, 652, 'Yorkton', 'Yorkton', 1100), -(7622, 83, 653, 'Carcross', 'Carcross', 100), -(7623, 83, 653, 'Dawson', 'Dawson', 200), -(7624, 83, 653, 'Faro', 'Faro', 300), -(7625, 83, 653, 'Whitehorse', 'Whitehorse', 400), -(7626, 84, 654, 'Доха', 'Doha', 100), -(7627, 85, 655, 'Fort Hall', 'Fort Hall', 100), -(7628, 85, 655, 'Gatei', 'Gatei', 200), -(7629, 85, 655, 'Gatunguru', 'Gatunguru', 300), -(7630, 85, 656, 'Balguda', 'Balguda', 100), -(7631, 85, 656, 'Mombasa', 'Mombasa', 200), -(7632, 85, 656, 'Mombassa', 'Mombassa', 300), -(7633, 85, 657, 'Harambee', 'Harambee', 100), -(7634, 85, 657, 'Kilimani Estate', 'Kilimani Estate', 200), -(7635, 85, 657, 'Nairobi', 'Nairobi', 300), -(7636, 85, 657, 'Shauri Moyo', 'Shauri Moyo', 400), -(7637, 85, 658, 'Arda Dadaja', 'Arda Dadaja', 100), -(7638, 85, 659, 'Busia', 'Busia', 100), -(7639, 86, 660, 'Ларнака', 'Ларнака', 100), -(7640, 86, 660, 'Лимассол', 'Лимассол', 200), -(7641, 86, 660, 'Пафос', 'Пафос', 300), -(7642, 86, 661, 'Гирне', 'Гирне', 100), -(7643, 86, 661, 'Никосия', 'Никосия', 200), -(7644, 86, 661, 'Фамагуста', 'Фамагуста', 300), -(7645, 87, 662, 'Aiaki', 'Aiaki', 100), -(7646, 87, 662, 'Bairiki', 'Bairiki', 200), -(7647, 87, 662, 'Baretoa', 'Baretoa', 300), -(7648, 87, 662, 'King', 'King', 400), -(7649, 87, 662, 'London', 'London', 500), -(7650, 87, 662, 'Ooma', 'Ooma', 600), -(7651, 87, 662, 'Tenanoraoi', 'Tenanoraoi', 700), -(7652, 87, 662, 'Terikai', 'Terikai', 800), -(7653, 87, 662, 'Tetabuki', 'Tetabuki', 900), -(7654, 88, 663, 'Aikou', 'Aikou', 100), -(7655, 88, 663, 'Changfeng', 'Changfeng', 200), -(7656, 88, 663, 'Hefei', 'Hefei', 300), -(7657, 88, 663, 'Quanjiao', 'Quanjiao', 400), -(7658, 88, 663, 'Wuhu', 'Wuhu', 500), -(7659, 88, 664, 'Anding', 'Anding', 100), -(7660, 88, 664, 'Anting', 'Anting', 200), -(7661, 88, 664, 'Badalingzhen', 'Badalingzhen', 300), -(7662, 88, 664, 'Badaohe', 'Badaohe', 400), -(7663, 88, 664, 'Banbidian', 'Banbidian', 500), -(7664, 88, 664, 'Banqiao', 'Banqiao', 600), -(7665, 88, 664, 'Beijian', 'Beijian', 700), -(7666, 88, 664, 'Beijing', 'Beijing', 800), -(7667, 88, 664, 'Beijing Shi', 'Beijing Shi', 900), -(7668, 88, 664, 'Beiling', 'Beiling', 1000), -(7669, 88, 664, 'Bujiaying', 'Bujiaying', 1100), -(7670, 88, 664, 'Fengtai', 'Fengtai', 1200), -(7671, 88, 664, 'Haidian', 'Haidian', 1300), -(7672, 88, 664, 'Pekin', 'Pekin', 1400), -(7673, 88, 664, 'Peking', 'Peking', 1500), -(7674, 88, 664, 'Shangyuan', 'Shangyuan', 1600), -(7675, 88, 664, 'Tongzhou', 'Tongzhou', 1700), -(7676, 88, 665, 'Aba', 'Aba', 100), -(7677, 88, 665, 'Anfuzhen', 'Anfuzhen', 200), -(7678, 88, 665, 'Baoshi', 'Baoshi', 300), -(7679, 88, 665, 'Chongning', 'Chongning', 400), -(7680, 88, 665, 'Guoluo', 'Guoluo', 500), -(7681, 88, 665, 'Hanwangchang', 'Hanwangchang', 600), -(7682, 88, 665, 'Jiangbei', 'Jiangbei', 700), -(7683, 88, 665, 'Luyang', 'Luyang', 800), -(7684, 88, 666, 'Dalian', 'Dalian', 100), -(7685, 88, 666, 'Fuzhou', 'Fuzhou', 200), -(7686, 88, 666, 'Shishi', 'Shishi', 300), -(7687, 88, 666, 'Xiamen', 'Xiamen', 400), -(7688, 88, 667, 'Aganzhen', 'Aganzhen', 100), -(7689, 88, 667, 'Ankou', 'Ankou', 200), -(7690, 88, 667, 'Daan', 'Daan', 300), -(7691, 88, 667, 'Lanzhou', 'Lanzhou', 400), -(7692, 88, 667, 'Lanzhou Shi', 'Lanzhou Shi', 500), -(7693, 88, 667, 'Linxia', 'Linxia', 600), -(7694, 88, 668, 'Chaozhou', 'Chaozhou', 100), -(7695, 88, 668, 'Dongguan', 'Dongguan', 200), -(7696, 88, 668, 'Foshan', 'Foshan', 300), -(7697, 88, 668, 'Guangzhou', 'Guangzhou', 400), -(7698, 88, 668, 'Guangzhou Shi', 'Guangzhou Shi', 500), -(7699, 88, 668, 'Guanzhuang', 'Guanzhuang', 600), -(7700, 88, 668, 'Jiangmen', 'Jiangmen', 700), -(7701, 88, 668, 'Juncun', 'Juncun', 800), -(7702, 88, 668, 'Qingyun', 'Qingyun', 900), -(7703, 88, 668, 'Shahezhen', 'Shahezhen', 1000), -(7704, 88, 668, 'Shantou', 'Shantou', 1100), -(7705, 88, 668, 'Shekou', 'Shekou', 1200), -(7706, 88, 668, 'Shenchen', 'Shenchen', 1300), -(7707, 88, 668, 'Shenching', 'Shenching', 1400), -(7708, 88, 668, 'Shenzhen', 'Shenzhen', 1500), -(7709, 88, 668, 'Zhongshan', 'Zhongshan', 1600), -(7710, 88, 668, 'Zhuhai', 'Zhuhai', 1700), -(7711, 88, 669, 'Guilin', 'Guilin', 100), -(7712, 88, 669, 'Nanning', 'Nanning', 200), -(7713, 88, 670, 'Chushui', 'Chushui', 100), -(7714, 88, 670, 'Guandong', 'Guandong', 200), -(7715, 88, 670, 'Guanzhou', 'Guanzhou', 300), -(7716, 88, 670, 'Yecha', 'Yecha', 400), -(7717, 88, 671, 'Baishacun', 'Baishacun', 100), -(7718, 88, 671, 'Haikou', 'Haikou', 200), -(7719, 88, 671, 'Hainan', 'Hainan', 300), -(7720, 88, 671, 'Juntian', 'Juntian', 400), -(7721, 88, 671, 'Sanjia', 'Sanjia', 500), -(7722, 88, 671, 'Sanya', 'Sanya', 600), -(7723, 88, 672, 'Baoding', 'Baoding', 100), -(7724, 88, 672, 'Changtai', 'Changtai', 200), -(7725, 88, 672, 'Hengshui', 'Hengshui', 300), -(7726, 88, 672, 'Qinhuangdao', 'Qinhuangdao', 400), -(7727, 88, 672, 'Shihjiazhuang', 'Shihjiazhuang', 500), -(7728, 88, 672, 'Shijiazhuang', 'Shijiazhuang', 600), -(7729, 88, 672, 'Shijiazhuang Shi', 'Shijiazhuang Shi', 700), -(7730, 88, 673, 'Amuerkhechzhan', 'Amuerkhechzhan', 100), -(7731, 88, 673, 'Daqing', 'Daqing', 200), -(7732, 88, 673, 'Dongning', 'Dongning', 300), -(7733, 88, 673, 'Fuhai', 'Fuhai', 400), -(7734, 88, 673, 'Haerhpin', 'Haerhpin', 500), -(7735, 88, 673, 'Harbin', 'Harbin', 600), -(7736, 88, 673, 'Harbin Shi', 'Harbin Shi', 700), -(7737, 88, 673, 'Heihe', 'Heihe', 800), -(7738, 88, 673, 'Jiamusi', 'Jiamusi', 900), -(7739, 88, 673, 'Jixi', 'Jixi', 1000), -(7740, 88, 673, 'Mudanjiang', 'Mudanjiang', 1100), -(7741, 88, 673, 'Mutanchiangshih', 'Mutanchiangshih', 1200), -(7742, 88, 673, 'Qiqihar', 'Qiqihar', 1300), -(7743, 88, 673, 'Suifenhe', 'Suifenhe', 1400), -(7744, 88, 673, 'Tongjiang', 'Tongjiang', 1500), -(7745, 88, 673, 'Tsitsihar', 'Tsitsihar', 1600), -(7746, 88, 674, 'Caicao', 'Caicao', 100), -(7747, 88, 674, 'Jiaozuo', 'Jiaozuo', 200), -(7748, 88, 674, 'Luoyang', 'Luoyang', 300), -(7749, 88, 674, 'Zhengzhou', 'Zhengzhou', 400), -(7750, 88, 675, 'Bingying', 'Bingying', 100), -(7751, 88, 675, 'Huiwan', 'Huiwan', 200), -(7752, 88, 675, 'Wuchang', 'Wuchang', 300), -(7753, 88, 675, 'Wuhan', 'Wuhan', 400), -(7754, 88, 675, 'Wuxue', 'Wuxue', 500), -(7755, 88, 676, 'Anle', 'Anle', 100), -(7756, 88, 676, 'Changsha', 'Changsha', 200), -(7757, 88, 676, 'Hengnan', 'Hengnan', 300), -(7758, 88, 676, 'Huaihua', 'Huaihua', 400), -(7759, 88, 676, 'Sanyi', 'Sanyi', 500), -(7760, 88, 677, 'Changzhou', 'Changzhou', 100), -(7761, 88, 677, 'Dinggang', 'Dinggang', 200), -(7762, 88, 677, 'Jinzhuang', 'Jinzhuang', 300), -(7763, 88, 677, 'Nanjing', 'Nanjing', 400), -(7764, 88, 677, 'Nantong', 'Nantong', 500), -(7765, 88, 677, 'Suzhou', 'Suzhou', 600), -(7766, 88, 677, 'Tai', 'Tai', 700), -(7767, 88, 677, 'Taizhou', 'Taizhou', 800), -(7768, 88, 677, 'Wuxi', 'Wuxi', 900), -(7769, 88, 677, 'Xuzhou', 'Xuzhou', 1000), -(7770, 88, 677, 'Yangzhou', 'Yangzhou', 1100), -(7771, 88, 677, 'Zhangjiagang', 'Zhangjiagang', 1200), -(7772, 88, 677, 'Zhangjiagang Shi', 'Zhangjiagang Shi', 1300), -(7773, 88, 678, '.Wanjialing', '.Wanjialing', 100), -(7774, 88, 678, 'Fuzhou', 'Fuzhou', 200), -(7775, 88, 678, 'Nanchang', 'Nanchang', 300), -(7776, 88, 679, 'Anguan', 'Anguan', 100), -(7777, 88, 679, 'Antuzhan', 'Antuzhan', 200), -(7778, 88, 679, 'Changanpu', 'Changanpu', 300), -(7779, 88, 679, 'Changchuan', 'Changchuan', 400), -(7780, 88, 679, 'Changchun', 'Changchun', 500), -(7781, 88, 679, 'Changchun Shi', 'Changchun Shi', 600), -(7782, 88, 679, 'Changchunshih', 'Changchunshih', 700), -(7783, 88, 679, 'Huichun', 'Huichun', 800), -(7784, 88, 679, 'Hunchun', 'Hunchun', 900), -(7785, 88, 679, 'Jilin', 'Jilin', 1000), -(7786, 88, 679, 'Siping', 'Siping', 1100), -(7787, 88, 679, 'Xukedi', 'Xukedi', 1200), -(7788, 88, 679, 'Yanji', 'Yanji', 1300), -(7789, 88, 680, 'Anshan', 'Anshan', 100), -(7790, 88, 680, 'Beijing', 'Beijing', 200), -(7791, 88, 680, 'Dalian', 'Dalian', 300), -(7792, 88, 680, 'Dandong', 'Dandong', 400), -(7793, 88, 680, 'Jinzhou', 'Jinzhou', 500), -(7794, 88, 680, 'Langtou', 'Langtou', 600), -(7795, 88, 680, 'Lshun', 'Lshun', 700), -(7796, 88, 680, 'Panshan', 'Panshan', 800), -(7797, 88, 680, 'Shenyang', 'Shenyang', 900), -(7798, 88, 680, 'Shenyang Shi', 'Shenyang Shi', 1000), -(7799, 88, 681, 'Abag Qi', 'Abag Qi', 100), -(7800, 88, 681, 'Ayulhai', 'Ayulhai', 200), -(7801, 88, 681, 'Baotou', 'Baotou', 300), -(7802, 88, 681, 'Hailar', 'Hailar', 400), -(7803, 88, 681, 'Hohhot', 'Hohhot', 500), -(7804, 88, 681, 'Huhe Hoter', 'Huhe Hoter', 600), -(7805, 88, 681, 'Huhehot', 'Huhehot', 700), -(7806, 88, 681, 'Huhohaote', 'Huhohaote', 800), -(7807, 88, 681, 'Manchouli', 'Manchouli', 900), -(7808, 88, 681, 'Manchuria', 'Manchuria', 1000), -(7809, 88, 681, 'Manchzhuriya', 'Manchzhuriya', 1100), -(7810, 88, 681, 'Manzhouli', 'Manzhouli', 1200), -(7811, 88, 681, 'Mongol Us', 'Mongol Us', 1300), -(7812, 88, 681, 'Wuhai', 'Wuhai', 1400), -(7813, 88, 682, 'Yinchuan', 'Yinchuan', 100), -(7814, 88, 683, 'Adoi', 'Adoi', 100), -(7815, 88, 683, 'Jangsib', 'Jangsib', 200), -(7816, 88, 683, 'Qinghaihu', 'Qinghaihu', 300), -(7817, 88, 684, 'Andin', 'Andin', 100), -(7818, 88, 684, 'Xian', 'Xian', 200), -(7819, 88, 684, 'Xian Shi', 'Xian Shi', 300), -(7820, 88, 685, 'Baijiadian', 'Baijiadian', 100), -(7821, 88, 685, 'Dongying', 'Dongying', 200), -(7822, 88, 685, 'Jiaoqiao', 'Jiaoqiao', 300), -(7823, 88, 685, 'Jinan', 'Jinan', 400), -(7824, 88, 685, 'Linyi', 'Linyi', 500), -(7825, 88, 685, 'Longkou', 'Longkou', 600), -(7826, 88, 685, 'Qiandao', 'Qiandao', 700), -(7827, 88, 685, 'Qingdao', 'Qingdao', 800), -(7828, 88, 685, 'Qingdao Shi', 'Qingdao Shi', 900), -(7829, 88, 685, 'Shidao', 'Shidao', 1000), -(7830, 88, 685, 'Shouguang', 'Shouguang', 1100), -(7831, 88, 685, 'Taian', 'Taian', 1200), -(7832, 88, 685, 'Weifang', 'Weifang', 1300), -(7833, 88, 685, 'Weihai', 'Weihai', 1400), -(7834, 88, 685, 'Yantai', 'Yantai', 1500), -(7835, 88, 685, 'Zibo', 'Zibo', 1600), -(7836, 88, 686, 'Anchuang', 'Anchuang', 100), -(7837, 88, 686, 'Changchai', 'Changchai', 200), -(7838, 88, 686, 'Hexingzhen', 'Hexingzhen', 300), -(7839, 88, 686, 'Pudong', 'Pudong', 400), -(7840, 88, 686, 'Puto', 'Puto', 500), -(7841, 88, 686, 'Putung', 'Putung', 600), -(7842, 88, 686, 'Qianqiao', 'Qianqiao', 700), -(7843, 88, 686, 'Shanghai', 'Shanghai', 800), -(7844, 88, 686, 'Shenjiazhen', 'Shenjiazhen', 900), -(7845, 88, 686, 'Songjiang', 'Songjiang', 1000), -(7846, 88, 686, 'Wusi', 'Wusi', 1100), -(7847, 88, 686, 'Xuhui', 'Xuhui', 1200), -(7848, 88, 686, 'Zhuzhai', 'Zhuzhai', 1300), -(7849, 88, 687, 'Ani', 'Ani', 100), -(7850, 88, 687, 'Changhang', 'Changhang', 200), -(7851, 88, 687, 'Taiyan', 'Taiyan', 300), -(7852, 88, 687, 'Taiyangcun', 'Taiyangcun', 400), -(7853, 88, 687, 'Taiyuan', 'Taiyuan', 500), -(7854, 88, 687, 'Xiaan', 'Xiaan', 600), -(7855, 88, 687, 'Xianren Xiang', 'Xianren Xiang', 700), -(7856, 88, 687, 'Xiyan', 'Xiyan', 800), -(7857, 88, 688, 'Chengdu', 'Chengdu', 100), -(7858, 88, 689, 'Balitai', 'Balitai', 100), -(7859, 88, 689, 'Tanggu', 'Tanggu', 200), -(7860, 88, 689, 'Tangku', 'Tangku', 300), -(7861, 88, 689, 'Tianjin', 'Tianjin', 400), -(7862, 88, 689, 'Tianjin Shi', 'Tianjin Shi', 500), -(7863, 88, 689, 'Tianjing', 'Tianjing', 600), -(7864, 88, 689, 'Xianshuigu', 'Xianshuigu', 700), -(7865, 88, 690, 'Abad', 'Abad', 100), -(7866, 88, 690, 'Akto', 'Akto', 200), -(7867, 88, 690, 'Aletai', 'Aletai', 300), -(7868, 88, 690, 'Altai', 'Altai', 400), -(7869, 88, 690, 'Beishanyanchi', 'Beishanyanchi', 500), -(7870, 88, 690, 'Burqin', 'Burqin', 600), -(7871, 88, 690, 'Chantszi', 'Chantszi', 700), -(7872, 88, 690, 'Hami', 'Hami', 800), -(7873, 88, 690, 'Ining', 'Ining', 900), -(7874, 88, 690, 'Kashgar', 'Kashgar', 1000), -(7875, 88, 690, 'Kashi Shi', 'Kashi Shi', 1100), -(7876, 88, 690, 'Knes', 'Knes', 1200), -(7877, 88, 690, 'Kulja', 'Kulja', 1300), -(7878, 88, 690, 'rmqi', 'rmqi', 1400), -(7879, 88, 690, 'rmqi Shi', 'rmqi Shi', 1500), -(7880, 88, 690, 'Urumchi', 'Urumchi', 1600), -(7881, 88, 690, 'Urumtschi', 'Urumtschi', 1700), -(7882, 88, 690, 'Urumutsi', 'Urumutsi', 1800), -(7883, 88, 690, 'Wulumuchi', 'Wulumuchi', 1900), -(7884, 88, 690, 'Wulumuchishih', 'Wulumuchishih', 2000), -(7885, 88, 690, 'Wurumchih', 'Wurumchih', 2100), -(7886, 88, 690, 'Xortang', 'Xortang', 2200), -(7887, 88, 690, 'Yaiko', 'Yaiko', 2300), -(7888, 88, 690, 'Yining', 'Yining', 2400), -(7889, 88, 690, 'Yiwu', 'Yiwu', 2500), -(7890, 88, 690, 'Zhaosu', 'Zhaosu', 2600), -(7891, 88, 691, 'Kunming', 'Kunming', 100), -(7892, 88, 691, 'Yiwu', 'Yiwu', 200), -(7893, 88, 692, 'Daitou', 'Daitou', 100), -(7894, 88, 692, 'Daniwan', 'Daniwan', 200), -(7895, 88, 692, 'Hangzhou', 'Hangzhou', 300), -(7896, 88, 692, 'Jinhua', 'Jinhua', 400), -(7897, 88, 692, 'Lanxi', 'Lanxi', 500), -(7898, 88, 692, 'Ningbo', 'Ningbo', 600), -(7899, 88, 692, 'Ningpo', 'Ningpo', 700), -(7900, 88, 692, 'Shangyu', 'Shangyu', 800), -(7901, 88, 692, 'Shaoxing', 'Shaoxing', 900), -(7902, 88, 692, 'Shenze', 'Shenze', 1000), -(7903, 88, 692, 'Shenzhen', 'Shenzhen', 1100), -(7904, 88, 692, 'Wenzhou', 'Wenzhou', 1200), -(7905, 88, 692, 'Xiangshan', 'Xiangshan', 1300), -(7906, 88, 692, 'Yiwu', 'Yiwu', 1400), -(7907, 88, 692, 'Yongkang', 'Yongkang', 1500), -(7908, 88, 692, 'Zhoushan', 'Zhoushan', 1600), -(7909, 89, 693, 'Abisinia', 'Abisinia', 100), -(7910, 89, 693, 'Amacocha', 'Amacocha', 200), -(7911, 89, 694, 'Abejorral', 'Abejorral', 100), -(7912, 89, 694, 'Aguamuerta', 'Aguamuerta', 200), -(7913, 89, 694, 'Caucasia', 'Caucasia', 300), -(7914, 89, 694, 'La Mesenia', 'La Mesenia', 400), -(7915, 89, 694, 'Medelln', 'Medelln', 500), -(7916, 89, 694, 'Sabaneta', 'Sabaneta', 600), -(7917, 89, 694, 'San Vicente', 'San Vicente', 700), -(7918, 89, 695, 'Alczar', 'Alczar', 100), -(7919, 89, 695, 'Barranquilla', 'Barranquilla', 200), -(7920, 89, 695, 'Colombia', 'Colombia', 300), -(7921, 89, 696, 'Cachiza', 'Cachiza', 100), -(7922, 89, 697, 'Popayn', 'Popayn', 100), -(7923, 89, 697, 'Santander de Quilichao', 'Santander de Quilichao', 200), -(7924, 89, 698, 'Acos', 'Acos', 100), -(7925, 89, 698, 'Las Hamacas', 'Las Hamacas', 200), -(7926, 89, 698, 'Quibd', 'Quibd', 300), -(7927, 89, 699, 'Aguas Claras', 'Aguas Claras', 100), -(7928, 89, 699, 'Montera', 'Montera', 200), -(7929, 89, 700, 'Arauca', 'Arauca', 100), -(7930, 89, 700, 'Valledupar', 'Valledupar', 200), -(7931, 89, 701, 'Bogot', 'Bogot', 100), -(7932, 89, 701, 'Cha', 'Cha', 200), -(7933, 89, 701, 'Funza', 'Funza', 300), -(7934, 89, 701, 'Fusagasuga', 'Fusagasuga', 400), -(7935, 89, 701, 'Girardot', 'Girardot', 500), -(7936, 89, 701, 'Soacha', 'Soacha', 600), -(7937, 89, 702, 'Barrio Boyac', 'Barrio Boyac', 100), -(7938, 89, 702, 'Bravo Pez', 'Bravo Pez', 200), -(7939, 89, 703, 'Arabia', 'Arabia', 100), -(7940, 89, 703, 'Bogot', 'Bogot', 200), -(7941, 89, 703, 'Isnos', 'Isnos', 300), -(7942, 89, 703, 'Mxico', 'Mxico', 400), -(7943, 89, 703, 'Neiva', 'Neiva', 500), -(7944, 89, 704, 'Maicao', 'Maicao', 100), -(7945, 89, 704, 'Rohacha', 'Rohacha', 200), -(7946, 89, 705, 'Berln', 'Berln', 100), -(7947, 89, 705, 'Villavicencio', 'Villavicencio', 200), -(7948, 89, 706, 'Bolvar', 'Bolvar', 100), -(7949, 89, 706, 'Tumaco', 'Tumaco', 200), -(7950, 89, 707, 'Apartadero', 'Apartadero', 100), -(7951, 89, 707, 'Ccuta', 'Ccuta', 200), -(7952, 89, 708, 'Armenia', 'Armenia', 100), -(7953, 89, 708, 'Crdoba', 'Crdoba', 200), -(7954, 89, 709, 'Belmonte', 'Belmonte', 100), -(7955, 89, 709, 'Boquern', 'Boquern', 200), -(7956, 89, 709, 'Cartago Viejo', 'Cartago Viejo', 300), -(7957, 89, 709, 'Pereira', 'Pereira', 400), -(7958, 89, 710, 'Aguas Claras', 'Aguas Claras', 100), -(7959, 89, 710, 'Bucaramanga', 'Bucaramanga', 200), -(7960, 89, 710, 'Floridablanca', 'Floridablanca', 300), -(7961, 89, 710, 'San Gil', 'San Gil', 400), -(7962, 89, 711, 'Ibagu', 'Ibagu', 100), -(7963, 90, 712, 'Морони', 'Moroni', 100), -(7964, 91, 713, 'Браззавиль', 'Braazzavil''', 100), -(7965, 91, 713, 'Кабинда', 'Kabinda', 200), -(7966, 91, 713, 'Пуэнт-Нуар', 'Puent-Nuar', 300), -(7967, 92, 714, 'Киншаса', 'Kinshasa', 100), -(7968, 93, 715, 'Alajuela', 'Alajuela', 100), -(7969, 93, 715, 'Ciudad Quesada', 'Ciudad Quesada', 200), -(7970, 93, 715, 'Fortuna', 'Fortuna', 300), -(7971, 93, 715, 'Grecia', 'Grecia', 400), -(7972, 93, 716, 'Aragn', 'Aragn', 100), -(7973, 93, 716, 'Arenilla', 'Arenilla', 200), -(7974, 93, 716, 'Cach', 'Cach', 300), -(7975, 93, 716, 'Cartago', 'Cartago', 400), -(7976, 93, 717, 'Caas', 'Caas', 100), -(7977, 93, 717, 'Nicoya', 'Nicoya', 200), -(7978, 93, 718, 'Heredia', 'Heredia', 100), -(7979, 93, 718, 'San Antonio de Belen', 'San Antonio de Belen', 200), -(7980, 93, 718, 'San Juan Abajo', 'San Juan Abajo', 300), -(7981, 93, 718, 'San Pablo', 'San Pablo', 400), -(7982, 93, 719, 'Agbeta', 'Agbeta', 100), -(7983, 93, 719, 'Altos Herediana', 'Altos Herediana', 200), -(7984, 93, 719, 'Asuncin', 'Asuncin', 300), -(7985, 93, 719, 'Atlanta', 'Atlanta', 400), -(7986, 93, 719, 'frica', 'frica', 500), -(7987, 93, 719, 'Puerto Viejo', 'Puerto Viejo', 600), -(7988, 93, 720, 'Aro', 'Aro', 100), -(7989, 93, 720, 'Baja Moras', 'Baja Moras', 200), -(7990, 93, 720, 'Jac', 'Jac', 300), -(7991, 93, 721, 'Alto', 'Alto', 100), -(7992, 93, 721, 'Barrio Escalante', 'Barrio Escalante', 200), -(7993, 93, 721, 'Barrio Urea', 'Barrio Urea', 300), -(7994, 93, 721, 'Calle Blancos', 'Calle Blancos', 400), -(7995, 93, 721, 'Curridabat', 'Curridabat', 500), -(7996, 93, 721, 'Escaz', 'Escaz', 600), -(7997, 93, 721, 'Morado', 'Morado', 700), -(7998, 93, 721, 'San Jos', 'San Jos', 800), -(7999, 93, 721, 'San Pedro', 'San Pedro', 900), -(8000, 94, 722, 'Абиджан', 'Abidzhan', 100), -(8001, 94, 722, 'Ямусукро', 'Yamusukro', 200), -(8002, 95, 723, 'Aguacatico', 'Aguacatico', 100), -(8003, 95, 723, 'Camagey', 'Camagey', 200), -(8004, 95, 723, 'Colonia', 'Colonia', 300), -(8005, 95, 724, 'Adela', 'Adela', 100), -(8006, 95, 724, 'Alonzo', 'Alonzo', 200), -(8007, 95, 724, 'Baragu', 'Baragu', 300), -(8008, 95, 724, 'Habana', 'Habana', 400), -(8009, 95, 724, 'Morn', 'Morn', 500), -(8010, 95, 725, 'Habana', 'Habana', 100), -(8011, 95, 725, 'Havana', 'Havana', 200), -(8012, 95, 725, 'La Habana', 'La Habana', 300), -(8013, 95, 725, 'Nuevo Vedado', 'Nuevo Vedado', 400), -(8014, 95, 725, 'Playa', 'Playa', 500), -(8015, 95, 726, 'Arroz', 'Arroz', 100), -(8016, 95, 726, 'Manzanillo', 'Manzanillo', 200), -(8017, 95, 727, 'Arena', 'Arena', 100), -(8018, 95, 727, 'Cabana', 'Cabana', 200), -(8019, 95, 727, 'Guantnamo', 'Guantnamo', 300), -(8020, 95, 727, 'Guatanamo', 'Guatanamo', 400), -(8021, 95, 727, 'Santa Mara', 'Santa Mara', 500), -(8022, 95, 728, 'Cacocn', 'Cacocn', 100), -(8023, 95, 728, 'Holgun', 'Holgun', 200), -(8024, 95, 729, 'La Palma', 'La Palma', 100), -(8025, 95, 729, 'Santa Brbara', 'Santa Brbara', 200), -(8026, 95, 730, 'Abajo', 'Abajo', 100), -(8027, 95, 730, 'Amistad', 'Amistad', 200), -(8028, 95, 730, 'Andres', 'Andres', 300), -(8029, 95, 730, 'Antiguo Central de Santa Luca', 'Antiguo Central de Santa Luca', 400), -(8030, 95, 730, 'Ave Mara', 'Ave Mara', 500), -(8031, 95, 730, 'Buenos Aires', 'Buenos Aires', 600), -(8032, 95, 730, 'Cardona', 'Cardona', 700), -(8033, 95, 730, 'Carmen', 'Carmen', 800), -(8034, 95, 730, 'Casa Blanca', 'Casa Blanca', 900), -(8035, 95, 730, 'Cervantes', 'Cervantes', 1000), -(8036, 95, 730, 'Coca', 'Coca', 1100), -(8037, 95, 730, 'Habana Libre', 'Habana Libre', 1200), -(8038, 95, 730, 'La Molina', 'La Molina', 1300), -(8039, 95, 730, 'La Rosa', 'La Rosa', 1400), -(8040, 95, 730, 'Los Cocos', 'Los Cocos', 1500), -(8041, 95, 730, 'Zorrilla', 'Zorrilla', 1600), -(8042, 95, 731, 'La Rosa', 'La Rosa', 100), -(8043, 95, 732, 'Amador', 'Amador', 100), -(8044, 95, 732, 'Perico', 'Perico', 200), -(8045, 95, 732, 'Varadero', 'Varadero', 300), -(8046, 95, 733, 'Brisas del Mar', 'Brisas del Mar', 100), -(8047, 95, 733, 'Monicas Mora', 'Monicas Mora', 200), -(8048, 95, 734, 'Aida', 'Aida', 100), -(8049, 95, 734, 'Antunes', 'Antunes', 200), -(8050, 95, 734, 'Bardallo', 'Bardallo', 300), -(8051, 95, 734, 'Buena Vista', 'Buena Vista', 400), -(8052, 95, 734, 'Santa Mara', 'Santa Mara', 500), -(8053, 95, 735, 'Campana', 'Campana', 100), -(8054, 95, 735, 'Sancti Spritus', 'Sancti Spritus', 200), -(8055, 95, 736, 'Alto del Villaln', 'Alto del Villaln', 100), -(8056, 95, 736, 'Amelia', 'Amelia', 200), -(8057, 95, 736, 'Campana', 'Campana', 300), -(8058, 95, 736, 'Colonia Nmero 7', 'Colonia Nmero 7', 400), -(8059, 95, 736, 'Cristo', 'Cristo', 500), -(8060, 95, 736, 'Dulce Nombre', 'Dulce Nombre', 600), -(8061, 95, 736, 'Guaninao', 'Guaninao', 700), -(8062, 95, 736, 'Quintero', 'Quintero', 800), -(8063, 95, 736, 'Santiago de Cuba', 'Santiago de Cuba', 900), -(8064, 95, 737, 'Aguada de Carillo', 'Aguada de Carillo', 100), -(8065, 95, 737, 'Anita', 'Anita', 200), -(8066, 95, 737, 'Antonia Rosa', 'Antonia Rosa', 300), -(8067, 95, 737, 'Buena Vista', 'Buena Vista', 400), -(8068, 95, 737, 'Calabazar de Sagua', 'Calabazar de Sagua', 500), -(8069, 95, 737, 'La Fortuna', 'La Fortuna', 600), -(8070, 95, 737, 'Santa Clara', 'Santa Clara', 700), -(8071, 96, 738, 'Аль-Яхра', 'Аль-Яхра', 100), -(8072, 96, 739, 'Эль-Кувейт', 'Эль-Кувейт', 100), -(8073, 97, 740, 'Аваруа', 'Аваруа', 100), -(8074, 98, 741, 'Ак-Шыйрак', 'Ак-Шыйрак', 100), -(8075, 98, 741, 'Ананьево', 'Ананьево', 200), -(8076, 98, 741, 'Боконбаевское', 'Боконбаевское', 300), -(8077, 98, 741, 'Бостери', 'Бостери', 400), -(8078, 98, 741, 'Каджи-Сай', 'Каджи-Сай', 500), -(8079, 98, 741, 'Кызыл Туу', 'Кызыл Туу', 600), -(8080, 98, 741, 'Покровка', 'Покровка', 700), -(8081, 98, 741, 'Пржевальск', 'Пржевальск', 800), -(8082, 98, 741, 'Рыбачье', 'Рыбачье', 900), -(8083, 98, 741, 'Тюп', 'Тюп', 1000), -(8084, 98, 741, 'Чолпон-Ата', 'Чолпон-Ата', 1100), -(8085, 98, 742, 'Ак-Суу', 'Ак-Суу', 100), -(8086, 98, 742, 'Араван', 'Араван', 200), -(8087, 98, 742, 'Балыкчи', 'Балыкчи', 300), -(8088, 98, 742, 'Беловодское', 'Беловодское', 400), -(8089, 98, 742, 'Бишкек', 'Бишкек', 500), -(8090, 98, 742, 'Боконбаевское', 'Боконбаевское', 600), -(8091, 98, 742, 'Быстровка', 'Быстровка', 700), -(8092, 98, 742, 'Жалал Абад', 'Жалал Абад', 800), -(8093, 98, 742, 'Ивановка', 'Ивановка', 900), -(8094, 98, 742, 'Каинды', 'Каинды', 1000), -(8095, 98, 742, 'Кант', 'Кант', 1100), -(8096, 98, 742, 'Кара-Балта', 'Кара-Балта', 1200), -(8097, 98, 742, 'Караван', 'Караван', 1300), -(8098, 98, 742, 'Каракол', 'Каракол', 1400), -(8099, 98, 742, 'Кемин', 'Кемин', 1500), -(8100, 98, 742, 'Кербен', 'Кербен', 1600), -(8101, 98, 742, 'Лебединовка', 'Лебединовка', 1700), -(8102, 98, 742, 'Майлуу-Суу', 'Майлуу-Суу', 1800), -(8103, 98, 742, 'Нарын', 'Нарын', 1900), -(8104, 98, 742, 'Ош', 'Ош', 2000), -(8105, 98, 742, 'Пульгон', 'Пульгон', 2100), -(8106, 98, 742, 'Соколук', 'Соколук', 2200), -(8107, 98, 742, 'Талас', 'Талас', 2300), -(8108, 98, 742, 'Таш-Кумыр', 'Таш-Кумыр', 2400), -(8109, 98, 742, 'Токмак', 'Токмак', 2500), -(8110, 98, 742, 'Чолпон-Ата', 'Чолпон-Ата', 2600), -(8111, 98, 742, 'Чуй', 'Чуй', 2700), -(8112, 98, 742, 'Эски-Ноокат', 'Эски-Ноокат', 2800), -(8113, 98, 743, 'Ат-Баши', 'Ат-Баши', 100), -(8114, 98, 743, 'Дюрбельджин', 'Дюрбельджин', 200), -(8115, 98, 743, 'Казарман', 'Казарман', 300), -(8116, 98, 743, 'Кочкорка', 'Кочкорка', 400), -(8117, 98, 743, 'Нарын', 'Нарын', 500), -(8118, 98, 743, 'Чаек', 'Чаек', 600), -(8119, 98, 744, 'Ак-Там', 'Ак-Там', 100), -(8120, 98, 744, 'Ала-Бука', 'Ала-Бука', 200), -(8121, 98, 744, 'Араван', 'Араван', 300), -(8122, 98, 744, 'Базар-Курган', 'Базар-Курган', 400), -(8123, 98, 744, 'Баткен', 'Баткен', 500), -(8124, 98, 744, 'Гульча', 'Гульча', 600), -(8125, 98, 744, 'Джалал-Абад', 'Джалал-Абад', 700), -(8126, 98, 744, 'Исфана', 'Исфана', 800), -(8127, 98, 744, 'Кара-Кульджа', 'Кара-Кульджа', 900), -(8128, 98, 744, 'Кара-Суу', 'Кара-Суу', 1000), -(8129, 98, 744, 'Караван', 'Караван', 1100), -(8130, 98, 744, 'Кок-Янгак', 'Кок-Янгак', 1200), -(8131, 98, 744, 'Кызыл-Кия', 'Кызыл-Кия', 1300), -(8132, 98, 744, 'Майли-Сай', 'Майли-Сай', 1400), -(8133, 98, 744, 'Ош', 'Ош', 1500), -(8134, 98, 744, 'Сары-Таш', 'Сары-Таш', 1600), -(8135, 98, 744, 'Сулюкта', 'Сулюкта', 1700), -(8136, 98, 744, 'Таш-Кумыр', 'Таш-Кумыр', 1800), -(8137, 98, 744, 'Узген', 'Узген', 1900), -(8138, 98, 744, 'Фрунзе', 'Фрунзе', 2000), -(8139, 98, 744, 'Хайдаркен', 'Хайдаркен', 2100), -(8140, 98, 745, 'Кара-Куль', 'Кара-Куль', 100), -(8141, 98, 745, 'Кировское', 'Кировское', 200), -(8142, 98, 745, 'Ленинполь', 'Ленинполь', 300), -(8143, 98, 745, 'Покровка', 'Покровка', 400), -(8144, 98, 745, 'Талас', 'Талас', 500), -(8145, 98, 745, 'Токтогул', 'Токтогул', 600), -(8146, 98, 745, 'Толук', 'Толук', 700), -(8147, 99, 746, 'Вьентьян', 'V''ent''yan', 100), -(8148, 100, 747, 'Айзпуте', 'Aizpute', 100), -(8149, 100, 747, 'Айнажи', 'Ainazhi', 200), -(8150, 100, 747, 'Алоя', 'Aloya', 300), -(8151, 100, 747, 'Алсунга', 'Alsunga', 400), -(8152, 100, 747, 'Алуксне', 'Aluksne', 500), -(8153, 100, 747, 'Апе', 'Ape', 600), -(8154, 100, 747, 'Ауце', 'Autse', 700), -(8155, 100, 747, 'Балви', 'Balvi', 800), -(8156, 100, 747, 'Балдоне', 'Baldone', 900), -(8157, 100, 747, 'Баложи', 'Balozhi', 1000), -(8158, 100, 747, 'Бауска', 'Bauska', 1100), -(8159, 100, 747, 'Бене', 'Bene', 1200), -(8160, 100, 747, 'Броцены', 'Brotseny', 1300), -(8161, 100, 747, 'Валка', 'Valka', 1400), -(8162, 100, 747, 'Валмиера', 'Valmiera', 1500), -(8163, 100, 747, 'Варакляны', 'Varaklyany', 1600), -(8164, 100, 747, 'Вентспилс', 'Ventspils', 1700), -(8165, 100, 747, 'Виляка', 'Vilyaka', 1800), -(8166, 100, 747, 'Виляны', 'Vilyany', 1900), -(8167, 100, 747, 'Гробиня', 'Grobinya', 2000), -(8168, 100, 747, 'Гулбене', 'Gulbene', 2100), -(8169, 100, 747, 'Гульбене', 'Gulbene', 2200), -(8170, 100, 747, 'Даугавпилс', 'Daugavpils', 2300), -(8171, 100, 747, 'Добеле', 'Dobele', 2400), -(8172, 100, 747, 'Дундага', 'Dundaga', 2500), -(8173, 100, 747, 'Дурбе', 'Durbe', 2600), -(8174, 100, 747, 'Екабпилс', 'Ekabpils', 2700), -(8175, 100, 747, 'Елгава', 'Elgava', 2800), -(8176, 100, 747, 'Зилупе', 'Zilupe', 2900), -(8177, 100, 747, 'Иецава', 'Ietsava', 3000), -(8178, 100, 747, 'Илуксте', 'Ilukste', 3100), -(8179, 100, 747, 'Калнциемс', 'Kalntsiems', 3200), -(8180, 100, 747, 'Кандава', 'Kandava', 3300), -(8181, 100, 747, 'Карсава', 'Karsava', 3400), -(8182, 100, 747, 'Кегумс', 'Kegums', 3500), -(8183, 100, 747, 'Кокнесе', 'Koknese', 3600), -(8184, 100, 747, 'Колка', 'Kolka', 3700), -(8185, 100, 747, 'Краслава', 'Kraslava', 3800), -(8186, 100, 747, 'Кулдига', 'Kuldiga', 3900), -(8187, 100, 747, 'Ливаны', 'Livany', 4000), -(8188, 100, 747, 'Лиепая', 'Liepaya', 4100), -(8189, 100, 747, 'Лимбажи', 'Limbazhi', 4200), -(8190, 100, 747, 'Лудза', 'Ludza', 4300), -(8191, 100, 747, 'Мадона', 'Madona', 4400), -(8192, 100, 747, 'Огре', 'Ogre', 4500), -(8193, 100, 747, 'Плявиняс', 'Plyavinyas', 4600), -(8194, 100, 747, 'Прейли', 'Preili', 4700), -(8195, 100, 747, 'Резекне', 'Rezekne', 4800), -(8196, 100, 747, 'Рига', 'Riga', 4900), -(8197, 100, 747, 'Салдус', 'Saldus', 5000), -(8198, 100, 747, 'Сигулда', 'Sigulda', 5100), -(8199, 100, 747, 'Стучка', 'Stuchka', 5200), -(8200, 100, 747, 'Талси', 'Talsi', 5300), -(8201, 100, 747, 'Тукумс', 'Tukums', 5400), -(8202, 100, 747, 'Цесис', 'Tsesis', 5500), -(8203, 100, 747, 'Элея', 'Eleya', 5600), -(8204, 100, 747, 'Юрмала', 'Yurmala', 5700), -(8205, 101, 748, 'Масеру', 'Maseru', 100), -(8206, 102, 749, 'Монровия', 'Monroviya', 100), -(8207, 103, 750, 'Бейрут', 'Beirut', 100), -(8208, 103, 750, 'Бейрут', 'Beirut', 200), -(8209, 104, 751, 'Триполи', 'Tripoli', 100), -(8210, 104, 752, 'Бенгази', 'Bengasi', 100), -(8211, 105, 753, 'Адутишкис', 'Adutishkis', 100), -(8212, 105, 753, 'Алитус', 'Alitus', 200), -(8213, 105, 753, 'Аникщчяй', 'Anikshchchyai', 300), -(8214, 105, 753, 'Ариогала', 'Ariogala', 400), -(8215, 105, 753, 'Балтойи-Воке', 'Baltoii-Voke', 500), -(8216, 105, 753, 'Бальберишкис', 'Balberishkis', 600), -(8217, 105, 753, 'Биржай', 'Birzhai', 700), -(8218, 105, 753, 'Бирштонас', 'Birshtonas', 800), -(8219, 105, 753, 'Вабальнинкас', 'Vabalninkas', 900), -(8220, 105, 753, 'Ванджиогала', 'Vandzhiogala', 1000), -(8221, 105, 753, 'Варена', 'Varena', 1100), -(8222, 105, 753, 'Виевис', 'Vievis', 1200), -(8223, 105, 753, 'Вилкавишкис', 'Vilkavishkis', 1300), -(8224, 105, 753, 'Вилькия', 'Vilkiya', 1400), -(8225, 105, 753, 'Вильно', 'Vilno', 1500), -(8226, 105, 753, 'Вильнюс', 'Vilnyus', 1600), -(8227, 105, 753, 'Вирбалис', 'Virbalis', 1700), -(8228, 105, 753, 'Висагинас', 'Visaginas', 1800), -(8229, 105, 753, 'Гаргждай', 'Gargzhdai', 1900), -(8230, 105, 753, 'Гарлява', 'Garlyava', 2000), -(8231, 105, 753, 'Даугай', 'Daugai', 2100), -(8232, 105, 753, 'Друскининкай', 'Druskininkai', 2200), -(8233, 105, 753, 'Дукштас', 'Dukshtas', 2300), -(8234, 105, 753, 'Дусетос', 'Dusetos', 2400), -(8235, 105, 753, 'Ейшишес', 'Eishishes', 2500), -(8236, 105, 753, 'Жагаре', 'Zhagare', 2600), -(8237, 105, 753, 'Зарасай', 'Zarasai', 2700), -(8238, 105, 753, 'Игналина', 'Ignalina', 2800), -(8239, 105, 753, 'Ионишкис', 'Ionishkis', 2900), -(8240, 105, 753, 'Йонава', 'Ionava', 3000), -(8241, 105, 753, 'Казлу-Руда', 'Kazlu-Ruda', 3100), -(8242, 105, 753, 'Кайшядорис', 'Kaishyadoris', 3200), -(8243, 105, 753, 'Каунас', 'Kaunas', 3300), -(8244, 105, 753, 'Качергине', 'Kachergine', 3400), -(8245, 105, 753, 'Кедайняй', 'Kedainyai', 3500), -(8246, 105, 753, 'Кельме', 'Kelme', 3600), -(8247, 105, 753, 'Кибартай', 'Kibartai', 3700), -(8248, 105, 753, 'Клайпеда', 'Klaipeda', 3800), -(8249, 105, 753, 'Ковно', 'Kovno', 3900), -(8250, 105, 753, 'Кретинга', 'Kretinga', 4000), -(8251, 105, 753, 'Кулаутува', 'Kulautuva', 4100), -(8252, 105, 753, 'куодас', 'kuodas', 4200), -(8253, 105, 753, 'Куршенай', 'Kurshenai', 4300), -(8254, 105, 753, 'Лаздияй', 'Lazdiyai', 4400), -(8255, 105, 753, 'Лентварис', 'Lentvaris', 4500), -(8256, 105, 753, 'Мажейкяй', 'Mazheikyai', 4600), -(8257, 105, 753, 'Марьямполе (Капсукас)', 'Maryampole (Kapsukas)', 4700), -(8258, 105, 753, 'Меркине', 'Merkine', 4800), -(8259, 105, 753, 'Молетай', 'Moletai', 4900), -(8260, 105, 753, 'Науйойи-Акмяне', 'Nauioii-Akmyane', 5000), -(8261, 105, 753, 'Нида', 'Nida', 5100), -(8262, 105, 753, 'Пабраде', 'Pabrade', 5200), -(8263, 105, 753, 'Пагегяй', 'Pagegyai', 5300), -(8264, 105, 753, 'Пакруоис', 'Pakruois', 5400), -(8265, 105, 753, 'Паланга', 'Palanga', 5500), -(8266, 105, 753, 'Паневежис', 'Panevezhis', 5600), -(8267, 105, 753, 'Пасвалис', 'Pasvalis', 5700), -(8268, 105, 753, 'Плунге', 'Plunge', 5800), -(8269, 105, 753, 'Приенай', 'Prienai', 5900), -(8270, 105, 753, 'Радвилишкис', 'Radvilishkis', 6000), -(8271, 105, 753, 'Расейняй', 'Raseinyai', 6100), -(8272, 105, 753, 'Риетавас', 'Rietavas', 6200), -(8273, 105, 753, 'Рокишкис', 'Rokishkis', 6300), -(8274, 105, 753, 'Симнас', 'Simnas', 6400), -(8275, 105, 753, 'Скаудвиле', 'Skaudvile', 6500), -(8276, 105, 753, 'Таураге', 'Taurage', 6600), -(8277, 105, 753, 'Тельшяй', 'Telshyai', 6700), -(8278, 105, 753, 'Тракай', 'Trakai', 6800), -(8279, 105, 753, 'Укмерге', 'Ukmerge', 6900), -(8280, 105, 753, 'Утена', 'Utena', 7000), -(8281, 105, 753, 'Шакяй', 'Shakyai', 7100), -(8282, 105, 753, 'Шальчининкай', 'Shalchininkai', 7200), -(8283, 105, 753, 'Швенченеляй', 'Shvenchenelyai', 7300), -(8284, 105, 753, 'Швенчионис', 'Shvenchionis', 7400), -(8285, 105, 753, 'Шета', 'Sheta', 7500), -(8286, 105, 753, 'Шилале', 'Shilale', 7600), -(8287, 105, 753, 'Шилуте', 'Shilute', 7700), -(8288, 105, 753, 'Ширвинтос', 'Shirvintos', 7800), -(8289, 105, 753, 'Шяуляй', 'Shyaulyai', 7900), -(8290, 105, 753, 'Эжярелис', 'Ezhyarelis', 8000), -(8291, 105, 753, 'Юрбаркас', 'Yurbarkas', 8100), -(8292, 106, 754, 'Balzers', 'Balzers', 100), -(8293, 106, 755, 'Eschen', 'Eschen', 100), -(8294, 106, 756, 'Ruggell', 'Ruggell', 100), -(8295, 106, 757, 'Schellenberg', 'Schellenberg', 100), -(8296, 106, 758, 'Triesen', 'Triesen', 100), -(8297, 106, 759, 'Vaduz', 'Vaduz', 100), -(8298, 107, 760, 'Allerborn', 'Allerborn', 100), -(8299, 107, 760, 'Baraques de Troine', 'Baraques de Troine', 200), -(8300, 107, 760, 'Diekirch', 'Diekirch', 300), -(8301, 107, 760, 'Esch', 'Esch', 400), -(8302, 107, 761, 'Assel', 'Assel', 100), -(8303, 107, 761, 'Berg-sur-Syre', 'Berg-sur-Syre', 200), -(8304, 107, 761, 'Lenningen', 'Lenningen', 300), -(8305, 107, 761, 'Remich', 'Remich', 400), -(8306, 107, 761, 'Wormeldange', 'Wormeldange', 500), -(8307, 107, 762, 'Airsain', 'Airsain', 100), -(8308, 107, 762, 'Angelsberg', 'Angelsberg', 200), -(8309, 107, 762, 'Ansembourg', 'Ansembourg', 300), -(8310, 107, 762, 'Beggen', 'Beggen', 400), -(8311, 107, 762, 'Belval', 'Belval', 500), -(8312, 107, 762, 'Berg', 'Berg', 600), -(8313, 107, 762, 'Bertrange', 'Bertrange', 700), -(8314, 107, 762, 'Bettembourg', 'Bettembourg', 800), -(8315, 107, 762, 'Bihl', 'Bihl', 900), -(8316, 107, 762, 'Bivange', 'Bivange', 1000), -(8317, 107, 762, 'Breldange', 'Breldange', 1100), -(8318, 107, 762, 'Dudelange', 'Dudelange', 1200), -(8319, 107, 762, 'Esch', 'Esch', 1300), -(8320, 107, 762, 'Gaichel', 'Gaichel', 1400), -(8321, 107, 762, 'Gras', 'Gras', 1500), -(8322, 107, 762, 'Italie', 'Italie', 1600), -(8323, 107, 762, 'Lampertsberg', 'Lampertsberg', 1700), -(8324, 107, 762, 'Limpertsberg', 'Limpertsberg', 1800), -(8325, 107, 762, 'Luxembourg', 'Luxembourg', 1900), -(8326, 107, 762, 'Luxemburg', 'Luxemburg', 2000), -(8327, 107, 762, 'Mersch', 'Mersch', 2100), -(8328, 107, 762, 'Neudorf', 'Neudorf', 2200), -(8329, 107, 762, 'Schifflange', 'Schifflange', 2300), -(8330, 107, 762, 'Schouweiler', 'Schouweiler', 2400), -(8331, 107, 762, 'Walferdange', 'Walferdange', 2500), -(8332, 107, 763, 'Acirie', 'Acirie', 100), -(8333, 107, 763, 'Berg', 'Berg', 200), -(8334, 107, 763, 'Birel', 'Birel', 300), -(8335, 107, 763, 'Bischenrech', 'Bischenrech', 400), -(8336, 108, 764, 'Порт-Луи', 'Port-Lyu', 100), -(8337, 109, 765, 'Нуакшот', 'Nouakchott', 100), -(8338, 110, 766, 'Антананариву', 'Antananarivu', 100), -(8339, 110, 766, 'Анцеранана', 'Antceranana', 200), -(8340, 110, 766, 'Анцирабе', 'Antcirabe', 300), -(8341, 110, 766, 'Манакара', 'Manakara', 400), -(8342, 110, 766, 'Туамасина', 'Tuamasina', 500), -(8343, 110, 766, 'Фианаранцура', 'Fianarantcura', 600), -(8344, 111, 767, 'Aracinovo', 'Aracinovo', 100), -(8345, 111, 768, 'Berovo', 'Berovo', 100), -(8346, 111, 769, 'Bitola', 'Bitola', 100), -(8347, 111, 769, 'Manastir', 'Manastir', 200), -(8348, 111, 770, 'Bosilevo', 'Bosilevo', 100), -(8349, 111, 771, 'Dolna Banjica', 'Dolna Banjica', 100), -(8350, 111, 772, 'Drugovo', 'Drugovo', 100), -(8351, 111, 773, 'Gevegeli', 'Gevegeli', 100), -(8352, 111, 773, 'Gevgelia', 'Gevgelia', 200), -(8353, 111, 774, 'Gostivar', 'Gostivar', 100), -(8354, 111, 775, 'Karpos', 'Karpos', 100), -(8355, 111, 775, 'Karpos Dva', 'Karpos Dva', 200), -(8356, 111, 776, 'Kavadarci', 'Kavadarci', 100), -(8357, 111, 777, 'Kisela Voda', 'Kisela Voda', 100), -(8358, 111, 778, 'Kumanovo', 'Kumanovo', 100), -(8359, 111, 779, 'Makedonska Kamenica', 'Makedonska Kamenica', 100), -(8360, 111, 780, 'Negotino', 'Negotino', 100), -(8361, 111, 781, 'Ohrid', 'Ohrid', 100), -(8362, 111, 782, 'Prilep', 'Prilep', 100), -(8363, 111, 783, 'Radovis', 'Radovis', 100), -(8364, 111, 784, 'Saraj', 'Saraj', 100), -(8365, 111, 785, 'Dojran', 'Dojran', 100), -(8366, 111, 786, 'Struga', 'Struga', 100), -(8367, 111, 787, 'Strumica', 'Strumica', 100), -(8368, 111, 788, 'Sveti Nikole', 'Sveti Nikole', 100), -(8369, 111, 789, 'Tetov', 'Tetov', 100), -(8370, 111, 789, 'Tetovo', 'Tetovo', 200), -(8371, 111, 790, 'Veles', 'Veles', 100), -(8372, 112, 791, 'Лилонгве', 'Lilongve', 100), -(8373, 113, 792, 'Куала-Лумпур', 'Kuala Lumpur', 100), -(8374, 114, 793, 'Бамако', 'Bamako', 100), -(8375, 114, 793, 'Гао', 'Gao', 200), -(8376, 114, 793, 'Мопти', 'Mopti', 300), -(8377, 115, 794, 'Мале', 'Male', 100), -(8378, 116, 795, '''Emieri', '''Emieri', 100), -(8379, 116, 795, 'B''Kara', 'B''Kara', 200), -(8380, 116, 795, 'Balzan', 'Balzan', 300), -(8381, 116, 795, 'Bighi', 'Bighi', 400), -(8382, 116, 795, 'Birzebbuga', 'Birzebbuga', 500), -(8383, 116, 795, 'Biskra', 'Biskra', 600), -(8384, 116, 795, 'Bugibba', 'Bugibba', 700), -(8385, 116, 795, 'Casal Paolo', 'Casal Paolo', 800), -(8386, 116, 795, 'Cospicua', 'Cospicua', 900), -(8387, 116, 795, 'Delimara', 'Delimara', 1000), -(8388, 116, 795, 'Gzira', 'Gzira', 1100), -(8389, 116, 795, 'Hal Baijada', 'Hal Baijada', 1200), -(8390, 116, 795, 'Il-Hamrun', 'Il-Hamrun', 1300), -(8391, 116, 795, 'Is-Swieqi', 'Is-Swieqi', 1400), -(8392, 116, 795, 'Isla', 'Isla', 1500), -(8393, 116, 795, 'La Valette', 'La Valette', 1600), -(8394, 116, 795, 'Madliena', 'Madliena', 1700), -(8395, 116, 795, 'Marsa', 'Marsa', 1800), -(8396, 116, 795, 'Marsalforn', 'Marsalforn', 1900), -(8397, 116, 795, 'Marsaskala', 'Marsaskala', 2000), -(8398, 116, 795, 'Marsaxlokk', 'Marsaxlokk', 2100), -(8399, 116, 795, 'Melita', 'Melita', 2200), -(8400, 116, 795, 'Mellie§a', 'Mellie§a', 2300), -(8401, 116, 795, 'Mosta', 'Mosta', 2400), -(8402, 116, 795, 'Msida', 'Msida', 2500), -(8403, 116, 795, 'Paola', 'Paola', 2600), -(8404, 116, 795, 'Piet', 'Piet', 2700), -(8405, 116, 795, 'Qormi', 'Qormi', 2800), -(8406, 116, 795, 'Saint Julian', 'Saint Julian', 2900), -(8407, 116, 795, 'Saint Julian''s', 'Saint Julian''s', 3000), -(8408, 116, 795, 'Saint Paul''s Bay', 'Saint Paul''s Bay', 3100), -(8409, 116, 795, 'San Giljan', 'San Giljan', 3200), -(8410, 116, 795, 'San Gwann', 'San Gwann', 3300); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(8411, 116, 795, 'Santa Lucia', 'Santa Lucia', 3400), -(8412, 116, 795, 'Sliema', 'Sliema', 3500), -(8413, 116, 795, 'Valetta', 'Valetta', 3600), -(8414, 116, 795, 'Valletta', 'Valletta', 3700), -(8415, 116, 795, 'Victoria', 'Victoria', 3800), -(8416, 116, 795, '¦''Attard', '¦''Attard', 3900), -(8417, 116, 795, '¦al Balzan', '¦al Balzan', 4000), -(8418, 117, 796, 'Морокко', 'Morocco', 100), -(8419, 117, 797, 'Танжер', 'Tangier', 100), -(8420, 118, 798, 'Фор-де-Франс', 'Fort-de-France', 100), -(8421, 119, 799, 'Adolfo Lpez Mateos', 'Adolfo Lpez Mateos', 100), -(8422, 119, 799, 'Aguascalientes', 'Aguascalientes', 200), -(8423, 119, 800, 'Acapulco', 'Acapulco', 100), -(8424, 119, 800, 'Ensenada', 'Ensenada', 200), -(8425, 119, 800, 'Mexicali', 'Mexicali', 300), -(8426, 119, 800, 'Tijuana', 'Tijuana', 400), -(8427, 119, 801, 'La Paz', 'La Paz', 100), -(8428, 119, 801, 'Loreto', 'Loreto', 200), -(8429, 119, 802, 'Campeche', 'Campeche', 100), -(8430, 119, 802, 'Carmen', 'Carmen', 200), -(8431, 119, 802, 'Escrcega', 'Escrcega', 300), -(8432, 119, 803, 'Al Fin', 'Al Fin', 100), -(8433, 119, 803, 'Comitan', 'Comitan', 200), -(8434, 119, 803, 'Comitn de Domnguez', 'Comitn de Domnguez', 300), -(8435, 119, 803, 'Jiquipilas', 'Jiquipilas', 400), -(8436, 119, 803, 'Tuxtla Gutirrez', 'Tuxtla Gutirrez', 500), -(8437, 119, 804, 'Chihuahua', 'Chihuahua', 100), -(8438, 119, 804, 'Delicias', 'Delicias', 200), -(8439, 119, 804, 'Jurez', 'Jurez', 300), -(8440, 119, 805, 'Allende', 'Allende', 100), -(8441, 119, 805, 'Monclova', 'Monclova', 200), -(8442, 119, 805, 'Saltillo', 'Saltillo', 300), -(8443, 119, 805, 'Torren', 'Torren', 400), -(8444, 119, 806, 'Acatitn', 'Acatitn', 100), -(8445, 119, 806, 'Amoles', 'Amoles', 200), -(8446, 119, 806, 'Armera', 'Armera', 300), -(8447, 119, 806, 'Colima', 'Colima', 400), -(8448, 119, 806, 'Manzanillo', 'Manzanillo', 500), -(8449, 119, 807, 'Ajusco', 'Ajusco', 100), -(8450, 119, 807, 'Alvaro Obregn', 'Alvaro Obregn', 200), -(8451, 119, 807, 'Azcapotzalco', 'Azcapotzalco', 300), -(8452, 119, 807, 'Benito Juarez', 'Benito Juarez', 400), -(8453, 119, 807, 'Cerro Prieto', 'Cerro Prieto', 500), -(8454, 119, 807, 'Ciudad de Mxico', 'Ciudad de Mxico', 600), -(8455, 119, 807, 'Colonia Ramos Milln', 'Colonia Ramos Milln', 700), -(8456, 119, 807, 'Coyoacn', 'Coyoacn', 800), -(8457, 119, 807, 'Cuauhtmoc', 'Cuauhtmoc', 900), -(8458, 119, 807, 'Iztapalapa', 'Iztapalapa', 1000), -(8459, 119, 807, 'Lomas de Chapultepec', 'Lomas de Chapultepec', 1100), -(8460, 119, 807, 'Mxico Distrito Federal', 'Mxico Distrito Federal', 1200), -(8461, 119, 807, 'Polanco', 'Polanco', 1300), -(8462, 119, 807, 'San Andrs Totoltepec', 'San Andrs Totoltepec', 1400), -(8463, 119, 807, 'San Angel', 'San Angel', 1500), -(8464, 119, 807, 'San Bartolo Atepehuacn', 'San Bartolo Atepehuacn', 1600), -(8465, 119, 807, 'San Pedro', 'San Pedro', 1700), -(8466, 119, 807, 'Tlalpan', 'Tlalpan', 1800), -(8467, 119, 807, 'Zona Urbana', 'Zona Urbana', 1900), -(8468, 119, 808, 'Aedo', 'Aedo', 100), -(8469, 119, 808, 'Antonio', 'Antonio', 200), -(8470, 119, 808, 'Durango', 'Durango', 300), -(8471, 119, 808, 'Gmez Palacio', 'Gmez Palacio', 400), -(8472, 119, 809, 'Abasolo', 'Abasolo', 100), -(8473, 119, 809, 'Acatlan', 'Acatlan', 200), -(8474, 119, 809, 'Charapuato', 'Charapuato', 300), -(8475, 119, 809, 'Guanajuato', 'Guanajuato', 400), -(8476, 119, 809, 'Irapuato', 'Irapuato', 500), -(8477, 119, 809, 'Len', 'Len', 600), -(8478, 119, 809, 'Len de los Aldamas', 'Len de los Aldamas', 700), -(8479, 119, 809, 'Ocampo', 'Ocampo', 800), -(8480, 119, 809, 'Salamanca', 'Salamanca', 900), -(8481, 119, 809, 'San Miguel Allende', 'San Miguel Allende', 1000), -(8482, 119, 810, 'Acapulco', 'Acapulco', 100), -(8483, 119, 810, 'Chilpancingo de los Bravos', 'Chilpancingo de los Bravos', 200), -(8484, 119, 810, 'Zihuatanejo', 'Zihuatanejo', 300), -(8485, 119, 811, 'Actopan', 'Actopan', 100), -(8486, 119, 811, 'Mixquiahuala', 'Mixquiahuala', 200), -(8487, 119, 811, 'Molango', 'Molango', 300), -(8488, 119, 811, 'Pachuca', 'Pachuca', 400), -(8489, 119, 811, 'Pachuca de Soto', 'Pachuca de Soto', 500), -(8490, 119, 811, 'Santiago Tulantepec', 'Santiago Tulantepec', 600), -(8491, 119, 811, 'Zimapn', 'Zimapn', 700), -(8492, 119, 812, 'Ameca', 'Ameca', 100), -(8493, 119, 812, 'Guadalajara', 'Guadalajara', 200), -(8494, 119, 812, 'Puerto Vallarta', 'Puerto Vallarta', 300), -(8495, 119, 812, 'Tamazula de Gordiano', 'Tamazula de Gordiano', 400), -(8496, 119, 812, 'Zapotlanejo', 'Zapotlanejo', 500), -(8497, 119, 813, 'La Piedad Cabadas', 'La Piedad Cabadas', 100), -(8498, 119, 813, 'Lzaro Crdenas', 'Lzaro Crdenas', 200), -(8499, 119, 813, 'Morelia', 'Morelia', 300), -(8500, 119, 813, 'Uruapan del Progreso', 'Uruapan del Progreso', 400), -(8501, 119, 814, 'Amatln', 'Amatln', 100), -(8502, 119, 814, 'Cuautla', 'Cuautla', 200), -(8503, 119, 814, 'Cuernavaca', 'Cuernavaca', 300), -(8504, 119, 814, 'Jiutepec', 'Jiutepec', 400), -(8505, 119, 815, 'Acahualco', 'Acahualco', 100), -(8506, 119, 815, 'Acatln', 'Acatln', 200), -(8507, 119, 815, 'Acaxuchitlan', 'Acaxuchitlan', 300), -(8508, 119, 815, 'Acazulco', 'Acazulco', 400), -(8509, 119, 815, 'Acozac', 'Acozac', 500), -(8510, 119, 815, 'Aculco', 'Aculco', 600), -(8511, 119, 815, 'Altavista', 'Altavista', 700), -(8512, 119, 815, 'Benitez', 'Benitez', 800), -(8513, 119, 815, 'Ecatepec', 'Ecatepec', 900), -(8514, 119, 815, 'El Grande', 'El Grande', 1000), -(8515, 119, 815, 'El Tecun', 'El Tecun', 1100), -(8516, 119, 815, 'Guadalupe', 'Guadalupe', 1200), -(8517, 119, 815, 'Ixtapaluca', 'Ixtapaluca', 1300), -(8518, 119, 815, 'Maxtleca', 'Maxtleca', 1400), -(8519, 119, 815, 'Minita Cedro', 'Minita Cedro', 1500), -(8520, 119, 815, 'Mxico', 'Mxico', 1600), -(8521, 119, 815, 'Naucalpan de Jurez', 'Naucalpan de Jurez', 1700), -(8522, 119, 815, 'Netzahualcyotl', 'Netzahualcyotl', 1800), -(8523, 119, 815, 'Santa Clara', 'Santa Clara', 1900), -(8524, 119, 815, 'Toluca', 'Toluca', 2000), -(8525, 119, 815, 'Xico', 'Xico', 2100), -(8526, 119, 816, 'Tepic', 'Tepic', 100), -(8527, 119, 817, 'Ro Verde', 'Ro Verde', 100), -(8528, 119, 818, 'Apodaca', 'Apodaca', 100), -(8529, 119, 818, 'Cadereyta', 'Cadereyta', 200), -(8530, 119, 818, 'Monterrey', 'Monterrey', 300), -(8531, 119, 818, 'Nogales', 'Nogales', 400), -(8532, 119, 818, 'San Nicols de los Garza', 'San Nicols de los Garza', 500), -(8533, 119, 818, 'Santa Catarina', 'Santa Catarina', 600), -(8534, 119, 819, 'Juchitn de Zaragoza', 'Juchitn de Zaragoza', 100), -(8535, 119, 819, 'Jurez', 'Jurez', 200), -(8536, 119, 819, 'San Felipe del Agua', 'San Felipe del Agua', 300), -(8537, 119, 819, 'Tezonapa', 'Tezonapa', 400), -(8538, 119, 819, 'Zoquiapam', 'Zoquiapam', 500), -(8539, 119, 820, 'Puebla', 'Puebla', 100), -(8540, 119, 820, 'Puebla de los Angeles', 'Puebla de los Angeles', 200), -(8541, 119, 820, 'Xicotepec de Jurez', 'Xicotepec de Jurez', 300), -(8542, 119, 821, 'Amoles', 'Amoles', 100), -(8543, 119, 821, 'Quertaro', 'Quertaro', 200), -(8544, 119, 822, 'Cafetal', 'Cafetal', 100), -(8545, 119, 822, 'Cancn', 'Cancn', 200), -(8546, 119, 823, 'Ciudad Fernndez', 'Ciudad Fernndez', 100), -(8547, 119, 823, 'San Luis Potos', 'San Luis Potos', 200), -(8548, 119, 823, 'San Luisito', 'San Luisito', 300), -(8549, 119, 823, 'Valles', 'Valles', 400), -(8550, 119, 824, 'Culiacn', 'Culiacn', 100), -(8551, 119, 824, 'Mazatln', 'Mazatln', 200), -(8552, 119, 825, 'Cajon', 'Cajon', 100), -(8553, 119, 825, 'El Empalme', 'El Empalme', 200), -(8554, 119, 825, 'Hermosillo', 'Hermosillo', 300), -(8555, 119, 825, 'Obregon', 'Obregon', 400), -(8556, 119, 825, 'San Luis Ro Colorado', 'San Luis Ro Colorado', 500), -(8557, 119, 826, 'Buena Vista de Tamult de las Sabanas', 'Buena Vista de Tamult de las Sabanas', 100), -(8558, 119, 826, 'Carrizal', 'Carrizal', 200), -(8559, 119, 826, 'Casa Blanca Segunda Seccin', 'Casa Blanca Segunda Seccin', 300), -(8560, 119, 826, 'Ciudad Pemex', 'Ciudad Pemex', 400), -(8561, 119, 826, 'Cuauhtmoc', 'Cuauhtmoc', 500), -(8562, 119, 826, 'Dos Montes', 'Dos Montes', 600), -(8563, 119, 826, 'Paso Real', 'Paso Real', 700), -(8564, 119, 826, 'Tenosique de Pino Surez', 'Tenosique de Pino Surez', 800), -(8565, 119, 826, 'Tierra Colorada', 'Tierra Colorada', 900), -(8566, 119, 826, 'Villa La Venta', 'Villa La Venta', 1000), -(8567, 119, 826, 'Villahermosa', 'Villahermosa', 1100), -(8568, 119, 826, 'Zaragoza', 'Zaragoza', 1200), -(8569, 119, 827, 'Ciudad Victoria', 'Ciudad Victoria', 100), -(8570, 119, 827, 'Matamoros', 'Matamoros', 200), -(8571, 119, 827, 'Nuevo Laredo', 'Nuevo Laredo', 300), -(8572, 119, 827, 'Reynosa', 'Reynosa', 400), -(8573, 119, 827, 'Tampico', 'Tampico', 500), -(8574, 119, 828, 'Apetatitln', 'Apetatitln', 100), -(8575, 119, 828, 'Apizaco', 'Apizaco', 200), -(8576, 119, 828, 'Chiautempan', 'Chiautempan', 300), -(8577, 119, 828, 'Panotla', 'Panotla', 400), -(8578, 119, 828, 'Teolocholco', 'Teolocholco', 500), -(8579, 119, 828, 'Tlaxcala', 'Tlaxcala', 600), -(8580, 119, 829, 'Acala', 'Acala', 100), -(8581, 119, 829, 'Coatzacoalcos', 'Coatzacoalcos', 200), -(8582, 119, 829, 'Orizaba', 'Orizaba', 300), -(8583, 119, 829, 'Papantla de Olarte', 'Papantla de Olarte', 400), -(8584, 119, 829, 'Potrero del Llano', 'Potrero del Llano', 500), -(8585, 119, 829, 'Tuxpan de Rodrguez Cano', 'Tuxpan de Rodrguez Cano', 600), -(8586, 119, 829, 'Veracruz', 'Veracruz', 700), -(8587, 119, 829, 'Veracruz Llave', 'Veracruz Llave', 800), -(8588, 119, 829, 'Xalapa', 'Xalapa', 900), -(8589, 119, 830, 'Mrida', 'Mrida', 100), -(8590, 119, 830, 'Valladolid', 'Valladolid', 200), -(8591, 120, 831, 'Бейра', 'Beira', 100), -(8592, 120, 831, 'Мапуто', 'Maputo', 200), -(8593, 120, 831, 'Нампула', 'Nampula', 300), -(8594, 120, 831, 'Пемба', 'Pemba', 400), -(8595, 121, 832, 'Атаки', 'Ataki', 100), -(8596, 121, 832, 'Бельцы', 'Beltsy', 200), -(8597, 121, 832, 'Бендеры', 'Bendery', 300), -(8598, 121, 832, 'Бессарабка', 'Bessarabka', 400), -(8599, 121, 832, 'Бируинца', 'Biruinta', 500), -(8600, 121, 832, 'Бричаны', 'Brichany', 600), -(8601, 121, 832, 'Быковец', 'Bykovets', 700), -(8602, 121, 832, 'Вадул-луй-Водэ', 'Vadului Voda', 800), -(8603, 121, 832, 'Ватра', 'Vatra', 900), -(8604, 121, 832, 'Вишневка', 'Vishnevka', 1000), -(8605, 121, 832, 'Вулканешты', 'Vulkaneshty', 1100), -(8606, 121, 832, 'Глодяны', 'Glodyany', 1200), -(8607, 121, 832, 'Григориополь', 'Grigoriopol', 1300), -(8608, 121, 832, 'Днестровск', 'Dnestrovsk', 1400), -(8609, 121, 832, 'Дондюшаны', 'Dondyushany', 1500), -(8610, 121, 832, 'Дрокия', 'Drokiya', 1600), -(8611, 121, 832, 'Дубоссары', 'Dubossary', 1700), -(8612, 121, 832, 'Дурлешты', 'Durlesti', 1800), -(8613, 121, 832, 'Единцы', 'Edintsy', 1900), -(8614, 121, 832, 'Кагул', 'Kagul', 2000), -(8615, 121, 832, 'Каинары', 'Cainari', 2100), -(8616, 121, 832, 'Калараш', 'Kalarash', 2200), -(8617, 121, 832, 'Каменка', 'Kamenka', 2300), -(8618, 121, 832, 'Кантемир', 'Cantemir', 2400), -(8619, 121, 832, 'Каушаны', 'Kaushany', 2500), -(8620, 121, 832, 'Кишинев', 'Kishinev', 2600), -(8621, 121, 832, 'Кодру', 'Codru', 2700), -(8622, 121, 832, 'Комрат', 'Komrat', 2800), -(8623, 121, 832, 'Корнешты', 'Korneshty', 2900), -(8624, 121, 832, 'Костешты', 'Costesti', 3000), -(8625, 121, 832, 'Красное', 'Krasnoe', 3100), -(8626, 121, 832, 'Криково', 'Cricovo', 3200), -(8627, 121, 832, 'Криуляны', 'Kriulyany', 3300), -(8628, 121, 832, 'Купчинь', 'Cupcini', 3400), -(8629, 121, 832, 'Леово', 'Leovo', 3500), -(8630, 121, 832, 'Липканы', 'Lipcani', 3600), -(8631, 121, 832, 'Маяк', 'Maiak', 3700), -(8632, 121, 832, 'Ниспорены', 'Nisporeny', 3800), -(8633, 121, 832, 'Новые Анены', 'Novye Aneny', 3900), -(8634, 121, 832, 'Окница', 'Oknitsa', 4000), -(8635, 121, 832, 'Оргеев', 'Orgeev', 4100), -(8636, 121, 832, 'Резина', 'Rezina', 4200), -(8637, 121, 832, 'Рыбница', 'Rybnitsa', 4300), -(8638, 121, 832, 'Рышканы', 'Ryshkany', 4400), -(8639, 121, 832, 'Слободзея', 'Slobodzeya', 4500), -(8640, 121, 832, 'Сороки', 'Soroki', 4600), -(8641, 121, 832, 'Страшены', 'Strasheny', 4700), -(8642, 121, 832, 'Сынжера', 'Singera', 4800), -(8643, 121, 832, 'Тараклия', 'Tarakliya', 4900), -(8644, 121, 832, 'Теленешты', 'Teleneshty', 5000), -(8645, 121, 832, 'Тирасполь', 'Tiraspol', 5100), -(8646, 121, 832, 'Унгены', 'Ungeny', 5200), -(8647, 121, 832, 'Фалешты', 'Faleshty', 5300), -(8648, 121, 832, 'Флорешты', 'Floreshty', 5400), -(8649, 121, 832, 'Хынчешты', 'Hincesti', 5500), -(8650, 121, 832, 'Чадыр-Лунга', 'Chadyr-Lunga', 5600), -(8651, 121, 832, 'Чимишлия', 'Chimishliya', 5700), -(8652, 121, 832, 'Шолданешты', 'Soldanesti', 5800), -(8653, 121, 832, 'Штефан-Водэ', 'Stefan-Voda', 5900), -(8654, 121, 832, 'Яловены', 'Ialoveni', 6000), -(8655, 121, 832, 'Яргара', 'Iagara', 6100), -(8656, 122, 833, 'Condamine', 'Condamine', 100), -(8657, 122, 833, 'Fontvieille', 'Fontvieille', 200), -(8658, 122, 833, 'La Condamine', 'La Condamine', 300), -(8659, 122, 833, 'Monaco', 'Monaco', 400), -(8660, 122, 833, 'Monaco-Ville', 'Monaco-Ville', 500), -(8661, 122, 833, 'Moneghetti', 'Moneghetti', 600), -(8662, 122, 833, 'Monte-Carlo', 'Monte-Carlo', 700), -(8663, 123, 834, 'Сайн-Шанд', 'Сайн-Шанд', 100), -(8664, 123, 834, 'Улан-Батор', 'Ulan Bator', 200), -(8665, 123, 834, 'Эрдэнэт', 'Эрдэнэт', 300), -(8666, 124, 835, 'Мьичина', 'M''ichina', 100), -(8667, 124, 835, 'Янгон', 'Yangon', 200), -(8668, 125, 836, 'Дуглас', 'Дуглас', 100), -(8669, 125, 836, 'Каслтаун', 'Каслтаун', 200), -(8670, 125, 836, 'Пил', 'Пил', 300), -(8671, 125, 836, 'Порт-Сент-Мэри', 'Порт-Сент-Мэри', 400), -(8672, 125, 836, 'Порт-Эрин', 'Порт-Эрин', 500), -(8673, 125, 836, 'Рамси', 'Рамси', 600), -(8674, 126, 837, 'Виндук', 'Vinduk', 100), -(8675, 126, 837, 'Людериц', 'Luderizc', 200), -(8676, 126, 837, 'Уолфиш-Бей', 'Yolfish-Bey', 300), -(8677, 127, 838, 'Баирики', 'Bairiki', 100), -(8678, 127, 838, 'Маджуро', 'Madzhuru', 200), -(8679, 127, 838, 'Ярен', 'Yaren', 300), -(8680, 128, 839, 'Катманду', 'Katmandu', 100), -(8681, 129, 840, 'Агадес', 'Agades', 100), -(8682, 129, 840, 'Бильма', 'Bilma', 200), -(8683, 129, 840, 'Джадо', 'Dzado', 300), -(8684, 129, 840, 'Зиндер', 'Zinder', 400), -(8685, 129, 840, 'Ниамей', 'Niamey', 500), -(8686, 130, 841, 'Абуджа', 'Abudja', 100), -(8687, 130, 841, 'Лагос', 'Lagos', 200), -(8688, 131, 842, '''t Haantje', '''t Haantje', 100), -(8689, 131, 842, '''t Noorden', '''t Noorden', 200), -(8690, 131, 842, 'Aalden', 'Aalden', 300), -(8691, 131, 842, 'Amen', 'Amen', 400), -(8692, 131, 842, 'Amerika', 'Amerika', 500), -(8693, 131, 842, 'Amsterdamsche Veld I', 'Amsterdamsche Veld I', 600), -(8694, 131, 842, 'Amsterdamscheveld', 'Amsterdamscheveld', 700), -(8695, 131, 842, 'Amsterdamseveld', 'Amsterdamseveld', 800), -(8696, 131, 842, 'Angelslo', 'Angelslo', 900), -(8697, 131, 842, 'Anlo', 'Anlo', 1000), -(8698, 131, 842, 'Anreep', 'Anreep', 1100), -(8699, 131, 842, 'Armweide', 'Armweide', 1200), -(8700, 131, 842, 'Assen', 'Assen', 1300), -(8701, 131, 842, 'Beilen', 'Beilen', 1400), -(8702, 131, 842, 'Bonnen', 'Bonnen', 1500), -(8703, 131, 842, 'Coevorden', 'Coevorden', 1600), -(8704, 131, 842, 'Emmen', 'Emmen', 1700), -(8705, 131, 842, 'Hoogeveen', 'Hoogeveen', 1800), -(8706, 131, 842, 'Meppel', 'Meppel', 1900), -(8707, 131, 842, 'Roden', 'Roden', 2000), -(8708, 131, 842, 'Zwinderen', 'Zwinderen', 2100), -(8709, 131, 843, 'Almere-Buiten', 'Almere-Buiten', 100), -(8710, 131, 843, 'Almere-Haven', 'Almere-Haven', 200), -(8711, 131, 843, 'Almere-Stad', 'Almere-Stad', 300), -(8712, 131, 843, 'Bant', 'Bant', 400), -(8713, 131, 843, 'Dronten', 'Dronten', 500), -(8714, 131, 843, 'Emmeloord', 'Emmeloord', 600), -(8715, 131, 843, 'Espel', 'Espel', 700), -(8716, 131, 843, 'Haven van Lelystad', 'Haven van Lelystad', 800), -(8717, 131, 843, 'Lelystad', 'Lelystad', 900), -(8718, 131, 843, 'Top', 'Top', 1000), -(8719, 131, 844, 'Aalsum', 'Aalsum', 100), -(8720, 131, 844, 'Aalzum', 'Aalzum', 200), -(8721, 131, 844, 'Aasterein', 'Aasterein', 300), -(8722, 131, 844, 'Allingawier', 'Allingawier', 400), -(8723, 131, 844, 'Appelscha', 'Appelscha', 500), -(8724, 131, 844, 'Baard', 'Baard', 600), -(8725, 131, 844, 'Bolsward', 'Bolsward', 700), -(8726, 131, 844, 'De Knipe', 'De Knipe', 800), -(8727, 131, 844, 'Dokkum', 'Dokkum', 900), -(8728, 131, 844, 'Drachten', 'Drachten', 1000), -(8729, 131, 844, 'Franeker', 'Franeker', 1100), -(8730, 131, 844, 'Harlingen', 'Harlingen', 1200), -(8731, 131, 844, 'Heerenveen', 'Heerenveen', 1300), -(8732, 131, 844, 'Joure', 'Joure', 1400), -(8733, 131, 844, 'Kollum', 'Kollum', 1500), -(8734, 131, 844, 'Leeuwarden', 'Leeuwarden', 1600), -(8735, 131, 844, 'Lieuwarden', 'Lieuwarden', 1700), -(8736, 131, 844, 'Midsln Noard', 'Midsln Noard', 1800), -(8737, 131, 844, 'Rijsberkampen', 'Rijsberkampen', 1900), -(8738, 131, 844, 'Sneek', 'Sneek', 2000), -(8739, 131, 844, 'Tilburen', 'Tilburen', 2100), -(8740, 131, 845, '''s-Heerenberg', '''s-Heerenberg', 100), -(8741, 131, 845, '''t Loo', '''t Loo', 200), -(8742, 131, 845, 'Aalten', 'Aalten', 300), -(8743, 131, 845, 'Apeldoorn', 'Apeldoorn', 400), -(8744, 131, 845, 'Arnheim', 'Arnheim', 500), -(8745, 131, 845, 'Arnhem', 'Arnhem', 600), -(8746, 131, 845, 'Barneveld', 'Barneveld', 700), -(8747, 131, 845, 'Bennekom', 'Bennekom', 800), -(8748, 131, 845, 'Brummen', 'Brummen', 900), -(8749, 131, 845, 'Didam', 'Didam', 1000), -(8750, 131, 845, 'Dieren', 'Dieren', 1100), -(8751, 131, 845, 'Dinxperlo', 'Dinxperlo', 1200), -(8752, 131, 845, 'Doetinchem', 'Doetinchem', 1300), -(8753, 131, 845, 'Ede', 'Ede', 1400), -(8754, 131, 845, 'Epe', 'Epe', 1500), -(8755, 131, 845, 'Geldermalsen', 'Geldermalsen', 1600), -(8756, 131, 845, 'Gendringen', 'Gendringen', 1700), -(8757, 131, 845, 'Haarlo', 'Haarlo', 1800), -(8758, 131, 845, 'Harderwijk', 'Harderwijk', 1900), -(8759, 131, 845, 'Lochem', 'Lochem', 2000), -(8760, 131, 845, 'Millingen aan de Rijn', 'Millingen aan de Rijn', 2100), -(8761, 131, 845, 'Nijkerk', 'Nijkerk', 2200), -(8762, 131, 845, 'Nijmegen', 'Nijmegen', 2300), -(8763, 131, 845, 'Nymegen', 'Nymegen', 2400), -(8764, 131, 845, 'Otterlo', 'Otterlo', 2500), -(8765, 131, 845, 'Rheden', 'Rheden', 2600), -(8766, 131, 845, 'Terwolde', 'Terwolde', 2700), -(8767, 131, 845, 'Tiel', 'Tiel', 2800), -(8768, 131, 845, 'Wageningen', 'Wageningen', 2900), -(8769, 131, 845, 'Wehl', 'Wehl', 3000), -(8770, 131, 845, 'Wijchen', 'Wijchen', 3100), -(8771, 131, 845, 'Winterswijk', 'Winterswijk', 3200), -(8772, 131, 845, 'Zevenaar', 'Zevenaar', 3300), -(8773, 131, 845, 'Zutphen', 'Zutphen', 3400), -(8774, 131, 845, 'Zwolle', 'Zwolle', 3500), -(8775, 131, 846, 'Aalsum', 'Aalsum', 100), -(8776, 131, 846, 'Amsweer', 'Amsweer', 200), -(8777, 131, 846, 'Beerta', 'Beerta', 300), -(8778, 131, 846, 'Delfzijl', 'Delfzijl', 400), -(8779, 131, 846, 'Enum', 'Enum', 500), -(8780, 131, 846, 'Groningen', 'Groningen', 600), -(8781, 131, 846, 'Winschoten', 'Winschoten', 700), -(8782, 131, 847, 'Aan de School', 'Aan de School', 100), -(8783, 131, 847, 'Aasterberg', 'Aasterberg', 200), -(8784, 131, 847, 'Afhang', 'Afhang', 300), -(8785, 131, 847, 'Amstenrade', 'Amstenrade', 400), -(8786, 131, 847, 'Baexem', 'Baexem', 500), -(8787, 131, 847, 'Beesel', 'Beesel', 600), -(8788, 131, 847, 'Broekhoven', 'Broekhoven', 700), -(8789, 131, 847, 'Echt', 'Echt', 800), -(8790, 131, 847, 'Eisden', 'Eisden', 900), -(8791, 131, 847, 'Geleen', 'Geleen', 1000), -(8792, 131, 847, 'Haag', 'Haag', 1100), -(8793, 131, 847, 'Heerlen', 'Heerlen', 1200), -(8794, 131, 847, 'Hees', 'Hees', 1300), -(8795, 131, 847, 'Heythuysen', 'Heythuysen', 1400), -(8796, 131, 847, 'Kelmond', 'Kelmond', 1500), -(8797, 131, 847, 'Kerkrade', 'Kerkrade', 1600), -(8798, 131, 847, 'Limbricht', 'Limbricht', 1700), -(8799, 131, 847, 'Maasbracht', 'Maasbracht', 1800), -(8800, 131, 847, 'Maastricht', 'Maastricht', 1900), -(8801, 131, 847, 'Maestricht', 'Maestricht', 2000), -(8802, 131, 847, 'Roermond', 'Roermond', 2100), -(8803, 131, 847, 'Scheide', 'Scheide', 2200), -(8804, 131, 847, 'Sittard', 'Sittard', 2300), -(8805, 131, 847, 'Swalmen', 'Swalmen', 2400), -(8806, 131, 847, 'Vaals', 'Vaals', 2500), -(8807, 131, 847, 'Valkenburg', 'Valkenburg', 2600), -(8808, 131, 847, 'Venlo', 'Venlo', 2700), -(8809, 131, 847, 'Venray', 'Venray', 2800), -(8810, 131, 847, 'Weert', 'Weert', 2900), -(8811, 131, 847, 'Wyck', 'Wyck', 3000), -(8812, 131, 848, '''s Bosch', '''s Bosch', 100), -(8813, 131, 848, '''s-Hertogenbosch', '''s-Hertogenbosch', 200), -(8814, 131, 848, '''t Hout', '''t Hout', 300), -(8815, 131, 848, 'Aalst', 'Aalst', 400), -(8816, 131, 848, 'Amsteleind', 'Amsteleind', 500), -(8817, 131, 848, 'Bakel', 'Bakel', 600), -(8818, 131, 848, 'Bergen op Zoom', 'Bergen op Zoom', 700), -(8819, 131, 848, 'Best', 'Best', 800), -(8820, 131, 848, 'Boxmeer', 'Boxmeer', 900), -(8821, 131, 848, 'Breda', 'Breda', 1000), -(8822, 131, 848, 'Den Bosch', 'Den Bosch', 1100), -(8823, 131, 848, 'Dongen', 'Dongen', 1200), -(8824, 131, 848, 'Duizel', 'Duizel', 1300), -(8825, 131, 848, 'Eiland', 'Eiland', 1400), -(8826, 131, 848, 'Eindhoven', 'Eindhoven', 1500), -(8827, 131, 848, 'Etten', 'Etten', 1600), -(8828, 131, 848, 'Gement', 'Gement', 1700), -(8829, 131, 848, 'Helmond', 'Helmond', 1800), -(8830, 131, 848, 'Hertogenbosch', 'Hertogenbosch', 1900), -(8831, 131, 848, 'Katwijk', 'Katwijk', 2000), -(8832, 131, 848, 'Mierlo', 'Mierlo', 2100), -(8833, 131, 848, 'Oss', 'Oss', 2200), -(8834, 131, 848, 'Oudenbosch', 'Oudenbosch', 2300), -(8835, 131, 848, 'Overloon', 'Overloon', 2400), -(8836, 131, 848, 'Rijen', 'Rijen', 2500), -(8837, 131, 848, 'Roosendaal', 'Roosendaal', 2600), -(8838, 131, 848, 'Tilburg', 'Tilburg', 2700), -(8839, 131, 848, 'Trent', 'Trent', 2800), -(8840, 131, 848, 'Uden', 'Uden', 2900), -(8841, 131, 848, 'Veghel', 'Veghel', 3000), -(8842, 131, 849, 'Aalsmeer', 'Aalsmeer', 100), -(8843, 131, 849, 'Akersloot', 'Akersloot', 200), -(8844, 131, 849, 'Alkmaar', 'Alkmaar', 300), -(8845, 131, 849, 'Amstelveen', 'Amstelveen', 400), -(8846, 131, 849, 'Amsterdam', 'Amsterdam', 500), -(8847, 131, 849, 'Bergen', 'Bergen', 600), -(8848, 131, 849, 'Beverwijk', 'Beverwijk', 700), -(8849, 131, 849, 'Bovenkerk', 'Bovenkerk', 800), -(8850, 131, 849, 'Bussum', 'Bussum', 900), -(8851, 131, 849, 'De Haal', 'De Haal', 1000), -(8852, 131, 849, 'De Strook', 'De Strook', 1100), -(8853, 131, 849, 'Den Helder', 'Den Helder', 1200), -(8854, 131, 849, 'Der Helder', 'Der Helder', 1300), -(8855, 131, 849, 'Egmond aan Zee', 'Egmond aan Zee', 1400), -(8856, 131, 849, 'Enkhuizen', 'Enkhuizen', 1500), -(8857, 131, 849, 'Haarlem', 'Haarlem', 1600), -(8858, 131, 849, 'Hilversum', 'Hilversum', 1700), -(8859, 131, 849, 'Hoofddorp', 'Hoofddorp', 1800), -(8860, 131, 849, 'Hoorn', 'Hoorn', 1900), -(8861, 131, 849, 'Huizen', 'Huizen', 2000), -(8862, 131, 849, 'IJmuiden', 'IJmuiden', 2100), -(8863, 131, 849, 'Laren', 'Laren', 2200), -(8864, 131, 849, 'Medemblik', 'Medemblik', 2300), -(8865, 131, 849, 'Naarden', 'Naarden', 2400), -(8866, 131, 849, 'Schagen', 'Schagen', 2500), -(8867, 131, 849, 'Verloren Einde', 'Verloren Einde', 2600), -(8868, 131, 849, 'Weesp', 'Weesp', 2700), -(8869, 131, 849, 'Zaandam', 'Zaandam', 2800), -(8870, 131, 849, 'Zaanstad', 'Zaanstad', 2900), -(8871, 131, 849, 'Zandvoort', 'Zandvoort', 3000), -(8872, 131, 849, 'Zwaagdijk', 'Zwaagdijk', 3100), -(8873, 131, 850, '''t Klooster', '''t Klooster', 100), -(8874, 131, 850, 'Almelo', 'Almelo', 200), -(8875, 131, 850, 'Dedemsvaart', 'Dedemsvaart', 300), -(8876, 131, 850, 'Deventer', 'Deventer', 400), -(8877, 131, 850, 'Elsen', 'Elsen', 500), -(8878, 131, 850, 'Enschede', 'Enschede', 600), -(8879, 131, 850, 'Goor', 'Goor', 700), -(8880, 131, 850, 'Hardenberg', 'Hardenberg', 800), -(8881, 131, 850, 'Hengelo', 'Hengelo', 900), -(8882, 131, 850, 'Kampen', 'Kampen', 1000), -(8883, 131, 850, 'Oldenzaal', 'Oldenzaal', 1100), -(8884, 131, 850, 'Vroomshoop', 'Vroomshoop', 1200), -(8885, 131, 850, 'Zwolle', 'Zwolle', 1300), -(8886, 131, 851, '''t Gooi', '''t Gooi', 100), -(8887, 131, 851, '''t Waal', '''t Waal', 200), -(8888, 131, 851, 'Achterbos', 'Achterbos', 300), -(8889, 131, 851, 'Achthoven', 'Achthoven', 400), -(8890, 131, 851, 'Achttienhoven', 'Achttienhoven', 500), -(8891, 131, 851, 'Amerongen', 'Amerongen', 600), -(8892, 131, 851, 'Amersfoort', 'Amersfoort', 700), -(8893, 131, 851, 'Baarn', 'Baarn', 800), -(8894, 131, 851, 'Birk', 'Birk', 900), -(8895, 131, 851, 'Blokland', 'Blokland', 1000), -(8896, 131, 851, 'De Bilt', 'De Bilt', 1100), -(8897, 131, 851, 'Den Bosch', 'Den Bosch', 1200), -(8898, 131, 851, 'Lage Weide', 'Lage Weide', 1300), -(8899, 131, 851, 'Lopik', 'Lopik', 1400), -(8900, 131, 851, 'Maarssen', 'Maarssen', 1500), -(8901, 131, 851, 'Maarssenbroek', 'Maarssenbroek', 1600), -(8902, 131, 851, 'Meern', 'Meern', 1700), -(8903, 131, 851, 'Mijdrecht', 'Mijdrecht', 1800), -(8904, 131, 851, 'Nieuwegein', 'Nieuwegein', 1900), -(8905, 131, 851, 'Nijenheim', 'Nijenheim', 2000), -(8906, 131, 851, 'Utrecht', 'Utrecht', 2100), -(8907, 131, 851, 'Veenendaal', 'Veenendaal', 2200), -(8908, 131, 851, 'Venendaal', 'Venendaal', 2300), -(8909, 131, 851, 'Zandvoort', 'Zandvoort', 2400), -(8910, 131, 851, 'Zeist', 'Zeist', 2500), -(8911, 131, 852, 'Abtsdale', 'Abtsdale', 100), -(8912, 131, 852, 'Aksel', 'Aksel', 200), -(8913, 131, 852, 'Axel', 'Axel', 300), -(8914, 131, 852, 'Biervliet', 'Biervliet', 400), -(8915, 131, 852, 'Eede', 'Eede', 500), -(8916, 131, 852, 'Goes', 'Goes', 600), -(8917, 131, 852, 'Kapelle', 'Kapelle', 700), -(8918, 131, 852, 'Kloosterzande', 'Kloosterzande', 800), -(8919, 131, 852, 'Koekoek', 'Koekoek', 900), -(8920, 131, 852, 'Middelburg', 'Middelburg', 1000), -(8921, 131, 852, 'Renesse', 'Renesse', 1100), -(8922, 131, 852, 'Sas van Gent', 'Sas van Gent', 1200), -(8923, 131, 852, 'Terneuzen', 'Terneuzen', 1300), -(8924, 131, 852, 'Vlissingen', 'Vlissingen', 1400), -(8925, 131, 852, 'Zieriksee', 'Zieriksee', 1500), -(8926, 131, 852, 'Zwartenhoek', 'Zwartenhoek', 1600), -(8927, 131, 853, '''s-Gravenhage', '''s-Gravenhage', 100), -(8928, 131, 853, '''s-Gravenzande', '''s-Gravenzande', 200), -(8929, 131, 853, 'Achterbroek', 'Achterbroek', 300), -(8930, 131, 853, 'Alphen aan den Rijn', 'Alphen aan den Rijn', 400), -(8931, 131, 853, 'Bleskensgraaf', 'Bleskensgraaf', 500), -(8932, 131, 853, 'Brielle', 'Brielle', 600), -(8933, 131, 853, 'Capelle-West', 'Capelle-West', 700), -(8934, 131, 853, 'De Hagen', 'De Hagen', 800), -(8935, 131, 853, 'Delft', 'Delft', 900), -(8936, 131, 853, 'Den Haag', 'Den Haag', 1000), -(8937, 131, 853, 'Den Hoorn', 'Den Hoorn', 1100), -(8938, 131, 853, 'Dordrecht', 'Dordrecht', 1200), -(8939, 131, 853, 'Dordt', 'Dordt', 1300), -(8940, 131, 853, 'Duinzigt', 'Duinzigt', 1400), -(8941, 131, 853, 'Gorinchem', 'Gorinchem', 1500), -(8942, 131, 853, 'Gouda', 'Gouda', 1600), -(8943, 131, 853, 'Haag', 'Haag', 1700), -(8944, 131, 853, 'Hellevoetsluis', 'Hellevoetsluis', 1800), -(8945, 131, 853, 'Katwijk', 'Katwijk', 1900), -(8946, 131, 853, 'Katwijk aan den Rijn', 'Katwijk aan den Rijn', 2000), -(8947, 131, 853, 'Katwijk aan Zee', 'Katwijk aan Zee', 2100), -(8948, 131, 853, 'Leiden', 'Leiden', 2200), -(8949, 131, 853, 'Leidschendam', 'Leidschendam', 2300), -(8950, 131, 853, 'Leimuiden', 'Leimuiden', 2400), -(8951, 131, 853, 'Leyden', 'Leyden', 2500), -(8952, 131, 853, 'Lisse', 'Lisse', 2600), -(8953, 131, 853, 'Middelburg', 'Middelburg', 2700), -(8954, 131, 853, 'Naaldwijk', 'Naaldwijk', 2800), -(8955, 131, 853, 'Noordwijk', 'Noordwijk', 2900), -(8956, 131, 853, 'Rhoon', 'Rhoon', 3000), -(8957, 131, 853, 'Rijndijk', 'Rijndijk', 3100), -(8958, 131, 853, 'Rijswijk', 'Rijswijk', 3200), -(8959, 131, 853, 'Rokanje', 'Rokanje', 3300), -(8960, 131, 853, 'Rotterdam', 'Rotterdam', 3400), -(8961, 131, 853, 'Rozendaal', 'Rozendaal', 3500), -(8962, 131, 853, 'Sassenheim', 'Sassenheim', 3600), -(8963, 131, 853, 'Schiedam', 'Schiedam', 3700), -(8964, 131, 853, 'Spijkenisse', 'Spijkenisse', 3800), -(8965, 131, 853, 'Voorschoten', 'Voorschoten', 3900), -(8966, 131, 853, 'Warmond', 'Warmond', 4000), -(8967, 131, 853, 'Zoetermeer', 'Zoetermeer', 4100), -(8968, 132, 854, 'Agua Agria', 'Agua Agria', 100), -(8969, 132, 854, 'Caa de Castilla', 'Caa de Castilla', 200), -(8970, 132, 855, 'Abra Vieja', 'Abra Vieja', 100), -(8971, 132, 855, 'Valle Las Zapatas', 'Valle Las Zapatas', 200), -(8972, 132, 856, 'Aduana', 'Aduana', 100), -(8973, 132, 856, 'Managua', 'Managua', 200), -(8974, 132, 857, 'La Fe', 'La Fe', 100), -(8975, 133, 858, 'Манукау', 'Манукау', 100), -(8976, 133, 858, 'Окленд', 'Окленд', 200), -(8977, 133, 859, 'Роторуа', 'Роторуа', 100), -(8978, 133, 859, 'Тауранга', 'Тауранга', 200), -(8979, 133, 860, 'Крайстчерч', 'Крайстчерч', 100), -(8980, 133, 860, 'Тимару', 'Тимару', 200), -(8981, 133, 861, 'Гисборн', 'Гисборн', 100), -(8982, 133, 862, 'Вангануи', 'Вангануи', 100), -(8983, 133, 862, 'Палмерстон-Норт', 'Палмерстон-Норт', 200), -(8984, 133, 863, 'Бленхейм', 'Бленхейм', 100), -(8985, 133, 864, 'Нельсон', 'Нельсон', 100), -(8986, 133, 865, 'Вангарей', 'Вангарей', 100), -(8987, 133, 866, 'Дунедин', 'Дунедин', 100), -(8988, 133, 867, 'Гор', 'Гор', 100), -(8989, 133, 867, 'Инверкаргилл', 'Инверкаргилл', 200), -(8990, 133, 868, 'Нью-Плимут', 'Нью-Плимут', 100), -(8991, 133, 869, 'Ричмонд', 'Ричмонд', 100), -(8992, 133, 870, 'Веллингтон', 'Веллингтон', 100), -(8993, 133, 870, 'Ловер-Хатт', 'Ловер-Хатт', 200), -(8994, 133, 870, 'Мастертон', 'Мастертон', 300), -(8995, 133, 871, 'Греймоут', 'Греймоут', 100), -(8996, 134, 872, 'Нумеа', 'Noumea', 100), -(8997, 135, 873, 'Aamot', 'Aamot', 100), -(8998, 135, 873, 'Asker', 'Asker', 200), -(8999, 135, 873, 'Berger', 'Berger', 300), -(9000, 135, 873, 'Braate', 'Braate', 400), -(9001, 135, 873, 'Brums Verk', 'Brums Verk', 500), -(9002, 135, 873, 'Dokke', 'Dokke', 600), -(9003, 135, 873, 'Drbak', 'Drbak', 700), -(9004, 135, 873, 'Eidsvoll', 'Eidsvoll', 800), -(9005, 135, 873, 'Eidsvoll Verk', 'Eidsvoll Verk', 900), -(9006, 135, 873, 'Fagernes', 'Fagernes', 1000), -(9007, 135, 873, 'Fetsund', 'Fetsund', 1100), -(9008, 135, 873, 'Fosser', 'Fosser', 1200), -(9009, 135, 873, 'Gardermoen', 'Gardermoen', 1300), -(9010, 135, 873, 'Hvik', 'Hvik', 1400), -(9011, 135, 873, 'Jessheim', 'Jessheim', 1500), -(9012, 135, 873, 'Klofta', 'Klofta', 1600), -(9013, 135, 873, 'Lillestrm', 'Lillestrm', 1700), -(9014, 135, 873, 'Mo', 'Mo', 1800), -(9015, 135, 873, 's', 's', 1900), -(9016, 135, 873, 'Sandvika', 'Sandvika', 2000), -(9017, 135, 873, 'Sandviken', 'Sandviken', 2100), -(9018, 135, 873, 'Ski', 'Ski', 2200), -(9019, 135, 873, 'Son', 'Son', 2300), -(9020, 135, 873, 'Stabekk', 'Stabekk', 2400), -(9021, 135, 873, 'Strmmen', 'Strmmen', 2500), -(9022, 135, 873, 'Vormsund', 'Vormsund', 2600), -(9023, 135, 874, 'Aapaasdal', 'Aapaasdal', 100), -(9024, 135, 874, 'Arendal', 'Arendal', 200), -(9025, 135, 874, 'Arnevik', 'Arnevik', 300), -(9026, 135, 874, 'Froland', 'Froland', 400), -(9027, 135, 874, 'Grimstad', 'Grimstad', 500), -(9028, 135, 874, 'Tvedestrand', 'Tvedestrand', 600), -(9029, 135, 875, 'Aamot', 'Aamot', 100), -(9030, 135, 875, 'Amot-Modum', 'Amot-Modum', 200), -(9031, 135, 875, 'Austvoll', 'Austvoll', 300), -(9032, 135, 875, 'Drammen', 'Drammen', 400), -(9033, 135, 875, 'Geilo', 'Geilo', 500), -(9034, 135, 875, 'Gol', 'Gol', 600), -(9035, 135, 875, 'Hemsedal', 'Hemsedal', 700), -(9036, 135, 875, 'Hnefoss', 'Hnefoss', 800), -(9037, 135, 875, 'Holmsbu', 'Holmsbu', 900), -(9038, 135, 875, 'Kongsberg', 'Kongsberg', 1000), -(9039, 135, 875, 'Noresund', 'Noresund', 1100), -(9040, 135, 875, 'Uvdal', 'Uvdal', 1200), -(9041, 135, 875, 'Vestfossen', 'Vestfossen', 1300), -(9042, 135, 875, 'Vik', 'Vik', 1400), -(9043, 135, 875, 'Vikersund', 'Vikersund', 1500), -(9044, 135, 876, 'Akkerfjorden', 'Akkerfjorden', 100), -(9045, 135, 876, 'Alta', 'Alta', 200), -(9046, 135, 876, 'Btsfjord', 'Btsfjord', 300), -(9047, 135, 876, 'Hammerfest', 'Hammerfest', 400), -(9048, 135, 876, 'Hammernes', 'Hammernes', 500), -(9049, 135, 876, 'Havysund', 'Havysund', 600), -(9050, 135, 876, 'Karasjok', 'Karasjok', 700), -(9051, 135, 876, 'Kirkenes', 'Kirkenes', 800), -(9052, 135, 876, 'Kjs', 'Kjs', 900), -(9053, 135, 876, 'Korsnes', 'Korsnes', 1000), -(9054, 135, 876, 'Lakselv', 'Lakselv', 1100), -(9055, 135, 876, 'Langenes', 'Langenes', 1200), -(9056, 135, 876, 'Masi', 'Masi', 1300), -(9057, 135, 876, 'Mehamn', 'Mehamn', 1400), -(9058, 135, 876, 'Seida', 'Seida', 1500), -(9059, 135, 876, 'Tmmervik', 'Tmmervik', 1600), -(9060, 135, 876, 'Vads', 'Vads', 1700), -(9061, 135, 877, 'Aakre', 'Aakre', 100), -(9062, 135, 877, 'Berger', 'Berger', 200), -(9063, 135, 877, 'Breen', 'Breen', 300), -(9064, 135, 877, 'Brumunddal', 'Brumunddal', 400), -(9065, 135, 877, 'Drevsj', 'Drevsj', 500), -(9066, 135, 877, 'Elverum', 'Elverum', 600), -(9067, 135, 877, 'Hamar', 'Hamar', 700), -(9068, 135, 877, 'Rena', 'Rena', 800), -(9069, 135, 877, 'Trysil', 'Trysil', 900), -(9070, 135, 878, 'Aakre', 'Aakre', 100), -(9071, 135, 878, 'Aarvik', 'Aarvik', 200), -(9072, 135, 878, 'Austevoll', 'Austevoll', 300), -(9073, 135, 878, 'Bergen', 'Bergen', 400), -(9074, 135, 878, 'Bmlo', 'Bmlo', 500), -(9075, 135, 878, 'Bogo', 'Bogo', 600), -(9076, 135, 878, 'Bruvik', 'Bruvik', 700), -(9077, 135, 878, 'Eikemofoss', 'Eikemofoss', 800), -(9078, 135, 878, 'Etne', 'Etne', 900), -(9079, 135, 878, 'Fedje', 'Fedje', 1000), -(9080, 135, 878, 'Fitjar', 'Fitjar', 1100), -(9081, 135, 878, 'Haganes', 'Haganes', 1200), -(9082, 135, 878, 'Hellesy', 'Hellesy', 1300), -(9083, 135, 878, 'Leirvik', 'Leirvik', 1400), -(9084, 135, 878, 'len', 'len', 1500), -(9085, 135, 878, 'Nordheimsund', 'Nordheimsund', 1600), -(9086, 135, 878, 'Rosendal', 'Rosendal', 1700), -(9087, 135, 878, 'Stord Island', 'Stord Island', 1800), -(9088, 135, 879, 'Aalesund', 'Aalesund', 100), -(9089, 135, 879, 'Bud', 'Bud', 200), -(9090, 135, 879, 'Farstad', 'Farstad', 300), -(9091, 135, 879, 'Hareid', 'Hareid', 400), -(9092, 135, 879, 'Kristiansund', 'Kristiansund', 500), -(9093, 135, 879, 'Kristiansund Nord', 'Kristiansund Nord', 600), -(9094, 135, 879, 'lesund', 'lesund', 700), -(9095, 135, 879, 'Molde', 'Molde', 800), -(9096, 135, 879, 'Skinnes', 'Skinnes', 900), -(9097, 135, 879, 'Skodje', 'Skodje', 1000), -(9098, 135, 879, 'Sunndalsra', 'Sunndalsra', 1100), -(9099, 135, 879, 'Tennfjord', 'Tennfjord', 1200), -(9100, 135, 879, 'Tomra', 'Tomra', 1300), -(9101, 135, 879, 'Ulsteinvik', 'Ulsteinvik', 1400), -(9102, 135, 879, 'Vik', 'Vik', 1500), -(9103, 135, 879, 'Vikebukt', 'Vikebukt', 1600), -(9104, 135, 880, 'Aisaroaivve', 'Aisaroaivve', 100), -(9105, 135, 881, 'By', 'By', 100), -(9106, 135, 881, 'Grong', 'Grong', 200), -(9107, 135, 881, 'Levanger', 'Levanger', 300), -(9108, 135, 881, 'Namsos', 'Namsos', 400), -(9109, 135, 881, 'Rosvik', 'Rosvik', 500), -(9110, 135, 881, 'Rrvik', 'Rrvik', 600), -(9111, 135, 881, 'sen', 'sen', 700), -(9112, 135, 881, 'Steinkjer', 'Steinkjer', 800), -(9113, 135, 881, 'Stenkjr', 'Stenkjr', 900), -(9114, 135, 882, '', '', 100), -(9115, 135, 882, ' i Lofoten', ' i Lofoten', 200), -(9116, 135, 882, 'B i Vesteralen', 'B i Vesteralen', 300), -(9117, 135, 882, 'Ballset', 'Ballset', 400), -(9118, 135, 882, 'Bergsdalen', 'Bergsdalen', 500), -(9119, 135, 882, 'Bod', 'Bod', 600), -(9120, 135, 882, 'Bosmo', 'Bosmo', 700), -(9121, 135, 882, 'Brnny', 'Brnny', 800), -(9122, 135, 882, 'Grimstad', 'Grimstad', 900), -(9123, 135, 882, 'Grnning', 'Grnning', 1000), -(9124, 135, 882, 'Leirvik', 'Leirvik', 1100), -(9125, 135, 882, 'Melbu', 'Melbu', 1200), -(9126, 135, 882, 'Mo i Rana', 'Mo i Rana', 1300), -(9127, 135, 882, 'Mosjen', 'Mosjen', 1400), -(9128, 135, 882, 'Narvik', 'Narvik', 1500), -(9129, 135, 882, 'Neverdal', 'Neverdal', 1600), -(9130, 135, 882, 'Nordfold', 'Nordfold', 1700), -(9131, 135, 882, 'rnes', 'rnes', 1800), -(9132, 135, 882, 's', 's', 1900), -(9133, 135, 882, 'Sortland', 'Sortland', 2000), -(9134, 135, 882, 'Stokmarknes', 'Stokmarknes', 2100), -(9135, 135, 882, 'Svolvr', 'Svolvr', 2200), -(9136, 135, 882, 'Vgan', 'Vgan', 2300), -(9137, 135, 883, 'Beitostlen', 'Beitostlen', 100), -(9138, 135, 883, 'Gjvik', 'Gjvik', 200), -(9139, 135, 883, 'Gran', 'Gran', 300), -(9140, 135, 883, 'Kolbu', 'Kolbu', 400), -(9141, 135, 883, 'Lillehammer', 'Lillehammer', 500), -(9142, 135, 883, 'Lom', 'Lom', 600), -(9143, 135, 883, 'Otta', 'Otta', 700), -(9144, 135, 883, 'Raufoss', 'Raufoss', 800), -(9145, 135, 883, 'Ringebu', 'Ringebu', 900), -(9146, 135, 883, 'Skreia', 'Skreia', 1000), -(9147, 135, 883, 'Venaasen', 'Venaasen', 1100), -(9148, 135, 884, 'Bekkelaget', 'Bekkelaget', 100), -(9149, 135, 884, 'Bjrnholt', 'Bjrnholt', 200), -(9150, 135, 884, 'Bryn', 'Bryn', 300), -(9151, 135, 884, 'Bygdy', 'Bygdy', 400), -(9152, 135, 884, 'Christiania', 'Christiania', 500), -(9153, 135, 884, 'Ekeberg', 'Ekeberg', 600), -(9154, 135, 884, 'Fiskevoll', 'Fiskevoll', 700), -(9155, 135, 884, 'Frognerstra', 'Frognerstra', 800), -(9156, 135, 884, 'Grefsen', 'Grefsen', 900), -(9157, 135, 884, 'Grorud', 'Grorud', 1000), -(9158, 135, 884, 'Hasle', 'Hasle', 1100), -(9159, 135, 884, 'Holmen', 'Holmen', 1200), -(9160, 135, 884, 'Holmenkollen', 'Holmenkollen', 1300), -(9161, 135, 884, 'Hybraaten', 'Hybraaten', 1400), -(9162, 135, 884, 'Lamberseter', 'Lamberseter', 1500), -(9163, 135, 884, 'Oppsal', 'Oppsal', 1600), -(9164, 135, 884, 'Oslo', 'Oslo', 1700), -(9165, 135, 884, 'Rd', 'Rd', 1800), -(9166, 135, 884, 'Sinsen', 'Sinsen', 1900), -(9167, 135, 884, 'Slakteren', 'Slakteren', 2000), -(9168, 135, 884, 'Tyen', 'Tyen', 2100), -(9169, 135, 884, 'Vika', 'Vika', 2200), -(9170, 135, 885, 'Askim', 'Askim', 100), -(9171, 135, 885, 'Borgen', 'Borgen', 200), -(9172, 135, 885, 'Dole Stasjon', 'Dole Stasjon', 300), -(9173, 135, 885, 'Fredrikstad', 'Fredrikstad', 400), -(9174, 135, 885, 'Greker', 'Greker', 500), -(9175, 135, 885, 'Halden', 'Halden', 600), -(9176, 135, 885, 'Knapstad', 'Knapstad', 700), -(9177, 135, 885, 'Moss', 'Moss', 800), -(9178, 135, 885, 'Sarpsborg', 'Sarpsborg', 900), -(9179, 135, 886, 'Aakrehamn', 'Aakrehamn', 100), -(9180, 135, 886, 'Bryne', 'Bryne', 200), -(9181, 135, 886, 'Egersund', 'Egersund', 300), -(9182, 135, 886, 'Figgjo', 'Figgjo', 400), -(9183, 135, 886, 'Haugesund', 'Haugesund', 500), -(9184, 135, 886, 'Karst', 'Karst', 600), -(9185, 135, 886, 'Leirvik', 'Leirvik', 700), -(9186, 135, 886, 'lgrd', 'lgrd', 800), -(9187, 135, 886, 'Sandnes', 'Sandnes', 900), -(9188, 135, 886, 'Stavanger', 'Stavanger', 1000), -(9189, 135, 886, 'Stavenger', 'Stavenger', 1100), -(9190, 135, 886, 'Tasta', 'Tasta', 1200), -(9191, 135, 887, 'Aalen', 'Aalen', 100), -(9192, 135, 887, 'Flor', 'Flor', 200), -(9193, 135, 887, 'Frde', 'Frde', 300), -(9194, 135, 887, 'Mly', 'Mly', 400), -(9195, 135, 887, 'Nordfjordeid', 'Nordfjordeid', 500), -(9196, 135, 887, 'rberg', 'rberg', 600), -(9197, 135, 887, 'Stryn', 'Stryn', 700), -(9198, 135, 888, '', '', 100), -(9199, 135, 888, 'Angen', 'Angen', 200), -(9200, 135, 888, 'Bakken', 'Bakken', 300), -(9201, 135, 888, 'Hstnes', 'Hstnes', 400), -(9202, 135, 888, 'Leirvik', 'Leirvik', 500), -(9203, 135, 888, 'Lensvik', 'Lensvik', 600), -(9204, 135, 888, 'Oppdal', 'Oppdal', 700), -(9205, 135, 888, 'Orkanger', 'Orkanger', 800), -(9206, 135, 888, 'Trondheim', 'Trondheim', 900), -(9207, 135, 888, 'Trondhjem', 'Trondhjem', 1000), -(9208, 135, 889, 'B', 'B', 100), -(9209, 135, 889, 'B i Telemark', 'B i Telemark', 200), -(9210, 135, 889, 'Bergan', 'Bergan', 300), -(9211, 135, 889, 'Drangedal', 'Drangedal', 400), -(9212, 135, 889, 'Krager', 'Krager', 500), -(9213, 135, 889, 'Notodden', 'Notodden', 600), -(9214, 135, 889, 'Porsgrunn', 'Porsgrunn', 700), -(9215, 135, 889, 'rak', 'rak', 800), -(9216, 135, 889, 'rnes i Telemark', 'rnes i Telemark', 900), -(9217, 135, 889, 'Skien', 'Skien', 1000), -(9218, 135, 890, '', '', 100), -(9219, 135, 890, 'Aanstad', 'Aanstad', 200), -(9220, 135, 890, 'Berg', 'Berg', 300), -(9221, 135, 890, 'Finnsnes', 'Finnsnes', 400), -(9222, 135, 890, 'Harstad', 'Harstad', 500), -(9223, 135, 890, 'Kirkesjord', 'Kirkesjord', 600), -(9224, 135, 890, 'Nordlenangen', 'Nordlenangen', 700), -(9225, 135, 890, 'Skjervy', 'Skjervy', 800), -(9226, 135, 890, 'Troms', 'Troms', 900), -(9227, 135, 890, 'Vanneried', 'Vanneried', 1000), -(9228, 135, 891, 'Farestad', 'Farestad', 100), -(9229, 135, 891, 'Flekkefjord', 'Flekkefjord', 200), -(9230, 135, 891, 'Grimestad', 'Grimestad', 300), -(9231, 135, 891, 'Kristiansand', 'Kristiansand', 400), -(9232, 135, 891, 'Lyngdal', 'Lyngdal', 500), -(9233, 135, 891, 'Mandal', 'Mandal', 600), -(9234, 135, 891, 'Vennesla', 'Vennesla', 700), -(9235, 135, 891, 'Vike', 'Vike', 800), -(9236, 135, 892, 'Bergan', 'Bergan', 100), -(9237, 135, 892, 'Bukta', 'Bukta', 200), -(9238, 135, 892, 'Horten', 'Horten', 300), -(9239, 135, 892, 'Larvik', 'Larvik', 400), -(9240, 135, 892, 'Nttery', 'Nttery', 500), -(9241, 135, 892, 's', 's', 600), -(9242, 135, 892, 'Sandefjord', 'Sandefjord', 700), -(9243, 135, 892, 'Tjme', 'Tjme', 800), -(9244, 135, 892, 'Tnsberg', 'Tnsberg', 900), -(9245, 136, 893, 'Кингстон', 'Kingston', 100), -(9246, 137, 894, 'Абу Даби', 'Abu Dhabi', 100), -(9247, 137, 895, 'Дубаи', 'Dubai', 100), -(9248, 138, 896, 'Маскат', 'Maskat', 100), -(9249, 138, 896, 'Салала', 'Salala', 200), -(9250, 138, 896, 'Сур', 'Sur', 300), -(9251, 139, 897, 'Исламабад', 'Islamabad', 100), -(9252, 139, 897, 'Карачи', 'Karachi', 200), -(9253, 139, 897, 'Лахоре', 'Lahore', 300), -(9254, 140, 898, 'David', 'David', 100), -(9255, 140, 899, 'Albina', 'Albina', 100), -(9256, 140, 899, 'El Olivo', 'El Olivo', 200), -(9257, 140, 900, 'Alto de La Cruz', 'Alto de La Cruz', 100), -(9258, 140, 901, 'Atalayita', 'Atalayita', 100), -(9259, 140, 902, 'Amador', 'Amador', 100), -(9260, 140, 902, 'Arraijn', 'Arraijn', 200), -(9261, 140, 902, 'Caledonia', 'Caledonia', 300), -(9262, 140, 902, 'Ciudad de Panam', 'Ciudad de Panam', 400), -(9263, 140, 902, 'Paitilla', 'Paitilla', 500), -(9264, 140, 902, 'Panam', 'Panam', 600), -(9265, 140, 902, 'Panama City', 'Panama City', 700), -(9266, 140, 902, 'San Miguelito', 'San Miguelito', 800), -(9267, 141, 903, 'Порт-Морсби', 'Port-Morsbi', 100), -(9268, 141, 903, 'Рабаул', 'Rabaul', 200), -(9269, 142, 904, '28 Km Paranambu', '28 Km Paranambu', 100), -(9270, 142, 905, 'Asuncin', 'Asuncin', 100), -(9271, 142, 906, 'Itacurub de la Cordillera', 'Itacurub de la Cordillera', 100), -(9272, 142, 907, 'Barrio Asuncin', 'Barrio Asuncin', 100), -(9273, 142, 907, 'Diarte', 'Diarte', 200), -(9274, 142, 908, 'Colonia San Pedro', 'Colonia San Pedro', 100), -(9275, 142, 908, 'Mercedes', 'Mercedes', 200), -(9276, 142, 908, 'Puerto Villa del Rosario', 'Puerto Villa del Rosario', 300), -(9277, 142, 908, 'San Pedro', 'San Pedro', 400), -(9278, 143, 909, 'Achaguay Medio', 'Achaguay Medio', 100), -(9279, 143, 910, 'Acco', 'Acco', 100), -(9280, 143, 910, 'Chimbote', 'Chimbote', 200), -(9281, 143, 910, 'Huaraz', 'Huaraz', 300), -(9282, 143, 911, 'Arequipa', 'Arequipa', 100), -(9283, 143, 912, 'Cangallo', 'Cangallo', 100), -(9284, 143, 913, 'Agua Dulce', 'Agua Dulce', 100), -(9285, 143, 913, 'Cajamarca', 'Cajamarca', 200), -(9286, 143, 914, 'La Perla', 'La Perla', 100), -(9287, 143, 915, 'Astana', 'Astana', 100), -(9288, 143, 915, 'Cusco', 'Cusco', 200), -(9289, 143, 915, 'Machu Piccho', 'Machu Piccho', 300), -(9290, 143, 915, 'Pisac', 'Pisac', 400), -(9291, 143, 916, 'Tingo Mara', 'Tingo Mara', 100), -(9292, 143, 917, 'Agua Salada', 'Agua Salada', 100), -(9293, 143, 917, 'Aja', 'Aja', 200), -(9294, 143, 917, 'Pisco', 'Pisco', 300), -(9295, 143, 917, 'Ullujalla Hacienda', 'Ullujalla Hacienda', 400), -(9296, 143, 918, 'Huancayo', 'Huancayo', 100), -(9297, 143, 918, 'Jauja', 'Jauja', 200), -(9298, 143, 918, 'Satipo', 'Satipo', 300), -(9299, 143, 919, 'Chocope', 'Chocope', 100), -(9300, 143, 919, 'Trujillo', 'Trujillo', 200), -(9301, 143, 920, 'Chiclayo', 'Chiclayo', 100), -(9302, 143, 920, 'Lambayeque', 'Lambayeque', 200), -(9303, 143, 921, 'Acacoto', 'Acacoto', 100), -(9304, 143, 921, 'Acho', 'Acho', 200), -(9305, 143, 921, 'Agua', 'Agua', 300), -(9306, 143, 921, 'Agustino', 'Agustino', 400), -(9307, 143, 921, 'Balconcillo de Aviyay', 'Balconcillo de Aviyay', 500), -(9308, 143, 921, 'Chorrillos', 'Chorrillos', 600), -(9309, 143, 921, 'Chosica', 'Chosica', 700), -(9310, 143, 921, 'Higuereta', 'Higuereta', 800), -(9311, 143, 921, 'Huacho', 'Huacho', 900), -(9312, 143, 921, 'La Victoria', 'La Victoria', 1000), -(9313, 143, 921, 'Lima', 'Lima', 1100), -(9314, 143, 921, 'Litma', 'Litma', 1200), -(9315, 143, 921, 'Los Cipreses', 'Los Cipreses', 1300), -(9316, 143, 921, 'Los Olivos', 'Los Olivos', 1400), -(9317, 143, 921, 'Magdalena del Mar', 'Magdalena del Mar', 1500), -(9318, 143, 921, 'Miraflores', 'Miraflores', 1600), -(9319, 143, 921, 'Rmac', 'Rmac', 1700), -(9320, 143, 921, 'San Borja', 'San Borja', 1800), -(9321, 143, 921, 'Santa Anita', 'Santa Anita', 1900), -(9322, 143, 921, 'Santiago de Surco', 'Santiago de Surco', 2000), -(9323, 143, 921, 'Surco', 'Surco', 2100), -(9324, 143, 921, 'Vitarte', 'Vitarte', 2200), -(9325, 143, 922, 'Iquitos', 'Iquitos', 100), -(9326, 143, 923, 'Esperana', 'Esperana', 100), -(9327, 143, 924, 'Queseras', 'Queseras', 100), -(9328, 143, 925, 'San Juan', 'San Juan', 100), -(9329, 143, 926, 'Castilla', 'Castilla', 100), -(9330, 143, 926, 'Piura', 'Piura', 200), -(9331, 143, 927, 'Azngaro', 'Azngaro', 100), -(9332, 143, 927, 'Puno', 'Puno', 200), -(9333, 143, 928, 'Tarapoto', 'Tarapoto', 100), -(9334, 143, 929, 'Alto Per', 'Alto Per', 100), -(9335, 143, 929, 'Tacna', 'Tacna', 200), -(9336, 143, 930, 'La Garita', 'La Garita', 100), -(9337, 143, 930, 'Tumbes', 'Tumbes', 200), -(9338, 143, 931, 'Callaria', 'Callaria', 100), -(9339, 143, 931, 'Pucallpa', 'Pucallpa', 200), -(9340, 144, 932, 'Адамстаун', 'Adamstown', 100), -(9341, 145, 933, 'Aleksandrw', 'Aleksandrw', 100), -(9342, 145, 933, 'Andrzejw', 'Andrzejw', 200), -(9343, 145, 933, 'Antolin', 'Antolin', 300), -(9344, 145, 933, 'Bedlno', 'Bedlno', 400), -(9345, 145, 933, 'Bia‚a Podlaska', 'Bia‚a Podlaska', 500), -(9346, 145, 933, 'Horbw', 'Horbw', 600), -(9347, 145, 933, 'Miedzyrzec', 'Miedzyrzec', 700), -(9348, 145, 933, 'Terespol', 'Terespol', 800), -(9349, 145, 934, 'Aleksandrowo', 'Aleksandrowo', 100), -(9350, 145, 934, 'Antoniuk', 'Antoniuk', 200), -(9351, 145, 934, 'Augustowo', 'Augustowo', 300), -(9352, 145, 934, 'Bernadzki Most', 'Bernadzki Most', 400), -(9353, 145, 934, 'Bialystok', 'Bialystok', 500), -(9354, 145, 934, 'Bia‚ostoczek', 'Bia‚ostoczek', 600), -(9355, 145, 934, 'Bielsk Podlaski', 'Bielsk Podlaski', 700), -(9356, 145, 934, 'Hajnwka', 'Hajnwka', 800), -(9357, 145, 934, 'Mielnik', 'Mielnik', 900), -(9358, 145, 934, 'Sokulka', 'Sokulka', 1000), -(9359, 145, 935, 'Auschwitz', 'Auschwitz', 100), -(9360, 145, 935, 'Bednarze', 'Bednarze', 200), -(9361, 145, 935, 'Bielsko-Bia‚a', 'Bielsko-Bia‚a', 300), -(9362, 145, 935, 'Czaniec', 'Czaniec', 400), -(9363, 145, 935, 'Kety', 'Kety', 500), -(9364, 145, 935, 'Oswiecim', 'Oswiecim', 600), -(9365, 145, 936, 'Augustowo', 'Augustowo', 100), -(9366, 145, 936, 'Cekcyn', 'Cekcyn', 200), -(9367, 145, 936, 'Chojnice', 'Chojnice', 300), -(9368, 145, 936, 'Fordon', 'Fordon', 400), -(9369, 145, 936, 'Inovrotslav', 'Inovrotslav', 500), -(9370, 145, 936, 'Slesin', 'Slesin', 600), -(9371, 145, 937, 'Che‚m', 'Che‚m', 100), -(9372, 145, 937, 'Horodyszcze', 'Horodyszcze', 200), -(9373, 145, 937, 'Huta', 'Huta', 300), -(9374, 145, 937, 'Krasnystaw', 'Krasnystaw', 400), -(9375, 145, 938, 'Aleksandria Pierwsza', 'Aleksandria Pierwsza', 100), -(9376, 145, 938, 'Chenstochov', 'Chenstochov', 200), -(9377, 145, 938, 'Czestochowa', 'Czestochowa', 300), -(9378, 145, 939, 'Breslau', 'Breslau', 100), -(9379, 145, 939, 'Breslavia', 'Breslavia', 200), -(9380, 145, 939, 'Czerniawa-Zdrj', 'Czerniawa-Zdrj', 300), -(9381, 145, 939, 'Jelenia Gra', 'Jelenia Gra', 400), -(9382, 145, 939, 'Liebau', 'Liebau', 500), -(9383, 145, 939, 'Rybnica', 'Rybnica', 600), -(9384, 145, 939, 'Vrotslav', 'Vrotslav', 700), -(9385, 145, 939, 'Wroc‚aw', 'Wroc‚aw', 800), -(9386, 145, 939, 'Wros‚aw', 'Wros‚aw', 900), -(9387, 145, 940, 'Braniewo', 'Braniewo', 100), -(9388, 145, 940, 'Elblag', 'Elblag', 200), -(9389, 145, 941, 'Althtte', 'Althtte', 100), -(9390, 145, 941, 'Banino', 'Banino', 200), -(9391, 145, 941, 'Bieszki', 'Bieszki', 300), -(9392, 145, 941, 'B‚otnik', 'B‚otnik', 400), -(9393, 145, 941, 'Choczewo', 'Choczewo', 500), -(9394, 145, 941, 'Gdingen', 'Gdingen', 600), -(9395, 145, 941, 'Gdynia', 'Gdynia', 700), -(9396, 145, 941, 'Grki Zachodnie', 'Grki Zachodnie', 800), -(9397, 145, 941, 'Huta', 'Huta', 900), -(9398, 145, 941, 'Lezno', 'Lezno', 1000), -(9399, 145, 941, 'Sopot', 'Sopot', 1100), -(9400, 145, 941, 'Tczew', 'Tczew', 1200), -(9401, 145, 941, 'Wrzeszcz', 'Wrzeszcz', 1300), -(9402, 145, 942, 'Gorzw Wielkopolski', 'Gorzw Wielkopolski', 100), -(9403, 145, 942, 'Kostrzyn nad Odra', 'Kostrzyn nad Odra', 200), -(9404, 145, 942, 'S‚ubice', 'S‚ubice', 300), -(9405, 145, 943, 'Boleslawice', 'Boleslawice', 100), -(9406, 145, 943, 'Boles‚awiec', 'Boles‚awiec', 200), -(9407, 145, 943, 'Czarne', 'Czarne', 300), -(9408, 145, 943, 'Wlen', 'Wlen', 400), -(9409, 145, 943, 'Zgorzelec', 'Zgorzelec', 500), -(9410, 145, 943, 'Zgorzelice', 'Zgorzelice', 600), -(9411, 145, 944, 'Kalisz', 'Kalisz', 100), -(9412, 145, 944, 'Ostrw Wielkopolski', 'Ostrw Wielkopolski', 200), -(9413, 145, 945, 'Bedzin', 'Bedzin', 100), -(9414, 145, 945, 'Bobrek Karf', 'Bobrek Karf', 200), -(9415, 145, 945, 'Bytom', 'Bytom', 300), -(9416, 145, 945, 'Dabrowa Gornicza', 'Dabrowa Gornicza', 400), -(9417, 145, 945, 'Gliwice', 'Gliwice', 500), -(9418, 145, 945, 'Jaworzno', 'Jaworzno', 600), -(9419, 145, 945, 'Katowice-Bogucice', 'Katowice-Bogucice', 700), -(9420, 145, 945, 'Katowice-Brynw', 'Katowice-Brynw', 800), -(9421, 145, 945, 'Kattowice-Nord', 'Kattowice-Nord', 900), -(9422, 145, 945, 'Kattowice-West', 'Kattowice-West', 1000), -(9423, 145, 945, 'Piekary Slaskie', 'Piekary Slaskie', 1100), -(9424, 145, 945, 'Racibrz', 'Racibrz', 1200), -(9425, 145, 945, 'Rybnik', 'Rybnik', 1300), -(9426, 145, 945, 'Sosnowiec', 'Sosnowiec', 1400), -(9427, 145, 945, 'Tarnowskie Gry', 'Tarnowskie Gry', 1500), -(9428, 145, 945, 'Tychy', 'Tychy', 1600), -(9429, 145, 945, 'Zabrze', 'Zabrze', 1700), -(9430, 145, 946, 'Adamw', 'Adamw', 100), -(9431, 145, 946, 'Bilcza', 'Bilcza', 200), -(9432, 145, 946, 'Busko-Zdrj', 'Busko-Zdrj', 300), -(9433, 145, 946, 'Cminsk Swiate‚ek', 'Cminsk Swiate‚ek', 400), -(9434, 145, 946, 'Kaziny', 'Kaziny', 500), -(9435, 145, 946, 'Kraskw', 'Kraskw', 600), -(9436, 145, 946, 'Ostrowiec', 'Ostrowiec', 700), -(9437, 145, 946, 'Ostrowiec Swietokrzyski', 'Ostrowiec Swietokrzyski', 800), -(9438, 145, 946, 'Skarzysko-Kamienna', 'Skarzysko-Kamienna', 900), -(9439, 145, 947, 'Babin', 'Babin', 100), -(9440, 145, 947, 'Dabrowica', 'Dabrowica', 200), -(9441, 145, 947, 'Konin', 'Konin', 300), -(9442, 145, 948, 'Preczw', 'Preczw', 100), -(9443, 145, 949, 'Balice', 'Balice', 100), -(9444, 145, 949, 'Batowice', 'Batowice', 200), -(9445, 145, 949, 'Borek', 'Borek', 300), -(9446, 145, 949, 'Borek Fa‚ecki', 'Borek Fa‚ecki', 400), -(9447, 145, 949, 'Czechy', 'Czechy', 500), -(9448, 145, 949, 'Ibramowice', 'Ibramowice', 600), -(9449, 145, 949, 'Janowice', 'Janowice', 700), -(9450, 145, 949, 'Kaszw', 'Kaszw', 800), -(9451, 145, 949, 'Kazimierz', 'Kazimierz', 900), -(9452, 145, 949, 'Konary', 'Konary', 1000), -(9453, 145, 949, 'Kozmice', 'Kozmice', 1100), -(9454, 145, 949, 'Krakuszowice', 'Krakuszowice', 1200), -(9455, 145, 949, 'Krowodrza', 'Krowodrza', 1300), -(9456, 145, 949, 'Krzykwka', 'Krzykwka', 1400), -(9457, 145, 949, 'Kunice', 'Kunice', 1500), -(9458, 145, 949, 'Mi‚ocice', 'Mi‚ocice', 1600), -(9459, 145, 949, 'Myslenice', 'Myslenice', 1700), -(9460, 145, 949, 'Nowa Huta', 'Nowa Huta', 1800), -(9461, 145, 949, 'Pieskowa Ska‚a', 'Pieskowa Ska‚a', 1900), -(9462, 145, 949, 'Wawel', 'Wawel', 2000), -(9463, 145, 949, 'Zbik', 'Zbik', 2100), -(9464, 145, 949, 'Zielona', 'Zielona', 2200), -(9465, 145, 950, 'Bromberg', 'Bromberg', 100), -(9466, 145, 950, 'Bydgoszcz', 'Bydgoszcz', 200), -(9467, 145, 951, 'Jawor', 'Jawor', 100); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(9468, 145, 951, 'Lignica', 'Lignica', 200), -(9469, 145, 952, 'Gostyn', 'Gostyn', 100), -(9470, 145, 952, 'Gra', 'Gra', 200), -(9471, 145, 952, 'Leszno', 'Leszno', 300), -(9472, 145, 953, 'Aleksandrw', 'Aleksandrw', 100), -(9473, 145, 953, 'Anielin', 'Anielin', 200), -(9474, 145, 953, 'Augustw', 'Augustw', 300), -(9475, 145, 953, 'Ba‚uty', 'Ba‚uty', 400), -(9476, 145, 953, 'Be‚dow', 'Be‚dow', 500), -(9477, 145, 953, 'Be‚dowek', 'Be‚dowek', 600), -(9478, 145, 953, 'Budy', 'Budy', 700), -(9479, 145, 953, 'Chojny', 'Chojny', 800), -(9480, 145, 953, 'Glovno', 'Glovno', 900), -(9481, 145, 953, 'Karolew', 'Karolew', 1000), -(9482, 145, 953, 'Kwilno', 'Kwilno', 1100), -(9483, 145, 953, 'Lublinek', 'Lublinek', 1200), -(9484, 145, 953, 'Olechw', 'Olechw', 1300), -(9485, 145, 953, 'owicz', 'owicz', 1400), -(9486, 145, 953, 'Pabianice', 'Pabianice', 1500), -(9487, 145, 953, 'Piaskowice', 'Piaskowice', 1600), -(9488, 145, 953, 'Radogoszcz', 'Radogoszcz', 1700), -(9489, 145, 953, 'Retkinia', 'Retkinia', 1800), -(9490, 145, 953, 'Teofilw', 'Teofilw', 1900), -(9491, 145, 953, 'Widzew', 'Widzew', 2000), -(9492, 145, 953, 'Zgierz', 'Zgierz', 2100), -(9493, 145, 954, 'Litzmannstadt', 'Litzmannstadt', 100), -(9494, 145, 955, 'Andrzejki', 'Andrzejki', 100), -(9495, 145, 955, 'Barany', 'Barany', 200), -(9496, 145, 955, 'Zambrw', 'Zambrw', 300), -(9497, 145, 956, 'Adampol', 'Adampol', 100), -(9498, 145, 956, 'Basonia', 'Basonia', 200), -(9499, 145, 956, 'Brzeznica Bychowska', 'Brzeznica Bychowska', 300), -(9500, 145, 956, 'Choiny', 'Choiny', 400), -(9501, 145, 956, 'Kazimierz Dolny', 'Kazimierz Dolny', 500), -(9502, 145, 956, 'Kock', 'Kock', 600), -(9503, 145, 956, 'Lubartw', 'Lubartw', 700), -(9504, 145, 956, 'Lubomirka', 'Lubomirka', 800), -(9505, 145, 956, 'Ludwikw Grny', 'Ludwikw Grny', 900), -(9506, 145, 956, 'Ludwin', 'Ludwin', 1000), -(9507, 145, 956, 'Milejw', 'Milejw', 1100), -(9508, 145, 956, 'Niemce', 'Niemce', 1200), -(9509, 145, 957, 'Grnberg', 'Grnberg', 100), -(9510, 145, 957, 'Gruentberg', 'Gruentberg', 200), -(9511, 145, 957, 'Zielona Gra', 'Zielona Gra', 300), -(9512, 145, 958, 'Cracovia', 'Cracovia', 100), -(9513, 145, 958, 'Cracovie', 'Cracovie', 200), -(9514, 145, 958, 'Cracow', 'Cracow', 300), -(9515, 145, 958, 'Krakau', 'Krakau', 400), -(9516, 145, 958, 'Krakov', 'Krakov', 500), -(9517, 145, 958, 'Krakw', 'Krakw', 600), -(9518, 145, 959, 'Warszawa', 'Warszawa', 100), -(9519, 145, 960, 'Sodehnen', 'Sodehnen', 100), -(9520, 145, 961, 'Nowy Sacz', 'Nowy Sacz', 100), -(9521, 145, 961, 'Tylicz', 'Tylicz', 200), -(9522, 145, 962, 'Bartenstein', 'Bartenstein', 100), -(9523, 145, 962, 'Bartoszyce', 'Bartoszyce', 200), -(9524, 145, 962, 'Dobre Miasto', 'Dobre Miasto', 300), -(9525, 145, 962, 'Ketrzyn', 'Ketrzyn', 400), -(9526, 145, 962, 'Stary Olsztyn', 'Stary Olsztyn', 500), -(9527, 145, 963, 'Brieg', 'Brieg', 100), -(9528, 145, 963, 'Grabczak', 'Grabczak', 200), -(9529, 145, 963, 'G‚ogowek', 'G‚ogowek', 300), -(9530, 145, 963, 'Kedzierzyn-Kozle', 'Kedzierzyn-Kozle', 400), -(9531, 145, 963, 'Kluczbork', 'Kluczbork', 500), -(9532, 145, 963, 'Krapkowice', 'Krapkowice', 600), -(9533, 145, 963, 'Lewice', 'Lewice', 700), -(9534, 145, 963, 'Nysa', 'Nysa', 800), -(9535, 145, 963, 'Opole-Szczepanowice', 'Opole-Szczepanowice', 900), -(9536, 145, 963, 'Polkowice', 'Polkowice', 1000), -(9537, 145, 964, 'Ma‚kinia Gorna', 'Ma‚kinia Gorna', 100), -(9538, 145, 964, 'Przasnysz', 'Przasnysz', 200), -(9539, 145, 965, 'Trzcianka', 'Trzcianka', 100), -(9540, 145, 966, 'Piotrkw Trybunalski', 'Piotrkw Trybunalski', 100), -(9541, 145, 966, 'Sulejw', 'Sulejw', 200), -(9542, 145, 966, 'Tomaszw Mazowiecki', 'Tomaszw Mazowiecki', 300), -(9543, 145, 967, 'Plotsk', 'Plotsk', 100), -(9544, 145, 967, 'P‚ock', 'P‚ock', 200), -(9545, 145, 968, 'Reichshof', 'Reichshof', 100), -(9546, 145, 968, 'Rzeszw', 'Rzeszw', 200), -(9547, 145, 968, 'Zheshev', 'Zheshev', 300), -(9548, 145, 968, 'Zheshuv', 'Zheshuv', 400), -(9549, 145, 969, 'Danzig', 'Danzig', 100), -(9550, 145, 969, 'Gdansk', 'Gdansk', 200), -(9551, 145, 970, 'Annopole', 'Annopole', 100), -(9552, 145, 970, 'Dabrowka Lesna', 'Dabrowka Lesna', 200), -(9553, 145, 970, 'Gniezno', 'Gniezno', 300), -(9554, 145, 970, 'Oborniki', 'Oborniki', 400), -(9555, 145, 970, 'Stare Miasto', 'Stare Miasto', 500), -(9556, 145, 970, 'Strzeszyn', 'Strzeszyn', 600), -(9557, 145, 970, 'Zielona Gra', 'Zielona Gra', 700), -(9558, 145, 971, 'Grki', 'Grki', 100), -(9559, 145, 971, 'Jaroslau', 'Jaroslau', 200), -(9560, 145, 971, 'Przemysl', 'Przemysl', 300), -(9561, 145, 972, 'Radom', 'Radom', 100), -(9562, 145, 973, 'Baranwka', 'Baranwka', 100), -(9563, 145, 973, 'Kielnarowa', 'Kielnarowa', 200), -(9564, 145, 973, 'Kolbuszowa', 'Kolbuszowa', 300), -(9565, 145, 973, 'Mielec', 'Mielec', 400), -(9566, 145, 973, 'Ropczyce', 'Ropczyce', 500), -(9567, 145, 973, 'Sieklwka', 'Sieklwka', 600), -(9568, 145, 973, 'Tyczyn', 'Tyczyn', 700), -(9569, 145, 974, 'Siedlce', 'Siedlce', 100), -(9570, 145, 974, 'Zembrw', 'Zembrw', 200), -(9571, 145, 975, 'Seradz', 'Seradz', 100), -(9572, 145, 975, 'Sieradz', 'Sieradz', 200), -(9573, 145, 975, 'Zdunska Wola', 'Zdunska Wola', 300), -(9574, 145, 976, 'Skieniewice', 'Skieniewice', 100), -(9575, 145, 976, 'Sochaczew', 'Sochaczew', 200), -(9576, 145, 977, 'Katowice', 'Katowice', 100), -(9577, 145, 977, 'Kattowitz', 'Kattowitz', 200), -(9578, 145, 977, 'Stalinogorod', 'Stalinogorod', 300), -(9579, 145, 978, 'Dobra', 'Dobra', 100), -(9580, 145, 978, 'Stolp in Pommern', 'Stolp in Pommern', 200), -(9581, 145, 978, 'S‚upsk', 'S‚upsk', 300), -(9582, 145, 979, 'Augustw', 'Augustw', 100), -(9583, 145, 979, 'Suvalkai', 'Suvalkai', 200), -(9584, 145, 979, 'Suvalki', 'Suvalki', 300), -(9585, 145, 979, 'Wygryny', 'Wygryny', 400), -(9586, 145, 980, 'Kielce', 'Kielce', 100), -(9587, 145, 981, 'Sandomierz', 'Sandomierz', 100), -(9588, 145, 981, 'Stalowa Wola', 'Stalowa Wola', 200), -(9589, 145, 981, 'Tarnobrzeg', 'Tarnobrzeg', 300), -(9590, 145, 982, 'Brzesko', 'Brzesko', 100), -(9591, 145, 982, 'Debica', 'Debica', 200), -(9592, 145, 982, 'Tarnw', 'Tarnw', 300), -(9593, 145, 983, 'Grudziadz', 'Grudziadz', 100), -(9594, 145, 983, 'Torun', 'Torun', 200), -(9595, 145, 983, 'Wabrzezno', 'Wabrzezno', 300), -(9596, 145, 984, 'Szczawno-Zdrj', 'Szczawno-Zdrj', 100), -(9597, 145, 985, 'Olsztyn', 'Olsztyn', 100), -(9598, 145, 986, 'Anin', 'Anin', 100), -(9599, 145, 986, 'Bielany', 'Bielany', 200), -(9600, 145, 986, 'Bieliny', 'Bieliny', 300), -(9601, 145, 986, 'Dziekanow Lesny', 'Dziekanow Lesny', 400), -(9602, 145, 986, 'Janczewice', 'Janczewice', 500), -(9603, 145, 986, 'Jankw Nowy', 'Jankw Nowy', 600), -(9604, 145, 986, 'Legionowo', 'Legionowo', 700), -(9605, 145, 986, 'Ostrw', 'Ostrw', 800), -(9606, 145, 986, 'Ozarow Mazowiecki', 'Ozarow Mazowiecki', 900), -(9607, 145, 986, 'Praga', 'Praga', 1000), -(9608, 145, 986, 'Pruszkw', 'Pruszkw', 1100), -(9609, 145, 986, 'Radzymin', 'Radzymin', 1200), -(9610, 145, 986, 'Varsavia', 'Varsavia', 1300), -(9611, 145, 986, 'Varshava', 'Varshava', 1400), -(9612, 145, 986, 'Varsovie', 'Varsovie', 1500), -(9613, 145, 986, 'Warsaw', 'Warsaw', 1600), -(9614, 145, 986, 'Warschau', 'Warschau', 1700), -(9615, 145, 986, 'Warszawa', 'Warszawa', 1800), -(9616, 145, 986, 'Warszwka', 'Warszwka', 1900), -(9617, 145, 986, 'Wawer', 'Wawer', 2000), -(9618, 145, 986, 'Wawrzyszew Nowy', 'Wawrzyszew Nowy', 2100), -(9619, 145, 986, 'Wolominek', 'Wolominek', 2200), -(9620, 145, 986, 'Zielona', 'Zielona', 2300), -(9621, 145, 986, 'Zoliborz', 'Zoliborz', 2400), -(9622, 145, 987, 'Posen', 'Posen', 100), -(9623, 145, 987, 'Poznan', 'Poznan', 200), -(9624, 145, 988, 'Rypin', 'Rypin', 100), -(9625, 145, 988, 'W‚oc‚awek', 'W‚oc‚awek', 200), -(9626, 145, 989, 'Baki', 'Baki', 100), -(9627, 145, 989, 'Brzykw', 'Brzykw', 200), -(9628, 145, 989, 'Bukownica', 'Bukownica', 300), -(9629, 145, 989, 'Krzyki', 'Krzyki', 400), -(9630, 145, 989, 'Olesnica', 'Olesnica', 500), -(9631, 145, 989, 'Srodmiescie', 'Srodmiescie', 600), -(9632, 145, 989, 'Swidnica Polska', 'Swidnica Polska', 700), -(9633, 145, 989, 'Wo‚ow', 'Wo‚ow', 800), -(9634, 145, 989, 'Wroc‚aw Bartoszewice', 'Wroc‚aw Bartoszewice', 900), -(9635, 145, 989, 'Wroc‚aw Pracze', 'Wroc‚aw Pracze', 1000), -(9636, 145, 989, 'Wroc‚aw Strachowice', 'Wroc‚aw Strachowice', 1100), -(9637, 145, 989, 'Wroc‚aw-Gadow Ma‚y', 'Wroc‚aw-Gadow Ma‚y', 1200), -(9638, 145, 989, 'Wroc‚aw-Kar‚owice', 'Wroc‚aw-Kar‚owice', 1300), -(9639, 145, 989, 'Wroc‚aw-Osobowice', 'Wroc‚aw-Osobowice', 1400), -(9640, 145, 989, 'Wroc‚aw-Psie Pole', 'Wroc‚aw-Psie Pole', 1500), -(9641, 145, 990, 'Abtei', 'Abtei', 100), -(9642, 145, 990, 'Bia‚ogard', 'Bia‚ogard', 200), -(9643, 145, 990, 'Borne', 'Borne', 300), -(9644, 145, 990, 'Kalisz Pomorski', 'Kalisz Pomorski', 400), -(9645, 145, 990, 'Kolberg', 'Kolberg', 500), -(9646, 145, 990, 'Koszalin', 'Koszalin', 600), -(9647, 145, 990, 'Ko‚obrzeg', 'Ko‚obrzeg', 700), -(9648, 145, 990, 'Plate', 'Plate', 800), -(9649, 145, 990, 'Stargard Szczecinski', 'Stargard Szczecinski', 900), -(9650, 145, 990, 'Stettin', 'Stettin', 1000), -(9651, 145, 990, 'Swinioujscie', 'Swinioujscie', 1100), -(9652, 145, 990, 'Swinoujscie', 'Swinoujscie', 1200), -(9653, 145, 990, 'Szczecin', 'Szczecin', 1300), -(9654, 145, 990, 'Szczecin Gumience', 'Szczecin Gumience', 1400), -(9655, 145, 990, 'Szczecinek', 'Szczecinek', 1500), -(9656, 145, 990, 'S‚ajsino', 'S‚ajsino', 1600), -(9657, 145, 990, 'Trzebiatw', 'Trzebiatw', 1700), -(9658, 145, 991, 'Dub', 'Dub', 100), -(9659, 145, 991, 'Tomaszw Lubelski', 'Tomaszw Lubelski', 200), -(9660, 145, 991, 'Zamosc', 'Zamosc', 300), -(9661, 145, 992, 'Gubin', 'Gubin', 100), -(9662, 145, 992, 'Krosno Odrzanskie', 'Krosno Odrzanskie', 200), -(9663, 145, 992, 'Sulechw', 'Sulechw', 300), -(9664, 145, 992, 'Zagan', 'Zagan', 400), -(9665, 145, 992, 'Zary', 'Zary', 500), -(9666, 146, 993, 'A dos Ferreiros de Cima', 'A dos Ferreiros de Cima', 100), -(9667, 146, 993, 'Albergaria-a-Velha', 'Albergaria-a-Velha', 200), -(9668, 146, 993, 'Arcozelo', 'Arcozelo', 300), -(9669, 146, 993, 'Arieiro', 'Arieiro', 400), -(9670, 146, 993, 'Aveiro', 'Aveiro', 500), -(9671, 146, 993, 'Borralha', 'Borralha', 600), -(9672, 146, 993, 'Cacia', 'Cacia', 700), -(9673, 146, 993, 'Cambra', 'Cambra', 800), -(9674, 146, 993, 'Espinho', 'Espinho', 900), -(9675, 146, 993, 'Feira', 'Feira', 1000), -(9676, 146, 993, 'Gafanha da Nazar', 'Gafanha da Nazar', 1100), -(9677, 146, 993, 'Gio', 'Gio', 1200), -(9678, 146, 993, 'gua Levada', 'gua Levada', 1300), -(9679, 146, 993, 'gueda', 'gueda', 1400), -(9680, 146, 993, 'lhavo', 'lhavo', 1500), -(9681, 146, 993, 'Oliveira de Azemeis', 'Oliveira de Azemeis', 1600), -(9682, 146, 993, 'Ovar', 'Ovar', 1700), -(9683, 146, 993, 'Pampilhosa', 'Pampilhosa', 1800), -(9684, 146, 993, 'Santa Maria', 'Santa Maria', 1900), -(9685, 146, 993, 'Santo Joo da Madeira', 'Santo Joo da Madeira', 2000), -(9686, 146, 993, 'So Joo da Madeira', 'So Joo da Madeira', 2100), -(9687, 146, 993, 'So Joo de Madeira', 'So Joo de Madeira', 2200), -(9688, 146, 993, 'Vale de Cambra', 'Vale de Cambra', 2300), -(9689, 146, 994, 'Angra', 'Angra', 100), -(9690, 146, 994, 'Angra do Herosmo', 'Angra do Herosmo', 200), -(9691, 146, 994, 'Fayal', 'Fayal', 300), -(9692, 146, 994, 'Madalena', 'Madalena', 400), -(9693, 146, 994, 'Ponta Delgada', 'Ponta Delgada', 500), -(9694, 146, 994, 'Praia da Vitria', 'Praia da Vitria', 600), -(9695, 146, 995, 'A do Ledo', 'A do Ledo', 100), -(9696, 146, 995, 'Beja', 'Beja', 200), -(9697, 146, 995, 'Boavista dos Pinheiros', 'Boavista dos Pinheiros', 300), -(9698, 146, 995, 'San Teotnio', 'San Teotnio', 400), -(9699, 146, 996, 'Abao', 'Abao', 100), -(9700, 146, 996, 'Aboim', 'Aboim', 200), -(9701, 146, 996, 'Aborim', 'Aborim', 300), -(9702, 146, 996, 'Agilde', 'Agilde', 400), -(9703, 146, 996, 'Agrelo', 'Agrelo', 500), -(9704, 146, 996, 'Barcelos', 'Barcelos', 600), -(9705, 146, 996, 'Braga', 'Braga', 700), -(9706, 146, 996, 'Caldas de Vizela', 'Caldas de Vizela', 800), -(9707, 146, 996, 'Esposende', 'Esposende', 900), -(9708, 146, 996, 'Famalico', 'Famalico', 1000), -(9709, 146, 996, 'Guimares', 'Guimares', 1100), -(9710, 146, 996, 'Lobo', 'Lobo', 1200), -(9711, 146, 996, 'Vila Nova de Famalico', 'Vila Nova de Famalico', 1300), -(9712, 146, 996, 'Vila Verde', 'Vila Verde', 1400), -(9713, 146, 997, 'Belver', 'Belver', 100), -(9714, 146, 998, 'Alvaro', 'Alvaro', 100), -(9715, 146, 998, 'Casais', 'Casais', 200), -(9716, 146, 998, 'Castelo Branco', 'Castelo Branco', 300), -(9717, 146, 998, 'Covilh', 'Covilh', 400), -(9718, 146, 998, 'Fundo', 'Fundo', 500), -(9719, 146, 998, 'Fundo', 'Fundo', 600), -(9720, 146, 999, 'Arganil', 'Arganil', 100), -(9721, 146, 999, 'Avelar', 'Avelar', 200), -(9722, 146, 999, 'Brasfemes', 'Brasfemes', 300), -(9723, 146, 999, 'Coimbra', 'Coimbra', 400), -(9724, 146, 999, 'Figueira da Foz', 'Figueira da Foz', 500), -(9725, 146, 999, 'Ponte de Vilela', 'Ponte de Vilela', 600), -(9726, 146, 1000, 'Barro Branco', 'Barro Branco', 100), -(9727, 146, 1000, 'Casa Nova', 'Casa Nova', 200), -(9728, 146, 1000, 'Reguengos de Monsaraz', 'Reguengos de Monsaraz', 300), -(9729, 146, 1000, 'Vendas Novas', 'Vendas Novas', 400), -(9730, 146, 1000, 'vora', 'vora', 500), -(9731, 146, 1001, 'Abutreira', 'Abutreira', 100), -(9732, 146, 1001, 'Albufeira', 'Albufeira', 200), -(9733, 146, 1001, 'Alcantarilha', 'Alcantarilha', 300), -(9734, 146, 1001, 'Algoz', 'Algoz', 400), -(9735, 146, 1001, 'Aljezur', 'Aljezur', 500), -(9736, 146, 1001, 'Almancil', 'Almancil', 600), -(9737, 146, 1001, 'Altura', 'Altura', 700), -(9738, 146, 1001, 'Alvor', 'Alvor', 800), -(9739, 146, 1001, 'Armao de Pra', 'Armao de Pra', 900), -(9740, 146, 1001, 'Belm', 'Belm', 1000), -(9741, 146, 1001, 'Cabanas', 'Cabanas', 1100), -(9742, 146, 1001, 'Esti', 'Esti', 1200), -(9743, 146, 1001, 'Faro', 'Faro', 1300), -(9744, 146, 1001, 'Foia', 'Foia', 1400), -(9745, 146, 1001, 'Lagoa', 'Lagoa', 1500), -(9746, 146, 1001, 'Lagoa', 'Lagoa', 1600), -(9747, 146, 1001, 'Lagoas', 'Lagoas', 1700), -(9748, 146, 1001, 'Lagos', 'Lagos', 1800), -(9749, 146, 1001, 'Loul', 'Loul', 1900), -(9750, 146, 1001, 'Mexilhoeira Grande', 'Mexilhoeira Grande', 2000), -(9751, 146, 1001, 'Monte Negro', 'Monte Negro', 2100), -(9752, 146, 1001, 'Odeceixe', 'Odeceixe', 2200), -(9753, 146, 1001, 'Olho', 'Olho', 2300), -(9754, 146, 1001, 'Pero de Elvas', 'Pero de Elvas', 2400), -(9755, 146, 1001, 'Portimo', 'Portimo', 2500), -(9756, 146, 1001, 'Quarteira', 'Quarteira', 2600), -(9757, 146, 1001, 'Sagres', 'Sagres', 2700), -(9758, 146, 1001, 'Silves', 'Silves', 2800), -(9759, 146, 1001, 'Tavira', 'Tavira', 2900), -(9760, 146, 1001, 'Vila Real de San Antnio', 'Vila Real de San Antnio', 3000), -(9761, 146, 1001, 'Vila Real de Santo Antnio', 'Vila Real de Santo Antnio', 3100), -(9762, 146, 1002, 'Albardeiros', 'Albardeiros', 100), -(9763, 146, 1002, 'Alcarva', 'Alcarva', 200), -(9764, 146, 1002, 'Guarda', 'Guarda', 300), -(9765, 146, 1002, 'Seia', 'Seia', 400), -(9766, 146, 1002, 'Vila Nova de Fozcoa', 'Vila Nova de Fozcoa', 500), -(9767, 146, 1003, 'Alcobaa', 'Alcobaa', 100), -(9768, 146, 1003, 'Amor', 'Amor', 200), -(9769, 146, 1003, 'Batalha', 'Batalha', 300), -(9770, 146, 1003, 'Benedita', 'Benedita', 400), -(9771, 146, 1003, 'Caldad da Rainha', 'Caldad da Rainha', 500), -(9772, 146, 1003, 'Caldas da Rainha', 'Caldas da Rainha', 600), -(9773, 146, 1003, 'Famalico', 'Famalico', 700), -(9774, 146, 1003, 'Leira', 'Leira', 800), -(9775, 146, 1003, 'Leiria', 'Leiria', 900), -(9776, 146, 1003, 'Marinha Grande', 'Marinha Grande', 1000), -(9777, 146, 1003, 'Martingana', 'Martingana', 1100), -(9778, 146, 1003, 'Mira d''Aire', 'Mira d''Aire', 1200), -(9779, 146, 1003, 'Nazar', 'Nazar', 1300), -(9780, 146, 1003, 'Peniche', 'Peniche', 1400), -(9781, 146, 1003, 'Pinheiros', 'Pinheiros', 1500), -(9782, 146, 1003, 'Pombal', 'Pombal', 1600), -(9783, 146, 1003, 'Porto de Ms', 'Porto de Ms', 1700), -(9784, 146, 1003, 'So Martinho de Porto', 'So Martinho de Porto', 1800), -(9785, 146, 1003, 'So Martinho do Porto', 'So Martinho do Porto', 1900), -(9786, 146, 1003, 'Vermoil', 'Vermoil', 2000), -(9787, 146, 1003, 'Zambujal', 'Zambujal', 2100), -(9788, 146, 1004, 'Agualva', 'Agualva', 100), -(9789, 146, 1004, 'Alcntara', 'Alcntara', 200), -(9790, 146, 1004, 'Alenquer', 'Alenquer', 300), -(9791, 146, 1004, 'Alhandra', 'Alhandra', 400), -(9792, 146, 1004, 'Almada', 'Almada', 500), -(9793, 146, 1004, 'Alverca', 'Alverca', 600), -(9794, 146, 1004, 'Amadora', 'Amadora', 700), -(9795, 146, 1004, 'Arruda dos Vinhos', 'Arruda dos Vinhos', 800), -(9796, 146, 1004, 'Assenta', 'Assenta', 900), -(9797, 146, 1004, 'Barreira', 'Barreira', 1000), -(9798, 146, 1004, 'Benfica', 'Benfica', 1100), -(9799, 146, 1004, 'Bucelas', 'Bucelas', 1200), -(9800, 146, 1004, 'Cacm', 'Cacm', 1300), -(9801, 146, 1004, 'Cadaval', 'Cadaval', 1400), -(9802, 146, 1004, 'Campolide', 'Campolide', 1500), -(9803, 146, 1004, 'Carcavelos', 'Carcavelos', 1600), -(9804, 146, 1004, 'Carcavelos', 'Carcavelos', 1700), -(9805, 146, 1004, 'Carregado', 'Carregado', 1800), -(9806, 146, 1004, 'Casais', 'Casais', 1900), -(9807, 146, 1004, 'Casais', 'Casais', 2000), -(9808, 146, 1004, 'Cascais', 'Cascais', 2100), -(9809, 146, 1004, 'Covas', 'Covas', 2200), -(9810, 146, 1004, 'Estoril', 'Estoril', 2300), -(9811, 146, 1004, 'Funchal', 'Funchal', 2400), -(9812, 146, 1004, 'Lisboa', 'Lisboa', 2500), -(9813, 146, 1004, 'Lisbon', 'Lisbon', 2600), -(9814, 146, 1004, 'Lissabon', 'Lissabon', 2700), -(9815, 146, 1004, 'Lourel', 'Lourel', 2800), -(9816, 146, 1004, 'Loures', 'Loures', 2900), -(9817, 146, 1004, 'Lourinh', 'Lourinh', 3000), -(9818, 146, 1004, 'Mafra', 'Mafra', 3100), -(9819, 146, 1004, 'Manique de Baixo', 'Manique de Baixo', 3200), -(9820, 146, 1004, 'Mem Martim', 'Mem Martim', 3300), -(9821, 146, 1004, 'Mem Martins', 'Mem Martins', 3400), -(9822, 146, 1004, 'Monte Estoril', 'Monte Estoril', 3500), -(9823, 146, 1004, 'Moscavide', 'Moscavide', 3600), -(9824, 146, 1004, 'Odivelas', 'Odivelas', 3700), -(9825, 146, 1004, 'Oeiras', 'Oeiras', 3800), -(9826, 146, 1004, 'Pao de Arcos', 'Pao de Arcos', 3900), -(9827, 146, 1004, 'Parede', 'Parede', 4000), -(9828, 146, 1004, 'Pontinha', 'Pontinha', 4100), -(9829, 146, 1004, 'Portela', 'Portela', 4200), -(9830, 146, 1004, 'Porto', 'Porto', 4300), -(9831, 146, 1004, 'Pragana', 'Pragana', 4400), -(9832, 146, 1004, 'Pvoa da Galega', 'Pvoa da Galega', 4500), -(9833, 146, 1004, 'Pvoa Santa Iria', 'Pvoa Santa Iria', 4600), -(9834, 146, 1004, 'Queluz', 'Queluz', 4700), -(9835, 146, 1004, 'Santa Cruz', 'Santa Cruz', 4800), -(9836, 146, 1004, 'Santo Estvo', 'Santo Estvo', 4900), -(9837, 146, 1004, 'Seixal', 'Seixal', 5000), -(9838, 146, 1004, 'Sintra', 'Sintra', 5100), -(9839, 146, 1004, 'So Domingos de Rana', 'So Domingos de Rana', 5200), -(9840, 146, 1004, 'Tires', 'Tires', 5300), -(9841, 146, 1004, 'Torres Vedras', 'Torres Vedras', 5400), -(9842, 146, 1004, 'Vila Franca de Xira', 'Vila Franca de Xira', 5500), -(9843, 146, 1004, 'Vimeiro', 'Vimeiro', 5600), -(9844, 146, 1005, 'Cabo da Ribeira', 'Cabo da Ribeira', 100), -(9845, 146, 1005, 'Camacha', 'Camacha', 200), -(9846, 146, 1005, 'Canio', 'Canio', 300), -(9847, 146, 1005, 'Carreira', 'Carreira', 400), -(9848, 146, 1005, 'Estreito de Cmara de Lobos', 'Estreito de Cmara de Lobos', 500), -(9849, 146, 1005, 'Funchal', 'Funchal', 600), -(9850, 146, 1005, 'gua de Pena', 'gua de Pena', 700), -(9851, 146, 1005, 'Porto Santo', 'Porto Santo', 800), -(9852, 146, 1005, 'Santo da Serra', 'Santo da Serra', 900), -(9853, 146, 1005, 'Tbua', 'Tbua', 1000), -(9854, 146, 1006, 'Venda da Costa', 'Venda da Costa', 100), -(9855, 146, 1007, 'Entre Ribeiras', 'Entre Ribeiras', 100), -(9856, 146, 1007, 'Portalegre', 'Portalegre', 200), -(9857, 146, 1008, 'Aguadeira', 'Aguadeira', 100), -(9858, 146, 1008, 'Albergaria', 'Albergaria', 200), -(9859, 146, 1008, 'Alfena', 'Alfena', 300), -(9860, 146, 1008, 'Amarante', 'Amarante', 400), -(9861, 146, 1008, 'Aves', 'Aves', 500), -(9862, 146, 1008, 'Ermezinde', 'Ermezinde', 600), -(9863, 146, 1008, 'Foz', 'Foz', 700), -(9864, 146, 1008, 'Gaia', 'Gaia', 800), -(9865, 146, 1008, 'Gondomar', 'Gondomar', 900), -(9866, 146, 1008, 'Maia', 'Maia', 1000), -(9867, 146, 1008, 'Matosinhos', 'Matosinhos', 1100), -(9868, 146, 1008, 'Matosinhos', 'Matosinhos', 1200), -(9869, 146, 1008, 'Paos de Ferreira', 'Paos de Ferreira', 1300), -(9870, 146, 1008, 'Paredes', 'Paredes', 1400), -(9871, 146, 1008, 'Paredes', 'Paredes', 1500), -(9872, 146, 1008, 'Penafiel', 'Penafiel', 1600), -(9873, 146, 1008, 'Porto', 'Porto', 1700), -(9874, 146, 1008, 'Pvoa de Varzim', 'Pvoa de Varzim', 1800), -(9875, 146, 1008, 'Trofa Velha', 'Trofa Velha', 1900), -(9876, 146, 1008, 'Vale', 'Vale', 2000), -(9877, 146, 1008, 'Vila do Conde', 'Vila do Conde', 2100), -(9878, 146, 1008, 'Vila Nova de Gaia', 'Vila Nova de Gaia', 2200), -(9879, 146, 1008, 'Vizela', 'Vizela', 2300), -(9880, 146, 1009, 'Abrantes', 'Abrantes', 100), -(9881, 146, 1009, 'Alcanena', 'Alcanena', 200), -(9882, 146, 1009, 'Almeirim', 'Almeirim', 300), -(9883, 146, 1009, 'Almeirim', 'Almeirim', 400), -(9884, 146, 1009, 'Alviobeira', 'Alviobeira', 500), -(9885, 146, 1009, 'Amiis de Baixo', 'Amiis de Baixo', 600), -(9886, 146, 1009, 'Asseiceira', 'Asseiceira', 700), -(9887, 146, 1009, 'Entrocamento', 'Entrocamento', 800), -(9888, 146, 1009, 'Entroncamento', 'Entroncamento', 900), -(9889, 146, 1009, 'Ftima', 'Ftima', 1000), -(9890, 146, 1009, 'gua Boa', 'gua Boa', 1100), -(9891, 146, 1009, 'Minde', 'Minde', 1200), -(9892, 146, 1009, 'Ourm', 'Ourm', 1300), -(9893, 146, 1009, 'Praia do Ribatejo', 'Praia do Ribatejo', 1400), -(9894, 146, 1009, 'Pvoa de Santarm', 'Pvoa de Santarm', 1500), -(9895, 146, 1009, 'Rio Maior', 'Rio Maior', 1600), -(9896, 146, 1009, 'Salvaterra de Magos', 'Salvaterra de Magos', 1700), -(9897, 146, 1009, 'Samora Correia', 'Samora Correia', 1800), -(9898, 146, 1009, 'Santarm', 'Santarm', 1900), -(9899, 146, 1009, 'Soudos', 'Soudos', 2000), -(9900, 146, 1009, 'Tomar', 'Tomar', 2100), -(9901, 146, 1009, 'Torres Novas', 'Torres Novas', 2200), -(9902, 146, 1009, 'Vila Moreira', 'Vila Moreira', 2300), -(9903, 146, 1010, 'Alccer do Sal', 'Alccer do Sal', 100), -(9904, 146, 1010, 'Almada', 'Almada', 200), -(9905, 146, 1010, 'Amora', 'Amora', 300), -(9906, 146, 1010, 'Arrentela', 'Arrentela', 400), -(9907, 146, 1010, 'Barreiro', 'Barreiro', 500), -(9908, 146, 1010, 'Costa de Caparica', 'Costa de Caparica', 600), -(9909, 146, 1010, 'Fogueteiro', 'Fogueteiro', 700), -(9910, 146, 1010, 'guas de Moura', 'guas de Moura', 800), -(9911, 146, 1010, 'Marateca', 'Marateca', 900), -(9912, 146, 1010, 'Moita', 'Moita', 1000), -(9913, 146, 1010, 'Montijo', 'Montijo', 1100), -(9914, 146, 1010, 'Paio Pires', 'Paio Pires', 1200), -(9915, 146, 1010, 'Palmela', 'Palmela', 1300), -(9916, 146, 1010, 'Pinhal Novo', 'Pinhal Novo', 1400), -(9917, 146, 1010, 'Pragal', 'Pragal', 1500), -(9918, 146, 1010, 'Santo Andr', 'Santo Andr', 1600), -(9919, 146, 1010, 'Sesimbra', 'Sesimbra', 1700), -(9920, 146, 1010, 'Setabul', 'Setabul', 1800), -(9921, 146, 1010, 'Setbal', 'Setbal', 1900), -(9922, 146, 1010, 'Sines', 'Sines', 2000), -(9923, 146, 1010, 'Sisimbra', 'Sisimbra', 2100), -(9924, 146, 1010, 'Torre da Marinha', 'Torre da Marinha', 2200), -(9925, 146, 1011, 'Caminha', 'Caminha', 100), -(9926, 146, 1011, 'Mono', 'Mono', 200), -(9927, 146, 1011, 'Valena', 'Valena', 300), -(9928, 146, 1011, 'Viana do Castelo', 'Viana do Castelo', 400), -(9929, 146, 1011, 'Vianna do Castello', 'Vianna do Castello', 500), -(9930, 146, 1012, 'Alijo', 'Alijo', 100), -(9931, 146, 1012, 'Chaves', 'Chaves', 200), -(9932, 146, 1012, 'Montalegre', 'Montalegre', 300), -(9933, 146, 1012, 'Vila Real', 'Vila Real', 400), -(9934, 146, 1013, 'Mangualde', 'Mangualde', 100), -(9935, 146, 1013, 'Oliveira de Frades', 'Oliveira de Frades', 200), -(9936, 146, 1013, 'Santa Comba Do', 'Santa Comba Do', 300), -(9937, 146, 1013, 'Santiago', 'Santiago', 400), -(9938, 146, 1013, 'So Joo da Pesqueira', 'So Joo da Pesqueira', 500), -(9939, 146, 1013, 'So Pedro do Sul', 'So Pedro do Sul', 600), -(9940, 146, 1013, 'Vimieiro', 'Vimieiro', 700), -(9941, 146, 1013, 'Viseu', 'Viseu', 800), -(9942, 146, 1013, 'Vizeu', 'Vizeu', 900), -(9943, 147, 1014, 'Adjuntas', 'Adjuntas', 100), -(9944, 147, 1014, 'Aguada', 'Aguada', 200), -(9945, 147, 1014, 'Aguas Buenas', 'Aguas Buenas', 300), -(9946, 147, 1014, 'Angeles', 'Angeles', 400), -(9947, 147, 1014, 'Arecibo', 'Arecibo', 500), -(9948, 147, 1014, 'Bayamon', 'Bayamon', 600), -(9949, 147, 1014, 'Camuy', 'Camuy', 700), -(9950, 147, 1014, 'Dorado', 'Dorado', 800), -(9951, 147, 1014, 'Gurabo', 'Gurabo', 900), -(9952, 147, 1014, 'Mayaguez', 'Mayaguez', 1000), -(9953, 147, 1014, 'Puerto Real', 'Puerto Real', 1100), -(9954, 147, 1014, 'Quebradillas', 'Quebradillas', 1200), -(9955, 147, 1014, 'San Juan', 'San Juan', 1300), -(9956, 147, 1014, 'San Lorenzo', 'San Lorenzo', 1400), -(9957, 147, 1014, 'Santa Isabel', 'Santa Isabel', 1500), -(9958, 148, 1015, 'Сант-Денис', 'Сант-Денис', 100), -(9959, 149, 1016, 'Адыгейск', 'Adygeisk', 100), -(9960, 149, 1016, 'Майкоп (Адыгея)', 'Maikop (Adygeya)', 200), -(9961, 149, 1017, 'Акташ', 'Aktash', 100), -(9962, 149, 1017, 'Акутиха', 'Akutiha', 200), -(9963, 149, 1017, 'Алейск', 'Aleisk', 300), -(9964, 149, 1017, 'Алтайский', 'Altaiskii', 400), -(9965, 149, 1017, 'Баево', 'Baevo', 500), -(9966, 149, 1017, 'Барнаул', 'Barnaul', 600), -(9967, 149, 1017, 'Белово (Алтайский край)', 'Belovo (Altaiskii krai)', 700), -(9968, 149, 1017, 'Белокуриха', 'Belokuriha', 800), -(9969, 149, 1017, 'Белоярск', 'Beloyarsk', 900), -(9970, 149, 1017, 'Бийск', 'Biisk', 1000), -(9971, 149, 1017, 'Благовещенск', 'Blagoveshchensk', 1100), -(9972, 149, 1017, 'Боровлянка', 'Borovlyanka', 1200), -(9973, 149, 1017, 'Бурла', 'Burla', 1300), -(9974, 149, 1017, 'Бурсоль', 'Bursol', 1400), -(9975, 149, 1017, 'Быстрый Исток', 'Bystryi Istok', 1500), -(9976, 149, 1017, 'Волчиха', 'Volchiha', 1600), -(9977, 149, 1017, 'Горно-Алтайск', 'Gorno-Altaisk', 1700), -(9978, 149, 1017, 'Горняк', 'Gornyak', 1800), -(9979, 149, 1017, 'Ельцовка', 'Eltsovka', 1900), -(9980, 149, 1017, 'Залесово', 'Zalesovo', 2000), -(9981, 149, 1017, 'Заринск', 'Zarinsk', 2100), -(9982, 149, 1017, 'Заток', 'Zatok', 2200), -(9983, 149, 1017, 'Змеиногорск', 'Zmeinogorsk', 2300), -(9984, 149, 1017, 'Камень-на-Оби', 'Kamen-na-Obi', 2400), -(9985, 149, 1017, 'Ключи (Алтайский край)', 'Klyuchi (Altaiskii krai)', 2500), -(9986, 149, 1017, 'Кош-Агач', 'Kosh-Agach', 2600), -(9987, 149, 1017, 'Красногорское (Алтайский край)', 'Krasnogorskoe (Altaiskii krai)', 2700), -(9988, 149, 1017, 'Краснощеково', 'Krasnoshchekovo', 2800), -(9989, 149, 1017, 'Кулунда', 'Kulunda', 2900), -(9990, 149, 1017, 'Кытманово', 'Kytmanovo', 3000), -(9991, 149, 1017, 'Мамонтово', 'Mamontovo', 3100), -(9992, 149, 1017, 'Новичиха', 'Novichiha', 3200), -(9993, 149, 1017, 'Новоалтайск', 'Novoaltaisk', 3300), -(9994, 149, 1017, 'Онгудай', 'Ongudai', 3400), -(9995, 149, 1017, 'Павловск (Алтайский край)', 'Pavlovsk (Altaiskii krai)', 3500), -(9996, 149, 1017, 'Петропавловское', 'Petropavlovskoe', 3600), -(9997, 149, 1017, 'Поспелиха', 'Pospeliha', 3700), -(9998, 149, 1017, 'Ребриха', 'Rebriha', 3800), -(9999, 149, 1017, 'Родино', 'Rodino', 3900), -(10000, 149, 1017, 'Рубцовск', 'Rubtsovsk', 4000), -(10001, 149, 1017, 'Славгород', 'Slavgorod', 4100), -(10002, 149, 1017, 'Смоленское', 'Smolenskoe', 4200), -(10003, 149, 1017, 'Солонешное', 'Soloneshnoe', 4300), -(10004, 149, 1017, 'Солтон', 'Solton', 4400), -(10005, 149, 1017, 'Староаллейское', 'Staroalleiskoe', 4500), -(10006, 149, 1017, 'Табуны', 'Tabuny', 4600), -(10007, 149, 1017, 'Тальменка', 'Talmenka', 4700), -(10008, 149, 1017, 'Тогул', 'Тогул', 4800), -(10009, 149, 1017, 'Топчиха', 'Topchiha', 4900), -(10010, 149, 1017, 'Троицкое (Алтайский край)', 'Troitskoe (Altaiskii krai)', 5000), -(10011, 149, 1017, 'Турочак', 'Turochak', 5100), -(10012, 149, 1017, 'Тюменцево', 'Tyumentsevo', 5200), -(10013, 149, 1017, 'Угловское', 'Uglovskoe', 5300), -(10014, 149, 1017, 'Усть-Калманка', 'Ust-Kalmanka', 5400), -(10015, 149, 1017, 'Усть-Кан', 'Ust-Kan', 5500), -(10016, 149, 1017, 'Усть-Кокса', 'Ust-Koksa', 5600), -(10017, 149, 1017, 'Усть-Улаган', 'Ust-Ulagan', 5700), -(10018, 149, 1017, 'Усть-Чарышская Пристань', 'Ust-Charyshskaya Pristan', 5800), -(10019, 149, 1017, 'Хабары', 'Habary', 5900), -(10020, 149, 1017, 'Целинное', 'Tselinnoe', 6000), -(10021, 149, 1017, 'Чарышское', 'Charyshskoe', 6100), -(10022, 149, 1017, 'Шебалино', 'Shebalino', 6200), -(10023, 149, 1017, 'Шелаболиха', 'Shelaboliha', 6300), -(10024, 149, 1017, 'Шипуново', 'Shipunovo', 6400), -(10025, 149, 1018, 'Айгунь', 'Aigun', 100), -(10026, 149, 1018, 'Архара', 'Arhara', 200), -(10027, 149, 1018, 'Белогорск', 'Belogorsk', 300), -(10028, 149, 1018, 'Благовещенск (Амурская обл.)', 'Blagoveshchensk (Amurskaya obl.)', 400), -(10029, 149, 1018, 'Бурея', 'Bureya', 500), -(10030, 149, 1018, 'Возжаевка', 'Vozzhaevka', 600), -(10031, 149, 1018, 'Екатеринославка', 'Ekaterinoslavka', 700), -(10032, 149, 1018, 'Ерофей Павлович', 'Erofei Pavlovich', 800), -(10033, 149, 1018, 'Завитинск', 'Zavitinsk', 900), -(10034, 149, 1018, 'Зея', 'Zeya', 1000), -(10035, 149, 1018, 'Златоустовск', 'Zlatoustovsk', 1100), -(10036, 149, 1018, 'Ивановка', 'Ivanovka', 1200), -(10037, 149, 1018, 'Коболдо', 'Koboldo', 1300), -(10038, 149, 1018, 'Магдагачи', 'Magdagachi', 1400), -(10039, 149, 1018, 'Новобурейский', 'Novobureiskii', 1500), -(10040, 149, 1018, 'Поярково', 'Poyarkovo', 1600), -(10041, 149, 1018, 'Райчихинск', 'Raichihinsk', 1700), -(10042, 149, 1018, 'Ромны', 'Romny', 1800), -(10043, 149, 1018, 'Свободный', 'Svobodnyi', 1900), -(10044, 149, 1018, 'Серышево', 'Seryshevo', 2000), -(10045, 149, 1018, 'Сковородино', 'Skovorodino', 2100), -(10046, 149, 1018, 'Стойба', 'Stoiba', 2200), -(10047, 149, 1018, 'Тамбовка', 'Tambovka', 2300), -(10048, 149, 1018, 'Тында', 'Tynda', 2400), -(10049, 149, 1018, 'Февральск', 'Февральск', 2500), -(10050, 149, 1018, 'Шимановск', 'Shimanovsk', 2600), -(10051, 149, 1018, 'Экимчан', 'Ekimchan', 2700), -(10052, 149, 1018, 'Ядрино', 'Yadrino', 2800), -(10053, 149, 1019, 'Амдерма', 'Amderma', 100), -(10054, 149, 1019, 'Архангельск', 'Arhangelsk', 200), -(10055, 149, 1019, 'Березник', 'Bereznik', 300), -(10056, 149, 1019, 'Вельск', 'Velsk', 400), -(10057, 149, 1019, 'Верхняя Тойма', 'Verhnyaya Toima', 500), -(10058, 149, 1019, 'Волошка', 'Voloshka', 600), -(10059, 149, 1019, 'Вычегодский', 'Vychegodskii', 700), -(10060, 149, 1019, 'Емца', 'Emtsa', 800), -(10061, 149, 1019, 'Илеза', 'Ileza', 900), -(10062, 149, 1019, 'Ильинско-Подомское', 'Ilinsko-Podomskoe', 1000), -(10063, 149, 1019, 'Каргополь (Архангельская обл.)', 'Kargopol (Arhangelskaya obl.)', 1100), -(10064, 149, 1019, 'Карпогоры', 'Karpogory', 1200), -(10065, 149, 1019, 'Кодино', 'Kodino', 1300), -(10066, 149, 1019, 'Коноша', 'Konosha', 1400), -(10067, 149, 1019, 'Коряжма', 'Koryazhma', 1500), -(10068, 149, 1019, 'Котлас', 'Kotlas', 1600), -(10069, 149, 1019, 'Красноборск', 'Krasnoborsk', 1700), -(10070, 149, 1019, 'Лешуконское', 'Leshukonskoe', 1800), -(10071, 149, 1019, 'Мезень', 'Mezen', 1900), -(10072, 149, 1019, 'Мирный (Архангельская обл.)', 'Mirnyi (Arhangelskaya obl.)', 2000), -(10073, 149, 1019, 'Нарьян-Мар', 'Naryan-Mar', 2100), -(10074, 149, 1019, 'Новодвинск', 'Novodvinsk', 2200), -(10075, 149, 1019, 'Няндома', 'Nyandoma', 2300), -(10076, 149, 1019, 'Онега', 'Onega', 2400), -(10077, 149, 1019, 'Пинега', 'Pinega', 2500), -(10078, 149, 1019, 'Плесецк', 'Plesetsk', 2600), -(10079, 149, 1019, 'Савинск', 'Савинск', 2700), -(10080, 149, 1019, 'Северодвинск', 'Severodvinsk', 2800), -(10081, 149, 1019, 'Сольвычегодск', 'Solvychegodsk', 2900), -(10082, 149, 1019, 'Холмогоры', 'Holmogory', 3000), -(10083, 149, 1019, 'Шенкурск', 'Shenkursk', 3100), -(10084, 149, 1019, 'Яренск', 'Yarensk', 3200), -(10085, 149, 1020, 'Астрахань', 'Astrahan', 100), -(10086, 149, 1020, 'Ахтубинск', 'Ahtubinsk', 200), -(10087, 149, 1020, 'Верхний Баскунчак', 'Verhnii Baskunchak', 300), -(10088, 149, 1020, 'Володарский', 'Volodarskii', 400), -(10089, 149, 1020, 'Енотаевка', 'Enotaevka', 500), -(10090, 149, 1020, 'Икряное', 'Ikryanoe', 600), -(10091, 149, 1020, 'Камызяк', 'Kamyzyak', 700), -(10092, 149, 1020, 'Капустин Яр', 'Kapustin Yar', 800), -(10093, 149, 1020, 'Красный Яр (Астраханская обл.)', 'Krasnyi Yar (Astrahanskaya obl.)', 900), -(10094, 149, 1020, 'Лиман', 'Liman', 1000), -(10095, 149, 1020, 'Началово', 'Nachalovo', 1100), -(10096, 149, 1020, 'Харабали', 'Harabali', 1200), -(10097, 149, 1020, 'Черный Яр', 'Chernyi Yar', 1300), -(10098, 149, 1021, 'Агидель', 'Агидель', 100), -(10099, 149, 1021, 'Аксаково', 'Aksakovo', 200), -(10100, 149, 1021, 'Амзя', 'Amzya', 300), -(10101, 149, 1021, 'Архангелькое', 'Архангелькое', 400), -(10102, 149, 1021, 'Аскарово', 'Аскарово', 500), -(10103, 149, 1021, 'Аскино', 'Askino', 600), -(10104, 149, 1021, 'Баймак', 'Baimak', 700), -(10105, 149, 1021, 'Бакалы', 'Bakaly', 800), -(10106, 149, 1021, 'Белебей', 'Belebei', 900), -(10107, 149, 1021, 'Белорецк', 'Beloretsk', 1000), -(10108, 149, 1021, 'Бижбуляк', 'Bizhbulyak', 1100), -(10109, 149, 1021, 'Бирск', 'Birsk', 1200), -(10110, 149, 1021, 'Благовещенск (Башкирия)', 'Blagoveshchensk (Bashkiriya)', 1300), -(10111, 149, 1021, 'Большеустьикинское', 'Bolsheustikinskoe', 1400), -(10112, 149, 1021, 'Бураево', 'Buraevo', 1500), -(10113, 149, 1021, 'Верхнеяркеево', 'Verhneyarkeevo', 1600), -(10114, 149, 1021, 'Верхние Киги', 'Verhnie Kigi', 1700), -(10115, 149, 1021, 'Верхние Татышлы', 'Verhnie Tatyshly', 1800), -(10116, 149, 1021, 'Верхний Авзян', 'Verhnii Avzyan', 1900), -(10117, 149, 1021, 'Давлеканово', 'Davlekanovo', 2000), -(10118, 149, 1021, 'Дуван', 'Duvan', 2100), -(10119, 149, 1021, 'Дюртюли', 'Dyurtyuli', 2200), -(10120, 149, 1021, 'Ермекеево', 'Ermekeevo', 2300), -(10121, 149, 1021, 'Ермолаево', 'Ermolaevo', 2400), -(10122, 149, 1021, 'Зилаир', 'Zilair', 2500), -(10123, 149, 1021, 'Зирган', 'Zirgan', 2600), -(10124, 149, 1021, 'Иглино', 'Iglino', 2700), -(10125, 149, 1021, 'Инзер', 'Inzer', 2800), -(10126, 149, 1021, 'Исянгулово', 'Isyangulovo', 2900), -(10127, 149, 1021, 'Ишимбай', 'Ishimbai', 3000), -(10128, 149, 1021, 'Калтасы', 'Калтасы', 3100), -(10129, 149, 1021, 'Кананикольское', 'Kananikolskoe', 3200), -(10130, 149, 1021, 'Кандры', 'Kandry', 3300), -(10131, 149, 1021, 'Караидель', 'Karaidel', 3400), -(10132, 149, 1021, 'Караидельский', 'Karaidelskii', 3500), -(10133, 149, 1021, 'Киргиз-Мияки', 'Kirgiz-Miyaki', 3600), -(10134, 149, 1021, 'Красноусольский', 'Krasnousolskii', 3700), -(10135, 149, 1021, 'Кумертау', 'Kumertau', 3800), -(10136, 149, 1021, 'Кушнаренково', 'Kushnarenkovo', 3900), -(10137, 149, 1021, 'Малояз', 'Maloyaz', 4000), -(10138, 149, 1021, 'Межгорье', 'Mezhgore', 4100), -(10139, 149, 1021, 'Мелеуз', 'Meleuz', 4200), -(10140, 149, 1021, 'Месягутово', 'Mesyagutovo', 4300), -(10141, 149, 1021, 'Мраково', 'Mrakovo', 4400), -(10142, 149, 1021, 'Нефтекамск', 'Neftekamsk', 4500), -(10143, 149, 1021, 'Октябрьский (Башкирия)', 'Oktyabrskii (Bashkiriya)', 4600), -(10144, 149, 1021, 'Приютово', 'Приютово', 4700), -(10145, 149, 1021, 'Раевский', 'Raevskii', 4800), -(10146, 149, 1021, 'Салават', 'Salavat', 4900), -(10147, 149, 1021, 'Сибай', 'Sibai', 5000), -(10148, 149, 1021, 'Старобалтачево', 'Starobaltachevo', 5100), -(10149, 149, 1021, 'Старосубхангулово', 'Starosubhangulovo', 5200), -(10150, 149, 1021, 'Стерлибашево', 'Sterlibashevo', 5300), -(10151, 149, 1021, 'Стерлитамак', 'Sterlitamak', 5400), -(10152, 149, 1021, 'Туймазы', 'Tuimazy', 5500), -(10153, 149, 1021, 'Уфа', 'Ufa', 5600), -(10154, 149, 1021, 'Учалы', 'Uchaly', 5700), -(10155, 149, 1021, 'Федоровка (Башкирия)', 'Fedorovka (Bashkiriya)', 5800), -(10156, 149, 1021, 'Чекмагуш', 'Chekmagush', 5900), -(10157, 149, 1021, 'Чишмы', 'Chishmy', 6000), -(10158, 149, 1021, 'Шаран', 'Sharan', 6100), -(10159, 149, 1021, 'Янаул', 'Yanaul', 6200), -(10160, 149, 1022, 'Алексеевка (Белгородская обл.)', 'Alekseevka (Belgorodskaya obl.)', 100), -(10161, 149, 1022, 'Белгород', 'Belgorod', 200), -(10162, 149, 1022, 'Борисовка', 'Borisovka', 300), -(10163, 149, 1022, 'Валуйки', 'Valuiki', 400), -(10164, 149, 1022, 'Вейделевка', 'Veidelevka', 500), -(10165, 149, 1022, 'Волоконовка', 'Volokonovka', 600), -(10166, 149, 1022, 'Грайворон', 'Graivoron', 700), -(10167, 149, 1022, 'Губкин', 'Gubkin', 800), -(10168, 149, 1022, 'Ивня', 'Ivnya', 900), -(10169, 149, 1022, 'Короча', 'Korocha', 1000), -(10170, 149, 1022, 'Красногвардейское (Белгород.)', 'Krasnogvardeiskoe (Belgorod.)', 1100), -(10171, 149, 1022, 'Новый Оскол', 'Novyi Oskol', 1200), -(10172, 149, 1022, 'Ракитное', 'Rakitnoe', 1300), -(10173, 149, 1022, 'Ровеньки', 'Rovenki', 1400), -(10174, 149, 1022, 'Старый Оскол', 'Staryi Oskol', 1500), -(10175, 149, 1022, 'Строитель', 'Stroitel', 1600), -(10176, 149, 1022, 'Чернянка', 'Chernyanka', 1700), -(10177, 149, 1022, 'Шебекино', 'Shebekino', 1800), -(10178, 149, 1023, 'Алтухово', 'Altuhovo', 100), -(10179, 149, 1023, 'Белая Березка', 'Belaya Berezka', 200), -(10180, 149, 1023, 'Белые Берега', 'Belye Berega', 300), -(10181, 149, 1023, 'Большое Полпино', 'Bolshoe Polpino', 400), -(10182, 149, 1023, 'Брянск', 'Bryansk', 500), -(10183, 149, 1023, 'Бытошь', 'Bytosh', 600), -(10184, 149, 1023, 'Выгоничи', 'Vygonichi', 700), -(10185, 149, 1023, 'Вышков', 'Vyshkov', 800), -(10186, 149, 1023, 'Гордеевка', 'Gordeevka', 900), -(10187, 149, 1023, 'Дубровка (Брянская обл.)', 'Dubrovka (Bryanskaya obl.)', 1000), -(10188, 149, 1023, 'Дятьково', 'Dyatkovo', 1100), -(10189, 149, 1023, 'Дятьково', 'Dyatkovo', 1200), -(10190, 149, 1023, 'Жирятино', 'Zhiryatino', 1300), -(10191, 149, 1023, 'Жуковка', 'Zhukovka', 1400), -(10192, 149, 1023, 'Злынка', 'Zlynka', 1500), -(10193, 149, 1023, 'Ивот', 'Ivot', 1600), -(10194, 149, 1023, 'Карачев', 'Karachev', 1700), -(10195, 149, 1023, 'Клетня', 'Kletnya', 1800), -(10196, 149, 1023, 'Климово', 'Klimovo', 1900), -(10197, 149, 1023, 'Клинцы', 'Klintsy', 2000), -(10198, 149, 1023, 'Кокаревка', 'Kokarevka', 2100), -(10199, 149, 1023, 'Комаричи', 'Komarichi', 2200), -(10200, 149, 1023, 'Красная Гора', 'Krasnaya Gora', 2300), -(10201, 149, 1023, 'Локоть (Брянская обл.)', 'Lokot (Bryanskaya obl.)', 2400), -(10202, 149, 1023, 'Мглин', 'Mglin', 2500), -(10203, 149, 1023, 'Навля', 'Navlya', 2600), -(10204, 149, 1023, 'Новозыбков', 'Novozybkov', 2700), -(10205, 149, 1023, 'Погар', 'Pogar', 2800), -(10206, 149, 1023, 'Почеп', 'Pochep', 2900), -(10207, 149, 1023, 'Ржаница', 'Rzhanitsa', 3000), -(10208, 149, 1023, 'Рогнедино', 'Rognedino', 3100), -(10209, 149, 1023, 'Севск', 'Sevsk', 3200), -(10210, 149, 1023, 'Стародуб', 'Starodub', 3300), -(10211, 149, 1023, 'Суземка', 'Suzemka', 3400), -(10212, 149, 1023, 'Сураж', 'Surazh', 3500), -(10213, 149, 1023, 'Трубчевск', 'Trubchevsk', 3600), -(10214, 149, 1023, 'Унеча', 'Unecha', 3700), -(10215, 149, 1024, 'Бабушкин', 'Babushkin', 100), -(10216, 149, 1024, 'Багдарин', 'Bagdarin', 200), -(10217, 149, 1024, 'Баргузин', 'Barguzin', 300), -(10218, 149, 1024, 'Баянгол', 'Bayangol', 400), -(10219, 149, 1024, 'Бичура', 'Bichura', 500), -(10220, 149, 1024, 'Выдрино', 'Vydrino', 600), -(10221, 149, 1024, 'Гусиное Озеро', 'Gusinoe Ozero', 700), -(10222, 149, 1024, 'Гусиноозерск', 'Gusinoozersk', 800), -(10223, 149, 1024, 'Заиграево', 'Zaigraevo', 900), -(10224, 149, 1024, 'Закаменск', 'Zakamensk', 1000), -(10225, 149, 1024, 'Иволгинск', 'Ivolginsk', 1100), -(10226, 149, 1024, 'Илька', 'Ilka', 1200), -(10227, 149, 1024, 'Кабанск', 'Kabansk', 1300), -(10228, 149, 1024, 'Каменск', 'Kamensk', 1400), -(10229, 149, 1024, 'Кижинга', 'Kizhinga', 1500), -(10230, 149, 1024, 'Курумкан', 'Kurumkan', 1600), -(10231, 149, 1024, 'Кырен', 'Kyren', 1700), -(10232, 149, 1024, 'Кяхта', 'Kyahta', 1800), -(10233, 149, 1024, 'Монды', 'Mondy', 1900), -(10234, 149, 1024, 'Мухоршибирь', 'Muhorshibir', 2000), -(10235, 149, 1024, 'Нижнеангарск', 'Nizhneangarsk', 2100), -(10236, 149, 1024, 'Орлик', 'Orlik', 2200), -(10237, 149, 1024, 'Петропавловка (Бурятия)', 'Petropavlovka (Buryatiya)', 2300), -(10238, 149, 1024, 'Романовка (Бурятия)', 'Romanovka (Buryatiya)', 2400), -(10239, 149, 1024, 'Северобайкальск (Бурятия)', 'Severobaikalsk (Buryatiya)', 2500), -(10240, 149, 1024, 'Селенгинск', 'Selenginsk', 2600), -(10241, 149, 1024, 'Сосново-Озерское', 'Sosnovo-Ozerskoe', 2700), -(10242, 149, 1024, 'Таксимо (Бурятия)', 'Taksimo (Buryatiya)', 2800), -(10243, 149, 1024, 'Турунтаево', 'Turuntaevo', 2900), -(10244, 149, 1024, 'Улан-Удэ', 'Ulan-Ude', 3000), -(10245, 149, 1024, 'Хоринск', 'Horinsk', 3100), -(10246, 149, 1025, 'Александров', 'Aleksandrov', 100), -(10247, 149, 1025, 'Андреево', 'Andreevo', 200), -(10248, 149, 1025, 'Анопино', 'Anopino', 300), -(10249, 149, 1025, 'Бавлены', 'Bavleny', 400), -(10250, 149, 1025, 'Балакирево', 'Balakirevo', 500), -(10251, 149, 1025, 'Боголюбово', 'Bogolyubovo', 600), -(10252, 149, 1025, 'Великодворский', 'Velikodvorskii', 700), -(10253, 149, 1025, 'Вербовский', 'Verbovskii', 800), -(10254, 149, 1025, 'Владимир', 'Vladimir', 900), -(10255, 149, 1025, 'Вязники', 'Vyazniki', 1000), -(10256, 149, 1025, 'Городищи (Владимирская обл.)', 'Gorodishchi (Vladimirskaya obl.)', 1100), -(10257, 149, 1025, 'Гороховец', 'Gorohovets', 1200), -(10258, 149, 1025, 'Гусевский', 'Gusevskii', 1300), -(10259, 149, 1025, 'Гусь Хрустальный', 'Gus Hrustalnyi', 1400), -(10260, 149, 1025, 'Гусь-Хрустальный', 'Gus-Hrustalnyi', 1500), -(10261, 149, 1025, 'Золотково', 'Zolotkovo', 1600), -(10262, 149, 1025, 'Иванищи', 'Ivanishchi', 1700), -(10263, 149, 1025, 'Камешково', 'Kameshkovo', 1800), -(10264, 149, 1025, 'Карабаново', 'Karabanovo', 1900), -(10265, 149, 1025, 'Киржач', 'Kirzhach', 2000), -(10266, 149, 1025, 'Ковров', 'Kovrov', 2100), -(10267, 149, 1025, 'Кольчугино', 'Kolchugino', 2200), -(10268, 149, 1025, 'Красная Горбатка', 'Krasnaya Gorbatka', 2300), -(10269, 149, 1025, 'Лакинск', 'Lakinsk', 2400), -(10270, 149, 1025, 'Меленки', 'Melenki', 2500), -(10271, 149, 1025, 'Муром', 'Murom', 2600), -(10272, 149, 1025, 'Петушки', 'Petushki', 2700), -(10273, 149, 1025, 'Покров', 'Pokrov', 2800), -(10274, 149, 1025, 'Радужный (Владимирская обл.)', 'Raduzhnyi (Vladimirskaya obl.)', 2900), -(10275, 149, 1025, 'Собинка', 'Sobinka', 3000), -(10276, 149, 1025, 'Судогда', 'Sudogda', 3100), -(10277, 149, 1025, 'Суздаль', 'Suzdal', 3200), -(10278, 149, 1025, 'Юрьев-Польский', 'Yurev-Polskii', 3300), -(10279, 149, 1026, 'Алексеевская', 'Alekseevskaya', 100), -(10280, 149, 1026, 'Алущевск', 'Alushchevsk', 200), -(10281, 149, 1026, 'Быково (Волгоградская обл.)', 'Bykovo (Volgogradskaya obl.)', 300), -(10282, 149, 1026, 'Волгоград', 'Volgograd', 400), -(10283, 149, 1026, 'Волжский (Волгоградская обл.)', 'Volzhskii (Volgogradskaya obl.)', 500), -(10284, 149, 1026, 'Городище (Волгоградская обл.)', 'Gorodishche (Volgogradskaya obl.)', 600), -(10285, 149, 1026, 'Дубовка (Волгоградская обл.)', 'Dubovka (Volgogradskaya obl.)', 700), -(10286, 149, 1026, 'Елань', 'Elan', 800), -(10287, 149, 1026, 'Жирновск', 'Zhirnovsk', 900), -(10288, 149, 1026, 'Иловля', 'Ilovlya', 1000), -(10289, 149, 1026, 'Калач-на-Дону', 'Kalach-na-Donu', 1100), -(10290, 149, 1026, 'Камышин', 'Kamyshin', 1200), -(10291, 149, 1026, 'Кириллов', 'Kirillov', 1300), -(10292, 149, 1026, 'Клетский', 'Kletskii', 1400), -(10293, 149, 1026, 'Котельниково', 'Kotelnikovo', 1500), -(10294, 149, 1026, 'Котово', 'Kotovo', 1600), -(10295, 149, 1026, 'Кумылженская', 'Kumylzhenskaya', 1700), -(10296, 149, 1026, 'Ленинск', 'Leninsk', 1800), -(10297, 149, 1026, 'Михайловка', 'Mihailovka', 1900), -(10298, 149, 1026, 'Нехаевский', 'Nehaevskii', 2000), -(10299, 149, 1026, 'Николаевск', 'Nikolaevsk', 2100), -(10300, 149, 1026, 'Новоаннинский', 'Novoanninskii', 2200), -(10301, 149, 1026, 'Новониколаевский', 'Novonikolaevskii', 2300), -(10302, 149, 1026, 'Ольховка', 'Olhovka', 2400), -(10303, 149, 1026, 'Палласовка (Волгоградская обл.)', 'Pallasovka (Volgogradskaya obl.)', 2500), -(10304, 149, 1026, 'Рудня (Волгоградская обл.)', 'Rudnya (Volgogradskaya obl.)', 2600), -(10305, 149, 1026, 'Светлый Яр', 'Svetlyi Yar', 2700), -(10306, 149, 1026, 'Серафимович', 'Serafimovich', 2800), -(10307, 149, 1026, 'Средняя Ахтуба', 'Srednyaya Ahtuba', 2900), -(10308, 149, 1026, 'Сталинград', 'Stalingrad', 3000), -(10309, 149, 1026, 'Старая Полтавка', 'Staraya Poltavka', 3100), -(10310, 149, 1026, 'Суровикино', 'Surovikino', 3200), -(10311, 149, 1026, 'Урюпинск', 'Uryupinsk', 3300), -(10312, 149, 1026, 'Фролово', 'Frolovo', 3400), -(10313, 149, 1026, 'Чернышковский', 'Chernyshkovskii', 3500), -(10314, 149, 1027, 'Бабаево', 'Babaevo', 100), -(10315, 149, 1027, 'Белозерск', 'Belozersk', 200), -(10316, 149, 1027, 'Великий Устюг', 'Velikii Ustyug', 300), -(10317, 149, 1027, 'Верховажье', 'Verhovazhe', 400), -(10318, 149, 1027, 'Вожега', 'Vozhega', 500), -(10319, 149, 1027, 'Вологда', 'Vologda', 600), -(10320, 149, 1027, 'Вохтога', 'Vohtoga', 700), -(10321, 149, 1027, 'Вытегра', 'Vytegra', 800), -(10322, 149, 1027, 'Грязовец', 'Gryazovets', 900), -(10323, 149, 1027, 'Кадников', 'Kadnikov', 1000), -(10324, 149, 1027, 'Кадуй', 'Kadui', 1100), -(10325, 149, 1027, 'Кириллов', 'Кириллов', 1200), -(10326, 149, 1027, 'Кичменгский Городок', 'Kichmengskii Gorodok', 1300), -(10327, 149, 1027, 'Липин Бор', 'Lipin Bor', 1400), -(10328, 149, 1027, 'Никольск', 'Nikolsk', 1500), -(10329, 149, 1027, 'Нюксеница', 'Nyuksenitsa', 1600), -(10330, 149, 1027, 'Сокол', 'Sokol', 1700), -(10331, 149, 1027, 'Сямжа', 'Syamzha', 1800), -(10332, 149, 1027, 'Тарногский Городок', 'Tarnogskii Gorodok', 1900), -(10333, 149, 1027, 'Тотьма', 'Totma', 2000), -(10334, 149, 1027, 'Устюжна', 'Ustyuzhna', 2100), -(10335, 149, 1027, 'Харовск', 'Harovsk', 2200), -(10336, 149, 1027, 'Чагода', 'Chagoda', 2300), -(10337, 149, 1027, 'Череповец', 'Cherepovets', 2400), -(10338, 149, 1027, 'Шексна', 'Sheksna', 2500), -(10339, 149, 1027, 'Шуйское', 'Shuiskoe', 2600), -(10340, 149, 1028, 'Анна', 'Anna', 100), -(10341, 149, 1028, 'Бобров', 'Bobrov', 200), -(10342, 149, 1028, 'Богучар', 'Boguchar', 300), -(10343, 149, 1028, 'Борисоглебск', 'Borisoglebsk', 400), -(10344, 149, 1028, 'Бутурлиновка', 'Buturlinovka', 500), -(10345, 149, 1028, 'Верхний Мамон', 'Verhnii Mamon', 600), -(10346, 149, 1028, 'Верхняя Хава', 'Verhnyaya Hava', 700), -(10347, 149, 1028, 'Воробьевка', 'Vorobevka', 800), -(10348, 149, 1028, 'Воронеж', 'Voronezh', 900), -(10349, 149, 1028, 'Грибановский', 'Gribanovskii', 1000), -(10350, 149, 1028, 'Давыдовка', 'Davydovka', 1100), -(10351, 149, 1028, 'Елань-Коленовский', 'Elan-Kolenovskii', 1200), -(10352, 149, 1028, 'Калач', 'Kalach', 1300), -(10353, 149, 1028, 'Кантемировка', 'Kantemirovka', 1400), -(10354, 149, 1028, 'Лиски (Воронежская обл.)', 'Liski (Voronezhskaya obl.)', 1500), -(10355, 149, 1028, 'Нижнедевицк', 'Nizhnedevitsk', 1600), -(10356, 149, 1028, 'Новая Усмань', 'Novaya Usman', 1700), -(10357, 149, 1028, 'Нововоронеж', 'Novovoronezh', 1800), -(10358, 149, 1028, 'Новохоперск', 'Novohopersk', 1900), -(10359, 149, 1028, 'Ольховатка', 'Olhovatka', 2000), -(10360, 149, 1028, 'Острогожск', 'Ostrogozhsk', 2100), -(10361, 149, 1028, 'Павловск (Воронежская обл.)', 'Pavlovsk (Voronezhskaya obl.)', 2200), -(10362, 149, 1028, 'Панино', 'Panino', 2300), -(10363, 149, 1028, 'Петропавловка', 'Petropavlovka', 2400), -(10364, 149, 1028, 'Поворино', 'Povorino', 2500), -(10365, 149, 1028, 'Подгоренский', 'Podgorenskii', 2600), -(10366, 149, 1028, 'Рамонь', 'Ramon', 2700), -(10367, 149, 1028, 'Репьевка', 'Repevka', 2800), -(10368, 149, 1028, 'Россошь', 'Rossosh', 2900), -(10369, 149, 1028, 'Семилуки', 'Semiluki', 3000), -(10370, 149, 1028, 'Таловая', 'Talovaya', 3100), -(10371, 149, 1028, 'Терновка', 'Ternovka', 3200), -(10372, 149, 1028, 'Хохольский', 'Hoholskii', 3300), -(10373, 149, 1028, 'Эртиль', 'Ertil', 3400), -(10374, 149, 1029, 'Агвали', 'Agvali', 100), -(10375, 149, 1029, 'Акуша', 'Akusha', 200), -(10376, 149, 1029, 'Ахты', 'Ahty', 300), -(10377, 149, 1029, 'Ачису', 'Achisu', 400), -(10378, 149, 1029, 'Бабаюрт', 'Babayurt', 500), -(10379, 149, 1029, 'Бежта', 'Bezhta', 600), -(10380, 149, 1029, 'Ботлих', 'Botlih', 700), -(10381, 149, 1029, 'Буйнакск', 'Buinaksk', 800), -(10382, 149, 1029, 'Вачи', 'Vachi', 900), -(10383, 149, 1029, 'Гергебиль', 'Gergebil', 1000), -(10384, 149, 1029, 'Гуниб', 'Gunib', 1100), -(10385, 149, 1029, 'Дагестанские Огни', 'Dagestanskie Ogni', 1200), -(10386, 149, 1029, 'Дербент', 'Derbent', 1300), -(10387, 149, 1029, 'Дылым', 'Dylym', 1400); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(10388, 149, 1029, 'Ершовка', 'Ershovka', 1500), -(10389, 149, 1029, 'Избербаш', 'Izberbash', 1600), -(10390, 149, 1029, 'Карабудахкент', 'Karabudahkent', 1700), -(10391, 149, 1029, 'Карата', 'Karata', 1800), -(10392, 149, 1029, 'Каспийск', 'Kaspiisk', 1900), -(10393, 149, 1029, 'Касумкент', 'Kasumkent', 2000), -(10394, 149, 1029, 'Кизилюрт', 'Kizilyurt', 2100), -(10395, 149, 1029, 'Кизляр', 'Kizlyar', 2200), -(10396, 149, 1029, 'Кочубей', 'Kochubei', 2300), -(10397, 149, 1029, 'Кумух', 'Kumuh', 2400), -(10398, 149, 1029, 'Курах', 'Kurah', 2500), -(10399, 149, 1029, 'Магарамкент', 'Magaramkent', 2600), -(10400, 149, 1029, 'Маджалис', 'Madzhalis', 2700), -(10401, 149, 1029, 'Махачкала', 'Mahachkala', 2800), -(10402, 149, 1029, 'Мехельта', 'Mehelta', 2900), -(10403, 149, 1029, 'Новолакское', 'Novolakskoe', 3000), -(10404, 149, 1029, 'Рутул', 'Rutul', 3100), -(10405, 149, 1029, 'Советское (Дагестан)', 'Sovetskoe (Dagestan)', 3200), -(10406, 149, 1029, 'Тарумовка', 'Tarumovka', 3300), -(10407, 149, 1029, 'Терекли-Мектеб', 'Terekli-Mekteb', 3400), -(10408, 149, 1029, 'Тлярата', 'Tlyarata', 3500), -(10409, 149, 1029, 'Тпиг', 'Tpig', 3600), -(10410, 149, 1029, 'Унцукуль', 'Унцукуль', 3700), -(10411, 149, 1029, 'Уркарах', 'Urkarah', 3800), -(10412, 149, 1029, 'Хасавюрт', 'Hasavyurt', 3900), -(10413, 149, 1029, 'Хив', 'Hiv', 4000), -(10414, 149, 1029, 'Хунзах', 'Hunzah', 4100), -(10415, 149, 1029, 'Цуриб', 'Tsurib', 4200), -(10416, 149, 1029, 'Южно-Сухокумск', 'Yuzhno-Suhokumsk', 4300), -(10417, 149, 1030, 'Биробиджан', 'Birobidzhan', 100), -(10418, 149, 1031, 'Архиповка', 'Arhipovka', 100), -(10419, 149, 1031, 'Верхний Ландех', 'Verhnii Landeh', 200), -(10420, 149, 1031, 'Вичуга', 'Vichuga', 300), -(10421, 149, 1031, 'Гаврилов Посад', 'Gavrilov Posad', 400), -(10422, 149, 1031, 'Долматовский', 'Dolmatovskii', 500), -(10423, 149, 1031, 'Дуляпино', 'Dulyapino', 600), -(10424, 149, 1031, 'Заволжск', 'Zavolzhsk', 700), -(10425, 149, 1031, 'Заречный (Ивановская обл.)', 'Zarechnyi (Ivanovskaya obl.)', 800), -(10426, 149, 1031, 'Иваново', 'Ivanovo', 900), -(10427, 149, 1031, 'Иваньковский', 'Ivankovskii', 1000), -(10428, 149, 1031, 'Ильинское-Хованское', 'Ilinskoe-Hovanskoe', 1100), -(10429, 149, 1031, 'Каминский', 'Kaminskii', 1200), -(10430, 149, 1031, 'Кинешма', 'Kineshma', 1300), -(10431, 149, 1031, 'Комсомольск', 'Komsomolsk', 1400), -(10432, 149, 1031, 'Кохма', 'Kohma', 1500), -(10433, 149, 1031, 'Лух', 'Luh', 1600), -(10434, 149, 1031, 'Палех', 'Paleh', 1700), -(10435, 149, 1031, 'Пестяки', 'Pestyaki', 1800), -(10436, 149, 1031, 'Приволжск', 'Privolzhsk', 1900), -(10437, 149, 1031, 'Пучеж', 'Puchezh', 2000), -(10438, 149, 1031, 'Родники (Ивановская обл.)', 'Rodniki (Ivanovskaya obl.)', 2100), -(10439, 149, 1031, 'Савино', 'Savino', 2200), -(10440, 149, 1031, 'Сокольское', 'Sokolskoe', 2300), -(10441, 149, 1031, 'Тейково', 'Teikovo', 2400), -(10442, 149, 1031, 'Фурманов', 'Furmanov', 2500), -(10443, 149, 1031, 'Шуя', 'Shuya', 2600), -(10444, 149, 1031, 'Южа', 'Yuzha', 2700), -(10445, 149, 1031, 'Юрьевец', 'Yurevets', 2800), -(10446, 149, 1032, 'Алексеевск', 'Alekseevsk', 100), -(10447, 149, 1032, 'Алзамай', 'Alzamai', 200), -(10448, 149, 1032, 'Алыгжер', 'Alygzher', 300), -(10449, 149, 1032, 'Ангарск', 'Angarsk', 400), -(10450, 149, 1032, 'Артемовский (Иркутская обл.)', 'Artemovskii (Irkutskaya obl.)', 500), -(10451, 149, 1032, 'Байкал', 'Baikal', 600), -(10452, 149, 1032, 'Байкальск', 'Baikalsk', 700), -(10453, 149, 1032, 'Балаганск', 'Balagansk', 800), -(10454, 149, 1032, 'Баяндай', 'Bayandai', 900), -(10455, 149, 1032, 'Бирюсинск', 'Biryusinsk', 1000), -(10456, 149, 1032, 'Бодайбо', 'Bodaibo', 1100), -(10457, 149, 1032, 'Большая Речка', 'Bolshaya Rechka', 1200), -(10458, 149, 1032, 'Большой Луг', 'Bolshoi Lug', 1300), -(10459, 149, 1032, 'Бохан', 'Bohan', 1400), -(10460, 149, 1032, 'Братск', 'Bratsk', 1500), -(10461, 149, 1032, 'Видим', 'Vidim', 1600), -(10462, 149, 1032, 'Витимский', 'Vitimskii', 1700), -(10463, 149, 1032, 'Вихоревка', 'Vihorevka', 1800), -(10464, 149, 1032, 'Еланцы', 'Elantsy', 1900), -(10465, 149, 1032, 'Ербогачен', 'Erbogachen', 2000), -(10466, 149, 1032, 'Железногорск-Илимский', 'Zheleznogorsk-Ilimskii', 2100), -(10467, 149, 1032, 'Жигалово', 'Zhigalovo', 2200), -(10468, 149, 1032, 'Забитуй', 'Zabitui', 2300), -(10469, 149, 1032, 'Залари', 'Zalari', 2400), -(10470, 149, 1032, 'Звездный', 'Zvezdnyi', 2500), -(10471, 149, 1032, 'Зима', 'Zima', 2600), -(10472, 149, 1032, 'Иркутск', 'Irkutsk', 2700), -(10473, 149, 1032, 'Казачинское (Иркутская обл.)', 'Kazachinskoe (Irkutskaya obl.)', 2800), -(10474, 149, 1032, 'Качуг', 'Kachug', 2900), -(10475, 149, 1032, 'Квиток', 'Kvitok', 3000), -(10476, 149, 1032, 'Киренск', 'Kirensk', 3100), -(10477, 149, 1032, 'Куйтун', 'Kuitun', 3200), -(10478, 149, 1032, 'Култук', 'Kultuk', 3300), -(10479, 149, 1032, 'Кутулик', 'Kutulik', 3400), -(10480, 149, 1032, 'Мама', 'Mama', 3500), -(10481, 149, 1032, 'Нижнеудинск', 'Nizhneudinsk', 3600), -(10482, 149, 1032, 'Оса', 'Osa', 3700), -(10483, 149, 1032, 'Саянск', 'Sayansk', 3800), -(10484, 149, 1032, 'Слюдянка', 'Slyudyanka', 3900), -(10485, 149, 1032, 'Тайшет', 'Taishet', 4000), -(10486, 149, 1032, 'Тулун', 'Tulun', 4100), -(10487, 149, 1032, 'Усолье-Сибирское (Иркутская обл.)', 'Usole-Sibirskoe (Irkutskaya obl.)', 4200), -(10488, 149, 1032, 'Усть-Илимск', 'Ust-Ilimsk', 4300), -(10489, 149, 1032, 'Усть-Кут', 'Ust-Kut', 4400), -(10490, 149, 1032, 'Усть-Ордынский', 'Ust-Ordynskii', 4500), -(10491, 149, 1032, 'Усть-Уда', 'Ust-Uda', 4600), -(10492, 149, 1032, 'Черемхово', 'Cheremhovo', 4700), -(10493, 149, 1032, 'Чунский', 'Chunskii', 4800), -(10494, 149, 1032, 'Шелехов', 'Shelehov', 4900), -(10495, 149, 1033, 'Баксан', 'Baksan', 100), -(10496, 149, 1033, 'Майский', 'Maiskii', 200), -(10497, 149, 1033, 'Нальчик', 'Nalchik', 300), -(10498, 149, 1033, 'Нарткала', 'Nartkala', 400), -(10499, 149, 1033, 'Прохладный', 'Prohladnyi', 500), -(10500, 149, 1033, 'Советское (Кабардино-Балкария)', 'Sovetskoe (Kabardino-Balkariya)', 600), -(10501, 149, 1033, 'Терек', 'Terek', 700), -(10502, 149, 1033, 'Тырныауз', 'Tyrnyauz', 800), -(10503, 149, 1033, 'Чегем-Первый', 'Chegem-Pervyi', 900), -(10504, 149, 1034, 'Багратионовск', 'Bagrationovsk', 100), -(10505, 149, 1034, 'Балтийск', 'Baltiisk', 200), -(10506, 149, 1034, 'Гвардейск', 'Gvardeisk', 300), -(10507, 149, 1034, 'Гурьевск (Калининградская обл.)', 'Gurevsk (Kaliningradskaya obl.)', 400), -(10508, 149, 1034, 'Гусев', 'Gusev', 500), -(10509, 149, 1034, 'Железнодорожный (Калининград.)', 'Zheleznodorozhnyi (Kaliningrad.)', 600), -(10510, 149, 1034, 'Зеленоградск', 'Zelenogradsk', 700), -(10511, 149, 1034, 'Знаменск', 'Znamensk', 800), -(10512, 149, 1034, 'Калининград (Кенигсберг)', 'Kaliningrad (Kenigsberg)', 900), -(10513, 149, 1034, 'Краснознаменск (Калининград.)', 'Krasnoznamensk (Kaliningrad.)', 1000), -(10514, 149, 1034, 'Ладушкин', 'Ладушкин', 1100), -(10515, 149, 1034, 'Мамоново', 'Mamonovo', 1200), -(10516, 149, 1034, 'Неман', 'Neman', 1300), -(10517, 149, 1034, 'Нестеров', 'Nesterov', 1400), -(10518, 149, 1034, 'Озерск(Калининградская обл.)', 'Ozersk(Kaliningradskaya obl.)', 1500), -(10519, 149, 1034, 'Пионерск', 'Пионерск', 1600), -(10520, 149, 1034, 'Полесск', 'Polessk', 1700), -(10521, 149, 1034, 'Правдинск', 'Pravdinsk', 1800), -(10522, 149, 1034, 'Светлогорск', 'Svetlogorsk', 1900), -(10523, 149, 1034, 'Светлый (Калининградская обл.)', 'Svetlyi (Kaliningradskaya obl.)', 2000), -(10524, 149, 1034, 'Славск', 'Slavsk', 2100), -(10525, 149, 1034, 'Советск (Калининградская обл.)', 'Sovetsk (Kaliningradskaya obl.)', 2200), -(10526, 149, 1034, 'Черняховск', 'Chernyahovsk', 2300), -(10527, 149, 1035, 'Аршань', 'Arshan', 100), -(10528, 149, 1035, 'Городовиковск', 'Городовиковск', 200), -(10529, 149, 1035, 'Каспийский', 'Kaspiiskii', 300), -(10530, 149, 1035, 'Комсомольский (Калмыкия)', 'Komsomolskii (Kalmykiya)', 400), -(10531, 149, 1035, 'Малые Дербеты', 'Malye Derbety', 500), -(10532, 149, 1035, 'Приютное', 'Priyutnoe', 600), -(10533, 149, 1035, 'Советское (Калмыкия)', 'Sovetskoe (Kalmykiya)', 700), -(10534, 149, 1035, 'Троицкое (Калмыкия)', 'Troitskoe (Kalmykiya)', 800), -(10535, 149, 1035, 'Утта', 'Utta', 900), -(10536, 149, 1035, 'Цаган-Аман', 'Tsagan-Aman', 1000), -(10537, 149, 1035, 'Элиста', 'Elista', 1100), -(10538, 149, 1035, 'Юста', 'Yusta', 1200), -(10539, 149, 1035, 'Яшалта', 'Yashalta', 1300), -(10540, 149, 1035, 'Яшкуль', 'Yashkul', 1400), -(10541, 149, 1036, 'Бабынино', 'Babynino', 100), -(10542, 149, 1036, 'Балабаново', 'Balabanovo', 200), -(10543, 149, 1036, 'Барятино', 'Baryatino', 300), -(10544, 149, 1036, 'Белоусово', 'Belousovo', 400), -(10545, 149, 1036, 'Бетлица', 'Betlitsa', 500), -(10546, 149, 1036, 'Боровск', 'Borovsk', 600), -(10547, 149, 1036, 'Дудоровский', 'Dudorovskii', 700), -(10548, 149, 1036, 'Думиничи', 'Duminichi', 800), -(10549, 149, 1036, 'Еленский', 'Elenskii', 900), -(10550, 149, 1036, 'Жиздра', 'Zhizdra', 1000), -(10551, 149, 1036, 'Жуков', 'Жуков', 1100), -(10552, 149, 1036, 'Износки', 'Iznoski', 1200), -(10553, 149, 1036, 'Калуга', 'Kaluga', 1300), -(10554, 149, 1036, 'Киров (Калужская обл.)', 'Kirov (Kaluzhskaya obl.)', 1400), -(10555, 149, 1036, 'Козельск', 'Kozelsk', 1500), -(10556, 149, 1036, 'Кондрово', 'Kondrovo', 1600), -(10557, 149, 1036, 'Кремёнки', 'Кремёнки', 1700), -(10558, 149, 1036, 'Людиново', 'Lyudinovo', 1800), -(10559, 149, 1036, 'Малоярославец', 'Maloyaroslavets', 1900), -(10560, 149, 1036, 'Медынь', 'Medyn', 2000), -(10561, 149, 1036, 'Мещовск', 'Meshchovsk', 2100), -(10562, 149, 1036, 'Мосальск', 'Mosalsk', 2200), -(10563, 149, 1036, 'Обнинск', 'Obninsk', 2300), -(10564, 149, 1036, 'Перемышль', 'Peremyshl', 2400), -(10565, 149, 1036, 'Спас-Деменск', 'Spas-Demensk', 2500), -(10566, 149, 1036, 'Сухиничи', 'Suhinichi', 2600), -(10567, 149, 1036, 'Таруса', 'Tarusa', 2700), -(10568, 149, 1036, 'Ульяново', 'Ulyanovo', 2800), -(10569, 149, 1036, 'Ферзиково', 'Ferzikovo', 2900), -(10570, 149, 1036, 'Хвастовичи', 'Hvastovichi', 3000), -(10571, 149, 1036, 'Юхнов', 'Yuhnov', 3100), -(10572, 149, 1037, 'Атласово', 'Atlasovo', 100), -(10573, 149, 1037, 'Аянка', 'Ayanka', 200), -(10574, 149, 1037, 'Большерецк', 'Bolsheretsk', 300), -(10575, 149, 1037, 'Вилючинск', 'Vilyuchinsk', 400), -(10576, 149, 1037, 'Елизово (Камчатская обл.)', 'Elizovo (Kamchatskaya obl.)', 500), -(10577, 149, 1037, 'Ильпырский', 'Ilpyrskii', 600), -(10578, 149, 1037, 'Каменское', 'Kamenskoe', 700), -(10579, 149, 1037, 'Кировский', 'Kirovskii', 800), -(10580, 149, 1037, 'Ключи (Камчатская обл.)', 'Klyuchi (Kamchatskaya obl.)', 900), -(10581, 149, 1037, 'Крапивная', 'Krapivnaya', 1000), -(10582, 149, 1037, 'Мильково', 'Milkovo', 1100), -(10583, 149, 1037, 'Никольское', 'Nikolskoe', 1200), -(10584, 149, 1037, 'Озерновский', 'Ozernovskii', 1300), -(10585, 149, 1037, 'Оссора', 'Ossora', 1400), -(10586, 149, 1037, 'Палана', 'Palana', 1500), -(10587, 149, 1037, 'Парень', 'Paren', 1600), -(10588, 149, 1037, 'Пахачи', 'Pahachi', 1700), -(10589, 149, 1037, 'Петропавловск-Камчатский', 'Petropavlovsk-Kamchatskii', 1800), -(10590, 149, 1037, 'Тигиль', 'Tigil', 1900), -(10591, 149, 1037, 'Тиличики', 'Tilichiki', 2000), -(10592, 149, 1037, 'Усть-Большерецк', 'Ust-Bolsheretsk', 2100), -(10593, 149, 1037, 'Усть-Камчатск', 'Ust-Kamchatsk', 2200), -(10594, 149, 1038, 'Черкесск', 'Черкесск', 100), -(10595, 149, 1039, 'Амбарный', 'Ambarnyi', 100), -(10596, 149, 1039, 'Беломорск', 'Belomorsk', 200), -(10597, 149, 1039, 'Валаам', 'Valaam', 300), -(10598, 149, 1039, 'Вирандозеро', 'Virandozero', 400), -(10599, 149, 1039, 'Гирвас', 'Girvas', 500), -(10600, 149, 1039, 'Деревянка', 'Derevyanka', 600), -(10601, 149, 1039, 'Идель', 'Idel', 700), -(10602, 149, 1039, 'Ильинский (Карелия)', 'Ilinskii (Kareliya)', 800), -(10603, 149, 1039, 'Калевала', 'Kalevala', 900), -(10604, 149, 1039, 'Кемь', 'Kem', 1000), -(10605, 149, 1039, 'Кестеньга', 'Kestenga', 1100), -(10606, 149, 1039, 'Кондопога', 'Kondopoga', 1200), -(10607, 149, 1039, 'Костомукша', 'Kostomuksha', 1300), -(10608, 149, 1039, 'Лахденпохья', 'Lahdenpohya', 1400), -(10609, 149, 1039, 'Лоухи', 'Louhi', 1500), -(10610, 149, 1039, 'Медвежьегорск', 'Medvezhegorsk', 1600), -(10611, 149, 1039, 'Муезерский', 'Muezerskii', 1700), -(10612, 149, 1039, 'Олонец', 'Olonets', 1800), -(10613, 149, 1039, 'Петрозаводск', 'Petrozavodsk', 1900), -(10614, 149, 1039, 'Питкяранта', 'Pitkyaranta', 2000), -(10615, 149, 1039, 'Повенец', 'Povenets', 2100), -(10616, 149, 1039, 'Пряжа', 'Pryazha', 2200), -(10617, 149, 1039, 'Пудож', 'Pudozh', 2300), -(10618, 149, 1039, 'Сегежа', 'Segezha', 2400), -(10619, 149, 1039, 'Сортавала', 'Sortavala', 2500), -(10620, 149, 1039, 'Суоярви', 'Suoyarvi', 2600), -(10621, 149, 1039, 'Хийденсельга', 'Хийденсельга', 2700), -(10622, 149, 1040, 'Анжеро-Судженск', 'Anzhero-Sudzhensk', 100), -(10623, 149, 1040, 'Барзас', 'Barzas', 200), -(10624, 149, 1040, 'Белово', 'Belovo', 300), -(10625, 149, 1040, 'Белогорск', 'Belogorsk', 400), -(10626, 149, 1040, 'Березовский (Кемеровская обл.)', 'Berezovskii (Kemerovskaya obl.)', 500), -(10627, 149, 1040, 'Грамотеино', 'Gramoteino', 600), -(10628, 149, 1040, 'Гурьевск', 'Gurevsk', 700), -(10629, 149, 1040, 'Ижморский', 'Izhmorskii', 800), -(10630, 149, 1040, 'Итатский', 'Itatskii', 900), -(10631, 149, 1040, 'Калтан', 'Kaltan', 1000), -(10632, 149, 1040, 'Кедровка', 'Kedrovka', 1100), -(10633, 149, 1040, 'Кемерово', 'Kemerovo', 1200), -(10634, 149, 1040, 'Киселевск', 'Kiselevsk', 1300), -(10635, 149, 1040, 'Крапивинский', 'Krapivinskii', 1400), -(10636, 149, 1040, 'Ленинск-Кузнецкий', 'Leninsk-Kuznetskii', 1500), -(10637, 149, 1040, 'Мариинск', 'Mariinsk', 1600), -(10638, 149, 1040, 'Междуреченск', 'Mezhdurechensk', 1700), -(10639, 149, 1040, 'Мыски', 'Myski', 1800), -(10640, 149, 1040, 'Новокузнецк', 'Novokuznetsk', 1900), -(10641, 149, 1040, 'Осинники', 'Osinniki', 2000), -(10642, 149, 1040, 'Полысаево', 'Полысаево', 2100), -(10643, 149, 1040, 'Прокопьевск', 'Prokopevsk', 2200), -(10644, 149, 1040, 'Промышленная', 'Promyshlennaya', 2300), -(10645, 149, 1040, 'Тайга', 'Taiga', 2400), -(10646, 149, 1040, 'Таштагол', 'Tashtagol', 2500), -(10647, 149, 1040, 'Тисуль', 'Tisul', 2600), -(10648, 149, 1040, 'Топки', 'Topki', 2700), -(10649, 149, 1040, 'Тяжинский', 'Tyazhinskii', 2800), -(10650, 149, 1040, 'Юрга', 'Yurga', 2900), -(10651, 149, 1040, 'Яшкино', 'Yashkino', 3000), -(10652, 149, 1040, 'Яя', 'Yaya', 3100), -(10653, 149, 1041, 'Арбаж', 'Arbazh', 100), -(10654, 149, 1041, 'Аркуль', 'Arkul', 200), -(10655, 149, 1041, 'Белая Холуница', 'Belaya Holunitsa', 300), -(10656, 149, 1041, 'Богородское (Кировская обл.)', 'Bogorodskoe (Kirovskaya obl.)', 400), -(10657, 149, 1041, 'Боровой', 'Borovoi', 500), -(10658, 149, 1041, 'Верхошижемье', 'Verhoshizheme', 600), -(10659, 149, 1041, 'Вятские Поляны (Кировская обл.)', 'Vyatskie Polyany (Kirovskaya obl.)', 700), -(10660, 149, 1041, 'Зуевка', 'Zuevka', 800), -(10661, 149, 1041, 'Каринторф', 'Karintorf', 900), -(10662, 149, 1041, 'Кикнур', 'Kiknur', 1000), -(10663, 149, 1041, 'Кильмезь', 'Kilmez', 1100), -(10664, 149, 1041, 'Киров (Кировская обл.)', 'Kirov (Kirovskaya obl.)', 1200), -(10665, 149, 1041, 'Кирово-Чепецк', 'Kirovo-Chepetsk', 1300), -(10666, 149, 1041, 'Кирс', 'Kirs', 1400), -(10667, 149, 1041, 'Кобра', 'Kobra', 1500), -(10668, 149, 1041, 'Котельнич', 'Kotelnich', 1600), -(10669, 149, 1041, 'Кумены', 'Kumeny', 1700), -(10670, 149, 1041, 'Ленинское', 'Leninskoe', 1800), -(10671, 149, 1041, 'Луза', 'Luza', 1900), -(10672, 149, 1041, 'Малмыж', 'Malmyzh', 2000), -(10673, 149, 1041, 'Мураши', 'Murashi', 2100), -(10674, 149, 1041, 'Нагорск', 'Nagorsk', 2200), -(10675, 149, 1041, 'Нема', 'Nema', 2300), -(10676, 149, 1041, 'Нововятск', 'Novovyatsk', 2400), -(10677, 149, 1041, 'Нолинск', 'Nolinsk', 2500), -(10678, 149, 1041, 'Омутнинск', 'Omutninsk', 2600), -(10679, 149, 1041, 'Опарино', 'Oparino', 2700), -(10680, 149, 1041, 'Оричи', 'Orichi', 2800), -(10681, 149, 1041, 'Пижанка', 'Pizhanka', 2900), -(10682, 149, 1041, 'Подосиновец', 'Podosinovets', 3000), -(10683, 149, 1041, 'Санчурск', 'Sanchursk', 3100), -(10684, 149, 1041, 'Свеча', 'Svecha', 3200), -(10685, 149, 1041, 'Слободской', 'Slobodskoi', 3300), -(10686, 149, 1041, 'Советск (Кировская обл.)', 'Sovetsk (Kirovskaya obl.)', 3400), -(10687, 149, 1041, 'Суна', 'Suna', 3500), -(10688, 149, 1041, 'Тужа', 'Tuzha', 3600), -(10689, 149, 1041, 'Уни', 'Uni', 3700), -(10690, 149, 1041, 'Уржум', 'Urzhum', 3800), -(10691, 149, 1041, 'Фаленки', 'Falenki', 3900), -(10692, 149, 1041, 'Халтурин', 'Halturin', 4000), -(10693, 149, 1041, 'Юрья', 'Yurya', 4100), -(10694, 149, 1041, 'Яранск', 'Yaransk', 4200), -(10695, 149, 1042, 'Абезь', 'Abez', 100), -(10696, 149, 1042, 'Адзьвавом', 'Adzvavom', 200), -(10697, 149, 1042, 'Айкино', 'Aikino', 300), -(10698, 149, 1042, 'Верхняя Инта', 'Verhnyaya Inta', 400), -(10699, 149, 1042, 'Визинга', 'Vizinga', 500), -(10700, 149, 1042, 'Водный', 'Vodnyi', 600), -(10701, 149, 1042, 'Воркута', 'Vorkuta', 700), -(10702, 149, 1042, 'Вуктыл', 'Vuktyl', 800), -(10703, 149, 1042, 'Елецкий', 'Eletskii', 900), -(10704, 149, 1042, 'Емва', 'Emva', 1000), -(10705, 149, 1042, 'Жешарт', 'Жешарт', 1100), -(10706, 149, 1042, 'Заполярный', 'Zapolyarnyi', 1200), -(10707, 149, 1042, 'Ижма', 'Izhma', 1300), -(10708, 149, 1042, 'Инта', 'Inta', 1400), -(10709, 149, 1042, 'Ираель', 'Irael', 1500), -(10710, 149, 1042, 'Каджером', 'Kadzherom', 1600), -(10711, 149, 1042, 'Кажым', 'Kazhym', 1700), -(10712, 149, 1042, 'Кожым', 'Kozhym', 1800), -(10713, 149, 1042, 'Койгородок', 'Koigorodok', 1900), -(10714, 149, 1042, 'Корткерос', 'Kortkeros', 2000), -(10715, 149, 1042, 'Кослан', 'Koslan', 2100), -(10716, 149, 1042, 'Микунь', 'Микунь', 2200), -(10717, 149, 1042, 'Нижний Одес', 'Nizhnii Odes', 2300), -(10718, 149, 1042, 'Объячево', 'Ob''yachevo', 2400), -(10719, 149, 1042, 'Печора', 'Pechora', 2500), -(10720, 149, 1042, 'Сосногорск', 'Sosnogorsk', 2600), -(10721, 149, 1042, 'Сыктывкар', 'Syktyvkar', 2700), -(10722, 149, 1042, 'Троицко-Печерск', 'Troitsko-Pechersk', 2800), -(10723, 149, 1042, 'Усинск', 'Usinsk', 2900), -(10724, 149, 1042, 'Усогорск', 'Usogorsk', 3000), -(10725, 149, 1042, 'Усть-Кулом', 'Ust-Kulom', 3100), -(10726, 149, 1042, 'Усть-Цильма', 'Ust-Tsilma', 3200), -(10727, 149, 1042, 'Ухта', 'Uhta', 3300), -(10728, 149, 1043, 'Антропово', 'Antropovo', 100), -(10729, 149, 1043, 'Боговарово', 'Bogovarovo', 200), -(10730, 149, 1043, 'Буй', 'Bui', 300), -(10731, 149, 1043, 'Волгореченск', 'Volgorechensk', 400), -(10732, 149, 1043, 'Галич', 'Galich', 500), -(10733, 149, 1043, 'Горчуха', 'Gorchuha', 600), -(10734, 149, 1043, 'Зебляки', 'Zeblyaki', 700), -(10735, 149, 1043, 'Кадый', 'Kadyi', 800), -(10736, 149, 1043, 'Кологрив', 'Kologriv', 900), -(10737, 149, 1043, 'Кострома', 'Kostroma', 1000), -(10738, 149, 1043, 'Красное-на-Волге', 'Krasnoe-na-Volge', 1100), -(10739, 149, 1043, 'Макарьев', 'Makarev', 1200), -(10740, 149, 1043, 'Мантурово', 'Manturovo', 1300), -(10741, 149, 1043, 'Нерехта', 'Nerehta', 1400), -(10742, 149, 1043, 'Нея', 'Neya', 1500), -(10743, 149, 1043, 'Островское', 'Ostrovskoe', 1600), -(10744, 149, 1043, 'Павино', 'Pavino', 1700), -(10745, 149, 1043, 'Парфентьево', 'Parfentevo', 1800), -(10746, 149, 1043, 'Поназырево', 'Ponazyrevo', 1900), -(10747, 149, 1043, 'Солигалич', 'Soligalich', 2000), -(10748, 149, 1043, 'Судиславль', 'Sudislavl', 2100), -(10749, 149, 1043, 'Сусанино', 'Susanino', 2200), -(10750, 149, 1043, 'Чухлома', 'Chuhloma', 2300), -(10751, 149, 1043, 'Шарья', 'Sharya', 2400), -(10752, 149, 1043, 'Шемятино', 'Shemyatino', 2500), -(10753, 149, 1044, 'Абинск', 'Abinsk', 100), -(10754, 149, 1044, 'Абрау-Дюрсо', 'Abrau-Dyurso', 200), -(10755, 149, 1044, 'Адлер', 'Adler', 300), -(10756, 149, 1044, 'Анапа', 'Anapa', 400), -(10757, 149, 1044, 'Апшеронск', 'Apsheronsk', 500), -(10758, 149, 1044, 'Армавир', 'Armavir', 600), -(10759, 149, 1044, 'Архипо-Осиповка', 'Arhipo-Osipovka', 700), -(10760, 149, 1044, 'Афипский', 'Afipskii', 800), -(10761, 149, 1044, 'Ахтырский', 'Ahtyrskii', 900), -(10762, 149, 1044, 'Ачуево', 'Achuevo', 1000), -(10763, 149, 1044, 'Белая Глина', 'Белая Глина', 1100), -(10764, 149, 1044, 'Белореченск', 'Belorechensk', 1200), -(10765, 149, 1044, 'Верхнебаканский', 'Verhnebakanskii', 1300), -(10766, 149, 1044, 'Выселки', 'Vyselki', 1400), -(10767, 149, 1044, 'Геленджик', 'Gelendzhik', 1500), -(10768, 149, 1044, 'Гиагинская', 'Giaginskaya', 1600), -(10769, 149, 1044, 'Горячий Ключ', 'Goryachii Klyuch', 1700), -(10770, 149, 1044, 'Гулькевичи', 'Гулькевичи', 1800), -(10771, 149, 1044, 'Джубга', 'Dzhubga', 1900), -(10772, 149, 1044, 'Динская', 'Dinskaya', 2000), -(10773, 149, 1044, 'Ейск', 'Eisk', 2100), -(10774, 149, 1044, 'Ильский', 'Ilskii', 2200), -(10775, 149, 1044, 'Кабардинка', 'Kabardinka', 2300), -(10776, 149, 1044, 'Калинино', 'Kalinino', 2400), -(10777, 149, 1044, 'Калининская', 'Kalininskaya', 2500), -(10778, 149, 1044, 'Каменномостский', 'Kamennomostskii', 2600), -(10779, 149, 1044, 'Каневская', 'Kanevskaya', 2700), -(10780, 149, 1044, 'Кореновск', 'Korenovsk', 2800), -(10781, 149, 1044, 'Красноармейская', 'Krasnoarmeiskaya', 2900), -(10782, 149, 1044, 'Краснодар', 'Krasnodar', 3000), -(10783, 149, 1044, 'Кропоткин', 'Kropotkin', 3100), -(10784, 149, 1044, 'Крыловская', 'Krylovskaya', 3200), -(10785, 149, 1044, 'Крымск', 'Krymsk', 3300), -(10786, 149, 1044, 'Курганинск', 'Kurganinsk', 3400), -(10787, 149, 1044, 'Кущевская', 'Kushchevskaya', 3500), -(10788, 149, 1044, 'Лабинск', 'Labinsk', 3600), -(10789, 149, 1044, 'Лазаревское', 'Lazarevskoe', 3700), -(10790, 149, 1044, 'Ленинградская', 'Leningradskaya', 3800), -(10791, 149, 1044, 'Майкоп (Краснодарский край)', 'Maikop (Krasnodarskii krai)', 3900), -(10792, 149, 1044, 'Мостовской', 'Mostovskoi', 4000), -(10793, 149, 1044, 'Новокубанск', 'Новокубанск', 4100), -(10794, 149, 1044, 'Новороссийск', 'Novorossiisk', 4200), -(10795, 149, 1044, 'Отрадная', 'Otradnaya', 4300), -(10796, 149, 1044, 'Павловская', 'Pavlovskaya', 4400), -(10797, 149, 1044, 'Приморско-Ахтарск', 'Primorsko-Ahtarsk', 4500), -(10798, 149, 1044, 'Северская', 'Severskaya', 4600), -(10799, 149, 1044, 'Славянск-на-Кубани', 'Slavyansk-na-Kubani', 4700), -(10800, 149, 1044, 'Сочи', 'Sochi', 4800), -(10801, 149, 1044, 'Староминская', 'Starominskaya', 4900), -(10802, 149, 1044, 'Старощербиновская', 'Staroshcherbinovskaya', 5000), -(10803, 149, 1044, 'Тбилисская', 'Tbilisskaya', 5100), -(10804, 149, 1044, 'Темрюк', 'Temryuk', 5200), -(10805, 149, 1044, 'Тимашевск', 'Timashevsk', 5300), -(10806, 149, 1044, 'Тихорецк', 'Tihoretsk', 5400), -(10807, 149, 1044, 'Туапсе', 'Tuapse', 5500), -(10808, 149, 1044, 'Тульский', 'Tulskii', 5600), -(10809, 149, 1044, 'Усть-Лабинск', 'Ust-Labinsk', 5700), -(10810, 149, 1044, 'Хадыженск', 'Hadyzhensk', 5800), -(10811, 149, 1044, 'Хоста', 'Хоста', 5900), -(10812, 149, 1044, 'Шовгеновский', 'Shovgenovskii', 6000), -(10813, 149, 1045, 'Абаза', 'Abaza', 100), -(10814, 149, 1045, 'Абакан', 'Abakan', 200), -(10815, 149, 1045, 'Агинское', 'Aginskoe', 300), -(10816, 149, 1045, 'Артемовск', 'Artemovsk', 400), -(10817, 149, 1045, 'Аскиз', 'Askiz', 500), -(10818, 149, 1045, 'Ачинск', 'Achinsk', 600), -(10819, 149, 1045, 'Байкит', 'Baikit', 700), -(10820, 149, 1045, 'Балахта', 'Balahta', 800), -(10821, 149, 1045, 'Балыкса', 'Balyksa', 900), -(10822, 149, 1045, 'Белый Яр', 'Belyi Yar', 1000), -(10823, 149, 1045, 'Бея', 'Beya', 1100), -(10824, 149, 1045, 'Бискамжа', 'Biskamzha', 1200), -(10825, 149, 1045, 'Боготол', 'Bogotol', 1300), -(10826, 149, 1045, 'Боград', 'Bograd', 1400), -(10827, 149, 1045, 'Богучаны', 'Boguchany', 1500), -(10828, 149, 1045, 'Большая Мурта', 'Bolshaya Murta', 1600), -(10829, 149, 1045, 'Большой Улуй', 'Bolshoi Ului', 1700), -(10830, 149, 1045, 'Бородино (Красноярский край)', 'Borodino (Krasnoyarskii krai)', 1800), -(10831, 149, 1045, 'Ванавара', 'Vanavara', 1900), -(10832, 149, 1045, 'Верхнеимбатск', 'Verhneimbatsk', 2000), -(10833, 149, 1045, 'Горячегорск', 'Goryachegorsk', 2100), -(10834, 149, 1045, 'Дзержинское', 'Dzerzhinskoe', 2200), -(10835, 149, 1045, 'Дивногорск', 'Divnogorsk', 2300), -(10836, 149, 1045, 'Диксон', 'Dikson', 2400), -(10837, 149, 1045, 'Дудинка', 'Dudinka', 2500), -(10838, 149, 1045, 'Емельяново', 'Emelyanovo', 2600), -(10839, 149, 1045, 'Енисейск', 'Eniseisk', 2700), -(10840, 149, 1045, 'Ермаковское', 'Ermakovskoe', 2800), -(10841, 149, 1045, 'Железногорск', 'Zheleznogorsk', 2900), -(10842, 149, 1045, 'Заозерный', 'Zaozernyi', 3000), -(10843, 149, 1045, 'Зеленогорск (Красноярский край)', 'Zelenogorsk (Krasnoyarskii krai)', 3100), -(10844, 149, 1045, 'Игарка', 'Igarka', 3200), -(10845, 149, 1045, 'Идринское', 'Idrinskoe', 3300), -(10846, 149, 1045, 'Иланский', 'Ilanskii', 3400), -(10847, 149, 1045, 'Ирбейское', 'Irbeiskoe', 3500), -(10848, 149, 1045, 'Казачинское (Красноярский край)', 'Kazachinskoe (Krasnoyarskii krai)', 3600), -(10849, 149, 1045, 'Канск', 'Kansk', 3700), -(10850, 149, 1045, 'Каратузское', 'Karatuzskoe', 3800), -(10851, 149, 1045, 'Караул', 'Karaul', 3900), -(10852, 149, 1045, 'Кодинск', 'Kodinsk', 4000), -(10853, 149, 1045, 'Козулька', 'Kozulka', 4100), -(10854, 149, 1045, 'Копьево', 'Kopevo', 4200), -(10855, 149, 1045, 'Краснотуранск', 'Krasnoturansk', 4300), -(10856, 149, 1045, 'Красноярск', 'Krasnoyarsk', 4400), -(10857, 149, 1045, 'Курагино', 'Kuragino', 4500), -(10858, 149, 1045, 'Лесосибирск', 'Lesosibirsk', 4600), -(10859, 149, 1045, 'Минусинск', 'Minusinsk', 4700), -(10860, 149, 1045, 'Мотыгино', 'Motygino', 4800), -(10861, 149, 1045, 'Назарово', 'Nazarovo', 4900), -(10862, 149, 1045, 'Нижний Ингаш', 'Nizhnii Ingash', 5000), -(10863, 149, 1045, 'Новоселово', 'Novoselovo', 5100), -(10864, 149, 1045, 'Норильск', 'Norilsk', 5200), -(10865, 149, 1045, 'Партизанское', 'Partizanskoe', 5300), -(10866, 149, 1045, 'Пировское', 'Pirovskoe', 5400), -(10867, 149, 1045, 'Северо-Енисейский', 'Severo-Eniseiskii', 5500), -(10868, 149, 1045, 'Сосновоборск (Красноярский край)', 'Sosnovoborsk (Krasnoyarskii krai)', 5600), -(10869, 149, 1045, 'Тасеево', 'Taseevo', 5700), -(10870, 149, 1045, 'Таштып', 'Tashtyp', 5800), -(10871, 149, 1045, 'Тура', 'Tura', 5900), -(10872, 149, 1045, 'Туруханск', 'Turuhansk', 6000), -(10873, 149, 1045, 'Тюхтет', 'Tyuhtet', 6100), -(10874, 149, 1045, 'Ужур', 'Uzhur', 6200), -(10875, 149, 1045, 'Уяр', 'Uyar', 6300), -(10876, 149, 1045, 'Хатанга', 'Hatanga', 6400), -(10877, 149, 1045, 'Черемушки', 'Cheremushki', 6500), -(10878, 149, 1045, 'Черногорск', 'Chernogorsk', 6600), -(10879, 149, 1045, 'Шалинское', 'Shalinskoe', 6700), -(10880, 149, 1045, 'Шарыпово (Красноярский край)', 'Sharypovo (Krasnoyarskii krai)', 6800), -(10881, 149, 1045, 'Шира', 'Shira', 6900), -(10882, 149, 1045, 'Шушенское', 'Shushenskoe', 7000), -(10883, 149, 1046, 'Варгаши', 'Vargashi', 100), -(10884, 149, 1046, 'Глядянское', 'Glyadyanskoe', 200), -(10885, 149, 1046, 'Далматово', 'Dalmatovo', 300), -(10886, 149, 1046, 'Каргаполье', 'Kargapole', 400), -(10887, 149, 1046, 'Катайск', 'Kataisk', 500), -(10888, 149, 1046, 'Кетово', 'Ketovo', 600), -(10889, 149, 1046, 'Курган', 'Kurgan', 700), -(10890, 149, 1046, 'Куртамыш', 'Kurtamysh', 800), -(10891, 149, 1046, 'Лебяжье', 'Lebyazhe', 900), -(10892, 149, 1046, 'Макушино', 'Makushino', 1000), -(10893, 149, 1046, 'Мишкино', 'Mishkino', 1100), -(10894, 149, 1046, 'Мокроусово', 'Mokrousovo', 1200), -(10895, 149, 1046, 'Петухово', 'Petuhovo', 1300), -(10896, 149, 1046, 'Половинное', 'Polovinnoe', 1400), -(10897, 149, 1046, 'Сафакулево', 'Safakulevo', 1500), -(10898, 149, 1046, 'Целинное', 'Tselinnoe', 1600), -(10899, 149, 1046, 'Шадринск', 'Shadrinsk', 1700), -(10900, 149, 1046, 'Шатрово', 'Shatrovo', 1800), -(10901, 149, 1046, 'Шумиха', 'Shumiha', 1900), -(10902, 149, 1046, 'Щучье', 'Shchuche', 2000), -(10903, 149, 1046, 'Юргамыш', 'Yurgamysh', 2100), -(10904, 149, 1047, 'Альменево', 'Almenevo', 100), -(10905, 149, 1047, 'Белая', 'Belaya', 200), -(10906, 149, 1047, 'Большое Солдатское', 'Bolshoe Soldatskoe', 300), -(10907, 149, 1047, 'Глушково', 'Glushkovo', 400), -(10908, 149, 1047, 'Горшечное', 'Gorshechnoe', 500), -(10909, 149, 1047, 'Дмитриев-Льговский', 'Dmitriev-Lgovskii', 600), -(10910, 149, 1047, 'Железногорск', 'Zheleznogorsk', 700), -(10911, 149, 1047, 'Золотухино', 'Zolotuhino', 800), -(10912, 149, 1047, 'Касторное', 'Kastornoe', 900), -(10913, 149, 1047, 'Конышевка', 'Konyshevka', 1000), -(10914, 149, 1047, 'Коренево', 'Korenevo', 1100), -(10915, 149, 1047, 'Курск', 'Kursk', 1200), -(10916, 149, 1047, 'Курчатов', 'Kurchatov', 1300), -(10917, 149, 1047, 'Кшенский', 'Kshenskii', 1400), -(10918, 149, 1047, 'Льгов', 'Lgov', 1500), -(10919, 149, 1047, 'Мантурово', 'Manturovo', 1600), -(10920, 149, 1047, 'Медвенка', 'Medvenka', 1700), -(10921, 149, 1047, 'Обоянь', 'Oboyan', 1800), -(10922, 149, 1047, 'Поныри', 'Ponyri', 1900), -(10923, 149, 1047, 'Пристень', 'Pristen', 2000), -(10924, 149, 1047, 'Прямицыно', 'Pryamitsyno', 2100), -(10925, 149, 1047, 'Рыльск', 'Rylsk', 2200), -(10926, 149, 1047, 'Суджа', 'Sudzha', 2300), -(10927, 149, 1047, 'Тим', 'Tim', 2400), -(10928, 149, 1047, 'Фатеж', 'Fatezh', 2500), -(10929, 149, 1047, 'Хомутовка', 'Homutovka', 2600), -(10930, 149, 1047, 'Черемисиново', 'Cheremisinovo', 2700), -(10931, 149, 1047, 'Щигры', 'Shchigry', 2800), -(10932, 149, 1048, 'Грязи', 'Gryazi', 100), -(10933, 149, 1048, 'Данков', 'Dankov', 200), -(10934, 149, 1048, 'Доброе', 'Dobroe', 300), -(10935, 149, 1048, 'Долгоруково', 'Dolgorukovo', 400), -(10936, 149, 1048, 'Елец', 'Elets', 500), -(10937, 149, 1048, 'Задонск', 'Zadonsk', 600), -(10938, 149, 1048, 'Измалково', 'Izmalkovo', 700), -(10939, 149, 1048, 'Казинка', 'Kazinka', 800), -(10940, 149, 1048, 'Лебедянь', 'Lebedyan', 900), -(10941, 149, 1048, 'Лев Толстой', 'Lev Tolstoi', 1000), -(10942, 149, 1048, 'Липецк', 'Lipetsk', 1100), -(10943, 149, 1048, 'Тербуны', 'Terbuny', 1200), -(10944, 149, 1048, 'Усмань', 'Usman', 1300), -(10945, 149, 1048, 'Хлевное', 'Hlevnoe', 1400), -(10946, 149, 1048, 'Чаплыгин', 'Chaplygin', 1500), -(10947, 149, 1049, 'Анадырь (Магаданская обл.)', 'Anadyr (Magadanskaya obl.)', 100), -(10948, 149, 1049, 'Атка', 'Atka', 200), -(10949, 149, 1049, 'Беринговский', 'Beringovskii', 300), -(10950, 149, 1049, 'Билибино', 'Bilibino', 400), -(10951, 149, 1049, 'Большевик', 'Bolshevik', 500), -(10952, 149, 1049, 'Ванкарем', 'Vankarem', 600), -(10953, 149, 1049, 'Кадыкчан', 'Kadykchan', 700), -(10954, 149, 1049, 'Лаврентия', 'Lavrentiya', 800), -(10955, 149, 1049, 'Магадан', 'Magadan', 900), -(10956, 149, 1049, 'Мыс Шмидта', 'Mys Shmidta', 1000), -(10957, 149, 1049, 'Ола', 'Ola', 1100), -(10958, 149, 1049, 'Омсукчан', 'Omsukchan', 1200), -(10959, 149, 1049, 'Палатка', 'Palatka', 1300), -(10960, 149, 1049, 'Певек', 'Pevek', 1400), -(10961, 149, 1049, 'Провидения', 'Provideniya', 1500), -(10962, 149, 1049, 'Сеймчан', 'Seimchan', 1600), -(10963, 149, 1049, 'Синегорье', 'Sinegore', 1700), -(10964, 149, 1049, 'Сусуман', 'Susuman', 1800), -(10965, 149, 1049, 'Усть-Омчуг', 'Ust-Omchug', 1900), -(10966, 149, 1049, 'Эвенск', 'Evensk', 2000), -(10967, 149, 1049, 'Эгвекинот', 'Egvekinot', 2100), -(10968, 149, 1049, 'Ягодное', 'Yagodnoe', 2200), -(10969, 149, 1050, 'Волжск', 'Volzhsk', 100), -(10970, 149, 1050, 'Дубовский', 'Dubovskii', 200), -(10971, 149, 1050, 'Звенигово', 'Zvenigovo', 300), -(10972, 149, 1050, 'Йошкар-Ола', 'Ioshkar-Ola', 400), -(10973, 149, 1050, 'Килемары', 'Kilemary', 500), -(10974, 149, 1050, 'Козьмодемьянск', 'Kozmodemyansk', 600), -(10975, 149, 1050, 'Куженер', 'Kuzhener', 700), -(10976, 149, 1050, 'Мари-Турек', 'Mari-Turek', 800), -(10977, 149, 1050, 'Медведево', 'Medvedevo', 900), -(10978, 149, 1050, 'Морки', 'Morki', 1000), -(10979, 149, 1050, 'Новый Торьял', 'Novyi Toryal', 1100), -(10980, 149, 1050, 'Оршанка', 'Orshanka', 1200), -(10981, 149, 1050, 'Параньга', 'Paranga', 1300), -(10982, 149, 1050, 'Сернур', 'Sernur', 1400), -(10983, 149, 1050, 'Советский (Марий Эл)', 'Sovetskii (Marii El)', 1500), -(10984, 149, 1050, 'Юрино', 'Yurino', 1600), -(10985, 149, 1051, 'Ардатов', 'Ardatov', 100), -(10986, 149, 1051, 'Атюрьево', 'Atyurevo', 200), -(10987, 149, 1051, 'Атяшево', 'Atyashevo', 300), -(10988, 149, 1051, 'Большие Березники', 'Bolshie Berezniki', 400), -(10989, 149, 1051, 'Большое Игнатово', 'Bolshoe Ignatovo', 500), -(10990, 149, 1051, 'Выша', 'Vysha', 600), -(10991, 149, 1051, 'Ельники', 'Elniki', 700), -(10992, 149, 1051, 'Зубова Поляна', 'Zubova Polyana', 800), -(10993, 149, 1051, 'Инсар', 'Insar', 900), -(10994, 149, 1051, 'Кадошкино', 'Kadoshkino', 1000), -(10995, 149, 1051, 'Кемля', 'Kemlya', 1100), -(10996, 149, 1051, 'Ковылкино', 'Kovylkino', 1200), -(10997, 149, 1051, 'Комсомольский (Мордовия)', 'Komsomolskii (Mordoviya)', 1300), -(10998, 149, 1051, 'Кочкурово', 'Kochkurovo', 1400), -(10999, 149, 1051, 'Краснослободск', 'Krasnoslobodsk', 1500), -(11000, 149, 1051, 'Лямбирь', 'Lyambir', 1600), -(11001, 149, 1051, 'Ромоданово', 'Romodanovo', 1700), -(11002, 149, 1051, 'Рузаевка', 'Ruzaevka', 1800), -(11003, 149, 1051, 'Саранск', 'Saransk', 1900), -(11004, 149, 1051, 'Старое Шайгово', 'Staroe Shaigovo', 2000), -(11005, 149, 1051, 'Темников', 'Temnikov', 2100), -(11006, 149, 1051, 'Теньгушево', 'Tengushevo', 2200), -(11007, 149, 1051, 'Торбеево', 'Torbeevo', 2300), -(11008, 149, 1051, 'Чамзинка', 'Chamzinka', 2400), -(11009, 149, 1052, 'Абрамцево', 'Abramtsevo', 100), -(11010, 149, 1052, 'Алабино', 'Alabino', 200), -(11011, 149, 1052, 'Апрелевка', 'Aprelevka', 300), -(11012, 149, 1052, 'Архангельское', 'Arhangelskoe', 400), -(11013, 149, 1052, 'Ашитково', 'Ashitkovo', 500), -(11014, 149, 1052, 'Байконур', 'Baikonur', 600), -(11015, 149, 1052, 'Бакшеево', 'Baksheevo', 700), -(11016, 149, 1052, 'Балашиха', 'Balashiha', 800), -(11017, 149, 1052, 'Барыбино', 'Barybino', 900), -(11018, 149, 1052, 'Белозёрский', 'Белозёрский', 1000), -(11019, 149, 1052, 'Белоомут', 'Beloomut', 1100), -(11020, 149, 1052, 'Белые Столбы', 'Belye Stolby', 1200), -(11021, 149, 1052, 'Бородино (Московская обл.)', 'Borodino (Moskovskaya obl.)', 1300), -(11022, 149, 1052, 'Бронницы', 'Bronnitsy', 1400), -(11023, 149, 1052, 'Быково (Московская обл.)', 'Bykovo (Moskovskaya obl.)', 1500), -(11024, 149, 1052, 'Валуево', 'Valuevo', 1600), -(11025, 149, 1052, 'Вербилки', 'Verbilki', 1700), -(11026, 149, 1052, 'Верея', 'Vereya', 1800), -(11027, 149, 1052, 'Видное', 'Vidnoe', 1900), -(11028, 149, 1052, 'Внуково', 'Vnukovo', 2000), -(11029, 149, 1052, 'Вождь Пролетариата', 'Vozhd Proletariata', 2100), -(11030, 149, 1052, 'Волоколамск', 'Volokolamsk', 2200), -(11031, 149, 1052, 'Вороново', 'Voronovo', 2300), -(11032, 149, 1052, 'Воскресенск', 'Voskresensk', 2400), -(11033, 149, 1052, 'Восточный', 'Vostochnyi', 2500), -(11034, 149, 1052, 'Востряково', 'Vostryakovo', 2600), -(11035, 149, 1052, 'Высоковск', 'Vysokovsk', 2700), -(11036, 149, 1052, 'Голицыно (Московская обл.)', 'Golitsino (Moskovskaya obl.)', 2800), -(11037, 149, 1052, 'Деденево', 'Dedenevo', 2900), -(11038, 149, 1052, 'Дедовск', 'Dedovsk', 3000), -(11039, 149, 1052, 'Дзержинский', 'Dzerzhinskii', 3100), -(11040, 149, 1052, 'Дмитров', 'Dmitrov', 3200), -(11041, 149, 1052, 'Долгопрудный', 'Dolgoprudnyi', 3300), -(11042, 149, 1052, 'Домодедово', 'Domodedovo', 3400), -(11043, 149, 1052, 'Дорохово', 'Dorohovo', 3500), -(11044, 149, 1052, 'Дрезна', 'Drezna', 3600), -(11045, 149, 1052, 'Дубки', 'Dubki', 3700), -(11046, 149, 1052, 'Дубна', 'Dubna', 3800), -(11047, 149, 1052, 'Егорьевск', 'Egorevsk', 3900), -(11048, 149, 1052, 'Железнодорожный (Московск.)', 'Zheleznodorozhnyi (Moskovsk.)', 4000), -(11049, 149, 1052, 'Жилево', 'Zhilevo', 4100), -(11050, 149, 1052, 'Жуковка', 'Жуковка', 4200), -(11051, 149, 1052, 'Жуковский', 'Zhukovskii', 4300), -(11052, 149, 1052, 'Загорск', 'Zagorsk', 4400), -(11053, 149, 1052, 'Загорянский', 'Zagoryanskii', 4500), -(11054, 149, 1052, 'Запрудная', 'Zaprudnaya', 4600), -(11055, 149, 1052, 'Зарайск', 'Zaraisk', 4700), -(11056, 149, 1052, 'Звенигород', 'Zvenigorod', 4800), -(11057, 149, 1052, 'Зеленоград', 'Zelenograd', 4900), -(11058, 149, 1052, 'Ивантеевка (Московская обл.)', 'Ivanteevka (Moskovskaya obl.)', 5000), -(11059, 149, 1052, 'Икша', 'Iksha', 5100), -(11060, 149, 1052, 'Ильинский (Московская обл.)', 'Ilinskii (Moskovskaya obl.)', 5200), -(11061, 149, 1052, 'Истра', 'Istra', 5300), -(11062, 149, 1052, 'Калининец', 'Калининец', 5400), -(11063, 149, 1052, 'Кашира', 'Kashira', 5500), -(11064, 149, 1052, 'Керва', 'Kerva', 5600), -(11065, 149, 1052, 'Климовск', 'Klimovsk', 5700), -(11066, 149, 1052, 'Клин', 'Klin', 5800), -(11067, 149, 1052, 'Клязьма', 'Klyazma', 5900), -(11068, 149, 1052, 'Кожино', 'Kozhino', 6000), -(11069, 149, 1052, 'Кокошкино', 'Kokoshkino', 6100), -(11070, 149, 1052, 'Коломна', 'Kolomna', 6200), -(11071, 149, 1052, 'Колюбакино', 'Kolyubakino', 6300), -(11072, 149, 1052, 'Королев', 'Korolev', 6400), -(11073, 149, 1052, 'Косино', 'Kosino', 6500), -(11074, 149, 1052, 'Котельники', 'Kotelniki', 6600), -(11075, 149, 1052, 'Красково', 'Kraskovo', 6700), -(11076, 149, 1052, 'Красноармейск (Московская обл.)', 'Krasnoarmeisk (Moskovskaya obl.)', 6800), -(11077, 149, 1052, 'Красногорск', 'Krasnogorsk', 6900), -(11078, 149, 1052, 'Краснозаводск', 'Krasnozavodsk', 7000), -(11079, 149, 1052, 'Краснознаменск (Московская обл.)', 'Krasnoznamensk (Moskovskaya obl.)', 7100), -(11080, 149, 1052, 'Красный Ткач', 'Krasnyi Tkach', 7200), -(11081, 149, 1052, 'Крюково', 'Kryukovo', 7300), -(11082, 149, 1052, 'Кубинка', 'Kubinka', 7400), -(11083, 149, 1052, 'Купавна', 'Kupavna', 7500), -(11084, 149, 1052, 'Куровское', 'Kurovskoe', 7600), -(11085, 149, 1052, 'Лесной Городок', 'Lesnoi Gorodok', 7700), -(11086, 149, 1052, 'Ликино-Дулево', 'Likino-Dulevo', 7800), -(11087, 149, 1052, 'Лобня', 'Lobnya', 7900), -(11088, 149, 1052, 'Лопатинский', 'Lopatinskii', 8000), -(11089, 149, 1052, 'Лосино-Петровский', 'Losino-Petrovskii', 8100), -(11090, 149, 1052, 'Лотошино', 'Lotoshino', 8200), -(11091, 149, 1052, 'Лукино', 'Lukino', 8300), -(11092, 149, 1052, 'Луховицы', 'Luhovitsy', 8400), -(11093, 149, 1052, 'Лыткарино', 'Lytkarino', 8500), -(11094, 149, 1052, 'Львовский', 'Lvovskii', 8600), -(11095, 149, 1052, 'Люберцы', 'Lyubertsy', 8700), -(11096, 149, 1052, 'Малаховка', 'Malahovka', 8800), -(11097, 149, 1052, 'Михайловское', 'Mihailovskoe', 8900), -(11098, 149, 1052, 'Михнево', 'Mihnevo', 9000), -(11099, 149, 1052, 'Можайск', 'Mozhaisk', 9100), -(11100, 149, 1052, 'Монино', 'Monino', 9200), -(11101, 149, 1052, 'Москва', 'Moscow', 9300), -(11102, 149, 1052, 'Московский', 'Московский', 9400), -(11103, 149, 1052, 'Муханово', 'Muhanovo', 9500), -(11104, 149, 1052, 'Мытищи', 'Mytishchi', 9600), -(11105, 149, 1052, 'Нарофоминск', 'Narofominsk', 9700), -(11106, 149, 1052, 'Нахабино', 'Nahabino', 9800), -(11107, 149, 1052, 'Некрасовка', 'Nekrasovka', 9900), -(11108, 149, 1052, 'Немчиновка', 'Nemchinovka', 10000), -(11109, 149, 1052, 'Новобратцевский', 'Novobrattsevskii', 10100), -(11110, 149, 1052, 'Новоподрезково', 'Novopodrezkovo', 10200), -(11111, 149, 1052, 'Ногинск', 'Noginsk', 10300), -(11112, 149, 1052, 'Обухово', 'Obuhovo', 10400), -(11113, 149, 1052, 'Одинцово', 'Odintsovo', 10500), -(11114, 149, 1052, 'Ожерелье', 'Ozherele', 10600), -(11115, 149, 1052, 'Озеры', 'Ozery', 10700), -(11116, 149, 1052, 'Октябрьский (Московская обл.)', 'Oktyabrskii (Moskovskaya obl.)', 10800), -(11117, 149, 1052, 'Опалиха', 'Opaliha', 10900), -(11118, 149, 1052, 'Орехово-Зуево', 'Orehovo-Zuevo', 11000), -(11119, 149, 1052, 'Павловский Посад', 'Pavlovskii Posad', 11100), -(11120, 149, 1052, 'Первомайский (Московская обл.)', 'Pervomaiskii (Moskovskaya obl.)', 11200), -(11121, 149, 1052, 'Пески (Московская обл.)', 'Peski (Moskovskaya obl.)', 11300), -(11122, 149, 1052, 'Пироговский', 'Pirogovskii', 11400), -(11123, 149, 1052, 'Подольск', 'Podolsk', 11500), -(11124, 149, 1052, 'Полушкино', 'Polushkino', 11600), -(11125, 149, 1052, 'Правдинский', 'Pravdinskii', 11700), -(11126, 149, 1052, 'Привокзальный', 'Privokzalnyi', 11800), -(11127, 149, 1052, 'Пролетарский', 'Proletarskii', 11900), -(11128, 149, 1052, 'Протвино (Московская обл.)', 'Protvino (Moskovskaya obl.)', 12000), -(11129, 149, 1052, 'Пушкино', 'Pushkino', 12100), -(11130, 149, 1052, 'Пущино', 'Pushchino', 12200), -(11131, 149, 1052, 'Раменское', 'Ramenskoe', 12300), -(11132, 149, 1052, 'Реутов', 'Reutov', 12400), -(11133, 149, 1052, 'Решетниково', 'Reshetnikovo', 12500), -(11134, 149, 1052, 'Родники (Московская обл.)', 'Rodniki (Moskovskaya obl.)', 12600), -(11135, 149, 1052, 'Рошаль', 'Roshal', 12700), -(11136, 149, 1052, 'Рублево', 'Rublevo', 12800), -(11137, 149, 1052, 'Руза', 'Ruza', 12900), -(11138, 149, 1052, 'Салтыковка', 'Saltykovka', 13000), -(11139, 149, 1052, 'Северный', 'Severnyi', 13100), -(11140, 149, 1052, 'Сергиев Посад', 'Sergiev Posad', 13200), -(11141, 149, 1052, 'Серебряные Пруды', 'Serebryanye Prudy', 13300), -(11142, 149, 1052, 'Серпухов', 'Serpuhov', 13400), -(11143, 149, 1052, 'Солнечногорск', 'Solnechnogorsk', 13500), -(11144, 149, 1052, 'Солнцево', 'Solntsevo', 13600), -(11145, 149, 1052, 'Софрино', 'Sofrino', 13700), -(11146, 149, 1052, 'Старая Купавна', 'Staraya Kupavna', 13800), -(11147, 149, 1052, 'Старбеево', 'Starbeevo', 13900), -(11148, 149, 1052, 'Ступино', 'Stupino', 14000), -(11149, 149, 1052, 'Сходня', 'Shodnya', 14100), -(11150, 149, 1052, 'Талдом', 'Taldom', 14200), -(11151, 149, 1052, 'Текстильщик', 'Tekstilshchik', 14300), -(11152, 149, 1052, 'Темпы', 'Tempy', 14400), -(11153, 149, 1052, 'Томилино', 'Tomilino', 14500), -(11154, 149, 1052, 'Троицк', 'Troitsk', 14600), -(11155, 149, 1052, 'Туголесский Бор', 'Tugolesskii Bor', 14700), -(11156, 149, 1052, 'Тучково', 'Tuchkovo', 14800), -(11157, 149, 1052, 'Уваровка', 'Uvarovka', 14900), -(11158, 149, 1052, 'Удельная', 'Udelnaya', 15000), -(11159, 149, 1052, 'Успенское', 'Uspenskoe', 15100), -(11160, 149, 1052, 'Фирсановка', 'Firsanovka', 15200), -(11161, 149, 1052, 'Фрязино', 'Fryazino', 15300), -(11162, 149, 1052, 'Фряново', 'Fryanovo', 15400), -(11163, 149, 1052, 'Химки', 'Himki', 15500), -(11164, 149, 1052, 'Хотьково', 'Hotkovo', 15600), -(11165, 149, 1052, 'Черкизово', 'Cherkizovo', 15700), -(11166, 149, 1052, 'Черноголовка', 'Chernogolovka', 15800), -(11167, 149, 1052, 'Черусти', 'Cherusti', 15900), -(11168, 149, 1052, 'Чехов', 'Chehov', 16000), -(11169, 149, 1052, 'Шарапово', 'Sharapovo', 16100), -(11170, 149, 1052, 'Шатура', 'Shatura', 16200), -(11171, 149, 1052, 'Шатурторф', 'Shaturtorf', 16300), -(11172, 149, 1052, 'Шаховская', 'Shahovskaya', 16400), -(11173, 149, 1052, 'Шереметьевский', 'Sheremetevskii', 16500), -(11174, 149, 1052, 'Щелково', 'Shchelkovo', 16600), -(11175, 149, 1052, 'Щербинка', 'Shcherbinka', 16700), -(11176, 149, 1052, 'Электрогорск', 'Elektrogorsk', 16800), -(11177, 149, 1052, 'Электросталь', 'Elektrostal', 16900), -(11178, 149, 1052, 'Электроугли', 'Elektrougli', 17000), -(11179, 149, 1052, 'Юбилейный (Московская обл.)', 'Uybileyniy', 17100), -(11180, 149, 1052, 'Яхрома', 'Yahroma', 17200), -(11181, 149, 1053, 'Апатиты', 'Apatity', 100), -(11182, 149, 1053, 'Африканда', 'Afrikanda', 200), -(11183, 149, 1053, 'Верхнетуломский', 'Verhnetulomskii', 300), -(11184, 149, 1053, 'Видяево', 'Видяево', 400), -(11185, 149, 1053, 'Гаджиево', 'Gadjievo', 500), -(11186, 149, 1053, 'Заозерск', 'Zaozersk', 600), -(11187, 149, 1053, 'Заполярный', 'Zapolyarnyi', 700), -(11188, 149, 1053, 'Зареченск', 'Zarechensk', 800), -(11189, 149, 1053, 'Зашеек', 'Zasheek', 900), -(11190, 149, 1053, 'Зеленоборский', 'Zelenoborskii', 1000), -(11191, 149, 1053, 'Кандалакша', 'Kandalaksha', 1100), -(11192, 149, 1053, 'Кильдинстрой', 'Kildinstroi', 1200), -(11193, 149, 1053, 'Кировск', 'Kirovsk', 1300), -(11194, 149, 1053, 'Ковдор', 'Kovdor', 1400), -(11195, 149, 1053, 'Кола', 'Kola', 1500), -(11196, 149, 1053, 'Конда', 'Konda', 1600), -(11197, 149, 1053, 'Ловозеро', 'Lovozero', 1700), -(11198, 149, 1053, 'Мончегорск', 'Monchegorsk', 1800), -(11199, 149, 1053, 'Мурманск', 'Murmansk', 1900), -(11200, 149, 1053, 'Мурмаши', 'Murmashi', 2000), -(11201, 149, 1053, 'Никель', 'Nikel', 2100), -(11202, 149, 1053, 'Оленегорск', 'Olenegorsk', 2200), -(11203, 149, 1053, 'Полярные Зори', 'Polyarnye Zori', 2300), -(11204, 149, 1053, 'Полярный', 'Polyarnyi', 2400), -(11205, 149, 1053, 'Ревда (Мурманская обл.)', 'Revda (Murmanskaya obl.)', 2500), -(11206, 149, 1053, 'Североморск', 'Severomorsk', 2600), -(11207, 149, 1053, 'Снежногорск', 'Snezhnogorsk', 2700), -(11208, 149, 1053, 'Умба', 'Umba', 2800), -(11209, 149, 1054, 'Ардатов', 'Ardatov', 100), -(11210, 149, 1054, 'Арзамас', 'Arzamas', 200), -(11211, 149, 1054, 'Арья', 'Arya', 300), -(11212, 149, 1054, 'Балахна', 'Balahna', 400), -(11213, 149, 1054, 'Богородск', 'Bogorodsk', 500), -(11214, 149, 1054, 'Большереченск', 'Bolsherechensk', 600); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(11215, 149, 1054, 'Большое Болдино', 'Bolshoe Boldino', 700), -(11216, 149, 1054, 'Большое Козино', 'Bolshoe Kozino', 800), -(11217, 149, 1054, 'Большое Мурашкино', 'Bolshoe Murashkino', 900), -(11218, 149, 1054, 'Большое Пикино', 'Bolshoe Pikino', 1000), -(11219, 149, 1054, 'Бор', 'Bor', 1100), -(11220, 149, 1054, 'Бутурлино', 'Buturlino', 1200), -(11221, 149, 1054, 'Вад', 'Vad', 1300), -(11222, 149, 1054, 'Варнавино', 'Varnavino', 1400), -(11223, 149, 1054, 'Васильсурск', 'Vasilsursk', 1500), -(11224, 149, 1054, 'Вахтан', 'Vahtan', 1600), -(11225, 149, 1054, 'Вача', 'Vacha', 1700), -(11226, 149, 1054, 'Ветлуга', 'Vetluga', 1800), -(11227, 149, 1054, 'Виля', 'Vilya', 1900), -(11228, 149, 1054, 'Вознесенское', 'Voznesenskoe', 2000), -(11229, 149, 1054, 'Володарск', 'Volodarsk', 2100), -(11230, 149, 1054, 'Воротынец', 'Vorotynets', 2200), -(11231, 149, 1054, 'Ворсма', 'Vorsma', 2300), -(11232, 149, 1054, 'Воскресенское', 'Voskresenskoe', 2400), -(11233, 149, 1054, 'Выездное', 'Vyezdnoe', 2500), -(11234, 149, 1054, 'Выкса', 'Vyksa', 2600), -(11235, 149, 1054, 'Гагино', 'Gagino', 2700), -(11236, 149, 1054, 'Гидроторф', 'Gidrotorf', 2800), -(11237, 149, 1054, 'Горбатов', 'Gorbatov', 2900), -(11238, 149, 1054, 'Горбатовка', 'Gorbatovka', 3000), -(11239, 149, 1054, 'Городец', 'Gorodets', 3100), -(11240, 149, 1054, 'Дальнее Константиново', 'Dalnee Konstantinovo', 3200), -(11241, 149, 1054, 'Дзержинск', 'Dzerzhinsk', 3300), -(11242, 149, 1054, 'Дивеево', 'Diveevo', 3400), -(11243, 149, 1054, 'Досчатое', 'Doschatoe', 3500), -(11244, 149, 1054, 'Заволжье', 'Zavolzhe', 3600), -(11245, 149, 1054, 'Керженец', 'Kerzhenets', 3700), -(11246, 149, 1054, 'Княгинино', 'Knyaginino', 3800), -(11247, 149, 1054, 'Ковернино', 'Kovernino', 3900), -(11248, 149, 1054, 'Красные Баки', 'Krasnye Baki', 4000), -(11249, 149, 1054, 'Кстово', 'Kstovo', 4100), -(11250, 149, 1054, 'Кулебаки', 'Kulebaki', 4200), -(11251, 149, 1054, 'Лукоянов', 'Lukoyanov', 4300), -(11252, 149, 1054, 'Лысково', 'Lyskovo', 4400), -(11253, 149, 1054, 'Навашино', 'Navashino', 4500), -(11254, 149, 1054, 'Нижний Новгород', 'Nizhnii Novgorod', 4600), -(11255, 149, 1054, 'Новосмолинский', 'Новосмолинский', 4700), -(11256, 149, 1054, 'Павлово', 'Pavlovo', 4800), -(11257, 149, 1054, 'Первомайск', 'Pervomaisk', 4900), -(11258, 149, 1054, 'Перевоз', 'Perevoz', 5000), -(11259, 149, 1054, 'Пильна', 'Pilna', 5100), -(11260, 149, 1054, 'Починки', 'Pochinki', 5200), -(11261, 149, 1054, 'Саров (Нижегородская обл.)', 'Sarov (Nizhegorodskaya obl.)', 5300), -(11262, 149, 1054, 'Семенов', 'Semenov', 5400), -(11263, 149, 1054, 'Сергач', 'Sergach', 5500), -(11264, 149, 1054, 'Сеченово', 'Sechenovo', 5600), -(11265, 149, 1054, 'Сосновское', 'Sosnovskoe', 5700), -(11266, 149, 1054, 'Спасское', 'Spasskoe', 5800), -(11267, 149, 1054, 'Тонкино', 'Tonkino', 5900), -(11268, 149, 1054, 'Тоншаево', 'Tonshaevo', 6000), -(11269, 149, 1054, 'Уразовка', 'Urazovka', 6100), -(11270, 149, 1054, 'Урень', 'Uren', 6200), -(11271, 149, 1054, 'Чкаловск', 'Chkalovsk', 6300), -(11272, 149, 1054, 'Шаранга', 'Sharanga', 6400), -(11273, 149, 1054, 'Шатки', 'Shatki', 6500), -(11274, 149, 1054, 'Шахунья', 'Shahunya', 6600), -(11275, 149, 1055, 'Анциферово', 'Antsiferovo', 100), -(11276, 149, 1055, 'Батецкий', 'Batetskii', 200), -(11277, 149, 1055, 'Большая Вишера', 'Bolshaya Vishera', 300), -(11278, 149, 1055, 'Боровичи', 'Borovichi', 400), -(11279, 149, 1055, 'Валдай', 'Valdai', 500), -(11280, 149, 1055, 'Великий Новгород (Новгород)', 'Velikii Novgorod (Novgorod)', 600), -(11281, 149, 1055, 'Волот', 'Volot', 700), -(11282, 149, 1055, 'Деманск', 'Demansk', 800), -(11283, 149, 1055, 'Зарубино', 'Zarubino', 900), -(11284, 149, 1055, 'Крестцы', 'Kresttsy', 1000), -(11285, 149, 1055, 'Любытино', 'Lyubytino', 1100), -(11286, 149, 1055, 'Малая Вишера', 'Malaya Vishera', 1200), -(11287, 149, 1055, 'Марево', 'Marevo', 1300), -(11288, 149, 1055, 'Мошенское', 'Moshenskoe', 1400), -(11289, 149, 1055, 'Окуловка', 'Okulovka', 1500), -(11290, 149, 1055, 'Парфино', 'Parfino', 1600), -(11291, 149, 1055, 'Пестово', 'Pestovo', 1700), -(11292, 149, 1055, 'Поддорье', 'Poddore', 1800), -(11293, 149, 1055, 'Сольцы', 'Soltsy', 1900), -(11294, 149, 1055, 'Старая Русса', 'Staraya Russa', 2000), -(11295, 149, 1055, 'Хвойная', 'Hvoinaя', 2100), -(11296, 149, 1055, 'Холм', 'Holm', 2200), -(11297, 149, 1055, 'Чудово', 'Chudovo', 2300), -(11298, 149, 1055, 'Шимск', 'Shimsk', 2400), -(11299, 149, 1056, 'Баган', 'Bagan', 100), -(11300, 149, 1056, 'Барабинск', 'Barabinsk', 200), -(11301, 149, 1056, 'Бердск', 'Berdsk', 300), -(11302, 149, 1056, 'Биаза', 'Biaza', 400), -(11303, 149, 1056, 'Болотное', 'Bolotnoe', 500), -(11304, 149, 1056, 'Венгерово', 'Vengerovo', 600), -(11305, 149, 1056, 'Довольное', 'Dovolnoe', 700), -(11306, 149, 1056, 'Завьялово', 'Zavyalovo', 800), -(11307, 149, 1056, 'Искитим', 'Iskitim', 900), -(11308, 149, 1056, 'Карасук', 'Karasuk', 1000), -(11309, 149, 1056, 'Каргат', 'Kargat', 1100), -(11310, 149, 1056, 'Колывань', 'Kolyvan', 1200), -(11311, 149, 1056, 'Краснозерское', 'Krasnozerskoe', 1300), -(11312, 149, 1056, 'Крутиха', 'Krutiha', 1400), -(11313, 149, 1056, 'Куйбышев (Новосибирская обл.)', 'Kuibyshev (Novosibirskaya obl.)', 1500), -(11314, 149, 1056, 'Купино', 'Kupino', 1600), -(11315, 149, 1056, 'Кыштовка', 'Kyshtovka', 1700), -(11316, 149, 1056, 'Маслянино', 'Maslyanino', 1800), -(11317, 149, 1056, 'Мошково', 'Moshkovo', 1900), -(11318, 149, 1056, 'Новосибирск', 'Novosibirsk', 2000), -(11319, 149, 1056, 'Норильск', 'Норильск', 2100), -(11320, 149, 1056, 'Обь', 'Обь', 2200), -(11321, 149, 1056, 'Ордынское', 'Ordynskoe', 2300), -(11322, 149, 1056, 'Северное', 'Severnoe', 2400), -(11323, 149, 1056, 'Сузун', 'Suzun', 2500), -(11324, 149, 1056, 'Татарск', 'Tatarsk', 2600), -(11325, 149, 1056, 'Тогучин', 'Toguchin', 2700), -(11326, 149, 1056, 'Убинское', 'Ubinskoe', 2800), -(11327, 149, 1056, 'Усть-Тарка', 'Ust-Tarka', 2900), -(11328, 149, 1056, 'Чаны', 'Chany', 3000), -(11329, 149, 1056, 'Черепаново', 'Cherepanovo', 3100), -(11330, 149, 1056, 'Чистоозерное', 'Chistoozernoe', 3200), -(11331, 149, 1056, 'Чулым', 'Chulym', 3300), -(11332, 149, 1057, 'Береговой', 'Beregovoi', 100), -(11333, 149, 1057, 'Большеречье', 'Bolshereche', 200), -(11334, 149, 1057, 'Большие Уки', 'Bolshie Uki', 300), -(11335, 149, 1057, 'Горьковское', 'Gorkovskoe', 400), -(11336, 149, 1057, 'Знаменское (Омская обл.)', 'Znamenskoe (Omskaya obl.)', 500), -(11337, 149, 1057, 'Исилькуль', 'Isilkul', 600), -(11338, 149, 1057, 'Калачинск', 'Kalachinsk', 700), -(11339, 149, 1057, 'Колосовка', 'Kolosovka', 800), -(11340, 149, 1057, 'Кормиловка', 'Kormilovka', 900), -(11341, 149, 1057, 'Крутинка', 'Krutinka', 1000), -(11342, 149, 1057, 'Любинский', 'Lyubinskii', 1100), -(11343, 149, 1057, 'Марьяновка', 'Maryanovka', 1200), -(11344, 149, 1057, 'Муромцево', 'Muromtsevo', 1300), -(11345, 149, 1057, 'Называевск', 'Nazyvaevsk', 1400), -(11346, 149, 1057, 'Нижняя Омка', 'Nizhnyaya Omka', 1500), -(11347, 149, 1057, 'Нововаршавка', 'Novovarshavka', 1600), -(11348, 149, 1057, 'Одесское', 'Odesskoe', 1700), -(11349, 149, 1057, 'Оконешниково', 'Okoneshnikovo', 1800), -(11350, 149, 1057, 'Омск', 'Omsk', 1900), -(11351, 149, 1057, 'Павлоградка', 'Pavlogradka', 2000), -(11352, 149, 1057, 'Полтавка', 'Poltavka', 2100), -(11353, 149, 1057, 'Русская Поляна', 'Russkaya Polyana', 2200), -(11354, 149, 1057, 'Саргатское', 'Sargatskoe', 2300), -(11355, 149, 1057, 'Седельниково', 'Sedelnikovo', 2400), -(11356, 149, 1057, 'Таврическое', 'Tavricheskoe', 2500), -(11357, 149, 1057, 'Тара', 'Tara', 2600), -(11358, 149, 1057, 'Тевриз', 'Tevriz', 2700), -(11359, 149, 1057, 'Тюкалинск', 'Tyukalinsk', 2800), -(11360, 149, 1057, 'Усть-Ишим', 'Ust-Ishim', 2900), -(11361, 149, 1057, 'Черлак', 'Cherlak', 3000), -(11362, 149, 1057, 'Шербакуль', 'Sherbakul', 3100), -(11363, 149, 1058, 'Абдулино', 'Abdulino', 100), -(11364, 149, 1058, 'Адамовка', 'Adamovka', 200), -(11365, 149, 1058, 'Айдырлинский', 'Aidyrlinskii', 300), -(11366, 149, 1058, 'Акбулак', 'Akbulak', 400), -(11367, 149, 1058, 'Аккермановка', 'Akkermanovka', 500), -(11368, 149, 1058, 'Асекеево', 'Asekeevo', 600), -(11369, 149, 1058, 'Беляевка', 'Belyaevka', 700), -(11370, 149, 1058, 'Бугуруслан', 'Buguruslan', 800), -(11371, 149, 1058, 'Бузулук', 'Buzuluk', 900), -(11372, 149, 1058, 'Гай', 'Gai', 1000), -(11373, 149, 1058, 'Грачевка', 'Grachevka', 1100), -(11374, 149, 1058, 'Домбаровский', 'Dombarovskii', 1200), -(11375, 149, 1058, 'Дубенский', 'Dubenskii', 1300), -(11376, 149, 1058, 'Илек', 'Ilek', 1400), -(11377, 149, 1058, 'Ириклинский', 'Iriklinskii', 1500), -(11378, 149, 1058, 'Кувандык', 'Kuvandyk', 1600), -(11379, 149, 1058, 'Курманаевка', 'Kurmanaevka', 1700), -(11380, 149, 1058, 'Матвеевка', 'Matveevka', 1800), -(11381, 149, 1058, 'Медногорск', 'Mednogorsk', 1900), -(11382, 149, 1058, 'Новоорск', 'Novoorsk', 2000), -(11383, 149, 1058, 'Новосергиевка', 'Novosergievka', 2100), -(11384, 149, 1058, 'Новотроицк', 'Novotroitsk', 2200), -(11385, 149, 1058, 'Октябрьское (Оренбург.)', 'Oktyabrskoe (Orenburg.)', 2300), -(11386, 149, 1058, 'Оренбург', 'Orenburg', 2400), -(11387, 149, 1058, 'Орск', 'Orsk', 2500), -(11388, 149, 1058, 'Первомайский (Оренбург.)', 'Pervomaiskii (Orenburg.)', 2600), -(11389, 149, 1058, 'Переволоцкий', 'Perevolotskii', 2700), -(11390, 149, 1058, 'Пономаревка', 'Ponomarevka', 2800), -(11391, 149, 1058, 'Саракташ', 'Saraktash', 2900), -(11392, 149, 1058, 'Светлый (Оренбургская обл.)', 'Svetlyi (Orenburgskaya obl.)', 3000), -(11393, 149, 1058, 'Северное', 'Severnoe', 3100), -(11394, 149, 1058, 'Соль-Илецк', 'Sol-Iletsk', 3200), -(11395, 149, 1058, 'Сорочинск', 'Sorochinsk', 3300), -(11396, 149, 1058, 'Ташла', 'Tashla', 3400), -(11397, 149, 1058, 'Тоцкое', 'Totskoe', 3500), -(11398, 149, 1058, 'Тюльган', 'Tyulgan', 3600), -(11399, 149, 1058, 'Шарлык', 'Sharlyk', 3700), -(11400, 149, 1058, 'Энергетик', 'Energetik', 3800), -(11401, 149, 1058, 'Ясный', 'Yasnyi', 3900), -(11402, 149, 1059, 'Болхов', 'Bolhov', 100), -(11403, 149, 1059, 'Верховье', 'Verhove', 200), -(11404, 149, 1059, 'Глазуновка', 'Glazunovka', 300), -(11405, 149, 1059, 'Дмитровск-Орловский', 'Dmitrovsk-Orlovskii', 400), -(11406, 149, 1059, 'Долгое', 'Dolgoe', 500), -(11407, 149, 1059, 'Залегощь', 'Zalegoshch', 600), -(11408, 149, 1059, 'Змиевка', 'Zmievka', 700), -(11409, 149, 1059, 'Знаменское (Орловская обл.)', 'Znamenskoe (Orlovskaya obl.)', 800), -(11410, 149, 1059, 'Колпны', 'Kolpny', 900), -(11411, 149, 1059, 'Красная Заря', 'Krasnaya Zarya', 1000), -(11412, 149, 1059, 'Кромы', 'Kromy', 1100), -(11413, 149, 1059, 'Ливны', 'Livny', 1200), -(11414, 149, 1059, 'Малоархангельск', 'Maloarhangelsk', 1300), -(11415, 149, 1059, 'Мценск', 'Mtsensk', 1400), -(11416, 149, 1059, 'Нарышкино', 'Naryshkino', 1500), -(11417, 149, 1059, 'Новосиль', 'Novosil', 1600), -(11418, 149, 1059, 'Орел', 'Orel', 1700), -(11419, 149, 1059, 'Покровское', 'Pokrovskoe', 1800), -(11420, 149, 1059, 'Сосково', 'Soskovo', 1900), -(11421, 149, 1059, 'Тросна', 'Trosna', 2000), -(11422, 149, 1059, 'Хомутово', 'Homutovo', 2100), -(11423, 149, 1059, 'Хотынец', 'Hotynets', 2200), -(11424, 149, 1059, 'Шаблыкино', 'Shablykino', 2300), -(11425, 149, 1060, 'Башмаково', 'Bashmakovo', 100), -(11426, 149, 1060, 'Беднодемьяновск', 'Bednodemyanovsk', 200), -(11427, 149, 1060, 'Беково', 'Bekovo', 300), -(11428, 149, 1060, 'Белинский', 'Belinskii', 400), -(11429, 149, 1060, 'Бессоновка', 'Bessonovka', 500), -(11430, 149, 1060, 'Вадинск', 'Vadinsk', 600), -(11431, 149, 1060, 'Верхозим', 'Verhozim', 700), -(11432, 149, 1060, 'Городище (Пензенская обл.)', 'Gorodishche (Penzenskaya obl.)', 800), -(11433, 149, 1060, 'Евлашево', 'Evlashevo', 900), -(11434, 149, 1060, 'Заречный (Пензенская обл.)', 'Zarechnyi (Penzenskaya obl.)', 1000), -(11435, 149, 1060, 'Земетчино', 'Zemetchino', 1100), -(11436, 149, 1060, 'Золотаревка', 'Zolotarevka', 1200), -(11437, 149, 1060, 'Исса', 'Issa', 1300), -(11438, 149, 1060, 'Каменка', 'Kamenka', 1400), -(11439, 149, 1060, 'Колышлей', 'Kolyshlei', 1500), -(11440, 149, 1060, 'Кондоль', 'Kondol', 1600), -(11441, 149, 1060, 'Кузнецк', 'Kuznetsk', 1700), -(11442, 149, 1060, 'Лопатино', 'Lopatino', 1800), -(11443, 149, 1060, 'Малая Сердоба', 'Malaya Serdoba', 1900), -(11444, 149, 1060, 'Мокшан', 'Mokshan', 2000), -(11445, 149, 1060, 'Наровчат', 'Narovchat', 2100), -(11446, 149, 1060, 'Неверкино', 'Neverkino', 2200), -(11447, 149, 1060, 'Нижний Ломов', 'Nizhnii Lomov', 2300), -(11448, 149, 1060, 'Никольск (Пензенская обл.)', 'Nikolsk (Penzenskaya obl.)', 2400), -(11449, 149, 1060, 'Пачелма', 'Pachelma', 2500), -(11450, 149, 1060, 'Пенза', 'Penza', 2600), -(11451, 149, 1060, 'Русский Камешкир', 'Russkii Kameshkir', 2700), -(11452, 149, 1060, 'Сердобск', 'Serdobsk', 2800), -(11453, 149, 1060, 'Сосновоборск', 'Sosnovoborsk', 2900), -(11454, 149, 1060, 'Сура', 'Sura', 3000), -(11455, 149, 1060, 'Тамала', 'Tamala', 3100), -(11456, 149, 1060, 'Шемышейка', 'Shemysheika', 3200), -(11457, 149, 1061, 'Александровск', 'Aleksandrovsk', 100), -(11458, 149, 1061, 'Барда', 'Barda', 200), -(11459, 149, 1061, 'Березники', 'Berezniki', 300), -(11460, 149, 1061, 'Большая Соснова', 'Bolshaya Sosnova', 400), -(11461, 149, 1061, 'Верещагино', 'Vereshchagino', 500), -(11462, 149, 1061, 'Гайны', 'Gainy', 600), -(11463, 149, 1061, 'Горнозаводск (Пермский край)', 'Gornozavodsk (Permskiy kray)', 700), -(11464, 149, 1061, 'Гремячинск', 'Gremyachinsk', 800), -(11465, 149, 1061, 'Губаха', 'Gubaha', 900), -(11466, 149, 1061, 'Добрянка', 'Dobryanka', 1000), -(11467, 149, 1061, 'Елово', 'Elovo', 1100), -(11468, 149, 1061, 'Зюкайка', 'Zyukaika', 1200), -(11469, 149, 1061, 'Ильинский (Пермская обл.)', 'Ilinskii (Permskaya obl.)', 1300), -(11470, 149, 1061, 'Карагай', 'Karagai', 1400), -(11471, 149, 1061, 'Керчевский', 'Kerchevskii', 1500), -(11472, 149, 1061, 'Кизел', 'Kizel', 1600), -(11473, 149, 1061, 'Коса', 'Kosa', 1700), -(11474, 149, 1061, 'Кочево', 'Kochevo', 1800), -(11475, 149, 1061, 'Красновишерск', 'Krasnovishersk', 1900), -(11476, 149, 1061, 'Краснокамск', 'Krasnokamsk', 2000), -(11477, 149, 1061, 'Кудымкар', 'Kudymkar', 2100), -(11478, 149, 1061, 'Куеда', 'Kueda', 2200), -(11479, 149, 1061, 'Кунгур', 'Kungur', 2300), -(11480, 149, 1061, 'Лысьва', 'Lysva', 2400), -(11481, 149, 1061, 'Ныроб', 'Nyrob', 2500), -(11482, 149, 1061, 'Нытва', 'Nytva', 2600), -(11483, 149, 1061, 'Октябрьский', 'Oktyabrskii', 2700), -(11484, 149, 1061, 'Орда', 'Orda', 2800), -(11485, 149, 1061, 'Оса', 'Osa', 2900), -(11486, 149, 1061, 'Оханск', 'Ohansk', 3000), -(11487, 149, 1061, 'Очер', 'Ocher', 3100), -(11488, 149, 1061, 'Пермь', 'Perm', 3200), -(11489, 149, 1061, 'Соликамск', 'Solikamsk', 3300), -(11490, 149, 1061, 'Суксун', 'Suksun', 3400), -(11491, 149, 1061, 'Уинское', 'Uinskoe', 3500), -(11492, 149, 1061, 'Усолье', 'Usole', 3600), -(11493, 149, 1061, 'Усть-Кишерть', 'Ust-Kishert', 3700), -(11494, 149, 1061, 'Чайковский', 'Chaikovskii', 3800), -(11495, 149, 1061, 'Частые', 'Chastye', 3900), -(11496, 149, 1061, 'Чердынь', 'Cherdyn', 4000), -(11497, 149, 1061, 'Чернореченский', 'Chernorechenskii', 4100), -(11498, 149, 1061, 'Чернушка', 'Chernushka', 4200), -(11499, 149, 1061, 'Чусовой', 'Chusovoi', 4300), -(11500, 149, 1061, 'Юрла', 'Yurla', 4400), -(11501, 149, 1061, 'Юсьва', 'Yusva', 4500), -(11502, 149, 1062, 'Анучино', 'Anuchino', 100), -(11503, 149, 1062, 'Арсеньев', 'Arsenev', 200), -(11504, 149, 1062, 'Артем', 'Artem', 300), -(11505, 149, 1062, 'Артемовский (Приморский край)', 'Artemovskii (Primorskii krai)', 400), -(11506, 149, 1062, 'Большой Камень', 'Bolshoi Kamen', 500), -(11507, 149, 1062, 'Валентин', 'Valentin', 600), -(11508, 149, 1062, 'Владивосток', 'Vladivostok', 700), -(11509, 149, 1062, 'Высокогорск', 'Vysokogorsk', 800), -(11510, 149, 1062, 'Горные Ключи', 'Gornye Klyuchi', 900), -(11511, 149, 1062, 'Горный', 'Gornyi', 1000), -(11512, 149, 1062, 'Дальнегорск', 'Dalnegorsk', 1100), -(11513, 149, 1062, 'Дальнереченск', 'Dalnerechensk', 1200), -(11514, 149, 1062, 'Зарубино', 'Zarubino', 1300), -(11515, 149, 1062, 'Кавалерово', 'Kavalerovo', 1400), -(11516, 149, 1062, 'Каменка (Приморский край)', 'Kamenka (Primorskii krai)', 1500), -(11517, 149, 1062, 'Камень-Рыболов', 'Kamen-Rybolov', 1600), -(11518, 149, 1062, 'Кировский', 'Kirovskii', 1700), -(11519, 149, 1062, 'Лазо', 'Lazo', 1800), -(11520, 149, 1062, 'Лесозаводск', 'Lesozavodsk', 1900), -(11521, 149, 1062, 'Лучегорск', 'Luchegorsk', 2000), -(11522, 149, 1062, 'Михайловка (Приморский край)', 'Mihailovka (Primorskii krai)', 2100), -(11523, 149, 1062, 'Находка (Приморский край)', 'Nahodka (Primorskii krai)', 2200), -(11524, 149, 1062, 'Новопокровка', 'Novopokrovka', 2300), -(11525, 149, 1062, 'Ольга', 'Olga', 2400), -(11526, 149, 1062, 'Партизанск', 'Partizansk', 2500), -(11527, 149, 1062, 'Пластун', 'Пластун', 2600), -(11528, 149, 1062, 'Пограничный', 'Pogranichnyi', 2700), -(11529, 149, 1062, 'Покровка', 'Pokrovka', 2800), -(11530, 149, 1062, 'Посьет', 'Посьет', 2900), -(11531, 149, 1062, 'Русский', 'Russkii', 3000), -(11532, 149, 1062, 'Славянка', 'Slavyanka', 3100), -(11533, 149, 1062, 'Спасск-Дальний', 'Spassk-Dalnii', 3200), -(11534, 149, 1062, 'Терней', 'Ternei', 3300), -(11535, 149, 1062, 'Уссурийск', 'Ussuriisk', 3400), -(11536, 149, 1062, 'Фокино', 'Fokino', 3500), -(11537, 149, 1062, 'Хасан', 'Hasan', 3600), -(11538, 149, 1062, 'Хороль', 'Horol', 3700), -(11539, 149, 1062, 'Черниговка', 'Chernigovka', 3800), -(11540, 149, 1062, 'Чугуевка', 'Chuguevka', 3900), -(11541, 149, 1062, 'Яковлевка', 'Yakovlevka', 4000), -(11542, 149, 1062, 'Ярославский', 'Yaroslavskii', 4100), -(11543, 149, 1063, 'Бежаницы', 'Bezhanitsy', 100), -(11544, 149, 1063, 'Великие Луки', 'Velikie Luki', 200), -(11545, 149, 1063, 'Гдов', 'Gdov', 300), -(11546, 149, 1063, 'Дедовичи', 'Dedovichi', 400), -(11547, 149, 1063, 'Дно', 'Dno', 500), -(11548, 149, 1063, 'Заплюсье', 'Zaplyuse', 600), -(11549, 149, 1063, 'Идрица', 'Idritsa', 700), -(11550, 149, 1063, 'Красногородское', 'Krasnogorodskoe', 800), -(11551, 149, 1063, 'Кунья', 'Kunya', 900), -(11552, 149, 1063, 'Локня', 'Loknya', 1000), -(11553, 149, 1063, 'Невель', 'Nevel', 1100), -(11554, 149, 1063, 'Новоржев', 'Novorzhev', 1200), -(11555, 149, 1063, 'Новосокольники', 'Novosokolniki', 1300), -(11556, 149, 1063, 'Опочка', 'Opochka', 1400), -(11557, 149, 1063, 'Остров', 'Ostrov', 1500), -(11558, 149, 1063, 'Палкино', 'Palkino', 1600), -(11559, 149, 1063, 'Печоры', 'Pechory', 1700), -(11560, 149, 1063, 'Плюсса', 'Plyussa', 1800), -(11561, 149, 1063, 'Порхов', 'Porhov', 1900), -(11562, 149, 1063, 'Псков', 'Pskov', 2000), -(11563, 149, 1063, 'Пустошка', 'Pustoshka', 2100), -(11564, 149, 1063, 'Пушкинские Горы', 'Pushkinskie Gory', 2200), -(11565, 149, 1063, 'Пыталово', 'Pytalovo', 2300), -(11566, 149, 1063, 'Себеж', 'Sebezh', 2400), -(11567, 149, 1063, 'Струги-Красные', 'Strugi-Krasnye', 2500), -(11568, 149, 1063, 'Усвяты', 'Usvyaty', 2600), -(11569, 149, 1064, 'Азов', 'Azov', 100), -(11570, 149, 1064, 'Аксай (Ростовская обл.)', 'Aksai (Rostovskaya obl.)', 200), -(11571, 149, 1064, 'Алмазный', 'Almaznyi', 300), -(11572, 149, 1064, 'Аютинск', 'Ayutinsk', 400), -(11573, 149, 1064, 'Багаевский', 'Bagaevskii', 500), -(11574, 149, 1064, 'Батайск', 'Bataisk', 600), -(11575, 149, 1064, 'Белая Калитва', 'Belaya Kalitva', 700), -(11576, 149, 1064, 'Боковская', 'Bokovskaya', 800), -(11577, 149, 1064, 'Большая Мартыновка', 'Bolshaya Martynovka', 900), -(11578, 149, 1064, 'Вешенская', 'Veshenskaya', 1000), -(11579, 149, 1064, 'Волгодонск', 'Volgodonsk', 1100), -(11580, 149, 1064, 'Восход', 'Voshod', 1200), -(11581, 149, 1064, 'Гигант', 'Gigant', 1300), -(11582, 149, 1064, 'Горняцкий', 'Gornyatskii', 1400), -(11583, 149, 1064, 'Гуково', 'Gukovo', 1500), -(11584, 149, 1064, 'Донецк', 'Donetsk', 1600), -(11585, 149, 1064, 'Донской (Ростовская обл.)', 'Donskoi (Rostovskaya obl.)', 1700), -(11586, 149, 1064, 'Дубовское', 'Dubovskoe', 1800), -(11587, 149, 1064, 'Егорлыкская', 'Egorlykskaya', 1900), -(11588, 149, 1064, 'Жирнов', 'Zhirnov', 2000), -(11589, 149, 1064, 'Заветное', 'Zavetnoe', 2100), -(11590, 149, 1064, 'Заводской', 'Zavodskoi', 2200), -(11591, 149, 1064, 'Зверево', 'Zverevo', 2300), -(11592, 149, 1064, 'Зерноград', 'Zernograd', 2400), -(11593, 149, 1064, 'Зимовники', 'Zimovniki', 2500), -(11594, 149, 1064, 'Кагальницкая', 'Kagalnitskaya', 2600), -(11595, 149, 1064, 'Казанская', 'Kazanskaya', 2700), -(11596, 149, 1064, 'Каменоломни', 'Kamenolomni', 2800), -(11597, 149, 1064, 'Каменск-Шахтинский', 'Kamensk-Shahtinskii', 2900), -(11598, 149, 1064, 'Кашары', 'Kashary', 3000), -(11599, 149, 1064, 'Коксовый', 'Koksovyi', 3100), -(11600, 149, 1064, 'Константиновск', 'Konstantinovsk', 3200), -(11601, 149, 1064, 'Красный Сулин', 'Krasnyi Sulin', 3300), -(11602, 149, 1064, 'Куйбышево', 'Kuibyshevo', 3400), -(11603, 149, 1064, 'Матвеев Курган', 'Matveev Kurgan', 3500), -(11604, 149, 1064, 'Мигулинская', 'Migulinskaya', 3600), -(11605, 149, 1064, 'Миллерово', 'Millerovo', 3700), -(11606, 149, 1064, 'Милютинская', 'Milyutinskaya', 3800), -(11607, 149, 1064, 'Морозовск', 'Morozovsk', 3900), -(11608, 149, 1064, 'Новочеркасск', 'Novocherkassk', 4000), -(11609, 149, 1064, 'Новошахтинск', 'Novoshahtinsk', 4100), -(11610, 149, 1064, 'Обливская', 'Oblivskaya', 4200), -(11611, 149, 1064, 'Орловский', 'Orlovskii', 4300), -(11612, 149, 1064, 'Песчанокопское', 'Peschanokopskoe', 4400), -(11613, 149, 1064, 'Покровское', 'Pokrovskoe', 4500), -(11614, 149, 1064, 'Пролетарск', 'Proletarsk', 4600), -(11615, 149, 1064, 'Ремонтное', 'Remontnoe', 4700), -(11616, 149, 1064, 'Родионово-Несветайская', 'Rodionovo-Nesvetaiskaya', 4800), -(11617, 149, 1064, 'Ростов-на-Дону', 'Rostov-na-Donu', 4900), -(11618, 149, 1064, 'Сальск', 'Salsk', 5000), -(11619, 149, 1064, 'Семикаракорск', 'Semikarakorsk', 5100), -(11620, 149, 1064, 'Таганрог', 'Taganrog', 5200), -(11621, 149, 1064, 'Тарасовский', 'Tarasovskii', 5300), -(11622, 149, 1064, 'Тацинский', 'Tatsinskii', 5400), -(11623, 149, 1064, 'Усть-Донецкий', 'Ust-Donetskii', 5500), -(11624, 149, 1064, 'Целина', 'Tselina', 5600), -(11625, 149, 1064, 'Цимлянск', 'Tsimlyansk', 5700), -(11626, 149, 1064, 'Чалтырь', 'Chaltyr', 5800), -(11627, 149, 1064, 'Чертково', 'Chertkovo', 5900), -(11628, 149, 1064, 'Шахты', 'Shahty', 6000), -(11629, 149, 1064, 'Шолоховский', 'Sholohovskii', 6100), -(11630, 149, 1065, 'Александро-Невский', 'Aleksandro-Nevskii', 100), -(11631, 149, 1065, 'Горняк', 'Gornyak', 200), -(11632, 149, 1065, 'Гусь Железный', 'Gus Zheleznyi', 300), -(11633, 149, 1065, 'Елатьма', 'Elatma', 400), -(11634, 149, 1065, 'Ермишь', 'Ermish', 500), -(11635, 149, 1065, 'Заречный (Рязанская обл.)', 'Zarechnyi (Ryazanskaya obl.)', 600), -(11636, 149, 1065, 'Захарово', 'Zaharovo', 700), -(11637, 149, 1065, 'Кадом', 'Kadom', 800), -(11638, 149, 1065, 'Касимов', 'Kasimov', 900), -(11639, 149, 1065, 'Кораблино', 'Korablino', 1000), -(11640, 149, 1065, 'Милославское', 'Miloslavskoe', 1100), -(11641, 149, 1065, 'Михайлов', 'Mihailov', 1200), -(11642, 149, 1065, 'Новомичуринск', 'Новомичуринск', 1300), -(11643, 149, 1065, 'Пителино', 'Pitelino', 1400), -(11644, 149, 1065, 'Пронск', 'Pronsk', 1500), -(11645, 149, 1065, 'Путятино', 'Putyatino', 1600), -(11646, 149, 1065, 'Рыбное', 'Rybnoe', 1700), -(11647, 149, 1065, 'Ряжск', 'Ryazhsk', 1800), -(11648, 149, 1065, 'Рязань', 'Ryazan', 1900), -(11649, 149, 1065, 'Сапожок', 'Sapozhok', 2000), -(11650, 149, 1065, 'Сараи', 'Sarai', 2100), -(11651, 149, 1065, 'Сасово', 'Sasovo', 2200), -(11652, 149, 1065, 'Скопин', 'Skopin', 2300), -(11653, 149, 1065, 'Спас-Клепики', 'Spas-Klepiki', 2400), -(11654, 149, 1065, 'Спасск-Рязанский', 'Spassk-Ryazanskii', 2500), -(11655, 149, 1065, 'Старожилово', 'Starozhilovo', 2600), -(11656, 149, 1065, 'Ухолово', 'Uholovo', 2700), -(11657, 149, 1065, 'Чучково', 'Chuchkovo', 2800), -(11658, 149, 1065, 'Шацк', 'Shatsk', 2900), -(11659, 149, 1065, 'Шилово', 'Shilovo', 3000), -(11660, 149, 1066, 'Алексеевка (Самарская обл.)', 'Alekseevka (Samarskaya obl.)', 100), -(11661, 149, 1066, 'Безенчук', 'Bezenchuk', 200), -(11662, 149, 1066, 'Богатое', 'Bogatoe', 300), -(11663, 149, 1066, 'Богатырь', 'Bogatyr', 400), -(11664, 149, 1066, 'Большая Глушица', 'Bolshaya Glushitsa', 500), -(11665, 149, 1066, 'Большая Глущица (Самарск.)', 'Bolshaya Glushchitsa (Samarsk.)', 600), -(11666, 149, 1066, 'Большая Черниговка', 'Bolshaya Chernigovka', 700), -(11667, 149, 1066, 'Борское', 'Borskoe', 800), -(11668, 149, 1066, 'Волжский (Самарская обл.)', 'Volzhskii (Samarskaya obl.)', 900), -(11669, 149, 1066, 'Жигулевск', 'Zhigulevsk', 1000), -(11670, 149, 1066, 'Зольное', 'Zolnoe', 1100), -(11671, 149, 1066, 'Исаклы', 'Isakly', 1200), -(11672, 149, 1066, 'Камышла', 'Kamyshla', 1300), -(11673, 149, 1066, 'Кинель', 'Kinel', 1400), -(11674, 149, 1066, 'Кинель-Черкасы', 'Kinel-Cherkasy', 1500), -(11675, 149, 1066, 'Клявлино', 'Klyavlino', 1600), -(11676, 149, 1066, 'Кошки', 'Koshki', 1700), -(11677, 149, 1066, 'Красноармейское (Самарск.)', 'Krasnoarmeiskoe (Samarsk.)', 1800), -(11678, 149, 1066, 'Красный Яр (Самарская обл.)', 'Krasnyi Yar (Samarskaya obl.)', 1900), -(11679, 149, 1066, 'Куйбышев', 'Kuibyshev', 2000), -(11680, 149, 1066, 'Нефтегорск', 'Neftegorsk', 2100), -(11681, 149, 1066, 'Новокуйбышевск', 'Novokuibyshevsk', 2200), -(11682, 149, 1066, 'Октябрьск', 'Oktyabrsk', 2300), -(11683, 149, 1066, 'Отрадный', 'Otradnyi', 2400), -(11684, 149, 1066, 'Пестравка', 'Pestravka', 2500), -(11685, 149, 1066, 'Похвистнево', 'Pohvistnevo', 2600), -(11686, 149, 1066, 'Приволжье', 'Privolzhe', 2700), -(11687, 149, 1066, 'Самара', 'Samara', 2800), -(11688, 149, 1066, 'Сергиевск', 'Сергиевск', 2900), -(11689, 149, 1066, 'Сургут (Самарская обл.)', 'Surgut (Samarskaya obl.)', 3000), -(11690, 149, 1066, 'Сызрань', 'Syzran', 3100), -(11691, 149, 1066, 'Тольятти', 'Tolyatti', 3200), -(11692, 149, 1066, 'Хворостянка', 'Hvorostyanka', 3300), -(11693, 149, 1066, 'Чапаевск', 'Chapaevsk', 3400), -(11694, 149, 1066, 'Челно-Вершины', 'Chelno-Vershiny', 3500), -(11695, 149, 1066, 'Шентала', 'Shentala', 3600), -(11696, 149, 1066, 'Шигоны', 'Shigony', 3700), -(11697, 149, 1067, 'Александровская', 'Aleksandrovskaya', 100), -(11698, 149, 1067, 'Бокситогорск', 'Boksitogorsk', 200), -(11699, 149, 1067, 'Большая Ижора', 'Bolshaya Izhora', 300), -(11700, 149, 1067, 'Будогощь', 'Budogoshch', 400), -(11701, 149, 1067, 'Вознесенье', 'Voznesene', 500), -(11702, 149, 1067, 'Волосово', 'Volosovo', 600), -(11703, 149, 1067, 'Волхов', 'Volhov', 700), -(11704, 149, 1067, 'Всеволожск', 'Vsevolozhsk', 800), -(11705, 149, 1067, 'Выборг', 'Vyborg', 900), -(11706, 149, 1067, 'Вырица', 'Vyritsa', 1000), -(11707, 149, 1067, 'Высоцк', 'Vysotsk', 1100), -(11708, 149, 1067, 'Гатчина', 'Gatchina', 1200), -(11709, 149, 1067, 'Дружная Горка', 'Druzhnaya Gorka', 1300), -(11710, 149, 1067, 'Дубровка', 'Dubrovka', 1400), -(11711, 149, 1067, 'Ефимовский', 'Efimovskii', 1500), -(11712, 149, 1067, 'Зеленогорск (Ленинградская обл.)', 'Zelenogorsk (Leningradskaya obl.)', 1600), -(11713, 149, 1067, 'Ивангород', 'Ivangorod', 1700), -(11714, 149, 1067, 'Каменногорск', 'Kamennogorsk', 1800), -(11715, 149, 1067, 'Кикерино', 'Kikerino', 1900), -(11716, 149, 1067, 'Кингисепп', 'Kingisepp', 2000), -(11717, 149, 1067, 'Кириши', 'Kirishi', 2100), -(11718, 149, 1067, 'Кировск', 'Kirovsk', 2200), -(11719, 149, 1067, 'Кобринское', 'Kobrinskoe', 2300), -(11720, 149, 1067, 'Колпино', 'Kolpino', 2400), -(11721, 149, 1067, 'Коммунар', 'Kommunar', 2500), -(11722, 149, 1067, 'Коммунар', 'Kommunar', 2600), -(11723, 149, 1067, 'Кронштадт', 'Kronshtadt', 2700), -(11724, 149, 1067, 'Лисий Нос', 'Lisii Nos', 2800), -(11725, 149, 1067, 'Лодейное Поле', 'Lodeinoe Pole', 2900), -(11726, 149, 1067, 'Ломоносов', 'Lomonosov', 3000), -(11727, 149, 1067, 'Луга', 'Luga', 3100), -(11728, 149, 1067, 'Павловск (Ленинградская обл.)', 'Pavlovsk (Leningradskaya obl.)', 3200), -(11729, 149, 1067, 'Парголово', 'Pargolovo', 3300), -(11730, 149, 1067, 'Петродворец', 'Petrodvorets', 3400), -(11731, 149, 1067, 'Пикалёво', 'Pikalyovo', 3500), -(11732, 149, 1067, 'Подпорожье', 'Podporozhe', 3600), -(11733, 149, 1067, 'Приозерск', 'Priozersk', 3700), -(11734, 149, 1067, 'Пушкин', 'Pushkin', 3800), -(11735, 149, 1067, 'Санкт-Петербург', 'Saint-Petersburg', 3900), -(11736, 149, 1067, 'Светогорск', 'Svetogorsk', 4000), -(11737, 149, 1067, 'Сертолово', 'Sertolovo', 4100), -(11738, 149, 1067, 'Сестрорецк', 'Sestroretsk', 4200), -(11739, 149, 1067, 'Сланцы', 'Slantsy', 4300), -(11740, 149, 1067, 'Сосновый Бор', 'Sosnovyi Bor', 4400), -(11741, 149, 1067, 'Тихвин', 'Tihvin', 4500), -(11742, 149, 1067, 'Тосно', 'Tosno', 4600), -(11743, 149, 1067, 'Шлиссельбург', 'Shlisselburg', 4700), -(11744, 149, 1068, 'Александров Гай', 'Aleksandrov Gai', 100), -(11745, 149, 1068, 'Аркадак', 'Arkadak', 200), -(11746, 149, 1068, 'Аткарск', 'Atkarsk', 300), -(11747, 149, 1068, 'Базарный Карабулак', 'Bazarnyi Karabulak', 400), -(11748, 149, 1068, 'Балаково', 'Balakovo', 500), -(11749, 149, 1068, 'Балашов', 'Balashov', 600), -(11750, 149, 1068, 'Балтай', 'Baltai', 700), -(11751, 149, 1068, 'Возрождение', 'Vozrozhdenie', 800), -(11752, 149, 1068, 'Вольск', 'Volsk', 900), -(11753, 149, 1068, 'Воскресенское (Саратовск.)', 'Voskresenskoe (Saratovsk.)', 1000), -(11754, 149, 1068, 'Горный', 'Gornyi', 1100), -(11755, 149, 1068, 'Дергачи', 'Dergachi', 1200), -(11756, 149, 1068, 'Духовницкое', 'Duhovnitskoe', 1300), -(11757, 149, 1068, 'Екатериновка', 'Ekaterinovka', 1400), -(11758, 149, 1068, 'Ершов', 'Ershov', 1500), -(11759, 149, 1068, 'Ивантеевка (Саратовская обл.)', 'Ivanteevka (Saratovskaya obl.)', 1600), -(11760, 149, 1068, 'Калининск', 'Kalininsk', 1700), -(11761, 149, 1068, 'Каменский', 'Kamenskii', 1800), -(11762, 149, 1068, 'Красноармейск (Саратовск.)', 'Krasnoarmeisk (Saratovsk.)', 1900), -(11763, 149, 1068, 'Красный Кут', 'Krasnyi Kut', 2000), -(11764, 149, 1068, 'Лысые Горы', 'Lysye Gory', 2100), -(11765, 149, 1068, 'Маркс', 'Marks', 2200), -(11766, 149, 1068, 'Мокроус', 'Mokrous', 2300), -(11767, 149, 1068, 'Новоузенск', 'Novouzensk', 2400), -(11768, 149, 1068, 'Новые Бурасы', 'Novye Burasy', 2500), -(11769, 149, 1068, 'Озинки', 'Ozinki', 2600), -(11770, 149, 1068, 'Перелюб', 'Perelyub', 2700), -(11771, 149, 1068, 'Петровск', 'Petrovsk', 2800), -(11772, 149, 1068, 'Питерка', 'Piterka', 2900), -(11773, 149, 1068, 'Пугачев', 'Pugachev', 3000), -(11774, 149, 1068, 'Ровное', 'Rovnoe', 3100), -(11775, 149, 1068, 'Романовка', 'Romanovka', 3200), -(11776, 149, 1068, 'Ртищево', 'Rtishchevo', 3300), -(11777, 149, 1068, 'Самойловка', 'Samoilovka', 3400), -(11778, 149, 1068, 'Саратов', 'Saratov', 3500), -(11779, 149, 1068, 'Степное (Саратовская обл.)', 'Stepnoe (Saratovskaya obl.)', 3600), -(11780, 149, 1068, 'Татищево', 'Tatishchevo', 3700), -(11781, 149, 1068, 'Турки', 'Turki', 3800), -(11782, 149, 1068, 'Хвалынск', 'Hvalynsk', 3900), -(11783, 149, 1068, 'Энгельс', 'Engels', 4000), -(11784, 149, 1069, 'Абый', 'Abyi', 100), -(11785, 149, 1069, 'Айхал', 'Aihal', 200), -(11786, 149, 1069, 'Алдан', 'Aldan', 300), -(11787, 149, 1069, 'Амга', 'Amga', 400), -(11788, 149, 1069, 'Батагай', 'Batagai', 500), -(11789, 149, 1069, 'Бердигестях', 'Berdigestyah', 600), -(11790, 149, 1069, 'Беркакит', 'Berkakit', 700), -(11791, 149, 1069, 'Бестях', 'Bestyah', 800), -(11792, 149, 1069, 'Борогонцы', 'Borogontsy', 900), -(11793, 149, 1069, 'Верхневилюйск', 'Verhnevilyuisk', 1000), -(11794, 149, 1069, 'Верхоянск', 'Verhoyansk', 1100), -(11795, 149, 1069, 'Вилюйск', 'Vilyuisk', 1200), -(11796, 149, 1069, 'Витим', 'Vitim', 1300), -(11797, 149, 1069, 'Власово', 'Vlasovo', 1400), -(11798, 149, 1069, 'Депутатский', 'Deputatskii', 1500), -(11799, 149, 1069, 'Жиганск', 'Zhigansk', 1600), -(11800, 149, 1069, 'Зырянка', 'Zyryanka', 1700), -(11801, 149, 1069, 'Кангалассы', 'Kangalassy', 1800), -(11802, 149, 1069, 'Ленск', 'Lensk', 1900), -(11803, 149, 1069, 'Майя', 'Maiya', 2000), -(11804, 149, 1069, 'Мирный (Саха)', 'Mirnyi (Saha)', 2100), -(11805, 149, 1069, 'Нерюнгри', 'Neryungri', 2200), -(11806, 149, 1069, 'Нижний Куранах', 'Nizhnii Kuranah', 2300), -(11807, 149, 1069, 'Нюрба', 'Nyurba', 2400), -(11808, 149, 1069, 'Олекминск', 'Olekminsk', 2500), -(11809, 149, 1069, 'Покровск', 'Pokrovsk', 2600), -(11810, 149, 1069, 'Сангар', 'Sangar', 2700), -(11811, 149, 1069, 'Саскылах', 'Saskylah', 2800), -(11812, 149, 1069, 'Солнечный', 'Солнечный', 2900), -(11813, 149, 1069, 'Среднеколымск', 'Srednekolymsk', 3000), -(11814, 149, 1069, 'Сунтар', 'Suntar', 3100), -(11815, 149, 1069, 'Тикси', 'Tiksi', 3200), -(11816, 149, 1069, 'Удачный', 'Удачный', 3300), -(11817, 149, 1069, 'Усть-Мая', 'Ust-Maya', 3400), -(11818, 149, 1069, 'Усть-Нера', 'Ust-Nera', 3500), -(11819, 149, 1069, 'Хандыга', 'Handyga', 3600), -(11820, 149, 1069, 'Хонуу', 'Honuu', 3700), -(11821, 149, 1069, 'Чернышевский', 'Чернышевский', 3800), -(11822, 149, 1069, 'Черский', 'Cherskii', 3900), -(11823, 149, 1069, 'Чокурдах', 'Chokurdah', 4000), -(11824, 149, 1069, 'Чульман', 'Чульман', 4100), -(11825, 149, 1069, 'Чурапча', 'Churapcha', 4200), -(11826, 149, 1069, 'Якутск', 'Yakutsk', 4300), -(11827, 149, 1070, 'Александровск-Сахалинский', 'Aleksandrovsk-Sahalinskii', 100), -(11828, 149, 1070, 'Анбэцу', 'Anbetsu', 200), -(11829, 149, 1070, 'Анива', 'Aniva', 300), -(11830, 149, 1070, 'Бошняково', 'Boshnyakovo', 400), -(11831, 149, 1070, 'Быков', 'Bykov', 500), -(11832, 149, 1070, 'Вахрушев', 'Vahrushev', 600), -(11833, 149, 1070, 'Взморье', 'Vzmore', 700), -(11834, 149, 1070, 'Гастелло', 'Gastello', 800), -(11835, 149, 1070, 'Горнозаводск (Сахалин)', 'Gornozavodsk (Sahalin)', 900), -(11836, 149, 1070, 'Долинск', 'Dolinsk', 1000), -(11837, 149, 1070, 'Ильинский (Сахалин)', 'Ilinskii (Sahalin)', 1100), -(11838, 149, 1070, 'Катангли', 'Katangli', 1200), -(11839, 149, 1070, 'Корсаков', 'Korsakov', 1300), -(11840, 149, 1070, 'Курильск', 'Kurilsk', 1400), -(11841, 149, 1070, 'Макаров', 'Makarov', 1500), -(11842, 149, 1070, 'Невельск', 'Nevelsk', 1600), -(11843, 149, 1070, 'Ноглики', 'Nogliki', 1700), -(11844, 149, 1070, 'Оха', 'Oha', 1800), -(11845, 149, 1070, 'Поронайск', 'Poronaisk', 1900), -(11846, 149, 1070, 'Северо-Курильск', 'Severo-Kurilsk', 2000), -(11847, 149, 1070, 'Смирных', 'Smirnyh', 2100), -(11848, 149, 1070, 'Томари', 'Tomari', 2200), -(11849, 149, 1070, 'Тымовское', 'Tymovskoe', 2300), -(11850, 149, 1070, 'Углегорск', 'Uglegorsk', 2400), -(11851, 149, 1070, 'Холмск', 'Holmsk', 2500), -(11852, 149, 1070, 'Шахтерск', 'Shahtersk', 2600), -(11853, 149, 1070, 'Южно-Курильск', 'Yuzhno-Kurilsk', 2700), -(11854, 149, 1070, 'Южно-Сахалинск', 'Yuzhno-Sahalinsk', 2800), -(11855, 149, 1071, 'Алапаевск', 'Alapaevsk', 100), -(11856, 149, 1071, 'Алтынай', 'Altynai', 200), -(11857, 149, 1071, 'Арамиль', 'Aramil', 300), -(11858, 149, 1071, 'Артемовский (Свердловская обл.)', 'Artemovskii (Sverdlovskaya obl.)', 400), -(11859, 149, 1071, 'Арти', 'Arti', 500), -(11860, 149, 1071, 'Асбест', 'Asbest', 600), -(11861, 149, 1071, 'Ачит', 'Achit', 700), -(11862, 149, 1071, 'Байкалово', 'Baikalovo', 800), -(11863, 149, 1071, 'Басьяновский', 'Basyanovskii', 900), -(11864, 149, 1071, 'Белоярский (Свердловская обл.)', 'Beloyarskii (Sverdlovskaya obl.)', 1000), -(11865, 149, 1071, 'Березовский (Свердловская обл.)', 'Berezovskii (Sverdlovskaya obl.)', 1100), -(11866, 149, 1071, 'Бисерть', 'Бисерть', 1200), -(11867, 149, 1071, 'Богданович', 'Bogdanovich', 1300), -(11868, 149, 1071, 'Буланаш', 'Bulanash', 1400), -(11869, 149, 1071, 'Верхний Тагил', 'Verhnii Tagil', 1500), -(11870, 149, 1071, 'Верхняя Пышма', 'Verhnyaya Pyshma', 1600), -(11871, 149, 1071, 'Верхняя Салда', 'Verhnyaya Salda', 1700), -(11872, 149, 1071, 'Верхняя Синячиха', 'Verhnyaya Sinyachiha', 1800), -(11873, 149, 1071, 'Верхняя Сысерть', 'Verhnyaya Sysert', 1900), -(11874, 149, 1071, 'Верхняя Тура', 'Verhnyaya Tura', 2000), -(11875, 149, 1071, 'Верхотурье', 'Verhoture', 2100), -(11876, 149, 1071, 'Висим', 'Visim', 2200), -(11877, 149, 1071, 'Волчанск', 'Volchansk', 2300), -(11878, 149, 1071, 'Гари', 'Gari', 2400), -(11879, 149, 1071, 'Дегтярск', 'Degtyarsk', 2500), -(11880, 149, 1071, 'Екатеринбург', 'Ekaterinburg', 2600), -(11881, 149, 1071, 'Ертарский', 'Ertarskii', 2700), -(11882, 149, 1071, 'Заводоуспенское', 'Zavodouspenskoe', 2800), -(11883, 149, 1071, 'Заречный', 'Заречный', 2900), -(11884, 149, 1071, 'Ивдель', 'Ivdel', 3000), -(11885, 149, 1071, 'Изумруд', 'Izumrud', 3100), -(11886, 149, 1071, 'Ирбит', 'Irbit', 3200), -(11887, 149, 1071, 'Ис', 'Is', 3300), -(11888, 149, 1071, 'Каменск-Уральский', 'Kamensk-Uralskii', 3400), -(11889, 149, 1071, 'Камышлов', 'Kamyshlov', 3500), -(11890, 149, 1071, 'Карпинск', 'Karpinsk', 3600), -(11891, 149, 1071, 'Качканар', 'Kachkanar', 3700), -(11892, 149, 1071, 'Кировград', 'Kirovgrad', 3800), -(11893, 149, 1071, 'Краснотурьинск', 'Krasnoturinsk', 3900), -(11894, 149, 1071, 'Красноуральск', 'Krasnouralsk', 4000), -(11895, 149, 1071, 'Красноуфимск', 'Krasnoufimsk', 4100), -(11896, 149, 1071, 'Кушва', 'Kushva', 4200), -(11897, 149, 1071, 'Лесной', 'Lesnoi', 4300), -(11898, 149, 1071, 'Михайловск', 'Mihailovsk', 4400), -(11899, 149, 1071, 'Невьянск', 'Nevyansk', 4500), -(11900, 149, 1071, 'Нижние Серги', 'Nizhnie Sergi', 4600), -(11901, 149, 1071, 'Нижний Тагил', 'Nizhnii Tagil', 4700), -(11902, 149, 1071, 'Нижняя Салда', 'Nizhnyaya Salda', 4800), -(11903, 149, 1071, 'Нижняя Тура', 'Nizhnyaya Tura', 4900), -(11904, 149, 1071, 'Новая Ляля', 'Novaya Lyalya', 5000), -(11905, 149, 1071, 'Новоуральск', 'Novouralsk', 5100), -(11906, 149, 1071, 'Новоуральск (Свердловская обл.)', 'Novouralsk (Sverdlovskaya obl.)', 5200), -(11907, 149, 1071, 'Оус', 'Ous', 5300), -(11908, 149, 1071, 'Первоуральск', 'Pervouralsk', 5400), -(11909, 149, 1071, 'Полевской', 'Polevskoi', 5500), -(11910, 149, 1071, 'Пышма', 'Pyshma', 5600), -(11911, 149, 1071, 'Ревда (Свердловская обл.)', 'Revda (Sverdlovskaya obl.)', 5700), -(11912, 149, 1071, 'Реж', 'Rezh', 5800), -(11913, 149, 1071, 'Рефтинск', 'Рефтинск', 5900), -(11914, 149, 1071, 'Свердловск', 'Sverdlovsk', 6000), -(11915, 149, 1071, 'Североуральск', 'Severouralsk', 6100), -(11916, 149, 1071, 'Серов', 'Serov', 6200), -(11917, 149, 1071, 'Сосьва', 'Sosva', 6300), -(11918, 149, 1071, 'Среднеуральск', 'Sredneuralsk', 6400), -(11919, 149, 1071, 'Сухой Лог', 'Suhoi Log', 6500), -(11920, 149, 1071, 'Сысерть', 'Sysert', 6600), -(11921, 149, 1071, 'Таборы', 'Tabory', 6700), -(11922, 149, 1071, 'Тавда', 'Tavda', 6800), -(11923, 149, 1071, 'Талица', 'Talitsa', 6900), -(11924, 149, 1071, 'Тугулым', 'Tugulym', 7000), -(11925, 149, 1071, 'Туринск', 'Turinsk', 7100), -(11926, 149, 1071, 'Туринская Слобода', 'Turinskaya Sloboda', 7200), -(11927, 149, 1072, 'Алагир', 'Alagir', 100), -(11928, 149, 1072, 'Ардон', 'Ardon', 200), -(11929, 149, 1072, 'Беслан', 'Beslan', 300), -(11930, 149, 1072, 'Бурон', 'Buron', 400), -(11931, 149, 1072, 'Владикавказ', 'Vladikavkaz', 500), -(11932, 149, 1072, 'Дигора', 'Digora', 600), -(11933, 149, 1072, 'Моздок', 'Mozdok', 700), -(11934, 149, 1072, 'Орджоникидзе', 'Ordzhonikidze', 800), -(11935, 149, 1072, 'Чикола', 'Chikola', 900), -(11936, 149, 1073, 'Велиж', 'Velizh', 100), -(11937, 149, 1073, 'Верхнеднепровский', 'Verhnedneprovskii', 200), -(11938, 149, 1073, 'Ворга', 'Vorga', 300), -(11939, 149, 1073, 'Вязьма', 'Vyazma', 400), -(11940, 149, 1073, 'Гагарин', 'Gagarin', 500), -(11941, 149, 1073, 'Глинка', 'Glinka', 600), -(11942, 149, 1073, 'Голынки', 'Golynki', 700), -(11943, 149, 1073, 'Демидов', 'Demidov', 800), -(11944, 149, 1073, 'Десногорск', 'Desnogorsk', 900), -(11945, 149, 1073, 'Дорогобуж', 'Dorogobuzh', 1000), -(11946, 149, 1073, 'Духовщина', 'Duhovshchina', 1100), -(11947, 149, 1073, 'Ельня', 'Elnya', 1200), -(11948, 149, 1073, 'Ершичи', 'Ershichi', 1300), -(11949, 149, 1073, 'Издешково', 'Izdeshkovo', 1400), -(11950, 149, 1073, 'Кардымово', 'Kardymovo', 1500), -(11951, 149, 1073, 'Красный', 'Krasnyi', 1600), -(11952, 149, 1073, 'Монастырщина', 'Monastyrshchina', 1700), -(11953, 149, 1073, 'Новодугино', 'Novodugino', 1800), -(11954, 149, 1073, 'Починок', 'Pochinok', 1900), -(11955, 149, 1073, 'Рославль', 'Roslavl', 2000), -(11956, 149, 1073, 'Рудня', 'Rudnya', 2100), -(11957, 149, 1073, 'Сафоново', 'Safonovo', 2200), -(11958, 149, 1073, 'Смоленск', 'Smolensk', 2300), -(11959, 149, 1073, 'Сычевка', 'Sychevka', 2400), -(11960, 149, 1073, 'Угра', 'Ugra', 2500), -(11961, 149, 1073, 'Хиславичи', 'Hislavichi', 2600), -(11962, 149, 1073, 'Холм-Жирковский', 'Holm-Zhirkovskii', 2700), -(11963, 149, 1073, 'Шумячи', 'Shumyachi', 2800), -(11964, 149, 1073, 'Ярцево', 'Yartsevo', 2900), -(11965, 149, 1074, 'Александровское (Ставрополь.)', 'Aleksandrovskoe (Stavropol.)', 100), -(11966, 149, 1074, 'Арзгир', 'Arzgir', 200), -(11967, 149, 1074, 'Благодарный', 'Blagodarnyi', 300), -(11968, 149, 1074, 'Буденновск', 'Budennovsk', 400), -(11969, 149, 1074, 'Георгиевск', 'Georgievsk', 500), -(11970, 149, 1074, 'Дивное (Ставропольский край)', 'Divnoe (Stavropolskii krai)', 600), -(11971, 149, 1074, 'Домбай', 'Dombai', 700), -(11972, 149, 1074, 'Донское', 'Donskoe', 800), -(11973, 149, 1074, 'Ессентуки', 'Essentuki', 900), -(11974, 149, 1074, 'Железноводск(Ставропольский)', 'Zheleznovodsk(Stavropolskii)', 1000), -(11975, 149, 1074, 'Зеленокумск', 'Zelenokumsk', 1100), -(11976, 149, 1074, 'Изобильный', 'Izobilnyi', 1200), -(11977, 149, 1074, 'Иноземцево', 'Inozemtsevo', 1300), -(11978, 149, 1074, 'Ипатово', 'Ipatovo', 1400), -(11979, 149, 1074, 'Карачаевск', 'Karachaevsk', 1500), -(11980, 149, 1074, 'Кисловодск', 'Kislovodsk', 1600), -(11981, 149, 1074, 'Кочубеевское', 'Kochubeevskoe', 1700), -(11982, 149, 1074, 'Красногвардейское (Ставрополь.)', 'Krasnogvardeiskoe (Stavropol.)', 1800), -(11983, 149, 1074, 'Курсавка', 'Kursavka', 1900), -(11984, 149, 1074, 'Левокумское', 'Levokumskoe', 2000), -(11985, 149, 1074, 'Лермонтов', 'Lermontov', 2100), -(11986, 149, 1074, 'Минеральные Воды', 'Mineralnye Vody', 2200), -(11987, 149, 1074, 'Михайловск', 'Mihailovsk', 2300), -(11988, 149, 1074, 'Невинномысск', 'Nevinnomyssk', 2400), -(11989, 149, 1074, 'Нефтекумск', 'Neftekumsk', 2500), -(11990, 149, 1074, 'Новоалександровск', 'Novoaleksandrovsk', 2600), -(11991, 149, 1074, 'Новоалександровская', 'Novoaleksandrovskaya', 2700), -(11992, 149, 1074, 'Новопавловск', 'Novopavlovsk', 2800), -(11993, 149, 1074, 'Новоселицкое', 'Novoselitskoe', 2900), -(11994, 149, 1074, 'Преградная', 'Pregradnaya', 3000), -(11995, 149, 1074, 'Пятигорск', 'Pyatigorsk', 3100), -(11996, 149, 1074, 'Светлоград', 'Svetlograd', 3200), -(11997, 149, 1074, 'Солнечнодольск', 'Solnechnodolsk', 3300), -(11998, 149, 1074, 'Ставрополь', 'Stavropol', 3400), -(11999, 149, 1074, 'Степное (Ставропольский край)', 'Stepnoe (Stavropolskii krai)', 3500), -(12000, 149, 1074, 'Теберда', 'Teberda', 3600), -(12001, 149, 1074, 'Усть-Джегута', 'Ust-Dzheguta', 3700), -(12002, 149, 1074, 'Хабез', 'Habez', 3800), -(12003, 149, 1074, 'Черкесск', 'Cherkessk', 3900), -(12004, 149, 1075, 'Бондари', 'Bondari', 100), -(12005, 149, 1075, 'Гавриловка Вторая', 'Gavrilovka Vtoraya', 200), -(12006, 149, 1075, 'Жердевка', 'Zherdevka', 300), -(12007, 149, 1075, 'Знаменка', 'Znamenka', 400), -(12008, 149, 1075, 'Инжавино', 'Inzhavino', 500), -(12009, 149, 1075, 'Кирсанов', 'Kirsanov', 600), -(12010, 149, 1075, 'Котовск', 'Kotovsk', 700), -(12011, 149, 1075, 'Мичуринск', 'Michurinsk', 800), -(12012, 149, 1075, 'Мордово', 'Mordovo', 900), -(12013, 149, 1075, 'Моршанск', 'Morshansk', 1000), -(12014, 149, 1075, 'Мучкапский', 'Muchkapskii', 1100), -(12015, 149, 1075, 'Первомайский (Тамбовская обл.)', 'Pervomaiskii (Tambovskaya obl.)', 1200), -(12016, 149, 1075, 'Петровское', 'Petrovskoe', 1300), -(12017, 149, 1075, 'Пичаево', 'Pichaevo', 1400), -(12018, 149, 1075, 'Рассказово', 'Rasskazovo', 1500), -(12019, 149, 1075, 'Ржакса', 'Rzhaksa', 1600), -(12020, 149, 1075, 'Сосновка', 'Сосновка', 1700), -(12021, 149, 1075, 'Староюрьево', 'Staroyurevo', 1800), -(12022, 149, 1075, 'Тамбов', 'Tambov', 1900), -(12023, 149, 1075, 'Токаревка', 'Tokarevka', 2000), -(12024, 149, 1075, 'Уварово', 'Uvarovo', 2100), -(12025, 149, 1075, 'Умет', 'Umet', 2200), -(12026, 149, 1076, 'Агрыз', 'Agryz', 100), -(12027, 149, 1076, 'Азнакаево', 'Aznakaevo', 200), -(12028, 149, 1076, 'Аксубаево', 'Aksubaevo', 300), -(12029, 149, 1076, 'Актаныш', 'Aktanysh', 400), -(12030, 149, 1076, 'Актюбинский', 'Aktyubinskii', 500), -(12031, 149, 1076, 'Алексеевское', 'Alekseevskoe', 600), -(12032, 149, 1076, 'Альметьевск', 'Almetevsk', 700), -(12033, 149, 1076, 'Апастово', 'Apastovo', 800), -(12034, 149, 1076, 'Арск', 'Arsk', 900), -(12035, 149, 1076, 'Бавлы', 'Bavly', 1000), -(12036, 149, 1076, 'Базарные Матаки', 'Bazarnye Mataki', 1100), -(12037, 149, 1076, 'Балтаси', 'Baltasi', 1200); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(12038, 149, 1076, 'Богатые Сабы', 'Bogatye Saby', 1300), -(12039, 149, 1076, 'Брежнев', 'Brezhnev', 1400), -(12040, 149, 1076, 'Бугульма', 'Bugulma', 1500), -(12041, 149, 1076, 'Буинск', 'Buinsk', 1600), -(12042, 149, 1076, 'Васильево', 'Vasilevo', 1700), -(12043, 149, 1076, 'Верхний Услон', 'Verhnii Uslon', 1800), -(12044, 149, 1076, 'Высокая Гора', 'Vysokaya Gora', 1900), -(12045, 149, 1076, 'Дербешкинский', 'Derbeshkinskii', 2000), -(12046, 149, 1076, 'Елабуга', 'Elabuga', 2100), -(12047, 149, 1076, 'Заинск', 'Zainsk', 2200), -(12048, 149, 1076, 'Зеленодольск', 'Zelenodolsk', 2300), -(12049, 149, 1076, 'Казань', 'Kazan', 2400), -(12050, 149, 1076, 'Камское Устье', 'Kamskoe Uste', 2500), -(12051, 149, 1076, 'Карабаш (Татарстан)', 'Karabash (Tatarstan)', 2600), -(12052, 149, 1076, 'Куйбышев (Татарстан)', 'Kuibyshev (Tatarstan)', 2700), -(12053, 149, 1076, 'Кукмод', 'Kukmod', 2800), -(12054, 149, 1076, 'Кукмор', 'Kukmor', 2900), -(12055, 149, 1076, 'Лаишево', 'Laishevo', 3000), -(12056, 149, 1076, 'Лениногорск', 'Leninogorsk', 3100), -(12057, 149, 1076, 'Мамадыш', 'Mamadysh', 3200), -(12058, 149, 1076, 'Менделеевск', 'Mendeleevsk', 3300), -(12059, 149, 1076, 'Мензелинск', 'Menzelinsk', 3400), -(12060, 149, 1076, 'Муслюмово', 'Muslyumovo', 3500), -(12061, 149, 1076, 'Набережные Челны', 'Naberezhnye Chelny', 3600), -(12062, 149, 1076, 'Нижнекамск', 'Nizhnekamsk', 3700), -(12063, 149, 1076, 'Новошешминск', 'Novosheshminsk', 3800), -(12064, 149, 1076, 'Нурлат', 'Nurlat', 3900), -(12065, 149, 1076, 'Пестрецы', 'Pestretsy', 4000), -(12066, 149, 1076, 'Рыбная Слобода', 'Rybnaya Sloboda', 4100), -(12067, 149, 1076, 'Сарманово', 'Sarmanovo', 4200), -(12068, 149, 1076, 'Старое Дрожжаное', 'Staroe Drozhzhanoe', 4300), -(12069, 149, 1076, 'Тетюши', 'Tetyushi', 4400), -(12070, 149, 1076, 'Черемшан', 'Cheremshan', 4500), -(12071, 149, 1076, 'Чистополь', 'Chistopol', 4600), -(12072, 149, 1077, 'Андреаполь', 'Andreapol', 100), -(12073, 149, 1077, 'Бежецк', 'Bezhetsk', 200), -(12074, 149, 1077, 'Белый', 'Belyi', 300), -(12075, 149, 1077, 'Белый Городок', 'Belyi Gorodok', 400), -(12076, 149, 1077, 'Березайка', 'Berezaika', 500), -(12077, 149, 1077, 'Бологое', 'Bologoe', 600), -(12078, 149, 1077, 'Васильевский Мох', 'Vasilevskii Moh', 700), -(12079, 149, 1077, 'Весьегонск', 'Весьегонск', 800), -(12080, 149, 1077, 'Выползово', 'Vypolzovo', 900), -(12081, 149, 1077, 'Вышний Волочек', 'Vyshnii Volochek', 1000), -(12082, 149, 1077, 'Жарковский', 'Zharkovskii', 1100), -(12083, 149, 1077, 'Западная Двина', 'Zapadnaya Dvina', 1200), -(12084, 149, 1077, 'Зубцов', 'Zubtsov', 1300), -(12085, 149, 1077, 'Изоплит', 'Izoplit', 1400), -(12086, 149, 1077, 'Калашниково', 'Kalashnikovo', 1500), -(12087, 149, 1077, 'Калинин', 'Kalinin', 1600), -(12088, 149, 1077, 'Калязин', 'Kalyazin', 1700), -(12089, 149, 1077, 'Кашин', 'Kashin', 1800), -(12090, 149, 1077, 'Кесова Гора', 'Kesova Gora', 1900), -(12091, 149, 1077, 'Кимры', 'Kimry', 2000), -(12092, 149, 1077, 'Конаково', 'Konakovo', 2100), -(12093, 149, 1077, 'Красный Холм', 'Krasnyi Holm', 2200), -(12094, 149, 1077, 'Кувшиново', 'Kuvshinovo', 2300), -(12095, 149, 1077, 'Лесное', 'Lesnoe', 2400), -(12096, 149, 1077, 'Лихославль', 'Lihoslavl', 2500), -(12097, 149, 1077, 'Максатиха', 'Maksatiha', 2600), -(12098, 149, 1077, 'Молоково', 'Molokovo', 2700), -(12099, 149, 1077, 'Нелидово', 'Nelidovo', 2800), -(12100, 149, 1077, 'Оленино', 'Olenino', 2900), -(12101, 149, 1077, 'Осташков', 'Ostashkov', 3000), -(12102, 149, 1077, 'Пено', 'Peno', 3100), -(12103, 149, 1077, 'Рамешки', 'Rameshki', 3200), -(12104, 149, 1077, 'Ржев', 'Rzhev', 3300), -(12105, 149, 1077, 'Сандово', 'Sandovo', 3400), -(12106, 149, 1077, 'Селижарово', 'Selizharovo', 3500), -(12107, 149, 1077, 'Сонково', 'Sonkovo', 3600), -(12108, 149, 1077, 'Спирово', 'Spirovo', 3700), -(12109, 149, 1077, 'Старица', 'Staritsa', 3800), -(12110, 149, 1077, 'Тверь', 'Tver', 3900), -(12111, 149, 1077, 'Торжок', 'Torzhok', 4000), -(12112, 149, 1077, 'Торопец', 'Toropets', 4100), -(12113, 149, 1077, 'Удомля', 'Udomlya', 4200), -(12114, 149, 1077, 'Фирово', 'Firovo', 4300), -(12115, 149, 1078, 'Александровское (Томская обл.)', 'Aleksandrovskoe (Tomskaya obl.)', 100), -(12116, 149, 1078, 'Асино', 'Asino', 200), -(12117, 149, 1078, 'Бакчар', 'Bakchar', 300), -(12118, 149, 1078, 'Батурино', 'Baturino', 400), -(12119, 149, 1078, 'Белый Яр', 'Belyi Yar', 500), -(12120, 149, 1078, 'Зырянское', 'Zyryanskoe', 600), -(12121, 149, 1078, 'Итатка', 'Itatka', 700), -(12122, 149, 1078, 'Каргасок', 'Kargasok', 800), -(12123, 149, 1078, 'Катайга', 'Kataiga', 900), -(12124, 149, 1078, 'Кожевниково', 'Kozhevnikovo', 1000), -(12125, 149, 1078, 'Колпашево', 'Kolpashevo', 1100), -(12126, 149, 1078, 'Кривошеино', 'Krivosheino', 1200), -(12127, 149, 1078, 'Мельниково', 'Melnikovo', 1300), -(12128, 149, 1078, 'Молчаново', 'Molchanovo', 1400), -(12129, 149, 1078, 'Парабель', 'Parabel', 1500), -(12130, 149, 1078, 'Первомайское', 'Pervomaiskoe', 1600), -(12131, 149, 1078, 'Подгорное', 'Podgornoe', 1700), -(12132, 149, 1078, 'Северск', 'Seversk', 1800), -(12133, 149, 1078, 'Стрежевой', 'Strezhevoi', 1900), -(12134, 149, 1078, 'Томск', 'Tomsk', 2000), -(12135, 149, 1078, 'Тымск', 'Tymsk', 2100), -(12136, 149, 1079, 'Ак-Довурак', 'Ak-Dovurak', 100), -(12137, 149, 1079, 'Бай Хаак', 'Bai Haak', 200), -(12138, 149, 1079, 'Кызыл', 'Kyzyl', 300), -(12139, 149, 1079, 'Самагалтай', 'Samagaltai', 400), -(12140, 149, 1079, 'Сарыг-Сеп', 'Saryg-Sep', 500), -(12141, 149, 1079, 'Суть-Холь', 'Sut-Hol', 600), -(12142, 149, 1079, 'Тоора-Хем', 'Toora-Hem', 700), -(12143, 149, 1079, 'Туран', 'Turan', 800), -(12144, 149, 1079, 'Тээли', 'Teeli', 900), -(12145, 149, 1079, 'Хову-Аксы', 'Hovu-Aksy', 1000), -(12146, 149, 1079, 'Чадан', 'Chadan', 1100), -(12147, 149, 1079, 'Шагонар', 'Shagonar', 1200), -(12148, 149, 1079, 'Эрзин', 'Erzin', 1300), -(12149, 149, 1080, 'Агеево', 'Ageevo', 100), -(12150, 149, 1080, 'Алексин', 'Aleksin', 200), -(12151, 149, 1080, 'Арсеньево', 'Arsenevo', 300), -(12152, 149, 1080, 'Барсуки', 'Barsuki', 400), -(12153, 149, 1080, 'Белев', 'Belev', 500), -(12154, 149, 1080, 'Богородицк', 'Bogoroditsk', 600), -(12155, 149, 1080, 'Болохово', 'Bolohovo', 700), -(12156, 149, 1080, 'Велегож', 'Velegozh', 800), -(12157, 149, 1080, 'Венев', 'Venev', 900), -(12158, 149, 1080, 'Волово', 'Volovo', 1000), -(12159, 149, 1080, 'Горелки', 'Gorelki', 1100), -(12160, 149, 1080, 'Донской', 'Donskoi', 1200), -(12161, 149, 1080, 'Дубна (Тульская обл.)', 'Dubna (Tulskaya obl.)', 1300), -(12162, 149, 1080, 'Епифань', 'Epifan', 1400), -(12163, 149, 1080, 'Ефремов', 'Efremov', 1500), -(12164, 149, 1080, 'Заокский', 'Zaokskii', 1600), -(12165, 149, 1080, 'Казановка', 'Kazanovka', 1700), -(12166, 149, 1080, 'Кимовск', 'Kimovsk', 1800), -(12167, 149, 1080, 'Киреевск', 'Kireevsk', 1900), -(12168, 149, 1080, 'Куркино', 'Kurkino', 2000), -(12169, 149, 1080, 'Ленинский', 'Leninskii', 2100), -(12170, 149, 1080, 'Лянтор', 'Lyantor', 2200), -(12171, 149, 1080, 'Новомосковск', 'Novomoskovsk', 2300), -(12172, 149, 1080, 'Одоев', 'Odoev', 2400), -(12173, 149, 1080, 'Плавск', 'Plavsk', 2500), -(12174, 149, 1080, 'Советск (Тульская обл.)', 'Sovetsk (Tulskaya obl.)', 2600), -(12175, 149, 1080, 'Суворов', 'Suvorov', 2700), -(12176, 149, 1080, 'Тула', 'Tula', 2800), -(12177, 149, 1080, 'Узловая', 'Uzlovaya', 2900), -(12178, 149, 1080, 'Щекино', 'Shchekino', 3000), -(12179, 149, 1080, 'Ясногорск', 'Yasnogorsk', 3100), -(12180, 149, 1081, 'Абатский', 'Abatskii', 100), -(12181, 149, 1081, 'Аган', 'Agan', 200), -(12182, 149, 1081, 'Аксарка', 'Aksarka', 300), -(12183, 149, 1081, 'Армизонское', 'Armizonskoe', 400), -(12184, 149, 1081, 'Аромашево', 'Aromashevo', 500), -(12185, 149, 1081, 'Белоярский (Тюменская обл.)', 'Beloyarskii (Tyumenskaya obl.)', 600), -(12186, 149, 1081, 'Бердюжье', 'Berdyuzhe', 700), -(12187, 149, 1081, 'Березово', 'Березово', 800), -(12188, 149, 1081, 'Большое Сорокино', 'Bolshoe Sorokino', 900), -(12189, 149, 1081, 'Вагай', 'Vagai', 1000), -(12190, 149, 1081, 'Викулово', 'Vikulovo', 1100), -(12191, 149, 1081, 'Винзили', 'Vinzili', 1200), -(12192, 149, 1081, 'Голышманово', 'Golyshmanovo', 1300), -(12193, 149, 1081, 'Губкинский (Тюменская обл.)', 'Gubkinskii (Tyumenskaya obl.)', 1400), -(12194, 149, 1081, 'Заводопетровский', 'Zavodopetrovskii', 1500), -(12195, 149, 1081, 'Заводоуковск', 'Zavodoukovsk', 1600), -(12196, 149, 1081, 'Игрим', 'Igrim', 1700), -(12197, 149, 1081, 'Излучинск', 'Izluchinsk', 1800), -(12198, 149, 1081, 'Исетское', 'Isetskoe', 1900), -(12199, 149, 1081, 'Ишим', 'Ishim', 2000), -(12200, 149, 1081, 'Казанское', 'Kazanskoe', 2100), -(12201, 149, 1081, 'Казым-Мыс', 'Kazym-Mys', 2200), -(12202, 149, 1081, 'Когалым (Тюменская обл.)', 'Kogalym (Tyumenskaya obl.)', 2300), -(12203, 149, 1081, 'Кондинское', 'Kondinskoe', 2400), -(12204, 149, 1081, 'Красноселькуп', 'Krasnoselkup', 2500), -(12205, 149, 1081, 'Лабытнанги', 'Labytnangi', 2600), -(12206, 149, 1081, 'Лангепас', 'Langepas', 2700), -(12207, 149, 1081, 'Ларьяк', 'Laryak', 2800), -(12208, 149, 1081, 'Лянторский', 'Lyantorskii', 2900), -(12209, 149, 1081, 'Мегион', 'Megion', 3000), -(12210, 149, 1081, 'Междуреченский', 'Междуреченский', 3100), -(12211, 149, 1081, 'Мужи', 'Muzhi', 3200), -(12212, 149, 1081, 'Муравленко (Тюменская обл.)', 'Muravlenko (Tyumenskaya obl.)', 3300), -(12213, 149, 1081, 'Надым (Тюменская обл.)', 'Nadym (Tyumenskaya obl.)', 3400), -(12214, 149, 1081, 'Находка (Тюменская обл.)', 'Nahodka (Tyumenskaya obl.)', 3500), -(12215, 149, 1081, 'Нефтеюганск', 'Nefteyugansk', 3600), -(12216, 149, 1081, 'Нижневартовск', 'Nizhnevartovsk', 3700), -(12217, 149, 1081, 'Нижняя Тавда', 'Nizhnyaya Tavda', 3800), -(12218, 149, 1081, 'Новоаганск', 'Новоаганск', 3900), -(12219, 149, 1081, 'Новый Уренгой (Тюменская обл.)', 'Novyi Urengoi (Tyumenskaya obl.)', 4000), -(12220, 149, 1081, 'Ноябрьск (Тюменская обл.)', 'Noyabrsk (Tyumenskaya obl.)', 4100), -(12221, 149, 1081, 'Нягань', 'Nyagan', 4200), -(12222, 149, 1081, 'Октябрьское (Тюменская обл.)', 'Oktyabrskoe (Tyumenskaya obl.)', 4300), -(12223, 149, 1081, 'Омутинский', 'Omutinskii', 4400), -(12224, 149, 1081, 'Покачи (Тюменская обл.)', 'Pokachi (Tyumenskaya obl.)', 4500), -(12225, 149, 1081, 'Приобье', 'Priobe', 4600), -(12226, 149, 1081, 'Пыть-Ях', 'Pyt-Yah', 4700), -(12227, 149, 1081, 'Радужный (Ханты-Мансийский АО)', 'Raduzhnyi (Hanty-Mansiiskii AO)', 4800), -(12228, 149, 1081, 'Салехард', 'Salehard', 4900), -(12229, 149, 1081, 'Сладково', 'Sladkovo', 5000), -(12230, 149, 1081, 'Советский (Тюменская обл.)', 'Sovetskii (Tyumenskaya obl.)', 5100), -(12231, 149, 1081, 'Сургут', 'Surgut', 5200), -(12232, 149, 1081, 'Тазовский', 'Tazovskii', 5300), -(12233, 149, 1081, 'Тобольск', 'Tobolsk', 5400), -(12234, 149, 1081, 'Тюмень', 'Tyumen', 5500), -(12235, 149, 1081, 'Уват', 'Uvat', 5600), -(12236, 149, 1081, 'Унъюган', 'Un''yugan', 5700), -(12237, 149, 1081, 'Упорово', 'Uporovo', 5800), -(12238, 149, 1081, 'Урай', 'Urai', 5900), -(12239, 149, 1081, 'Ханты-Мансийск', 'Hanty-Mansiisk', 6000), -(12240, 149, 1081, 'Югорск', 'Yugorsk', 6100), -(12241, 149, 1081, 'Юрибей', 'Yuribei', 6200), -(12242, 149, 1081, 'Ялуторовск', 'Yalutorovsk', 6300), -(12243, 149, 1081, 'Яр-Сале', 'Yar-Sale', 6400), -(12244, 149, 1081, 'Ярково', 'Yarkovo', 6500), -(12245, 149, 1082, 'Алнаши', 'Alnashi', 100), -(12246, 149, 1082, 'Балезино', 'Balezino', 200), -(12247, 149, 1082, 'Вавож', 'Vavozh', 300), -(12248, 149, 1082, 'Воткинск', 'Votkinsk', 400), -(12249, 149, 1082, 'Глазов', 'Glazov', 500), -(12250, 149, 1082, 'Грахово', 'Grahovo', 600), -(12251, 149, 1082, 'Дебесы', 'Debesy', 700), -(12252, 149, 1082, 'Завьялово', 'Zavyalovo', 800), -(12253, 149, 1082, 'Игра', 'Igra', 900), -(12254, 149, 1082, 'Ижевск', 'Izhevsk', 1000), -(12255, 149, 1082, 'Кама', 'Kama', 1100), -(12256, 149, 1082, 'Камбарка', 'Kambarka', 1200), -(12257, 149, 1082, 'Каракулино', 'Karakulino', 1300), -(12258, 149, 1082, 'Кез', 'Kez', 1400), -(12259, 149, 1082, 'Кизнер', 'Kizner', 1500), -(12260, 149, 1082, 'Киясово', 'Kiyasovo', 1600), -(12261, 149, 1082, 'Красногорское (Удмуртия)', 'Krasnogorskoe (Udmurtiya)', 1700), -(12262, 149, 1082, 'Можга', 'Mozhga', 1800), -(12263, 149, 1082, 'Сарапул', 'Sarapul', 1900), -(12264, 149, 1082, 'Селты', 'Selty', 2000), -(12265, 149, 1082, 'Сюмси', 'Syumsi', 2100), -(12266, 149, 1082, 'Ува', 'Uva', 2200), -(12267, 149, 1082, 'Устинов', 'Ustinov', 2300), -(12268, 149, 1082, 'Шаркан', 'Sharkan', 2400), -(12269, 149, 1082, 'Юкаменское', 'Yukamenskoe', 2500), -(12270, 149, 1082, 'Якшур-Бодья', 'Yakshur-Bodya', 2600), -(12271, 149, 1082, 'Яр', 'Yar', 2700), -(12272, 149, 1083, 'Базарный Сызган', 'Bazarnyi Syzgan', 100), -(12273, 149, 1083, 'Барыш', 'Barysh', 200), -(12274, 149, 1083, 'Большое Нагаткино', 'Bolshoe Nagatkino', 300), -(12275, 149, 1083, 'Вешкайма', 'Veshkaima', 400), -(12276, 149, 1083, 'Глотовка', 'Glotovka', 500), -(12277, 149, 1083, 'Димитровград', 'Dimitrovgrad', 600), -(12278, 149, 1083, 'Игнатовка', 'Ignatovka', 700), -(12279, 149, 1083, 'Измайлово', 'Izmailovo', 800), -(12280, 149, 1083, 'Инза', 'Inza', 900), -(12281, 149, 1083, 'Ишеевка', 'Isheevka', 1000), -(12282, 149, 1083, 'Канадей', 'Kanadei', 1100), -(12283, 149, 1083, 'Карсун', 'Karsun', 1200), -(12284, 149, 1083, 'Кузоватово', 'Kuzovatovo', 1300), -(12285, 149, 1083, 'Майна', 'Maina', 1400), -(12286, 149, 1083, 'Новая Малыкла', 'Novaya Malykla', 1500), -(12287, 149, 1083, 'Новоспасское', 'Novospasskoe', 1600), -(12288, 149, 1083, 'Новоульяновск', 'Новоульяновск', 1700), -(12289, 149, 1083, 'Павловка', 'Pavlovka', 1800), -(12290, 149, 1083, 'Радищево', 'Radishchevo', 1900), -(12291, 149, 1083, 'Сенгилей', 'Sengilei', 2000), -(12292, 149, 1083, 'Старая Кулатка', 'Staraya Kulatka', 2100), -(12293, 149, 1083, 'Старая Майна', 'Staraya Maina', 2200), -(12294, 149, 1083, 'Сурское', 'Surskoe', 2300), -(12295, 149, 1083, 'Тереньга', 'Terenga', 2400), -(12296, 149, 1083, 'Ульяновск', 'Ulyanovsk', 2500), -(12297, 149, 1083, 'Чердаклы', 'Cherdakly', 2600), -(12298, 149, 1084, 'Аксай (Уральская обл.)', 'Aksai (Uralskaya obl.)', 100), -(12299, 149, 1084, 'Дарьинское', 'Darinskoe', 200), -(12300, 149, 1084, 'Деркул', 'Derkul', 300), -(12301, 149, 1084, 'Джамбейты', 'Dzhambeity', 400), -(12302, 149, 1084, 'Переметное', 'Peremetnoe', 500), -(12303, 149, 1084, 'Уральск', 'Uralsk', 600), -(12304, 149, 1084, 'Федоровка (Уральская обл.)', 'Fedorovka (Uralskaya obl.)', 700), -(12305, 149, 1084, 'Фурманово', 'Furmanovo', 800), -(12306, 149, 1084, 'Чапаев', 'Chapaev', 900), -(12307, 149, 1085, 'Амурск', 'Amursk', 100), -(12308, 149, 1085, 'Аян', 'Ayan', 200), -(12309, 149, 1085, 'Березовый', 'Berezovyi', 300), -(12310, 149, 1085, 'Бикин', 'Bikin', 400), -(12311, 149, 1085, 'Бира', 'Bira', 500), -(12312, 149, 1085, 'Биракан', 'Birakan', 600), -(12313, 149, 1085, 'Богородское (Хабаровский край)', 'Bogorodskoe (Habarovskii krai)', 700), -(12314, 149, 1085, 'Ванино', 'Vanino', 800), -(12315, 149, 1085, 'Волочаевка Вторая', 'Volochaevka Vtoraya', 900), -(12316, 149, 1085, 'Высокогорный', 'Vysokogornyi', 1000), -(12317, 149, 1085, 'Вяземский', 'Vyazemskii', 1100), -(12318, 149, 1085, 'Горный', 'Gornyi', 1200), -(12319, 149, 1085, 'Гурское', 'Gurskoe', 1300), -(12320, 149, 1085, 'Дормидонтовка', 'Dormidontovka', 1400), -(12321, 149, 1085, 'Заветы Ильича', 'Zavety Ilicha', 1500), -(12322, 149, 1085, 'Известковый', 'Izvestkovyi', 1600), -(12323, 149, 1085, 'Иннокентьевка', 'Innokentevka', 1700), -(12324, 149, 1085, 'Комсомольск-на-Амуре', 'Komsomolsk-na-Amure', 1800), -(12325, 149, 1085, 'Ленинское', 'Leninskoe', 1900), -(12326, 149, 1085, 'Нелькан', 'Nelkan', 2000), -(12327, 149, 1085, 'Николаевск-на-Амуре', 'Nikolaevsk-na-Amure', 2100), -(12328, 149, 1085, 'Облучье', 'Obluche', 2200), -(12329, 149, 1085, 'Охотск', 'Ohotsk', 2300), -(12330, 149, 1085, 'Переяславка', 'Pereyaslavka', 2400), -(12331, 149, 1085, 'Смидович', 'Smidovich', 2500), -(12332, 149, 1085, 'Советская Гавань', 'Sovetskaya Gavan', 2600), -(12333, 149, 1085, 'Софийск', 'Sofiisk', 2700), -(12334, 149, 1085, 'Троицкое', 'Troitskoe', 2800), -(12335, 149, 1085, 'Тугур', 'Tugur', 2900), -(12336, 149, 1085, 'Хабаровск', 'Khabarovsk', 3000), -(12337, 149, 1085, 'Чегдомын', 'Chegdomyn', 3100), -(12338, 149, 1085, 'Чумикан', 'Chumikan', 3200), -(12339, 149, 1086, 'Абакан', 'Abakan', 100), -(12340, 149, 1086, 'Саяногорск', 'Sayanogorsk', 200), -(12341, 149, 1086, 'Черногорск', 'Черногорск', 300), -(12342, 149, 1087, 'Агаповка', 'Agapovka', 100), -(12343, 149, 1087, 'Аргаяш', 'Argayash', 200), -(12344, 149, 1087, 'Аша', 'Asha', 300), -(12345, 149, 1087, 'Бакал', 'Bakal', 400), -(12346, 149, 1087, 'Бреды', 'Bredy', 500), -(12347, 149, 1087, 'Варна', 'Varna', 600), -(12348, 149, 1087, 'Верхнеуральск', 'Verhneuralsk', 700), -(12349, 149, 1087, 'Верхний Уфалей', 'Verhnii Ufalei', 800), -(12350, 149, 1087, 'Еманжелинск', 'Emanzhelinsk', 900), -(12351, 149, 1087, 'Златоуст', 'Zlatoust', 1000), -(12352, 149, 1087, 'Карабаш', 'Karabash', 1100), -(12353, 149, 1087, 'Карталы', 'Kartaly', 1200), -(12354, 149, 1087, 'Касли', 'Kasli', 1300), -(12355, 149, 1087, 'Катав-Ивановск', 'Katav-Ivanovsk', 1400), -(12356, 149, 1087, 'Копейск', 'Kopeisk', 1500), -(12357, 149, 1087, 'Коркино', 'Korkino', 1600), -(12358, 149, 1087, 'Красногорский', 'Красногорский', 1700), -(12359, 149, 1087, 'Кунашак', 'Kunashak', 1800), -(12360, 149, 1087, 'Куса', 'Kusa', 1900), -(12361, 149, 1087, 'Кыштым', 'Kyshtym', 2000), -(12362, 149, 1087, 'Магнитогорск', 'Magnitogorsk', 2100), -(12363, 149, 1087, 'Миасс', 'Miass', 2200), -(12364, 149, 1087, 'Миньяр', 'Миньяр', 2300), -(12365, 149, 1087, 'Озерск(Челябинская обл.)', 'Ozersk(Chelyabinskaya obl.)', 2400), -(12366, 149, 1087, 'Октябрьское (Челябинская обл.)', 'Oktyabrskoe (Chelyabinskaya obl.)', 2500), -(12367, 149, 1087, 'Пласт', 'Plast', 2600), -(12368, 149, 1087, 'Сатка', 'Satka', 2700), -(12369, 149, 1087, 'Сим', 'Sim', 2800), -(12370, 149, 1087, 'Снежинск (Челябинская обл.)', 'Snezhinsk (Chelyabinskaya obl.)', 2900), -(12371, 149, 1087, 'Трехгорный', 'Trehgornyi', 3000), -(12372, 149, 1087, 'Троицк', 'Troitsk', 3100), -(12373, 149, 1087, 'Увельский', 'Uvelskii', 3200), -(12374, 149, 1087, 'Уйское', 'Uiskoe', 3300), -(12375, 149, 1087, 'Усть-Катав', 'Ust-Katav', 3400), -(12376, 149, 1087, 'Фершампенуаз', 'Fershampenuaz', 3500), -(12377, 149, 1087, 'Чебаркуль', 'Chebarkul', 3600), -(12378, 149, 1087, 'Челябинск', 'Chelyabinsk', 3700), -(12379, 149, 1087, 'Чесма', 'Chesma', 3800), -(12380, 149, 1087, 'Южно-Уральск', 'Yuzhno-Uralsk', 3900), -(12381, 149, 1087, 'Юрюзань', 'Yuryuzan', 4000), -(12382, 149, 1088, 'Аргун', 'Argun', 100), -(12383, 149, 1088, 'Грозный', 'Groznyi', 200), -(12384, 149, 1088, 'Гудермес', 'Gudermes', 300), -(12385, 149, 1088, 'Знаменское', 'Знаменское', 400), -(12386, 149, 1088, 'Малгобек', 'Malgobek', 500), -(12387, 149, 1088, 'Назрань', 'Nazran', 600), -(12388, 149, 1088, 'Наурская', 'Naurskaya', 700), -(12389, 149, 1088, 'Ножай-Юрт', 'Nozhai-Yurt', 800), -(12390, 149, 1088, 'Орджоникидзевская', 'Ordzhonikidzevskaya', 900), -(12391, 149, 1088, 'Советское (Чечено-Ингушетия)', 'Sovetskoe (Checheno-Ingushetiya)', 1000), -(12392, 149, 1088, 'Урус-Мартан', 'Urus-Martan', 1100), -(12393, 149, 1088, 'Шали', 'Shali', 1200), -(12394, 149, 1089, 'Агинское', 'Aginskoe', 100), -(12395, 149, 1089, 'Аксеново-Зиловское', 'Aksenovo-Zilovskoe', 200), -(12396, 149, 1089, 'Акша', 'Aksha', 300), -(12397, 149, 1089, 'Арбагар', 'Arbagar', 400), -(12398, 149, 1089, 'Атамановка', 'Atamanovka', 500), -(12399, 149, 1089, 'Балей', 'Balei', 600), -(12400, 149, 1089, 'Борзя', 'Borzya', 700), -(12401, 149, 1089, 'Букачача', 'Bukachacha', 800), -(12402, 149, 1089, 'Газимурский Завод', 'Gazimurskii Zavod', 900), -(12403, 149, 1089, 'Давенда', 'Davenda', 1000), -(12404, 149, 1089, 'Дарасун', 'Darasun', 1100), -(12405, 149, 1089, 'Домна', 'Domna', 1200), -(12406, 149, 1089, 'Дровяная', 'Drovyanaya', 1300), -(12407, 149, 1089, 'Дульдурга', 'Duldurga', 1400), -(12408, 149, 1089, 'Забайкальск', 'Zabaikalsk', 1500), -(12409, 149, 1089, 'Карымское', 'Karymskoe', 1600), -(12410, 149, 1089, 'Ключевский', 'Klyuchevskii', 1700), -(12411, 149, 1089, 'Кокуй', 'Kokui', 1800), -(12412, 149, 1089, 'Краснокаменск', 'Krasnokamensk', 1900), -(12413, 149, 1089, 'Красный Чикой', 'Krasnyi Chikoi', 2000), -(12414, 149, 1089, 'Кыра', 'Kyra', 2100), -(12415, 149, 1089, 'Моготуй', 'Mogotui', 2200), -(12416, 149, 1089, 'Могоча', 'Mogocha', 2300), -(12417, 149, 1089, 'Нерчинск', 'Nerchinsk', 2400), -(12418, 149, 1089, 'Нерчинский Завод', 'Nerchinskii Zavod', 2500), -(12419, 149, 1089, 'Нижний Цасучей', 'Nizhnii Chasuchei', 2600), -(12420, 149, 1089, 'Оловянная', 'Olovyannaya', 2700), -(12421, 149, 1089, 'Первомайский (Читинская обл.)', 'Pervomaiskii (Chitinskaya obl.)', 2800), -(12422, 149, 1089, 'Петровск-Забайкальский', 'Petrovsk-Zabaikalskii', 2900), -(12423, 149, 1089, 'Приаргунск', 'Priargunsk', 3000), -(12424, 149, 1089, 'Сретенск', 'Sretensk', 3100), -(12425, 149, 1089, 'Тупик', 'Tupik', 3200), -(12426, 149, 1089, 'Улеты', 'Ulety', 3300), -(12427, 149, 1089, 'Хилок', 'Hilok', 3400), -(12428, 149, 1089, 'Чара', 'Chara', 3500), -(12429, 149, 1089, 'Чернышевск', 'Chernyshevsk', 3600), -(12430, 149, 1089, 'Чита', 'Chita', 3700), -(12431, 149, 1089, 'Шелопугино', 'Shelopugino', 3800), -(12432, 149, 1089, 'Шилка', 'Shilka', 3900), -(12433, 149, 1090, 'Алатырь', 'Alatyr', 100), -(12434, 149, 1090, 'Аликово', 'Alikovo', 200), -(12435, 149, 1090, 'Батырева', 'Batyreva', 300), -(12436, 149, 1090, 'Буинск', 'Buinsk', 400), -(12437, 149, 1090, 'Вурнары', 'Vurnary', 500), -(12438, 149, 1090, 'Ибреси', 'Ibresi', 600), -(12439, 149, 1090, 'Канаш', 'Kanash', 700), -(12440, 149, 1090, 'Киря', 'Kirya', 800), -(12441, 149, 1090, 'Комсомольское', 'Komsomolskoe', 900), -(12442, 149, 1090, 'Красноармейское (Чувашия)', 'Krasnoarmeiskoe (Chuvashiya)', 1000), -(12443, 149, 1090, 'Красные Четаи', 'Krasnye Chetai', 1100), -(12444, 149, 1090, 'Кугеси', 'Kugesi', 1200), -(12445, 149, 1090, 'Мариинский Посад', 'Mariinskii Posad', 1300), -(12446, 149, 1090, 'Моргауши', 'Morgaushi', 1400), -(12447, 149, 1090, 'Новочебоксарск', 'Novocheboksarsk', 1500), -(12448, 149, 1090, 'Порецкое', 'Poretskoe', 1600), -(12449, 149, 1090, 'Урмары', 'Urmary', 1700), -(12450, 149, 1090, 'Цивильск', 'Tsivilsk', 1800), -(12451, 149, 1090, 'Чебоксары', 'Cheboksary', 1900), -(12452, 149, 1090, 'Шемурша', 'Shemursha', 2000), -(12453, 149, 1090, 'Шумерля', 'Shumerlya', 2100), -(12454, 149, 1090, 'Ядрин', 'Yadrin', 2200), -(12455, 149, 1090, 'Яльчики', 'Yalchiki', 2300), -(12456, 149, 1090, 'Янтиково', 'Yantikovo', 2400), -(12457, 149, 1091, 'Анадырь (Чукотский АО)', 'Anadyr (Chukotskii AO)', 100), -(12458, 149, 1091, 'Билибино', 'Bilibino', 200), -(12459, 149, 1091, 'ПЕВЕК', 'ПЕВЕК', 300), -(12460, 149, 1092, 'Губкинский (Ямало-Ненецкий АО)', 'Gubkinskii (Yamalo-Nenetskii AO)', 100), -(12461, 149, 1092, 'Заполярный (Ямало-Ненецкий АО)', 'Zapolyarnyi (Yamalo-Nenetskii AO)', 200), -(12462, 149, 1092, 'Муравленко', 'Muravlenko', 300), -(12463, 149, 1092, 'Надым', 'Nadym', 400), -(12464, 149, 1092, 'Новый Уренгой', 'Novyi Urengoi', 500), -(12465, 149, 1092, 'Ноябрьск', 'Noyabrsk', 600), -(12466, 149, 1092, 'Пангоды', 'Пангоды', 700), -(12467, 149, 1092, 'Пуровск', 'Purovsk', 800), -(12468, 149, 1092, 'Салехард', 'Salehard', 900), -(12469, 149, 1092, 'Тазовский', 'Тазовский', 1000), -(12470, 149, 1092, 'Тарко-Сале', 'Tarko-Sale', 1100), -(12471, 149, 1093, 'Андропов', 'Andropov', 100), -(12472, 149, 1093, 'Берендеево', 'Berendeevo', 200), -(12473, 149, 1093, 'Большое Село', 'Bolshoe Selo', 300), -(12474, 149, 1093, 'Борисоглебский', 'Borisoglebskii', 400), -(12475, 149, 1093, 'Брейтово', 'Breitovo', 500), -(12476, 149, 1093, 'Бурмакино', 'Burmakino', 600), -(12477, 149, 1093, 'Варегово', 'Varegovo', 700), -(12478, 149, 1093, 'Волга', 'Volga', 800), -(12479, 149, 1093, 'Гаврилов Ям', 'Gavrilov Yam', 900), -(12480, 149, 1093, 'Данилов', 'Danilov', 1000), -(12481, 149, 1093, 'Любим', 'Lyubim', 1100), -(12482, 149, 1093, 'Мышкин', 'Myshkin', 1200), -(12483, 149, 1093, 'Некрасовское', 'Nekrasovskoe', 1300), -(12484, 149, 1093, 'Новый Некоуз', 'Novyi Nekouz', 1400), -(12485, 149, 1093, 'Переславль-Залесский', 'Pereslavl-Zalesskii', 1500), -(12486, 149, 1093, 'Пошехонье-Володарск', 'Poshehone-Volodarsk', 1600), -(12487, 149, 1093, 'Ростов', 'Rostov', 1700), -(12488, 149, 1093, 'Рыбинск', 'Rybinsk', 1800), -(12489, 149, 1093, 'Тутаев', 'Tutaev', 1900), -(12490, 149, 1093, 'Углич', 'Uglich', 2000), -(12491, 149, 1093, 'Ярославль', 'Yaroslavl', 2100), -(12492, 150, 1094, 'Кигали', 'Kigali', 100), -(12493, 151, 1095, 'Abrud', 'Abrud', 100), -(12494, 151, 1095, 'Aiud', 'Aiud', 200), -(12495, 151, 1095, 'Alba Iulia', 'Alba Iulia', 300), -(12496, 151, 1095, 'Baia de Aries', 'Baia de Aries', 400), -(12497, 151, 1095, 'Blaj', 'Blaj', 500), -(12498, 151, 1095, 'Campeni', 'Campeni', 600), -(12499, 151, 1095, 'Cugir', 'Cugir', 700), -(12500, 151, 1095, 'Ocna Mures', 'Ocna Mures', 800), -(12501, 151, 1095, 'Sebes', 'Sebes', 900), -(12502, 151, 1095, 'Teius', 'Teius', 1000), -(12503, 151, 1095, 'Zlatna', 'Zlatna', 1100), -(12504, 151, 1096, 'Arad', 'Arad', 100), -(12505, 151, 1096, 'Chisineu-Cris', 'Chisineu-Cris', 200), -(12506, 151, 1096, 'Curtici', 'Curtici', 300), -(12507, 151, 1096, 'Ineu', 'Ineu', 400), -(12508, 151, 1096, 'Lipova', 'Lipova', 500), -(12509, 151, 1096, 'Nadlac', 'Nadlac', 600), -(12510, 151, 1096, 'Pancota', 'Pancota', 700), -(12511, 151, 1096, 'Sebis', 'Sebis', 800), -(12512, 151, 1097, 'Campulung-Muscel', 'Campulung-Muscel', 100), -(12513, 151, 1097, 'Costesti', 'Costesti', 200), -(12514, 151, 1097, 'Curtea de Arges', 'Curtea de Arges', 300), -(12515, 151, 1097, 'Mioveni', 'Mioveni', 400), -(12516, 151, 1097, 'Pitesti', 'Pitesti', 500), -(12517, 151, 1097, 'Topoloveni', 'Topoloveni', 600), -(12518, 151, 1098, 'Bacau', 'Bacau', 100), -(12519, 151, 1098, 'Buhusi', 'Buhusi', 200), -(12520, 151, 1098, 'Comanesti', 'Comanesti', 300), -(12521, 151, 1098, 'Darmanesti', 'Darmanesti', 400), -(12522, 151, 1098, 'Moinesti', 'Moinesti', 500), -(12523, 151, 1098, 'Onesti', 'Onesti', 600), -(12524, 151, 1098, 'Slanic Moldova', 'Slanic Moldova', 700), -(12525, 151, 1098, 'Targu Ocna', 'Targu Ocna', 800), -(12526, 151, 1099, 'Alesd', 'Alesd', 100), -(12527, 151, 1099, 'Beius', 'Beius', 200), -(12528, 151, 1099, 'Marghita', 'Marghita', 300), -(12529, 151, 1099, 'Nucet', 'Nucet', 400), -(12530, 151, 1099, 'Oradea', 'Oradea', 500), -(12531, 151, 1099, 'Salonta', 'Salonta', 600), -(12532, 151, 1099, 'Stei', 'Stei', 700), -(12533, 151, 1099, 'Valea lui Mihai', 'Valea lui Mihai', 800), -(12534, 151, 1099, 'Vascau', 'Vascau', 900), -(12535, 151, 1100, 'Beclean', 'Beclean', 100), -(12536, 151, 1100, 'Bistrita', 'Bistrita', 200), -(12537, 151, 1100, 'Nasaud', 'Nasaud', 300), -(12538, 151, 1100, 'Sangeorz-Bai', 'Sangeorz-Bai', 400), -(12539, 151, 1101, 'Botosani', 'Botosani', 100), -(12540, 151, 1101, 'Darabani', 'Darabani', 200), -(12541, 151, 1101, 'Dorohoi', 'Dorohoi', 300), -(12542, 151, 1101, 'Saveni', 'Saveni', 400), -(12543, 151, 1102, 'Braila', 'Braila', 100), -(12544, 151, 1102, 'Faurei', 'Faurei', 200), -(12545, 151, 1102, 'Ianca', 'Ianca', 300), -(12546, 151, 1102, 'Insuratei', 'Insuratei', 400), -(12547, 151, 1103, 'Brasov', 'Brasov', 100), -(12548, 151, 1103, 'Codlea', 'Codlea', 200), -(12549, 151, 1103, 'Fagaras', 'Fagaras', 300), -(12550, 151, 1103, 'Predeal', 'Predeal', 400), -(12551, 151, 1103, 'Rasnov', 'Rasnov', 500), -(12552, 151, 1103, 'Rupea', 'Rupea', 600), -(12553, 151, 1103, 'Sacele', 'Sacele', 700), -(12554, 151, 1103, 'Victoria', 'Victoria', 800), -(12555, 151, 1103, 'Zarnesti', 'Zarnesti', 900), -(12556, 151, 1104, 'Bucuresti', 'Bucuresti', 100), -(12557, 151, 1105, 'Buzau', 'Buzau', 100), -(12558, 151, 1105, 'Nehoiu', 'Nehoiu', 200), -(12559, 151, 1105, 'Pogoanele', 'Pogoanele', 300), -(12560, 151, 1105, 'Ramnicu Sarat', 'Ramnicu Sarat', 400), -(12561, 151, 1106, 'Budesti', 'Budesti', 100), -(12562, 151, 1106, 'Calarasi', 'Calarasi', 200), -(12563, 151, 1106, 'Fundulea', 'Fundulea', 300), -(12564, 151, 1106, 'Lehliu Gara', 'Lehliu Gara', 400), -(12565, 151, 1106, 'Oltenita', 'Oltenita', 500), -(12566, 151, 1107, 'Anina', 'Anina', 100), -(12567, 151, 1107, 'Baile Herculane', 'Baile Herculane', 200), -(12568, 151, 1107, 'Bocsa', 'Bocsa', 300), -(12569, 151, 1107, 'Caransebes', 'Caransebes', 400), -(12570, 151, 1107, 'Moldova Noua', 'Moldova Noua', 500), -(12571, 151, 1107, 'Oravita', 'Oravita', 600), -(12572, 151, 1107, 'Otelu Rosu', 'Otelu Rosu', 700), -(12573, 151, 1107, 'Resita', 'Resita', 800), -(12574, 151, 1108, 'Campia-Turzii', 'Campia-Turzii', 100), -(12575, 151, 1108, 'Cluj-Napoca', 'Cluj-Napoca', 200), -(12576, 151, 1108, 'Dej', 'Dej', 300), -(12577, 151, 1108, 'Gherla', 'Gherla', 400), -(12578, 151, 1108, 'Huedin', 'Huedin', 500), -(12579, 151, 1108, 'Turda', 'Turda', 600), -(12580, 151, 1109, 'Basarabi', 'Basarabi', 100), -(12581, 151, 1109, 'Cernavoda', 'Cernavoda', 200), -(12582, 151, 1109, 'Constanta', 'Constanta', 300), -(12583, 151, 1109, 'Eforie', 'Eforie', 400), -(12584, 151, 1109, 'Harsova', 'Harsova', 500), -(12585, 151, 1109, 'Mangalia', 'Mangalia', 600), -(12586, 151, 1109, 'Medgidia', 'Medgidia', 700), -(12587, 151, 1109, 'Navodari', 'Navodari', 800), -(12588, 151, 1109, 'Negru Voda', 'Negru Voda', 900), -(12589, 151, 1109, 'Ovidiu', 'Ovidiu', 1000), -(12590, 151, 1109, 'Techirghiol', 'Techirghiol', 1100), -(12591, 151, 1110, 'Baraolt', 'Baraolt', 100), -(12592, 151, 1110, 'Covasna', 'Covasna', 200), -(12593, 151, 1110, 'Intorsura Buzaului', 'Intorsura Buzaului', 300), -(12594, 151, 1110, 'Sfntu Gheorghe', 'Sfntu Gheorghe', 400), -(12595, 151, 1110, 'Targu Secuiesc', 'Targu Secuiesc', 500), -(12596, 151, 1111, 'Fieni', 'Fieni', 100), -(12597, 151, 1111, 'Gaesti', 'Gaesti', 200), -(12598, 151, 1111, 'Moreni', 'Moreni', 300), -(12599, 151, 1111, 'Pucioasa', 'Pucioasa', 400), -(12600, 151, 1111, 'Targoviste', 'Targoviste', 500), -(12601, 151, 1111, 'Titu', 'Titu', 600), -(12602, 151, 1112, 'Bailesti', 'Bailesti', 100), -(12603, 151, 1112, 'Calafat', 'Calafat', 200), -(12604, 151, 1112, 'Craiova', 'Craiova', 300), -(12605, 151, 1112, 'Filiasi', 'Filiasi', 400), -(12606, 151, 1112, 'Segarcea', 'Segarcea', 500), -(12607, 151, 1113, 'Beresti', 'Beresti', 100), -(12608, 151, 1113, 'Galati', 'Galati', 200), -(12609, 151, 1113, 'Targu Bujor', 'Targu Bujor', 300), -(12610, 151, 1113, 'Tecuci', 'Tecuci', 400), -(12611, 151, 1114, 'Bolintin-Vale', 'Bolintin-Vale', 100), -(12612, 151, 1114, 'Giurgiu', 'Giurgiu', 200), -(12613, 151, 1114, 'Mihailesti', 'Mihailesti', 300), -(12614, 151, 1115, 'Bumbesti-Jiu', 'Bumbesti-Jiu', 100), -(12615, 151, 1115, 'Motru', 'Motru', 200), -(12616, 151, 1115, 'Novaci', 'Novaci', 300), -(12617, 151, 1115, 'Rovinari', 'Rovinari', 400), -(12618, 151, 1115, 'Targu Carbunesti', 'Targu Carbunesti', 500), -(12619, 151, 1115, 'Targu Jiu', 'Targu Jiu', 600), -(12620, 151, 1115, 'Ticleni', 'Ticleni', 700), -(12621, 151, 1115, 'Tismana', 'Tismana', 800), -(12622, 151, 1116, 'Baile Tusnad', 'Baile Tusnad', 100), -(12623, 151, 1116, 'Balan', 'Balan', 200), -(12624, 151, 1116, 'Borsec', 'Borsec', 300), -(12625, 151, 1116, 'Cristuru Secuiesc', 'Cristuru Secuiesc', 400), -(12626, 151, 1116, 'Gheorgheni', 'Gheorgheni', 500), -(12627, 151, 1116, 'Miercurea Ciuc', 'Miercurea Ciuc', 600), -(12628, 151, 1116, 'Odorheiu Secuiesc', 'Odorheiu Secuiesc', 700), -(12629, 151, 1116, 'Toplita', 'Toplita', 800), -(12630, 151, 1116, 'Vlahita', 'Vlahita', 900), -(12631, 151, 1117, 'Aninoasa', 'Aninoasa', 100), -(12632, 151, 1117, 'Brad', 'Brad', 200), -(12633, 151, 1117, 'Calan', 'Calan', 300), -(12634, 151, 1117, 'Deva', 'Deva', 400), -(12635, 151, 1117, 'Geoagiu', 'Geoagiu', 500), -(12636, 151, 1117, 'Hateg', 'Hateg', 600), -(12637, 151, 1117, 'Hunedoara', 'Hunedoara', 700), -(12638, 151, 1117, 'Lupeni', 'Lupeni', 800), -(12639, 151, 1117, 'Orastie', 'Orastie', 900), -(12640, 151, 1117, 'Petrosani', 'Petrosani', 1000), -(12641, 151, 1117, 'Simeria', 'Simeria', 1100), -(12642, 151, 1117, 'Uricani', 'Uricani', 1200), -(12643, 151, 1117, 'Vulcan', 'Vulcan', 1300), -(12644, 151, 1118, 'Fetesti', 'Fetesti', 100), -(12645, 151, 1118, 'Slobozia', 'Slobozia', 200), -(12646, 151, 1118, 'Tandarei', 'Tandarei', 300), -(12647, 151, 1118, 'Urziceni', 'Urziceni', 400), -(12648, 151, 1119, 'Harlau', 'Harlau', 100), -(12649, 151, 1119, 'Iasi', 'Iasi', 200), -(12650, 151, 1119, 'Pascani', 'Pascani', 300), -(12651, 151, 1119, 'Targu Frumos', 'Targu Frumos', 400), -(12652, 151, 1120, 'Buftea', 'Buftea', 100), -(12653, 151, 1120, 'Otopeni', 'Otopeni', 200), -(12654, 151, 1121, 'Baia Mare', 'Baia Mare', 100), -(12655, 151, 1121, 'Baia Sprie', 'Baia Sprie', 200), -(12656, 151, 1121, 'Borsa', 'Borsa', 300), -(12657, 151, 1121, 'Cavnic', 'Cavnic', 400), -(12658, 151, 1121, 'Seini', 'Seini', 500), -(12659, 151, 1121, 'Sighetu Marmatiei', 'Sighetu Marmatiei', 600), -(12660, 151, 1121, 'Targu Lapus', 'Targu Lapus', 700), -(12661, 151, 1121, 'Viseu de Sus', 'Viseu de Sus', 800), -(12662, 151, 1122, 'Baia de Arama', 'Baia de Arama', 100), -(12663, 151, 1122, 'Drobeta-Turnu-Severin', 'Drobeta-Turnu-Severin', 200), -(12664, 151, 1122, 'Orsova', 'Orsova', 300), -(12665, 151, 1122, 'Strehaia', 'Strehaia', 400), -(12666, 151, 1122, 'Vanju Mare', 'Vanju Mare', 500), -(12667, 151, 1123, 'Iernut', 'Iernut', 100), -(12668, 151, 1123, 'Ludus', 'Ludus', 200), -(12669, 151, 1123, 'Reghin', 'Reghin', 300), -(12670, 151, 1123, 'Sighisoara', 'Sighisoara', 400), -(12671, 151, 1123, 'Sovata', 'Sovata', 500), -(12672, 151, 1123, 'Targu Mures', 'Targu Mures', 600), -(12673, 151, 1123, 'Tarnaveni', 'Tarnaveni', 700), -(12674, 151, 1124, 'Bicaz', 'Bicaz', 100), -(12675, 151, 1124, 'Piatra Neamt', 'Piatra Neamt', 200), -(12676, 151, 1124, 'Roman', 'Roman', 300), -(12677, 151, 1124, 'Targu Neam', 'Targu Neam', 400), -(12678, 151, 1125, 'Bals', 'Bals', 100), -(12679, 151, 1125, 'Corabia', 'Corabia', 200), -(12680, 151, 1125, 'Draganesti-Olt', 'Draganesti-Olt', 300), -(12681, 151, 1125, 'Piatra Olt', 'Piatra Olt', 400), -(12682, 151, 1125, 'Scornicesti', 'Scornicesti', 500), -(12683, 151, 1125, 'Slatina', 'Slatina', 600), -(12684, 151, 1126, 'Azuga', 'Azuga', 100), -(12685, 151, 1126, 'Baicoi', 'Baicoi', 200), -(12686, 151, 1126, 'Boldesti-Scaeni', 'Boldesti-Scaeni', 300), -(12687, 151, 1126, 'Breaza', 'Breaza', 400), -(12688, 151, 1126, 'Busteni', 'Busteni', 500), -(12689, 151, 1126, 'Campina', 'Campina', 600), -(12690, 151, 1126, 'Comarnic', 'Comarnic', 700), -(12691, 151, 1126, 'Mizil', 'Mizil', 800), -(12692, 151, 1126, 'Ploiesti', 'Ploiesti', 900), -(12693, 151, 1126, 'Plopeni', 'Plopeni', 1000), -(12694, 151, 1126, 'Sinaia', 'Sinaia', 1100), -(12695, 151, 1126, 'Slanic', 'Slanic', 1200), -(12696, 151, 1126, 'Urlai', 'Urlai', 1300), -(12697, 151, 1126, 'Valenii de Munte', 'Valenii de Munte', 1400), -(12698, 151, 1127, 'Cehu Silvaniei', 'Cehu Silvaniei', 100), -(12699, 151, 1127, 'Jibou', 'Jibou', 200), -(12700, 151, 1127, 'Simleu Silvaniei', 'Simleu Silvaniei', 300), -(12701, 151, 1127, 'Zalau', 'Zalau', 400), -(12702, 151, 1128, 'Carei', 'Carei', 100), -(12703, 151, 1128, 'Negresti-Oas', 'Negresti-Oas', 200), -(12704, 151, 1128, 'Satu Mare', 'Satu Mare', 300), -(12705, 151, 1128, 'Tasnad', 'Tasnad', 400), -(12706, 151, 1129, 'Agnita', 'Agnita', 100), -(12707, 151, 1129, 'Avrig', 'Avrig', 200), -(12708, 151, 1129, 'Cisnadie', 'Cisnadie', 300), -(12709, 151, 1129, 'Copsa Mica', 'Copsa Mica', 400), -(12710, 151, 1129, 'Dumbraveni', 'Dumbraveni', 500), -(12711, 151, 1129, 'Medias', 'Medias', 600), -(12712, 151, 1129, 'Ocna Sibiului', 'Ocna Sibiului', 700), -(12713, 151, 1129, 'Sibiu', 'Sibiu', 800), -(12714, 151, 1129, 'Talmaciu', 'Talmaciu', 900), -(12715, 151, 1130, 'Campulung Moldovenesc', 'Campulung Moldovenesc', 100), -(12716, 151, 1130, 'Falticeni', 'Falticeni', 200), -(12717, 151, 1130, 'Gura Humorului', 'Gura Humorului', 300), -(12718, 151, 1130, 'Radauti', 'Radauti', 400), -(12719, 151, 1130, 'Siret', 'Siret', 500), -(12720, 151, 1130, 'Solca', 'Solca', 600), -(12721, 151, 1130, 'Suceava', 'Suceava', 700), -(12722, 151, 1130, 'Vatra Dornei', 'Vatra Dornei', 800), -(12723, 151, 1131, 'Alexandria', 'Alexandria', 100), -(12724, 151, 1131, 'Rosiori de Vede', 'Rosiori de Vede', 200), -(12725, 151, 1131, 'Turnu Magurele', 'Turnu Magurele', 300), -(12726, 151, 1131, 'Videle', 'Videle', 400), -(12727, 151, 1131, 'Zimnicea', 'Zimnicea', 500), -(12728, 151, 1132, 'Buzias', 'Buzias', 100), -(12729, 151, 1132, 'Deta', 'Deta', 200), -(12730, 151, 1132, 'Faget', 'Faget', 300), -(12731, 151, 1132, 'Jimbolia', 'Jimbolia', 400), -(12732, 151, 1132, 'Lugoj', 'Lugoj', 500), -(12733, 151, 1132, 'Sannicolau Mare', 'Sannicolau Mare', 600), -(12734, 151, 1132, 'Timisoara', 'Timisoara', 700), -(12735, 151, 1133, 'Babadag', 'Babadag', 100), -(12736, 151, 1133, 'Isaccea', 'Isaccea', 200), -(12737, 151, 1133, 'Macin', 'Macin', 300), -(12738, 151, 1133, 'Sulina', 'Sulina', 400), -(12739, 151, 1133, 'Tulcea', 'Tulcea', 500), -(12740, 151, 1134, 'Baile Govora', 'Baile Govora', 100), -(12741, 151, 1134, 'Baile Olanesti', 'Baile Olanesti', 200), -(12742, 151, 1134, 'Brezoi', 'Brezoi', 300), -(12743, 151, 1134, 'Calimanesti-Caciulata', 'Calimanesti-Caciulata', 400), -(12744, 151, 1134, 'Dragasani', 'Dragasani', 500), -(12745, 151, 1134, 'Horezu', 'Horezu', 600), -(12746, 151, 1134, 'Ocnele Mari', 'Ocnele Mari', 700), -(12747, 151, 1134, 'Rmnicu Vlcea', 'Rmnicu Vlcea', 800), -(12748, 151, 1135, 'Barlad', 'Barlad', 100), -(12749, 151, 1135, 'Husi', 'Husi', 200), -(12750, 151, 1135, 'Negresti', 'Negresti', 300), -(12751, 151, 1135, 'Vaslui', 'Vaslui', 400), -(12752, 151, 1136, 'Adjud', 'Adjud', 100), -(12753, 151, 1136, 'Focsani', 'Focsani', 200), -(12754, 151, 1136, 'Marasesti', 'Marasesti', 300), -(12755, 151, 1136, 'Odobesti', 'Odobesti', 400), -(12756, 151, 1136, 'Panciu', 'Panciu', 500), -(12757, 152, 1137, 'Ахуачапан', 'Ахуачапан', 100), -(12758, 152, 1138, 'Нуэва Сан Салвадор', 'Нуэва Сан Салвадор', 100), -(12759, 152, 1139, 'Закатеколука', 'Закатеколука', 100), -(12760, 152, 1140, 'Ла Унион', 'Ла Унион', 100), -(12761, 152, 1141, 'Сан Мигуэл', 'Сан Мигуэл', 100), -(12762, 152, 1142, 'Сан-Сальвадор', 'Сан-Сальвадор', 100), -(12763, 153, 1143, 'Алиа', 'Alia', 100), -(12764, 153, 1143, 'Паго-Паго', 'Pago-Pago', 200), -(12765, 154, 1144, 'Acquaviva', 'Acquaviva', 100), -(12766, 154, 1145, 'Chiesanuova', 'Chiesanuova', 100), -(12767, 154, 1146, 'Falciano', 'Falciano', 100), -(12768, 154, 1146, 'Serravalle', 'Serravalle', 200), -(12769, 155, 1147, 'Сан-Томе', 'Сан-Томе', 100), -(12770, 156, 1148, 'Бурайда', 'Buraida', 100), -(12771, 156, 1148, 'Дамам', 'Damam', 200), -(12772, 156, 1148, 'Джидда', 'Djidda', 300), -(12773, 156, 1148, 'Мекка', 'Mekka', 400), -(12774, 156, 1148, 'Эль-Бир', 'El''-Bir', 500), -(12775, 156, 1148, 'Эр-Рияд', 'Er-Riad', 600), -(12776, 157, 1149, 'Мбабане', 'Mbabane', 100), -(12777, 158, 1150, 'Кастри', 'Castries', 100), -(12778, 159, 1151, 'Джеймстаун', 'Jamestown', 100), -(12779, 160, 1152, 'Dagu', 'Dagu', 100), -(12780, 161, 1153, 'Виктория', 'Victoria', 100), -(12781, 162, 1154, 'Сен-Пьер', 'Saint Pierre', 100), -(12782, 163, 1155, 'Дакар', 'Dakar', 100), -(12783, 164, 1156, 'Бастер', 'Basseterre', 100), -(12784, 165, 1157, 'Кингстаун', 'Kingstown', 100), -(12785, 166, 1158, 'Западная Бачка округ', 'Western District of tank', 100), -(12786, 166, 1158, 'Северная Бачка округ', 'Northern District of tank', 200), -(12787, 166, 1158, 'Северно-Банатский округ', 'North Banatsky District', 300), -(12788, 166, 1158, 'Средне-Банатский округ', 'Mid-Banatsky District', 400), -(12789, 166, 1158, 'Сремский округ', 'Sremska District', 500), -(12790, 166, 1158, 'Южная Бачка округ', 'South tank District', 600), -(12791, 166, 1158, 'Южно-Банатский округ', 'Southern District Banatsky', 700), -(12792, 166, 1159, 'Косовскомитровачский округ', 'Kosovskomitrovachsky District', 100), -(12793, 166, 1159, 'Призренский округ', 'Prizren District', 200), -(12794, 166, 1160, 'Белград', 'Belgrade', 100), -(12795, 166, 1160, 'Борский округ', 'Bor District', 200), -(12796, 166, 1160, 'Заечарский округ', 'Zaecharsky District', 300), -(12797, 166, 1160, 'Златиборский округ', 'Zlatiborsky District', 400), -(12798, 166, 1160, 'Моравичский округ', 'Moravichsky District', 500), -(12799, 166, 1160, 'Нишавский округ', 'Nishavski District', 600), -(12800, 166, 1160, 'округ Рашка', 'District Raka', 700), -(12801, 166, 1160, 'Поморавский округ', 'Pomoravsky District', 800), -(12802, 166, 1160, 'Расинский округ', 'Rasinsky District', 900), -(12803, 166, 1160, 'Шумадийский округ', 'Shumadiysky District', 1000), -(12804, 166, 1160, 'Ябланичский округ', 'Yablanichsky District', 1100), -(12805, 167, 1161, 'Сингапур', 'Singapore', 100), -(12806, 168, 1162, 'Дамаск', 'Damascus', 100), -(12807, 169, 1163, 'Bratislava', 'Bratislava', 100), -(12808, 169, 1163, 'Bratislava-mesto', 'Bratislava-mesto', 200), -(12809, 169, 1163, 'Pozsony', 'Pozsony', 300), -(12810, 169, 1164, 'Kaschau', 'Kaschau', 100), -(12811, 169, 1164, 'Kassa', 'Kassa', 200), -(12812, 169, 1164, 'Kosice', 'Kosice', 300), -(12813, 169, 1165, 'Nitra', 'Nitra', 100), -(12814, 169, 1166, 'Abrahamovce', 'Abrahamovce', 100), -(12815, 169, 1166, 'Aha', 'Aha', 200), -(12816, 169, 1166, 'Dunajsk Streda', 'Dunajsk Streda', 300), -(12817, 169, 1166, 'Michalovce', 'Michalovce', 400), -(12818, 169, 1166, 'Prievidza', 'Prievidza', 500), -(12819, 169, 1166, 'Zvolen', 'Zvolen', 600), -(12820, 169, 1167, 'Presov', 'Presov', 100), -(12821, 169, 1168, 'Trencin', 'Trencin', 100), -(12822, 169, 1169, 'Trnava', 'Trnava', 100), -(12823, 170, 1170, 'Dvori', 'Dvori', 100), -(12824, 170, 1170, 'Valica', 'Valica', 200), -(12825, 170, 1171, 'Brezovec', 'Brezovec', 100), -(12826, 170, 1171, 'Preseka', 'Preseka', 200), -(12827, 170, 1172, 'Celje', 'Celje', 100), -(12828, 170, 1172, 'Dol pri Hrastniku', 'Dol pri Hrastniku', 200), -(12829, 170, 1172, 'Ljubljana', 'Ljubljana', 300), -(12830, 170, 1172, 'Maribor', 'Maribor', 400), -(12831, 170, 1172, 'Nemcavci', 'Nemcavci', 500), -(12832, 170, 1172, 'Nova Gorica', 'Nova Gorica', 600), -(12833, 170, 1172, 'Portorose', 'Portorose', 700), -(12834, 170, 1172, 'Velenje', 'Velenje', 800), -(12835, 171, 1173, 'Хониара', 'Honiara', 100), -(12836, 172, 1174, 'Могадишо', 'Mogadishu', 100), -(12837, 173, 1175, 'Вади-Хальфа', 'Vadi-Hal''fa', 100), -(12838, 173, 1175, 'Вау', 'Vau', 200), -(12839, 173, 1175, 'Джуба', 'Djuba', 300), -(12840, 173, 1175, 'Малакаль', 'Malakal''', 400), -(12841, 173, 1175, 'Омдурман', 'Omdurman', 500), -(12842, 173, 1175, 'Порт-Судан', 'Port-Sudan', 600), -(12843, 173, 1175, 'Хартум', 'Hartum', 700), -(12844, 173, 1175, 'Эль-Обейд', 'El''-Obeiyd', 800), -(12845, 174, 1176, 'Парамарибо', 'Paramaribo', 100), -(12846, 175, 1177, 'Abbeville', 'Abbeville', 100), -(12847, 175, 1177, 'Abernant', 'Abernant', 200), -(12848, 175, 1177, 'Addison', 'Addison', 300), -(12849, 175, 1177, 'Adger', 'Adger', 400), -(12850, 175, 1177, 'Akron', 'Akron', 500), -(12851, 175, 1177, 'Alberta', 'Alberta', 600), -(12852, 175, 1177, 'Alma', 'Alma', 700), -(12853, 175, 1177, 'Alpine', 'Alpine', 800), -(12854, 175, 1177, 'Alton', 'Alton', 900), -(12855, 175, 1177, 'Auburn', 'Auburn', 1000), -(12856, 175, 1177, 'Birmingham', 'Birmingham', 1100), -(12857, 175, 1177, 'Bon Air', 'Bon Air', 1200), -(12858, 175, 1177, 'Campbell', 'Campbell', 1300), -(12859, 175, 1177, 'Cullman', 'Cullman', 1400), -(12860, 175, 1177, 'Decatur', 'Decatur', 1500), -(12861, 175, 1177, 'Delmar', 'Delmar', 1600), -(12862, 175, 1177, 'Detroit', 'Detroit', 1700), -(12863, 175, 1177, 'Fort Rucker', 'Fort Rucker', 1800), -(12864, 175, 1177, 'Gadsden', 'Gadsden', 1900), -(12865, 175, 1177, 'Greensboro', 'Greensboro', 2000), -(12866, 175, 1177, 'Gulf Shores', 'Gulf Shores', 2100), -(12867, 175, 1177, 'Hollywood', 'Hollywood', 2200), -(12868, 175, 1177, 'Huntsville', 'Huntsville', 2300), -(12869, 175, 1177, 'Jacksonville', 'Jacksonville', 2400), -(12870, 175, 1177, 'Mobile', 'Mobile', 2500), -(12871, 175, 1177, 'Montgomery', 'Montgomery', 2600), -(12872, 175, 1177, 'Opp', 'Opp', 2700), -(12873, 175, 1177, 'Orange Beach', 'Orange Beach', 2800), -(12874, 175, 1177, 'Sweet Water', 'Sweet Water', 2900), -(12875, 175, 1177, 'Troy', 'Troy', 3000), -(12876, 175, 1177, 'York', 'York', 3100), -(12877, 175, 1178, 'Adak', 'Adak', 100), -(12878, 175, 1178, 'Aleknagik', 'Aleknagik', 200), -(12879, 175, 1178, 'Ambler', 'Ambler', 300), -(12880, 175, 1178, 'Anchorage', 'Anchorage', 400), -(12881, 175, 1178, 'Angoon', 'Angoon', 500), -(12882, 175, 1178, 'Atka', 'Atka', 600), -(12883, 175, 1178, 'Auke Bay', 'Auke Bay', 700), -(12884, 175, 1178, 'Barrow', 'Barrow', 800), -(12885, 175, 1178, 'Big Lake', 'Big Lake', 900), -(12886, 175, 1178, 'Cordova', 'Cordova', 1000), -(12887, 175, 1178, 'Delta Junction', 'Delta Junction', 1100), -(12888, 175, 1178, 'Douglas', 'Douglas', 1200), -(12889, 175, 1178, 'Fairbanks', 'Fairbanks', 1300), -(12890, 175, 1178, 'Funny River', 'Funny River', 1400), -(12891, 175, 1178, 'Homer', 'Homer', 1500), -(12892, 175, 1178, 'Juneau', 'Juneau', 1600), -(12893, 175, 1178, 'Kenai', 'Kenai', 1700), -(12894, 175, 1178, 'Ketchikan', 'Ketchikan', 1800), -(12895, 175, 1178, 'Nome', 'Nome', 1900), -(12896, 175, 1178, 'North Pole', 'North Pole', 2000), -(12897, 175, 1178, 'Petersburg', 'Petersburg', 2100), -(12898, 175, 1178, 'Russian Mission', 'Russian Mission', 2200), -(12899, 175, 1178, 'Wasilla', 'Wasilla', 2300), -(12900, 175, 1178, 'Yakutat', 'Yakutat', 2400), -(12901, 175, 1179, 'Pago Pago', 'Pago Pago', 100), -(12902, 175, 1180, 'Aguila', 'Aguila', 100), -(12903, 175, 1180, 'Ajo', 'Ajo', 200), -(12904, 175, 1180, 'Alpine', 'Alpine', 300), -(12905, 175, 1180, 'Amado', 'Amado', 400), -(12906, 175, 1180, 'Arivaca', 'Arivaca', 500), -(12907, 175, 1180, 'Arizona City', 'Arizona City', 600), -(12908, 175, 1180, 'Ash Fork', 'Ash Fork', 700), -(12909, 175, 1180, 'Avondale', 'Avondale', 800), -(12910, 175, 1180, 'Benson', 'Benson', 900), -(12911, 175, 1180, 'Big Park', 'Big Park', 1000), -(12912, 175, 1180, 'Bullhead City', 'Bullhead City', 1100), -(12913, 175, 1180, 'Carefree', 'Carefree', 1200), -(12914, 175, 1180, 'Casa Grande', 'Casa Grande', 1300), -(12915, 175, 1180, 'Chandler', 'Chandler', 1400), -(12916, 175, 1180, 'Colorado City', 'Colorado City', 1500), -(12917, 175, 1180, 'Flagstaff', 'Flagstaff', 1600), -(12918, 175, 1180, 'Fort Huachuca', 'Fort Huachuca', 1700), -(12919, 175, 1180, 'Gilbert', 'Gilbert', 1800), -(12920, 175, 1180, 'Glendale', 'Glendale', 1900), -(12921, 175, 1180, 'Kingman', 'Kingman', 2000), -(12922, 175, 1180, 'Lake Havasu City', 'Lake Havasu City', 2100), -(12923, 175, 1180, 'Lake Montezuma', 'Lake Montezuma', 2200), -(12924, 175, 1180, 'Lakeside', 'Lakeside', 2300), -(12925, 175, 1180, 'Maricopa', 'Maricopa', 2400), -(12926, 175, 1180, 'Mesa', 'Mesa', 2500), -(12927, 175, 1180, 'Miami', 'Miami', 2600), -(12928, 175, 1180, 'Paradise Valley', 'Paradise Valley', 2700), -(12929, 175, 1180, 'Payson', 'Payson', 2800), -(12930, 175, 1180, 'Peoria', 'Peoria', 2900), -(12931, 175, 1180, 'Phoenix', 'Phoenix', 3000), -(12932, 175, 1180, 'Prescott Valley', 'Prescott Valley', 3100), -(12933, 175, 1180, 'Scottsdale', 'Scottsdale', 3200), -(12934, 175, 1180, 'Tempe', 'Tempe', 3300), -(12935, 175, 1180, 'Thatcher', 'Thatcher', 3400), -(12936, 175, 1180, 'Tucson', 'Tucson', 3500), -(12937, 175, 1181, 'Alicia', 'Alicia', 100), -(12938, 175, 1181, 'Avoca', 'Avoca', 200), -(12939, 175, 1181, 'Bentonville', 'Bentonville', 300), -(12940, 175, 1181, 'Chidester', 'Chidester', 400), -(12941, 175, 1181, 'Conway', 'Conway', 500), -(12942, 175, 1181, 'England', 'England', 600); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(12943, 175, 1181, 'Fayetteville', 'Fayetteville', 700), -(12944, 175, 1181, 'Lavaca', 'Lavaca', 800), -(12945, 175, 1181, 'Little Rock', 'Little Rock', 900), -(12946, 175, 1181, 'Magnolia', 'Magnolia', 1000), -(12947, 175, 1181, 'Paris', 'Paris', 1100), -(12948, 175, 1181, 'Pine Bluff', 'Pine Bluff', 1200), -(12949, 175, 1181, 'Sims', 'Sims', 1300), -(12950, 175, 1182, 'Acampo', 'Acampo', 100), -(12951, 175, 1182, 'Acton', 'Acton', 200), -(12952, 175, 1182, 'Adelanto', 'Adelanto', 300), -(12953, 175, 1182, 'Adin', 'Adin', 400), -(12954, 175, 1182, 'Aguanga', 'Aguanga', 500), -(12955, 175, 1182, 'Ahwahnee', 'Ahwahnee', 600), -(12956, 175, 1182, 'Alameda', 'Alameda', 700), -(12957, 175, 1182, 'Alamo', 'Alamo', 800), -(12958, 175, 1182, 'Albany', 'Albany', 900), -(12959, 175, 1182, 'Aliso Viejo', 'Aliso Viejo', 1000), -(12960, 175, 1182, 'Alleghany', 'Alleghany', 1100), -(12961, 175, 1182, 'Alta', 'Alta', 1200), -(12962, 175, 1182, 'Alta Loma', 'Alta Loma', 1300), -(12963, 175, 1182, 'Altadena', 'Altadena', 1400), -(12964, 175, 1182, 'Amador City', 'Amador City', 1500), -(12965, 175, 1182, 'Amboy', 'Amboy', 1600), -(12966, 175, 1182, 'American Canyon', 'American Canyon', 1700), -(12967, 175, 1182, 'Anaheim', 'Anaheim', 1800), -(12968, 175, 1182, 'Anderson', 'Anderson', 1900), -(12969, 175, 1182, 'Angels Camp', 'Angels Camp', 2000), -(12970, 175, 1182, 'Annapolis', 'Annapolis', 2100), -(12971, 175, 1182, 'Antelope', 'Antelope', 2200), -(12972, 175, 1182, 'Arcadia', 'Arcadia', 2300), -(12973, 175, 1182, 'Auburn', 'Auburn', 2400), -(12974, 175, 1182, 'Avenal', 'Avenal', 2500), -(12975, 175, 1182, 'Bakersfield', 'Bakersfield', 2600), -(12976, 175, 1182, 'Barstow', 'Barstow', 2700), -(12977, 175, 1182, 'Bass Lake', 'Bass Lake', 2800), -(12978, 175, 1182, 'Belmont', 'Belmont', 2900), -(12979, 175, 1182, 'Berkeley', 'Berkeley', 3000), -(12980, 175, 1182, 'Beverly Hills', 'Beverly Hills', 3100), -(12981, 175, 1182, 'Big Bar', 'Big Bar', 3200), -(12982, 175, 1182, 'Bishop', 'Bishop', 3300), -(12983, 175, 1182, 'Blue Lake', 'Blue Lake', 3400), -(12984, 175, 1182, 'Boyes Hot Springs', 'Boyes Hot Springs', 3500), -(12985, 175, 1182, 'Brea', 'Brea', 3600), -(12986, 175, 1182, 'Brentwood', 'Brentwood', 3700), -(12987, 175, 1182, 'Brooks', 'Brooks', 3800), -(12988, 175, 1182, 'Burbank', 'Burbank', 3900), -(12989, 175, 1182, 'Calabasas', 'Calabasas', 4000), -(12990, 175, 1182, 'California City', 'California City', 4100), -(12991, 175, 1182, 'California Hot Springs', 'California Hot Springs', 4200), -(12992, 175, 1182, 'Camarillo', 'Camarillo', 4300), -(12993, 175, 1182, 'Campbell', 'Campbell', 4400), -(12994, 175, 1182, 'Cantil', 'Cantil', 4500), -(12995, 175, 1182, 'Capistrano Beach', 'Capistrano Beach', 4600), -(12996, 175, 1182, 'Carlsbad', 'Carlsbad', 4700), -(12997, 175, 1182, 'Carmichael', 'Carmichael', 4800), -(12998, 175, 1182, 'Castro Valley', 'Castro Valley', 4900), -(12999, 175, 1182, 'Cazadero', 'Cazadero', 5000), -(13000, 175, 1182, 'Ceres', 'Ceres', 5100), -(13001, 175, 1182, 'Chicago Park', 'Chicago Park', 5200), -(13002, 175, 1182, 'Chico', 'Chico', 5300), -(13003, 175, 1182, 'Chino', 'Chino', 5400), -(13004, 175, 1182, 'Chula Vista', 'Chula Vista', 5500), -(13005, 175, 1182, 'Citrus Heights', 'Citrus Heights', 5600), -(13006, 175, 1182, 'Clovis', 'Clovis', 5700), -(13007, 175, 1182, 'Concord', 'Concord', 5800), -(13008, 175, 1182, 'Cool', 'Cool', 5900), -(13009, 175, 1182, 'Corona', 'Corona', 6000), -(13010, 175, 1182, 'Coronado', 'Coronado', 6100), -(13011, 175, 1182, 'Corte Madera', 'Corte Madera', 6200), -(13012, 175, 1182, 'Costa Mesa', 'Costa Mesa', 6300), -(13013, 175, 1182, 'Covina', 'Covina', 6400), -(13014, 175, 1182, 'Coyote', 'Coyote', 6500), -(13015, 175, 1182, 'Crest Park', 'Crest Park', 6600), -(13016, 175, 1182, 'Cupertino', 'Cupertino', 6700), -(13017, 175, 1182, 'Daly City', 'Daly City', 6800), -(13018, 175, 1182, 'Danville', 'Danville', 6900), -(13019, 175, 1182, 'Davis', 'Davis', 7000), -(13020, 175, 1182, 'Del Mar', 'Del Mar', 7100), -(13021, 175, 1182, 'Dos Rios', 'Dos Rios', 7200), -(13022, 175, 1182, 'Dublin', 'Dublin', 7300), -(13023, 175, 1182, 'Dunnigan', 'Dunnigan', 7400), -(13024, 175, 1182, 'El Cajon', 'El Cajon', 7500), -(13025, 175, 1182, 'El Cerrito', 'El Cerrito', 7600), -(13026, 175, 1182, 'El Dorado Hills', 'El Dorado Hills', 7700), -(13027, 175, 1182, 'Encino', 'Encino', 7800), -(13028, 175, 1182, 'Eureka', 'Eureka', 7900), -(13029, 175, 1182, 'Fairfield', 'Fairfield', 8000), -(13030, 175, 1182, 'Foster City', 'Foster City', 8100), -(13031, 175, 1182, 'Fountain Valley', 'Fountain Valley', 8200), -(13032, 175, 1182, 'Fremont', 'Fremont', 8300), -(13033, 175, 1182, 'Fresno', 'Fresno', 8400), -(13034, 175, 1182, 'Gerber', 'Gerber', 8500), -(13035, 175, 1182, 'Gilroy', 'Gilroy', 8600), -(13036, 175, 1182, 'Glendale', 'Glendale', 8700), -(13037, 175, 1182, 'Granada Hills', 'Granada Hills', 8800), -(13038, 175, 1182, 'Half Moon Bay', 'Half Moon Bay', 8900), -(13039, 175, 1182, 'Hayward', 'Hayward', 9000), -(13040, 175, 1182, 'Holy City', 'Holy City', 9100), -(13041, 175, 1182, 'Huntington Beach', 'Huntington Beach', 9200), -(13042, 175, 1182, 'Huntington Park', 'Huntington Park', 9300), -(13043, 175, 1182, 'Ione', 'Ione', 9400), -(13044, 175, 1182, 'Irvine', 'Irvine', 9500), -(13045, 175, 1182, 'Jackson', 'Jackson', 9600), -(13046, 175, 1182, 'King City', 'King City', 9700), -(13047, 175, 1182, 'Kingsburg', 'Kingsburg', 9800), -(13048, 175, 1182, 'Kyburz', 'Kyburz', 9900), -(13049, 175, 1182, 'La Grange', 'La Grange', 10000), -(13050, 175, 1182, 'La Habra', 'La Habra', 10100), -(13051, 175, 1182, 'La Jolla', 'La Jolla', 10200), -(13052, 175, 1182, 'Lafayette', 'Lafayette', 10300), -(13053, 175, 1182, 'Laguna Beach', 'Laguna Beach', 10400), -(13054, 175, 1182, 'Laguna Hills', 'Laguna Hills', 10500), -(13055, 175, 1182, 'Lake Elsinore', 'Lake Elsinore', 10600), -(13056, 175, 1182, 'Lake Forest', 'Lake Forest', 10700), -(13057, 175, 1182, 'Lakewood', 'Lakewood', 10800), -(13058, 175, 1182, 'Lancaster', 'Lancaster', 10900), -(13059, 175, 1182, 'Laton', 'Laton', 11000), -(13060, 175, 1182, 'Long Beach', 'Long Beach', 11100), -(13061, 175, 1182, 'Los Alamitos', 'Los Alamitos', 11200), -(13062, 175, 1182, 'Los Altos', 'Los Altos', 11300), -(13063, 175, 1182, 'Los Angeles', 'Los Angeles', 11400), -(13064, 175, 1182, 'Los Gatos', 'Los Gatos', 11500), -(13065, 175, 1182, 'Malibu', 'Malibu', 11600), -(13066, 175, 1182, 'Manhattan Beach', 'Manhattan Beach', 11700), -(13067, 175, 1182, 'Manteca', 'Manteca', 11800), -(13068, 175, 1182, 'Marina', 'Marina', 11900), -(13069, 175, 1182, 'Merced', 'Merced', 12000), -(13070, 175, 1182, 'Mill Valley', 'Mill Valley', 12100), -(13071, 175, 1182, 'Millbrae', 'Millbrae', 12200), -(13072, 175, 1182, 'Milpitas', 'Milpitas', 12300), -(13073, 175, 1182, 'Mira Loma', 'Mira Loma', 12400), -(13074, 175, 1182, 'Mission Hills', 'Mission Hills', 12500), -(13075, 175, 1182, 'Mission Viejo', 'Mission Viejo', 12600), -(13076, 175, 1182, 'Modesto', 'Modesto', 12700), -(13077, 175, 1182, 'Monterey', 'Monterey', 12800), -(13078, 175, 1182, 'Mountain View', 'Mountain View', 12900), -(13079, 175, 1182, 'National City', 'National City', 13000), -(13080, 175, 1182, 'Nevada City', 'Nevada City', 13100), -(13081, 175, 1182, 'Newport Beach', 'Newport Beach', 13200), -(13082, 175, 1182, 'North Hollywood', 'North Hollywood', 13300), -(13083, 175, 1182, 'Novato', 'Novato', 13400), -(13084, 175, 1182, 'Oakland', 'Oakland', 13500), -(13085, 175, 1182, 'Oceanside', 'Oceanside', 13600), -(13086, 175, 1182, 'Ontario', 'Ontario', 13700), -(13087, 175, 1182, 'Oxnard', 'Oxnard', 13800), -(13088, 175, 1182, 'Pacifica', 'Pacifica', 13900), -(13089, 175, 1182, 'Palm Desert', 'Palm Desert', 14000), -(13090, 175, 1182, 'Palm Springs', 'Palm Springs', 14100), -(13091, 175, 1182, 'Palmdale', 'Palmdale', 14200), -(13092, 175, 1182, 'Palo Alto', 'Palo Alto', 14300), -(13093, 175, 1182, 'Palo Verde', 'Palo Verde', 14400), -(13094, 175, 1182, 'Pasadena', 'Pasadena', 14500), -(13095, 175, 1182, 'Penn Valley', 'Penn Valley', 14600), -(13096, 175, 1182, 'Pittsburg', 'Pittsburg', 14700), -(13097, 175, 1182, 'Pleasant Hill', 'Pleasant Hill', 14800), -(13098, 175, 1182, 'Pomona', 'Pomona', 14900), -(13099, 175, 1182, 'Poway', 'Poway', 15000), -(13100, 175, 1182, 'Rancho Cordova', 'Rancho Cordova', 15100), -(13101, 175, 1182, 'Rancho Santa Margarita', 'Rancho Santa Margarita', 15200), -(13102, 175, 1182, 'Redding', 'Redding', 15300), -(13103, 175, 1182, 'Redondo Beach', 'Redondo Beach', 15400), -(13104, 175, 1182, 'Redwood City', 'Redwood City', 15500), -(13105, 175, 1182, 'Riverside', 'Riverside', 15600), -(13106, 175, 1182, 'Rocklin', 'Rocklin', 15700), -(13107, 175, 1182, 'Roseville', 'Roseville', 15800), -(13108, 175, 1182, 'Sacramento', 'Sacramento', 15900), -(13109, 175, 1182, 'Salinas', 'Salinas', 16000), -(13110, 175, 1182, 'San Ardo', 'San Ardo', 16100), -(13111, 175, 1182, 'San Bernardino', 'San Bernardino', 16200), -(13112, 175, 1182, 'San Bruno', 'San Bruno', 16300), -(13113, 175, 1182, 'San Clemente', 'San Clemente', 16400), -(13114, 175, 1182, 'San Diego', 'San Diego', 16500), -(13115, 175, 1182, 'San Francisco', 'San Francisco', 16600), -(13116, 175, 1182, 'San Gabriel', 'San Gabriel', 16700), -(13117, 175, 1182, 'San Jose', 'San Jose', 16800), -(13118, 175, 1182, 'San Marcos', 'San Marcos', 16900), -(13119, 175, 1182, 'San Marino', 'San Marino', 17000), -(13120, 175, 1182, 'San Mateo', 'San Mateo', 17100), -(13121, 175, 1182, 'San Pedro', 'San Pedro', 17200), -(13122, 175, 1182, 'San Rafael', 'San Rafael', 17300), -(13123, 175, 1182, 'San Ramon', 'San Ramon', 17400), -(13124, 175, 1182, 'Santa Ana', 'Santa Ana', 17500), -(13125, 175, 1182, 'Santa Barbara', 'Santa Barbara', 17600), -(13126, 175, 1182, 'Santa Clara', 'Santa Clara', 17700), -(13127, 175, 1182, 'Santa Cruz', 'Santa Cruz', 17800), -(13128, 175, 1182, 'Santa Monica', 'Santa Monica', 17900), -(13129, 175, 1182, 'Santa Rosa', 'Santa Rosa', 18000), -(13130, 175, 1182, 'Sherman Oaks', 'Sherman Oaks', 18100), -(13131, 175, 1182, 'Simi Valley', 'Simi Valley', 18200), -(13132, 175, 1182, 'Smith River', 'Smith River', 18300), -(13133, 175, 1182, 'South Lake Tahoe', 'South Lake Tahoe', 18400), -(13134, 175, 1182, 'South San Francisco', 'South San Francisco', 18500), -(13135, 175, 1182, 'Squaw Valley', 'Squaw Valley', 18600), -(13136, 175, 1182, 'Stanford', 'Stanford', 18700), -(13137, 175, 1182, 'Stockton', 'Stockton', 18800), -(13138, 175, 1182, 'Studio City', 'Studio City', 18900), -(13139, 175, 1182, 'Sunnyvale', 'Sunnyvale', 19000), -(13140, 175, 1182, 'Tarzana', 'Tarzana', 19100), -(13141, 175, 1182, 'Temecula', 'Temecula', 19200), -(13142, 175, 1182, 'Thousand Oaks', 'Thousand Oaks', 19300), -(13143, 175, 1182, 'Toluca Lake', 'Toluca Lake', 19400), -(13144, 175, 1182, 'Torrance', 'Torrance', 19500), -(13145, 175, 1182, 'Tracy', 'Tracy', 19600), -(13146, 175, 1182, 'Turlock', 'Turlock', 19700), -(13147, 175, 1182, 'Tustin', 'Tustin', 19800), -(13148, 175, 1182, 'Vallejo', 'Vallejo', 19900), -(13149, 175, 1182, 'Van Nuys', 'Van Nuys', 20000), -(13150, 175, 1182, 'Venice', 'Venice', 20100), -(13151, 175, 1182, 'Ventura', 'Ventura', 20200), -(13152, 175, 1182, 'Walnut Creek', 'Walnut Creek', 20300), -(13153, 175, 1182, 'Washington', 'Washington', 20400), -(13154, 175, 1182, 'Weed', 'Weed', 20500), -(13155, 175, 1182, 'West Hollywood', 'West Hollywood', 20600), -(13156, 175, 1182, 'Westwood', 'Westwood', 20700), -(13157, 175, 1182, 'Whittier', 'Whittier', 20800), -(13158, 175, 1182, 'Woodland Hills', 'Woodland Hills', 20900), -(13159, 175, 1182, 'Yettem', 'Yettem', 21000), -(13160, 175, 1182, 'Yolo', 'Yolo', 21100), -(13161, 175, 1182, 'Yuba City', 'Yuba City', 21200), -(13162, 175, 1183, 'Agate', 'Agate', 100), -(13163, 175, 1183, 'Akron', 'Akron', 200), -(13164, 175, 1183, 'Almont', 'Almont', 300), -(13165, 175, 1183, 'Arvada', 'Arvada', 400), -(13166, 175, 1183, 'Aspen', 'Aspen', 500), -(13167, 175, 1183, 'Aurora', 'Aurora', 600), -(13168, 175, 1183, 'Avon', 'Avon', 700), -(13169, 175, 1183, 'Bennett', 'Bennett', 800), -(13170, 175, 1183, 'Bond', 'Bond', 900), -(13171, 175, 1183, 'Boulder', 'Boulder', 1000), -(13172, 175, 1183, 'Breckenridge', 'Breckenridge', 1100), -(13173, 175, 1183, 'Brighton', 'Brighton', 1200), -(13174, 175, 1183, 'Broomfield', 'Broomfield', 1300), -(13175, 175, 1183, 'Carbondale', 'Carbondale', 1400), -(13176, 175, 1183, 'Castle Rock', 'Castle Rock', 1500), -(13177, 175, 1183, 'Colorado City', 'Colorado City', 1600), -(13178, 175, 1183, 'Colorado Springs', 'Colorado Springs', 1700), -(13179, 175, 1183, 'Denver', 'Denver', 1800), -(13180, 175, 1183, 'Dillon', 'Dillon', 1900), -(13181, 175, 1183, 'Durango', 'Durango', 2000), -(13182, 175, 1183, 'Englewood', 'Englewood', 2100), -(13183, 175, 1183, 'Estes Park', 'Estes Park', 2200), -(13184, 175, 1183, 'Evergreen', 'Evergreen', 2300), -(13185, 175, 1183, 'Fort Collins', 'Fort Collins', 2400), -(13186, 175, 1183, 'Glenwood Springs', 'Glenwood Springs', 2500), -(13187, 175, 1183, 'Golden', 'Golden', 2600), -(13188, 175, 1183, 'Grand Junction', 'Grand Junction', 2700), -(13189, 175, 1183, 'Idaho Springs', 'Idaho Springs', 2800), -(13190, 175, 1183, 'Littleton', 'Littleton', 2900), -(13191, 175, 1183, 'Longmont', 'Longmont', 3000), -(13192, 175, 1183, 'Loveland', 'Loveland', 3100), -(13193, 175, 1183, 'Montrose', 'Montrose', 3200), -(13194, 175, 1183, 'Ordway', 'Ordway', 3300), -(13195, 175, 1183, 'Parker', 'Parker', 3400), -(13196, 175, 1183, 'San Pablo', 'San Pablo', 3500), -(13197, 175, 1183, 'Silverthorne', 'Silverthorne', 3600), -(13198, 175, 1183, 'Steamboat Springs', 'Steamboat Springs', 3700), -(13199, 175, 1183, 'Thornton', 'Thornton', 3800), -(13200, 175, 1183, 'Vail', 'Vail', 3900), -(13201, 175, 1183, 'Westminster', 'Westminster', 4000), -(13202, 175, 1184, 'Andover', 'Andover', 100), -(13203, 175, 1184, 'Avon', 'Avon', 200), -(13204, 175, 1184, 'Baltic', 'Baltic', 300), -(13205, 175, 1184, 'Bolton', 'Bolton', 400), -(13206, 175, 1184, 'Bridgeport', 'Bridgeport', 500), -(13207, 175, 1184, 'Bristol', 'Bristol', 600), -(13208, 175, 1184, 'Brooklyn', 'Brooklyn', 700), -(13209, 175, 1184, 'Canaan', 'Canaan', 800), -(13210, 175, 1184, 'Cheshire', 'Cheshire', 900), -(13211, 175, 1184, 'Clinton', 'Clinton', 1000), -(13212, 175, 1184, 'Columbia', 'Columbia', 1100), -(13213, 175, 1184, 'Cromwell', 'Cromwell', 1200), -(13214, 175, 1184, 'Danbury', 'Danbury', 1300), -(13215, 175, 1184, 'Dayville', 'Dayville', 1400), -(13216, 175, 1184, 'Derby', 'Derby', 1500), -(13217, 175, 1184, 'East Berlin', 'East Berlin', 1600), -(13218, 175, 1184, 'East Hartford', 'East Hartford', 1700), -(13219, 175, 1184, 'Enfield', 'Enfield', 1800), -(13220, 175, 1184, 'Essex', 'Essex', 1900), -(13221, 175, 1184, 'Fairfield', 'Fairfield', 2000), -(13222, 175, 1184, 'Falls Village', 'Falls Village', 2100), -(13223, 175, 1184, 'Farmington', 'Farmington', 2200), -(13224, 175, 1184, 'Glastonbury', 'Glastonbury', 2300), -(13225, 175, 1184, 'Greenwich', 'Greenwich', 2400), -(13226, 175, 1184, 'Groton', 'Groton', 2500), -(13227, 175, 1184, 'Hamden', 'Hamden', 2600), -(13228, 175, 1184, 'Hartford', 'Hartford', 2700), -(13229, 175, 1184, 'Manchester', 'Manchester', 2800), -(13230, 175, 1184, 'Meriden', 'Meriden', 2900), -(13231, 175, 1184, 'Milford', 'Milford', 3000), -(13232, 175, 1184, 'Mystic', 'Mystic', 3100), -(13233, 175, 1184, 'New Britain', 'New Britain', 3200), -(13234, 175, 1184, 'New Canaan', 'New Canaan', 3300), -(13235, 175, 1184, 'New Haven', 'New Haven', 3400), -(13236, 175, 1184, 'New London', 'New London', 3500), -(13237, 175, 1184, 'Newington', 'Newington', 3600), -(13238, 175, 1184, 'Niantic', 'Niantic', 3700), -(13239, 175, 1184, 'North Haven', 'North Haven', 3800), -(13240, 175, 1184, 'Norwalk', 'Norwalk', 3900), -(13241, 175, 1184, 'Norwich', 'Norwich', 4000), -(13242, 175, 1184, 'Pawcatuck', 'Pawcatuck', 4100), -(13243, 175, 1184, 'Redding Center', 'Redding Center', 4200), -(13244, 175, 1184, 'Rocky Hill', 'Rocky Hill', 4300), -(13245, 175, 1184, 'Shelton', 'Shelton', 4400), -(13246, 175, 1184, 'Simsbury', 'Simsbury', 4500), -(13247, 175, 1184, 'Southbury', 'Southbury', 4600), -(13248, 175, 1184, 'Southport', 'Southport', 4700), -(13249, 175, 1184, 'Stafford', 'Stafford', 4800), -(13250, 175, 1184, 'Stamford', 'Stamford', 4900), -(13251, 175, 1184, 'Stratford', 'Stratford', 5000), -(13252, 175, 1184, 'Suffield', 'Suffield', 5100), -(13253, 175, 1184, 'Trumbull', 'Trumbull', 5200), -(13254, 175, 1184, 'W Hartford', 'W Hartford', 5300), -(13255, 175, 1184, 'Wallingford', 'Wallingford', 5400), -(13256, 175, 1184, 'Waterbury', 'Waterbury', 5500), -(13257, 175, 1184, 'Watertown', 'Watertown', 5600), -(13258, 175, 1184, 'West Hartland', 'West Hartland', 5700), -(13259, 175, 1184, 'West Haven', 'West Haven', 5800), -(13260, 175, 1184, 'Westport', 'Westport', 5900), -(13261, 175, 1184, 'Wethersfield', 'Wethersfield', 6000), -(13262, 175, 1184, 'Willimantic', 'Willimantic', 6100), -(13263, 175, 1184, 'Wilton', 'Wilton', 6200), -(13264, 175, 1184, 'Windham', 'Windham', 6300), -(13265, 175, 1184, 'Windsor', 'Windsor', 6400), -(13266, 175, 1184, 'Woodbury', 'Woodbury', 6500), -(13267, 175, 1185, 'Bear', 'Bear', 100), -(13268, 175, 1185, 'Bethany Beach', 'Bethany Beach', 200), -(13269, 175, 1185, 'Dagsboro', 'Dagsboro', 300), -(13270, 175, 1185, 'Delmar', 'Delmar', 400), -(13271, 175, 1185, 'Dover', 'Dover', 500), -(13272, 175, 1185, 'Dover AFB', 'Dover AFB', 600), -(13273, 175, 1185, 'Fenwick Island', 'Fenwick Island', 700), -(13274, 175, 1185, 'Hockessin', 'Hockessin', 800), -(13275, 175, 1185, 'Milton', 'Milton', 900), -(13276, 175, 1185, 'Newark', 'Newark', 1000), -(13277, 175, 1185, 'Rehoboth Beach', 'Rehoboth Beach', 1100), -(13278, 175, 1185, 'Wilmington', 'Wilmington', 1200), -(13279, 175, 1186, 'Washington', 'Washington', 100), -(13280, 175, 1187, 'Alachua', 'Alachua', 100), -(13281, 175, 1187, 'Alford', 'Alford', 200), -(13282, 175, 1187, 'Altamonte Springs', 'Altamonte Springs', 300), -(13283, 175, 1187, 'Altoona', 'Altoona', 400), -(13284, 175, 1187, 'Alva', 'Alva', 500), -(13285, 175, 1187, 'Anna Maria', 'Anna Maria', 600), -(13286, 175, 1187, 'Apollo Beach', 'Apollo Beach', 700), -(13287, 175, 1187, 'Apopka', 'Apopka', 800), -(13288, 175, 1187, 'Arcadia', 'Arcadia', 900), -(13289, 175, 1187, 'Archer', 'Archer', 1000), -(13290, 175, 1187, 'Argyle', 'Argyle', 1100), -(13291, 175, 1187, 'Astatula', 'Astatula', 1200), -(13292, 175, 1187, 'Astor', 'Astor', 1300), -(13293, 175, 1187, 'Atlantic Beach', 'Atlantic Beach', 1400), -(13294, 175, 1187, 'Auburndale', 'Auburndale', 1500), -(13295, 175, 1187, 'Avon Park', 'Avon Park', 1600), -(13296, 175, 1187, 'Bartow', 'Bartow', 1700), -(13297, 175, 1187, 'Beverly Hills', 'Beverly Hills', 1800), -(13298, 175, 1187, 'Blountstown', 'Blountstown', 1900), -(13299, 175, 1187, 'Boca Raton', 'Boca Raton', 2000), -(13300, 175, 1187, 'Boynton Beach', 'Boynton Beach', 2100), -(13301, 175, 1187, 'Bradenton', 'Bradenton', 2200), -(13302, 175, 1187, 'Brandon', 'Brandon', 2300), -(13303, 175, 1187, 'Bristol', 'Bristol', 2400), -(13304, 175, 1187, 'Bunnell', 'Bunnell', 2500), -(13305, 175, 1187, 'Candler', 'Candler', 2600), -(13306, 175, 1187, 'Cape Coral', 'Cape Coral', 2700), -(13307, 175, 1187, 'Casselberry', 'Casselberry', 2800), -(13308, 175, 1187, 'Chipley', 'Chipley', 2900), -(13309, 175, 1187, 'Clearwater', 'Clearwater', 3000), -(13310, 175, 1187, 'Clearwater Beach', 'Clearwater Beach', 3100), -(13311, 175, 1187, 'Clermont', 'Clermont', 3200), -(13312, 175, 1187, 'Cocoa', 'Cocoa', 3300), -(13313, 175, 1187, 'Crescent City', 'Crescent City', 3400), -(13314, 175, 1187, 'Davenport', 'Davenport', 3500), -(13315, 175, 1187, 'Daytona Beach', 'Daytona Beach', 3600), -(13316, 175, 1187, 'Deerfield Beach', 'Deerfield Beach', 3700), -(13317, 175, 1187, 'Deland', 'Deland', 3800), -(13318, 175, 1187, 'Delray Beach', 'Delray Beach', 3900), -(13319, 175, 1187, 'Deltona', 'Deltona', 4000), -(13320, 175, 1187, 'Destin', 'Destin', 4100), -(13321, 175, 1187, 'Dunedin', 'Dunedin', 4200), -(13322, 175, 1187, 'Eglin AFB', 'Eglin AFB', 4300), -(13323, 175, 1187, 'Englewood', 'Englewood', 4400), -(13324, 175, 1187, 'Flagler Beach', 'Flagler Beach', 4500), -(13325, 175, 1187, 'Florida City', 'Florida City', 4600), -(13326, 175, 1187, 'Fort Lauderdale', 'Fort Lauderdale', 4700), -(13327, 175, 1187, 'Fort Myers', 'Fort Myers', 4800), -(13328, 175, 1187, 'Fort Walton Beach', 'Fort Walton Beach', 4900), -(13329, 175, 1187, 'Gainesville', 'Gainesville', 5000), -(13330, 175, 1187, 'Geneva', 'Geneva', 5100), -(13331, 175, 1187, 'Groveland', 'Groveland', 5200), -(13332, 175, 1187, 'Gulf Breeze', 'Gulf Breeze', 5300), -(13333, 175, 1187, 'Hallandale', 'Hallandale', 5400), -(13334, 175, 1187, 'Hawthorne', 'Hawthorne', 5500), -(13335, 175, 1187, 'Hialeah', 'Hialeah', 5600), -(13336, 175, 1187, 'Hollywood', 'Hollywood', 5700), -(13337, 175, 1187, 'Hudson', 'Hudson', 5800), -(13338, 175, 1187, 'Indian Rocks Beach', 'Indian Rocks Beach', 5900), -(13339, 175, 1187, 'Jacksonville', 'Jacksonville', 6000), -(13340, 175, 1187, 'Jacksonville Beach', 'Jacksonville Beach', 6100), -(13341, 175, 1187, 'Key West', 'Key West', 6200), -(13342, 175, 1187, 'Kissimmee', 'Kissimmee', 6300), -(13343, 175, 1187, 'Labelle', 'Labelle', 6400), -(13344, 175, 1187, 'Lake City', 'Lake City', 6500), -(13345, 175, 1187, 'Lake Mary', 'Lake Mary', 6600), -(13346, 175, 1187, 'Land O'' Lakes', 'Land O'' Lakes', 6700), -(13347, 175, 1187, 'Lantana', 'Lantana', 6800), -(13348, 175, 1187, 'Largo', 'Largo', 6900), -(13349, 175, 1187, 'Madison', 'Madison', 7000), -(13350, 175, 1187, 'Marathon', 'Marathon', 7100), -(13351, 175, 1187, 'Marco Island', 'Marco Island', 7200), -(13352, 175, 1187, 'Marianna', 'Marianna', 7300), -(13353, 175, 1187, 'Melbourne', 'Melbourne', 7400), -(13354, 175, 1187, 'Merritt Island', 'Merritt Island', 7500), -(13355, 175, 1187, 'Miami', 'Miami', 7600), -(13356, 175, 1187, 'Miami Beach', 'Miami Beach', 7700), -(13357, 175, 1187, 'Miramar Beach', 'Miramar Beach', 7800), -(13358, 175, 1187, 'Naples', 'Naples', 7900), -(13359, 175, 1187, 'New Port Richey', 'New Port Richey', 8000), -(13360, 175, 1187, 'North Miami Beach', 'North Miami Beach', 8100), -(13361, 175, 1187, 'North Port', 'North Port', 8200), -(13362, 175, 1187, 'Ocoee', 'Ocoee', 8300), -(13363, 175, 1187, 'Odessa', 'Odessa', 8400), -(13364, 175, 1187, 'Orange City', 'Orange City', 8500), -(13365, 175, 1187, 'Orlando', 'Orlando', 8600), -(13366, 175, 1187, 'Ormond Beach', 'Ormond Beach', 8700), -(13367, 175, 1187, 'Palm Beach', 'Palm Beach', 8800), -(13368, 175, 1187, 'Palm Coast', 'Palm Coast', 8900), -(13369, 175, 1187, 'Panama City', 'Panama City', 9000), -(13370, 175, 1187, 'Panama City Beach', 'Panama City Beach', 9100), -(13371, 175, 1187, 'Parrish', 'Parrish', 9200), -(13372, 175, 1187, 'Pensacola', 'Pensacola', 9300), -(13373, 175, 1187, 'Pompano Beach', 'Pompano Beach', 9400), -(13374, 175, 1187, 'Ponte Vedra Beach', 'Ponte Vedra Beach', 9500), -(13375, 175, 1187, 'Port Charlotte', 'Port Charlotte', 9600), -(13376, 175, 1187, 'Port Orange', 'Port Orange', 9700), -(13377, 175, 1187, 'Port St. Lucie', 'Port St. Lucie', 9800), -(13378, 175, 1187, 'Saint Augustine', 'Saint Augustine', 9900), -(13379, 175, 1187, 'Saint Petersburg', 'Saint Petersburg', 10000), -(13380, 175, 1187, 'San Antonio', 'San Antonio', 10100), -(13381, 175, 1187, 'Santa Rosa Beach', 'Santa Rosa Beach', 10200), -(13382, 175, 1187, 'Sarasota', 'Sarasota', 10300), -(13383, 175, 1187, 'Satellite Beach', 'Satellite Beach', 10400), -(13384, 175, 1187, 'Spring Hill', 'Spring Hill', 10500), -(13385, 175, 1187, 'Tallahassee', 'Tallahassee', 10600), -(13386, 175, 1187, 'Tampa', 'Tampa', 10700), -(13387, 175, 1187, 'Tarpon Springs', 'Tarpon Springs', 10800), -(13388, 175, 1187, 'Titusville', 'Titusville', 10900), -(13389, 175, 1187, 'Venice', 'Venice', 11000), -(13390, 175, 1187, 'Vero Beach', 'Vero Beach', 11100), -(13391, 175, 1187, 'West Palm Beach', 'West Palm Beach', 11200), -(13392, 175, 1187, 'Wewahitchka', 'Wewahitchka', 11300), -(13393, 175, 1187, 'Windermere', 'Windermere', 11400), -(13394, 175, 1188, 'Abbeville', 'Abbeville', 100), -(13395, 175, 1188, 'Acworth', 'Acworth', 200), -(13396, 175, 1188, 'Adrian', 'Adrian', 300), -(13397, 175, 1188, 'Allentown', 'Allentown', 400), -(13398, 175, 1188, 'Alpharetta', 'Alpharetta', 500), -(13399, 175, 1188, 'Alston', 'Alston', 600), -(13400, 175, 1188, 'Alto', 'Alto', 700), -(13401, 175, 1188, 'Arabi', 'Arabi', 800), -(13402, 175, 1188, 'Aragon', 'Aragon', 900), -(13403, 175, 1188, 'Athens', 'Athens', 1000), -(13404, 175, 1188, 'Atlanta', 'Atlanta', 1100), -(13405, 175, 1188, 'Augusta', 'Augusta', 1200), -(13406, 175, 1188, 'Blue Ridge', 'Blue Ridge', 1300), -(13407, 175, 1188, 'Boston', 'Boston', 1400), -(13408, 175, 1188, 'Canton', 'Canton', 1500), -(13409, 175, 1188, 'Carrollton', 'Carrollton', 1600), -(13410, 175, 1188, 'Clarkston', 'Clarkston', 1700), -(13411, 175, 1188, 'Columbus', 'Columbus', 1800), -(13412, 175, 1188, 'Conyers', 'Conyers', 1900), -(13413, 175, 1188, 'Dahlonega', 'Dahlonega', 2000), -(13414, 175, 1188, 'Dallas', 'Dallas', 2100), -(13415, 175, 1188, 'Duluth', 'Duluth', 2200), -(13416, 175, 1188, 'Flowery Branch', 'Flowery Branch', 2300), -(13417, 175, 1188, 'Fort Benning', 'Fort Benning', 2400), -(13418, 175, 1188, 'Gainesville', 'Gainesville', 2500), -(13419, 175, 1188, 'Hinesville', 'Hinesville', 2600), -(13420, 175, 1188, 'Kennesaw', 'Kennesaw', 2700), -(13421, 175, 1188, 'Lagrange', 'Lagrange', 2800), -(13422, 175, 1188, 'Lawrenceville', 'Lawrenceville', 2900), -(13423, 175, 1188, 'Lilburn', 'Lilburn', 3000), -(13424, 175, 1188, 'Macon', 'Macon', 3100), -(13425, 175, 1188, 'Marietta', 'Marietta', 3200), -(13426, 175, 1188, 'Norcross', 'Norcross', 3300), -(13427, 175, 1188, 'Roswell', 'Roswell', 3400), -(13428, 175, 1188, 'Saint George', 'Saint George', 3500), -(13429, 175, 1188, 'Savannah', 'Savannah', 3600), -(13430, 175, 1188, 'Stone Mountain', 'Stone Mountain', 3700), -(13431, 175, 1188, 'Toccoa', 'Toccoa', 3800), -(13432, 175, 1188, 'Washington', 'Washington', 3900), -(13433, 175, 1188, 'Winder', 'Winder', 4000), -(13434, 175, 1188, 'Zebulon', 'Zebulon', 4100), -(13435, 175, 1189, 'Haiku', 'Haiku', 100), -(13436, 175, 1189, 'Hakalau', 'Hakalau', 200), -(13437, 175, 1189, 'Hanamaulu', 'Hanamaulu', 300), -(13438, 175, 1189, 'Hawaiian Ocean View', 'Hawaiian Ocean View', 400), -(13439, 175, 1189, 'Hawi', 'Hawi', 500), -(13440, 175, 1189, 'Honolulu', 'Honolulu', 600), -(13441, 175, 1189, 'Kailua Kona', 'Kailua Kona', 700), -(13442, 175, 1189, 'Kihei', 'Kihei', 800), -(13443, 175, 1189, 'Ocean View', 'Ocean View', 900), -(13444, 175, 1189, 'Pahoa', 'Pahoa', 1000), -(13445, 175, 1189, 'Pearl Harbor', 'Pearl Harbor', 1100), -(13446, 175, 1189, 'Wake Island', 'Wake Island', 1200), -(13447, 175, 1190, 'American Falls', 'American Falls', 100), -(13448, 175, 1190, 'Boise', 'Boise', 200), -(13449, 175, 1190, 'Conda', 'Conda', 300), -(13450, 175, 1190, 'Fish Haven', 'Fish Haven', 400), -(13451, 175, 1190, 'Idaho Falls', 'Idaho Falls', 500), -(13452, 175, 1190, 'Moscow', 'Moscow', 600), -(13453, 175, 1190, 'Pocatello', 'Pocatello', 700), -(13454, 175, 1190, 'Preston', 'Preston', 800), -(13455, 175, 1190, 'Sandpoint', 'Sandpoint', 900), -(13456, 175, 1190, 'Twin Falls', 'Twin Falls', 1000), -(13457, 175, 1191, 'Addison', 'Addison', 100), -(13458, 175, 1191, 'Albany', 'Albany', 200), -(13459, 175, 1191, 'Alsey', 'Alsey', 300), -(13460, 175, 1191, 'Alton', 'Alton', 400), -(13461, 175, 1191, 'Anna', 'Anna', 500), -(13462, 175, 1191, 'Arlington Heights', 'Arlington Heights', 600), -(13463, 175, 1191, 'Aurora', 'Aurora', 700), -(13464, 175, 1191, 'Barrington', 'Barrington', 800), -(13465, 175, 1191, 'Belleville', 'Belleville', 900), -(13466, 175, 1191, 'Berwyn', 'Berwyn', 1000), -(13467, 175, 1191, 'Bloomingdale', 'Bloomingdale', 1100), -(13468, 175, 1191, 'Bolingbrook', 'Bolingbrook', 1200), -(13469, 175, 1191, 'Buffalo Grove', 'Buffalo Grove', 1300), -(13470, 175, 1191, 'Bushnell', 'Bushnell', 1400), -(13471, 175, 1191, 'Cary', 'Cary', 1500), -(13472, 175, 1191, 'Champaign', 'Champaign', 1600), -(13473, 175, 1191, 'Chicago', 'Chicago', 1700), -(13474, 175, 1191, 'Chicago Heights', 'Chicago Heights', 1800), -(13475, 175, 1191, 'Chicago Ridge', 'Chicago Ridge', 1900), -(13476, 175, 1191, 'Darien', 'Darien', 2000), -(13477, 175, 1191, 'Deerfield', 'Deerfield', 2100), -(13478, 175, 1191, 'Des Plaines', 'Des Plaines', 2200), -(13479, 175, 1191, 'Downers Grove', 'Downers Grove', 2300), -(13480, 175, 1191, 'Elk Grove Village', 'Elk Grove Village', 2400), -(13481, 175, 1191, 'Elmwood Park', 'Elmwood Park', 2500), -(13482, 175, 1191, 'Evanston', 'Evanston', 2600), -(13483, 175, 1191, 'Franklin', 'Franklin', 2700), -(13484, 175, 1191, 'Geneva', 'Geneva', 2800), -(13485, 175, 1191, 'Glenview', 'Glenview', 2900), -(13486, 175, 1191, 'Hammond', 'Hammond', 3000), -(13487, 175, 1191, 'Harwood Heights', 'Harwood Heights', 3100), -(13488, 175, 1191, 'La Grange Park', 'La Grange Park', 3200), -(13489, 175, 1191, 'Lemont', 'Lemont', 3300), -(13490, 175, 1191, 'Long Grove', 'Long Grove', 3400), -(13491, 175, 1191, 'Loves Park', 'Loves Park', 3500), -(13492, 175, 1191, 'Madison', 'Madison', 3600), -(13493, 175, 1191, 'Monticello', 'Monticello', 3700), -(13494, 175, 1191, 'Morton Grove', 'Morton Grove', 3800), -(13495, 175, 1191, 'Mount Prospect', 'Mount Prospect', 3900), -(13496, 175, 1191, 'Mundelein', 'Mundelein', 4000), -(13497, 175, 1191, 'Naperville', 'Naperville', 4100), -(13498, 175, 1191, 'Niles', 'Niles', 4200), -(13499, 175, 1191, 'Northbrook', 'Northbrook', 4300), -(13500, 175, 1191, 'Oak Lawn', 'Oak Lawn', 4400), -(13501, 175, 1191, 'Oak Park', 'Oak Park', 4500), -(13502, 175, 1191, 'Palatine', 'Palatine', 4600), -(13503, 175, 1191, 'Rochester', 'Rochester', 4700), -(13504, 175, 1191, 'Rockford', 'Rockford', 4800), -(13505, 175, 1191, 'Rolling Meadows', 'Rolling Meadows', 4900), -(13506, 175, 1191, 'Roselle', 'Roselle', 5000), -(13507, 175, 1191, 'Round Lake', 'Round Lake', 5100), -(13508, 175, 1191, 'Schaumburg', 'Schaumburg', 5200), -(13509, 175, 1191, 'Skokie', 'Skokie', 5300), -(13510, 175, 1191, 'Springfield', 'Springfield', 5400), -(13511, 175, 1191, 'Urbana', 'Urbana', 5500), -(13512, 175, 1191, 'Vernon Hills', 'Vernon Hills', 5600), -(13513, 175, 1191, 'Waukegan', 'Waukegan', 5700), -(13514, 175, 1191, 'Westmont', 'Westmont', 5800), -(13515, 175, 1191, 'Wheaton', 'Wheaton', 5900), -(13516, 175, 1191, 'Wheeling', 'Wheeling', 6000), -(13517, 175, 1192, 'Akron', 'Akron', 100), -(13518, 175, 1192, 'Angola', 'Angola', 200), -(13519, 175, 1192, 'Atlanta', 'Atlanta', 300), -(13520, 175, 1192, 'Attica', 'Attica', 400), -(13521, 175, 1192, 'Bloomington', 'Bloomington', 500), -(13522, 175, 1192, 'Carmel', 'Carmel', 600), -(13523, 175, 1192, 'Central', 'Central', 700), -(13524, 175, 1192, 'Elkhart', 'Elkhart', 800), -(13525, 175, 1192, 'Fishers', 'Fishers', 900), -(13526, 175, 1192, 'Fort Wayne', 'Fort Wayne', 1000), -(13527, 175, 1192, 'Goshen', 'Goshen', 1100), -(13528, 175, 1192, 'Greencastle', 'Greencastle', 1200), -(13529, 175, 1192, 'Indianapolis', 'Indianapolis', 1300), -(13530, 175, 1192, 'Lafayette', 'Lafayette', 1400), -(13531, 175, 1192, 'Michigan City', 'Michigan City', 1500), -(13532, 175, 1192, 'Nappanee', 'Nappanee', 1600), -(13533, 175, 1192, 'New Albany', 'New Albany', 1700), -(13534, 175, 1192, 'Richmond', 'Richmond', 1800), -(13535, 175, 1192, 'Spencerville', 'Spencerville', 1900), -(13536, 175, 1192, 'Terre Haute', 'Terre Haute', 2000), -(13537, 175, 1192, 'West Lafayette', 'West Lafayette', 2100), -(13538, 175, 1193, 'Afton', 'Afton', 100), -(13539, 175, 1193, 'Ames', 'Ames', 200), -(13540, 175, 1193, 'Bancroft', 'Bancroft', 300), -(13541, 175, 1193, 'Cedar Rapids', 'Cedar Rapids', 400), -(13542, 175, 1193, 'Davenport', 'Davenport', 500), -(13543, 175, 1193, 'Des Moines', 'Des Moines', 600), -(13544, 175, 1193, 'Iowa City', 'Iowa City', 700), -(13545, 175, 1193, 'Oskaloosa', 'Oskaloosa', 800), -(13546, 175, 1193, 'Postville', 'Postville', 900), -(13547, 175, 1193, 'Story City', 'Story City', 1000), -(13548, 175, 1194, 'Arkansas City', 'Arkansas City', 100), -(13549, 175, 1194, 'Arma', 'Arma', 200), -(13550, 175, 1194, 'Atchison', 'Atchison', 300), -(13551, 175, 1194, 'Bonner Springs', 'Bonner Springs', 400), -(13552, 175, 1194, 'Clay Center', 'Clay Center', 500), -(13553, 175, 1194, 'Green', 'Green', 600), -(13554, 175, 1194, 'Kansas City', 'Kansas City', 700), -(13555, 175, 1194, 'Lawrence', 'Lawrence', 800), -(13556, 175, 1194, 'Manhattan', 'Manhattan', 900), -(13557, 175, 1194, 'Rose Hill', 'Rose Hill', 1000), -(13558, 175, 1194, 'Shawnee Mission', 'Shawnee Mission', 1100), -(13559, 175, 1194, 'Topeka', 'Topeka', 1200), -(13560, 175, 1194, 'Utica', 'Utica', 1300), -(13561, 175, 1194, 'Wichita', 'Wichita', 1400), -(13562, 175, 1195, 'Adairville', 'Adairville', 100), -(13563, 175, 1195, 'Adams', 'Adams', 200), -(13564, 175, 1195, 'Artemus', 'Artemus', 300), -(13565, 175, 1195, 'Bowling Green', 'Bowling Green', 400), -(13566, 175, 1195, 'Erlanger', 'Erlanger', 500), -(13567, 175, 1195, 'Falmouth', 'Falmouth', 600), -(13568, 175, 1195, 'Florence', 'Florence', 700), -(13569, 175, 1195, 'Frankfort', 'Frankfort', 800), -(13570, 175, 1195, 'Ft Mitchell', 'Ft Mitchell', 900), -(13571, 175, 1195, 'Hi Hat', 'Hi Hat', 1000), -(13572, 175, 1195, 'Lancaster', 'Lancaster', 1100), -(13573, 175, 1195, 'Lexington', 'Lexington', 1200), -(13574, 175, 1195, 'London', 'London', 1300), -(13575, 175, 1195, 'Louisville', 'Louisville', 1400), -(13576, 175, 1195, 'Wendover', 'Wendover', 1500), -(13577, 175, 1196, 'Amelia', 'Amelia', 100), -(13578, 175, 1196, 'Anacoco', 'Anacoco', 200), -(13579, 175, 1196, 'Arcadia', 'Arcadia', 300), -(13580, 175, 1196, 'Baldwin', 'Baldwin', 400), -(13581, 175, 1196, 'Baton Rouge', 'Baton Rouge', 500), -(13582, 175, 1196, 'Blanks', 'Blanks', 600), -(13583, 175, 1196, 'Boutte', 'Boutte', 700), -(13584, 175, 1196, 'Chalmette', 'Chalmette', 800), -(13585, 175, 1196, 'Covington', 'Covington', 900), -(13586, 175, 1196, 'Creole', 'Creole', 1000), -(13587, 175, 1196, 'Geismar', 'Geismar', 1100), -(13588, 175, 1196, 'Kenner', 'Kenner', 1200), -(13589, 175, 1196, 'Lafayette', 'Lafayette', 1300), -(13590, 175, 1196, 'Lake Charles', 'Lake Charles', 1400), -(13591, 175, 1196, 'Metairie', 'Metairie', 1500), -(13592, 175, 1196, 'Natchitoches', 'Natchitoches', 1600), -(13593, 175, 1196, 'New Orleans', 'New Orleans', 1700), -(13594, 175, 1196, 'Rayne', 'Rayne', 1800), -(13595, 175, 1196, 'Shreveport', 'Shreveport', 1900), -(13596, 175, 1197, 'Auburn', 'Auburn', 100), -(13597, 175, 1197, 'Augusta', 'Augusta', 200), -(13598, 175, 1197, 'Bangor', 'Bangor', 300), -(13599, 175, 1197, 'Bar Harbor', 'Bar Harbor', 400), -(13600, 175, 1197, 'Belfast', 'Belfast', 500), -(13601, 175, 1197, 'Bethel', 'Bethel', 600), -(13602, 175, 1197, 'Ellsworth', 'Ellsworth', 700), -(13603, 175, 1197, 'Northeast Harbor', 'Northeast Harbor', 800), -(13604, 175, 1197, 'Old Orchard Beach', 'Old Orchard Beach', 900), -(13605, 175, 1197, 'Portland', 'Portland', 1000), -(13606, 175, 1197, 'Scarborough', 'Scarborough', 1100), -(13607, 175, 1197, 'Standish', 'Standish', 1200), -(13608, 175, 1197, 'Washington', 'Washington', 1300), -(13609, 175, 1197, 'York', 'York', 1400), -(13610, 175, 1197, 'York Beach', 'York Beach', 1500), -(13611, 175, 1198, 'Aberdeen', 'Aberdeen', 100), -(13612, 175, 1198, 'Aberdeen Proving Ground', 'Aberdeen Proving Ground', 200), -(13613, 175, 1198, 'Abingdon', 'Abingdon', 300), -(13614, 175, 1198, 'Annapolis', 'Annapolis', 400), -(13615, 175, 1198, 'Baltimore', 'Baltimore', 500), -(13616, 175, 1198, 'Bel Air', 'Bel Air', 600), -(13617, 175, 1198, 'Beltsville', 'Beltsville', 700), -(13618, 175, 1198, 'Berlin', 'Berlin', 800), -(13619, 175, 1198, 'Bethesda', 'Bethesda', 900), -(13620, 175, 1198, 'Bowie', 'Bowie', 1000), -(13621, 175, 1198, 'California', 'California', 1100), -(13622, 175, 1198, 'Cambridge', 'Cambridge', 1200), -(13623, 175, 1198, 'Chevy Chase', 'Chevy Chase', 1300), -(13624, 175, 1198, 'College Park', 'College Park', 1400), -(13625, 175, 1198, 'Columbia', 'Columbia', 1500), -(13626, 175, 1198, 'Crofton', 'Crofton', 1600), -(13627, 175, 1198, 'Dundalk', 'Dundalk', 1700), -(13628, 175, 1198, 'Ellicott City', 'Ellicott City', 1800), -(13629, 175, 1198, 'Frederick', 'Frederick', 1900), -(13630, 175, 1198, 'Fulton', 'Fulton', 2000), -(13631, 175, 1198, 'Gaithersburg', 'Gaithersburg', 2100), -(13632, 175, 1198, 'Germantown', 'Germantown', 2200), -(13633, 175, 1198, 'Hagerstown', 'Hagerstown', 2300), -(13634, 175, 1198, 'Hyattsville', 'Hyattsville', 2400), -(13635, 175, 1198, 'Jefferson', 'Jefferson', 2500), -(13636, 175, 1198, 'Joppa', 'Joppa', 2600), -(13637, 175, 1198, 'Laurel', 'Laurel', 2700), -(13638, 175, 1198, 'Lusby', 'Lusby', 2800), -(13639, 175, 1198, 'Lutherville Timonium', 'Lutherville Timonium', 2900), -(13640, 175, 1198, 'Montgomery Village', 'Montgomery Village', 3000), -(13641, 175, 1198, 'North East', 'North East', 3100), -(13642, 175, 1198, 'Oakland', 'Oakland', 3200), -(13643, 175, 1198, 'Ocean City', 'Ocean City', 3300), -(13644, 175, 1198, 'Owings Mills', 'Owings Mills', 3400), -(13645, 175, 1198, 'Pikesville', 'Pikesville', 3500), -(13646, 175, 1198, 'Potomac', 'Potomac', 3600), -(13647, 175, 1198, 'Reisterstown', 'Reisterstown', 3700), -(13648, 175, 1198, 'Rockville', 'Rockville', 3800), -(13649, 175, 1198, 'Salisbury', 'Salisbury', 3900), -(13650, 175, 1198, 'Severna Park', 'Severna Park', 4000), -(13651, 175, 1198, 'Silver Spring', 'Silver Spring', 4100), -(13652, 175, 1198, 'Towson', 'Towson', 4200), -(13653, 175, 1199, 'Acton', 'Acton', 100), -(13654, 175, 1199, 'Agawam', 'Agawam', 200), -(13655, 175, 1199, 'Allston', 'Allston', 300), -(13656, 175, 1199, 'Amesbury', 'Amesbury', 400), -(13657, 175, 1199, 'Amherst', 'Amherst', 500), -(13658, 175, 1199, 'Andover', 'Andover', 600), -(13659, 175, 1199, 'Attleboro', 'Attleboro', 700), -(13660, 175, 1199, 'Becket', 'Becket', 800), -(13661, 175, 1199, 'Berkley', 'Berkley', 900), -(13662, 175, 1199, 'Bolton', 'Bolton', 1000), -(13663, 175, 1199, 'Boston', 'Boston', 1100), -(13664, 175, 1199, 'Brookline', 'Brookline', 1200), -(13665, 175, 1199, 'Burlington', 'Burlington', 1300), -(13666, 175, 1199, 'Cambridge', 'Cambridge', 1400), -(13667, 175, 1199, 'Canton', 'Canton', 1500), -(13668, 175, 1199, 'Centerville', 'Centerville', 1600), -(13669, 175, 1199, 'Chicopee', 'Chicopee', 1700), -(13670, 175, 1199, 'Dennis Port', 'Dennis Port', 1800), -(13671, 175, 1199, 'Eastham', 'Eastham', 1900), -(13672, 175, 1199, 'Essex', 'Essex', 2000), -(13673, 175, 1199, 'Fall River', 'Fall River', 2100), -(13674, 175, 1199, 'Feeding Hills', 'Feeding Hills', 2200), -(13675, 175, 1199, 'Framingham', 'Framingham', 2300), -(13676, 175, 1199, 'Franklin', 'Franklin', 2400), -(13677, 175, 1199, 'Greenfield', 'Greenfield', 2500), -(13678, 175, 1199, 'Hyannis', 'Hyannis', 2600), -(13679, 175, 1199, 'Lee', 'Lee', 2700), -(13680, 175, 1199, 'Lexington', 'Lexington', 2800), -(13681, 175, 1199, 'Lynn', 'Lynn', 2900), -(13682, 175, 1199, 'Manchester', 'Manchester', 3000), -(13683, 175, 1199, 'Marlborough', 'Marlborough', 3100), -(13684, 175, 1199, 'Marstons Mills', 'Marstons Mills', 3200), -(13685, 175, 1199, 'Methuen', 'Methuen', 3300), -(13686, 175, 1199, 'Nantucket', 'Nantucket', 3400), -(13687, 175, 1199, 'Newton', 'Newton', 3500), -(13688, 175, 1199, 'Newtonville', 'Newtonville', 3600), -(13689, 175, 1199, 'Northampton', 'Northampton', 3700), -(13690, 175, 1199, 'Palmer', 'Palmer', 3800), -(13691, 175, 1199, 'Pittsfield', 'Pittsfield', 3900), -(13692, 175, 1199, 'Rutland', 'Rutland', 4000), -(13693, 175, 1199, 'Salem', 'Salem', 4100), -(13694, 175, 1199, 'Shirley', 'Shirley', 4200), -(13695, 175, 1199, 'South Hadley', 'South Hadley', 4300), -(13696, 175, 1199, 'South Yarmouth', 'South Yarmouth', 4400), -(13697, 175, 1199, 'Springfield', 'Springfield', 4500), -(13698, 175, 1199, 'West Roxbury', 'West Roxbury', 4600), -(13699, 175, 1199, 'West Springfield', 'West Springfield', 4700), -(13700, 175, 1199, 'West Yarmouth', 'West Yarmouth', 4800), -(13701, 175, 1199, 'Westfield', 'Westfield', 4900), -(13702, 175, 1199, 'Worcester', 'Worcester', 5000), -(13703, 175, 1200, 'Afton', 'Afton', 100), -(13704, 175, 1200, 'Akron', 'Akron', 200), -(13705, 175, 1200, 'Algonac', 'Algonac', 300), -(13706, 175, 1200, 'Alpena', 'Alpena', 400), -(13707, 175, 1200, 'Ann Arbor', 'Ann Arbor', 500), -(13708, 175, 1200, 'Applegate', 'Applegate', 600), -(13709, 175, 1200, 'Atlanta', 'Atlanta', 700), -(13710, 175, 1200, 'Auburn Hills', 'Auburn Hills', 800), -(13711, 175, 1200, 'Berkley', 'Berkley', 900), -(13712, 175, 1200, 'Birmingham', 'Birmingham', 1000), -(13713, 175, 1200, 'Bloomfield Hills', 'Bloomfield Hills', 1100), -(13714, 175, 1200, 'Canton', 'Canton', 1200), -(13715, 175, 1200, 'Cedar Springs', 'Cedar Springs', 1300), -(13716, 175, 1200, 'Center Line', 'Center Line', 1400), -(13717, 175, 1200, 'Clarkston', 'Clarkston', 1500), -(13718, 175, 1200, 'Coldwater', 'Coldwater', 1600), -(13719, 175, 1200, 'Commerce Township', 'Commerce Township', 1700), -(13720, 175, 1200, 'Dearborn', 'Dearborn', 1800), -(13721, 175, 1200, 'Dearborn Heights', 'Dearborn Heights', 1900), -(13722, 175, 1200, 'Deerton', 'Deerton', 2000), -(13723, 175, 1200, 'Detroit', 'Detroit', 2100), -(13724, 175, 1200, 'East Lansing', 'East Lansing', 2200), -(13725, 175, 1200, 'Farmington', 'Farmington', 2300), -(13726, 175, 1200, 'Flint', 'Flint', 2400), -(13727, 175, 1200, 'Flushing', 'Flushing', 2500), -(13728, 175, 1200, 'Grand Rapids', 'Grand Rapids', 2600), -(13729, 175, 1200, 'Greenville', 'Greenville', 2700), -(13730, 175, 1200, 'Grosse Pointe', 'Grosse Pointe', 2800), -(13731, 175, 1200, 'Hamtramck', 'Hamtramck', 2900), -(13732, 175, 1200, 'Kalamazoo', 'Kalamazoo', 3000), -(13733, 175, 1200, 'Lake Odessa', 'Lake Odessa', 3100), -(13734, 175, 1200, 'Lake Orion', 'Lake Orion', 3200), -(13735, 175, 1200, 'Lansing', 'Lansing', 3300), -(13736, 175, 1200, 'Madison Heights', 'Madison Heights', 3400), -(13737, 175, 1200, 'Novi', 'Novi', 3500), -(13738, 175, 1200, 'Oak Park', 'Oak Park', 3600), -(13739, 175, 1200, 'Oakland', 'Oakland', 3700), -(13740, 175, 1200, 'Okemos', 'Okemos', 3800), -(13741, 175, 1200, 'Pontiac', 'Pontiac', 3900), -(13742, 175, 1200, 'Riga', 'Riga', 4000), -(13743, 175, 1200, 'Rochester', 'Rochester', 4100), -(13744, 175, 1200, 'Royal Oak', 'Royal Oak', 4200), -(13745, 175, 1200, 'Saint Clair', 'Saint Clair', 4300), -(13746, 175, 1200, 'Southfield', 'Southfield', 4400), -(13747, 175, 1200, 'Sterling', 'Sterling', 4500), -(13748, 175, 1200, 'Sterling Heights', 'Sterling Heights', 4600), -(13749, 175, 1200, 'Swartz Creek', 'Swartz Creek', 4700), -(13750, 175, 1200, 'Traverse City', 'Traverse City', 4800), -(13751, 175, 1200, 'Troy', 'Troy', 4900), -(13752, 175, 1200, 'Utica', 'Utica', 5000), -(13753, 175, 1200, 'Walled Lake', 'Walled Lake', 5100), -(13754, 175, 1200, 'Warren', 'Warren', 5200), -(13755, 175, 1200, 'Waterford', 'Waterford', 5300), -(13756, 175, 1200, 'West Bloomfield', 'West Bloomfield', 5400), -(13757, 175, 1200, 'Wixom', 'Wixom', 5500), -(13758, 175, 1200, 'Ypsilanti', 'Ypsilanti', 5600), -(13759, 175, 1201, 'Acton', 'Acton', 100), -(13760, 175, 1201, 'Albert Lea', 'Albert Lea', 200), -(13761, 175, 1201, 'Alexandria', 'Alexandria', 300), -(13762, 175, 1201, 'Andover', 'Andover', 400), -(13763, 175, 1201, 'Anoka', 'Anoka', 500), -(13764, 175, 1201, 'Austin', 'Austin', 600), -(13765, 175, 1201, 'Bagley', 'Bagley', 700), -(13766, 175, 1201, 'Belle Plaine', 'Belle Plaine', 800), -(13767, 175, 1201, 'Blooming Prairie', 'Blooming Prairie', 900), -(13768, 175, 1201, 'Burnsville', 'Burnsville', 1000), -(13769, 175, 1201, 'Champlin', 'Champlin', 1100), -(13770, 175, 1201, 'Chisago City', 'Chisago City', 1200), -(13771, 175, 1201, 'Cotton', 'Cotton', 1300), -(13772, 175, 1201, 'Dayton', 'Dayton', 1400), -(13773, 175, 1201, 'Detroit Lakes', 'Detroit Lakes', 1500), -(13774, 175, 1201, 'Dover', 'Dover', 1600), -(13775, 175, 1201, 'Duluth', 'Duluth', 1700), -(13776, 175, 1201, 'Eden Prairie', 'Eden Prairie', 1800), -(13777, 175, 1201, 'Elk River', 'Elk River', 1900), -(13778, 175, 1201, 'Farmington', 'Farmington', 2000), -(13779, 175, 1201, 'Grand Rapids', 'Grand Rapids', 2100), -(13780, 175, 1201, 'Hopkins', 'Hopkins', 2200), -(13781, 175, 1201, 'Isanti', 'Isanti', 2300), -(13782, 175, 1201, 'Lake Elmo', 'Lake Elmo', 2400), -(13783, 175, 1201, 'Lakeville', 'Lakeville', 2500), -(13784, 175, 1201, 'Mankato', 'Mankato', 2600), -(13785, 175, 1201, 'Minneapolis', 'Minneapolis', 2700), -(13786, 175, 1201, 'Minnesota City', 'Minnesota City', 2800), -(13787, 175, 1201, 'Minnetonka', 'Minnetonka', 2900), -(13788, 175, 1201, 'Moorhead', 'Moorhead', 3000), -(13789, 175, 1201, 'Morris', 'Morris', 3100), -(13790, 175, 1201, 'Mound', 'Mound', 3200), -(13791, 175, 1201, 'North Branch', 'North Branch', 3300), -(13792, 175, 1201, 'Prior Lake', 'Prior Lake', 3400), -(13793, 175, 1201, 'Rochester', 'Rochester', 3500), -(13794, 175, 1201, 'Rosemount', 'Rosemount', 3600), -(13795, 175, 1201, 'Rothsay', 'Rothsay', 3700), -(13796, 175, 1201, 'Saint Cloud', 'Saint Cloud', 3800), -(13797, 175, 1201, 'Saint Paul', 'Saint Paul', 3900), -(13798, 175, 1201, 'Shakopee', 'Shakopee', 4000), -(13799, 175, 1201, 'Wayzata', 'Wayzata', 4100), -(13800, 175, 1202, 'Bay Springs', 'Bay Springs', 100), -(13801, 175, 1202, 'Biloxi', 'Biloxi', 200), -(13802, 175, 1202, 'Cleveland', 'Cleveland', 300), -(13803, 175, 1202, 'Gulfport', 'Gulfport', 400), -(13804, 175, 1202, 'Itta Bena', 'Itta Bena', 500), -(13805, 175, 1202, 'Jackson', 'Jackson', 600), -(13806, 175, 1202, 'Lucedale', 'Lucedale', 700), -(13807, 175, 1202, 'Natchez', 'Natchez', 800), -(13808, 175, 1202, 'Ocean Springs', 'Ocean Springs', 900), -(13809, 175, 1202, 'Oxford', 'Oxford', 1000), -(13810, 175, 1202, 'Pascagoula', 'Pascagoula', 1100), -(13811, 175, 1202, 'Southaven', 'Southaven', 1200), -(13812, 175, 1203, 'Arnold', 'Arnold', 100), -(13813, 175, 1203, 'Belton', 'Belton', 200), -(13814, 175, 1203, 'Branson', 'Branson', 300), -(13815, 175, 1203, 'California', 'California', 400), -(13816, 175, 1203, 'Columbia', 'Columbia', 500), -(13817, 175, 1203, 'Fulton', 'Fulton', 600), -(13818, 175, 1203, 'High Ridge', 'High Ridge', 700), -(13819, 175, 1203, 'Jefferson City', 'Jefferson City', 800), -(13820, 175, 1203, 'Kansas City', 'Kansas City', 900), -(13821, 175, 1203, 'Lake Saint Louis', 'Lake Saint Louis', 1000), -(13822, 175, 1203, 'Lees Summit', 'Lees Summit', 1100), -(13823, 175, 1203, 'Moberly', 'Moberly', 1200), -(13824, 175, 1203, 'New Haven', 'New Haven', 1300), -(13825, 175, 1203, 'Pomona', 'Pomona', 1400), -(13826, 175, 1203, 'Raymore', 'Raymore', 1500), -(13827, 175, 1203, 'Saint Charles', 'Saint Charles', 1600), -(13828, 175, 1203, 'Saint Louis', 'Saint Louis', 1700), -(13829, 175, 1203, 'Sedalia', 'Sedalia', 1800), -(13830, 175, 1203, 'Springfield', 'Springfield', 1900), -(13831, 175, 1203, 'St. Robert', 'St. Robert', 2000), -(13832, 175, 1203, 'Sweet Springs', 'Sweet Springs', 2100), -(13833, 175, 1203, 'West Plains', 'West Plains', 2200), -(13834, 175, 1204, 'Anaconda', 'Anaconda', 100), -(13835, 175, 1204, 'Angela', 'Angela', 200), -(13836, 175, 1204, 'Baker', 'Baker', 300), -(13837, 175, 1204, 'Belt', 'Belt', 400), -(13838, 175, 1204, 'Bigfork', 'Bigfork', 500), -(13839, 175, 1204, 'Billings', 'Billings', 600), -(13840, 175, 1204, 'Bozeman', 'Bozeman', 700), -(13841, 175, 1204, 'Broadview', 'Broadview', 800), -(13842, 175, 1204, 'Florence', 'Florence', 900), -(13843, 175, 1204, 'Frenchtown', 'Frenchtown', 1000), -(13844, 175, 1204, 'Great Falls', 'Great Falls', 1100), -(13845, 175, 1204, 'Helena', 'Helena', 1200), -(13846, 175, 1204, 'Kalispell', 'Kalispell', 1300), -(13847, 175, 1204, 'Libby', 'Libby', 1400), -(13848, 175, 1204, 'Lincoln', 'Lincoln', 1500), -(13849, 175, 1204, 'Missoula', 'Missoula', 1600), -(13850, 175, 1204, 'Polson', 'Polson', 1700), -(13851, 175, 1204, 'Silver Star', 'Silver Star', 1800), -(13852, 175, 1204, 'Sumatra', 'Sumatra', 1900), -(13853, 175, 1205, 'Ansley', 'Ansley', 100), -(13854, 175, 1205, 'Lincoln', 'Lincoln', 200), -(13855, 175, 1205, 'Omaha', 'Omaha', 300), -(13856, 175, 1205, 'Saint Edward', 'Saint Edward', 400), -(13857, 175, 1206, 'Alamo', 'Alamo', 100), -(13858, 175, 1206, 'Gardnerville Ranchos', 'Gardnerville Ranchos', 200), -(13859, 175, 1206, 'Henderson', 'Henderson', 300), -(13860, 175, 1206, 'Las Vegas', 'Las Vegas', 400), -(13861, 175, 1206, 'Manhattan', 'Manhattan', 500), -(13862, 175, 1206, 'Nixon', 'Nixon', 600), -(13863, 175, 1206, 'Reno', 'Reno', 700), -(13864, 175, 1206, 'Sun Valley', 'Sun Valley', 800), -(13865, 175, 1206, 'West Wendover', 'West Wendover', 900), -(13866, 175, 1207, 'Amherst', 'Amherst', 100), -(13867, 175, 1207, 'Concord', 'Concord', 200), -(13868, 175, 1207, 'Contoocook', 'Contoocook', 300), -(13869, 175, 1207, 'Derry', 'Derry', 400), -(13870, 175, 1207, 'Durham', 'Durham', 500), -(13871, 175, 1207, 'East Derry', 'East Derry', 600), -(13872, 175, 1207, 'Exeter', 'Exeter', 700), -(13873, 175, 1207, 'Hampton', 'Hampton', 800), -(13874, 175, 1207, 'Laconia', 'Laconia', 900), -(13875, 175, 1207, 'Manchester', 'Manchester', 1000), -(13876, 175, 1207, 'Merrimack', 'Merrimack', 1100), -(13877, 175, 1207, 'Nashua', 'Nashua', 1200), -(13878, 175, 1207, 'Newport', 'Newport', 1300), -(13879, 175, 1207, 'Portsmouth', 'Portsmouth', 1400), -(13880, 175, 1207, 'Rye', 'Rye', 1500), -(13881, 175, 1207, 'Salem', 'Salem', 1600), -(13882, 175, 1207, 'West Lebanon', 'West Lebanon', 1700), -(13883, 175, 1207, 'Wolfeboro', 'Wolfeboro', 1800), -(13884, 175, 1208, 'Absecon', 'Absecon', 100), -(13885, 175, 1208, 'Allentown', 'Allentown', 200), -(13886, 175, 1208, 'Alpine', 'Alpine', 300), -(13887, 175, 1208, 'Asbury', 'Asbury', 400), -(13888, 175, 1208, 'Asbury Park', 'Asbury Park', 500), -(13889, 175, 1208, 'Atlantic City', 'Atlantic City', 600), -(13890, 175, 1208, 'Atlantic Highlands', 'Atlantic Highlands', 700), -(13891, 175, 1208, 'Avalon', 'Avalon', 800), -(13892, 175, 1208, 'Avenel', 'Avenel', 900), -(13893, 175, 1208, 'Basking Ridge', 'Basking Ridge', 1000), -(13894, 175, 1208, 'Bayonne', 'Bayonne', 1100), -(13895, 175, 1208, 'Beach Haven', 'Beach Haven', 1200), -(13896, 175, 1208, 'Bedminster', 'Bedminster', 1300), -(13897, 175, 1208, 'Belle Mead', 'Belle Mead', 1400), -(13898, 175, 1208, 'Belmar', 'Belmar', 1500), -(13899, 175, 1208, 'Berlin', 'Berlin', 1600), -(13900, 175, 1208, 'Bernards', 'Bernards', 1700), -(13901, 175, 1208, 'Bloomfield', 'Bloomfield', 1800), -(13902, 175, 1208, 'Bloomingdale', 'Bloomingdale', 1900), -(13903, 175, 1208, 'Bogota', 'Bogota', 2000), -(13904, 175, 1208, 'Bordentown', 'Bordentown', 2100), -(13905, 175, 1208, 'Brick', 'Brick', 2200), -(13906, 175, 1208, 'Bridgewater', 'Bridgewater', 2300), -(13907, 175, 1208, 'Budd Lake', 'Budd Lake', 2400), -(13908, 175, 1208, 'Burlington', 'Burlington', 2500), -(13909, 175, 1208, 'Cape May', 'Cape May', 2600), -(13910, 175, 1208, 'Cape May Point', 'Cape May Point', 2700), -(13911, 175, 1208, 'Carteret', 'Carteret', 2800), -(13912, 175, 1208, 'Cherry Hill', 'Cherry Hill', 2900), -(13913, 175, 1208, 'Clark', 'Clark', 3000), -(13914, 175, 1208, 'Clementon', 'Clementon', 3100), -(13915, 175, 1208, 'Cliffside Park', 'Cliffside Park', 3200), -(13916, 175, 1208, 'Clifton', 'Clifton', 3300), -(13917, 175, 1208, 'Clinton', 'Clinton', 3400), -(13918, 175, 1208, 'Closter', 'Closter', 3500), -(13919, 175, 1208, 'Columbia', 'Columbia', 3600), -(13920, 175, 1208, 'Columbus', 'Columbus', 3700), -(13921, 175, 1208, 'Cranbury', 'Cranbury', 3800), -(13922, 175, 1208, 'Cresskill', 'Cresskill', 3900), -(13923, 175, 1208, 'Deal', 'Deal', 4000), -(13924, 175, 1208, 'Delaware', 'Delaware', 4100), -(13925, 175, 1208, 'Denville', 'Denville', 4200), -(13926, 175, 1208, 'Dover', 'Dover', 4300), -(13927, 175, 1208, 'Dumont', 'Dumont', 4400), -(13928, 175, 1208, 'East Brunswick', 'East Brunswick', 4500), -(13929, 175, 1208, 'East Hanover', 'East Hanover', 4600), -(13930, 175, 1208, 'East Orange', 'East Orange', 4700), -(13931, 175, 1208, 'Eatontown', 'Eatontown', 4800), -(13932, 175, 1208, 'Edgewater', 'Edgewater', 4900), -(13933, 175, 1208, 'Edison', 'Edison', 5000), -(13934, 175, 1208, 'Elizabeth', 'Elizabeth', 5100), -(13935, 175, 1208, 'Elmwood Park', 'Elmwood Park', 5200), -(13936, 175, 1208, 'Englewood', 'Englewood', 5300), -(13937, 175, 1208, 'Englishtown', 'Englishtown', 5400), -(13938, 175, 1208, 'Essex Fells', 'Essex Fells', 5500), -(13939, 175, 1208, 'Fair Lawn', 'Fair Lawn', 5600), -(13940, 175, 1208, 'Flemington', 'Flemington', 5700), -(13941, 175, 1208, 'Florham Park', 'Florham Park', 5800); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(13942, 175, 1208, 'Fort Lee', 'Fort Lee', 5900), -(13943, 175, 1208, 'Franklin Park', 'Franklin Park', 6000), -(13944, 175, 1208, 'Freehold', 'Freehold', 6100), -(13945, 175, 1208, 'Garfield', 'Garfield', 6200), -(13946, 175, 1208, 'Glen Ridge', 'Glen Ridge', 6300), -(13947, 175, 1208, 'Hackensack', 'Hackensack', 6400), -(13948, 175, 1208, 'Hackettstown', 'Hackettstown', 6500), -(13949, 175, 1208, 'Hampton', 'Hampton', 6600), -(13950, 175, 1208, 'Harrison', 'Harrison', 6700), -(13951, 175, 1208, 'Hawthorne', 'Hawthorne', 6800), -(13952, 175, 1208, 'Hazlet', 'Hazlet', 6900), -(13953, 175, 1208, 'Highland Park', 'Highland Park', 7000), -(13954, 175, 1208, 'Hillsdale', 'Hillsdale', 7100), -(13955, 175, 1208, 'Hoboken', 'Hoboken', 7200), -(13956, 175, 1208, 'Holmdel', 'Holmdel', 7300), -(13957, 175, 1208, 'Hopewell', 'Hopewell', 7400), -(13958, 175, 1208, 'Howell', 'Howell', 7500), -(13959, 175, 1208, 'Jackson', 'Jackson', 7600), -(13960, 175, 1208, 'Jamesburg', 'Jamesburg', 7700), -(13961, 175, 1208, 'Jersey City', 'Jersey City', 7800), -(13962, 175, 1208, 'Kearny', 'Kearny', 7900), -(13963, 175, 1208, 'Keasbey', 'Keasbey', 8000), -(13964, 175, 1208, 'Kenilworth', 'Kenilworth', 8100), -(13965, 175, 1208, 'Lakehurst', 'Lakehurst', 8200), -(13966, 175, 1208, 'Lakewood', 'Lakewood', 8300), -(13967, 175, 1208, 'Lincoln Park', 'Lincoln Park', 8400), -(13968, 175, 1208, 'Linden', 'Linden', 8500), -(13969, 175, 1208, 'Little Falls', 'Little Falls', 8600), -(13970, 175, 1208, 'Long Branch', 'Long Branch', 8700), -(13971, 175, 1208, 'Madison', 'Madison', 8800), -(13972, 175, 1208, 'Mahwah', 'Mahwah', 8900), -(13973, 175, 1208, 'Manville', 'Manville', 9000), -(13974, 175, 1208, 'Maplewood', 'Maplewood', 9100), -(13975, 175, 1208, 'Margate City', 'Margate City', 9200), -(13976, 175, 1208, 'Marlboro', 'Marlboro', 9300), -(13977, 175, 1208, 'Marlton', 'Marlton', 9400), -(13978, 175, 1208, 'Matawan', 'Matawan', 9500), -(13979, 175, 1208, 'Middletown', 'Middletown', 9600), -(13980, 175, 1208, 'Millburn', 'Millburn', 9700), -(13981, 175, 1208, 'Monmouth Junction', 'Monmouth Junction', 9800), -(13982, 175, 1208, 'Montclair', 'Montclair', 9900), -(13983, 175, 1208, 'Montvale', 'Montvale', 10000), -(13984, 175, 1208, 'Montville', 'Montville', 10100), -(13985, 175, 1208, 'Morganville', 'Morganville', 10200), -(13986, 175, 1208, 'Morris Plains', 'Morris Plains', 10300), -(13987, 175, 1208, 'Morristown', 'Morristown', 10400), -(13988, 175, 1208, 'Mount Arlington', 'Mount Arlington', 10500), -(13989, 175, 1208, 'Mount Laurel', 'Mount Laurel', 10600), -(13990, 175, 1208, 'Navesink', 'Navesink', 10700), -(13991, 175, 1208, 'Neptune', 'Neptune', 10800), -(13992, 175, 1208, 'New Brunswick', 'New Brunswick', 10900), -(13993, 175, 1208, 'New Egypt', 'New Egypt', 11000), -(13994, 175, 1208, 'New York', 'New York', 11100), -(13995, 175, 1208, 'Newark', 'Newark', 11200), -(13996, 175, 1208, 'Norma', 'Norma', 11300), -(13997, 175, 1208, 'North Arlington', 'North Arlington', 11400), -(13998, 175, 1208, 'North Bergen', 'North Bergen', 11500), -(13999, 175, 1208, 'North Brunswick', 'North Brunswick', 11600), -(14000, 175, 1208, 'Nutley', 'Nutley', 11700), -(14001, 175, 1208, 'Oakhurst', 'Oakhurst', 11800), -(14002, 175, 1208, 'Ocean City', 'Ocean City', 11900), -(14003, 175, 1208, 'Old Bridge', 'Old Bridge', 12000), -(14004, 175, 1208, 'Oradell', 'Oradell', 12100), -(14005, 175, 1208, 'Orange', 'Orange', 12200), -(14006, 175, 1208, 'Palisades Park', 'Palisades Park', 12300), -(14007, 175, 1208, 'Paramus', 'Paramus', 12400), -(14008, 175, 1208, 'Parlin', 'Parlin', 12500), -(14009, 175, 1208, 'Parsippany', 'Parsippany', 12600), -(14010, 175, 1208, 'Passaic', 'Passaic', 12700), -(14011, 175, 1208, 'Paterson', 'Paterson', 12800), -(14012, 175, 1208, 'Paulsboro', 'Paulsboro', 12900), -(14013, 175, 1208, 'Perth Amboy', 'Perth Amboy', 13000), -(14014, 175, 1208, 'Phillipsburg', 'Phillipsburg', 13100), -(14015, 175, 1208, 'Piscataway', 'Piscataway', 13200), -(14016, 175, 1208, 'Plainfield', 'Plainfield', 13300), -(14017, 175, 1208, 'Plainsboro', 'Plainsboro', 13400), -(14018, 175, 1208, 'Pomona', 'Pomona', 13500), -(14019, 175, 1208, 'Princeton', 'Princeton', 13600), -(14020, 175, 1208, 'Randolph', 'Randolph', 13700), -(14021, 175, 1208, 'Red Bank', 'Red Bank', 13800), -(14022, 175, 1208, 'Ridgewood', 'Ridgewood', 13900), -(14023, 175, 1208, 'River Edge', 'River Edge', 14000), -(14024, 175, 1208, 'Rockaway', 'Rockaway', 14100), -(14025, 175, 1208, 'Runnemede', 'Runnemede', 14200), -(14026, 175, 1208, 'Rutherford', 'Rutherford', 14300), -(14027, 175, 1208, 'Saddle Brook', 'Saddle Brook', 14400), -(14028, 175, 1208, 'Saddle River', 'Saddle River', 14500), -(14029, 175, 1208, 'Sayreville', 'Sayreville', 14600), -(14030, 175, 1208, 'Scotch Plains', 'Scotch Plains', 14700), -(14031, 175, 1208, 'Sea Girt', 'Sea Girt', 14800), -(14032, 175, 1208, 'Seaside Heights', 'Seaside Heights', 14900), -(14033, 175, 1208, 'Short Hills', 'Short Hills', 15000), -(14034, 175, 1208, 'Somerset', 'Somerset', 15100), -(14035, 175, 1208, 'Somerville', 'Somerville', 15200), -(14036, 175, 1208, 'South Amboy', 'South Amboy', 15300), -(14037, 175, 1208, 'South Orange', 'South Orange', 15400), -(14038, 175, 1208, 'South River', 'South River', 15500), -(14039, 175, 1208, 'Spring Lake', 'Spring Lake', 15600), -(14040, 175, 1208, 'Springfield', 'Springfield', 15700), -(14041, 175, 1208, 'Stirling', 'Stirling', 15800), -(14042, 175, 1208, 'Stockton', 'Stockton', 15900), -(14043, 175, 1208, 'Stone Harbor', 'Stone Harbor', 16000), -(14044, 175, 1208, 'Summit', 'Summit', 16100), -(14045, 175, 1208, 'Sussex', 'Sussex', 16200), -(14046, 175, 1208, 'Teaneck', 'Teaneck', 16300), -(14047, 175, 1208, 'Toms River', 'Toms River', 16400), -(14048, 175, 1208, 'Trenton', 'Trenton', 16500), -(14049, 175, 1208, 'Union', 'Union', 16600), -(14050, 175, 1208, 'Union City', 'Union City', 16700), -(14051, 175, 1208, 'Ventnor City', 'Ventnor City', 16800), -(14052, 175, 1208, 'Vernon', 'Vernon', 16900), -(14053, 175, 1208, 'Vineland', 'Vineland', 17000), -(14054, 175, 1208, 'Wallington', 'Wallington', 17100), -(14055, 175, 1208, 'Washington', 'Washington', 17200), -(14056, 175, 1208, 'Wayne', 'Wayne', 17300), -(14057, 175, 1208, 'West New York', 'West New York', 17400), -(14058, 175, 1208, 'West Orange', 'West Orange', 17500), -(14059, 175, 1208, 'West Paterson', 'West Paterson', 17600), -(14060, 175, 1208, 'Westfield', 'Westfield', 17700), -(14061, 175, 1208, 'Westwood', 'Westwood', 17800), -(14062, 175, 1208, 'Wharton', 'Wharton', 17900), -(14063, 175, 1208, 'Wildwood', 'Wildwood', 18000), -(14064, 175, 1208, 'Woodbridge', 'Woodbridge', 18100), -(14065, 175, 1208, 'Woodcliff Lake', 'Woodcliff Lake', 18200), -(14066, 175, 1209, 'Alamogordo', 'Alamogordo', 100), -(14067, 175, 1209, 'Albuquerque', 'Albuquerque', 200), -(14068, 175, 1209, 'Angel Fire', 'Angel Fire', 300), -(14069, 175, 1209, 'Aragon', 'Aragon', 400), -(14070, 175, 1209, 'Cleveland', 'Cleveland', 500), -(14071, 175, 1209, 'Cuba', 'Cuba', 600), -(14072, 175, 1209, 'Las Cruces', 'Las Cruces', 700), -(14073, 175, 1209, 'Las Vegas', 'Las Vegas', 800), -(14074, 175, 1209, 'Miami', 'Miami', 900), -(14075, 175, 1209, 'Newkirk', 'Newkirk', 1000), -(14076, 175, 1209, 'Portales', 'Portales', 1100), -(14077, 175, 1209, 'Roswell', 'Roswell', 1200), -(14078, 175, 1209, 'Santa Fe', 'Santa Fe', 1300), -(14079, 175, 1210, 'Accord', 'Accord', 100), -(14080, 175, 1210, 'Acra', 'Acra', 200), -(14081, 175, 1210, 'Adams', 'Adams', 300), -(14082, 175, 1210, 'Adams Basin', 'Adams Basin', 400), -(14083, 175, 1210, 'Adams Center', 'Adams Center', 500), -(14084, 175, 1210, 'Addison', 'Addison', 600), -(14085, 175, 1210, 'Adirondack', 'Adirondack', 700), -(14086, 175, 1210, 'Afton', 'Afton', 800), -(14087, 175, 1210, 'Alabama', 'Alabama', 900), -(14088, 175, 1210, 'Albany', 'Albany', 1000), -(14089, 175, 1210, 'Albion', 'Albion', 1100), -(14090, 175, 1210, 'Alden', 'Alden', 1200), -(14091, 175, 1210, 'Alexander', 'Alexander', 1300), -(14092, 175, 1210, 'Alexandria Bay', 'Alexandria Bay', 1400), -(14093, 175, 1210, 'Alfred', 'Alfred', 1500), -(14094, 175, 1210, 'Alpine', 'Alpine', 1600), -(14095, 175, 1210, 'Altamont', 'Altamont', 1700), -(14096, 175, 1210, 'Amsterdam', 'Amsterdam', 1800), -(14097, 175, 1210, 'Angelica', 'Angelica', 1900), -(14098, 175, 1210, 'Ardsley', 'Ardsley', 2000), -(14099, 175, 1210, 'Ardsley On Hudson', 'Ardsley On Hudson', 2100), -(14100, 175, 1210, 'Armonk', 'Armonk', 2200), -(14101, 175, 1210, 'Astoria', 'Astoria', 2300), -(14102, 175, 1210, 'Athol', 'Athol', 2400), -(14103, 175, 1210, 'Atlanta', 'Atlanta', 2500), -(14104, 175, 1210, 'Atlantic Beach', 'Atlantic Beach', 2600), -(14105, 175, 1210, 'Babylon', 'Babylon', 2700), -(14106, 175, 1210, 'Barneveld', 'Barneveld', 2800), -(14107, 175, 1210, 'Barton', 'Barton', 2900), -(14108, 175, 1210, 'Basom', 'Basom', 3000), -(14109, 175, 1210, 'Bellerose', 'Bellerose', 3100), -(14110, 175, 1210, 'Black River', 'Black River', 3200), -(14111, 175, 1210, 'Bolton Landing', 'Bolton Landing', 3300), -(14112, 175, 1210, 'Boston', 'Boston', 3400), -(14113, 175, 1210, 'Bradford', 'Bradford', 3500), -(14114, 175, 1210, 'Brasher Falls', 'Brasher Falls', 3600), -(14115, 175, 1210, 'Breezy Point', 'Breezy Point', 3700), -(14116, 175, 1210, 'Bronx', 'Bronx', 3800), -(14117, 175, 1210, 'Brooklyn', 'Brooklyn', 3900), -(14118, 175, 1210, 'Buffalo', 'Buffalo', 4000), -(14119, 175, 1210, 'Byron', 'Byron', 4100), -(14120, 175, 1210, 'Cambridge', 'Cambridge', 4200), -(14121, 175, 1210, 'Cameron', 'Cameron', 4300), -(14122, 175, 1210, 'Carthage', 'Carthage', 4400), -(14123, 175, 1210, 'Ceres', 'Ceres', 4500), -(14124, 175, 1210, 'Chelsea', 'Chelsea', 4600), -(14125, 175, 1210, 'Cleveland', 'Cleveland', 4700), -(14126, 175, 1210, 'Clifton Park', 'Clifton Park', 4800), -(14127, 175, 1210, 'Climax', 'Climax', 4900), -(14128, 175, 1210, 'Colden', 'Colden', 5000), -(14129, 175, 1210, 'College Point', 'College Point', 5100), -(14130, 175, 1210, 'Conklin', 'Conklin', 5200), -(14131, 175, 1210, 'Copiague', 'Copiague', 5300), -(14132, 175, 1210, 'Corona', 'Corona', 5400), -(14133, 175, 1210, 'Denver', 'Denver', 5500), -(14134, 175, 1210, 'Dexter', 'Dexter', 5600), -(14135, 175, 1210, 'East Hampton', 'East Hampton', 5700), -(14136, 175, 1210, 'East Northport', 'East Northport', 5800), -(14137, 175, 1210, 'Ellenburg', 'Ellenburg', 5900), -(14138, 175, 1210, 'Elmhurst', 'Elmhurst', 6000), -(14139, 175, 1210, 'Far Rockaway', 'Far Rockaway', 6100), -(14140, 175, 1210, 'Florida', 'Florida', 6200), -(14141, 175, 1210, 'Flushing', 'Flushing', 6300), -(14142, 175, 1210, 'Forest Hills', 'Forest Hills', 6400), -(14143, 175, 1210, 'Fresh Meadows', 'Fresh Meadows', 6500), -(14144, 175, 1210, 'Garden City', 'Garden City', 6600), -(14145, 175, 1210, 'Ghent', 'Ghent', 6700), -(14146, 175, 1210, 'Hampton', 'Hampton', 6800), -(14147, 175, 1210, 'Hauppauge', 'Hauppauge', 6900), -(14148, 175, 1210, 'Hempstead', 'Hempstead', 7000), -(14149, 175, 1210, 'Hicksville', 'Hicksville', 7100), -(14150, 175, 1210, 'Hortonville', 'Hortonville', 7200), -(14151, 175, 1210, 'Huntington', 'Huntington', 7300), -(14152, 175, 1210, 'Hyde Park', 'Hyde Park', 7400), -(14153, 175, 1210, 'Ithaca', 'Ithaca', 7500), -(14154, 175, 1210, 'Jacksonville', 'Jacksonville', 7600), -(14155, 175, 1210, 'Jamaica', 'Jamaica', 7700), -(14156, 175, 1210, 'Kendall', 'Kendall', 7800), -(14157, 175, 1210, 'Kew Gardens', 'Kew Gardens', 7900), -(14158, 175, 1210, 'Kingston', 'Kingston', 8000), -(14159, 175, 1210, 'Lake Placid', 'Lake Placid', 8100), -(14160, 175, 1210, 'Laurens', 'Laurens', 8200), -(14161, 175, 1210, 'Long Beach', 'Long Beach', 8300), -(14162, 175, 1210, 'Long Island City', 'Long Island City', 8400), -(14163, 175, 1210, 'Macedon', 'Macedon', 8500), -(14164, 175, 1210, 'Mahopac', 'Mahopac', 8600), -(14165, 175, 1210, 'Malden On Hudson', 'Malden On Hudson', 8700), -(14166, 175, 1210, 'Manchester', 'Manchester', 8800), -(14167, 175, 1210, 'Manhasset', 'Manhasset', 8900), -(14168, 175, 1210, 'Marathon', 'Marathon', 9000), -(14169, 175, 1210, 'Marlboro', 'Marlboro', 9100), -(14170, 175, 1210, 'Massapequa', 'Massapequa', 9200), -(14171, 175, 1210, 'Massapequa Park', 'Massapequa Park', 9300), -(14172, 175, 1210, 'Mastic Beach', 'Mastic Beach', 9400), -(14173, 175, 1210, 'Middletown', 'Middletown', 9500), -(14174, 175, 1210, 'Miller Place', 'Miller Place', 9600), -(14175, 175, 1210, 'Modena', 'Modena', 9700), -(14176, 175, 1210, 'Monsey', 'Monsey', 9800), -(14177, 175, 1210, 'Moriah Center', 'Moriah Center', 9900), -(14178, 175, 1210, 'Mount Kisco', 'Mount Kisco', 10000), -(14179, 175, 1210, 'Mount Vernon', 'Mount Vernon', 10100), -(14180, 175, 1210, 'Nanuet', 'Nanuet', 10200), -(14181, 175, 1210, 'Natural Bridge', 'Natural Bridge', 10300), -(14182, 175, 1210, 'New Baltimore', 'New Baltimore', 10400), -(14183, 175, 1210, 'New City', 'New City', 10500), -(14184, 175, 1210, 'New Hampton', 'New Hampton', 10600), -(14185, 175, 1210, 'New Hartford', 'New Hartford', 10700), -(14186, 175, 1210, 'New Paltz', 'New Paltz', 10800), -(14187, 175, 1210, 'New Rochelle', 'New Rochelle', 10900), -(14188, 175, 1210, 'New Russia', 'New Russia', 11000), -(14189, 175, 1210, 'New Windsor', 'New Windsor', 11100), -(14190, 175, 1210, 'New York', 'New York', 11200), -(14191, 175, 1210, 'New York Mills', 'New York Mills', 11300), -(14192, 175, 1210, 'Newark', 'Newark', 11400), -(14193, 175, 1210, 'Newburgh', 'Newburgh', 11500), -(14194, 175, 1210, 'Oceanside', 'Oceanside', 11600), -(14195, 175, 1210, 'Odessa', 'Odessa', 11700), -(14196, 175, 1210, 'Oriskany', 'Oriskany', 11800), -(14197, 175, 1210, 'Ossining', 'Ossining', 11900), -(14198, 175, 1210, 'Oxford', 'Oxford', 12000), -(14199, 175, 1210, 'Oyster Bay', 'Oyster Bay', 12100), -(14200, 175, 1210, 'Patchogue', 'Patchogue', 12200), -(14201, 175, 1210, 'Philadelphia', 'Philadelphia', 12300), -(14202, 175, 1210, 'Phoenicia', 'Phoenicia', 12400), -(14203, 175, 1210, 'Plattsburgh', 'Plattsburgh', 12500), -(14204, 175, 1210, 'Port Washington', 'Port Washington', 12600), -(14205, 175, 1210, 'Potsdam', 'Potsdam', 12700), -(14206, 175, 1210, 'Queens Village', 'Queens Village', 12800), -(14207, 175, 1210, 'Rego Park', 'Rego Park', 12900), -(14208, 175, 1210, 'Richmond Hill', 'Richmond Hill', 13000), -(14209, 175, 1210, 'Ridgewood', 'Ridgewood', 13100), -(14210, 175, 1210, 'Riverhead', 'Riverhead', 13200), -(14211, 175, 1210, 'Rochester', 'Rochester', 13300), -(14212, 175, 1210, 'Rome', 'Rome', 13400), -(14213, 175, 1210, 'Russell', 'Russell', 13500), -(14214, 175, 1210, 'Sardinia', 'Sardinia', 13600), -(14215, 175, 1210, 'Scarsdale', 'Scarsdale', 13700), -(14216, 175, 1210, 'Schenectady', 'Schenectady', 13800), -(14217, 175, 1210, 'Sidney', 'Sidney', 13900), -(14218, 175, 1210, 'Sound Beach', 'Sound Beach', 14000), -(14219, 175, 1210, 'Southampton', 'Southampton', 14100), -(14220, 175, 1210, 'Spring Valley', 'Spring Valley', 14200), -(14221, 175, 1210, 'Stony Brook', 'Stony Brook', 14300), -(14222, 175, 1210, 'Sunnyside', 'Sunnyside', 14400), -(14223, 175, 1210, 'Syosset', 'Syosset', 14500), -(14224, 175, 1210, 'Syracuse', 'Syracuse', 14600), -(14225, 175, 1210, 'Taberg', 'Taberg', 14700), -(14226, 175, 1210, 'Utica', 'Utica', 14800), -(14227, 175, 1210, 'Valley Stream', 'Valley Stream', 14900), -(14228, 175, 1210, 'Wappingers Falls', 'Wappingers Falls', 15000), -(14229, 175, 1210, 'Wellsburg', 'Wellsburg', 15100), -(14230, 175, 1210, 'West Nyack', 'West Nyack', 15200), -(14231, 175, 1210, 'West Park', 'West Park', 15300), -(14232, 175, 1210, 'Westbury', 'Westbury', 15400), -(14233, 175, 1210, 'Westford', 'Westford', 15500), -(14234, 175, 1210, 'Westport', 'Westport', 15600), -(14235, 175, 1210, 'White Plains', 'White Plains', 15700), -(14236, 175, 1210, 'Wolcott', 'Wolcott', 15800), -(14237, 175, 1210, 'Yonkers', 'Yonkers', 15900), -(14238, 175, 1210, 'York', 'York', 16000), -(14239, 175, 1210, 'Yorktown Heights', 'Yorktown Heights', 16100), -(14240, 175, 1211, 'Aberdeen', 'Aberdeen', 100), -(14241, 175, 1211, 'Apex', 'Apex', 200), -(14242, 175, 1211, 'Asheville', 'Asheville', 300), -(14243, 175, 1211, 'Brevard', 'Brevard', 400), -(14244, 175, 1211, 'Candler', 'Candler', 500), -(14245, 175, 1211, 'Carolina Beach', 'Carolina Beach', 600), -(14246, 175, 1211, 'Cary', 'Cary', 700), -(14247, 175, 1211, 'Cashiers', 'Cashiers', 800), -(14248, 175, 1211, 'Chapel Hill', 'Chapel Hill', 900), -(14249, 175, 1211, 'Charlotte', 'Charlotte', 1000), -(14250, 175, 1211, 'Deep Gap', 'Deep Gap', 1100), -(14251, 175, 1211, 'Durham', 'Durham', 1200), -(14252, 175, 1211, 'Eden', 'Eden', 1300), -(14253, 175, 1211, 'Elizabeth City', 'Elizabeth City', 1400), -(14254, 175, 1211, 'Fayetteville', 'Fayetteville', 1500), -(14255, 175, 1211, 'Fort Bragg', 'Fort Bragg', 1600), -(14256, 175, 1211, 'Fuquay Varina', 'Fuquay Varina', 1700), -(14257, 175, 1211, 'Gastonia', 'Gastonia', 1800), -(14258, 175, 1211, 'Graham', 'Graham', 1900), -(14259, 175, 1211, 'Greensboro', 'Greensboro', 2000), -(14260, 175, 1211, 'Greenville', 'Greenville', 2100), -(14261, 175, 1211, 'Grifton', 'Grifton', 2200), -(14262, 175, 1211, 'Hendersonville', 'Hendersonville', 2300), -(14263, 175, 1211, 'Indian Trail', 'Indian Trail', 2400), -(14264, 175, 1211, 'Jacksonville', 'Jacksonville', 2500), -(14265, 175, 1211, 'Kernersville', 'Kernersville', 2600), -(14266, 175, 1211, 'Kill Devil Hills', 'Kill Devil Hills', 2700), -(14267, 175, 1211, 'Kitty Hawk', 'Kitty Hawk', 2800), -(14268, 175, 1211, 'Matthews', 'Matthews', 2900), -(14269, 175, 1211, 'Minneapolis', 'Minneapolis', 3000), -(14270, 175, 1211, 'Morrisville', 'Morrisville', 3100), -(14271, 175, 1211, 'Mount Olive', 'Mount Olive', 3200), -(14272, 175, 1211, 'Moyock', 'Moyock', 3300), -(14273, 175, 1211, 'New Bern', 'New Bern', 3400), -(14274, 175, 1211, 'Raeford', 'Raeford', 3500), -(14275, 175, 1211, 'Raleigh', 'Raleigh', 3600), -(14276, 175, 1211, 'Shelby', 'Shelby', 3700), -(14277, 175, 1211, 'Wake Forest', 'Wake Forest', 3800), -(14278, 175, 1211, 'Wilmington', 'Wilmington', 3900), -(14279, 175, 1211, 'Winston Salem', 'Winston Salem', 4000), -(14280, 175, 1211, 'Woodleaf', 'Woodleaf', 4100), -(14281, 175, 1211, 'Wrightsville Beach', 'Wrightsville Beach', 4200), -(14282, 175, 1212, 'Bismarck', 'Bismarck', 100), -(14283, 175, 1212, 'Fargo', 'Fargo', 200), -(14284, 175, 1213, 'Akron', 'Akron', 100), -(14285, 175, 1213, 'Alliance', 'Alliance', 200), -(14286, 175, 1213, 'Alpha', 'Alpha', 300), -(14287, 175, 1213, 'Ansonia', 'Ansonia', 400), -(14288, 175, 1213, 'Arcadia', 'Arcadia', 500), -(14289, 175, 1213, 'Athens', 'Athens', 600), -(14290, 175, 1213, 'Aurora', 'Aurora', 700), -(14291, 175, 1213, 'Beachwood', 'Beachwood', 800), -(14292, 175, 1213, 'Bedford', 'Bedford', 900), -(14293, 175, 1213, 'Canton', 'Canton', 1000), -(14294, 175, 1213, 'Cherry Fork', 'Cherry Fork', 1100), -(14295, 175, 1213, 'Chesterland', 'Chesterland', 1200), -(14296, 175, 1213, 'Cincinnati', 'Cincinnati', 1300), -(14297, 175, 1213, 'Cleveland', 'Cleveland', 1400), -(14298, 175, 1213, 'Columbus', 'Columbus', 1500), -(14299, 175, 1213, 'Dayton', 'Dayton', 1600), -(14300, 175, 1213, 'Hartville', 'Hartville', 1700), -(14301, 175, 1213, 'Hudson', 'Hudson', 1800), -(14302, 175, 1213, 'Huron', 'Huron', 1900), -(14303, 175, 1213, 'Kent', 'Kent', 2000), -(14304, 175, 1213, 'Lebanon', 'Lebanon', 2100), -(14305, 175, 1213, 'Lockbourne', 'Lockbourne', 2200), -(14306, 175, 1213, 'Loveland', 'Loveland', 2300), -(14307, 175, 1213, 'Lyons', 'Lyons', 2400), -(14308, 175, 1213, 'Maineville', 'Maineville', 2500), -(14309, 175, 1213, 'Mansfield', 'Mansfield', 2600), -(14310, 175, 1213, 'Marietta', 'Marietta', 2700), -(14311, 175, 1213, 'Massillon', 'Massillon', 2800), -(14312, 175, 1213, 'Newark', 'Newark', 2900), -(14313, 175, 1213, 'North Royalton', 'North Royalton', 3000), -(14314, 175, 1213, 'Oakwood', 'Oakwood', 3100), -(14315, 175, 1213, 'Oberlin', 'Oberlin', 3200), -(14316, 175, 1213, 'Ohio City', 'Ohio City', 3300), -(14317, 175, 1213, 'Richmond', 'Richmond', 3400), -(14318, 175, 1213, 'Sandusky', 'Sandusky', 3500), -(14319, 175, 1213, 'Springfield', 'Springfield', 3600), -(14320, 175, 1213, 'Sylvania', 'Sylvania', 3700), -(14321, 175, 1213, 'Toledo', 'Toledo', 3800), -(14322, 175, 1213, 'Warren', 'Warren', 3900), -(14323, 175, 1213, 'West Chester', 'West Chester', 4000), -(14324, 175, 1213, 'Willoughby', 'Willoughby', 4100), -(14325, 175, 1213, 'Zanesville', 'Zanesville', 4200), -(14326, 175, 1214, 'Dover', 'Dover', 100), -(14327, 175, 1214, 'Fort Sill', 'Fort Sill', 200), -(14328, 175, 1214, 'Jenks', 'Jenks', 300), -(14329, 175, 1214, 'Lawton', 'Lawton', 400), -(14330, 175, 1214, 'Norman', 'Norman', 500), -(14331, 175, 1214, 'Oklahoma City', 'Oklahoma City', 600), -(14332, 175, 1214, 'Stillwater', 'Stillwater', 700), -(14333, 175, 1214, 'Tulsa', 'Tulsa', 800), -(14334, 175, 1215, 'Albany', 'Albany', 100), -(14335, 175, 1215, 'Beaverton', 'Beaverton', 200), -(14336, 175, 1215, 'Bend', 'Bend', 300), -(14337, 175, 1215, 'Clackamas', 'Clackamas', 400), -(14338, 175, 1215, 'Corvallis', 'Corvallis', 500), -(14339, 175, 1215, 'Dallas', 'Dallas', 600), -(14340, 175, 1215, 'Detroit', 'Detroit', 700), -(14341, 175, 1215, 'Estacada', 'Estacada', 800), -(14342, 175, 1215, 'Eugene', 'Eugene', 900), -(14343, 175, 1215, 'Gervais', 'Gervais', 1000), -(14344, 175, 1215, 'Gresham', 'Gresham', 1100), -(14345, 175, 1215, 'Hillsboro', 'Hillsboro', 1200), -(14346, 175, 1215, 'Lake Oswego', 'Lake Oswego', 1300), -(14347, 175, 1215, 'Medford', 'Medford', 1400), -(14348, 175, 1215, 'Phoenix', 'Phoenix', 1500), -(14349, 175, 1215, 'Portland', 'Portland', 1600), -(14350, 175, 1215, 'Powell Butte', 'Powell Butte', 1700), -(14351, 175, 1215, 'Salem', 'Salem', 1800), -(14352, 175, 1215, 'Stayton', 'Stayton', 1900), -(14353, 175, 1215, 'Troutdale', 'Troutdale', 2000), -(14354, 175, 1215, 'Woodburn', 'Woodburn', 2100), -(14355, 175, 1216, 'Abington', 'Abington', 100), -(14356, 175, 1216, 'Adamstown', 'Adamstown', 200), -(14357, 175, 1216, 'Akron', 'Akron', 300), -(14358, 175, 1216, 'Allentown', 'Allentown', 400), -(14359, 175, 1216, 'Apollo', 'Apollo', 500), -(14360, 175, 1216, 'Bensalem', 'Bensalem', 600), -(14361, 175, 1216, 'Berlin', 'Berlin', 700), -(14362, 175, 1216, 'Bethlehem', 'Bethlehem', 800), -(14363, 175, 1216, 'Birdsboro', 'Birdsboro', 900), -(14364, 175, 1216, 'Bristol', 'Bristol', 1000), -(14365, 175, 1216, 'Brooklyn', 'Brooklyn', 1100), -(14366, 175, 1216, 'Brookville', 'Brookville', 1200), -(14367, 175, 1216, 'Camp Hill', 'Camp Hill', 1300), -(14368, 175, 1216, 'Catasauqua', 'Catasauqua', 1400), -(14369, 175, 1216, 'Clarion', 'Clarion', 1500), -(14370, 175, 1216, 'Clarks Summit', 'Clarks Summit', 1600), -(14371, 175, 1216, 'Coaldale', 'Coaldale', 1700), -(14372, 175, 1216, 'Cranberry Twp', 'Cranberry Twp', 1800), -(14373, 175, 1216, 'Denver', 'Denver', 1900), -(14374, 175, 1216, 'Eagleville', 'Eagleville', 2000), -(14375, 175, 1216, 'East Earl', 'East Earl', 2100), -(14376, 175, 1216, 'Easton', 'Easton', 2200), -(14377, 175, 1216, 'Enola', 'Enola', 2300), -(14378, 175, 1216, 'Erie', 'Erie', 2400), -(14379, 175, 1216, 'Exton', 'Exton', 2500), -(14380, 175, 1216, 'Feasterville Trevose', 'Feasterville Trevose', 2600), -(14381, 175, 1216, 'Franconia', 'Franconia', 2700), -(14382, 175, 1216, 'Gettysburg', 'Gettysburg', 2800), -(14383, 175, 1216, 'Girard', 'Girard', 2900), -(14384, 175, 1216, 'Gladwyne', 'Gladwyne', 3000), -(14385, 175, 1216, 'Greensburg', 'Greensburg', 3100), -(14386, 175, 1216, 'Harrisburg', 'Harrisburg', 3200), -(14387, 175, 1216, 'Hazleton', 'Hazleton', 3300), -(14388, 175, 1216, 'Hershey', 'Hershey', 3400), -(14389, 175, 1216, 'Jamison', 'Jamison', 3500), -(14390, 175, 1216, 'King Of Prussia', 'King Of Prussia', 3600), -(14391, 175, 1216, 'Lancaster', 'Lancaster', 3700), -(14392, 175, 1216, 'Langhorne', 'Langhorne', 3800), -(14393, 175, 1216, 'Lansdale', 'Lansdale', 3900), -(14394, 175, 1216, 'Levittown', 'Levittown', 4000), -(14395, 175, 1216, 'Lewisburg', 'Lewisburg', 4100), -(14396, 175, 1216, 'Lewistown', 'Lewistown', 4200), -(14397, 175, 1216, 'Lock Haven', 'Lock Haven', 4300), -(14398, 175, 1216, 'Mexico', 'Mexico', 4400), -(14399, 175, 1216, 'Monessen', 'Monessen', 4500), -(14400, 175, 1216, 'Morrisville', 'Morrisville', 4600), -(14401, 175, 1216, 'Moscow', 'Moscow', 4700), -(14402, 175, 1216, 'Mountain Top', 'Mountain Top', 4800), -(14403, 175, 1216, 'New Hope', 'New Hope', 4900), -(14404, 175, 1216, 'Newtown', 'Newtown', 5000), -(14405, 175, 1216, 'Norristown', 'Norristown', 5100), -(14406, 175, 1216, 'North East', 'North East', 5200), -(14407, 175, 1216, 'Oxford', 'Oxford', 5300), -(14408, 175, 1216, 'Philadelphia', 'Philadelphia', 5400), -(14409, 175, 1216, 'Philipsburg', 'Philipsburg', 5500), -(14410, 175, 1216, 'Pittsburgh', 'Pittsburgh', 5600), -(14411, 175, 1216, 'Reading', 'Reading', 5700), -(14412, 175, 1216, 'Richboro', 'Richboro', 5800), -(14413, 175, 1216, 'Scranton', 'Scranton', 5900), -(14414, 175, 1216, 'State College', 'State College', 6000), -(14415, 175, 1216, 'Strasburg', 'Strasburg', 6100), -(14416, 175, 1216, 'Stroudsburg', 'Stroudsburg', 6200), -(14417, 175, 1216, 'Susquehanna', 'Susquehanna', 6300), -(14418, 175, 1216, 'Tobyhanna', 'Tobyhanna', 6400), -(14419, 175, 1216, 'Towanda', 'Towanda', 6500), -(14420, 175, 1216, 'Uniontown', 'Uniontown', 6600), -(14421, 175, 1216, 'Washington', 'Washington', 6700), -(14422, 175, 1216, 'Wilkes Barre', 'Wilkes Barre', 6800), -(14423, 175, 1216, 'Willow Street', 'Willow Street', 6900), -(14424, 175, 1216, 'Wolf', 'Wolf', 7000), -(14425, 175, 1216, 'York', 'York', 7100), -(14426, 175, 1217, 'Block Island', 'Block Island', 100), -(14427, 175, 1217, 'East Providence', 'East Providence', 200), -(14428, 175, 1217, 'Narragansett', 'Narragansett', 300), -(14429, 175, 1217, 'Newport', 'Newport', 400), -(14430, 175, 1217, 'Pascoag', 'Pascoag', 500), -(14431, 175, 1217, 'Portsmouth', 'Portsmouth', 600), -(14432, 175, 1217, 'Providence', 'Providence', 700), -(14433, 175, 1217, 'South Kingstown', 'South Kingstown', 800), -(14434, 175, 1217, 'Wakefield', 'Wakefield', 900), -(14435, 175, 1217, 'Warwick', 'Warwick', 1000), -(14436, 175, 1217, 'West Warwick', 'West Warwick', 1100), -(14437, 175, 1217, 'Westerly', 'Westerly', 1200), -(14438, 175, 1218, 'Cameron', 'Cameron', 100), -(14439, 175, 1218, 'Central', 'Central', 200), -(14440, 175, 1218, 'Charleston', 'Charleston', 300), -(14441, 175, 1218, 'Columbia', 'Columbia', 400), -(14442, 175, 1218, 'Florence', 'Florence', 500), -(14443, 175, 1218, 'Greenville', 'Greenville', 600), -(14444, 175, 1218, 'Grover', 'Grover', 700), -(14445, 175, 1218, 'Hilton Head Island', 'Hilton Head Island', 800), -(14446, 175, 1218, 'Lexington', 'Lexington', 900), -(14447, 175, 1218, 'Little River', 'Little River', 1000), -(14448, 175, 1218, 'Lyman', 'Lyman', 1100), -(14449, 175, 1218, 'Mount Pleasant', 'Mount Pleasant', 1200), -(14450, 175, 1218, 'Myrtle Beach', 'Myrtle Beach', 1300), -(14451, 175, 1218, 'North Myrtle Beach', 'North Myrtle Beach', 1400), -(14452, 175, 1218, 'Orangeburg', 'Orangeburg', 1500), -(14453, 175, 1218, 'Rock Hill', 'Rock Hill', 1600), -(14454, 175, 1218, 'Society Hill', 'Society Hill', 1700), -(14455, 175, 1218, 'Spartanburg', 'Spartanburg', 1800), -(14456, 175, 1219, 'Pierre', 'Pierre', 100), -(14457, 175, 1219, 'Rapid City', 'Rapid City', 200), -(14458, 175, 1219, 'Sioux Falls', 'Sioux Falls', 300), -(14459, 175, 1219, 'Watertown', 'Watertown', 400), -(14460, 175, 1220, 'Arlington', 'Arlington', 100), -(14461, 175, 1220, 'Chattanooga', 'Chattanooga', 200), -(14462, 175, 1220, 'Cleveland', 'Cleveland', 300), -(14463, 175, 1220, 'Cordova', 'Cordova', 400), -(14464, 175, 1220, 'Franklin', 'Franklin', 500), -(14465, 175, 1220, 'Gatlinburg', 'Gatlinburg', 600), -(14466, 175, 1220, 'Hixson', 'Hixson', 700), -(14467, 175, 1220, 'Jackson', 'Jackson', 800), -(14468, 175, 1220, 'Johnson City', 'Johnson City', 900), -(14469, 175, 1220, 'Kingsport', 'Kingsport', 1000), -(14470, 175, 1220, 'Knoxville', 'Knoxville', 1100), -(14471, 175, 1220, 'Memphis', 'Memphis', 1200), -(14472, 175, 1220, 'Murfreesboro', 'Murfreesboro', 1300), -(14473, 175, 1220, 'Nashville', 'Nashville', 1400), -(14474, 175, 1220, 'Pigeon Forge', 'Pigeon Forge', 1500), -(14475, 175, 1220, 'Sevierville', 'Sevierville', 1600), -(14476, 175, 1221, 'Abilene', 'Abilene', 100), -(14477, 175, 1221, 'Ace', 'Ace', 200), -(14478, 175, 1221, 'Afton', 'Afton', 300), -(14479, 175, 1221, 'Aiken', 'Aiken', 400), -(14480, 175, 1221, 'Allen', 'Allen', 500), -(14481, 175, 1221, 'Alleyton', 'Alleyton', 600), -(14482, 175, 1221, 'Altair', 'Altair', 700), -(14483, 175, 1221, 'Amarillo', 'Amarillo', 800), -(14484, 175, 1221, 'Arlington', 'Arlington', 900), -(14485, 175, 1221, 'Austin', 'Austin', 1000), -(14486, 175, 1221, 'Axtell', 'Axtell', 1100), -(14487, 175, 1221, 'Balmorhea', 'Balmorhea', 1200), -(14488, 175, 1221, 'Beaumont', 'Beaumont', 1300), -(14489, 175, 1221, 'Bellaire', 'Bellaire', 1400), -(14490, 175, 1221, 'Big Spring', 'Big Spring', 1500), -(14491, 175, 1221, 'Borger', 'Borger', 1600), -(14492, 175, 1221, 'Brenham', 'Brenham', 1700), -(14493, 175, 1221, 'Buffalo', 'Buffalo', 1800), -(14494, 175, 1221, 'Burleson', 'Burleson', 1900), -(14495, 175, 1221, 'College Station', 'College Station', 2000), -(14496, 175, 1221, 'Conroe', 'Conroe', 2100), -(14497, 175, 1221, 'Copperas Cove', 'Copperas Cove', 2200), -(14498, 175, 1221, 'Corpus Christi', 'Corpus Christi', 2300), -(14499, 175, 1221, 'Dallas', 'Dallas', 2400), -(14500, 175, 1221, 'Denton', 'Denton', 2500), -(14501, 175, 1221, 'El Paso', 'El Paso', 2600), -(14502, 175, 1221, 'Euless', 'Euless', 2700), -(14503, 175, 1221, 'Fort Worth', 'Fort Worth', 2800), -(14504, 175, 1221, 'Frisco', 'Frisco', 2900), -(14505, 175, 1221, 'Fritch', 'Fritch', 3000), -(14506, 175, 1221, 'Galveston', 'Galveston', 3100), -(14507, 175, 1221, 'Grand Prairie', 'Grand Prairie', 3200), -(14508, 175, 1221, 'Grapevine', 'Grapevine', 3300), -(14509, 175, 1221, 'Harlingen', 'Harlingen', 3400), -(14510, 175, 1221, 'Houston', 'Houston', 3500), -(14511, 175, 1221, 'Irving', 'Irving', 3600), -(14512, 175, 1221, 'Killeen', 'Killeen', 3700), -(14513, 175, 1221, 'La Blanca', 'La Blanca', 3800), -(14514, 175, 1221, 'Lufkin', 'Lufkin', 3900), -(14515, 175, 1221, 'Marshall', 'Marshall', 4000), -(14516, 175, 1221, 'McAllen', 'McAllen', 4100), -(14517, 175, 1221, 'McKinney', 'McKinney', 4200), -(14518, 175, 1221, 'Memphis', 'Memphis', 4300), -(14519, 175, 1221, 'Miami', 'Miami', 4400), -(14520, 175, 1221, 'Midland', 'Midland', 4500), -(14521, 175, 1221, 'Odessa', 'Odessa', 4600), -(14522, 175, 1221, 'Plainview', 'Plainview', 4700), -(14523, 175, 1221, 'Plano', 'Plano', 4800), -(14524, 175, 1221, 'Red Rock', 'Red Rock', 4900), -(14525, 175, 1221, 'Richmond', 'Richmond', 5000), -(14526, 175, 1221, 'San Angelo', 'San Angelo', 5100), -(14527, 175, 1221, 'San Antonio', 'San Antonio', 5200), -(14528, 175, 1221, 'Spring', 'Spring', 5300), -(14529, 175, 1221, 'Sugar Land', 'Sugar Land', 5400), -(14530, 175, 1221, 'Terrell', 'Terrell', 5500), -(14531, 175, 1221, 'Texarkana', 'Texarkana', 5600), -(14532, 175, 1221, 'Texas City', 'Texas City', 5700), -(14533, 175, 1221, 'Tyler', 'Tyler', 5800), -(14534, 175, 1221, 'Waco', 'Waco', 5900), -(14535, 175, 1222, 'Alpine', 'Alpine', 100), -(14536, 175, 1222, 'Bryce Canyon', 'Bryce Canyon', 200), -(14537, 175, 1222, 'Draper', 'Draper', 300), -(14538, 175, 1222, 'Grantsville', 'Grantsville', 400), -(14539, 175, 1222, 'Kaysville', 'Kaysville', 500), -(14540, 175, 1222, 'La Sal', 'La Sal', 600), -(14541, 175, 1222, 'Midvale', 'Midvale', 700), -(14542, 175, 1222, 'Ogden', 'Ogden', 800), -(14543, 175, 1222, 'Park City', 'Park City', 900), -(14544, 175, 1222, 'Provo', 'Provo', 1000), -(14545, 175, 1222, 'Saint George', 'Saint George', 1100), -(14546, 175, 1222, 'Salt Lake City', 'Salt Lake City', 1200), -(14547, 175, 1222, 'Sandy', 'Sandy', 1300), -(14548, 175, 1222, 'West Jordan', 'West Jordan', 1400), -(14549, 175, 1223, 'Alburg', 'Alburg', 100), -(14550, 175, 1223, 'Bristol', 'Bristol', 200), -(14551, 175, 1223, 'Burlington', 'Burlington', 300), -(14552, 175, 1223, 'Moscow', 'Moscow', 400), -(14553, 175, 1223, 'North Pownal', 'North Pownal', 500), -(14554, 175, 1223, 'White River Junction', 'White River Junction', 600), -(14555, 175, 1224, 'Christiansted', 'Christiansted', 100), -(14556, 175, 1224, 'Kingshill', 'Kingshill', 200), -(14557, 175, 1224, 'St Thomas', 'St Thomas', 300), -(14558, 175, 1225, 'Alberta', 'Alberta', 100), -(14559, 175, 1225, 'Alexandria', 'Alexandria', 200), -(14560, 175, 1225, 'Annandale', 'Annandale', 300), -(14561, 175, 1225, 'Arlington', 'Arlington', 400), -(14562, 175, 1225, 'Ashburn', 'Ashburn', 500), -(14563, 175, 1225, 'Atlantic', 'Atlantic', 600), -(14564, 175, 1225, 'Blacksburg', 'Blacksburg', 700), -(14565, 175, 1225, 'Boston', 'Boston', 800), -(14566, 175, 1225, 'Carrollton', 'Carrollton', 900), -(14567, 175, 1225, 'Centreville', 'Centreville', 1000), -(14568, 175, 1225, 'Chantilly', 'Chantilly', 1100), -(14569, 175, 1225, 'Charlottesville', 'Charlottesville', 1200), -(14570, 175, 1225, 'Chesapeake', 'Chesapeake', 1300), -(14571, 175, 1225, 'Chester', 'Chester', 1400), -(14572, 175, 1225, 'Clifton', 'Clifton', 1500), -(14573, 175, 1225, 'Colonial Heights', 'Colonial Heights', 1600), -(14574, 175, 1225, 'Danville', 'Danville', 1700), -(14575, 175, 1225, 'Emporia', 'Emporia', 1800), -(14576, 175, 1225, 'Fairfax', 'Fairfax', 1900), -(14577, 175, 1225, 'Falls Church', 'Falls Church', 2000), -(14578, 175, 1225, 'Forest', 'Forest', 2100), -(14579, 175, 1225, 'Foster', 'Foster', 2200), -(14580, 175, 1225, 'Glen Allen', 'Glen Allen', 2300), -(14581, 175, 1225, 'Hampton', 'Hampton', 2400), -(14582, 175, 1225, 'Harrisonburg', 'Harrisonburg', 2500), -(14583, 175, 1225, 'Herndon', 'Herndon', 2600), -(14584, 175, 1225, 'Leesburg', 'Leesburg', 2700), -(14585, 175, 1225, 'Lynchburg', 'Lynchburg', 2800), -(14586, 175, 1225, 'Manassas', 'Manassas', 2900), -(14587, 175, 1225, 'Martinsville', 'Martinsville', 3000), -(14588, 175, 1225, 'McLean', 'McLean', 3100), -(14589, 175, 1225, 'Newport News', 'Newport News', 3200), -(14590, 175, 1225, 'Norfolk', 'Norfolk', 3300), -(14591, 175, 1225, 'Pittsville', 'Pittsville', 3400), -(14592, 175, 1225, 'Portsmouth', 'Portsmouth', 3500), -(14593, 175, 1225, 'Pulaski', 'Pulaski', 3600), -(14594, 175, 1225, 'Quantico', 'Quantico', 3700), -(14595, 175, 1225, 'Reston', 'Reston', 3800), -(14596, 175, 1225, 'Richmond', 'Richmond', 3900), -(14597, 175, 1225, 'Roanoke', 'Roanoke', 4000), -(14598, 175, 1225, 'Shawsville', 'Shawsville', 4100), -(14599, 175, 1225, 'Spotsylvania', 'Spotsylvania', 4200), -(14600, 175, 1225, 'Triangle', 'Triangle', 4300), -(14601, 175, 1225, 'Vienna', 'Vienna', 4400), -(14602, 175, 1225, 'Virgilina', 'Virgilina', 4500), -(14603, 175, 1225, 'Virginia Beach', 'Virginia Beach', 4600), -(14604, 175, 1225, 'Washington', 'Washington', 4700), -(14605, 175, 1225, 'Wicomico', 'Wicomico', 4800), -(14606, 175, 1225, 'Williamsburg', 'Williamsburg', 4900), -(14607, 175, 1225, 'Winchester', 'Winchester', 5000), -(14608, 175, 1225, 'Woodbridge', 'Woodbridge', 5100), -(14609, 175, 1225, 'Zuni', 'Zuni', 5200), -(14610, 175, 1226, 'Aberdeen', 'Aberdeen', 100), -(14611, 175, 1226, 'Almira', 'Almira', 200), -(14612, 175, 1226, 'Amanda Park', 'Amanda Park', 300), -(14613, 175, 1226, 'Arlington', 'Arlington', 400), -(14614, 175, 1226, 'Asotin', 'Asotin', 500), -(14615, 175, 1226, 'Auburn', 'Auburn', 600), -(14616, 175, 1226, 'Bainbridge Island', 'Bainbridge Island', 700), -(14617, 175, 1226, 'Battle Ground', 'Battle Ground', 800), -(14618, 175, 1226, 'Bellevue', 'Bellevue', 900), -(14619, 175, 1226, 'Bellingham', 'Bellingham', 1000), -(14620, 175, 1226, 'Blaine', 'Blaine', 1100), -(14621, 175, 1226, 'Bothell', 'Bothell', 1200), -(14622, 175, 1226, 'Bremerton', 'Bremerton', 1300), -(14623, 175, 1226, 'Brush Prairie', 'Brush Prairie', 1400), -(14624, 175, 1226, 'Coulee Dam', 'Coulee Dam', 1500), -(14625, 175, 1226, 'Creston', 'Creston', 1600), -(14626, 175, 1226, 'Darrington', 'Darrington', 1700), -(14627, 175, 1226, 'Dayton', 'Dayton', 1800), -(14628, 175, 1226, 'Deer Park', 'Deer Park', 1900), -(14629, 175, 1226, 'Edmonds', 'Edmonds', 2000), -(14630, 175, 1226, 'Everett', 'Everett', 2100), -(14631, 175, 1226, 'Federal Way', 'Federal Way', 2200), -(14632, 175, 1226, 'Ferndale', 'Ferndale', 2300), -(14633, 175, 1226, 'Ford', 'Ford', 2400), -(14634, 175, 1226, 'Forks', 'Forks', 2500), -(14635, 175, 1226, 'Fox Island', 'Fox Island', 2600), -(14636, 175, 1226, 'Friday Harbor', 'Friday Harbor', 2700), -(14637, 175, 1226, 'Gold Bar', 'Gold Bar', 2800), -(14638, 175, 1226, 'Harrington', 'Harrington', 2900), -(14639, 175, 1226, 'Humptulips', 'Humptulips', 3000), -(14640, 175, 1226, 'Issaquah', 'Issaquah', 3100), -(14641, 175, 1226, 'Kennewick', 'Kennewick', 3200), -(14642, 175, 1226, 'Kent', 'Kent', 3300), -(14643, 175, 1226, 'Kettle Falls', 'Kettle Falls', 3400), -(14644, 175, 1226, 'Kirkland', 'Kirkland', 3500), -(14645, 175, 1226, 'Lacey', 'Lacey', 3600), -(14646, 175, 1226, 'Lake Stevens', 'Lake Stevens', 3700), -(14647, 175, 1226, 'Longview', 'Longview', 3800), -(14648, 175, 1226, 'Lynnwood', 'Lynnwood', 3900), -(14649, 175, 1226, 'Marysville', 'Marysville', 4000), -(14650, 175, 1226, 'Medical Lake', 'Medical Lake', 4100), -(14651, 175, 1226, 'Mossyrock', 'Mossyrock', 4200), -(14652, 175, 1226, 'Ocean Park', 'Ocean Park', 4300), -(14653, 175, 1226, 'Odessa', 'Odessa', 4400), -(14654, 175, 1226, 'Olympia', 'Olympia', 4500), -(14655, 175, 1226, 'Pullman', 'Pullman', 4600), -(14656, 175, 1226, 'Redmond', 'Redmond', 4700), -(14657, 175, 1226, 'Renton', 'Renton', 4800), -(14658, 175, 1226, 'Richland', 'Richland', 4900), -(14659, 175, 1226, 'Roslyn', 'Roslyn', 5000), -(14660, 175, 1226, 'Seattle', 'Seattle', 5100), -(14661, 175, 1226, 'Spokane', 'Spokane', 5200), -(14662, 175, 1226, 'Tacoma', 'Tacoma', 5300), -(14663, 175, 1226, 'University Place', 'University Place', 5400), -(14664, 175, 1226, 'Vancouver', 'Vancouver', 5500), -(14665, 175, 1226, 'Waldron', 'Waldron', 5600), -(14666, 175, 1226, 'Waterville', 'Waterville', 5700), -(14667, 175, 1226, 'Westport', 'Westport', 5800), -(14668, 175, 1226, 'Woodinville', 'Woodinville', 5900), -(14669, 175, 1226, 'Woodland', 'Woodland', 6000), -(14670, 175, 1226, 'Yakima', 'Yakima', 6100), -(14671, 175, 1227, 'Blair', 'Blair', 100), -(14672, 175, 1227, 'Charleston', 'Charleston', 200), -(14673, 175, 1227, 'Fairmont', 'Fairmont', 300), -(14674, 175, 1227, 'Keyser', 'Keyser', 400), -(14675, 175, 1227, 'Tornado', 'Tornado', 500), -(14676, 175, 1227, 'Washington', 'Washington', 600), -(14677, 175, 1228, 'Algoma', 'Algoma', 100), -(14678, 175, 1228, 'Argyle', 'Argyle', 200), -(14679, 175, 1228, 'Brookfield', 'Brookfield', 300), -(14680, 175, 1228, 'Cedarburg', 'Cedarburg', 400), -(14681, 175, 1228, 'Clinton', 'Clinton', 500), -(14682, 175, 1228, 'Cudahy', 'Cudahy', 600), -(14683, 175, 1228, 'Dane', 'Dane', 700), -(14684, 175, 1228, 'De Forest', 'De Forest', 800), -(14685, 175, 1228, 'Eagle River', 'Eagle River', 900), -(14686, 175, 1228, 'Eau Claire', 'Eau Claire', 1000), -(14687, 175, 1228, 'Fond Du Lac', 'Fond Du Lac', 1100), -(14688, 175, 1228, 'Grafton', 'Grafton', 1200), -(14689, 175, 1228, 'Green Bay', 'Green Bay', 1300), -(14690, 175, 1228, 'Hudson', 'Hudson', 1400), -(14691, 175, 1228, 'Janesville', 'Janesville', 1500), -(14692, 175, 1228, 'Jefferson', 'Jefferson', 1600), -(14693, 175, 1228, 'Kenosha', 'Kenosha', 1700), -(14694, 175, 1228, 'La Crosse', 'La Crosse', 1800), -(14695, 175, 1228, 'Loyal', 'Loyal', 1900), -(14696, 175, 1228, 'Madison', 'Madison', 2000), -(14697, 175, 1228, 'Menomonee Falls', 'Menomonee Falls', 2100), -(14698, 175, 1228, 'Mequon', 'Mequon', 2200), -(14699, 175, 1228, 'Milwaukee', 'Milwaukee', 2300), -(14700, 175, 1228, 'New Berlin', 'New Berlin', 2400), -(14701, 175, 1228, 'Oshkosh', 'Oshkosh', 2500), -(14702, 175, 1228, 'Packwaukee', 'Packwaukee', 2600), -(14703, 175, 1228, 'Port Washington', 'Port Washington', 2700), -(14704, 175, 1228, 'Portage', 'Portage', 2800), -(14705, 175, 1228, 'Prairie Du Sac', 'Prairie Du Sac', 2900), -(14706, 175, 1228, 'Reedsburg', 'Reedsburg', 3000), -(14707, 175, 1228, 'Rochester', 'Rochester', 3100), -(14708, 175, 1228, 'Sheboygan', 'Sheboygan', 3200), -(14709, 175, 1228, 'Sister Bay', 'Sister Bay', 3300), -(14710, 175, 1228, 'Sun Prairie', 'Sun Prairie', 3400), -(14711, 175, 1228, 'Thiensville', 'Thiensville', 3500), -(14712, 175, 1228, 'Waukesha', 'Waukesha', 3600), -(14713, 175, 1228, 'Wausau', 'Wausau', 3700), -(14714, 175, 1228, 'West Bend', 'West Bend', 3800), -(14715, 175, 1228, 'Wisconsin Dells', 'Wisconsin Dells', 3900), -(14716, 175, 1229, 'Aladdin', 'Aladdin', 100), -(14717, 175, 1229, 'Banner', 'Banner', 200), -(14718, 175, 1229, 'Casper', 'Casper', 300), -(14719, 175, 1229, 'Cheyenne', 'Cheyenne', 400), -(14720, 175, 1229, 'Cody', 'Cody', 500), -(14721, 175, 1229, 'Cowley', 'Cowley', 600), -(14722, 175, 1229, 'Jackson', 'Jackson', 700), -(14723, 175, 1229, 'Laramie', 'Laramie', 800), -(14724, 175, 1229, 'Teton Village', 'Teton Village', 900), -(14725, 175, 1229, 'Yoder', 'Yoder', 1000), -(14726, 176, 1230, 'Фритаун', 'Freetown', 100), -(14727, 177, 1231, 'Ванч', 'Ванч', 100), -(14728, 177, 1231, 'Вранг', 'Вранг', 200), -(14729, 177, 1231, 'Ишкашим', 'Ишкашим', 300), -(14730, 177, 1231, 'Кудара', 'Кудара', 400), -(14731, 177, 1231, 'Мургаб', 'Мургаб', 500), -(14732, 177, 1231, 'Рушан', 'Рушан', 600), -(14733, 177, 1231, 'Токтомуш', 'Токтомуш', 700), -(14734, 177, 1231, 'Хорог', 'Хорог', 800), -(14735, 177, 1232, 'Дангара', 'Дангара', 100), -(14736, 177, 1232, 'Куляб', 'Куляб', 200), -(14737, 177, 1232, 'Лениградский', 'Лениградский', 300), -(14738, 177, 1232, 'Пархар', 'Пархар', 400), -(14739, 177, 1232, 'Советский', 'Советский', 500), -(14740, 177, 1232, 'Ховалинг', 'Ховалинг', 600), -(14741, 177, 1233, 'Калининабад', 'Калининабад', 100), -(14742, 177, 1233, 'Колхозабад', 'Колхозабад', 200), -(14743, 177, 1233, 'Куйбышевский', 'Куйбышевский', 300), -(14744, 177, 1233, 'Курган-Тюбе', 'Курган-Тюбе', 400), -(14745, 177, 1233, 'Нижний Пяндж', 'Нижний Пяндж', 500), -(14746, 177, 1233, 'Пяндж', 'Пяндж', 600), -(14747, 177, 1233, 'Шаартуз', 'Шаартуз', 700), -(14748, 177, 1233, 'Яван', 'Яван', 800), -(14749, 177, 1234, 'Адрасман', 'Адрасман', 100), -(14750, 177, 1234, 'Айни', 'Айни', 200), -(14751, 177, 1234, 'Ашт', 'Ашт', 300), -(14752, 177, 1234, 'Бустон', 'Бустон', 400), -(14753, 177, 1234, 'Ганчи', 'Ганчи', 500), -(14754, 177, 1234, 'Гафуров', 'Гафуров', 600), -(14755, 177, 1234, 'Зафарабад', 'Зафарабад', 700), -(14756, 177, 1234, 'Зеравшан', 'Зеравшан', 800), -(14757, 177, 1234, 'Истаравшан (Ура-Тюбе)', 'Истаравшан (Ура-Тюбе)', 900), -(14758, 177, 1234, 'Исфара', 'Исфара', 1000), -(14759, 177, 1234, 'Кайракуум', 'Кайракуум', 1100), -(14760, 177, 1234, 'Канибадам', 'Канибадам', 1200), -(14761, 177, 1234, 'Кансай', 'Кансай', 1300), -(14762, 177, 1234, 'Нау', 'Нау', 1400), -(14763, 177, 1234, 'Пенджикент', 'Пенджикент', 1500), -(14764, 177, 1234, 'Пролетарск', 'Пролетарск', 1600), -(14765, 177, 1234, 'Табошар', 'Табошар', 1700), -(14766, 177, 1234, 'Худжанд', 'Худжанд', 1800), -(14767, 177, 1234, 'Чкаловск', 'Чкаловск', 1900), -(14768, 177, 1234, 'Шураб', 'Шураб', 2000), -(14769, 177, 1235, 'Варзоб', 'Варзоб', 100), -(14770, 177, 1235, 'Вахш', 'Вахш', 200), -(14771, 177, 1235, 'Гарм', 'Гарм', 300), -(14772, 177, 1235, 'Гиссар', 'Гиссар', 400), -(14773, 177, 1235, 'Джиргаталь', 'Джиргаталь', 500), -(14774, 177, 1235, 'Дусти', 'Дусти', 600), -(14775, 177, 1235, 'Душанбе', 'Душанбе', 700), -(14776, 177, 1235, 'Кофарнихон', 'Кофарнихон', 800), -(14777, 177, 1235, 'Куйбышевск', 'Куйбышевск', 900), -(14778, 177, 1235, 'Ленинский', 'Ленинский', 1000), -(14779, 177, 1235, 'Московский', 'Московский', 1100), -(14780, 177, 1235, 'Насруд', 'Насруд', 1200), -(14781, 177, 1235, 'Нурек', 'Нурек', 1300), -(14782, 177, 1235, 'Орджоникидзеабад', 'Орджоникидзеабад', 1400), -(14783, 177, 1235, 'Турсунзаде', 'Турсунзаде', 1500), -(14784, 177, 1235, 'Файзабад', 'Файзабад', 1600), -(14785, 178, 1236, 'Самуи', 'Самуи', 100), -(14786, 178, 1237, 'Бангкок', 'Bangcock', 100), -(14787, 178, 1238, 'Паттая', 'Паттая', 100), -(14788, 179, 1239, 'Тайбэй', 'Taipei', 100), -(14789, 180, 1240, 'Дар-эс-Салам', 'Dar-es-Salam', 100), -(14790, 180, 1240, 'Додома', 'Dodoma', 200), -(14791, 180, 1240, 'Занзибар', 'Zanzibar', 300), -(14792, 180, 1240, 'Мванза', 'Mvanza', 400), -(14793, 181, 1241, 'Ломе', 'Lome', 100), -(14794, 182, 1242, 'Факаофо', 'Fakaofo', 100), -(14795, 183, 1243, 'Нукуалофа', 'Nukualofa', 100), -(14796, 184, 1244, 'Порт-оф-Спейн', 'Port of Spain', 100), -(14797, 185, 1245, 'Фунафути', 'Funafuti', 100), -(14798, 186, 1246, 'Nabeul', 'Nabeul', 100), -(14799, 187, 1247, 'Ашхабад', 'Ашхабад', 100), -(14800, 187, 1247, 'Бахарден', 'Бахарден', 200), -(14801, 187, 1247, 'Безмеин', 'Безмеин', 300), -(14802, 187, 1247, 'Геок-Тепе', 'Геок-Тепе', 400), -(14803, 187, 1247, 'Дарваза', 'Дарваза', 500), -(14804, 187, 1247, 'Каахка', 'Каахка', 600), -(14805, 187, 1247, 'Кировск', 'Кировск', 700), -(14806, 187, 1247, 'Серахс', 'Серахс', 800), -(14807, 187, 1247, 'Теджен', 'Теджен', 900), -(14808, 187, 1248, 'Бекдаш', 'Бекдаш', 100), -(14809, 187, 1248, 'Гасан-Кули', 'Гасан-Кули', 200), -(14810, 187, 1248, 'Джанга', 'Джанга', 300), -(14811, 187, 1248, 'Казанджик', 'Казанджик', 400), -(14812, 187, 1248, 'Карагель', 'Карагель', 500), -(14813, 187, 1248, 'Кизыл-Арват', 'Кизыл-Арват', 600), -(14814, 187, 1248, 'Красноводск', 'Красноводск', 700), -(14815, 187, 1248, 'Небит-Даг', 'Небит-Даг', 800), -(14816, 187, 1248, 'Челекен', 'Челекен', 900), -(14817, 187, 1249, 'Байрам-Али', 'Байрам-Али', 100), -(14818, 187, 1249, 'Иолотань', 'Иолотань', 200), -(14819, 187, 1249, 'Мары', 'Мары', 300), -(14820, 187, 1249, 'Сакар-Чага', 'Сакар-Чага', 400), -(14821, 187, 1249, 'Тахта-Базар', 'Тахта-Базар', 500), -(14822, 187, 1249, 'Туркмен-Кала', 'Туркмен-Кала', 600), -(14823, 187, 1250, 'Куня-Ургенч', 'Куня-Ургенч', 100), -(14824, 187, 1250, 'Ташауз', 'Ташауз', 200), -(14825, 187, 1251, 'Аму-Дарья', 'Аму-Дарья', 100), -(14826, 187, 1251, 'Газ-Ачак', 'Газ-Ачак', 200), -(14827, 187, 1251, 'Гаурдак', 'Гаурдак', 300), -(14828, 187, 1251, 'Дейнау', 'Дейнау', 400), -(14829, 187, 1251, 'Карабекаул', 'Карабекаул', 500), -(14830, 187, 1251, 'Керки', 'Керки', 600), -(14831, 187, 1251, 'Мукры', 'Мукры', 700), -(14832, 187, 1251, 'Нефтезаводск', 'Нефтезаводск', 800), -(14833, 187, 1251, 'Сакар', 'Сакар', 900), -(14834, 187, 1251, 'Саят', 'Саят', 1000), -(14835, 187, 1251, 'Фараб', 'Фараб', 1100), -(14836, 187, 1251, 'Халач', 'Халач', 1200), -(14837, 187, 1251, 'Чарджоу', 'Чарджоу', 1300), -(14838, 187, 1251, 'Чаршанга', 'Чаршанга', 1400), -(14839, 188, 1252, 'Кев', 'Kev', 100), -(14840, 188, 1252, 'Теркс-Айлендс', 'Turk Islands', 200), -(14841, 189, 1253, 'Бартын', 'Bartin', 100), -(14842, 189, 1254, 'Байбурт', 'Bayburt', 100), -(14843, 189, 1255, 'Карабук', 'Karabuk', 100), -(14844, 189, 1256, 'Адана', 'Adana', 100), -(14845, 189, 1257, 'Айдын', 'Aydin', 100), -(14846, 189, 1258, 'Амасья', 'Amasya', 100), -(14847, 189, 1259, 'Анкара', 'Ankara', 100), -(14848, 189, 1260, 'Анталия', 'Antalya', 100), -(14849, 189, 1261, 'Артвин', 'Artvin', 100), -(14850, 189, 1262, 'Афьон', 'Afion', 100), -(14851, 189, 1263, 'Балыкесир', 'Balikesir', 100), -(14852, 189, 1264, 'Биледжик', 'Bilecik', 100), -(14853, 189, 1265, 'Бурса', 'Bursa', 100), -(14854, 189, 1266, 'Газиантеп', 'Gaziantep', 100), -(14855, 189, 1267, 'Денизли', 'Denizli', 100), -(14856, 189, 1268, 'Измир', 'Izmir', 100), -(14857, 189, 1269, 'Испарта', 'Isparta', 100), -(14858, 189, 1270, 'Мерсин', 'Mersin', 100), -(14859, 189, 1271, 'Кэйсери', 'Kayseri', 100), -(14860, 189, 1272, 'Карс', 'Kars', 100), -(14861, 189, 1273, 'Измит', 'Izmit', 100), -(14862, 189, 1273, 'Кокели', 'Kokeli', 200), -(14863, 189, 1274, 'Кониа', 'Konya', 100), -(14864, 189, 1275, 'Кириккал', 'Kirklareli', 100), -(14865, 189, 1276, 'Кутахиа', 'Kutahya', 100), -(14866, 189, 1277, 'Малатиа', 'Malatya', 100), -(14867, 189, 1278, 'Маниса', 'Manisa', 100), -(14868, 189, 1279, 'Адапазари', 'Adapazari', 100), -(14869, 189, 1280, 'Самсун', 'Samsun', 100), -(14870, 189, 1281, 'Сивас', 'Sivas', 100), -(14871, 189, 1282, 'Стамбул', 'Istanbul', 100), -(14872, 189, 1283, 'Корум', 'Corum', 100), -(14873, 189, 1284, 'Эдирн', 'Edirne', 100), -(14874, 189, 1285, 'Элазиг', 'Elazig', 100), -(14875, 189, 1286, 'Эрзинкан', 'Erzincan', 100), -(14876, 189, 1287, 'Эрзурум', 'Erzurum', 100), -(14877, 189, 1288, 'Ескисехир', 'Eskisehir', 100), -(14878, 190, 1289, 'Йиня', 'Jinja', 100), -(14879, 190, 1290, 'Кампала', 'Kampala', 100), -(14880, 191, 1291, 'Алтынкуль', 'Алтынкуль', 100), -(14881, 191, 1291, 'Андижан', 'Андижан', 200), -(14882, 191, 1291, 'Балыкчи', 'Балыкчи', 300), -(14883, 191, 1291, 'Ленинск', 'Ленинск', 400), -(14884, 191, 1291, 'Мархамат', 'Мархамат', 500), -(14885, 191, 1291, 'Советабад', 'Советабад', 600), -(14886, 191, 1291, 'Шахрихан', 'Шахрихан', 700), -(14887, 191, 1292, 'Алат', 'Алат', 100), -(14888, 191, 1292, 'Бухара', 'Бухара', 200), -(14889, 191, 1292, 'Вабкент', 'Вабкент', 300), -(14890, 191, 1292, 'Газли', 'Газли', 400), -(14891, 191, 1292, 'Галаасия', 'Галаасия', 500), -(14892, 191, 1292, 'Гиждуван', 'Гиждуван', 600), -(14893, 191, 1292, 'Каган', 'Каган', 700), -(14894, 191, 1292, 'Каракуль', 'Каракуль', 800), -(14895, 191, 1292, 'Ромитан', 'Ромитан', 900), -(14896, 191, 1293, 'Галляарал', 'Галляарал', 100), -(14897, 191, 1293, 'Джизак', 'Джизак', 200), -(14898, 191, 1293, 'Заамин', 'Заамин', 300), -(14899, 191, 1293, 'Усмат', 'Усмат', 400), -(14900, 191, 1293, 'Янгикишлак', 'Янгикишлак', 500), -(14901, 191, 1294, 'Кегейли', 'Кегейли', 100), -(14902, 191, 1294, 'Кунград', 'Кунград', 200), -(14903, 191, 1294, 'Мангит', 'Мангит', 300), -(14904, 191, 1294, 'Муйнак', 'Муйнак', 400), -(14905, 191, 1294, 'Нукус', 'Нукус', 500), -(14906, 191, 1294, 'Тахиаташ', 'Тахиаташ', 600), -(14907, 191, 1294, 'Тахтакупыр', 'Тахтакупыр', 700), -(14908, 191, 1294, 'Турткуль', 'Турткуль', 800), -(14909, 191, 1294, 'Ходжейли', 'Ходжейли', 900), -(14910, 191, 1294, 'Чимбай', 'Чимбай', 1000), -(14911, 191, 1294, 'Шуманай', 'Шуманай', 1100), -(14912, 191, 1295, 'Бешкент', 'Бешкент', 100), -(14913, 191, 1295, 'Гузар', 'Гузар', 200), -(14914, 191, 1295, 'Камаши', 'Камаши', 300); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(14915, 191, 1295, 'Карши', 'Карши', 400), -(14916, 191, 1295, 'Касан', 'Касан', 500), -(14917, 191, 1295, 'Китаб', 'Китаб', 600), -(14918, 191, 1295, 'Шахрисабз', 'Шахрисабз', 700), -(14919, 191, 1296, 'Зарафшан', 'Зарафшан', 100), -(14920, 191, 1296, 'Навои', 'Навои', 200), -(14921, 191, 1296, 'Тамдыбулак', 'Тамдыбулак', 300), -(14922, 191, 1296, 'Учкудук', 'Учкудук', 400), -(14923, 191, 1297, 'Касансай', 'Касансай', 100), -(14924, 191, 1297, 'Наманган', 'Наманган', 200), -(14925, 191, 1297, 'Пап', 'Пап', 300), -(14926, 191, 1297, 'Учкурган', 'Учкурган', 400), -(14927, 191, 1297, 'Чартак', 'Чартак', 500), -(14928, 191, 1297, 'Чуст', 'Чуст', 600), -(14929, 191, 1297, 'Янгикурган', 'Янгикурган', 700), -(14930, 191, 1298, 'Акташ', 'Акташ', 100), -(14931, 191, 1298, 'Зиадин', 'Зиадин', 200), -(14932, 191, 1298, 'Ингичка', 'Ингичка', 300), -(14933, 191, 1298, 'Каттакурган', 'Каттакурган', 400), -(14934, 191, 1298, 'Красногвардейск', 'Красногвардейск', 500), -(14935, 191, 1298, 'Самарканд', 'Самарканд', 600), -(14936, 191, 1298, 'Ургут', 'Ургут', 700), -(14937, 191, 1299, 'Байсун', 'Байсун', 100), -(14938, 191, 1299, 'Денау', 'Денау', 200), -(14939, 191, 1299, 'Карлук', 'Карлук', 300), -(14940, 191, 1299, 'Термез', 'Термез', 400), -(14941, 191, 1299, 'Узун', 'Узун', 500), -(14942, 191, 1299, 'Шерабад', 'Шерабад', 600), -(14943, 191, 1299, 'Шурчи', 'Шурчи', 700), -(14944, 191, 1300, 'Бахт', 'Бахт', 100), -(14945, 191, 1300, 'Гулистан', 'Гулистан', 200), -(14946, 191, 1300, 'Димитровское', 'Димитровское', 300), -(14947, 191, 1300, 'Крестьянский', 'Крестьянский', 400), -(14948, 191, 1300, 'Сырдарья', 'Сырдарья', 500), -(14949, 191, 1300, 'Сырьдарья', 'Сырьдарья', 600), -(14950, 191, 1300, 'Хаваст', 'Хаваст', 700), -(14951, 191, 1300, 'Ширин', 'Ширин', 800), -(14952, 191, 1300, 'Янгиер', 'Янгиер', 900), -(14953, 191, 1301, 'Алимкент', 'Алимкент', 100), -(14954, 191, 1301, 'Алмазар', 'Алмазар', 200), -(14955, 191, 1301, 'Алмалык', 'Алмалык', 300), -(14956, 191, 1301, 'Ангрен', 'Ангрен', 400), -(14957, 191, 1301, 'Ахангаран', 'Ахангаран', 500), -(14958, 191, 1301, 'Бакабад', 'Бакабад', 600), -(14959, 191, 1301, 'Бекабад', 'Бекабад', 700), -(14960, 191, 1301, 'Бука', 'Бука', 800), -(14961, 191, 1301, 'Газалкент', 'Газалкент', 900), -(14962, 191, 1301, 'Искандар', 'Искандар', 1000), -(14963, 191, 1301, 'Келес', 'Келес', 1100), -(14964, 191, 1301, 'Паркент', 'Паркент', 1200), -(14965, 191, 1301, 'Пскент', 'Пскент', 1300), -(14966, 191, 1301, 'Сиджак', 'Сиджак', 1400), -(14967, 191, 1301, 'Солдатский', 'Солдатский', 1500), -(14968, 191, 1301, 'Ташкент', 'Ташкент', 1600), -(14969, 191, 1301, 'Тойтепа', 'Тойтепа', 1700), -(14970, 191, 1301, 'Чиназ', 'Чиназ', 1800), -(14971, 191, 1301, 'Чирчик', 'Чирчик', 1900), -(14972, 191, 1301, 'Янгиабад', 'Янгиабад', 2000), -(14973, 191, 1301, 'Янгибазар', 'Янгибазар', 2100), -(14974, 191, 1301, 'Янгиюль', 'Янгиюль', 2200), -(14975, 191, 1302, 'Алтыарык', 'Алтыарык', 100), -(14976, 191, 1302, 'Бешарык', 'Бешарык', 200), -(14977, 191, 1302, 'Вуадиль', 'Вуадиль', 300), -(14978, 191, 1302, 'Дангара', 'Дангара', 400), -(14979, 191, 1302, 'Коканд', 'Коканд', 500), -(14980, 191, 1302, 'Кува', 'Кува', 600), -(14981, 191, 1302, 'Кувасай', 'Кувасай', 700), -(14982, 191, 1302, 'Маргилан', 'Маргилан', 800), -(14983, 191, 1302, 'Учкуприк', 'Учкуприк', 900), -(14984, 191, 1302, 'Фергана', 'Фергана', 1000), -(14985, 191, 1302, 'Яйпан', 'Яйпан', 1100), -(14986, 191, 1303, 'Ургенч', 'Ургенч', 100), -(14987, 191, 1303, 'Хива', 'Хива', 200), -(14988, 192, 1304, 'Бар', 'Bar', 100), -(14989, 192, 1304, 'Бершадь', 'Bershad', 200), -(14990, 192, 1304, 'Браилов', 'Brailov', 300), -(14991, 192, 1304, 'Брацлав', 'Bratslav', 400), -(14992, 192, 1304, 'Вапнярка', 'Vapnyarka', 500), -(14993, 192, 1304, 'Вендичаны', 'Vendichany', 600), -(14994, 192, 1304, 'Винница', 'Vinnitsa', 700), -(14995, 192, 1304, 'Вороновица', 'Voronovitsa', 800), -(14996, 192, 1304, 'Гайсин', 'Gaisin', 900), -(14997, 192, 1304, 'Гнивань', 'Gnivan', 1000), -(14998, 192, 1304, 'Дашев', 'Dashev', 1100), -(14999, 192, 1304, 'Жмеринка', 'Zhmerinka', 1200), -(15000, 192, 1304, 'Ильинцы', 'Ilintsy', 1300), -(15001, 192, 1304, 'Казатин', 'Kazatin', 1400), -(15002, 192, 1304, 'Калиновка', 'Kalinovka', 1500), -(15003, 192, 1304, 'Крыжополь', 'Kryzhopol', 1600), -(15004, 192, 1304, 'Ладыжин', 'Ладыжин', 1700), -(15005, 192, 1304, 'Липовец', 'Lipovets', 1800), -(15006, 192, 1304, 'Литин', 'Litin', 1900), -(15007, 192, 1304, 'Могилев-Подольский', 'Mogilev-Podolskii', 2000), -(15008, 192, 1304, 'Мурованные Куриловцы', 'Murovannye Kurilovtsy', 2100), -(15009, 192, 1304, 'Немиров', 'Nemirov', 2200), -(15010, 192, 1304, 'Оратов', 'Oratov', 2300), -(15011, 192, 1304, 'Песчанка', 'Peschanka', 2400), -(15012, 192, 1304, 'Погребище', 'Pogrebishche', 2500), -(15013, 192, 1304, 'Теплик', 'Teplik', 2600), -(15014, 192, 1304, 'Томашполь', 'Tomashpol', 2700), -(15015, 192, 1304, 'Тростянец', 'Trostyanets', 2800), -(15016, 192, 1304, 'Тульчин', 'Tulchin', 2900), -(15017, 192, 1304, 'Тывров', 'Tyvrov', 3000), -(15018, 192, 1304, 'Хмельник', 'Hmelnik', 3100), -(15019, 192, 1304, 'Чечельник', 'Chechelnik', 3200), -(15020, 192, 1304, 'Шаргород', 'Shargorod', 3300), -(15021, 192, 1304, 'Ямполь', 'Yampol', 3400), -(15022, 192, 1305, 'Берестечко', 'Berestechko', 100), -(15023, 192, 1305, 'Владимир-Волынский', 'Vladimir-Volynskii', 200), -(15024, 192, 1305, 'Голобы', 'Goloby', 300), -(15025, 192, 1305, 'Головно', 'Golovno', 400), -(15026, 192, 1305, 'Горохов', 'Gorohov', 500), -(15027, 192, 1305, 'Заболотье', 'Zabolote', 600), -(15028, 192, 1305, 'Иваничи', 'Ivanichi', 700), -(15029, 192, 1305, 'Камень-Каширский', 'Kamen-Kashirskii', 800), -(15030, 192, 1305, 'Киверцы', 'Kivertsy', 900), -(15031, 192, 1305, 'Ковель', 'Kovel', 1000), -(15032, 192, 1305, 'Локачи', 'Lokachi', 1100), -(15033, 192, 1305, 'Луцк', 'Lutsk', 1200), -(15034, 192, 1305, 'Любешов', 'Lyubeshov', 1300), -(15035, 192, 1305, 'Любомль', 'Lyuboml', 1400), -(15036, 192, 1305, 'Маневичи', 'Manevichi', 1500), -(15037, 192, 1305, 'Нововолынск', 'Novovolynsk', 1600), -(15038, 192, 1305, 'Ратно', 'Ratno', 1700), -(15039, 192, 1305, 'Рожище', 'Rozhishche', 1800), -(15040, 192, 1305, 'Старая Выжевка', 'Staraya Vyzhevka', 1900), -(15041, 192, 1305, 'Турийск', 'Turiisk', 2000), -(15042, 192, 1306, 'Апостолово', 'Apostolovo', 100), -(15043, 192, 1306, 'Аулы', 'Auly', 200), -(15044, 192, 1306, 'Брагиновка', 'Braginovka', 300), -(15045, 192, 1306, 'Васильковка', 'Vasilkovka', 400), -(15046, 192, 1306, 'Верхнеднепровск', 'Verhnedneprovsk', 500), -(15047, 192, 1306, 'Верховцево', 'Verhovtsevo', 600), -(15048, 192, 1306, 'Вольногорск', 'Volnogorsk', 700), -(15049, 192, 1306, 'Гвардейское', 'Gvardeiskoe', 800), -(15050, 192, 1306, 'Горняцкое', 'Gornyatskoe', 900), -(15051, 192, 1306, 'Губиниха', 'Gubiniha', 1000), -(15052, 192, 1306, 'Демурино', 'Demurino', 1100), -(15053, 192, 1306, 'Днепродзержинск', 'Dneprodzerzhinsk', 1200), -(15054, 192, 1306, 'Днепропетровск', 'Dnepropetrovsk', 1300), -(15055, 192, 1306, 'Желтые Воды', 'Zheltye Vody', 1400), -(15056, 192, 1306, 'Зализничное', 'Zaliznichnoe', 1500), -(15057, 192, 1306, 'Зеленодольск', 'Zelenodolsk', 1600), -(15058, 192, 1306, 'Зеленое', 'Zelenoe', 1700), -(15059, 192, 1306, 'Илларионово', 'Illarionovo', 1800), -(15060, 192, 1306, 'Ингулец', 'Ingulets', 1900), -(15061, 192, 1306, 'Калинино', 'Kalinino', 2000), -(15062, 192, 1306, 'Карнауховка', 'Karnauhovka', 2100), -(15063, 192, 1306, 'Кривой Рог', 'Krivoi Rog', 2200), -(15064, 192, 1306, 'Кринички', 'Krinichki', 2300), -(15065, 192, 1306, 'Магдалиновка', 'Magdalinovka', 2400), -(15066, 192, 1306, 'Марганец', 'Marganets', 2500), -(15067, 192, 1306, 'Межевая', 'Mezhevaya', 2600), -(15068, 192, 1306, 'Никополь', 'Nikopol', 2700), -(15069, 192, 1306, 'Новомосковск', 'Novomoskovsk', 2800), -(15070, 192, 1306, 'Орджоникидзе', 'Ordzhonikidze', 2900), -(15071, 192, 1306, 'Павлоград', 'Pavlograd', 3000), -(15072, 192, 1306, 'Першотравенск', 'Pershotravensk', 3100), -(15073, 192, 1306, 'Петропавловка', 'Petropavlovka', 3200), -(15074, 192, 1306, 'Покровское', 'Pokrovskoe', 3300), -(15075, 192, 1306, 'Пятихатки', 'Pyatihatki', 3400), -(15076, 192, 1306, 'Синельниково', 'Sinelnikovo', 3500), -(15077, 192, 1306, 'Софиевка', 'Sofievka', 3600), -(15078, 192, 1306, 'Томаковка', 'Tomakovka', 3700), -(15079, 192, 1306, 'Царичанка', 'Tsarichanka', 3800), -(15080, 192, 1306, 'Широкое', 'Shirokoe', 3900), -(15081, 192, 1307, 'Авдеевка', 'Avdeevka', 100), -(15082, 192, 1307, 'Александровка', 'Aleksandrovka', 200), -(15083, 192, 1307, 'Алексеево-Дружковка', 'Alekseevo-Druzhkovka', 300), -(15084, 192, 1307, 'Амвросиевка', 'Amvrosievka', 400), -(15085, 192, 1307, 'Андреевка', 'Andreevka', 500), -(15086, 192, 1307, 'Артемово', 'Artemovo', 600), -(15087, 192, 1307, 'Артемовск', 'Artemovsk', 700), -(15088, 192, 1307, 'Безыменное', 'Bezymennoe', 800), -(15089, 192, 1307, 'Беленькое', 'Belenkoe', 900), -(15090, 192, 1307, 'Белицкое', 'Belitskoe', 1000), -(15091, 192, 1307, 'Благодатное', 'Blagodatnoe', 1100), -(15092, 192, 1307, 'Былбасовка', 'Bylbasovka', 1200), -(15093, 192, 1307, 'Великая Новоселка', 'Velikaya Novoselka', 1300), -(15094, 192, 1307, 'Войковский', 'Voikovskii', 1400), -(15095, 192, 1307, 'Волноваха', 'Volnovaha', 1500), -(15096, 192, 1307, 'Володарское', 'Volodarskoe', 1600), -(15097, 192, 1307, 'Гольмовский', 'Golmovskii', 1700), -(15098, 192, 1307, 'Горбачево-Михайловка', 'Gorbachevo-Mihailovka', 1800), -(15099, 192, 1307, 'Горловка', 'Gorlovka', 1900), -(15100, 192, 1307, 'Гродовка', 'Grodovka', 2000), -(15101, 192, 1307, 'Грузско-Зорянское', 'Gruzsko-Zoryanskoe', 2100), -(15102, 192, 1307, 'Дебальцево', 'Debaltsevo', 2200), -(15103, 192, 1307, 'Дзержинск', 'Dzerzhinsk', 2300), -(15104, 192, 1307, 'Димитров', 'Dimitrov', 2400), -(15105, 192, 1307, 'Доброполье', 'Dobropole', 2500), -(15106, 192, 1307, 'Докучаевск', 'Dokuchaevsk', 2600), -(15107, 192, 1307, 'Донецк', 'Donetsk', 2700), -(15108, 192, 1307, 'Донецкая', 'Donetskaya', 2800), -(15109, 192, 1307, 'Донское', 'Donskoe', 2900), -(15110, 192, 1307, 'Дробышево', 'Drobyshevo', 3000), -(15111, 192, 1307, 'Дружковка', 'Druzhkovka', 3100), -(15112, 192, 1307, 'Енакиево', 'Enakievo', 3200), -(15113, 192, 1307, 'Жданов', 'Zhdanov', 3300), -(15114, 192, 1307, 'Ждановка', 'Ждановка', 3400), -(15115, 192, 1307, 'Желанное', 'Zhelannoe', 3500), -(15116, 192, 1307, 'Зугрэс', 'Zugres', 3600), -(15117, 192, 1307, 'Зуевка', 'Zuevka', 3700), -(15118, 192, 1307, 'Иловайск', 'Ilovaisk', 3800), -(15119, 192, 1307, 'Карло-Либкнехтовск', 'Karlo-Libknehtovsk', 3900), -(15120, 192, 1307, 'Карло-Марксово', 'Karlo-Marksovo', 4000), -(15121, 192, 1307, 'Кировск', 'Kirovsk', 4100), -(15122, 192, 1307, 'Константиновка', 'Konstantinovka', 4200), -(15123, 192, 1307, 'Краматорск', 'Kramatorsk', 4300), -(15124, 192, 1307, 'Красноармейск', 'Krasnoarmeisk', 4400), -(15125, 192, 1307, 'Красный Лиман', 'Krasnyi Liman', 4500), -(15126, 192, 1307, 'Макеевка', 'Makeevka', 4600), -(15127, 192, 1307, 'Мариуполь', 'Mariupol', 4700), -(15128, 192, 1307, 'Марьинка', 'Marinka', 4800), -(15129, 192, 1307, 'Николаевка', 'Николаевка', 4900), -(15130, 192, 1307, 'Новоазовск', 'Novoazovsk', 5000), -(15131, 192, 1307, 'Новоэкономическое', 'Novoekonomicheskoe', 5100), -(15132, 192, 1307, 'Першотравневое', 'Pershotravnevoe', 5200), -(15133, 192, 1307, 'Селидово', 'Selidovo', 5300), -(15134, 192, 1307, 'Славянск', 'Slavyansk', 5400), -(15135, 192, 1307, 'Снежное', 'Snezhnoe', 5500), -(15136, 192, 1307, 'Старобешево', 'Starobeshevo', 5600), -(15137, 192, 1307, 'Тельманово', 'Telmanovo', 5700), -(15138, 192, 1307, 'Торез', 'Torez', 5800), -(15139, 192, 1307, 'Угледар', 'Ugledar', 5900), -(15140, 192, 1307, 'Харцызск', 'Hartsyzsk', 6000), -(15141, 192, 1307, 'Шахтерск', 'Shahtersk', 6100), -(15142, 192, 1307, 'Ясиноватая', 'Yasinovataya', 6200), -(15143, 192, 1308, 'Андрушевка', 'Andrushevka', 100), -(15144, 192, 1308, 'Барановка', 'Baranovka', 200), -(15145, 192, 1308, 'Белая Криница', 'Belaya Krinitsa', 300), -(15146, 192, 1308, 'Бердичев', 'Berdichev', 400), -(15147, 192, 1308, 'Броницкая Гута', 'Bronitskaya Guta', 500), -(15148, 192, 1308, 'Брусилов', 'Brusilov', 600), -(15149, 192, 1308, 'Быковка', 'Bykovka', 700), -(15150, 192, 1308, 'Великие Коровинцы', 'Velikie Korovintsy', 800), -(15151, 192, 1308, 'Володарск-Волынский', 'Volodarsk-Volynskii', 900), -(15152, 192, 1308, 'Городница', 'Gorodnitsa', 1000), -(15153, 192, 1308, 'Гришковцы', 'Grishkovtsy', 1100), -(15154, 192, 1308, 'Дзержинск', 'Dzerzhinsk', 1200), -(15155, 192, 1308, 'Довбыш', 'Dovbysh', 1300), -(15156, 192, 1308, 'Емильчино', 'Emilchino', 1400), -(15157, 192, 1308, 'Житомир', 'Zhitomir', 1500), -(15158, 192, 1308, 'Иванополь', 'Ivanopol', 1600), -(15159, 192, 1308, 'Каменный Брод', 'Kamennyi Brod', 1700), -(15160, 192, 1308, 'Коростень', 'Korosten', 1800), -(15161, 192, 1308, 'Коростышев', 'Korostyshev', 1900), -(15162, 192, 1308, 'Лугины', 'Luginy', 2000), -(15163, 192, 1308, 'Любар', 'Lyubar', 2100), -(15164, 192, 1308, 'Малин', 'Malin', 2200), -(15165, 192, 1308, 'Народичи', 'Narodichi', 2300), -(15166, 192, 1308, 'Новоград-Волынский', 'Novograd-Volynskii', 2400), -(15167, 192, 1308, 'Овруч', 'Ovruch', 2500), -(15168, 192, 1308, 'Олевск', 'Olevsk', 2600), -(15169, 192, 1308, 'Попельня', 'Popelnya', 2700), -(15170, 192, 1308, 'Радомышль', 'Radomyshl', 2800), -(15171, 192, 1308, 'Ружин', 'Ruzhin', 2900), -(15172, 192, 1308, 'Червоноармейск', 'Chervonoarmeisk', 3000), -(15173, 192, 1308, 'Черняхов', 'Chernyahov', 3100), -(15174, 192, 1308, 'Чуднов', 'Chudnov', 3200), -(15175, 192, 1309, 'Берегово', 'Beregovo', 100), -(15176, 192, 1309, 'Буштына', 'Bushtyna', 200), -(15177, 192, 1309, 'Великий Березный', 'Velikii Bereznyi', 300), -(15178, 192, 1309, 'Великий Бычков', 'Velikii Bychkov', 400), -(15179, 192, 1309, 'Виноградов', 'Vinogradov', 500), -(15180, 192, 1309, 'Воловец', 'Volovets', 600), -(15181, 192, 1309, 'Иршава', 'Irshava', 700), -(15182, 192, 1309, 'Межгорье', 'Mezhgore', 800), -(15183, 192, 1309, 'Мукачево', 'Mukachevo', 900), -(15184, 192, 1309, 'Перечин', 'Perechin', 1000), -(15185, 192, 1309, 'Рахов', 'Rahov', 1100), -(15186, 192, 1309, 'Свалява', 'Svalyava', 1200), -(15187, 192, 1309, 'Тячев', 'Tyachev', 1300), -(15188, 192, 1309, 'Ужгород', 'Uzhgorod', 1400), -(15189, 192, 1309, 'Хуст', 'Hust', 1500), -(15190, 192, 1309, 'Чоп', 'Chop', 1600), -(15191, 192, 1310, 'Акимовка', 'Akimovka', 100), -(15192, 192, 1310, 'Андреевка', 'Andreevka', 200), -(15193, 192, 1310, 'Балабино', 'Balabino', 300), -(15194, 192, 1310, 'Бердянск', 'Berdyansk', 400), -(15195, 192, 1310, 'Васильевка', 'Vasilevka', 500), -(15196, 192, 1310, 'Веселое', 'Veseloe', 600), -(15197, 192, 1310, 'Вольнянск', 'Вольнянск', 700), -(15198, 192, 1310, 'Гуляйполе', 'Gulyaipole', 800), -(15199, 192, 1310, 'Днепрорудный', 'Днепрорудный', 900), -(15200, 192, 1310, 'Запорожье', 'Zaporozhe', 1000), -(15201, 192, 1310, 'Каменка-Днепровская', 'Kamenka-Dneprovskaya', 1100), -(15202, 192, 1310, 'Каменное', 'Kamennoe', 1200), -(15203, 192, 1310, 'Камыш-Заря', 'Kamysh-Zarya', 1300), -(15204, 192, 1310, 'Куйбышево', 'Kuibyshevo', 1400), -(15205, 192, 1310, 'Мелитополь', 'Melitopol', 1500), -(15206, 192, 1310, 'Михайловка', 'Mihailovka', 1600), -(15207, 192, 1310, 'Новониколаевка', 'Novonikolaevka', 1700), -(15208, 192, 1310, 'Орехов', 'Orehov', 1800), -(15209, 192, 1310, 'Пологи', 'Pologi', 1900), -(15210, 192, 1310, 'Приазовское', 'Priazovskoe', 2000), -(15211, 192, 1310, 'Приморск', 'Primorsk', 2100), -(15212, 192, 1310, 'Токмак', 'Tokmak', 2200), -(15213, 192, 1310, 'Черниговка', 'Chernigovka', 2300), -(15214, 192, 1310, 'Энергодар', 'Energodar', 2400), -(15215, 192, 1311, 'Богородчаны', 'Bogorodchany', 100), -(15216, 192, 1311, 'Болехов', 'Bolehov', 200), -(15217, 192, 1311, 'Болшовцы', 'Bolshovtsy', 300), -(15218, 192, 1311, 'Брошнев-Осада', 'Broshnev-Osada', 400), -(15219, 192, 1311, 'Букачевцы', 'Bukachevtsy', 500), -(15220, 192, 1311, 'Бурштын', 'Burshtyn', 600), -(15221, 192, 1311, 'Бытков', 'Bytkov', 700), -(15222, 192, 1311, 'Верховина', 'Verhovina', 800), -(15223, 192, 1311, 'Войнилов', 'Voinilov', 900), -(15224, 192, 1311, 'Ворохта', 'Vorohta', 1000), -(15225, 192, 1311, 'Выгода', 'Vygoda', 1100), -(15226, 192, 1311, 'Галич', 'Galich', 1200), -(15227, 192, 1311, 'Гвоздец', 'Gvozdets', 1300), -(15228, 192, 1311, 'Городенка', 'Gorodenka', 1400), -(15229, 192, 1311, 'Делятин', 'Delyatin', 1500), -(15230, 192, 1311, 'Долина', 'Dolina', 1600), -(15231, 192, 1311, 'Жовтень', 'Zhovten', 1700), -(15232, 192, 1311, 'Заболотов', 'Zabolotov', 1800), -(15233, 192, 1311, 'Ивано-Франковск', 'Ivano-Frankovsk', 1900), -(15234, 192, 1311, 'Калуж', 'Kaluzh', 2000), -(15235, 192, 1311, 'Калуш', 'Kalush', 2100), -(15236, 192, 1311, 'Коломыя', 'Kolomyya', 2200), -(15237, 192, 1311, 'Косов', 'Kosov', 2300), -(15238, 192, 1311, 'Надворна', 'Nadvorna', 2400), -(15239, 192, 1311, 'Надворная', 'Nadvornaya', 2500), -(15240, 192, 1311, 'Рогатин', 'Rogatin', 2600), -(15241, 192, 1311, 'Рожнятов', 'Rozhnyatov', 2700), -(15242, 192, 1311, 'Снятын', 'Snyatyn', 2800), -(15243, 192, 1311, 'Станиславов', 'Stanislavov', 2900), -(15244, 192, 1311, 'Тлумач', 'Tlumach', 3000), -(15245, 192, 1311, 'Тысменица', 'Tysmenitsa', 3100), -(15246, 192, 1311, 'Яремча', 'Yaremcha', 3200), -(15247, 192, 1312, 'Барышевка', 'Baryshevka', 100), -(15248, 192, 1312, 'Белая Церковь', 'Belaya Tserkov', 200), -(15249, 192, 1312, 'Березань', 'Berezan', 300), -(15250, 192, 1312, 'Богуслав', 'Boguslav', 400), -(15251, 192, 1312, 'Борисполь', 'Borispol', 500), -(15252, 192, 1312, 'Боровая', 'Borovaya', 600), -(15253, 192, 1312, 'Бородянка', 'Borodyanka', 700), -(15254, 192, 1312, 'Боярка', 'Boyarka', 800), -(15255, 192, 1312, 'Бровары', 'Brovary', 900), -(15256, 192, 1312, 'Васильков', 'Vasilkov', 1000), -(15257, 192, 1312, 'Володарка', 'Volodarka', 1100), -(15258, 192, 1312, 'Ворзель', 'Vorzel', 1200), -(15259, 192, 1312, 'Вышгород', 'Vyshgorod', 1300), -(15260, 192, 1312, 'Гребенки', 'Grebenki', 1400), -(15261, 192, 1312, 'Дымер', 'Dymer', 1500), -(15262, 192, 1312, 'Згуровка', 'Zgurovka', 1600), -(15263, 192, 1312, 'Иванков', 'Ivankov', 1700), -(15264, 192, 1312, 'Ирпень', 'Irpen', 1800), -(15265, 192, 1312, 'Кагарлык', 'Kagarlyk', 1900), -(15266, 192, 1312, 'Калиновка', 'Kalinovka', 2000), -(15267, 192, 1312, 'Киев', 'Kiev', 2100), -(15268, 192, 1312, 'Киевская', 'Kievskaya', 2200), -(15269, 192, 1312, 'Кодра', 'Kodra', 2300), -(15270, 192, 1312, 'Кожанка', 'Kozhanka', 2400), -(15271, 192, 1312, 'Козин', 'Kozin', 2500), -(15272, 192, 1312, 'Макаров', 'Makarov', 2600), -(15273, 192, 1312, 'Мироновка', 'Mironovka', 2700), -(15274, 192, 1312, 'Обухов', 'Obuhov', 2800), -(15275, 192, 1312, 'Переяслав-Хмельницкий', 'Pereyaslav-Hmelnitskii', 2900), -(15276, 192, 1312, 'Полесское', 'Polesskoe', 3000), -(15277, 192, 1312, 'Ракитное', 'Rakitnoe', 3100), -(15278, 192, 1312, 'Ржищев', 'Ржищев', 3200), -(15279, 192, 1312, 'Сквира', 'Skvira', 3300), -(15280, 192, 1312, 'Славутич', 'Slavutich', 3400), -(15281, 192, 1312, 'Ставище', 'Stavishche', 3500), -(15282, 192, 1312, 'Тараща', 'Tarashcha', 3600), -(15283, 192, 1312, 'Тетиев', 'Tetiev', 3700), -(15284, 192, 1312, 'Фастов', 'Fastov', 3800), -(15285, 192, 1312, 'Чернобыль', 'Chernobyl', 3900), -(15286, 192, 1312, 'Яготин', 'Yagotin', 4000), -(15287, 192, 1313, 'Александрия', 'Aleksandriya', 100), -(15288, 192, 1313, 'Александровка', 'Aleksandrovka', 200), -(15289, 192, 1313, 'Бобринец', 'Bobrinets', 300), -(15290, 192, 1313, 'Гайворон', 'Gaivoron', 400), -(15291, 192, 1313, 'Голованевск', 'Golovanevsk', 500), -(15292, 192, 1313, 'Добровеличковка', 'Dobrovelichkovka', 600), -(15293, 192, 1313, 'Долинская', 'Dolinskaya', 700), -(15294, 192, 1313, 'Елизаветградка', 'Elizavetgradka', 800), -(15295, 192, 1313, 'Завалье', 'Zavale', 900), -(15296, 192, 1313, 'Знаменка', 'Znamenka', 1000), -(15297, 192, 1313, 'Знаменка-Вторая', 'Znamenka-Vtoraya', 1100), -(15298, 192, 1313, 'Капитановка', 'Kapitanovka', 1200), -(15299, 192, 1313, 'Кировоград', 'Kirovograd', 1300), -(15300, 192, 1313, 'Компанеевка', 'Kompaneevka', 1400), -(15301, 192, 1313, 'Малая Виска', 'Malaya Viska', 1500), -(15302, 192, 1313, 'Новгородка', 'Novgorodka', 1600), -(15303, 192, 1313, 'Новоархангельск', 'Novoarhangelsk', 1700), -(15304, 192, 1313, 'Новомиргород', 'Novomirgorod', 1800), -(15305, 192, 1313, 'Новоукраинка', 'Novoukrainka', 1900), -(15306, 192, 1313, 'Ольшанка', 'Olshanka', 2000), -(15307, 192, 1313, 'Онуфриевка', 'Onufrievka', 2100), -(15308, 192, 1313, 'Петрово', 'Petrovo', 2200), -(15309, 192, 1313, 'Светловодск', 'Svetlovodsk', 2300), -(15310, 192, 1313, 'Ульяновка', 'Ulyanovka', 2400), -(15311, 192, 1313, 'Устиновка', 'Ustinovka', 2500), -(15312, 192, 1314, 'Азовское', 'Azovskoe', 100), -(15313, 192, 1314, 'Алупка', 'Alupka', 200), -(15314, 192, 1314, 'Алушта', 'Alushta', 300), -(15315, 192, 1314, 'Армянск', 'Armyansk', 400), -(15316, 192, 1314, 'Багерово', 'Bagerovo', 500), -(15317, 192, 1314, 'Балаклава', 'Balaklava', 600), -(15318, 192, 1314, 'Бахчисарай', 'Bahchisarai', 700), -(15319, 192, 1314, 'Белогорск', 'Belogorsk', 800), -(15320, 192, 1314, 'Гаспра', 'Gaspra', 900), -(15321, 192, 1314, 'Гвардейское', 'Gvardeiskoe', 1000), -(15322, 192, 1314, 'Гурзуф', 'Gurzuf', 1100), -(15323, 192, 1314, 'Джанкой', 'Dzhankoi', 1200), -(15324, 192, 1314, 'Евпатория', 'Evpatoriya', 1300), -(15325, 192, 1314, 'Зуя', 'Zuya', 1400), -(15326, 192, 1314, 'Керчь', 'Kerch', 1500), -(15327, 192, 1314, 'Кировское', 'Kirovskoe', 1600), -(15328, 192, 1314, 'Коктебель', 'Коктебель', 1700), -(15329, 192, 1314, 'Красногвардейское', 'Krasnogvardeiskoe', 1800), -(15330, 192, 1314, 'Красноперекопск', 'Krasnoperekopsk', 1900), -(15331, 192, 1314, 'Ленино', 'Lenino', 2000), -(15332, 192, 1314, 'Массандра', 'Massandra', 2100), -(15333, 192, 1314, 'Нижнегорский', 'Nizhnegorskii', 2200), -(15334, 192, 1314, 'Первомайское', 'Pervomaiskoe', 2300), -(15335, 192, 1314, 'Раздольное', 'Razdolnoe', 2400), -(15336, 192, 1314, 'Саки', 'Saki', 2500), -(15337, 192, 1314, 'Севастополь', 'Sevastopol', 2600), -(15338, 192, 1314, 'Симеиз', 'Симеиз', 2700), -(15339, 192, 1314, 'Симферополь', 'Simferopol', 2800), -(15340, 192, 1314, 'Советский', 'Sovetskii', 2900), -(15341, 192, 1314, 'Судак', 'Sudak', 3000), -(15342, 192, 1314, 'Феодосия', 'Feodosiya', 3100), -(15343, 192, 1314, 'Форос', 'Foros', 3200), -(15344, 192, 1314, 'Черноморское', 'Chernomorskoe', 3300), -(15345, 192, 1314, 'Щёлкино', 'Shchyolkino', 3400), -(15346, 192, 1314, 'Ялта', 'Yalta', 3500), -(15347, 192, 1315, 'Алексадровск', 'Aleksadrovsk', 100), -(15348, 192, 1315, 'Алчевск', 'Alchevsk', 200), -(15349, 192, 1315, 'Антрацит', 'Antratsit', 300), -(15350, 192, 1315, 'Артемовск', 'Artemovsk', 400), -(15351, 192, 1315, 'Байрачки', 'Bairachki', 500), -(15352, 192, 1315, 'Беловодск', 'Belovodsk', 600), -(15353, 192, 1315, 'Белое', 'Beloe', 700), -(15354, 192, 1315, 'Белокуракино', 'Belokurakino', 800), -(15355, 192, 1315, 'Белолуцк', 'Belolutsk', 900), -(15356, 192, 1315, 'Бирюково', 'Biryukovo', 1000), -(15357, 192, 1315, 'Боково-Платово', 'Bokovo-Platovo', 1100), -(15358, 192, 1315, 'Боровское', 'Borovskoe', 1200), -(15359, 192, 1315, 'Брянка', 'Bryanka', 1300), -(15360, 192, 1315, 'Бугаевка', 'Bugaevka', 1400), -(15361, 192, 1315, 'Вахрушево', 'Vahrushevo', 1500), -(15362, 192, 1315, 'Великий Лог', 'Velikii Log', 1600), -(15363, 192, 1315, 'Вергулевка', 'Vergulevka', 1700), -(15364, 192, 1315, 'Володарск', 'Volodarsk', 1800), -(15365, 192, 1315, 'Волчеяровка', 'Volcheyarovka', 1900), -(15366, 192, 1315, 'Ворошиловград', 'Voroshilovgrad', 2000), -(15367, 192, 1315, 'Врубовка', 'Vrubovka', 2100), -(15368, 192, 1315, 'Врубовский', 'Vrubovskii', 2200), -(15369, 192, 1315, 'Георгиевка', 'Georgievka', 2300), -(15370, 192, 1315, 'Горское', 'Gorskoe', 2400), -(15371, 192, 1315, 'Есауловка', 'Esaulovka', 2500), -(15372, 192, 1315, 'Зимогорье', 'Zimogore', 2600), -(15373, 192, 1315, 'Золотое', 'Zolotoe', 2700), -(15374, 192, 1315, 'Зоринск', 'Zorinsk', 2800), -(15375, 192, 1315, 'Изварино', 'Izvarino', 2900), -(15376, 192, 1315, 'Калиново', 'Kalinovo', 3000), -(15377, 192, 1315, 'Кировск', 'Kirovsk', 3100), -(15378, 192, 1315, 'Коммунарск', 'Kommunarsk', 3200), -(15379, 192, 1315, 'Краснодон', 'Krasnodon', 3300), -(15380, 192, 1315, 'Красный Луч', 'Krasnyi Luch', 3400), -(15381, 192, 1315, 'Кременная', 'Kremennaya', 3500), -(15382, 192, 1315, 'Лисичанск', 'Lisichansk', 3600), -(15383, 192, 1315, 'Луганск', 'Lugansk', 3700), -(15384, 192, 1315, 'Лутугино', 'Lutugino', 3800), -(15385, 192, 1315, 'Марковка', 'Markovka', 3900), -(15386, 192, 1315, 'Меловое', 'Melovoe', 4000), -(15387, 192, 1315, 'Молодогвардейск', 'Молодогвардейск', 4100), -(15388, 192, 1315, 'Новоайдар', 'Novoaidar', 4200), -(15389, 192, 1315, 'Новопсков', 'Novopskov', 4300), -(15390, 192, 1315, 'Первомайск', 'Pervomaisk', 4400), -(15391, 192, 1315, 'Перевальск', 'Perevalsk', 4500), -(15392, 192, 1315, 'Попасная', 'Popasnaya', 4600), -(15393, 192, 1315, 'Ровеньки', 'Rovenki', 4700), -(15394, 192, 1315, 'Рубежное', 'Rubezhnoe', 4800), -(15395, 192, 1315, 'Сватово', 'Svatovo', 4900), -(15396, 192, 1315, 'Свердловск', 'Sverdlovsk', 5000), -(15397, 192, 1315, 'Северодонецк', 'Severodonetsk', 5100), -(15398, 192, 1315, 'Славяносербск', 'Slavyanoserbsk', 5200), -(15399, 192, 1315, 'Станично-Луганское', 'Stanichno-Luganskoe', 5300), -(15400, 192, 1315, 'Старобельск', 'Starobelsk', 5400), -(15401, 192, 1315, 'Стаханов', 'Stahanov', 5500), -(15402, 192, 1315, 'Счастье', 'Счастье', 5600), -(15403, 192, 1315, 'Троицкое', 'Troitskoe', 5700), -(15404, 192, 1316, 'Белз', 'Belz', 100), -(15405, 192, 1316, 'Бобрка', 'Bobrka', 200), -(15406, 192, 1316, 'Борислав', 'Borislav', 300), -(15407, 192, 1316, 'Броды', 'Brody', 400), -(15408, 192, 1316, 'Буск', 'Busk', 500), -(15409, 192, 1316, 'Великие Мосты', 'Velikie Mosty', 600), -(15410, 192, 1316, 'Верхнее Синевидное', 'Verhnee Sinevidnoe', 700), -(15411, 192, 1316, 'Винники', 'Vinniki', 800), -(15412, 192, 1316, 'Глиняны', 'Glinyany', 900), -(15413, 192, 1316, 'Горняк', 'Gornyak', 1000), -(15414, 192, 1316, 'Дашава', 'Dashava', 1100), -(15415, 192, 1316, 'Добротвор', 'Dobrotvor', 1200), -(15416, 192, 1316, 'Дрогобыч', 'Drogobych', 1300), -(15417, 192, 1316, 'Жидачов', 'Zhidachov', 1400), -(15418, 192, 1316, 'Жовква', 'Жовква', 1500), -(15419, 192, 1316, 'Золочев', 'Zolochev', 1600), -(15420, 192, 1316, 'Ивано-Франково', 'Ivano-Frankovo', 1700), -(15421, 192, 1316, 'Каменка-Бугская', 'Kamenka-Bugskaya', 1800), -(15422, 192, 1316, 'Красне', 'Красне', 1900), -(15423, 192, 1316, 'Львов', 'Lvov', 2000), -(15424, 192, 1316, 'Моршин', 'Моршин', 2100), -(15425, 192, 1316, 'Мостиска', 'Mostiska', 2200), -(15426, 192, 1316, 'Нестеров', 'Nesterov', 2300), -(15427, 192, 1316, 'Николаев', 'Nikolaev', 2400), -(15428, 192, 1316, 'Новый Роздил', 'Новый Роздил', 2500), -(15429, 192, 1316, 'Перемышляны', 'Peremyshlyany', 2600), -(15430, 192, 1316, 'Пустомыты', 'Pustomyty', 2700), -(15431, 192, 1316, 'Рава Русская', 'Rava Russkaya', 2800), -(15432, 192, 1316, 'Радехов', 'Radehov', 2900), -(15433, 192, 1316, 'Самбор', 'Sambor', 3000), -(15434, 192, 1316, 'Сколе', 'Skole', 3100), -(15435, 192, 1316, 'Сокаль', 'Sokal', 3200), -(15436, 192, 1316, 'Старый Самбор', 'Staryi Sambor', 3300), -(15437, 192, 1316, 'Стрый', 'Stryi', 3400), -(15438, 192, 1316, 'Трускавец', 'Truskavets', 3500), -(15439, 192, 1316, 'Турка', 'Turka', 3600), -(15440, 192, 1316, 'Червоноград', 'Chervonograd', 3700), -(15441, 192, 1316, 'Яворов', 'Yavorov', 3800), -(15442, 192, 1317, 'Александровка', 'Aleksandrovka', 100), -(15443, 192, 1317, 'Арбузинка', 'Arbuzinka', 200), -(15444, 192, 1317, 'Баштанка', 'Bashtanka', 300), -(15445, 192, 1317, 'Березнеговатое', 'Bereznegovatoe', 400), -(15446, 192, 1317, 'Братское', 'Bratskoe', 500), -(15447, 192, 1317, 'Великая Корениха', 'Velikaya Koreniha', 600), -(15448, 192, 1317, 'Веселиново', 'Veselinovo', 700), -(15449, 192, 1317, 'Вознесенск', 'Voznesensk', 800), -(15450, 192, 1317, 'Доманевка', 'Domanevka', 900), -(15451, 192, 1317, 'Еланец', 'Elanets', 1000), -(15452, 192, 1317, 'Казанка', 'Kazanka', 1100), -(15453, 192, 1317, 'Коблево', 'Коблево', 1200), -(15454, 192, 1317, 'Кривое Озеро', 'Krivoe Ozero', 1300), -(15455, 192, 1317, 'Николаев', 'Nikolaev', 1400), -(15456, 192, 1317, 'Новая Одесса', 'Novaya Odessa', 1500), -(15457, 192, 1317, 'Новый Буг', 'Novyi Bug', 1600), -(15458, 192, 1317, 'Очаков', 'Ochakov', 1700), -(15459, 192, 1317, 'Первомайск', 'Pervomaisk', 1800), -(15460, 192, 1317, 'Снигиревка', 'Snigirevka', 1900), -(15461, 192, 1317, 'Южноукраинск', 'Yuzhnoukrainsk', 2000), -(15462, 192, 1318, 'Аккерман', 'Akkerman', 100), -(15463, 192, 1318, 'Ананьев', 'Ananev', 200), -(15464, 192, 1318, 'Арциз', 'Artsiz', 300), -(15465, 192, 1318, 'Балта', 'Balta', 400), -(15466, 192, 1318, 'Белгород-Днестровский', 'Belgorod-Dnestrovskii', 500), -(15467, 192, 1318, 'Беляевка', 'Belyaevka', 600), -(15468, 192, 1318, 'Березино', 'Berezino', 700), -(15469, 192, 1318, 'Березовка', 'Berezovka', 800), -(15470, 192, 1318, 'Болград', 'Bolgrad', 900), -(15471, 192, 1318, 'Бородино', 'Borodino', 1000), -(15472, 192, 1318, 'Великая Михайловка', 'Velikaya Mihailovka', 1100), -(15473, 192, 1318, 'Великодолининское', 'Velikodolininskoe', 1200), -(15474, 192, 1318, 'Вилково', 'Vilkovo', 1300), -(15475, 192, 1318, 'Затишье', 'Zatishe', 1400), -(15476, 192, 1318, 'Измаил', 'Izmail', 1500), -(15477, 192, 1318, 'Ильичевск', 'Ilichevsk', 1600), -(15478, 192, 1318, 'Килия', 'Kiliya', 1700), -(15479, 192, 1318, 'Кодыма', 'Kodyma', 1800), -(15480, 192, 1318, 'Коминтерновское', 'Kominternovskoe', 1900), -(15481, 192, 1318, 'Котовск', 'Kotovsk', 2000), -(15482, 192, 1318, 'Красные Окны', 'Krasnye Okny', 2100), -(15483, 192, 1318, 'Любашевка', 'Lyubashevka', 2200), -(15484, 192, 1318, 'Николаевка', 'Nikolaevka', 2300), -(15485, 192, 1318, 'Овидиополь', 'Ovidiopol', 2400), -(15486, 192, 1318, 'Одесса', 'Odessa', 2500), -(15487, 192, 1318, 'Раздельная', 'Razdelnaya', 2600), -(15488, 192, 1318, 'Рени', 'Reni', 2700), -(15489, 192, 1318, 'Саврань', 'Savran', 2800), -(15490, 192, 1318, 'Сарата', 'Sarata', 2900), -(15491, 192, 1318, 'Тарутино', 'Tarutino', 3000), -(15492, 192, 1318, 'Татарбунары', 'Tatarbunary', 3100), -(15493, 192, 1318, 'Теплодар', 'Teplodar', 3200), -(15494, 192, 1318, 'Фрунзовка', 'Frunzovka', 3300), -(15495, 192, 1318, 'Ширяево', 'Shiryaevo', 3400), -(15496, 192, 1318, 'Южный', 'Yuzhnyi', 3500), -(15497, 192, 1319, 'Белики', 'Beliki', 100), -(15498, 192, 1319, 'Великая Багачка', 'Velikaya Bagachka', 200), -(15499, 192, 1319, 'Гадяч', 'Gadyach', 300), -(15500, 192, 1319, 'Глобино', 'Globino', 400), -(15501, 192, 1319, 'Гоголево', 'Gogolevo', 500), -(15502, 192, 1319, 'Градижск', 'Gradizhsk', 600), -(15503, 192, 1319, 'Гребенка', 'Grebenka', 700), -(15504, 192, 1319, 'Диканька', 'Dikanka', 800), -(15505, 192, 1319, 'Зеньков', 'Zenkov', 900), -(15506, 192, 1319, 'Карловка', 'Karlovka', 1000), -(15507, 192, 1319, 'Кобеляки', 'Kobelyaki', 1100), -(15508, 192, 1319, 'Козельщина', 'Kozelshchina', 1200), -(15509, 192, 1319, 'Комсомольск', 'Komsomolsk', 1300), -(15510, 192, 1319, 'Котельва', 'Kotelva', 1400), -(15511, 192, 1319, 'Кременчуг', 'Kremenchug', 1500), -(15512, 192, 1319, 'Лохвица', 'Lohvitsa', 1600), -(15513, 192, 1319, 'Лубны', 'Lubny', 1700), -(15514, 192, 1319, 'Машевка', 'Mashevka', 1800), -(15515, 192, 1319, 'Миргород', 'Mirgorod', 1900), -(15516, 192, 1319, 'Новые Санжары', 'Novye Sanzhary', 2000), -(15517, 192, 1319, 'Оржица', 'Orzhitsa', 2100), -(15518, 192, 1319, 'Пирянтин', 'Piryantin', 2200), -(15519, 192, 1319, 'Пирятин', 'Piryatin', 2300), -(15520, 192, 1319, 'Полтава', 'Poltava', 2400), -(15521, 192, 1319, 'Решетиловка', 'Reshetilovka', 2500), -(15522, 192, 1319, 'Семеновка', 'Semenovka', 2600), -(15523, 192, 1319, 'Хорол', 'Horol', 2700), -(15524, 192, 1319, 'Чернухи', 'Chernuhi', 2800), -(15525, 192, 1319, 'Чутово', 'Chutovo', 2900), -(15526, 192, 1319, 'Шишаки', 'Shishaki', 3000), -(15527, 192, 1320, 'Владимирец', 'Vladimirets', 100), -(15528, 192, 1320, 'Гоща', 'Goshcha', 200), -(15529, 192, 1320, 'Демидовка', 'Demidovka', 300), -(15530, 192, 1320, 'Дубно', 'Dubno', 400), -(15531, 192, 1320, 'Дубровица', 'Dubrovitsa', 500), -(15532, 192, 1320, 'Заречное', 'Zarechnoe', 600), -(15533, 192, 1320, 'Здолбунов', 'Zdolbunov', 700), -(15534, 192, 1320, 'Клевань', 'Klevan', 800), -(15535, 192, 1320, 'Клесов', 'Klesov', 900), -(15536, 192, 1320, 'Корец', 'Korets', 1000), -(15537, 192, 1320, 'Костополь', 'Kostopol', 1100), -(15538, 192, 1320, 'Кузнецовск', 'Kuznetsovsk', 1200), -(15539, 192, 1320, 'Млинов', 'Mlinov', 1300), -(15540, 192, 1320, 'Острог', 'Ostrog', 1400), -(15541, 192, 1320, 'Радивилов', 'Radivilov', 1500), -(15542, 192, 1320, 'Ровно', 'Rovno', 1600), -(15543, 192, 1320, 'Сарны', 'Sarny', 1700), -(15544, 192, 1321, 'Ахтырка', 'Ahtyrka', 100), -(15545, 192, 1321, 'Белополье', 'Belopole', 200), -(15546, 192, 1321, 'Бурынь', 'Buryn', 300), -(15547, 192, 1321, 'Великая Писаревка', 'Velikaya Pisarevka', 400), -(15548, 192, 1321, 'Ворожба', 'Vorozhba', 500), -(15549, 192, 1321, 'Воронеж', 'Voronezh', 600), -(15550, 192, 1321, 'Глухов', 'Gluhov', 700), -(15551, 192, 1321, 'Дружба', 'Druzhba', 800), -(15552, 192, 1321, 'Знобь-Новгородское', 'Znob-Novgorodskoe', 900), -(15553, 192, 1321, 'Кириковка', 'Kirikovka', 1000), -(15554, 192, 1321, 'Конотоп', 'Konotop', 1100), -(15555, 192, 1321, 'Краснополье', 'Krasnopole', 1200), -(15556, 192, 1321, 'Кролевец', 'Krolevets', 1300), -(15557, 192, 1321, 'Лебедин', 'Lebedin', 1400), -(15558, 192, 1321, 'Липовая Долина', 'Lipovaya Dolina', 1500), -(15559, 192, 1321, 'Недригайлов', 'Nedrigailov', 1600), -(15560, 192, 1321, 'Путивль', 'Putivl', 1700), -(15561, 192, 1321, 'Ромны', 'Romny', 1800), -(15562, 192, 1321, 'Середина-Буда', 'Seredina-Buda', 1900), -(15563, 192, 1321, 'Сумы', 'Sumy', 2000), -(15564, 192, 1321, 'Тростянец', 'Trostyanets', 2100), -(15565, 192, 1321, 'Шостка', 'Shostka', 2200), -(15566, 192, 1321, 'Шурупинское', 'Shurupinskoe', 2300), -(15567, 192, 1321, 'Ямполь', 'Yampol', 2400), -(15568, 192, 1322, 'Бережаны', 'Berezhany', 100), -(15569, 192, 1322, 'Борщев', 'Borshchev', 200), -(15570, 192, 1322, 'Бучач', 'Buchach', 300), -(15571, 192, 1322, 'Великие Борки', 'Velikie Borki', 400), -(15572, 192, 1322, 'Вишневец', 'Vishnevets', 500), -(15573, 192, 1322, 'Гримайлов', 'Grimailov', 600), -(15574, 192, 1322, 'Гусятин', 'Gusyatin', 700), -(15575, 192, 1322, 'Залещики', 'Zaleshchiki', 800), -(15576, 192, 1322, 'Заложцы', 'Zalozhtsy', 900), -(15577, 192, 1322, 'Збараж', 'Zbarazh', 1000), -(15578, 192, 1322, 'Зборов', 'Zborov', 1100), -(15579, 192, 1322, 'Золотники', 'Zolotniki', 1200), -(15580, 192, 1322, 'Золотойпоток', 'Zolotoipotok', 1300), -(15581, 192, 1322, 'Козлов', 'Kozlov', 1400), -(15582, 192, 1322, 'Козова', 'Kozova', 1500), -(15583, 192, 1322, 'Кременец', 'Kremenets', 1600), -(15584, 192, 1322, 'Лановцы', 'Lanovtsy', 1700), -(15585, 192, 1322, 'Монастыриска', 'Monastyriska', 1800), -(15586, 192, 1322, 'Подволочиск', 'Podvolochisk', 1900), -(15587, 192, 1322, 'Теребовля', 'Terebovlya', 2000), -(15588, 192, 1322, 'Тернополь', 'Ternopol', 2100), -(15589, 192, 1322, 'Чортков', 'Chortkov', 2200), -(15590, 192, 1322, 'Шумское', 'Shumskoe', 2300), -(15591, 192, 1323, 'Армянск', 'Armyansk', 100), -(15592, 192, 1323, 'Артек', 'Artek', 200), -(15593, 192, 1323, 'Береговое', 'Beregovoe', 300), -(15594, 192, 1323, 'Ботаническое', 'Botanicheskoe', 400), -(15595, 192, 1323, 'Кастрополь', 'Kastropol', 500), -(15596, 192, 1323, 'Кацивели', 'Katsiveli', 600), -(15597, 192, 1323, 'Кореиз', 'Koreiz', 700), -(15598, 192, 1323, 'Красногвардейск', 'Krasnogvardeisk', 800), -(15599, 192, 1323, 'Краснокаменка', 'Krasnokamenka', 900), -(15600, 192, 1323, 'Курпаты', 'Kurpaty', 1000), -(15601, 192, 1323, 'Ливадия', 'Livadiya', 1100), -(15602, 192, 1323, 'Мисхор', 'Mishor', 1200), -(15603, 192, 1323, 'Олива', 'Oliva', 1300), -(15604, 192, 1323, 'Оползневое', 'Opolznevoe', 1400), -(15605, 192, 1323, 'Парковое', 'Parkovoe', 1500), -(15606, 192, 1323, 'Понизовка', 'Ponizovka', 1600), -(15607, 192, 1323, 'Санаторное', 'Sanatornoe', 1700), -(15608, 192, 1323, 'Симеиз', 'Simeiz', 1800), -(15609, 192, 1324, 'Балаклея', 'Balakleya', 100), -(15610, 192, 1324, 'Барвенково', 'Barvenkovo', 200), -(15611, 192, 1324, 'Близнюки', 'Bliznyuki', 300), -(15612, 192, 1324, 'Богодухов', 'Bogoduhov', 400), -(15613, 192, 1324, 'Борки', 'Borki', 500), -(15614, 192, 1324, 'Боровая', 'Borovaya', 600), -(15615, 192, 1324, 'Буды', 'Budy', 700), -(15616, 192, 1324, 'Валки', 'Valki', 800), -(15617, 192, 1324, 'Великий Бурлук', 'Velikii Burluk', 900), -(15618, 192, 1324, 'Волчанск', 'Volchansk', 1000), -(15619, 192, 1324, 'Готвальд', 'Gotvald', 1100), -(15620, 192, 1324, 'Гуты', 'Guty', 1200), -(15621, 192, 1324, 'Дергачи', 'Dergachi', 1300), -(15622, 192, 1324, 'Зачепиловка', 'Zachepilovka', 1400), -(15623, 192, 1324, 'Зидьки', 'Zidki', 1500), -(15624, 192, 1324, 'Золочев', 'Zolochev', 1600), -(15625, 192, 1324, 'Изюм', 'Izyum', 1700), -(15626, 192, 1324, 'Казачья Лопань', 'Kazachya Lopan', 1800), -(15627, 192, 1324, 'Кегичевка', 'Kegichevka', 1900), -(15628, 192, 1324, 'Красноград', 'Krasnograd', 2000), -(15629, 192, 1324, 'Краснокутск', 'Krasnokutsk', 2100), -(15630, 192, 1324, 'Купянск', 'Kupyansk', 2200), -(15631, 192, 1324, 'Лозовая', 'Lozovaya', 2300), -(15632, 192, 1324, 'Люботин', 'Lyubotin', 2400), -(15633, 192, 1324, 'Мерефа', 'Merefa', 2500), -(15634, 192, 1324, 'Новая Водолага', 'Novaya Vodolaga', 2600), -(15635, 192, 1324, 'Первомайский', 'Pervomaiskii', 2700), -(15636, 192, 1324, 'Песочин', 'Pesochin', 2800), -(15637, 192, 1324, 'Сахновщина', 'Sahnovshchina', 2900), -(15638, 192, 1324, 'Харьков', 'Harkov', 3000), -(15639, 192, 1324, 'Чугуев', 'Chuguev', 3100), -(15640, 192, 1324, 'Шевченково', 'Shevchenkovo', 3200), -(15641, 192, 1325, 'Аскания-Нова', 'Askaniya-Nova', 100), -(15642, 192, 1325, 'Белая Криница', 'Belaya Krinitsa', 200), -(15643, 192, 1325, 'Белозерка', 'Belozerka', 300), -(15644, 192, 1325, 'Берислав', 'Berislav', 400), -(15645, 192, 1325, 'Великая Александровка', 'Velikaya Aleksandrovka', 500), -(15646, 192, 1325, 'Великая Лепетиха', 'Velikaya Lepetiha', 600), -(15647, 192, 1325, 'Верхний Рогачик', 'Verhnii Rogachik', 700), -(15648, 192, 1325, 'Высокополье', 'Vysokopole', 800), -(15649, 192, 1325, 'Геническ', 'Genichesk', 900), -(15650, 192, 1325, 'Голая Пристань', 'Golaya Pristan', 1000), -(15651, 192, 1325, 'Горностаевка', 'Gornostaevka', 1100), -(15652, 192, 1325, 'Днепряны', 'Dnepryany', 1200), -(15653, 192, 1325, 'Каланчак', 'Kalanchak', 1300), -(15654, 192, 1325, 'Калининское', 'Kalininskoe', 1400), -(15655, 192, 1325, 'Каховка', 'Kahovka', 1500), -(15656, 192, 1325, 'Нижние Серогозы', 'Nizhnie Serogozy', 1600), -(15657, 192, 1325, 'Новая Каховка', 'Novaya Kahovka', 1700), -(15658, 192, 1325, 'Нововоронцовка', 'Novovorontsovka', 1800), -(15659, 192, 1325, 'Новотроицкое', 'Novotroitskoe', 1900), -(15660, 192, 1325, 'Скадовск', 'Skadovsk', 2000), -(15661, 192, 1325, 'Херсон', 'Herson', 2100), -(15662, 192, 1325, 'Цюрупинск', 'Tsyurupinsk', 2200), -(15663, 192, 1325, 'Чаплинка', 'Chaplinka', 2300), -(15664, 192, 1326, 'Антонины', 'Antoniny', 100), -(15665, 192, 1326, 'Базалия', 'Bazaliya', 200), -(15666, 192, 1326, 'Белогорье', 'Belogore', 300), -(15667, 192, 1326, 'Виньковцы', 'Vinkovtsy', 400), -(15668, 192, 1326, 'Волочиск', 'Volochisk', 500), -(15669, 192, 1326, 'Городок', 'Gorodok', 600), -(15670, 192, 1326, 'Грицев', 'Gritsev', 700), -(15671, 192, 1326, 'Деражня', 'Derazhnya', 800), -(15672, 192, 1326, 'Дунаевцы', 'Dunaevtsy', 900), -(15673, 192, 1326, 'Изяслав', 'Izyaslav', 1000), -(15674, 192, 1326, 'Каменец-Подольский', 'Kamenets-Podolskii', 1100), -(15675, 192, 1326, 'Красилов', 'Krasilov', 1200), -(15676, 192, 1326, 'Летичев', 'Letichev', 1300), -(15677, 192, 1326, 'Нетешин', 'Neteshin', 1400), -(15678, 192, 1326, 'Новая Ушица', 'Novaya Ushitsa', 1500), -(15679, 192, 1326, 'Полонное', 'Polonnoe', 1600), -(15680, 192, 1326, 'Славута', 'Slavuta', 1700), -(15681, 192, 1326, 'Старая Синява', 'Staraya Sinyava', 1800), -(15682, 192, 1326, 'Староконстантинов', 'Starokonstantinov', 1900), -(15683, 192, 1326, 'Теофиполь', 'Teofipol', 2000), -(15684, 192, 1326, 'Хмельницкий', 'Hmelnitskii', 2100), -(15685, 192, 1326, 'Чемеровцы', 'Chemerovtsy', 2200), -(15686, 192, 1326, 'Шепетовка', 'Shepetovka', 2300), -(15687, 192, 1326, 'Ярмолинцы', 'Yarmolintsy', 2400), -(15688, 192, 1327, 'Ватутино', 'Vatutino', 100), -(15689, 192, 1327, 'Городище', 'Gorodishche', 200), -(15690, 192, 1327, 'Драбов', 'Drabov', 300), -(15691, 192, 1327, 'Ерки', 'Erki', 400), -(15692, 192, 1327, 'Жашков', 'Zhashkov', 500), -(15693, 192, 1327, 'Зараевск', 'Zaraevsk', 600), -(15694, 192, 1327, 'Звенигородка', 'Zvenigorodka', 700), -(15695, 192, 1327, 'Золотоноша', 'Zolotonosha', 800), -(15696, 192, 1327, 'Ирдынь', 'Irdyn', 900), -(15697, 192, 1327, 'Каменка', 'Kamenka', 1000), -(15698, 192, 1327, 'Канев', 'Канев', 1100), -(15699, 192, 1327, 'Катеринополь', 'Katerinopol', 1200), -(15700, 192, 1327, 'Корсунь-Шевченковский', 'Korsun-Shevchenkovskii', 1300), -(15701, 192, 1327, 'Лысянка', 'Lysyanka', 1400), -(15702, 192, 1327, 'Маньковка', 'Mankovka', 1500), -(15703, 192, 1327, 'Монастырище', 'Monastyrishche', 1600), -(15704, 192, 1327, 'Смела', 'Smela', 1700), -(15705, 192, 1327, 'Тальное', 'Talnoe', 1800), -(15706, 192, 1327, 'Умань', 'Uman', 1900), -(15707, 192, 1327, 'Христиновка', 'Hristinovka', 2000), -(15708, 192, 1327, 'Черкассы', 'Cherkassy', 2100), -(15709, 192, 1327, 'Чернобай', 'Chernobai', 2200), -(15710, 192, 1327, 'Чигирин', 'Chigirin', 2300), -(15711, 192, 1327, 'Шпола', 'Shpola', 2400), -(15712, 192, 1328, 'Батурин', 'Baturin', 100), -(15713, 192, 1328, 'Бахмач', 'Bahmach', 200), -(15714, 192, 1328, 'Березна', 'Berezna', 300), -(15715, 192, 1328, 'Бобровица', 'Bobrovitsa', 400), -(15716, 192, 1328, 'Борзна', 'Borzna', 500), -(15717, 192, 1328, 'Варва', 'Varva', 600), -(15718, 192, 1328, 'Вертиевка', 'Vertievka', 700), -(15719, 192, 1328, 'Городня', 'Gorodnya', 800), -(15720, 192, 1328, 'Добрянка', 'Добрянка', 900), -(15721, 192, 1328, 'Замглай', 'Zamglai', 1000), -(15722, 192, 1328, 'Ичня', 'Ichnya', 1100), -(15723, 192, 1328, 'Козелец', 'Kozelets', 1200), -(15724, 192, 1328, 'Короп', 'Korop', 1300), -(15725, 192, 1328, 'Корюковка', 'Koryukovka', 1400), -(15726, 192, 1328, 'Куликовка', 'Kulikovka', 1500), -(15727, 192, 1328, 'Мена', 'Mena', 1600), -(15728, 192, 1328, 'Нежин', 'Nezhin', 1700), -(15729, 192, 1328, 'Новгород Северский', 'Novgorod Severskii', 1800), -(15730, 192, 1328, 'Носовка', 'Nosovka', 1900), -(15731, 192, 1328, 'Прилуки', 'Priluki', 2000), -(15732, 192, 1328, 'Припять', 'Припять', 2100), -(15733, 192, 1328, 'Репки', 'Repki', 2200), -(15734, 192, 1328, 'Семеновка', 'Semenovka', 2300), -(15735, 192, 1328, 'Сосница', 'Sosnitsa', 2400), -(15736, 192, 1328, 'Талалаевка', 'Talalaevka', 2500), -(15737, 192, 1328, 'Чернигов', 'Chernigov', 2600), -(15738, 192, 1328, 'Щорс', 'Shchors', 2700), -(15739, 192, 1329, 'Берегомет', 'Beregomet', 100), -(15740, 192, 1329, 'Вашковцы', 'Vashkovtsy', 200), -(15741, 192, 1329, 'Вижница', 'Vizhnitsa', 300), -(15742, 192, 1329, 'Герца', 'Gertsa', 400), -(15743, 192, 1329, 'Глыбокая', 'Glybokaya', 500), -(15744, 192, 1329, 'Заставна', 'Zastavna', 600), -(15745, 192, 1329, 'Кельменцы', 'Kelmentsy', 700), -(15746, 192, 1329, 'Кицмань', 'Kitsman', 800), -(15747, 192, 1329, 'Новоселица', 'Novoselitsa', 900), -(15748, 192, 1329, 'Путила', 'Putila', 1000), -(15749, 192, 1329, 'Сокиряны', 'Sokiryany', 1100), -(15750, 192, 1329, 'Сторожинец', 'Storozhinets', 1200), -(15751, 192, 1329, 'Хотин', 'Hotin', 1300), -(15752, 192, 1329, 'Черновцы', 'Chernovtsy', 1400), -(15753, 193, 1330, 'Arenal', 'Arenal', 100), -(15754, 193, 1330, 'Canelones', 'Canelones', 200), -(15755, 193, 1331, 'Pueblo de la Paz', 'Pueblo de la Paz', 100), -(15756, 193, 1332, 'Minas', 'Minas', 100), -(15757, 193, 1333, 'Maldonado', 'Maldonado', 100), -(15758, 193, 1333, 'Punta del Este', 'Punta del Este', 200), -(15759, 193, 1334, 'Balneario Chacarita', 'Balneario Chacarita', 100), -(15760, 193, 1334, 'Buceo', 'Buceo', 200), -(15761, 193, 1334, 'Montevideo', 'Montevideo', 300), -(15762, 193, 1334, 'Pocitos', 'Pocitos', 400), -(15763, 193, 1334, 'Villa Muoz', 'Villa Muoz', 500), -(15764, 193, 1335, 'Poblado del Borracho', 'Poblado del Borracho', 100), -(15765, 193, 1336, 'Cortume', 'Cortume', 100), -(15766, 193, 1336, 'Los Potreros', 'Los Potreros', 200), -(15767, 193, 1336, 'Rivera', 'Rivera', 300), -(15768, 193, 1337, 'Sauce', 'Sauce', 100), -(15769, 193, 1338, 'Salto', 'Salto', 100); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(15770, 193, 1339, 'Tacuaremb', 'Tacuaremb', 100), -(15771, 193, 1340, 'Arrozal Treinta y Tres', 'Arrozal Treinta y Tres', 100), -(15772, 193, 1340, 'Paso de Piriz', 'Paso de Piriz', 200), -(15773, 194, 1341, 'Торсхавн', 'Торсхавн', 100), -(15774, 195, 1342, 'Нукуалофа', 'Nukualofa', 100), -(15775, 195, 1342, 'Сува', 'Suva', 200), -(15776, 196, 1343, 'Давао', 'Davao', 100), -(15777, 196, 1343, 'Замбоанга', 'Zamboanga', 200), -(15778, 196, 1343, 'Илоило', 'Iloilo', 300), -(15779, 196, 1343, 'Кессон-Сити', 'Kesson-City', 400), -(15780, 196, 1343, 'Легаспи', 'Legaspy', 500), -(15781, 196, 1343, 'Манила', 'Manila', 600), -(15782, 196, 1343, 'Себу', 'Sebu', 700), -(15783, 197, 1344, 'Aatola', 'Aatola', 100), -(15784, 197, 1344, 'Ahmovaara', 'Ahmovaara', 200), -(15785, 197, 1344, 'Ahola', 'Ahola', 300), -(15786, 197, 1344, 'Ahvenlahti', 'Ahvenlahti', 400), -(15787, 197, 1344, 'Airaksela', 'Airaksela', 500), -(15788, 197, 1344, 'Egyptinkorpi', 'Egyptinkorpi', 600), -(15789, 197, 1344, 'Haso', 'Haso', 700), -(15790, 197, 1344, 'Heiniemi', 'Heiniemi', 800), -(15791, 197, 1344, 'Hernejrvi', 'Hernejrvi', 900), -(15792, 197, 1344, 'Hieru', 'Hieru', 1000), -(15793, 197, 1344, 'Iisalmi', 'Iisalmi', 1100), -(15794, 197, 1344, 'Isal''mi', 'Isal''mi', 1200), -(15795, 197, 1344, 'Isomki', 'Isomki', 1300), -(15796, 197, 1344, 'Joensuu', 'Joensuu', 1400), -(15797, 197, 1344, 'Joroinen', 'Joroinen', 1500), -(15798, 197, 1344, 'Juankoski', 'Juankoski', 1600), -(15799, 197, 1344, 'Juva', 'Juva', 1700), -(15800, 197, 1344, 'Kaavi', 'Kaavi', 1800), -(15801, 197, 1344, 'Kalamki', 'Kalamki', 1900), -(15802, 197, 1344, 'Kitee', 'Kitee', 2000), -(15803, 197, 1344, 'Kokkola', 'Kokkola', 2100), -(15804, 197, 1344, 'Kontioranta', 'Kontioranta', 2200), -(15805, 197, 1344, 'Kuomiokoski', 'Kuomiokoski', 2300), -(15806, 197, 1344, 'Kuopio', 'Kuopio', 2400), -(15807, 197, 1344, 'Leppvirta', 'Leppvirta', 2500), -(15808, 197, 1344, 'Lieksa', 'Lieksa', 2600), -(15809, 197, 1344, 'Mikkeli', 'Mikkeli', 2700), -(15810, 197, 1344, 'Mikkelin Maalaiskunta', 'Mikkelin Maalaiskunta', 2800), -(15811, 197, 1344, 'Nilsi', 'Nilsi', 2900), -(15812, 197, 1344, 'Noljakka', 'Noljakka', 3000), -(15813, 197, 1344, 'Nurmes', 'Nurmes', 3100), -(15814, 197, 1344, 'Nurmijrvi', 'Nurmijrvi', 3200), -(15815, 197, 1344, 'Outokumpu', 'Outokumpu', 3300), -(15816, 197, 1344, 'Pieksmki', 'Pieksmki', 3400), -(15817, 197, 1344, 'Punkaharju', 'Punkaharju', 3500), -(15818, 197, 1344, 'Puumala', 'Puumala', 3600), -(15819, 197, 1344, 'Pyhjrvi', 'Pyhjrvi', 3700), -(15820, 197, 1344, 'Salo', 'Salo', 3800), -(15821, 197, 1344, 'Savonlinna', 'Savonlinna', 3900), -(15822, 197, 1344, 'Siilinjrvi', 'Siilinjrvi', 4000), -(15823, 197, 1344, 'Suonenjoki', 'Suonenjoki', 4100), -(15824, 197, 1344, 'Tohmajrvi', 'Tohmajrvi', 4200), -(15825, 197, 1344, 'Tusku', 'Tusku', 4300), -(15826, 197, 1344, 'Varkaus', 'Varkaus', 4400), -(15827, 197, 1344, 'Vehmersalmi', 'Vehmersalmi', 4500), -(15828, 197, 1344, 'Viitasaari', 'Viitasaari', 4600), -(15829, 197, 1345, 'Aanaar', 'Aanaar', 100), -(15830, 197, 1345, 'Aatsinki', 'Aatsinki', 200), -(15831, 197, 1345, 'Ahola', 'Ahola', 300), -(15832, 197, 1345, 'Akanlahti', 'Akanlahti', 400), -(15833, 197, 1345, 'Alanampa', 'Alanampa', 500), -(15834, 197, 1345, 'Arvola', 'Arvola', 600), -(15835, 197, 1345, 'Haara', 'Haara', 700), -(15836, 197, 1345, 'Hepola', 'Hepola', 800), -(15837, 197, 1345, 'Hoikkaniemi', 'Hoikkaniemi', 900), -(15838, 197, 1345, 'Inari', 'Inari', 1000), -(15839, 197, 1345, 'Ivalo', 'Ivalo', 1100), -(15840, 197, 1345, 'Kainuu', 'Kainuu', 1200), -(15841, 197, 1345, 'Kemi', 'Kemi', 1300), -(15842, 197, 1345, 'Kemijrvi', 'Kemijrvi', 1400), -(15843, 197, 1345, 'Keminmaa', 'Keminmaa', 1500), -(15844, 197, 1345, 'Ketola', 'Ketola', 1600), -(15845, 197, 1345, 'Kittil', 'Kittil', 1700), -(15846, 197, 1345, 'Kngs', 'Kngs', 1800), -(15847, 197, 1345, 'Koivu', 'Koivu', 1900), -(15848, 197, 1345, 'Kolari', 'Kolari', 2000), -(15849, 197, 1345, 'Lappea', 'Lappea', 2100), -(15850, 197, 1345, 'Pello', 'Pello', 2200), -(15851, 197, 1345, 'Rovala', 'Rovala', 2300), -(15852, 197, 1345, 'Rovaniemi', 'Rovaniemi', 2400), -(15853, 197, 1345, 'Rovanieni', 'Rovanieni', 2500), -(15854, 197, 1345, 'Runkaus', 'Runkaus', 2600), -(15855, 197, 1345, 'Tervola', 'Tervola', 2700), -(15856, 197, 1345, 'Tohmo', 'Tohmo', 2800), -(15857, 197, 1345, 'Tornio', 'Tornio', 2900), -(15858, 197, 1345, 'Turska', 'Turska', 3000), -(15859, 197, 1346, 'Hiukkamki', 'Hiukkamki', 100), -(15860, 197, 1346, 'Kinola', 'Kinola', 200), -(15861, 197, 1346, 'Ruokojrvi', 'Ruokojrvi', 300), -(15862, 197, 1346, 'Vihavuoren Saha', 'Vihavuoren Saha', 400), -(15863, 197, 1347, 'Aaita', 'Aaita', 100), -(15864, 197, 1347, 'Ahenp', 'Ahenp', 200), -(15865, 197, 1347, 'Aho', 'Aho', 300), -(15866, 197, 1347, 'Aitta', 'Aitta', 400), -(15867, 197, 1347, 'Alajrvi', 'Alajrvi', 500), -(15868, 197, 1347, 'Auho', 'Auho', 600), -(15869, 197, 1347, 'Haapajrvi', 'Haapajrvi', 700), -(15870, 197, 1347, 'Haapavesi', 'Haapavesi', 800), -(15871, 197, 1347, 'Haukipudas', 'Haukipudas', 900), -(15872, 197, 1347, 'Hyrynsaimi', 'Hyrynsaimi', 1000), -(15873, 197, 1347, 'Jrvenp', 'Jrvenp', 1100), -(15874, 197, 1347, 'Kajaani', 'Kajaani', 1200), -(15875, 197, 1347, 'Kalajoki', 'Kalajoki', 1300), -(15876, 197, 1347, 'Kankaanp', 'Kankaanp', 1400), -(15877, 197, 1347, 'Kempele', 'Kempele', 1500), -(15878, 197, 1347, 'Kestil', 'Kestil', 1600), -(15879, 197, 1347, 'Kuhmo', 'Kuhmo', 1700), -(15880, 197, 1347, 'Kurki', 'Kurki', 1800), -(15881, 197, 1347, 'Kuusamo', 'Kuusamo', 1900), -(15882, 197, 1347, 'Muhos', 'Muhos', 2000), -(15883, 197, 1347, 'Nivala', 'Nivala', 2100), -(15884, 197, 1347, 'Oulainen', 'Oulainen', 2200), -(15885, 197, 1347, 'Oulu', 'Oulu', 2300), -(15886, 197, 1347, 'Paltamo', 'Paltamo', 2400), -(15887, 197, 1347, 'Puolivlinkangas', 'Puolivlinkangas', 2500), -(15888, 197, 1347, 'Pyhsalmi', 'Pyhsalmi', 2600), -(15889, 197, 1347, 'Raahe', 'Raahe', 2700), -(15890, 197, 1347, 'Sievi', 'Sievi', 2800), -(15891, 197, 1347, 'Somero', 'Somero', 2900), -(15892, 197, 1347, 'Sotkamo', 'Sotkamo', 3000), -(15893, 197, 1347, 'Suomusal''mi', 'Suomusal''mi', 3100), -(15894, 197, 1347, 'Suomussalmi', 'Suomussalmi', 3200), -(15895, 197, 1347, 'Taipalo', 'Taipalo', 3300), -(15896, 197, 1347, 'Utajrvi', 'Utajrvi', 3400), -(15897, 197, 1347, 'Vaala', 'Vaala', 3500), -(15898, 197, 1347, 'Vesa', 'Vesa', 3600), -(15899, 197, 1347, 'Vuokatti', 'Vuokatti', 3700), -(15900, 197, 1347, 'Ylivieska', 'Ylivieska', 3800), -(15901, 197, 1348, 'Ahjo', 'Ahjo', 100), -(15902, 197, 1348, 'Ahola', 'Ahola', 200), -(15903, 197, 1348, 'Ala-Malmi', 'Ala-Malmi', 300), -(15904, 197, 1348, 'Asikkala', 'Asikkala', 400), -(15905, 197, 1348, 'Askola', 'Askola', 500), -(15906, 197, 1348, 'Bengtsr', 'Bengtsr', 600), -(15907, 197, 1348, 'Borg', 'Borg', 700), -(15908, 197, 1348, 'Box', 'Box', 800), -(15909, 197, 1348, 'by', 'by', 900), -(15910, 197, 1348, 'Daj', 'Daj', 1000), -(15911, 197, 1348, 'Epoo', 'Epoo', 1100), -(15912, 197, 1348, 'Esbo', 'Esbo', 1200), -(15913, 197, 1348, 'Espoo', 'Espoo', 1300), -(15914, 197, 1348, 'Forssa', 'Forssa', 1400), -(15915, 197, 1348, 'Haaga', 'Haaga', 1500), -(15916, 197, 1348, 'Hakunila', 'Hakunila', 1600), -(15917, 197, 1348, 'Hamina', 'Hamina', 1700), -(15918, 197, 1348, 'Hanko', 'Hanko', 1800), -(15919, 197, 1348, 'Hanski', 'Hanski', 1900), -(15920, 197, 1348, 'Hauho', 'Hauho', 2000), -(15921, 197, 1348, 'Heimala', 'Heimala', 2100), -(15922, 197, 1348, 'Heinola', 'Heinola', 2200), -(15923, 197, 1348, 'Helsinge', 'Helsinge', 2300), -(15924, 197, 1348, 'Helsingfors', 'Helsingfors', 2400), -(15925, 197, 1348, 'Helsinki', 'Helsinki', 2500), -(15926, 197, 1348, 'Hlsinge', 'Hlsinge', 2600), -(15927, 197, 1348, 'Hmeenlinna', 'Hmeenlinna', 2700), -(15928, 197, 1348, 'Hyvinge', 'Hyvinge', 2800), -(15929, 197, 1348, 'Hyvink', 'Hyvink', 2900), -(15930, 197, 1348, 'Imatra', 'Imatra', 3000), -(15931, 197, 1348, 'Ing', 'Ing', 3100), -(15932, 197, 1348, 'Janakkala', 'Janakkala', 3200), -(15933, 197, 1348, 'Joensuu', 'Joensuu', 3300), -(15934, 197, 1348, 'Joutseno', 'Joutseno', 3400), -(15935, 197, 1348, 'Jrvenp', 'Jrvenp', 3500), -(15936, 197, 1348, 'Kaipiainen', 'Kaipiainen', 3600), -(15937, 197, 1348, 'Karjaa', 'Karjaa', 3700), -(15938, 197, 1348, 'Kerava', 'Kerava', 3800), -(15939, 197, 1348, 'Kirkkonummi', 'Kirkkonummi', 3900), -(15940, 197, 1348, 'Klaukkala', 'Klaukkala', 4000), -(15941, 197, 1348, 'Kontro', 'Kontro', 4100), -(15942, 197, 1348, 'Kotimki', 'Kotimki', 4200), -(15943, 197, 1348, 'Kotka', 'Kotka', 4300), -(15944, 197, 1348, 'Kourula', 'Kourula', 4400), -(15945, 197, 1348, 'Kouvola', 'Kouvola', 4500), -(15946, 197, 1348, 'Kouvola-Tornionmki', 'Kouvola-Tornionmki', 4600), -(15947, 197, 1348, 'Kuopiola', 'Kuopiola', 4700), -(15948, 197, 1348, 'Kuusankoski', 'Kuusankoski', 4800), -(15949, 197, 1348, 'Kymin Tehtaat', 'Kymin Tehtaat', 4900), -(15950, 197, 1348, 'Lahti', 'Lahti', 5000), -(15951, 197, 1348, 'Lappeenranta', 'Lappeenranta', 5100), -(15952, 197, 1348, 'Lappenranta', 'Lappenranta', 5200), -(15953, 197, 1348, 'Liljendal', 'Liljendal', 5300), -(15954, 197, 1348, 'Lohja', 'Lohja', 5400), -(15955, 197, 1348, 'Loviisa', 'Loviisa', 5500), -(15956, 197, 1348, 'Lovisa', 'Lovisa', 5600), -(15957, 197, 1348, 'Malmi', 'Malmi', 5700), -(15958, 197, 1348, 'Miehikkl', 'Miehikkl', 5800), -(15959, 197, 1348, 'minnefors', 'minnefors', 5900), -(15960, 197, 1348, 'Nummela', 'Nummela', 6000), -(15961, 197, 1348, 'Nurmijrvi', 'Nurmijrvi', 6100), -(15962, 197, 1348, 'Oulunkyl', 'Oulunkyl', 6200), -(15963, 197, 1348, 'Parikkala', 'Parikkala', 6300), -(15964, 197, 1348, 'Porvo', 'Porvo', 6400), -(15965, 197, 1348, 'Porvoo', 'Porvoo', 6500), -(15966, 197, 1348, 'Pukkila', 'Pukkila', 6600), -(15967, 197, 1348, 'Pyhjrvi', 'Pyhjrvi', 6700), -(15968, 197, 1348, 'Riihimki', 'Riihimki', 6800), -(15969, 197, 1348, 'Salo', 'Salo', 6900), -(15970, 197, 1348, 'Simpele', 'Simpele', 7000), -(15971, 197, 1348, 'Siuntio', 'Siuntio', 7100), -(15972, 197, 1348, 'Storkrr', 'Storkrr', 7200), -(15973, 197, 1348, 'Tammisaari', 'Tammisaari', 7300), -(15974, 197, 1348, 'Tapiola', 'Tapiola', 7400), -(15975, 197, 1348, 'Tavastehus', 'Tavastehus', 7500), -(15976, 197, 1348, 'Tenhola', 'Tenhola', 7600), -(15977, 197, 1348, 'Turkia', 'Turkia', 7700), -(15978, 197, 1348, 'Uusimaa', 'Uusimaa', 7800), -(15979, 197, 1348, 'Vainikkala', 'Vainikkala', 7900), -(15980, 197, 1348, 'Vanda', 'Vanda', 8000), -(15981, 197, 1348, 'Vantaa', 'Vantaa', 8100), -(15982, 197, 1348, 'Yelsinki', 'Yelsinki', 8200), -(15983, 197, 1349, 'Aarlahti', 'Aarlahti', 100), -(15984, 197, 1349, 'Aartuka', 'Aartuka', 200), -(15985, 197, 1349, 'Aasla', 'Aasla', 300), -(15986, 197, 1349, 'Ahlholm', 'Ahlholm', 400), -(15987, 197, 1349, 'Aho', 'Aho', 500), -(15988, 197, 1349, 'Aijala', 'Aijala', 600), -(15989, 197, 1349, 'Alajrvi', 'Alajrvi', 700), -(15990, 197, 1349, 'Alastaro', 'Alastaro', 800), -(15991, 197, 1349, 'bo', 'bo', 900), -(15992, 197, 1349, 'Brnd', 'Brnd', 1000), -(15993, 197, 1349, 'Etel-Vartsala', 'Etel-Vartsala', 1100), -(15994, 197, 1349, 'Eura', 'Eura', 1200), -(15995, 197, 1349, 'Haapamki', 'Haapamki', 1300), -(15996, 197, 1349, 'Haapasalo', 'Haapasalo', 1400), -(15997, 197, 1349, 'Halikko', 'Halikko', 1500), -(15998, 197, 1349, 'Helsinge', 'Helsinge', 1600), -(15999, 197, 1349, 'Helsinki', 'Helsinki', 1700), -(16000, 197, 1349, 'Huittinen', 'Huittinen', 1800), -(16001, 197, 1349, 'Jakobstad', 'Jakobstad', 1900), -(16002, 197, 1349, 'Jeppo', 'Jeppo', 2000), -(16003, 197, 1349, 'Jms', 'Jms', 2100), -(16004, 197, 1349, 'Joensuu', 'Joensuu', 2200), -(16005, 197, 1349, 'Jokela', 'Jokela', 2300), -(16006, 197, 1349, 'Juva', 'Juva', 2400), -(16007, 197, 1349, 'Jyvskyl', 'Jyvskyl', 2500), -(16008, 197, 1349, 'Jyvskyln Maalaiskunta', 'Jyvskyln Maalaiskunta', 2600), -(16009, 197, 1349, 'Kaarina', 'Kaarina', 2700), -(16010, 197, 1349, 'Kangasala', 'Kangasala', 2800), -(16011, 197, 1349, 'Kangasniemi', 'Kangasniemi', 2900), -(16012, 197, 1349, 'Kankaanp', 'Kankaanp', 3000), -(16013, 197, 1349, 'Kauhajoki', 'Kauhajoki', 3100), -(16014, 197, 1349, 'Kauhava', 'Kauhava', 3200), -(16015, 197, 1349, 'Kaustinen', 'Kaustinen', 3300), -(16016, 197, 1349, 'Keuruu', 'Keuruu', 3400), -(16017, 197, 1349, 'Kokemki', 'Kokemki', 3500), -(16018, 197, 1349, 'Kokkola', 'Kokkola', 3600), -(16019, 197, 1349, 'Kotka', 'Kotka', 3700), -(16020, 197, 1349, 'Kouvala', 'Kouvala', 3800), -(16021, 197, 1349, 'Kouvola', 'Kouvola', 3900), -(16022, 197, 1349, 'Kovalanmki', 'Kovalanmki', 4000), -(16023, 197, 1349, 'Kristinestad', 'Kristinestad', 4100), -(16024, 197, 1349, 'Kurejoki', 'Kurejoki', 4200), -(16025, 197, 1349, 'Kurikka', 'Kurikka', 4300), -(16026, 197, 1349, 'Laasala', 'Laasala', 4400), -(16027, 197, 1349, 'Lahti', 'Lahti', 4500), -(16028, 197, 1349, 'Lahtinen', 'Lahtinen', 4600), -(16029, 197, 1349, 'Lappajrvi', 'Lappajrvi', 4700), -(16030, 197, 1349, 'Lapua', 'Lapua', 4800), -(16031, 197, 1349, 'Laukaa', 'Laukaa', 4900), -(16032, 197, 1349, 'Laupunen', 'Laupunen', 5000), -(16033, 197, 1349, 'Lieto', 'Lieto', 5100), -(16034, 197, 1349, 'Loimaa', 'Loimaa', 5200), -(16035, 197, 1349, 'Maunula', 'Maunula', 5300), -(16036, 197, 1349, 'Merikarvia', 'Merikarvia', 5400), -(16037, 197, 1349, 'Naantali', 'Naantali', 5500), -(16038, 197, 1349, 'nekoski', 'nekoski', 5600), -(16039, 197, 1349, 'Nrpes', 'Nrpes', 5700), -(16040, 197, 1349, 'Nyukarlebyu', 'Nyukarlebyu', 5800), -(16041, 197, 1349, 'Parkano', 'Parkano', 5900), -(16042, 197, 1349, 'Pietarsaari', 'Pietarsaari', 6000), -(16043, 197, 1349, 'Pitkjrvi', 'Pitkjrvi', 6100), -(16044, 197, 1349, 'Pori', 'Pori', 6200), -(16045, 197, 1349, 'Raisio', 'Raisio', 6300), -(16046, 197, 1349, 'Ramsi', 'Ramsi', 6400), -(16047, 197, 1349, 'Rauma', 'Rauma', 6500), -(16048, 197, 1349, 'Redamo', 'Redamo', 6600), -(16049, 197, 1349, 'Riihikoski', 'Riihikoski', 6700), -(16050, 197, 1349, 'Riihimki', 'Riihimki', 6800), -(16051, 197, 1349, 'Salo', 'Salo', 6900), -(16052, 197, 1349, 'Seinjoki', 'Seinjoki', 7000), -(16053, 197, 1349, 'Somerniemi', 'Somerniemi', 7100), -(16054, 197, 1349, 'Somero', 'Somero', 7200), -(16055, 197, 1349, 'Sydnmaa', 'Sydnmaa', 7300), -(16056, 197, 1349, 'Tammerfors', 'Tammerfors', 7400), -(16057, 197, 1349, 'Tampere', 'Tampere', 7500), -(16058, 197, 1349, 'Tourula', 'Tourula', 7600), -(16059, 197, 1349, 'Turku', 'Turku', 7700), -(16060, 197, 1349, 'Tuuri', 'Tuuri', 7800), -(16061, 197, 1349, 'Urjala', 'Urjala', 7900), -(16062, 197, 1349, 'Usikaupunki', 'Usikaupunki', 8000), -(16063, 197, 1349, 'Uusikaupunki', 'Uusikaupunki', 8100), -(16064, 197, 1349, 'Vaasa', 'Vaasa', 8200), -(16065, 197, 1349, 'Valkeakoski', 'Valkeakoski', 8300), -(16066, 197, 1349, 'Vammala', 'Vammala', 8400), -(16067, 197, 1349, 'Vasa', 'Vasa', 8500), -(16068, 197, 1349, 'Vihtavuori', 'Vihtavuori', 8600), -(16069, 197, 1349, 'Virrat', 'Virrat', 8700), -(16070, 197, 1349, 'Vista', 'Vista', 8800), -(16071, 197, 1349, 'Vuoskoski', 'Vuoskoski', 8900), -(16072, 197, 1349, 'Wasa', 'Wasa', 9000), -(16073, 197, 1350, 'Bast', 'Bast', 100), -(16074, 197, 1350, 'Bengtsble', 'Bengtsble', 200), -(16075, 197, 1350, 'Fgl', 'Fgl', 300), -(16076, 197, 1350, 'Godby', 'Godby', 400), -(16077, 197, 1350, 'Jomala', 'Jomala', 500), -(16078, 197, 1350, 'Karleby', 'Karleby', 600), -(16079, 197, 1350, 'Karlgrd', 'Karlgrd', 700), -(16080, 197, 1350, 'kerlund', 'kerlund', 800), -(16081, 197, 1350, 'Marianhamina', 'Marianhamina', 900), -(16082, 197, 1350, 'Mariehamn', 'Mariehamn', 1000), -(16083, 197, 1350, 'Norrberg', 'Norrberg', 1100), -(16084, 198, 1351, 'Amareins', 'Amareins', 100), -(16085, 198, 1351, 'Argis', 'Argis', 200), -(16086, 198, 1351, 'Bg-la-Ville', 'Bg-la-Ville', 300), -(16087, 198, 1351, 'Bourg-en-Bresse', 'Bourg-en-Bresse', 400), -(16088, 198, 1351, 'Bouvent', 'Bouvent', 500), -(16089, 198, 1351, 'Cessy', 'Cessy', 600), -(16090, 198, 1351, 'Confort', 'Confort', 700), -(16091, 198, 1351, 'Divonne-les-Bains', 'Divonne-les-Bains', 800), -(16092, 198, 1351, 'Ferney-Voltaire', 'Ferney-Voltaire', 900), -(16093, 198, 1351, 'Montceaux', 'Montceaux', 1000), -(16094, 198, 1351, 'Port', 'Port', 1100), -(16095, 198, 1351, 'Pron', 'Pron', 1200), -(16096, 198, 1351, 'Saint-Nizier-le-Bouchoux', 'Saint-Nizier-le-Bouchoux', 1300), -(16097, 198, 1351, 'Saint-Vulbas', 'Saint-Vulbas', 1400), -(16098, 198, 1351, 'Vesancy', 'Vesancy', 1500), -(16099, 198, 1351, 'Vonnas', 'Vonnas', 1600), -(16100, 198, 1352, 'Achery', 'Achery', 100), -(16101, 198, 1352, 'Acy', 'Acy', 200), -(16102, 198, 1352, 'Hirson', 'Hirson', 300), -(16103, 198, 1352, 'Saint-Quentin', 'Saint-Quentin', 400), -(16104, 198, 1352, 'Soissons', 'Soissons', 500), -(16105, 198, 1352, 'Soize', 'Soize', 600), -(16106, 198, 1353, 'Abrest', 'Abrest', 100), -(16107, 198, 1353, 'Bayet', 'Bayet', 200), -(16108, 198, 1353, 'Charmes', 'Charmes', 300), -(16109, 198, 1353, 'Montluon', 'Montluon', 400), -(16110, 198, 1353, 'Vichy', 'Vichy', 500), -(16111, 198, 1354, 'Argens', 'Argens', 100), -(16112, 198, 1354, 'Banon', 'Banon', 200), -(16113, 198, 1354, 'Mlan', 'Mlan', 300), -(16114, 198, 1354, 'Saint-Andr-les-Alpes', 'Saint-Andr-les-Alpes', 400), -(16115, 198, 1355, 'Aiglun', 'Aiglun', 100), -(16116, 198, 1355, 'Antibes', 'Antibes', 200), -(16117, 198, 1355, 'Auribeau-sur-Siagne', 'Auribeau-sur-Siagne', 300), -(16118, 198, 1355, 'Auvare', 'Auvare', 400), -(16119, 198, 1355, 'Beaulieu-sur-Mer', 'Beaulieu-sur-Mer', 500), -(16120, 198, 1355, 'Beausoleil', 'Beausoleil', 600), -(16121, 198, 1355, 'Belvdre', 'Belvdre', 700), -(16122, 198, 1355, 'Biot', 'Biot', 800), -(16123, 198, 1355, 'Cannes', 'Cannes', 900), -(16124, 198, 1355, 'Cap-d''Ail', 'Cap-d''Ail', 1000), -(16125, 198, 1355, 'Juan-les-Pins', 'Juan-les-Pins', 1100), -(16126, 198, 1355, 'La Tour', 'La Tour', 1200), -(16127, 198, 1355, 'Mandelieu-la-Napoule', 'Mandelieu-la-Napoule', 1300), -(16128, 198, 1355, 'Menton', 'Menton', 1400), -(16129, 198, 1355, 'Mougins', 'Mougins', 1500), -(16130, 198, 1355, 'Nice', 'Nice', 1600), -(16131, 198, 1355, 'Saint-Jean-Cap-Ferrat', 'Saint-Jean-Cap-Ferrat', 1700), -(16132, 198, 1355, 'Valbonne', 'Valbonne', 1800), -(16133, 198, 1355, 'Villeneuve-Loubet', 'Villeneuve-Loubet', 1900), -(16134, 198, 1356, 'Alboussire', 'Alboussire', 100), -(16135, 198, 1356, 'Aubenas', 'Aubenas', 200), -(16136, 198, 1356, 'Beauvne', 'Beauvne', 300), -(16137, 198, 1356, 'Chambonas', 'Chambonas', 400), -(16138, 198, 1356, 'Joyeuse', 'Joyeuse', 500), -(16139, 198, 1356, 'La Voulte-sur-Rhne', 'La Voulte-sur-Rhne', 600), -(16140, 198, 1356, 'Saint-Pray', 'Saint-Pray', 700), -(16141, 198, 1357, 'Aiglemont', 'Aiglemont', 100), -(16142, 198, 1357, 'Charleville-Mzires', 'Charleville-Mzires', 200), -(16143, 198, 1357, 'Rethel', 'Rethel', 300), -(16144, 198, 1357, 'Sedan', 'Sedan', 400), -(16145, 198, 1358, 'Aigues-Vives', 'Aigues-Vives', 100), -(16146, 198, 1358, 'Albis', 'Albis', 200), -(16147, 198, 1358, 'Allires', 'Allires', 300), -(16148, 198, 1358, 'Saverdun', 'Saverdun', 400), -(16149, 198, 1358, 'Sem', 'Sem', 500), -(16150, 198, 1359, 'Ailleville', 'Ailleville', 100), -(16151, 198, 1359, 'Amance', 'Amance', 200), -(16152, 198, 1359, 'Arsonval', 'Arsonval', 300), -(16153, 198, 1359, 'Bar-sur-Seine', 'Bar-sur-Seine', 400), -(16154, 198, 1359, 'Mry-sur-Seine', 'Mry-sur-Seine', 500), -(16155, 198, 1359, 'Troyes', 'Troyes', 600), -(16156, 198, 1360, 'Ajac', 'Ajac', 100), -(16157, 198, 1360, 'Azille', 'Azille', 200), -(16158, 198, 1360, 'Carcassonne', 'Carcassonne', 300), -(16159, 198, 1360, 'Castelnaudary', 'Castelnaudary', 400), -(16160, 198, 1360, 'Fa', 'Fa', 500), -(16161, 198, 1360, 'Fabrezan', 'Fabrezan', 600), -(16162, 198, 1360, 'Limoux', 'Limoux', 700), -(16163, 198, 1360, 'Luc-sur-Orbieu', 'Luc-sur-Orbieu', 800), -(16164, 198, 1360, 'Lzignan-Corbires', 'Lzignan-Corbires', 900), -(16165, 198, 1360, 'Narbonne', 'Narbonne', 1000), -(16166, 198, 1360, 'Narbonne-Plage', 'Narbonne-Plage', 1100), -(16167, 198, 1360, 'Villelongue-d''Aude', 'Villelongue-d''Aude', 1200), -(16168, 198, 1361, 'Agen-d''Aveyron', 'Agen-d''Aveyron', 100), -(16169, 198, 1361, 'Auriac-Lagast', 'Auriac-Lagast', 200), -(16170, 198, 1361, 'Bozouls', 'Bozouls', 300), -(16171, 198, 1361, 'Brandonnet', 'Brandonnet', 400), -(16172, 198, 1361, 'Brommat', 'Brommat', 500), -(16173, 198, 1361, 'Curan', 'Curan', 600), -(16174, 198, 1361, 'Nant', 'Nant', 700), -(16175, 198, 1361, 'Rodez', 'Rodez', 800), -(16176, 198, 1361, 'Saint-Beaulize', 'Saint-Beaulize', 900), -(16177, 198, 1362, 'Achenheim', 'Achenheim', 100), -(16178, 198, 1362, 'Allenwiller', 'Allenwiller', 200), -(16179, 198, 1362, 'Altenheim', 'Altenheim', 300), -(16180, 198, 1362, 'Barr', 'Barr', 400), -(16181, 198, 1362, 'Illkirch-Graffenstaden', 'Illkirch-Graffenstaden', 500), -(16182, 198, 1362, 'Niederbronn-les-Bains', 'Niederbronn-les-Bains', 600), -(16183, 198, 1362, 'Russ', 'Russ', 700), -(16184, 198, 1362, 'Saverne', 'Saverne', 800), -(16185, 198, 1362, 'Schiltigheim', 'Schiltigheim', 900), -(16186, 198, 1362, 'Slestat', 'Slestat', 1000), -(16187, 198, 1362, 'Strasbourg', 'Strasbourg', 1100), -(16188, 198, 1362, 'Wintzenbach', 'Wintzenbach', 1200), -(16189, 198, 1363, 'Aix-en-Provence', 'Aix-en-Provence', 100), -(16190, 198, 1363, 'Arles', 'Arles', 200), -(16191, 198, 1363, 'Aubagne', 'Aubagne', 300), -(16192, 198, 1363, 'Belcodne', 'Belcodne', 400), -(16193, 198, 1363, 'Bouc-Bel-Air', 'Bouc-Bel-Air', 500), -(16194, 198, 1363, 'Carry-le-Rouet', 'Carry-le-Rouet', 600), -(16195, 198, 1363, 'Marseille', 'Marseille', 700), -(16196, 198, 1363, 'Martigues', 'Martigues', 800), -(16197, 198, 1363, 'Saint-Paul-lez-Durance', 'Saint-Paul-lez-Durance', 900), -(16198, 198, 1363, 'Salon-de-Provence', 'Salon-de-Provence', 1000), -(16199, 198, 1363, 'Tarascon', 'Tarascon', 1100), -(16200, 198, 1364, 'Ablon', 'Ablon', 100), -(16201, 198, 1364, 'Anisy', 'Anisy', 200), -(16202, 198, 1364, 'Caen', 'Caen', 300), -(16203, 198, 1364, 'Canon', 'Canon', 400), -(16204, 198, 1364, 'Deauville', 'Deauville', 500), -(16205, 198, 1364, 'Douville-en-Auge', 'Douville-en-Auge', 600), -(16206, 198, 1365, 'Aurillac', 'Aurillac', 100), -(16207, 198, 1365, 'Bassignac', 'Bassignac', 200), -(16208, 198, 1366, 'Aigre', 'Aigre', 100), -(16209, 198, 1366, 'Angoulme', 'Angoulme', 200), -(16210, 198, 1366, 'Cognac', 'Cognac', 300), -(16211, 198, 1367, 'Beaugeay', 'Beaugeay', 100), -(16212, 198, 1367, 'Benon', 'Benon', 200), -(16213, 198, 1367, 'La Rochelle', 'La Rochelle', 300), -(16214, 198, 1367, 'Nantill', 'Nantill', 400), -(16215, 198, 1367, 'Royan', 'Royan', 500), -(16216, 198, 1367, 'Saint-Georges-de-Didonne', 'Saint-Georges-de-Didonne', 600), -(16217, 198, 1368, 'Annoix', 'Annoix', 100), -(16218, 198, 1368, 'Azy', 'Azy', 200), -(16219, 198, 1368, 'Bourges', 'Bourges', 300), -(16220, 198, 1368, 'Cerbois', 'Cerbois', 400), -(16221, 198, 1368, 'Chry', 'Chry', 500), -(16222, 198, 1368, 'Culan', 'Culan', 600), -(16223, 198, 1368, 'Uzay-le-Venon', 'Uzay-le-Venon', 700), -(16224, 198, 1368, 'Vierzon', 'Vierzon', 800), -(16225, 198, 1369, 'Brive-la-Gaillarde', 'Brive-la-Gaillarde', 100), -(16226, 198, 1369, 'Corrze', 'Corrze', 200), -(16227, 198, 1370, 'Ajaccio', 'Ajaccio', 100), -(16228, 198, 1370, 'Bastelica', 'Bastelica', 200), -(16229, 198, 1370, 'Bastia', 'Bastia', 300), -(16230, 198, 1370, 'Calvi', 'Calvi', 400), -(16231, 198, 1370, 'L''le-Rousse', 'L''le-Rousse', 500), -(16232, 198, 1370, 'Porto', 'Porto', 600), -(16233, 198, 1370, 'Propriano', 'Propriano', 700), -(16234, 198, 1371, 'Ars', 'Ars', 100), -(16235, 198, 1371, 'Guret', 'Guret', 200), -(16236, 198, 1372, 'Ahuy', 'Ahuy', 100), -(16237, 198, 1372, 'Chenve', 'Chenve', 200), -(16238, 198, 1372, 'Chtillon-sur-Seine', 'Chtillon-sur-Seine', 300), -(16239, 198, 1372, 'Dijon', 'Dijon', 400), -(16240, 198, 1372, 'Nicey', 'Nicey', 500), -(16241, 198, 1372, 'Spoy', 'Spoy', 600), -(16242, 198, 1372, 'Touillon', 'Touillon', 700), -(16243, 198, 1373, 'Andel', 'Andel', 100), -(16244, 198, 1373, 'Chtelaudren', 'Chtelaudren', 200), -(16245, 198, 1373, 'Guingamp', 'Guingamp', 300), -(16246, 198, 1373, 'Loscout-sur-Meu', 'Loscout-sur-Meu', 400), -(16247, 198, 1373, 'Plrin', 'Plrin', 500), -(16248, 198, 1373, 'Saint-Brieuc', 'Saint-Brieuc', 600), -(16249, 198, 1373, 'Saint-Jacut-de-la-Mer', 'Saint-Jacut-de-la-Mer', 700), -(16250, 198, 1374, 'Bressuire', 'Bressuire', 100), -(16251, 198, 1374, 'Chrign', 'Chrign', 200), -(16252, 198, 1374, 'Niort', 'Niort', 300), -(16253, 198, 1375, 'Besse', 'Besse', 100), -(16254, 198, 1375, 'Cercles', 'Cercles', 200), -(16255, 198, 1375, 'Le Bugue', 'Le Bugue', 300), -(16256, 198, 1375, 'Monbazillac', 'Monbazillac', 400), -(16257, 198, 1375, 'Pazayac', 'Pazayac', 500), -(16258, 198, 1375, 'Prigueux', 'Prigueux', 600), -(16259, 198, 1375, 'Sarlat-la-Canda', 'Sarlat-la-Canda', 700), -(16260, 198, 1376, 'Alaise', 'Alaise', 100), -(16261, 198, 1376, 'Besanon', 'Besanon', 200), -(16262, 198, 1376, 'Doubs', 'Doubs', 300), -(16263, 198, 1376, 'Montbliard', 'Montbliard', 400), -(16264, 198, 1376, 'Sochaux', 'Sochaux', 500), -(16265, 198, 1376, 'Vaux-et-Chantegrue', 'Vaux-et-Chantegrue', 600), -(16266, 198, 1376, 'Villers-le-Lac', 'Villers-le-Lac', 700), -(16267, 198, 1377, 'Alixan', 'Alixan', 100), -(16268, 198, 1377, 'Barbires', 'Barbires', 200), -(16269, 198, 1377, 'Beauvallon', 'Beauvallon', 300), -(16270, 198, 1377, 'Bourg-ls-Valence', 'Bourg-ls-Valence', 400), -(16271, 198, 1377, 'Montlimar', 'Montlimar', 500), -(16272, 198, 1377, 'Pierrelatte', 'Pierrelatte', 600), -(16273, 198, 1377, 'Romans-sur-Isre', 'Romans-sur-Isre', 700), -(16274, 198, 1377, 'Tain-l''Hermitage', 'Tain-l''Hermitage', 800), -(16275, 198, 1377, 'Valence', 'Valence', 900), -(16276, 198, 1378, 'Bivres', 'Bivres', 100), -(16277, 198, 1378, 'vry', 'vry', 200), -(16278, 198, 1379, 'Acon', 'Acon', 100), -(16279, 198, 1379, 'Amfreville-sur-Iton', 'Amfreville-sur-Iton', 200), -(16280, 198, 1379, 'Brionne', 'Brionne', 300), -(16281, 198, 1379, 'Vernon', 'Vernon', 400), -(16282, 198, 1379, 'vreux', 'vreux', 500), -(16283, 198, 1380, 'Anet', 'Anet', 100), -(16284, 198, 1380, 'Brou', 'Brou', 200), -(16285, 198, 1380, 'Chartres', 'Chartres', 300), -(16286, 198, 1381, 'Audierne', 'Audierne', 100), -(16287, 198, 1381, 'Brest', 'Brest', 200), -(16288, 198, 1381, 'Huelgoat', 'Huelgoat', 300), -(16289, 198, 1381, 'Molan-sur-Mer', 'Molan-sur-Mer', 400), -(16290, 198, 1381, 'Quimper', 'Quimper', 500), -(16291, 198, 1382, 'Als', 'Als', 100), -(16292, 198, 1382, 'Marguerittes', 'Marguerittes', 200), -(16293, 198, 1382, 'Nmes', 'Nmes', 300), -(16294, 198, 1382, 'Poulx', 'Poulx', 400), -(16295, 198, 1383, 'Auch', 'Auch', 100), -(16296, 198, 1383, 'Gaujan', 'Gaujan', 200), -(16297, 198, 1383, 'Sainte-Christie-d''Armagnac', 'Sainte-Christie-d''Armagnac', 300), -(16298, 198, 1384, 'Andernos-les-Bains', 'Andernos-les-Bains', 100), -(16299, 198, 1384, 'Arcachon', 'Arcachon', 200), -(16300, 198, 1384, 'Aubiac', 'Aubiac', 300), -(16301, 198, 1384, 'Blanquefort', 'Blanquefort', 400), -(16302, 198, 1384, 'Bordeaux', 'Bordeaux', 500), -(16303, 198, 1384, 'Cadillac', 'Cadillac', 600), -(16304, 198, 1384, 'Carbon-Blanc', 'Carbon-Blanc', 700), -(16305, 198, 1384, 'Langon', 'Langon', 800), -(16306, 198, 1385, 'Bollwiller', 'Bollwiller', 100), -(16307, 198, 1385, 'Colmar', 'Colmar', 200), -(16308, 198, 1385, 'Illzach', 'Illzach', 300), -(16309, 198, 1385, 'Mulhouse', 'Mulhouse', 400), -(16310, 198, 1385, 'Riedisheim', 'Riedisheim', 500), -(16311, 198, 1385, 'Saint-Amarin', 'Saint-Amarin', 600), -(16312, 198, 1385, 'Saint-Louis', 'Saint-Louis', 700), -(16313, 198, 1385, 'Thann', 'Thann', 800), -(16314, 198, 1386, 'Arbas', 'Arbas', 100), -(16315, 198, 1386, 'Colomiers', 'Colomiers', 200), -(16316, 198, 1386, 'Lavalette', 'Lavalette', 300), -(16317, 198, 1386, 'Lourde', 'Lourde', 400), -(16318, 198, 1386, 'Menville', 'Menville', 500), -(16319, 198, 1386, 'Muret', 'Muret', 600), -(16320, 198, 1386, 'Toulouse', 'Toulouse', 700), -(16321, 198, 1387, 'Beaux', 'Beaux', 100), -(16322, 198, 1387, 'Langeac', 'Langeac', 200), -(16323, 198, 1387, 'Le Puy-en-Velay', 'Le Puy-en-Velay', 300), -(16324, 198, 1387, 'Sainte-Florine', 'Sainte-Florine', 400), -(16325, 198, 1389, 'Amage', 'Amage', 100), -(16326, 198, 1390, 'Annecy', 'Annecy', 100), -(16327, 198, 1390, 'Annemasse', 'Annemasse', 200), -(16328, 198, 1390, 'Chamonix-Mont-Blanc', 'Chamonix-Mont-Blanc', 300), -(16329, 198, 1390, 'Cluses', 'Cluses', 400), -(16330, 198, 1390, 'Douvaine', 'Douvaine', 500), -(16331, 198, 1390, 'Saint-Julien-en-Genevois', 'Saint-Julien-en-Genevois', 600), -(16332, 198, 1390, 'Veigy-Foncenex', 'Veigy-Foncenex', 700), -(16333, 198, 1390, 'vian-les-Bains', 'vian-les-Bains', 800), -(16334, 198, 1391, 'Aixe-sur-Vienne', 'Aixe-sur-Vienne', 100), -(16335, 198, 1391, 'Couzeix', 'Couzeix', 200), -(16336, 198, 1391, 'Limoges', 'Limoges', 300), -(16337, 198, 1392, 'Claret', 'Claret', 100), -(16338, 198, 1392, 'Gap', 'Gap', 200), -(16339, 198, 1392, 'Orcires', 'Orcires', 300), -(16340, 198, 1392, 'Vallouise', 'Vallouise', 400), -(16341, 198, 1393, 'Arn', 'Arn', 100), -(16342, 198, 1393, 'Lannemezan', 'Lannemezan', 200), -(16343, 198, 1393, 'Lourdes', 'Lourdes', 300), -(16344, 198, 1393, 'Maulon-Barousse', 'Maulon-Barousse', 400), -(16345, 198, 1393, 'Tarbes', 'Tarbes', 500), -(16346, 198, 1393, 'Vic-en-Bigorre', 'Vic-en-Bigorre', 600), -(16347, 198, 1394, 'Bois-Colombes', 'Bois-Colombes', 100), -(16348, 198, 1394, 'Boulogne-Billancourt', 'Boulogne-Billancourt', 200), -(16349, 198, 1394, 'Bourg-la-Reine', 'Bourg-la-Reine', 300), -(16350, 198, 1394, 'Nanterre', 'Nanterre', 400), -(16351, 198, 1394, 'Neuilly-sur-Seine', 'Neuilly-sur-Seine', 500), -(16352, 198, 1394, 'Puteaux', 'Puteaux', 600), -(16353, 198, 1394, 'Saint-Cloud', 'Saint-Cloud', 700), -(16354, 198, 1395, 'Agde', 'Agde', 100), -(16355, 198, 1395, 'Bdarieux', 'Bdarieux', 200), -(16356, 198, 1395, 'Bziers', 'Bziers', 300), -(16357, 198, 1395, 'La Grande Motte', 'La Grande Motte', 400), -(16358, 198, 1395, 'Montpellier', 'Montpellier', 500), -(16359, 198, 1395, 'Plaissan', 'Plaissan', 600), -(16360, 198, 1395, 'Poussan', 'Poussan', 700), -(16361, 198, 1395, 'Ste', 'Ste', 800), -(16362, 198, 1396, 'Baguer-Morvan', 'Baguer-Morvan', 100), -(16363, 198, 1396, 'Cancale', 'Cancale', 200), -(16364, 198, 1396, 'Dinard', 'Dinard', 300), -(16365, 198, 1396, 'Fougres', 'Fougres', 400), -(16366, 198, 1396, 'Gvez', 'Gvez', 500), -(16367, 198, 1396, 'Laill', 'Laill', 600), -(16368, 198, 1396, 'Rennes', 'Rennes', 700), -(16369, 198, 1396, 'Saint-Malo', 'Saint-Malo', 800), -(16370, 198, 1396, 'Vitr', 'Vitr', 900), -(16371, 198, 1397, 'Chteauroux', 'Chteauroux', 100), -(16372, 198, 1398, 'Amboise', 'Amboise', 100), -(16373, 198, 1398, 'Cormery', 'Cormery', 200), -(16374, 198, 1398, 'Saint-Martin-le-Beau', 'Saint-Martin-le-Beau', 300), -(16375, 198, 1398, 'Tours', 'Tours', 400), -(16376, 198, 1399, 'Bourgoin-Jallieu', 'Bourgoin-Jallieu', 100), -(16377, 198, 1399, 'Grenoble', 'Grenoble', 200), -(16378, 198, 1400, 'Abergement-le-Petit', 'Abergement-le-Petit', 100), -(16379, 198, 1400, 'Besain', 'Besain', 200), -(16380, 198, 1400, 'Biarne', 'Biarne', 300), -(16381, 198, 1400, 'Dole', 'Dole', 400), -(16382, 198, 1400, 'Lains', 'Lains', 500), -(16383, 198, 1400, 'Lons-le-Saunier', 'Lons-le-Saunier', 600), -(16384, 198, 1400, 'Tavaux', 'Tavaux', 700), -(16385, 198, 1401, 'Aire-sur-l''Adour', 'Aire-sur-l''Adour', 100), -(16386, 198, 1401, 'Azur', 'Azur', 200), -(16387, 198, 1401, 'Mont-de-Marsan', 'Mont-de-Marsan', 300), -(16388, 198, 1401, 'Saint-Michel-Escalus', 'Saint-Michel-Escalus', 400), -(16389, 198, 1402, 'Arville', 'Arville', 100), -(16390, 198, 1402, 'Blois', 'Blois', 200), -(16391, 198, 1402, 'Romorantin-Lanthenay', 'Romorantin-Lanthenay', 300), -(16392, 198, 1403, 'Bard', 'Bard', 100), -(16393, 198, 1403, 'La Gresle', 'La Gresle', 200), -(16394, 198, 1403, 'La Valla', 'La Valla', 300), -(16395, 198, 1403, 'La Versanne', 'La Versanne', 400), -(16396, 198, 1403, 'Lay', 'Lay', 500), -(16397, 198, 1403, 'Mably', 'Mably', 600), -(16398, 198, 1403, 'Roanne', 'Roanne', 700), -(16399, 198, 1403, 'Saint-tienne', 'Saint-tienne', 800), -(16400, 198, 1404, 'Abbaretz', 'Abbaretz', 100), -(16401, 198, 1404, 'Ancenis', 'Ancenis', 200), -(16402, 198, 1404, 'Casson', 'Casson', 300), -(16403, 198, 1404, 'La Baule-Escoublac', 'La Baule-Escoublac', 400), -(16404, 198, 1404, 'La Roche-Blanche', 'La Roche-Blanche', 500), -(16405, 198, 1404, 'Nantes', 'Nantes', 600), -(16406, 198, 1404, 'Pornic', 'Pornic', 700), -(16407, 198, 1404, 'Port-Saint-Pre', 'Port-Saint-Pre', 800), -(16408, 198, 1404, 'Saint-Lyphard', 'Saint-Lyphard', 900), -(16409, 198, 1404, 'Saint-Nazaire', 'Saint-Nazaire', 1000), -(16410, 198, 1405, 'Chapelon', 'Chapelon', 100), -(16411, 198, 1405, 'Gien', 'Gien', 200), -(16412, 198, 1405, 'Montargis', 'Montargis', 300), -(16413, 198, 1405, 'Orlans', 'Orlans', 400), -(16414, 198, 1406, 'Baladou', 'Baladou', 100), -(16415, 198, 1406, 'Cahors', 'Cahors', 200), -(16416, 198, 1406, 'Figeac', 'Figeac', 300), -(16417, 198, 1406, 'Vers', 'Vers', 400), -(16418, 198, 1407, 'Agen', 'Agen', 100), -(16419, 198, 1407, 'Estillac', 'Estillac', 200), -(16420, 198, 1407, 'Laroque-Timbaut', 'Laroque-Timbaut', 300), -(16421, 198, 1408, 'Langogne', 'Langogne', 100), -(16422, 198, 1408, 'Malbouzon', 'Malbouzon', 200), -(16423, 198, 1408, 'Mende', 'Mende', 300), -(16424, 198, 1409, 'Angers', 'Angers', 100), -(16425, 198, 1409, 'Avrill', 'Avrill', 200), -(16426, 198, 1409, 'Cholet', 'Cholet', 300), -(16427, 198, 1409, 'Saumur', 'Saumur', 400), -(16428, 198, 1410, 'Cherbourg', 'Cherbourg', 100), -(16429, 198, 1410, 'Margueray', 'Margueray', 200), -(16430, 198, 1410, 'Pirou', 'Pirou', 300), -(16431, 198, 1410, 'Saint-L', 'Saint-L', 400), -(16432, 198, 1410, 'Tamerville', 'Tamerville', 500), -(16433, 198, 1411, 'Ay', 'Ay', 100), -(16434, 198, 1411, 'Chlons-en-Champagne', 'Chlons-en-Champagne', 200), -(16435, 198, 1411, 'Cormontreuil', 'Cormontreuil', 300), -(16436, 198, 1411, 'pernay', 'pernay', 400), -(16437, 198, 1411, 'Reims', 'Reims', 500), -(16438, 198, 1411, 'Soudron', 'Soudron', 600), -(16439, 198, 1412, 'Laval', 'Laval', 100), -(16440, 198, 1412, 'Montenay', 'Montenay', 200), -(16441, 198, 1413, 'Avril', 'Avril', 100), -(16442, 198, 1413, 'Batilly', 'Batilly', 200), -(16443, 198, 1413, 'Laneuveville-devant-Nancy', 'Laneuveville-devant-Nancy', 300), -(16444, 198, 1413, 'Longwy', 'Longwy', 400), -(16445, 198, 1413, 'Nancy', 'Nancy', 500), -(16446, 198, 1414, 'Montsec', 'Montsec', 100), -(16447, 198, 1414, 'tain', 'tain', 200), -(16448, 198, 1415, 'Ambon', 'Ambon', 100), -(16449, 198, 1415, 'Baden', 'Baden', 200), -(16450, 198, 1415, 'Hennebont', 'Hennebont', 300), -(16451, 198, 1415, 'Larmor-Plage', 'Larmor-Plage', 400), -(16452, 198, 1415, 'Lorient', 'Lorient', 500), -(16453, 198, 1415, 'Pontivy', 'Pontivy', 600), -(16454, 198, 1415, 'Vannes', 'Vannes', 700), -(16455, 198, 1416, 'Amnville', 'Amnville', 100), -(16456, 198, 1416, 'Ancerville', 'Ancerville', 200), -(16457, 198, 1416, 'Beux', 'Beux', 300), -(16458, 198, 1416, 'Forbach', 'Forbach', 400), -(16459, 198, 1416, 'Hayange', 'Hayange', 500), -(16460, 198, 1416, 'Holling', 'Holling', 600), -(16461, 198, 1416, 'Longeville-ls-Saint-Avold', 'Longeville-ls-Saint-Avold', 700), -(16462, 198, 1416, 'Marsal', 'Marsal', 800), -(16463, 198, 1416, 'Marsilly', 'Marsilly', 900), -(16464, 198, 1416, 'Metz', 'Metz', 1000), -(16465, 198, 1416, 'Porcelette', 'Porcelette', 1100), -(16466, 198, 1416, 'Sarreguemines', 'Sarreguemines', 1200), -(16467, 198, 1416, 'Stiring-Wendel', 'Stiring-Wendel', 1300), -(16468, 198, 1416, 'Thimonville', 'Thimonville', 1400), -(16469, 198, 1416, 'Thionville', 'Thionville', 1500), -(16470, 198, 1417, 'Bry', 'Bry', 100), -(16471, 198, 1417, 'Cambrai', 'Cambrai', 200), -(16472, 198, 1417, 'Cartignies', 'Cartignies', 300), -(16473, 198, 1417, 'Cassel', 'Cassel', 400), -(16474, 198, 1417, 'Denain', 'Denain', 500), -(16475, 198, 1417, 'Douai', 'Douai', 600), -(16476, 198, 1417, 'Dunkerque', 'Dunkerque', 700), -(16477, 198, 1417, 'Lille', 'Lille', 800), -(16478, 198, 1417, 'Roubaix', 'Roubaix', 900), -(16479, 198, 1417, 'Tourcoing', 'Tourcoing', 1000), -(16480, 198, 1417, 'Valenciennes', 'Valenciennes', 1100), -(16481, 198, 1417, 'Villeneuve-d''Ascq', 'Villeneuve-d''Ascq', 1200), -(16482, 198, 1418, 'Abbecourt', 'Abbecourt', 100), -(16483, 198, 1418, 'Beauvais', 'Beauvais', 200), -(16484, 198, 1418, 'Chantilly', 'Chantilly', 300), -(16485, 198, 1418, 'Compigne', 'Compigne', 400), -(16486, 198, 1418, 'Litz', 'Litz', 500), -(16487, 198, 1418, 'Marseille-en-Beauvaisis', 'Marseille-en-Beauvaisis', 600), -(16488, 198, 1418, 'Nogent-sur-Oise', 'Nogent-sur-Oise', 700), -(16489, 198, 1418, 'Noyon', 'Noyon', 800), -(16490, 198, 1419, 'Alenon', 'Alenon', 100), -(16491, 198, 1419, 'Bagnoles-de-l''Orne', 'Bagnoles-de-l''Orne', 200), -(16492, 198, 1420, 'Paris', 'Paris', 100), -(16493, 198, 1421, 'Arras', 'Arras', 100), -(16494, 198, 1421, 'Boulogne-sur-Mer', 'Boulogne-sur-Mer', 200), -(16495, 198, 1421, 'Calais', 'Calais', 300), -(16496, 198, 1421, 'Le Parcq', 'Le Parcq', 400), -(16497, 198, 1421, 'Lens', 'Lens', 500), -(16498, 198, 1421, 'taples', 'taples', 600), -(16499, 198, 1422, 'Aulnat', 'Aulnat', 100), -(16500, 198, 1422, 'Bourg-Lastic', 'Bourg-Lastic', 200), -(16501, 198, 1422, 'Chas', 'Chas', 300), -(16502, 198, 1422, 'Clermont-Ferrand', 'Clermont-Ferrand', 400), -(16503, 198, 1422, 'Cournon-d''Auvergne', 'Cournon-d''Auvergne', 500), -(16504, 198, 1423, 'Anglet', 'Anglet', 100), -(16505, 198, 1423, 'Bastans', 'Bastans', 200), -(16506, 198, 1423, 'Bayonne', 'Bayonne', 300), -(16507, 198, 1423, 'Biarritz', 'Biarritz', 400), -(16508, 198, 1423, 'Billre', 'Billre', 500), -(16509, 198, 1423, 'Hendaye', 'Hendaye', 600), -(16510, 198, 1423, 'Oloron-Sainte-Marie', 'Oloron-Sainte-Marie', 700), -(16511, 198, 1423, 'Pau', 'Pau', 800), -(16512, 198, 1423, 'Saint-Esteben', 'Saint-Esteben', 900), -(16513, 198, 1423, 'Sus', 'Sus', 1000), -(16514, 198, 1424, 'Baillestavy', 'Baillestavy', 100), -(16515, 198, 1424, 'Canet-Plage', 'Canet-Plage', 200), -(16516, 198, 1424, 'Oms', 'Oms', 300), -(16517, 198, 1424, 'Perpignan', 'Perpignan', 400), -(16518, 198, 1424, 'Pia', 'Pia', 500), -(16519, 198, 1424, 'Saint-Laurent-de-Cerdans', 'Saint-Laurent-de-Cerdans', 600), -(16520, 198, 1424, 'Thuir', 'Thuir', 700), -(16521, 198, 1424, 'Toulouges', 'Toulouges', 800), -(16522, 198, 1425, 'Alix', 'Alix', 100), -(16523, 198, 1425, 'Ancy', 'Ancy', 200), -(16524, 198, 1425, 'Bron', 'Bron', 300), -(16525, 198, 1425, 'Caluire-et-Cuire', 'Caluire-et-Cuire', 400), -(16526, 198, 1425, 'Limas', 'Limas', 500), -(16527, 198, 1425, 'Lyon', 'Lyon', 600), -(16528, 198, 1425, 'Meyzieu', 'Meyzieu', 700), -(16529, 198, 1425, 'Saint-Didier-au-Mont-d''Or', 'Saint-Didier-au-Mont-d''Or', 800), -(16530, 198, 1425, 'Saint-tienne-des-Oullires', 'Saint-tienne-des-Oullires', 900), -(16531, 198, 1425, 'Taluyers', 'Taluyers', 1000), -(16532, 198, 1425, 'Vernaison', 'Vernaison', 1100), -(16533, 198, 1425, 'Villefranche-sur-Sane', 'Villefranche-sur-Sane', 1200), -(16534, 198, 1425, 'Vnissieux', 'Vnissieux', 1300), -(16535, 198, 1426, 'Autun', 'Autun', 100), -(16536, 198, 1426, 'Charbonnires', 'Charbonnires', 200), -(16537, 198, 1426, 'Mcon', 'Mcon', 300), -(16538, 198, 1426, 'Paray-le-Monial', 'Paray-le-Monial', 400), -(16539, 198, 1427, 'Aix-les-Bains', 'Aix-les-Bains', 100), -(16540, 198, 1427, 'Albertville', 'Albertville', 200), -(16541, 198, 1427, 'Bourdeau', 'Bourdeau', 300), -(16542, 198, 1427, 'Chambry', 'Chambry', 400), -(16543, 198, 1427, 'Courchevel', 'Courchevel', 500), -(16544, 198, 1427, 'Saint-Andr', 'Saint-Andr', 600), -(16545, 198, 1428, 'Amponville', 'Amponville', 100), -(16546, 198, 1428, 'Chelles', 'Chelles', 200), -(16547, 198, 1428, 'Coulommiers', 'Coulommiers', 300), -(16548, 198, 1428, 'Fontainebleau', 'Fontainebleau', 400), -(16549, 198, 1428, 'Melun', 'Melun', 500), -(16550, 198, 1429, 'Le Havre', 'Le Havre', 100), -(16551, 198, 1429, 'Rouen', 'Rouen', 200), -(16552, 198, 1429, 'tretat', 'tretat', 300), -(16553, 198, 1429, 'Vieux-Manoir', 'Vieux-Manoir', 400), -(16554, 198, 1430, 'Drancy', 'Drancy', 100), -(16555, 198, 1430, 'Gournay-sur-Marne', 'Gournay-sur-Marne', 200), -(16556, 198, 1430, 'Le Blanc-Mesnil', 'Le Blanc-Mesnil', 300), -(16557, 198, 1430, 'Neuilly-Plaisance', 'Neuilly-Plaisance', 400), -(16558, 198, 1430, 'Pantin', 'Pantin', 500), -(16559, 198, 1430, 'Saint-Denis', 'Saint-Denis', 600), -(16560, 198, 1430, 'Stains', 'Stains', 700), -(16561, 198, 1431, 'Abbeville', 'Abbeville', 100), -(16562, 198, 1431, 'Amiens', 'Amiens', 200), -(16563, 198, 1431, 'Digeon', 'Digeon', 300), -(16564, 198, 1432, 'Albi', 'Albi', 100), -(16565, 198, 1432, 'Gaillac', 'Gaillac', 200), -(16566, 198, 1432, 'Le Vintrou', 'Le Vintrou', 300), -(16567, 198, 1432, 'Viane', 'Viane', 400), -(16568, 198, 1433, 'Bouloc', 'Bouloc', 100), -(16569, 198, 1433, 'Moissac', 'Moissac', 200), -(16570, 198, 1433, 'Montauban', 'Montauban', 300), -(16571, 198, 1434, 'Bavilliers', 'Bavilliers', 100), -(16572, 198, 1434, 'Belfort', 'Belfort', 200), -(16573, 198, 1434, 'Rchsy', 'Rchsy', 300), -(16574, 198, 1435, 'Ableiges', 'Ableiges', 100), -(16575, 198, 1435, 'Arnouville-ls-Gonesse', 'Arnouville-ls-Gonesse', 200), -(16576, 198, 1436, 'Ablon-sur-Seine', 'Ablon-sur-Seine', 100), -(16577, 198, 1436, 'Alfortville', 'Alfortville', 200), -(16578, 198, 1436, 'Choisy-le-Roi', 'Choisy-le-Roi', 300), -(16579, 198, 1436, 'Ivry-sur-Seine', 'Ivry-sur-Seine', 400), -(16580, 198, 1436, 'Limeil-Brvannes', 'Limeil-Brvannes', 500), -(16581, 198, 1436, 'Maisons-Alfort', 'Maisons-Alfort', 600), -(16582, 198, 1436, 'Orly', 'Orly', 700), -(16583, 198, 1436, 'Saint-Maur-des-Fosss', 'Saint-Maur-des-Fosss', 800), -(16584, 198, 1436, 'Vincennes', 'Vincennes', 900), -(16585, 198, 1437, 'Draguignan', 'Draguignan', 100), -(16586, 198, 1437, 'Frjus', 'Frjus', 200), -(16587, 198, 1437, 'Gassin', 'Gassin', 300), -(16588, 198, 1437, 'Hyres', 'Hyres', 400), -(16589, 198, 1437, 'La Londe-les-Maures', 'La Londe-les-Maures', 500), -(16590, 198, 1437, 'Le Beausset', 'Le Beausset', 600), -(16591, 198, 1437, 'Le Lavandou', 'Le Lavandou', 700), -(16592, 198, 1437, 'Saint-Maximin-la-Sainte-Baume', 'Saint-Maximin-la-Sainte-Baume', 800), -(16593, 198, 1437, 'Saint-Raphal', 'Saint-Raphal', 900), -(16594, 198, 1437, 'Saint-Tropez', 'Saint-Tropez', 1000), -(16595, 198, 1437, 'Sanary-sur-Mer', 'Sanary-sur-Mer', 1100), -(16596, 198, 1437, 'Toulon', 'Toulon', 1200), -(16597, 198, 1438, 'Apt', 'Apt', 100), -(16598, 198, 1438, 'Avignon', 'Avignon', 200), -(16599, 198, 1438, 'Bonnieux', 'Bonnieux', 300), -(16600, 198, 1438, 'L''Isle-sur-la-Sorgue', 'L''Isle-sur-la-Sorgue', 400), -(16601, 198, 1438, 'Montfavet', 'Montfavet', 500), -(16602, 198, 1438, 'Orange', 'Orange', 600), -(16603, 198, 1438, 'Saint-Christol', 'Saint-Christol', 700), -(16604, 198, 1439, 'Angles', 'Angles', 100), -(16605, 198, 1439, 'Chavagnes-les-Redoux', 'Chavagnes-les-Redoux', 200), -(16606, 198, 1439, 'La Roche-sur-Yon', 'La Roche-sur-Yon', 300), -(16607, 198, 1439, 'Les Sables-d''Olonne', 'Les Sables-d''Olonne', 400), -(16608, 198, 1439, 'Saint-Prouant', 'Saint-Prouant', 500), -(16609, 198, 1439, 'Vix', 'Vix', 600), -(16610, 198, 1440, 'Chtellerault', 'Chtellerault', 100), -(16611, 198, 1440, 'Genay', 'Genay', 200), -(16612, 198, 1440, 'Poitiers', 'Poitiers', 300), -(16613, 198, 1440, 'Saint-Saviol', 'Saint-Saviol', 400), -(16614, 198, 1441, 'pinal', 'pinal', 100), -(16615, 198, 1441, 'Remiremont', 'Remiremont', 200), -(16616, 198, 1441, 'Vittel', 'Vittel', 300), -(16617, 198, 1442, 'Angely', 'Angely', 100), -(16618, 198, 1442, 'Auxerre', 'Auxerre', 200), -(16619, 198, 1442, 'Villeneuve-sur-Yonne', 'Villeneuve-sur-Yonne', 300), -(16620, 198, 1442, 'Yrouerre', 'Yrouerre', 400), -(16621, 198, 1443, 'La Celle-Saint-Cloud', 'La Celle-Saint-Cloud', 100), -(16622, 198, 1443, 'La Verrire', 'La Verrire', 200), -(16623, 198, 1443, 'Le Vsinet', 'Le Vsinet', 300), -(16624, 198, 1443, 'Marly-le-Roi', 'Marly-le-Roi', 400), -(16625, 198, 1443, 'Rambouillet', 'Rambouillet', 500), -(16626, 198, 1443, 'Verneuil-sur-Seine', 'Verneuil-sur-Seine', 600), -(16627, 198, 1443, 'Versailles', 'Versailles', 700), -(16628, 198, 1443, 'Vert', 'Vert', 800), -(16629, 199, 1444, 'Cayenne', 'Cayenne', 100), -(16630, 199, 1444, 'Kourou', 'Kourou', 200), -(16631, 199, 1444, 'Sinnamary', 'Sinnamary', 300), -(16632, 200, 1445, 'Папеэте', 'Папеэте', 100), -(16633, 201, 1446, 'Dubrovnik', 'Dubrovnik', 100), -(16634, 201, 1447, 'Adamovec', 'Adamovec', 100), -(16635, 201, 1447, 'Dubrava', 'Dubrava', 200), -(16636, 201, 1447, 'Sesvete', 'Sesvete', 300), -(16637, 201, 1447, 'Zabreg', 'Zabreg', 400), -(16638, 201, 1447, 'Zagrabia', 'Zagrabia', 500), -(16639, 201, 1447, 'Zagreb', 'Zagreb', 600), -(16640, 201, 1448, 'Abrega', 'Abrega', 100), -(16641, 201, 1448, 'Materada', 'Materada', 200), -(16642, 201, 1448, 'Opatija', 'Opatija', 300), -(16643, 201, 1448, 'Pazin', 'Pazin', 400), -(16644, 201, 1448, 'Porec', 'Porec', 500), -(16645, 201, 1448, 'Rovinj', 'Rovinj', 600), -(16646, 201, 1449, 'Karlovac', 'Karlovac', 100), -(16647, 201, 1450, 'Cakovec', 'Cakovec', 100), -(16648, 201, 1450, 'Nedelisce', 'Nedelisce', 200), -(16649, 201, 1451, 'Pula', 'Pula', 100), -(16650, 201, 1452, 'Barusic', 'Barusic', 100), -(16651, 201, 1452, 'Opatija', 'Opatija', 200), -(16652, 201, 1452, 'Rijeka', 'Rijeka', 300), -(16653, 201, 1453, 'Sebenico', 'Sebenico', 100), -(16654, 201, 1453, 'Sibenik', 'Sibenik', 200), -(16655, 201, 1454, 'Cesko Selo', 'Cesko Selo', 100), -(16656, 201, 1454, 'Sisak', 'Sisak', 200), -(16657, 201, 1455, 'Spalato', 'Spalato', 100), -(16658, 201, 1455, 'Split', 'Split', 200), -(16659, 201, 1456, 'Varazdin', 'Varazdin', 100), -(16660, 201, 1457, 'Dubrava', 'Dubrava', 100), -(16661, 201, 1457, 'Topolje', 'Topolje', 200), -(16662, 201, 1457, 'Vrbovec', 'Vrbovec', 300), -(16663, 201, 1457, 'Zadar', 'Zadar', 400), -(16664, 201, 1457, 'Zara', 'Zara', 500), -(16665, 202, 1458, 'Абеше', 'Abeshe', 100), -(16666, 202, 1458, 'Ларжо', 'Karzho', 200), -(16667, 202, 1458, 'Нджамена', 'Ndzhamena', 300), -(16668, 203, 1459, 'Бар', 'Bar', 100), -(16669, 203, 1459, 'Будва', 'Budva', 200), -(16670, 203, 1459, 'Колашин', 'Kolasin', 300), -(16671, 203, 1459, 'Подгорица', 'Podgorica', 400), -(16672, 203, 1459, 'Тиват', 'Tivat', 500), -(16673, 203, 1459, 'Херцег-Нови', 'Herceg-Novi', 600), -(16674, 203, 1459, 'Цетинье', 'Cetinje', 700), -(16675, 204, 1460, 'Praha', 'Praha', 100), -(16676, 204, 1461, 'Bhmisch Budweis', 'Bhmisch Budweis', 100), -(16677, 204, 1461, 'Budejovice', 'Budejovice', 200), -(16678, 204, 1461, 'Budweis', 'Budweis', 300), -(16679, 204, 1461, 'Ceske Budejovice', 'Ceske Budejovice', 400), -(16680, 204, 1461, 'Ceske Krumlov', 'Ceske Krumlov', 500), -(16681, 204, 1461, 'Cesky Krumlov', 'Cesky Krumlov', 600), -(16682, 204, 1461, 'Krummau', 'Krummau', 700), -(16683, 204, 1461, 'Prachatice', 'Prachatice', 800), -(16684, 204, 1461, 'Prachatitz', 'Prachatitz', 900), -(16685, 204, 1461, 'Psek', 'Psek', 1000), -(16686, 204, 1461, 'Strakonice', 'Strakonice', 1100), -(16687, 204, 1461, 'Tbor', 'Tbor', 1200), -(16688, 204, 1462, 'Berno', 'Berno', 100), -(16689, 204, 1462, 'Blansko', 'Blansko', 200), -(16690, 204, 1462, 'Breclav', 'Breclav', 300), -(16691, 204, 1462, 'Brnn', 'Brnn', 400), -(16692, 204, 1462, 'Brno', 'Brno', 500), -(16693, 204, 1462, 'Hodonn', 'Hodonn', 600), -(16694, 204, 1462, 'Vyskov', 'Vyskov', 700), -(16695, 204, 1462, 'Znojmo', 'Znojmo', 800), -(16696, 204, 1463, 'Carlsbad', 'Carlsbad', 100), -(16697, 204, 1463, 'Cheb', 'Cheb', 200), -(16698, 204, 1463, 'Eger', 'Eger', 300), -(16699, 204, 1463, 'Falkenau', 'Falkenau', 400), -(16700, 204, 1463, 'Falknov', 'Falknov', 500), -(16701, 204, 1463, 'Karl Vary', 'Karl Vary', 600), -(16702, 204, 1463, 'Karlovy Vary', 'Karlovy Vary', 700), -(16703, 204, 1463, 'Karlsbad', 'Karlsbad', 800), -(16704, 204, 1463, 'Sokolov', 'Sokolov', 900), -(16705, 204, 1463, 'Sokolov nad Ohri', 'Sokolov nad Ohri', 1000), -(16706, 204, 1464, 'Gradets Kralove', 'Gradets Kralove', 100), -(16707, 204, 1464, 'Hradec Krlov', 'Hradec Krlov', 200), -(16708, 204, 1464, 'Jicin', 'Jicin', 300), -(16709, 204, 1464, 'Nchod', 'Nchod', 400), -(16710, 204, 1464, 'Reichenau', 'Reichenau', 500), -(16711, 204, 1464, 'Rychnov nad Kneznou', 'Rychnov nad Kneznou', 600), -(16712, 204, 1464, 'Trutnov', 'Trutnov', 700), -(16713, 204, 1465, 'Ceska Lipa', 'Ceska Lipa', 100), -(16714, 204, 1465, 'Jablonec', 'Jablonec', 200), -(16715, 204, 1465, 'Jablonec nad Nisou', 'Jablonec nad Nisou', 300), -(16716, 204, 1465, 'Liberec', 'Liberec', 400), -(16717, 204, 1465, 'Lipa', 'Lipa', 500), -(16718, 204, 1465, 'Reichenberg', 'Reichenberg', 600), -(16719, 204, 1465, 'Semily', 'Semily', 700), -(16720, 204, 1466, 'Bruntl', 'Bruntl', 100), -(16721, 204, 1466, 'Frdek-Mstek', 'Frdek-Mstek', 200), -(16722, 204, 1466, 'Freistadt', 'Freistadt', 300), -(16723, 204, 1466, 'Karvin', 'Karvin', 400), -(16724, 204, 1466, 'Novy Jicin', 'Novy Jicin', 500), -(16725, 204, 1466, 'Opava', 'Opava', 600), -(16726, 204, 1466, 'Ostrava', 'Ostrava', 700), -(16727, 204, 1467, 'Abaschin', 'Abaschin', 100), -(16728, 204, 1467, 'Adlerova Hut', 'Adlerova Hut', 200), -(16729, 204, 1467, 'Brno-Kralovo', 'Brno-Kralovo', 300), -(16730, 204, 1467, 'Filz', 'Filz', 400), -(16731, 204, 1467, 'Jablonn nad Orlic', 'Jablonn nad Orlic', 500), -(16732, 204, 1467, 'Kladno', 'Kladno', 600), -(16733, 204, 1467, 'Krupka', 'Krupka', 700), -(16734, 204, 1467, 'Mal Skla', 'Mal Skla', 800), -(16735, 204, 1467, 'Prague-Vinohrady', 'Prague-Vinohrady', 900), -(16736, 204, 1467, 'Pretin', 'Pretin', 1000), -(16737, 204, 1467, 'Raabe', 'Raabe', 1100), -(16738, 204, 1467, 'Vsebor', 'Vsebor', 1200), -(16739, 204, 1468, 'Jesenk', 'Jesenk', 100), -(16740, 204, 1468, 'Olomouc', 'Olomouc', 200), -(16741, 204, 1468, 'Prerov', 'Prerov', 300), -(16742, 204, 1468, 'Prostejov', 'Prostejov', 400), -(16743, 204, 1468, 'Sumperk', 'Sumperk', 500), -(16744, 204, 1469, 'Chrudim', 'Chrudim', 100), -(16745, 204, 1469, 'Pardubice', 'Pardubice', 200), -(16746, 204, 1469, 'Pardubitz', 'Pardubitz', 300), -(16747, 204, 1469, 'st nad Orlic', 'st nad Orlic', 400), -(16748, 204, 1469, 'Svitave', 'Svitave', 500), -(16749, 204, 1470, 'Domazlice', 'Domazlice', 100), -(16750, 204, 1470, 'Klatovy', 'Klatovy', 200), -(16751, 204, 1470, 'Pilsen', 'Pilsen', 300), -(16752, 204, 1470, 'Plzen', 'Plzen', 400), -(16753, 204, 1470, 'Rokycan', 'Rokycan', 500), -(16754, 204, 1470, 'Rokycany', 'Rokycany', 600), -(16755, 204, 1470, 'Tachov', 'Tachov', 700), -(16756, 204, 1471, 'Benesov', 'Benesov', 100), -(16757, 204, 1471, 'Beroun', 'Beroun', 200), -(16758, 204, 1471, 'Kladno', 'Kladno', 300), -(16759, 204, 1471, 'Koln', 'Koln', 400), -(16760, 204, 1471, 'Kutn Hora', 'Kutn Hora', 500), -(16761, 204, 1471, 'Melnik', 'Melnik', 600), -(16762, 204, 1471, 'Mlad Boleslav', 'Mlad Boleslav', 700), -(16763, 204, 1471, 'Nimburg', 'Nimburg', 800), -(16764, 204, 1471, 'Nymburk', 'Nymburk', 900), -(16765, 204, 1471, 'Pribram', 'Pribram', 1000), -(16766, 204, 1471, 'Rakovnk', 'Rakovnk', 1100), -(16767, 204, 1472, 'Aussig', 'Aussig', 100), -(16768, 204, 1472, 'Chomutov', 'Chomutov', 200), -(16769, 204, 1472, 'Decin', 'Decin', 300), -(16770, 204, 1472, 'Litomerice', 'Litomerice', 400), -(16771, 204, 1472, 'Louny', 'Louny', 500), -(16772, 204, 1472, 'Most', 'Most', 600), -(16773, 204, 1472, 'st', 'st', 700), -(16774, 204, 1472, 'st nad Labem', 'st nad Labem', 800), -(16775, 204, 1472, 'Teplice', 'Teplice', 900), -(16776, 204, 1472, 'Teplice-Sanov', 'Teplice-Sanov', 1000), -(16777, 204, 1473, 'Deutsch Brod', 'Deutsch Brod', 100), -(16778, 204, 1473, 'Havlickuv Brod', 'Havlickuv Brod', 200), -(16779, 204, 1473, 'Jihlava', 'Jihlava', 300), -(16780, 204, 1473, 'Pelhrimov', 'Pelhrimov', 400), -(16781, 204, 1473, 'Pilgram', 'Pilgram', 500), -(16782, 204, 1473, 'Trebic', 'Trebic', 600), -(16783, 204, 1473, 'Zdar', 'Zdar', 700), -(16784, 204, 1473, 'Zdar nad Sazavou', 'Zdar nad Sazavou', 800), -(16785, 204, 1474, 'Gottwaldov', 'Gottwaldov', 100), -(16786, 204, 1474, 'Kromeriz', 'Kromeriz', 200), -(16787, 204, 1474, 'Uherske Hradiste', 'Uherske Hradiste', 300), -(16788, 204, 1474, 'Vsetn', 'Vsetn', 400), -(16789, 204, 1474, 'Wszetyn', 'Wszetyn', 500), -(16790, 204, 1474, 'Zln', 'Zln', 600), -(16791, 205, 1475, 'Coihaique', 'Coihaique', 100), -(16792, 205, 1475, 'Coyhaique', 'Coyhaique', 200), -(16793, 205, 1476, 'Antofagasta', 'Antofagasta', 100), -(16794, 205, 1477, 'Pucn', 'Pucn', 100), -(16795, 205, 1477, 'Temuco', 'Temuco', 200), -(16796, 205, 1478, 'Copiap', 'Copiap', 100), -(16797, 205, 1479, 'Boca Bo-Bo', 'Boca Bo-Bo', 100), -(16798, 205, 1479, 'Cabrero', 'Cabrero', 200), -(16799, 205, 1479, 'Cajn de Mela', 'Cajn de Mela', 300), -(16800, 205, 1479, 'Callaqui', 'Callaqui', 400), -(16801, 205, 1479, 'Chilln', 'Chilln', 500), -(16802, 205, 1479, 'Ciudad de Concepcion', 'Ciudad de Concepcion', 600); -INSERT INTO `prefix_geo_city` (`id`, `country_id`, `region_id`, `name_ru`, `name_en`, `sort`) VALUES -(16803, 205, 1479, 'Concepcin', 'Concepcin', 700), -(16804, 205, 1479, 'Lota Alto', 'Lota Alto', 800), -(16805, 205, 1479, 'Quirihue', 'Quirihue', 900), -(16806, 205, 1480, 'Algarrobo', 'Algarrobo', 100), -(16807, 205, 1480, 'Illapel', 'Illapel', 200), -(16808, 205, 1480, 'La Serena', 'La Serena', 300), -(16809, 205, 1480, 'Ovalle', 'Ovalle', 400), -(16810, 205, 1480, 'Vicua', 'Vicua', 500), -(16811, 205, 1481, 'Codegua', 'Codegua', 100), -(16812, 205, 1481, 'Isla del Guindo', 'Isla del Guindo', 200), -(16813, 205, 1481, 'Peumo', 'Peumo', 300), -(16814, 205, 1481, 'Rancagua', 'Rancagua', 400), -(16815, 205, 1481, 'San Vicente de Taguatagua', 'San Vicente de Taguatagua', 500), -(16816, 205, 1482, 'Aguas Buenas', 'Aguas Buenas', 100), -(16817, 205, 1482, 'Ancud', 'Ancud', 200), -(16818, 205, 1482, 'Antillanca', 'Antillanca', 300), -(16819, 205, 1482, 'California', 'California', 400), -(16820, 205, 1482, 'Castro', 'Castro', 500), -(16821, 205, 1482, 'Osorno', 'Osorno', 600), -(16822, 205, 1482, 'Pichil', 'Pichil', 700), -(16823, 205, 1482, 'Puerto Montt', 'Puerto Montt', 800), -(16824, 205, 1482, 'Valdivia', 'Valdivia', 900), -(16825, 205, 1483, 'Magallanes', 'Magallanes', 100), -(16826, 205, 1483, 'Punta Arenas', 'Punta Arenas', 200), -(16827, 205, 1484, 'Baos de Panimvida', 'Baos de Panimvida', 100), -(16828, 205, 1484, 'Caliboro', 'Caliboro', 200), -(16829, 205, 1484, 'Talca', 'Talca', 300), -(16830, 205, 1485, 'CiudadSantiago', 'CiudadSantiago', 100), -(16831, 205, 1485, 'La Florida', 'La Florida', 200), -(16832, 205, 1485, 'La Granja', 'La Granja', 300), -(16833, 205, 1485, 'La Reina', 'La Reina', 400), -(16834, 205, 1485, 'Lampa', 'Lampa', 500), -(16835, 205, 1485, 'Maip', 'Maip', 600), -(16836, 205, 1485, 'Pealoln', 'Pealoln', 700), -(16837, 205, 1485, 'Puente Alto', 'Puente Alto', 800), -(16838, 205, 1485, 'Quilicura', 'Quilicura', 900), -(16839, 205, 1485, 'San Bernardo', 'San Bernardo', 1000), -(16840, 205, 1485, 'San Joaqun', 'San Joaqun', 1100), -(16841, 205, 1485, 'Santiago', 'Santiago', 1200), -(16842, 205, 1485, 'uoa', 'uoa', 1300), -(16843, 205, 1486, 'Alto del Molino', 'Alto del Molino', 100), -(16844, 205, 1486, 'Arica', 'Arica', 200), -(16845, 205, 1486, 'Iquique', 'Iquique', 300), -(16846, 205, 1487, 'Calera', 'Calera', 100), -(16847, 205, 1487, 'Peablanca', 'Peablanca', 200), -(16848, 205, 1487, 'Placilla de Peuelas', 'Placilla de Peuelas', 300), -(16849, 205, 1487, 'Putaendo', 'Putaendo', 400), -(16850, 205, 1487, 'Quilpu', 'Quilpu', 500), -(16851, 205, 1487, 'San Antonio', 'San Antonio', 600), -(16852, 205, 1487, 'Valparaso', 'Valparaso', 700), -(16853, 205, 1487, 'Via del Mar', 'Via del Mar', 800), -(16854, 206, 1488, 'Aarau', 'Aarau', 100), -(16855, 206, 1488, 'Aarburg', 'Aarburg', 200), -(16856, 206, 1488, 'Baden', 'Baden', 300), -(16857, 206, 1488, 'Birr', 'Birr', 400), -(16858, 206, 1488, 'Dttingen', 'Dttingen', 500), -(16859, 206, 1488, 'Frick', 'Frick', 600), -(16860, 206, 1488, 'Kaiseraugst', 'Kaiseraugst', 700), -(16861, 206, 1488, 'Lenzburg', 'Lenzburg', 800), -(16862, 206, 1488, 'Mellingen', 'Mellingen', 900), -(16863, 206, 1488, 'Menziken', 'Menziken', 1000), -(16864, 206, 1488, 'Merenschwand', 'Merenschwand', 1100), -(16865, 206, 1488, 'Mumpf', 'Mumpf', 1200), -(16866, 206, 1488, 'Niederlenz', 'Niederlenz', 1300), -(16867, 206, 1488, 'Oberentfelden', 'Oberentfelden', 1400), -(16868, 206, 1488, 'Oberrti', 'Oberrti', 1500), -(16869, 206, 1488, 'Rheinfelden', 'Rheinfelden', 1600), -(16870, 206, 1488, 'Seengen', 'Seengen', 1700), -(16871, 206, 1488, 'Sins', 'Sins', 1800), -(16872, 206, 1488, 'Stilli', 'Stilli', 1900), -(16873, 206, 1488, 'Suhr', 'Suhr', 2000), -(16874, 206, 1488, 'Turgi', 'Turgi', 2100), -(16875, 206, 1488, 'Villmergen', 'Villmergen', 2200), -(16876, 206, 1488, 'Wettingen', 'Wettingen', 2300), -(16877, 206, 1488, 'Wrenlingen', 'Wrenlingen', 2400), -(16878, 206, 1488, 'Zofingen', 'Zofingen', 2500), -(16879, 206, 1489, 'Gais', 'Gais', 100), -(16880, 206, 1489, 'Heiden', 'Heiden', 200), -(16881, 206, 1489, 'Herisau', 'Herisau', 300), -(16882, 206, 1489, 'Zrchersmhle', 'Zrchersmhle', 400), -(16883, 206, 1490, 'Appenzell', 'Appenzell', 100), -(16884, 206, 1490, 'Gonten', 'Gonten', 200), -(16885, 206, 1491, 'Allschwil', 'Allschwil', 100), -(16886, 206, 1491, 'Arisdorf', 'Arisdorf', 200), -(16887, 206, 1491, 'Arlesheim', 'Arlesheim', 300), -(16888, 206, 1491, 'Binningen', 'Binningen', 400), -(16889, 206, 1491, 'Ettingen', 'Ettingen', 500), -(16890, 206, 1491, 'Frenkendorf', 'Frenkendorf', 600), -(16891, 206, 1491, 'Laufen', 'Laufen', 700), -(16892, 206, 1491, 'Liestal', 'Liestal', 800), -(16893, 206, 1491, 'Mnchenstein', 'Mnchenstein', 900), -(16894, 206, 1491, 'Muttenz', 'Muttenz', 1000), -(16895, 206, 1491, 'Sissach', 'Sissach', 1100), -(16896, 206, 1492, 'Basel', 'Basel', 100), -(16897, 206, 1492, 'Bettingen', 'Bettingen', 200), -(16898, 206, 1493, 'Arch', 'Arch', 100), -(16899, 206, 1493, 'Bellelay', 'Bellelay', 200), -(16900, 206, 1493, 'Belp', 'Belp', 300), -(16901, 206, 1493, 'Bern', 'Bern', 400), -(16902, 206, 1493, 'Biglen', 'Biglen', 500), -(16903, 206, 1493, 'Boll', 'Boll', 600), -(16904, 206, 1493, 'Brienzwiler', 'Brienzwiler', 700), -(16905, 206, 1493, 'Corgmont', 'Corgmont', 800), -(16906, 206, 1493, 'Heimenschwand', 'Heimenschwand', 900), -(16907, 206, 1493, 'Herzogenbuchsee', 'Herzogenbuchsee', 1000), -(16908, 206, 1493, 'Huttwil', 'Huttwil', 1100), -(16909, 206, 1493, 'Interlaken', 'Interlaken', 1200), -(16910, 206, 1493, 'Langenthal', 'Langenthal', 1300), -(16911, 206, 1493, 'Lotzwil', 'Lotzwil', 1400), -(16912, 206, 1493, 'Lyss', 'Lyss', 1500), -(16913, 206, 1493, 'Mrigen', 'Mrigen', 1600), -(16914, 206, 1493, 'Nidau', 'Nidau', 1700), -(16915, 206, 1493, 'Steffisburg', 'Steffisburg', 1800), -(16916, 206, 1493, 'Thun', 'Thun', 1900), -(16917, 206, 1493, 'Uttigen', 'Uttigen', 2000), -(16918, 206, 1493, 'Zweiltschinen', 'Zweiltschinen', 2100), -(16919, 206, 1494, 'Barberche', 'Barberche', 100), -(16920, 206, 1494, 'Bulle', 'Bulle', 200), -(16921, 206, 1494, 'Cheyres', 'Cheyres', 300), -(16922, 206, 1494, 'Fribourg', 'Fribourg', 400), -(16923, 206, 1495, 'Bellevue', 'Bellevue', 100), -(16924, 206, 1495, 'Bernex', 'Bernex', 200), -(16925, 206, 1495, 'Chambsy', 'Chambsy', 300), -(16926, 206, 1495, 'Chancy', 'Chancy', 400), -(16927, 206, 1495, 'Chne-Bougeries', 'Chne-Bougeries', 500), -(16928, 206, 1495, 'Collonge-Bellerive', 'Collonge-Bellerive', 600), -(16929, 206, 1495, 'Cologny', 'Cologny', 700), -(16930, 206, 1495, 'Confignon', 'Confignon', 800), -(16931, 206, 1495, 'Genf', 'Genf', 900), -(16932, 206, 1495, 'Hermance', 'Hermance', 1000), -(16933, 206, 1495, 'Jussy', 'Jussy', 1100), -(16934, 206, 1495, 'La Praille', 'La Praille', 1200), -(16935, 206, 1495, 'Le Grand-Saconnex', 'Le Grand-Saconnex', 1300), -(16936, 206, 1495, 'Meyrin', 'Meyrin', 1400), -(16937, 206, 1495, 'Onex', 'Onex', 1500), -(16938, 206, 1495, 'Plan-les-Ouates', 'Plan-les-Ouates', 1600), -(16939, 206, 1495, 'Russin', 'Russin', 1700), -(16940, 206, 1495, 'Vernier', 'Vernier', 1800), -(16941, 206, 1495, 'Versoix', 'Versoix', 1900), -(16942, 206, 1495, 'Vsenaz', 'Vsenaz', 2000), -(16943, 206, 1496, 'Filzbach', 'Filzbach', 100), -(16944, 206, 1496, 'Matt', 'Matt', 200), -(16945, 206, 1496, 'Mollis', 'Mollis', 300), -(16946, 206, 1497, 'Ardez', 'Ardez', 100), -(16947, 206, 1497, 'Bivio', 'Bivio', 200), -(16948, 206, 1497, 'Chur', 'Chur', 300), -(16949, 206, 1497, 'Davos Platz', 'Davos Platz', 400), -(16950, 206, 1497, 'Klosters', 'Klosters', 500), -(16951, 206, 1497, 'Pontresina', 'Pontresina', 600), -(16952, 206, 1497, 'Poschiavo', 'Poschiavo', 700), -(16953, 206, 1497, 'Samedan', 'Samedan', 800), -(16954, 206, 1497, 'Sils im Domleschg', 'Sils im Domleschg', 900), -(16955, 206, 1497, 'Silvaplana', 'Silvaplana', 1000), -(16956, 206, 1498, 'Alle', 'Alle', 100), -(16957, 206, 1498, 'Delmont', 'Delmont', 200), -(16958, 206, 1498, 'La Chaux-des-Breuleux', 'La Chaux-des-Breuleux', 300), -(16959, 206, 1499, 'Ballwil', 'Ballwil', 100), -(16960, 206, 1499, 'Dagmersellen', 'Dagmersellen', 200), -(16961, 206, 1499, 'Doppleschwand', 'Doppleschwand', 300), -(16962, 206, 1499, 'Ebikon', 'Ebikon', 400), -(16963, 206, 1499, 'Eich', 'Eich', 500), -(16964, 206, 1499, 'Emmen', 'Emmen', 600), -(16965, 206, 1499, 'Gelfingen', 'Gelfingen', 700), -(16966, 206, 1499, 'Kriens', 'Kriens', 800), -(16967, 206, 1499, 'Luthern', 'Luthern', 900), -(16968, 206, 1499, 'Luzern', 'Luzern', 1000), -(16969, 206, 1499, 'Nottwil', 'Nottwil', 1100), -(16970, 206, 1499, 'Sursee', 'Sursee', 1200), -(16971, 206, 1500, 'La Chaux-de-Fonds', 'La Chaux-de-Fonds', 100), -(16972, 206, 1500, 'Le Landeron', 'Le Landeron', 200), -(16973, 206, 1500, 'Marin-Epagnier', 'Marin-Epagnier', 300), -(16974, 206, 1500, 'Neuchtel', 'Neuchtel', 400), -(16975, 206, 1501, 'Beckenried', 'Beckenried', 100), -(16976, 206, 1501, 'Kehrsiten', 'Kehrsiten', 200), -(16977, 206, 1501, 'Stans', 'Stans', 300), -(16978, 206, 1502, 'Grafenort', 'Grafenort', 100), -(16979, 206, 1503, 'Bad Ragaz', 'Bad Ragaz', 100), -(16980, 206, 1503, 'Flawil', 'Flawil', 200), -(16981, 206, 1503, 'Flums', 'Flums', 300), -(16982, 206, 1503, 'Gams', 'Gams', 400), -(16983, 206, 1503, 'Goldach', 'Goldach', 500), -(16984, 206, 1503, 'Gommiswald', 'Gommiswald', 600), -(16985, 206, 1503, 'Heerbrugg', 'Heerbrugg', 700), -(16986, 206, 1503, 'Jona', 'Jona', 800), -(16987, 206, 1503, 'Lichtensteig', 'Lichtensteig', 900), -(16988, 206, 1503, 'Niederuzwil', 'Niederuzwil', 1000), -(16989, 206, 1503, 'Rheineck', 'Rheineck', 1100), -(16990, 206, 1503, 'Rorschacherberg', 'Rorschacherberg', 1200), -(16991, 206, 1503, 'Sargans', 'Sargans', 1300), -(16992, 206, 1503, 'Uzwil', 'Uzwil', 1400), -(16993, 206, 1503, 'Wittenbach', 'Wittenbach', 1500), -(16994, 206, 1504, 'Beringen', 'Beringen', 100), -(16995, 206, 1504, 'Schaffhausen', 'Schaffhausen', 200), -(16996, 206, 1505, 'Altendorf', 'Altendorf', 100), -(16997, 206, 1505, 'Brunnen', 'Brunnen', 200), -(16998, 206, 1505, 'Einsiedeln', 'Einsiedeln', 300), -(16999, 206, 1505, 'Sattel', 'Sattel', 400), -(17000, 206, 1505, 'Schindellegi', 'Schindellegi', 500), -(17001, 206, 1505, 'Schwyz', 'Schwyz', 600), -(17002, 206, 1506, 'Egerkingen', 'Egerkingen', 100), -(17003, 206, 1506, 'Gerlafingen', 'Gerlafingen', 200), -(17004, 206, 1506, 'Grenchen', 'Grenchen', 300), -(17005, 206, 1506, 'Halten', 'Halten', 400), -(17006, 206, 1506, 'Obergsgen', 'Obergsgen', 500), -(17007, 206, 1506, 'Olten', 'Olten', 600), -(17008, 206, 1506, 'Solothurn', 'Solothurn', 700), -(17009, 206, 1507, 'Amriswil', 'Amriswil', 100), -(17010, 206, 1507, 'Arbon', 'Arbon', 200), -(17011, 206, 1507, 'Egnach', 'Egnach', 300), -(17012, 206, 1507, 'Frauenfeld', 'Frauenfeld', 400), -(17013, 206, 1507, 'Kreuzlingen', 'Kreuzlingen', 500), -(17014, 206, 1507, 'Romanshorn', 'Romanshorn', 600), -(17015, 206, 1507, 'Schlattingen', 'Schlattingen', 700), -(17016, 206, 1507, 'Steckborn', 'Steckborn', 800), -(17017, 206, 1508, 'Agno', 'Agno', 100), -(17018, 206, 1508, 'Ascona', 'Ascona', 200), -(17019, 206, 1508, 'Bellinzona', 'Bellinzona', 300), -(17020, 206, 1508, 'Locarno', 'Locarno', 400), -(17021, 206, 1508, 'Lugano', 'Lugano', 500), -(17022, 206, 1508, 'Stabio', 'Stabio', 600), -(17023, 206, 1508, 'Tenero', 'Tenero', 700), -(17024, 206, 1509, 'Erstfeld', 'Erstfeld', 100), -(17025, 206, 1509, 'Intschi', 'Intschi', 200), -(17026, 206, 1509, 'Realp', 'Realp', 300), -(17027, 206, 1509, 'Rtli', 'Rtli', 400), -(17028, 206, 1509, 'Sisikon', 'Sisikon', 500), -(17029, 206, 1510, 'Arolla', 'Arolla', 100), -(17030, 206, 1510, 'Brig', 'Brig', 200), -(17031, 206, 1510, 'Collombey', 'Collombey', 300), -(17032, 206, 1510, 'Leukerbad', 'Leukerbad', 400), -(17033, 206, 1510, 'Monthey', 'Monthey', 500), -(17034, 206, 1510, 'Sierre', 'Sierre', 600), -(17035, 206, 1510, 'Sion', 'Sion', 700), -(17036, 206, 1511, 'Ballaigues', 'Ballaigues', 100), -(17037, 206, 1511, 'Belmont-sur-Lausanne', 'Belmont-sur-Lausanne', 200), -(17038, 206, 1511, 'Chexbres', 'Chexbres', 300), -(17039, 206, 1511, 'Epalinges', 'Epalinges', 400), -(17040, 206, 1511, 'Gryon', 'Gryon', 500), -(17041, 206, 1511, 'Lausanne', 'Lausanne', 600), -(17042, 206, 1511, 'Leysin', 'Leysin', 700), -(17043, 206, 1511, 'Montreux', 'Montreux', 800), -(17044, 206, 1511, 'Nyon', 'Nyon', 900), -(17045, 206, 1511, 'Rolle', 'Rolle', 1000), -(17046, 206, 1511, 'Vevey', 'Vevey', 1100), -(17047, 206, 1511, 'Yens', 'Yens', 1200), -(17048, 206, 1511, 'Yverdon', 'Yverdon', 1300), -(17049, 206, 1512, 'Adliswil', 'Adliswil', 100), -(17050, 206, 1512, 'Affoltern am Albis', 'Affoltern am Albis', 200), -(17051, 206, 1512, 'Bassersdorf', 'Bassersdorf', 300), -(17052, 206, 1512, 'Bauma', 'Bauma', 400), -(17053, 206, 1512, 'Blach', 'Blach', 500), -(17054, 206, 1512, 'Brtten', 'Brtten', 600), -(17055, 206, 1512, 'Dbendorf', 'Dbendorf', 700), -(17056, 206, 1512, 'Dielsdorf', 'Dielsdorf', 800), -(17057, 206, 1512, 'Dietikon', 'Dietikon', 900), -(17058, 206, 1512, 'Dietlikon', 'Dietlikon', 1000), -(17059, 206, 1512, 'Feldbach', 'Feldbach', 1100), -(17060, 206, 1512, 'Hombrechtikon', 'Hombrechtikon', 1200), -(17061, 206, 1512, 'Horgen', 'Horgen', 1300), -(17062, 206, 1512, 'Kloten', 'Kloten', 1400), -(17063, 206, 1512, 'Lindau', 'Lindau', 1500), -(17064, 206, 1512, 'Mnnedorf', 'Mnnedorf', 1600), -(17065, 206, 1512, 'Stfa', 'Stfa', 1700), -(17066, 206, 1512, 'Thalwil', 'Thalwil', 1800), -(17067, 206, 1512, 'Uetliberg', 'Uetliberg', 1900), -(17068, 206, 1512, 'Wdenswil', 'Wdenswil', 2000), -(17069, 206, 1512, 'Winterthur', 'Winterthur', 2100), -(17070, 206, 1512, 'Zrich', 'Zrich', 2200), -(17071, 206, 1512, 'Zumikon', 'Zumikon', 2300), -(17072, 206, 1513, 'Baar', 'Baar', 100), -(17073, 206, 1513, 'Cham', 'Cham', 200), -(17074, 206, 1513, 'Rotkreuz', 'Rotkreuz', 300), -(17075, 206, 1513, 'Zug', 'Zug', 400), -(17076, 207, 1514, 'Abborremla', 'Abborremla', 100), -(17077, 207, 1514, 'Asarum', 'Asarum', 200), -(17078, 207, 1514, 'Backaryd', 'Backaryd', 300), -(17079, 207, 1514, 'Karlshamn', 'Karlshamn', 400), -(17080, 207, 1514, 'Karlskrona', 'Karlskrona', 500), -(17081, 207, 1514, 'Kylinge', 'Kylinge', 600), -(17082, 207, 1514, 'lmtamla', 'lmtamla', 700), -(17083, 207, 1514, 'Olofstrm', 'Olofstrm', 800), -(17084, 207, 1514, 'Rdeby', 'Rdeby', 900), -(17085, 207, 1514, 'Ronneby', 'Ronneby', 1000), -(17086, 207, 1514, 'Slvesborg', 'Slvesborg', 1100), -(17087, 207, 1515, 'Avesta', 'Avesta', 100), -(17088, 207, 1515, 'Bodarna', 'Bodarna', 200), -(17089, 207, 1515, 'Borlnge', 'Borlnge', 300), -(17090, 207, 1515, 'Falun', 'Falun', 400), -(17091, 207, 1515, 'Gagnef', 'Gagnef', 500), -(17092, 207, 1515, 'Grngesberg', 'Grngesberg', 600), -(17093, 207, 1515, 'Hedemora', 'Hedemora', 700), -(17094, 207, 1515, 'Hkberget', 'Hkberget', 800), -(17095, 207, 1515, 'Ludvika', 'Ludvika', 900), -(17096, 207, 1515, 'Mora-Noret', 'Mora-Noret', 1000), -(17097, 207, 1516, 'Bollns', 'Bollns', 100), -(17098, 207, 1516, 'Delsbo', 'Delsbo', 200), -(17099, 207, 1516, 'Gfle', 'Gfle', 300), -(17100, 207, 1516, 'Gvle', 'Gvle', 400), -(17101, 207, 1516, 'Hudiksvall', 'Hudiksvall', 500), -(17102, 207, 1516, 'Ljusdal', 'Ljusdal', 600), -(17103, 207, 1516, 'Sandviken', 'Sandviken', 700), -(17104, 207, 1516, 'Sderhamn', 'Sderhamn', 800), -(17105, 207, 1516, 'Valbo', 'Valbo', 900), -(17106, 207, 1517, 'Alby', 'Alby', 100), -(17107, 207, 1517, 'Roma', 'Roma', 200), -(17108, 207, 1517, 'Visby', 'Visby', 300), -(17109, 207, 1518, 'Abild', 'Abild', 100), -(17110, 207, 1518, 'Allared', 'Allared', 200), -(17111, 207, 1518, 'Falkenberg', 'Falkenberg', 300), -(17112, 207, 1518, 'Halmstad', 'Halmstad', 400), -(17113, 207, 1518, 'Hyltebruk', 'Hyltebruk', 500), -(17114, 207, 1518, 'ker', 'ker', 600), -(17115, 207, 1518, 'Kpinge', 'Kpinge', 700), -(17116, 207, 1518, 'Kungsbacka', 'Kungsbacka', 800), -(17117, 207, 1518, 'Varberg', 'Varberg', 900), -(17118, 207, 1519, 'lven', 'lven', 100), -(17119, 207, 1519, 'stersund', 'stersund', 200), -(17120, 207, 1519, 'Stockholm', 'Stockholm', 300), -(17121, 207, 1520, 'Bodafors', 'Bodafors', 100), -(17122, 207, 1520, 'Eksj', 'Eksj', 200), -(17123, 207, 1520, 'Gislaved', 'Gislaved', 300), -(17124, 207, 1520, 'Huskvarna', 'Huskvarna', 400), -(17125, 207, 1520, 'Jnkping', 'Jnkping', 500), -(17126, 207, 1520, 'Nssj', 'Nssj', 600), -(17127, 207, 1520, 'Trans', 'Trans', 700), -(17128, 207, 1520, 'Vetlanda', 'Vetlanda', 800), -(17129, 207, 1520, 'Vrnamo', 'Vrnamo', 900), -(17130, 207, 1521, 'Aboda', 'Aboda', 100), -(17131, 207, 1521, 'Borsna', 'Borsna', 200), -(17132, 207, 1521, 'Degerhamn', 'Degerhamn', 300), -(17133, 207, 1521, 'Hgsby', 'Hgsby', 400), -(17134, 207, 1521, 'Hultsfred', 'Hultsfred', 500), -(17135, 207, 1521, 'Kalmar', 'Kalmar', 600), -(17136, 207, 1521, 'Malm', 'Malm', 700), -(17137, 207, 1521, 'Mrlunda', 'Mrlunda', 800), -(17138, 207, 1521, 'Oskarshamn', 'Oskarshamn', 900), -(17139, 207, 1521, 'Vimmerby', 'Vimmerby', 1000), -(17140, 207, 1521, 'Vstervik', 'Vstervik', 1100), -(17141, 207, 1522, 'latorp', 'latorp', 100), -(17142, 207, 1522, 'Ljungby', 'Ljungby', 200), -(17143, 207, 1522, 'lmehult', 'lmehult', 300), -(17144, 207, 1522, 'Markaryd', 'Markaryd', 400), -(17145, 207, 1522, 'Vexi', 'Vexi', 500), -(17146, 207, 1522, 'Vxj', 'Vxj', 600), -(17147, 207, 1523, 'Brmsebro', 'Brmsebro', 100), -(17148, 207, 1523, 'Linds', 'Linds', 200), -(17149, 207, 1523, 'Lindshammar', 'Lindshammar', 300), -(17150, 207, 1523, 'Sylarna', 'Sylarna', 400), -(17151, 207, 1524, 'Boden', 'Boden', 100), -(17152, 207, 1524, 'Bodn', 'Bodn', 200), -(17153, 207, 1524, 'Gllivare', 'Gllivare', 300), -(17154, 207, 1524, 'Haaparanta', 'Haaparanta', 400), -(17155, 207, 1524, 'Haparanda', 'Haparanda', 500), -(17156, 207, 1524, 'Kalix', 'Kalix', 600), -(17157, 207, 1524, 'Kallax', 'Kallax', 700), -(17158, 207, 1524, 'Kiruna', 'Kiruna', 800), -(17159, 207, 1524, 'Lappea', 'Lappea', 900), -(17160, 207, 1524, 'Lule', 'Lule', 1000), -(17161, 207, 1524, 'lvsbyn', 'lvsbyn', 1100), -(17162, 207, 1524, 'Malmberget', 'Malmberget', 1200), -(17163, 207, 1524, 'Persn', 'Persn', 1300), -(17164, 207, 1524, 'Pite', 'Pite', 1400), -(17165, 207, 1524, 'Uumaa', 'Uumaa', 1500), -(17166, 207, 1525, 'Backa', 'Backa', 100), -(17167, 207, 1525, 'Hallsberg', 'Hallsberg', 200), -(17168, 207, 1525, 'Kariskoga', 'Kariskoga', 300), -(17169, 207, 1525, 'Karlskoga', 'Karlskoga', 400), -(17170, 207, 1525, 'Lindesberg', 'Lindesberg', 500), -(17171, 207, 1525, 'Lund', 'Lund', 600), -(17172, 207, 1525, 'na', 'na', 700), -(17173, 207, 1525, 'rebro', 'rebro', 800), -(17174, 207, 1525, 'Stlldalen', 'Stlldalen', 900), -(17175, 207, 1526, 'Finspng', 'Finspng', 100), -(17176, 207, 1526, 'Linkping', 'Linkping', 200), -(17177, 207, 1526, 'Mjlby', 'Mjlby', 300), -(17178, 207, 1526, 'Motala', 'Motala', 400), -(17179, 207, 1526, 'Norrkping', 'Norrkping', 500), -(17180, 207, 1526, 'Skrblacka', 'Skrblacka', 600), -(17181, 207, 1526, 'Vadstena', 'Vadstena', 700), -(17182, 207, 1527, 'Alstad', 'Alstad', 100), -(17183, 207, 1527, 'Arlv', 'Arlv', 200), -(17184, 207, 1527, 'Bjrnholm', 'Bjrnholm', 300), -(17185, 207, 1527, 'Bromma', 'Bromma', 400), -(17186, 207, 1527, 'Eslv', 'Eslv', 500), -(17187, 207, 1527, 'Flenninge', 'Flenninge', 600), -(17188, 207, 1527, 'Helsingborg', 'Helsingborg', 700), -(17189, 207, 1527, 'Hlsingborg', 'Hlsingborg', 800), -(17190, 207, 1527, 'Hssleholm', 'Hssleholm', 900), -(17191, 207, 1527, 'hus', 'hus', 1000), -(17192, 207, 1527, 'karp', 'karp', 1100), -(17193, 207, 1527, 'Kristianstad', 'Kristianstad', 1200), -(17194, 207, 1527, 'Landskrona', 'Landskrona', 1300), -(17195, 207, 1527, 'Lund', 'Lund', 1400), -(17196, 207, 1527, 'Malm', 'Malm', 1500), -(17197, 207, 1527, 'ngelholm', 'ngelholm', 1600), -(17198, 207, 1527, 'Osby', 'Osby', 1700), -(17199, 207, 1527, 'Simrishamn', 'Simrishamn', 1800), -(17200, 207, 1527, 'Stockholm', 'Stockholm', 1900), -(17201, 207, 1527, 'storp', 'storp', 2000), -(17202, 207, 1527, 'Viken', 'Viken', 2100), -(17203, 207, 1527, 'Yxenhult', 'Yxenhult', 2200), -(17204, 207, 1528, 'Eskilstuna', 'Eskilstuna', 100), -(17205, 207, 1528, 'Flen', 'Flen', 200), -(17206, 207, 1528, 'Lundby', 'Lundby', 300), -(17207, 207, 1528, 'Nykping', 'Nykping', 400), -(17208, 207, 1528, 'Rosenlund', 'Rosenlund', 500), -(17209, 207, 1528, 'rsta', 'rsta', 600), -(17210, 207, 1528, 'Strngns', 'Strngns', 700), -(17211, 207, 1528, 'Trosa', 'Trosa', 800), -(17212, 207, 1528, 'Vingker', 'Vingker', 900), -(17213, 207, 1529, 'Abborkroken', 'Abborkroken', 100), -(17214, 207, 1529, 'Albano', 'Albano', 200), -(17215, 207, 1529, 'Alby', 'Alby', 300), -(17216, 207, 1529, 'Almvik', 'Almvik', 400), -(17217, 207, 1529, 'Alvik', 'Alvik', 500), -(17218, 207, 1529, 'Aspudden', 'Aspudden', 600), -(17219, 207, 1529, 'Backa', 'Backa', 700), -(17220, 207, 1529, 'Barkaby', 'Barkaby', 800), -(17221, 207, 1529, 'Botkyrka', 'Botkyrka', 900), -(17222, 207, 1529, 'Bro', 'Bro', 1000), -(17223, 207, 1529, 'Bromma', 'Bromma', 1100), -(17224, 207, 1529, 'by', 'by', 1200), -(17225, 207, 1529, 'dala', 'dala', 1300), -(17226, 207, 1529, 'Dalar', 'Dalar', 1400), -(17227, 207, 1529, 'Danderyd', 'Danderyd', 1500), -(17228, 207, 1529, 'Drottningholm', 'Drottningholm', 1600), -(17229, 207, 1529, 'Eriksund', 'Eriksund', 1700), -(17230, 207, 1529, 'Fagersj', 'Fagersj', 1800), -(17231, 207, 1529, 'Farsta', 'Farsta', 1900), -(17232, 207, 1529, 'Fiskstra', 'Fiskstra', 2000), -(17233, 207, 1529, 'Fittja', 'Fittja', 2100), -(17234, 207, 1529, 'Fridhem', 'Fridhem', 2200), -(17235, 207, 1529, 'Gamla Stan', 'Gamla Stan', 2300), -(17236, 207, 1529, 'Grundvik', 'Grundvik', 2400), -(17237, 207, 1529, 'Handen', 'Handen', 2500), -(17238, 207, 1529, 'Harg', 'Harg', 2600), -(17239, 207, 1529, 'Hsselby', 'Hsselby', 2700), -(17240, 207, 1529, 'Huddinge', 'Huddinge', 2800), -(17241, 207, 1529, 'Husby', 'Husby', 2900), -(17242, 207, 1529, 'Islinge', 'Islinge', 3000), -(17243, 207, 1529, 'Jakobsberg', 'Jakobsberg', 3100), -(17244, 207, 1529, 'Karlsvik', 'Karlsvik', 3200), -(17245, 207, 1529, 'kersberg', 'kersberg', 3300), -(17246, 207, 1529, 'kersberga', 'kersberga', 3400), -(17247, 207, 1529, 'keshov', 'keshov', 3500), -(17248, 207, 1529, 'Kista', 'Kista', 3600), -(17249, 207, 1529, 'Kristineberg', 'Kristineberg', 3700), -(17250, 207, 1529, 'Labben', 'Labben', 3800), -(17251, 207, 1529, 'Liding', 'Liding', 3900), -(17252, 207, 1529, 'lmora', 'lmora', 4000), -(17253, 207, 1529, 'lsten', 'lsten', 4100), -(17254, 207, 1529, 'lvsj', 'lvsj', 4200), -(17255, 207, 1529, 'Marsta', 'Marsta', 4300), -(17256, 207, 1529, 'Mrsta', 'Mrsta', 4400), -(17257, 207, 1529, 'Nacka', 'Nacka', 4500), -(17258, 207, 1529, 'Norrtelje', 'Norrtelje', 4600), -(17259, 207, 1529, 'Norsborg', 'Norsborg', 4700), -(17260, 207, 1529, 'Nynshamm', 'Nynshamm', 4800), -(17261, 207, 1529, 'Nynshamn', 'Nynshamn', 4900), -(17262, 207, 1529, 'Orninge', 'Orninge', 5000), -(17263, 207, 1529, 'Rickeby', 'Rickeby', 5100), -(17264, 207, 1529, 'Rinkeby', 'Rinkeby', 5200), -(17265, 207, 1529, 'rsta', 'rsta', 5300), -(17266, 207, 1529, 'Saln', 'Saln', 5400), -(17267, 207, 1529, 'Saltsjbaden', 'Saltsjbaden', 5500), -(17268, 207, 1529, 'Sdermalm', 'Sdermalm', 5600), -(17269, 207, 1529, 'Sdertlje', 'Sdertlje', 5700), -(17270, 207, 1529, 'Sigtuna', 'Sigtuna', 5800), -(17271, 207, 1529, 'Skrholmen', 'Skrholmen', 5900), -(17272, 207, 1529, 'Sol', 'Sol', 6000), -(17273, 207, 1529, 'Sollentuna', 'Sollentuna', 6100), -(17274, 207, 1529, 'Solna', 'Solna', 6200), -(17275, 207, 1529, 'Sotinge', 'Sotinge', 6300), -(17276, 207, 1529, 'Spnga', 'Spnga', 6400), -(17277, 207, 1529, 'stermalm', 'stermalm', 6500), -(17278, 207, 1529, 'Stockholm', 'Stockholm', 6600), -(17279, 207, 1529, 'Stocksund', 'Stocksund', 6700), -(17280, 207, 1529, 'Storholmen', 'Storholmen', 6800), -(17281, 207, 1529, 'Sundbyberg', 'Sundbyberg', 6900), -(17282, 207, 1529, 'Sundyberg', 'Sundyberg', 7000), -(17283, 207, 1529, 'Svarts', 'Svarts', 7100), -(17284, 207, 1529, 'Svedmyra', 'Svedmyra', 7200), -(17285, 207, 1529, 'Tby', 'Tby', 7300), -(17286, 207, 1529, 'Tumba', 'Tumba', 7400), -(17287, 207, 1529, 'Uplands Vsby', 'Uplands Vsby', 7500), -(17288, 207, 1529, 'Upplands-Vsby', 'Upplands-Vsby', 7600), -(17289, 207, 1529, 'Uppsala', 'Uppsala', 7700), -(17290, 207, 1529, 'Vista', 'Vista', 7800), -(17291, 207, 1529, 'Vitsand', 'Vitsand', 7900), -(17292, 207, 1529, 'Vllingby', 'Vllingby', 8000), -(17293, 207, 1529, 'Vrby', 'Vrby', 8100), -(17294, 207, 1530, 'Askskr', 'Askskr', 100), -(17295, 207, 1530, 'Blsta', 'Blsta', 200), -(17296, 207, 1530, 'dalen', 'dalen', 300), -(17297, 207, 1530, 'Enkping', 'Enkping', 400), -(17298, 207, 1530, 'Fiskvik', 'Fiskvik', 500), -(17299, 207, 1530, 'Malma', 'Malma', 600), -(17300, 207, 1530, 'Skutskr', 'Skutskr', 700), -(17301, 207, 1530, 'Tierp', 'Tierp', 800), -(17302, 207, 1530, 'Uppland', 'Uppland', 900), -(17303, 207, 1530, 'Uppsala', 'Uppsala', 1000), -(17304, 207, 1531, 'Filipstad', 'Filipstad', 100), -(17305, 207, 1531, 'Grums', 'Grums', 200), -(17306, 207, 1531, 'Hammar', 'Hammar', 300), -(17307, 207, 1531, 'Karlstad', 'Karlstad', 400), -(17308, 207, 1531, 'Kristinehamn', 'Kristinehamn', 500), -(17309, 207, 1531, 'Lesjfors', 'Lesjfors', 600), -(17310, 207, 1531, 'Linds', 'Linds', 700), -(17311, 207, 1531, 'Storfors', 'Storfors', 800), -(17312, 207, 1531, 'Vesters', 'Vesters', 900), -(17313, 207, 1532, 'Boliden', 'Boliden', 100), -(17314, 207, 1532, 'sele', 'sele', 200), -(17315, 207, 1532, 'Skellefte', 'Skellefte', 300), -(17316, 207, 1532, 'Ume', 'Ume', 400), -(17317, 207, 1533, 'Alby', 'Alby', 100), -(17318, 207, 1533, 'Almsjns', 'Almsjns', 200), -(17319, 207, 1533, 'Hrnsand', 'Hrnsand', 300), -(17320, 207, 1533, 'Husum', 'Husum', 400), -(17321, 207, 1533, 'Kramfors', 'Kramfors', 500), -(17322, 207, 1533, 'lfva', 'lfva', 600), -(17323, 207, 1533, 'Lucksta', 'Lucksta', 700), -(17324, 207, 1533, 'nge', 'nge', 800), -(17325, 207, 1533, 'rnskldsvik', 'rnskldsvik', 900), -(17326, 207, 1533, 'Sundsvall', 'Sundsvall', 1000), -(17327, 207, 1534, 'Aberga', 'Aberga', 100), -(17328, 207, 1534, 'Arboga', 'Arboga', 200), -(17329, 207, 1534, 'Fagersta', 'Fagersta', 300), -(17330, 207, 1534, 'Kping', 'Kping', 400), -(17331, 207, 1534, 'Olsta', 'Olsta', 500), -(17332, 207, 1534, 'Sala', 'Sala', 600), -(17333, 207, 1534, 'vestbo', 'vestbo', 700), -(17334, 207, 1534, 'Vsters', 'Vsters', 800), -(17335, 207, 1535, '', '', 100), -(17336, 207, 1535, 'Bengtsfors', 'Bengtsfors', 200), -(17337, 207, 1535, 'Bjurdammen', 'Bjurdammen', 300), -(17338, 207, 1535, 'Borrs', 'Borrs', 400), -(17339, 207, 1535, 'Bors', 'Bors', 500), -(17340, 207, 1535, 'Fly', 'Fly', 600), -(17341, 207, 1535, 'Goeteborg', 'Goeteborg', 700), -(17342, 207, 1535, 'Goteburg', 'Goteburg', 800), -(17343, 207, 1535, 'Gothenburg', 'Gothenburg', 900), -(17344, 207, 1535, 'Gteborg', 'Gteborg', 1000), -(17345, 207, 1535, 'Gtene', 'Gtene', 1100), -(17346, 207, 1535, 'Kunglv', 'Kunglv', 1200), -(17347, 207, 1535, 'Lidkping', 'Lidkping', 1300), -(17348, 207, 1535, 'Malm', 'Malm', 1400), -(17349, 207, 1535, 'Mariestad', 'Mariestad', 1500), -(17350, 207, 1535, 'Mlndal', 'Mlndal', 1600), -(17351, 207, 1535, 'Skene', 'Skene', 1700), -(17352, 207, 1535, 'Skepplanda', 'Skepplanda', 1800), -(17353, 207, 1535, 'Skvde', 'Skvde', 1900), -(17354, 207, 1535, 'Strmstad', 'Strmstad', 2000), -(17355, 207, 1535, 'Svinesund', 'Svinesund', 2100), -(17356, 207, 1535, 'Trollhttan', 'Trollhttan', 2200), -(17357, 207, 1535, 'Uddevalla', 'Uddevalla', 2300), -(17358, 207, 1535, 'Ulricehamn', 'Ulricehamn', 2400), -(17359, 207, 1535, 'Vnersborg', 'Vnersborg', 2500), -(17360, 207, 1535, 'Ytterstad', 'Ytterstad', 2600), -(17361, 208, 1536, 'Коломбо', 'Kolombo', 100), -(17362, 209, 1537, 'Cuenca', 'Cuenca', 100), -(17363, 209, 1538, 'Asuncin', 'Asuncin', 100), -(17364, 209, 1538, 'Bilovn', 'Bilovn', 200), -(17365, 209, 1539, 'Riobamba', 'Riobamba', 100), -(17366, 209, 1540, 'Alvarez', 'Alvarez', 100), -(17367, 209, 1540, 'Machala', 'Machala', 200), -(17368, 209, 1541, 'Puerto Ayora', 'Puerto Ayora', 100), -(17369, 209, 1542, 'Alfredo Baquerizo Moreno', 'Alfredo Baquerizo Moreno', 100), -(17370, 209, 1542, 'Bella Vista', 'Bella Vista', 200), -(17371, 209, 1542, 'Durn', 'Durn', 300), -(17372, 209, 1542, 'Guayaquil', 'Guayaquil', 400), -(17373, 209, 1542, 'Salinas', 'Salinas', 500), -(17374, 209, 1543, 'Ibarra', 'Ibarra', 100), -(17375, 209, 1544, 'Loja', 'Loja', 100), -(17376, 209, 1545, 'Manta', 'Manta', 100), -(17377, 209, 1545, 'Montecristi', 'Montecristi', 200), -(17378, 209, 1545, 'Portoviejo', 'Portoviejo', 300), -(17379, 209, 1545, 'Rocafuerte', 'Rocafuerte', 400), -(17380, 209, 1546, 'C.J. Arosemena Tola', 'C.J. Arosemena Tola', 100), -(17381, 209, 1547, 'Amazonas', 'Amazonas', 100), -(17382, 209, 1548, 'Arcadia', 'Arcadia', 100), -(17383, 209, 1548, 'Machachi', 'Machachi', 200), -(17384, 209, 1548, 'Quinche', 'Quinche', 300), -(17385, 209, 1548, 'Quito', 'Quito', 400), -(17386, 209, 1548, 'Santo Domingo de los Colorados', 'Santo Domingo de los Colorados', 500), -(17387, 209, 1549, 'Baos', 'Baos', 100), -(17388, 209, 1549, 'Benigno Vela', 'Benigno Vela', 200), -(17389, 209, 1549, 'Bentez', 'Bentez', 300), -(17390, 210, 1550, 'Малабо', 'Малабо', 100), -(17391, 211, 1551, 'Асмара', 'Asmara', 100), -(17392, 212, 1552, 'Абья-Палуоя', 'Abya-Paluoya', 100), -(17393, 212, 1552, 'Азери', 'Azeri', 200), -(17394, 212, 1552, 'Антсла', 'Antsla', 300), -(17395, 212, 1552, 'Валга', 'Valga', 400), -(17396, 212, 1552, 'Васкнарва', 'Vasknarva', 500), -(17397, 212, 1552, 'Вильянди', 'Vilyandi', 600), -(17398, 212, 1552, 'Выру', 'Vyru', 700), -(17399, 212, 1552, 'Йыгева', 'Iygeva', 800), -(17400, 212, 1552, 'Йыхви', 'Йыхви', 900), -(17401, 212, 1552, 'Калласте', 'Kallaste', 1000), -(17402, 212, 1552, 'Кейла', 'Keila', 1100), -(17403, 212, 1552, 'Кехра', 'Kehra', 1200), -(17404, 212, 1552, 'Кивиыли', 'Kiviyli', 1300), -(17405, 212, 1552, 'Килинги', 'Kilingi', 1400), -(17406, 212, 1552, 'Килинги-Нымме', 'Kilingi-Nymme', 1500), -(17407, 212, 1552, 'Кингисепп', 'Kingisepp', 1600), -(17408, 212, 1552, 'Кохтла-Ярве', 'Kohtla-Yarve', 1700), -(17409, 212, 1552, 'Кунда', 'Кунда', 1800), -(17410, 212, 1552, 'Куресааре', 'Kuresaare', 1900), -(17411, 212, 1552, 'Кярдла', 'Kyardla', 2000), -(17412, 212, 1552, 'Муствээ', 'Mustvee', 2100), -(17413, 212, 1552, 'Мыйзакюла', 'Myizakyula', 2200), -(17414, 212, 1552, 'Нарва', 'Narva', 2300), -(17415, 212, 1552, 'Пайде', 'Paide', 2400), -(17416, 212, 1552, 'Палдиски', 'Paldiski', 2500), -(17417, 212, 1552, 'Пылва', 'Пылва', 2600), -(17418, 212, 1552, 'Пылтсамаа', 'Pyltsamaa', 2700), -(17419, 212, 1552, 'Пярну', 'Pyarnu', 2800), -(17420, 212, 1552, 'Раквере', 'Rakvere', 2900), -(17421, 212, 1552, 'Рапла', 'Rapla', 3000), -(17422, 212, 1552, 'Ряпино', 'Ряпино', 3100), -(17423, 212, 1552, 'Силламяэ', 'Sillamyae', 3200), -(17424, 212, 1552, 'Сууре-Яани', 'Suure-Yaani', 3300), -(17425, 212, 1552, 'Таллин', 'Tallin', 3400), -(17426, 212, 1552, 'Тапа', 'Tapa', 3500), -(17427, 212, 1552, 'Тарту', 'Tartu', 3600), -(17428, 212, 1552, 'Тырва', 'Tyrva', 3700), -(17429, 212, 1552, 'Хаапсалу', 'Haapsalu', 3800), -(17430, 212, 1552, 'Эльва', 'Elva', 3900), -(17431, 213, 1553, 'Аддис-Абеба', 'Addis-Abeba', 100), -(17432, 213, 1553, 'Гондэр', 'Gonder', 200), -(17433, 213, 1553, 'Дэссе', 'Desse', 300), -(17434, 214, 1554, 'Йоханесбург', 'Johannesburg', 100), -(17435, 215, 1555, 'Чею', 'Cheju', 100), -(17436, 215, 1556, 'Кунсан', 'Kunsan', 100), -(17437, 215, 1556, 'Намвон', 'Namwon', 200), -(17438, 215, 1557, 'Йосу', 'Yosu', 100), -(17439, 215, 1557, 'Мокп''о', 'Mokp''o', 200), -(17440, 215, 1557, 'Чечон', 'Chechon', 300), -(17441, 215, 1558, 'Чонгжу', 'Chongju', 100), -(17442, 215, 1558, 'Чунгжу', 'Chungju', 200), -(17443, 215, 1559, 'Асан', 'Asan', 100), -(17444, 215, 1559, 'Ч''онан', 'Ch''onan', 200), -(17445, 215, 1560, 'Инчхон', 'Incheon', 100), -(17446, 215, 1561, 'Вонжу', 'Wonju', 100), -(17447, 215, 1561, 'Кангнунг', 'Kangnun', 200), -(17448, 215, 1561, 'Тондычон', 'Тондычон', 300), -(17449, 215, 1561, 'Чунчон', 'Chunchon', 400), -(17450, 215, 1562, 'Кванчжу', 'Kwangju', 100), -(17451, 215, 1563, 'Йонгжу', 'Yeongju', 100), -(17452, 215, 1563, 'Сувон', 'Suwon', 200), -(17453, 215, 1564, 'Андонг', 'Andong', 100), -(17454, 215, 1564, 'Кионгджу', 'Kyeongju', 200), -(17455, 215, 1564, 'П''оханг', 'P''ohang', 300), -(17456, 215, 1565, 'Масан', 'Masan', 100), -(17457, 215, 1565, 'Мирианг', 'Mirang', 200), -(17458, 215, 1565, 'Чинхэ', 'Chinhe', 300), -(17459, 215, 1565, 'Чиню', 'Chinyu', 400), -(17460, 215, 1566, 'Пусан', 'Pusan', 100), -(17461, 215, 1567, 'Сеул', 'Seoul', 100), -(17462, 215, 1568, 'Тэгу', 'Taegu', 100), -(17463, 215, 1569, 'Тэджон', 'Taejeon', 100), -(17464, 215, 1570, 'Ульсан', 'Ulslan', 100), -(17465, 215, 1571, 'Кимпо', 'Kimpo', 100), -(17466, 216, 1572, 'Джава', 'Джава', 100), -(17467, 216, 1572, 'Цхинвали', 'Цхинвали', 200), -(17468, 218, 1574, 'Ичиномия', 'Ичиномия', 100), -(17469, 218, 1574, 'Касугаи', 'Касугаи', 200), -(17470, 218, 1574, 'Нагоиа', 'Нагоиа', 300), -(17471, 218, 1574, 'Оказаки', 'Оказаки', 400), -(17472, 218, 1574, 'Тойота', 'Тойота', 500), -(17473, 218, 1574, 'Тойохаши', 'Тойохаши', 600), -(17474, 218, 1575, 'Аомори', 'Аомори', 100), -(17475, 218, 1575, 'Гошогавара', 'Гошогавара', 200), -(17476, 218, 1575, 'Хачинохе', 'Хачинохе', 300), -(17477, 218, 1575, 'Хиросаки', 'Хиросаки', 400), -(17478, 218, 1576, 'Вакэйама', 'Вакэйама', 100), -(17479, 218, 1576, 'Шингу', 'Шингу', 200), -(17480, 218, 1577, 'Кириу', 'Кириу', 100), -(17481, 218, 1577, 'Маебаши', 'Маебаши', 200), -(17482, 218, 1577, 'Ота', 'Ота', 300), -(17483, 218, 1577, 'Такасаки', 'Такасаки', 400), -(17484, 218, 1578, 'Ибараки', 'Ибараки', 100), -(17485, 218, 1578, 'Мито', 'Мито', 200), -(17486, 218, 1578, 'Хитачи', 'Хитачи', 300), -(17487, 218, 1578, 'Цущиура', 'Цущиура', 400), -(17488, 218, 1579, 'Мииако', 'Мииако', 100), -(17489, 218, 1579, 'Мориока', 'Мориока', 200), -(17490, 218, 1580, 'Каназава', 'Каназава', 100), -(17491, 218, 1581, 'Каноя', 'Каноя', 100), -(17492, 218, 1582, 'Зуши', 'Зуши', 100), -(17493, 218, 1582, 'Йокогама', 'Йокогама', 200), -(17494, 218, 1582, 'Йокосука', 'Йокосука', 300), -(17495, 218, 1582, 'Камакура', 'Камакура', 400), -(17496, 218, 1582, 'Одавара', 'Одавара', 500), -(17497, 218, 1582, 'Хиратсука', 'Хиратсука', 600), -(17498, 218, 1583, 'Киото', 'Киото', 100), -(17499, 218, 1583, 'Маизуру', 'Маизуру', 200), -(17500, 218, 1583, 'Фукучииама', 'Фукучииама', 300), -(17501, 218, 1584, 'Кочи', 'Кочи', 100), -(17502, 218, 1585, 'Ишиномаки', 'Ишиномаки', 100), -(17503, 218, 1585, 'Матсушима', 'Матсушима', 200), -(17504, 218, 1585, 'Сендай', 'Сендай', 300), -(17505, 218, 1585, 'Фурукава', 'Фурукава', 400), -(17506, 218, 1586, 'Мииазаки', 'Мииазаки', 100), -(17507, 218, 1586, 'Мииаконойо', 'Мииаконойо', 200), -(17508, 218, 1587, 'Матсумото', 'Матсумото', 100), -(17509, 218, 1587, 'Нагано', 'Нагано', 200), -(17510, 218, 1587, 'Саку', 'Саку', 300), -(17511, 218, 1588, 'Исахая', 'Исахая', 100), -(17512, 218, 1588, 'Нагасаки', 'Нагасаки', 200), -(17513, 218, 1588, 'Сасэбо', 'Сасэбо', 300), -(17514, 218, 1589, 'Нара', 'Нара', 100), -(17515, 218, 1590, 'Нагаока', 'Нагаока', 100), -(17516, 218, 1590, 'Ниигата', 'Ниигата', 200), -(17517, 218, 1590, 'Цубаме', 'Цубаме', 300), -(17518, 218, 1590, 'Шибата', 'Шибата', 400), -(17519, 218, 1591, 'Окэйама', 'Окэйама', 100), -(17520, 218, 1592, 'Ишигаки', 'Ишигаки', 100), -(17521, 218, 1592, 'Наха', 'Наха', 200), -(17522, 218, 1593, 'Даито', 'Даито', 100), -(17523, 218, 1593, 'Матсубара', 'Матсубара', 200), -(17524, 218, 1593, 'Ниагава', 'Ниагава', 300), -(17525, 218, 1593, 'Осака', 'Осака', 400), -(17526, 218, 1593, 'Хираката', 'Хираката', 500), -(17527, 218, 1593, 'Яо', 'Яо', 600), -(17528, 218, 1594, 'Каратсу', 'Каратсу', 100), -(17529, 218, 1594, 'Сага', 'Сага', 200), -(17530, 218, 1595, 'Вараби', 'Вараби', 100), -(17531, 218, 1595, 'Иватсуки', 'Иватсуки', 200), -(17532, 218, 1595, 'Йоно', 'Йоно', 300), -(17533, 218, 1595, 'Кавагоэ', 'Кавагоэ', 400), -(17534, 218, 1595, 'Кавагучи', 'Кавагучи', 500), -(17535, 218, 1595, 'Кошигэйа', 'Кошигэйа', 600), -(17536, 218, 1595, 'Кумагэйа', 'Кумагэйа', 700), -(17537, 218, 1595, 'Сока', 'Сока', 800), -(17538, 218, 1595, 'Ханно', 'Ханно', 900), -(17539, 218, 1596, 'Отсу', 'Отсу', 100), -(17540, 218, 1596, 'Хикон', 'Хикон', 200), -(17541, 218, 1597, 'Атами', 'Атами', 100), -(17542, 218, 1597, 'Фуджи', 'Фуджи', 200), -(17543, 218, 1598, 'Ичикава', 'Ичикава', 100), -(17544, 218, 1598, 'Кашива', 'Кашива', 200), -(17545, 218, 1598, 'Нода', 'Нода', 300), -(17546, 218, 1598, 'Фунабаши', 'Фунабаши', 400), -(17547, 218, 1598, 'Чиба', 'Чиба', 500), -(17548, 218, 1599, 'Кодаира', 'Кодаира', 100), -(17549, 218, 1599, 'Мачида', 'Мачида', 200), -(17550, 218, 1599, 'Митака', 'Митака', 300), -(17551, 218, 1599, 'Мусашино', 'Мусашино', 400), -(17552, 218, 1599, 'Тачикава', 'Тачикава', 500), -(17553, 218, 1599, 'Токио', 'Токио', 600), -(17554, 218, 1599, 'Хачиойи', 'Хачиойи', 700), -(17555, 218, 1599, 'Хофу', 'Хофу', 800), -(17556, 218, 1600, 'Токушима', 'Токушима', 100), -(17557, 218, 1601, 'Ашикага', 'Ашикага', 100), -(17558, 218, 1601, 'Отавара', 'Отавара', 200), -(17559, 218, 1601, 'Утсуномииа', 'Утсуномииа', 300), -(17560, 218, 1602, 'Такаока', 'Такаока', 100), -(17561, 218, 1602, 'Тояма', 'Тояма', 200), -(17562, 218, 1603, 'Оно', 'Оно', 100), -(17563, 218, 1603, 'Фукуи', 'Фукуи', 200), -(17564, 218, 1604, 'Китакиушу', 'Китакиушу', 100), -(17565, 218, 1604, 'Ногата', 'Ногата', 200), -(17566, 218, 1604, 'Омута', 'Омута', 300), -(17567, 218, 1604, 'Фукуока', 'Фукуока', 400), -(17568, 218, 1605, 'Иваки', 'Иваки', 100), -(17569, 218, 1605, 'Корииама', 'Корииама', 200), -(17570, 218, 1606, 'Фукуиама', 'Фукуиама', 100), -(17571, 218, 1606, 'Хирошима', 'Хирошима', 200), -(17572, 218, 1607, 'Абашири', 'Абашири', 100), -(17573, 218, 1607, 'Асахигава', 'Асахигава', 200), -(17574, 218, 1607, 'Вакканаи', 'Вакканаи', 300), -(17575, 218, 1607, 'Китами', 'Китами', 400), -(17576, 218, 1607, 'Куширо', 'Куширо', 500), -(17577, 218, 1607, 'Обихиро', 'Обихиро', 600), -(17578, 218, 1607, 'Отару', 'Отару', 700), -(17579, 218, 1607, 'Саппоро', 'Саппоро', 800), -(17580, 218, 1607, 'Томакомаи', 'Томакомаи', 900), -(17581, 218, 1607, 'Хакодата', 'Хакодата', 1000), -(17582, 218, 1608, 'Акаши', 'Акаши', 100), -(17583, 218, 1608, 'Какогава', 'Какогава', 200), -(17584, 218, 1608, 'Химейи', 'Химейи', 300), -(17585, 218, 1609, 'Увайима', 'Увайима', 100), -(17586, 218, 1610, 'Ивакуни', 'Ивакуни', 100), -(17587, 218, 1610, 'Токуиама', 'Токуиама', 200), -(17588, 218, 1610, 'Ямагучи', 'Ямагучи', 300), -(17589, 218, 1611, 'Кофу', 'Кофу', 100); - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_geo_country` --- - -CREATE TABLE IF NOT EXISTS `prefix_geo_country` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name_ru` varchar(50) NOT NULL, - `name_en` varchar(50) NOT NULL, - `code` varchar(5) NOT NULL, - `sort` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - KEY `sort` (`sort`), - KEY `name_ru` (`name_ru`), - KEY `name_en` (`name_en`), - KEY `code` (`code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=219 ; - --- --- Дамп данных таблицы `prefix_geo_country` --- - -INSERT INTO `prefix_geo_country` (`id`, `name_ru`, `name_en`, `code`, `sort`) VALUES -(1, 'Абхазия', 'Abkhazia', 'AB', 100), -(2, 'Австралия', 'Australia', 'AU', 200), -(3, 'Австрия', 'Austria', 'AT', 300), -(4, 'Азербайджан', 'Azerbaijan', 'AZ', 400), -(5, 'Албания', 'Albania', 'AL', 500), -(6, 'Алжир', 'Algeria', 'DZ', 600), -(7, 'Ангола', 'Angola', 'AO', 700), -(8, 'Ангуилья', 'Anguilla', 'AI', 800), -(9, 'Андорра', 'Andorra', 'AD', 900), -(10, 'Антигуа и Барбуда', 'Antigua and Barbuda', 'AG', 1000), -(11, 'Антильские о-ва', 'Netherlands Antilles', 'AN', 1100), -(12, 'Аргентина', 'Argentina', 'AR', 1200), -(13, 'Армения', 'Armenia', 'AM', 1300), -(14, 'Арулько', 'Aruba', 'AW', 1400), -(15, 'Афганистан', 'Afghanistan', 'AF', 1500), -(16, 'Багамские о-ва', 'Bahamas', 'BS', 1600), -(17, 'Бангладеш', 'Bangladesh', 'BD', 1700), -(18, 'Барбадос', 'Barbados', 'BB', 1800), -(19, 'Бахрейн', 'Bahrain', 'BH', 1900), -(20, 'Беларусь', 'Belarus', 'BY', 3), -(21, 'Белиз', 'Belize', 'BZ', 2100), -(22, 'Бельгия', 'Belgium', 'BE', 2200), -(23, 'Бенин', 'Benin', 'BJ', 2300), -(24, 'Бермуды', 'Bermuda', 'BM', 2400), -(25, 'Болгария', 'Bulgaria', 'BG', 2500), -(26, 'Боливия', 'Bolivia', 'BO', 2600), -(27, 'Босния/Герцеговина', 'Bosnia and Herzegovina', 'BA', 2700), -(28, 'Ботсвана', 'Botswana', 'BW', 2800), -(29, 'Бразилия', 'Brazil', 'BR', 2900), -(30, 'Британские Виргинские о-ва', 'British Virgin Islands', 'VG', 3000), -(31, 'Бруней', 'Brunei', 'BN', 3100), -(32, 'Буркина Фасо', 'Burkina Faso', 'BF', 3200), -(33, 'Бурунди', 'Burundi', 'BI', 3300), -(34, 'Бутан', 'Bhutan', 'BT', 3400), -(35, 'Валлис и Футуна о-ва', 'Wallis and Futuna', 'WF', 3500), -(36, 'Вануату', 'Vanuatu', 'VU', 3600), -(37, 'Великобритания', 'United Kingdom', 'GB', 3700), -(38, 'Венгрия', 'Hungary', 'HU', 3800), -(39, 'Венесуэла', 'Venezuela', 'VE', 3900), -(40, 'Восточный Тимор', 'East Timor', 'TL', 4000), -(41, 'Вьетнам', 'Vietnam', 'VN', 4100), -(42, 'Габон', 'Gabon', 'GA', 4200), -(43, 'Гаити', 'Haiti', 'HT', 4300), -(44, 'Гайана', 'Guyana', 'GY', 4400), -(45, 'Гамбия', 'Gambia', 'GM', 4500), -(46, 'Гана', 'Ghana', 'GH', 4600), -(47, 'Гваделупа', 'Guadeloupe', 'GP', 4700), -(48, 'Гватемала', 'Guatemala', 'GT', 4800), -(49, 'Гвинея', 'Guinea', 'GN', 4900), -(50, 'Гвинея-Бисау', 'Guinea-Bissau', 'GW', 5000), -(51, 'Германия', 'Germany', 'DE', 5100), -(52, 'Гернси о-в', 'Guernsey', 'GG', 5200), -(53, 'Гибралтар', 'Gibraltar', 'GI', 5300), -(54, 'Гондурас', 'Honduras', 'HN', 5400), -(55, 'Гонконг', 'Hong Kong', 'HK', 5500), -(56, 'Гренада', 'Grenada', 'GD', 5600), -(57, 'Гренландия', 'Greenland', 'GL', 5700), -(58, 'Греция', 'Greece', 'GR', 5800), -(59, 'Грузия', 'Georgia', 'GE', 5900), -(60, 'Дания', 'Denmark', 'DK', 6000), -(61, 'Джерси о-в', 'Jersey', 'JE', 6100), -(62, 'Джибути', 'Djibouti', 'DJ', 6200), -(63, 'Доминиканская республика', 'Dominican Republic', 'DO', 6300), -(64, 'Египет', 'Egypt', 'EG', 6400), -(65, 'Замбия', 'Zambia', 'ZM', 6500), -(66, 'Западная Сахара', 'Western Sahara', 'EH', 6600), -(67, 'Зимбабве', 'Zimbabwe', 'ZW', 6700), -(68, 'Израиль', 'Israel', 'IL', 6800), -(69, 'Индия', 'India', 'IN', 6900), -(70, 'Индонезия', 'Indonesia', 'ID', 7000), -(71, 'Иордания', 'Jordan', 'JO', 7100), -(72, 'Ирак', 'Iraq', 'IQ', 7200), -(73, 'Иран', 'Iran', 'IR', 7300), -(74, 'Ирландия', 'Ireland', 'IE', 7400), -(75, 'Исландия', 'Iceland', 'IS', 7500), -(76, 'Испания', 'Spain', 'ES', 7600), -(77, 'Италия', 'Italy', 'IT', 7700), -(78, 'Йемен', 'Yemen', 'YE', 7800), -(79, 'Кабо-Верде', 'Cape Verde', 'CV', 7900), -(80, 'Казахстан', 'Kazakhstan', 'KZ', 8000), -(81, 'Камбоджа', 'Cambodia', 'KH', 8100), -(82, 'Камерун', 'Cameroon', 'CM', 8200), -(83, 'Канада', 'Canada', 'CA', 8300), -(84, 'Катар', 'Qatar', 'QA', 8400), -(85, 'Кения', 'Kenya', 'KE', 8500), -(86, 'Кипр', 'Cyprus', 'CY', 8600), -(87, 'Кирибати', 'Kiribati', 'KI', 8700), -(88, 'Китай', 'China', 'CN', 8800), -(89, 'Колумбия', 'Colombia', 'CO', 8900), -(90, 'Коморские о-ва', 'Comoros', 'KM', 9000), -(91, 'Конго (Brazzaville)', 'Congo (Brazzaville)', 'CG', 9100), -(92, 'Конго (Kinshasa)', 'Congo (Kinshasa)', 'CD', 9200), -(93, 'Коста-Рика', 'Costa Rica', 'CR', 9300), -(94, 'Кот-д''Ивуар', 'Cote D''Ivoire', 'CI', 9400), -(95, 'Куба', 'Cuba', 'CU', 9500), -(96, 'Кувейт', 'Kuwait', 'KW', 9600), -(97, 'Кука о-ва', 'Cook Islands', 'CK', 9700), -(98, 'Кыргызстан', 'Kyrgyzstan', 'KG', 9800), -(99, 'Лаос', 'Laos', 'LA', 9900), -(100, 'Латвия', 'Latvia', 'LV', 10000), -(101, 'Лесото', 'Lesotho', 'LS', 10100), -(102, 'Либерия', 'Liberia', 'LR', 10200), -(103, 'Ливан', 'Lebanon', 'LB', 10300), -(104, 'Ливия', 'Libya', 'LY', 10400), -(105, 'Литва', 'Lithuania', 'LT', 10500), -(106, 'Лихтенштейн', 'Liechtenstein', 'LI', 10600), -(107, 'Люксембург', 'Luxembourg', 'LU', 10700), -(108, 'Маврикий', 'Mauritius', 'MU', 10800), -(109, 'Мавритания', 'Mauritania', 'MR', 10900), -(110, 'Мадагаскар', 'Madagascar', 'MG', 11000), -(111, 'Македония', 'Macedonia', 'MK', 11100), -(112, 'Малави', 'Malawi', 'MW', 11200), -(113, 'Малайзия', 'Malaysia', 'MY', 11300), -(114, 'Мали', 'Mali', 'ML', 11400), -(115, 'Мальдивские о-ва', 'Maldives', 'MV', 11500), -(116, 'Мальта', 'Malta', 'MT', 11600), -(117, 'Марокко', 'Morocco', 'MA', 11700), -(118, 'Мартиника о-в', 'Martinique', 'MQ', 11800), -(119, 'Мексика', 'Mexico', 'MX', 11900), -(120, 'Мозамбик', 'Mozambique', 'MZ', 12000), -(121, 'Молдова', 'Moldova', 'MD', 12100), -(122, 'Монако', 'Monaco', 'MC', 12200), -(123, 'Монголия', 'Mongolia', 'MN', 12300), -(124, 'Мьянма (Бирма)', 'Myanmar (Burma)', 'MM', 12400), -(125, 'Мэн о-в', 'Isle of Man', 'IM', 12500), -(126, 'Намибия', 'Namibia', 'NA', 12600), -(127, 'Науру', 'Nauru', 'NR', 12700), -(128, 'Непал', 'Nepal', 'NP', 12800), -(129, 'Нигер', 'Niger', 'NE', 12900), -(130, 'Нигерия', 'Nigeria', 'NG', 13000), -(131, 'Нидерланды (Голландия)', 'Netherlands', 'NL', 13100), -(132, 'Никарагуа', 'Nicaragua', 'NI', 13200), -(133, 'Новая Зеландия', 'New Zealand', 'NZ', 13300), -(134, 'Новая Каледония о-в', 'New Caledonia', 'NC', 13400), -(135, 'Норвегия', 'Norway', 'NO', 13500), -(136, 'Норфолк о-в', 'Norfolk Island', 'NF', 13600), -(137, 'О.А.Э.', 'United Arab Emirates', 'AE', 13700), -(138, 'Оман', 'Oman', 'OM', 13800), -(139, 'Пакистан', 'Pakistan', 'PK', 13900), -(140, 'Панама', 'Panama', 'PA', 14000), -(141, 'Папуа Новая Гвинея', 'Papua New Guinea', 'PG', 14100), -(142, 'Парагвай', 'Paraguay', 'PY', 14200), -(143, 'Перу', 'Peru', 'PE', 14300), -(144, 'Питкэрн о-в', 'Pitcairn Islands', 'PN', 14400), -(145, 'Польша', 'Poland', 'PL', 14500), -(146, 'Португалия', 'Portugal', 'PT', 14600), -(147, 'Пуэрто Рико', 'Puerto Rico', 'PR', 14700), -(148, 'Реюньон', 'Reunion', 'RE', 14800), -(149, 'Россия', 'Russia', 'RU', 1), -(150, 'Руанда', 'Rwanda', 'RW', 15000), -(151, 'Румыния', 'Romania', 'RO', 15100), -(152, 'Сальвадор', 'El Salvador', 'SV', 15200), -(153, 'Самоа', 'Samoa', 'WS', 15300), -(154, 'Сан-Марино', 'San Marino', 'SM', 15400), -(155, 'Сан-Томе и Принсипи', 'Sao Tome and Principe', 'ST', 15500), -(156, 'Саудовская Аравия', 'Saudi Arabia', 'SA', 15600), -(157, 'Свазиленд', 'Swaziland', 'SZ', 15700), -(158, 'Святая Люсия', 'Saint Lucia', 'LC', 15800), -(159, 'Святой Елены о-в', 'Saint Helena', 'SH', 15900), -(160, 'Северная Корея', 'North Korea', 'KP', 16000), -(161, 'Сейшеллы', 'Seychelles', 'SC', 16100), -(162, 'Сен-Пьер и Микелон', 'Saint Pierre and Miquelon', 'PM', 16200), -(163, 'Сенегал', 'Senegal', 'SN', 16300), -(164, 'Сент Китс и Невис', 'Saint Kitts and Nevis', 'KN', 16400), -(165, 'Сент-Винсент и Гренадины', 'Saint Vincent and the Grenadines', 'VC', 16500), -(166, 'Сербия', 'Serbia', 'RS', 16600), -(167, 'Сингапур', 'Singapore', 'SG', 16700), -(168, 'Сирия', 'Syria', 'SY', 16800), -(169, 'Словакия', 'Slovakia', 'SK', 16900), -(170, 'Словения', 'Slovenia', 'SI', 17000), -(171, 'Соломоновы о-ва', 'Solomon Islands', 'SB', 17100), -(172, 'Сомали', 'Somalia', 'SO', 17200), -(173, 'Судан', 'Sudan', 'SD', 17300), -(174, 'Суринам', 'Suriname', 'SR', 17400), -(175, 'США', 'United States', 'US', 17500), -(176, 'Сьерра-Леоне', 'Sierra Leone', 'SL', 17600), -(177, 'Таджикистан', 'Tajikistan', 'TJ', 17700), -(178, 'Таиланд', 'Thailand', 'TH', 17800), -(179, 'Тайвань', 'Taiwan', 'TW', 17900), -(180, 'Танзания', 'Tanzania', 'TZ', 18000), -(181, 'Того', 'Togo', 'TG', 18100), -(182, 'Токелау о-ва', 'Tokelau', 'TK', 18200), -(183, 'Тонга', 'Tonga', 'TO', 18300), -(184, 'Тринидад и Тобаго', 'Trinidad and Tobago', 'TT', 18400), -(185, 'Тувалу', 'Tuvalu', 'TV', 18500), -(186, 'Тунис', 'Tunisia', 'TN', 18600), -(187, 'Туркменистан', 'Turkmenistan', 'TM', 18700), -(188, 'Туркс и Кейкос', 'Turks and Caicos Islands', 'TC', 18800), -(189, 'Турция', 'Turkey', 'TR', 18900), -(190, 'Уганда', 'Uganda', 'UG', 19000), -(191, 'Узбекистан', 'Uzbekistan', 'UZ', 19100), -(192, 'Украина', 'Ukraine', 'UA', 2), -(193, 'Уругвай', 'Uruguay', 'UY', 19300), -(194, 'Фарерские о-ва', 'Faroe Islands', 'FO', 19400), -(195, 'Фиджи', 'Fiji', 'FJ', 19500), -(196, 'Филиппины', 'Philippines', 'PH', 19600), -(197, 'Финляндия', 'Finland', 'FI', 19700), -(198, 'Франция', 'France', 'FR', 19800), -(199, 'Французская Гвинея', 'French Guiana', 'GF', 19900), -(200, 'Французская Полинезия', 'French Polynesia', 'PF', 20000), -(201, 'Хорватия', 'Croatia', 'HR', 20100), -(202, 'Чад', 'Chad', 'TD', 20200), -(203, 'Черногория', 'Montenegro', 'ME', 20300), -(204, 'Чехия', 'Czech Republic', 'CZ', 20400), -(205, 'Чили', 'Chile', 'CL', 20500), -(206, 'Швейцария', 'Switzerland', 'CH', 20600), -(207, 'Швеция', 'Sweden', 'SE', 20700), -(208, 'Шри-Ланка', 'Sri Lanka', 'LK', 20800), -(209, 'Эквадор', 'Ecuador', 'EC', 20900), -(210, 'Экваториальная Гвинея', 'Equatorial Guinea', 'GQ', 21000), -(211, 'Эритрея', 'Eritrea', 'ER', 21100), -(212, 'Эстония', 'Estonia', 'EE', 21200), -(213, 'Эфиопия', 'Ethiopia', 'ET', 21300), -(214, 'ЮАР', 'South Africa', 'ZA', 21400), -(215, 'Южная Корея', 'South Korea', 'KR', 21500), -(216, 'Южная Осетия', 'South Ossetia', 'OS', 21600), -(217, 'Ямайка', 'Jamaica', 'JM', 21700), -(218, 'Япония', 'Japan', 'JP', 21800); - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_geo_region` --- - -CREATE TABLE IF NOT EXISTS `prefix_geo_region` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `country_id` int(11) NOT NULL, - `name_ru` varchar(50) NOT NULL, - `name_en` varchar(50) NOT NULL, - `sort` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - KEY `sort` (`sort`), - KEY `country_id` (`country_id`), - KEY `name_ru` (`name_ru`), - KEY `name_en` (`name_en`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1612 ; - --- --- Дамп данных таблицы `prefix_geo_region` --- - -INSERT INTO `prefix_geo_region` (`id`, `country_id`, `name_ru`, `name_en`, `sort`) VALUES -(1, 1, 'Абхазия', 'Абхазия', 100), -(2, 2, 'Australian Capital Territory', 'Australian Capital Territory', 100), -(3, 2, 'New South Wales', 'New South Wales', 200), -(4, 2, 'None', 'None', 300), -(5, 2, 'Northern Territory', 'Northern Territory', 400), -(6, 2, 'Queensland', 'Queensland', 500), -(7, 2, 'South Australia', 'South Australia', 600), -(8, 2, 'Tasmania', 'Tasmania', 700), -(9, 2, 'Victoria', 'Victoria', 800), -(10, 2, 'Western Australia', 'Western Australia', 900), -(11, 3, 'Burgenland', 'Burgenland', 100), -(12, 3, 'Krnten', 'Krnten', 200), -(13, 3, 'Niedersterreich', 'Niedersterreich', 300), -(14, 3, 'Obersterreich', 'Obersterreich', 400), -(15, 3, 'Salzburg', 'Salzburg', 500), -(16, 3, 'Steiermark', 'Steiermark', 600), -(17, 3, 'Tirol', 'Tirol', 700), -(18, 3, 'Vorarlberg', 'Vorarlberg', 800), -(19, 3, 'Wien', 'Wien', 900), -(20, 4, 'Азербайджан', 'Азербайджан', 100), -(21, 4, 'Нагорный Карабах', 'Нагорный Карабах', 200), -(22, 4, 'Нахичеванская обл.', 'Нахичеванская обл.', 300), -(23, 5, 'Berat', 'Berat', 100), -(24, 5, 'Diber', 'Diber', 200), -(25, 5, 'Durres', 'Durres', 300), -(26, 5, 'Elbasan', 'Elbasan', 400), -(27, 5, 'Fier', 'Fier', 500), -(28, 5, 'Gjirokaster', 'Gjirokaster', 600), -(29, 5, 'Korce', 'Korce', 700), -(30, 5, 'Kukes', 'Kukes', 800), -(31, 5, 'None', 'None', 900), -(32, 5, 'Shkoder', 'Shkoder', 1000), -(33, 5, 'Tirane', 'Tirane', 1100), -(34, 5, 'Vlore', 'Vlore', 1200), -(35, 6, 'Алжир', 'Algeria', 100), -(36, 7, 'Ангола', 'Angola', 100), -(37, 8, 'Anguilla', 'Anguilla', 100), -(38, 9, 'Andorra la Vella', 'Andorra la Vella', 100), -(39, 9, 'Canillo', 'Canillo', 200), -(40, 9, 'Encamp', 'Encamp', 300), -(41, 9, 'Escaldes-Engordany', 'Escaldes-Engordany', 400), -(42, 9, 'La Massana', 'La Massana', 500), -(43, 9, 'None', 'None', 600), -(44, 9, 'Ordino', 'Ordino', 700), -(45, 9, 'Sant Julia de Loria', 'Sant Julia de Loria', 800), -(46, 10, 'Антигуа и Барбуда', 'Antigua and Barbuda', 100), -(47, 11, 'Виллемстад', 'Willemstad', 100), -(48, 12, 'Buenos Aires', 'Buenos Aires', 100), -(49, 12, 'Catamarca', 'Catamarca', 200), -(50, 12, 'Chaco', 'Chaco', 300), -(51, 12, 'Chubut', 'Chubut', 400), -(52, 12, 'Corrientes', 'Corrientes', 500), -(53, 12, 'Crdoba', 'Crdoba', 600), -(54, 12, 'Distrito Federal', 'Distrito Federal', 700), -(55, 12, 'Entre Ros', 'Entre Ros', 800), -(56, 12, 'Formosa', 'Formosa', 900), -(57, 12, 'Jujuy', 'Jujuy', 1000), -(58, 12, 'La Pampa', 'La Pampa', 1100), -(59, 12, 'La Rioja', 'La Rioja', 1200), -(60, 12, 'Mendoza', 'Mendoza', 1300), -(61, 12, 'Misiones', 'Misiones', 1400), -(62, 12, 'Neuqun', 'Neuqun', 1500), -(63, 12, 'Ro Negro', 'Ro Negro', 1600), -(64, 12, 'Salta', 'Salta', 1700), -(65, 12, 'San Juan', 'San Juan', 1800), -(66, 12, 'San Luis', 'San Luis', 1900), -(67, 12, 'Santa Cruz', 'Santa Cruz', 2000), -(68, 12, 'Santa Fe', 'Santa Fe', 2100), -(69, 12, 'Santiago del Estero', 'Santiago del Estero', 2200), -(70, 12, 'Tierra del Fuego', 'Tierra del Fuego', 2300), -(71, 12, 'Tucumn', 'Tucumn', 2400), -(72, 13, 'Aragatsotn', 'Aragatsotn', 100), -(73, 13, 'Ararat', 'Ararat', 200), -(74, 13, 'Armavir', 'Armavir', 300), -(75, 13, 'Geghark''unik''', 'Geghark''unik''', 400), -(76, 13, 'Kotayk''', 'Kotayk''', 500), -(77, 13, 'Lorri', 'Lorri', 600), -(78, 13, 'None', 'None', 700), -(79, 13, 'Shirak', 'Shirak', 800), -(80, 13, 'Syunik''', 'Syunik''', 900), -(81, 13, 'Tavush', 'Tavush', 1000), -(82, 13, 'Vayots'' Dzor', 'Vayots'' Dzor', 1100), -(83, 13, 'Yerevan', 'Yerevan', 1200), -(84, 14, 'Арулько', 'Арулько', 100), -(85, 15, 'Афганистан', 'Afghanistan', 100), -(86, 16, 'Багамы', 'Багамы', 100), -(87, 17, 'Бангладеш', 'Bangladesh', 100), -(88, 18, 'Барбадос', 'Barbados', 100), -(89, 19, 'Бахрейн', 'Bahrain', 100), -(90, 20, 'Брестская обл.', 'Brestskaya obl.', 100), -(91, 20, 'Витебская обл.', 'Vitebskaya obl.', 200), -(92, 20, 'Гомельская обл.', 'Gomelskaya obl.', 300), -(93, 20, 'Гродненская обл.', 'Grodnenskaya obl.', 400), -(94, 20, 'Минская обл.', 'Minskaya obl.', 500), -(95, 20, 'Могилевская обл.', 'Mogilevskaya obl.', 600), -(96, 21, 'Belize', 'Belize', 100), -(97, 22, 'Antwerpen', 'Antwerpen', 100), -(98, 22, 'Brabant Wallon', 'Brabant Wallon', 200), -(99, 22, 'Bruxelles', 'Bruxelles', 300), -(100, 22, 'Hainaut', 'Hainaut', 400), -(101, 22, 'Lige', 'Lige', 500), -(102, 22, 'Limburg', 'Limburg', 600), -(103, 22, 'Luxembourg', 'Luxembourg', 700), -(104, 22, 'Namur', 'Namur', 800), -(105, 22, 'Oost-Vlaanderen', 'Oost-Vlaanderen', 900), -(106, 22, 'Vlaams Brabant', 'Vlaams Brabant', 1000), -(107, 22, 'West-Vlaanderen', 'West-Vlaanderen', 1100), -(108, 23, 'Бенин', 'Benin', 100), -(109, 24, 'Hamilton', 'Hamilton', 100), -(110, 25, 'Blagoevgrad', 'Blagoevgrad', 100), -(111, 25, 'Burgas', 'Burgas', 200), -(112, 25, 'Dobrich', 'Dobrich', 300), -(113, 25, 'Gabrovo', 'Gabrovo', 400), -(114, 25, 'Grad Sofiya', 'Grad Sofiya', 500), -(115, 25, 'Khaskovo', 'Khaskovo', 600), -(116, 25, 'Kurdzhali', 'Kurdzhali', 700), -(117, 25, 'Kyustendil', 'Kyustendil', 800), -(118, 25, 'Lovech', 'Lovech', 900), -(119, 25, 'Montana', 'Montana', 1000), -(120, 25, 'None', 'None', 1100), -(121, 25, 'Pazardzhik', 'Pazardzhik', 1200), -(122, 25, 'Pernik', 'Pernik', 1300), -(123, 25, 'Pleven', 'Pleven', 1400), -(124, 25, 'Plovdiv', 'Plovdiv', 1500), -(125, 25, 'Razgrad', 'Razgrad', 1600), -(126, 25, 'Ruse', 'Ruse', 1700), -(127, 25, 'Shumen', 'Shumen', 1800), -(128, 25, 'Silistra', 'Silistra', 1900), -(129, 25, 'Sliven', 'Sliven', 2000), -(130, 25, 'Smolyan', 'Smolyan', 2100), -(131, 25, 'Sofiya', 'Sofiya', 2200), -(132, 25, 'Stara Zagora', 'Stara Zagora', 2300), -(133, 25, 'Turgovishte', 'Turgovishte', 2400), -(134, 25, 'Varna', 'Varna', 2500), -(135, 25, 'Veliko Turnovo', 'Veliko Turnovo', 2600), -(136, 25, 'Vidin', 'Vidin', 2700), -(137, 25, 'Vratsa', 'Vratsa', 2800), -(138, 25, 'Yambol', 'Yambol', 2900), -(139, 26, 'Chuquisaca', 'Chuquisaca', 100), -(140, 26, 'Cochabamba', 'Cochabamba', 200), -(141, 26, 'El Beni', 'El Beni', 300), -(142, 26, 'La Paz', 'La Paz', 400), -(143, 26, 'None', 'None', 500), -(144, 26, 'Oruro', 'Oruro', 600), -(145, 26, 'Potos', 'Potos', 700), -(146, 26, 'Santa Cruz', 'Santa Cruz', 800), -(147, 27, 'Federation of Bosnia and Herzegovina', 'Federation of Bosnia and Herzegovina', 100), -(148, 27, 'None', 'None', 200), -(149, 27, 'Republika Srpska', 'Republika Srpska', 300), -(150, 28, 'Ботсвана', 'Botswana', 100), -(151, 29, 'Acre', 'Acre', 100), -(152, 29, 'Alagoas', 'Alagoas', 200), -(153, 29, 'Amapa', 'Amapa', 300), -(154, 29, 'Amazonas', 'Amazonas', 400), -(155, 29, 'Bahia', 'Bahia', 500), -(156, 29, 'Ceara', 'Ceara', 600), -(157, 29, 'Distrito Federal', 'Distrito Federal', 700), -(158, 29, 'Espirito Santo', 'Espirito Santo', 800), -(159, 29, 'Goias', 'Goias', 900), -(160, 29, 'Maranhao', 'Maranhao', 1000), -(161, 29, 'Minas Gerais', 'Minas Gerais', 1100), -(162, 29, 'Paraiba', 'Paraiba', 1200), -(163, 29, 'Parana', 'Parana', 1300), -(164, 29, 'Rio de Janeiro', 'Rio de Janeiro', 1400), -(165, 29, 'Rio Grande do Norte', 'Rio Grande do Norte', 1500), -(166, 29, 'Rio Grande do Sul', 'Rio Grande do Sul', 1600), -(167, 29, 'Rondonia', 'Rondonia', 1700), -(168, 29, 'Roraima', 'Roraima', 1800), -(169, 29, 'Santa Catarina', 'Santa Catarina', 1900), -(170, 29, 'Sao Paulo', 'Sao Paulo', 2000), -(171, 29, 'Sergipe', 'Sergipe', 2100), -(172, 30, 'Род-Таун', 'Род-Таун', 100), -(173, 31, 'Бруней', 'Brunei', 100), -(174, 32, 'Буркина Фасо', 'Burkina Faso', 100), -(175, 33, 'Бурунди', 'Burundi', 100), -(176, 34, 'Бутан', 'Bhutan', 100), -(177, 35, 'Мата-Уту', 'Mata-Utu', 100), -(178, 36, 'Вануату', 'Vanuatu', 100), -(179, 37, 'Channel Islands', 'Channel Islands', 100), -(180, 37, 'England - East', 'England - East', 200), -(181, 37, 'England - East Midlands', 'England - East Midlands', 300), -(182, 37, 'England - London', 'England - London', 400), -(183, 37, 'England - North East', 'England - North East', 500), -(184, 37, 'England - North West', 'England - North West', 600), -(185, 37, 'England - South East', 'England - South East', 700), -(186, 37, 'England - South West', 'England - South West', 800), -(187, 37, 'England - West Midlands', 'England - West Midlands', 900), -(188, 37, 'England - Yorks & Humber', 'England - Yorks & Humber', 1000), -(189, 37, 'Isle of Man', 'Isle of Man', 1100), -(190, 37, 'Northern Ireland', 'Northern Ireland', 1200), -(191, 37, 'Scotland Central', 'Scotland Central', 1300), -(192, 37, 'Scotland North', 'Scotland North', 1400), -(193, 37, 'Scotland South', 'Scotland South', 1500), -(194, 37, 'Wales North', 'Wales North', 1600), -(195, 37, 'Wales South', 'Wales South', 1700), -(196, 38, 'Bacs-Kiskun', 'Bacs-Kiskun', 100), -(197, 38, 'Bekes', 'Bekes', 200), -(198, 38, 'Borsod-Abauj-Zemplen', 'Borsod-Abauj-Zemplen', 300), -(199, 38, 'Budapest', 'Budapest', 400), -(200, 38, 'Csongrad', 'Csongrad', 500), -(201, 38, 'Debrecen', 'Debrecen', 600), -(202, 38, 'Fejer', 'Fejer', 700), -(203, 38, 'Gyor', 'Gyor', 800), -(204, 38, 'Gyor-Moson-Sopron', 'Gyor-Moson-Sopron', 900), -(205, 38, 'Heves', 'Heves', 1000), -(206, 38, 'Jasz-Nagykun-Szolnok', 'Jasz-Nagykun-Szolnok', 1100), -(207, 38, 'Komarom-Esztergom', 'Komarom-Esztergom', 1200), -(208, 38, 'Miskolc', 'Miskolc', 1300), -(209, 38, 'Nograd', 'Nograd', 1400), -(210, 38, 'Pecs', 'Pecs', 1500), -(211, 38, 'Pest', 'Pest', 1600), -(212, 38, 'Somogy', 'Somogy', 1700), -(213, 38, 'Szabolcs-Szatmar-Bereg', 'Szabolcs-Szatmar-Bereg', 1800), -(214, 38, 'Szeged', 'Szeged', 1900), -(215, 38, 'Tolna', 'Tolna', 2000), -(216, 38, 'Vas', 'Vas', 2100), -(217, 38, 'Veszprem', 'Veszprem', 2200), -(218, 38, 'Zala', 'Zala', 2300), -(219, 39, 'Amazonas', 'Amazonas', 100), -(220, 39, 'Anzoategui', 'Anzoategui', 200), -(221, 39, 'Apure', 'Apure', 300), -(222, 39, 'Aragua', 'Aragua', 400), -(223, 39, 'Barinas', 'Barinas', 500), -(224, 39, 'Bolvar', 'Bolvar', 600), -(225, 39, 'Carabobo', 'Carabobo', 700), -(226, 39, 'Cojedes', 'Cojedes', 800), -(227, 39, 'Delta Amacuro', 'Delta Amacuro', 900), -(228, 39, 'Distrito Federal', 'Distrito Federal', 1000), -(229, 39, 'Falcn', 'Falcn', 1100), -(230, 39, 'Gurico', 'Gurico', 1200), -(231, 39, 'Lara', 'Lara', 1300), -(232, 39, 'Miranda', 'Miranda', 1400), -(233, 39, 'Monagas', 'Monagas', 1500), -(234, 39, 'Mrida', 'Mrida', 1600), -(235, 39, 'None', 'None', 1700), -(236, 39, 'Nueva Esparta', 'Nueva Esparta', 1800), -(237, 39, 'Portuguesa', 'Portuguesa', 1900), -(238, 39, 'Sucre', 'Sucre', 2000), -(239, 39, 'Tchira', 'Tchira', 2100), -(240, 39, 'Yaracuy', 'Yaracuy', 2200), -(241, 39, 'Zulia', 'Zulia', 2300), -(242, 40, 'Восточный Тимор', 'East Timor', 100), -(243, 41, 'Dong Bang Song Hong', 'Dong Bang Song Hong', 100), -(244, 41, 'Dong Nam Bo', 'Dong Nam Bo', 200), -(245, 41, 'Duyen Hai Mien Trung', 'Duyen Hai Mien Trung', 300), -(246, 41, 'Khu Bon Cu', 'Khu Bon Cu', 400), -(247, 41, 'Mien Nui Va Trung Du', 'Mien Nui Va Trung Du', 500), -(248, 41, 'Thai Nguyen', 'Thai Nguyen', 600), -(249, 42, 'Габон', 'Gabon', 100), -(250, 43, 'Artibonite', 'Artibonite', 100), -(251, 43, 'Grand''Anse', 'Grand''Anse', 200), -(252, 43, 'Nord-Ouest', 'Nord-Ouest', 300), -(253, 43, 'Ouest', 'Ouest', 400), -(254, 43, 'Sud', 'Sud', 500), -(255, 43, 'Sud-Est', 'Sud-Est', 600), -(256, 44, 'Гайана', 'Guyana', 100), -(257, 45, 'Гамбия', 'Gambia', 100), -(258, 46, 'Гана', 'Ghana', 100), -(259, 47, 'Grande-Terre', 'Grande-Terre', 100), -(260, 47, 'Бас-Тер', 'Бас-Тер', 200), -(261, 48, 'Alta Verapaz', 'Alta Verapaz', 100), -(262, 48, 'Baja Verapaz', 'Baja Verapaz', 200), -(263, 48, 'Chimaltenango', 'Chimaltenango', 300), -(264, 48, 'Chiquimula', 'Chiquimula', 400), -(265, 48, 'Escuintla', 'Escuintla', 500), -(266, 48, 'Guatemala', 'Guatemala', 600), -(267, 48, 'Jutiapa', 'Jutiapa', 700), -(268, 48, 'Petn', 'Petn', 800), -(269, 48, 'Quetzaltenango', 'Quetzaltenango', 900), -(270, 48, 'Totonicapn', 'Totonicapn', 1000), -(271, 48, 'Zacapa', 'Zacapa', 1100), -(272, 49, 'Гвинея', 'Guinea', 100), -(273, 50, 'Бисау', 'Бисау', 100), -(274, 51, 'Baden-Wrttemberg', 'Baden-Wrttemberg', 100), -(275, 51, 'Bayern', 'Bayern', 200), -(276, 51, 'Berlin', 'Berlin', 300), -(277, 51, 'Brandenburg', 'Brandenburg', 400), -(278, 51, 'Bremen', 'Bremen', 500), -(279, 51, 'Hamburg', 'Hamburg', 600), -(280, 51, 'Hessen', 'Hessen', 700), -(281, 51, 'Mecklenburg-Vorpommern', 'Mecklenburg-Vorpommern', 800), -(282, 51, 'Niedersachsen', 'Niedersachsen', 900), -(283, 51, 'Nordrhein-Westfalen', 'Nordrhein-Westfalen', 1000), -(284, 51, 'Rheinland-Pfalz', 'Rheinland-Pfalz', 1100), -(285, 51, 'Saarland', 'Saarland', 1200), -(286, 51, 'Sachsen', 'Sachsen', 1300), -(287, 51, 'Sachsen-Anhalt', 'Sachsen-Anhalt', 1400), -(288, 51, 'Schleswig-Holstein', 'Schleswig-Holstein', 1500), -(289, 51, 'Thringen', 'Thringen', 1600), -(290, 52, 'Сент-Питер-Порт', 'Сент-Питер-Порт', 100), -(291, 53, 'Gibraltar', 'Gibraltar', 100), -(292, 54, 'Тегусигальпа', 'Тегусигальпа', 100), -(293, 55, 'Гонконг', 'Гонконг', 100), -(294, 56, 'Сент-Джорджес', 'Сент-Джорджес', 100), -(295, 57, 'Гренландия', 'Гренландия', 100), -(296, 58, 'Aitolia kai Akarnania', 'Aitolia kai Akarnania', 100), -(297, 58, 'Akhaia', 'Akhaia', 200), -(298, 58, 'Argolis', 'Argolis', 300), -(299, 58, 'Arkadhia', 'Arkadhia', 400), -(300, 58, 'Arta', 'Arta', 500), -(301, 58, 'Attiki', 'Attiki', 600), -(302, 58, 'Dhodhekanisos', 'Dhodhekanisos', 700), -(303, 58, 'Drama', 'Drama', 800), -(304, 58, 'Evritania', 'Evritania', 900), -(305, 58, 'Evros', 'Evros', 1000), -(306, 58, 'Evvoia', 'Evvoia', 1100), -(307, 58, 'Florina', 'Florina', 1200), -(308, 58, 'Fthiotis', 'Fthiotis', 1300), -(309, 58, 'Grevena', 'Grevena', 1400), -(310, 58, 'Ilia', 'Ilia', 1500), -(311, 58, 'Imathia', 'Imathia', 1600), -(312, 58, 'Ioannina', 'Ioannina', 1700), -(313, 58, 'Iraklion', 'Iraklion', 1800), -(314, 58, 'Kardhitsa', 'Kardhitsa', 1900), -(315, 58, 'Kastoria', 'Kastoria', 2000), -(316, 58, 'Kavala', 'Kavala', 2100), -(317, 58, 'Kefallinia', 'Kefallinia', 2200), -(318, 58, 'Kerkira', 'Kerkira', 2300), -(319, 58, 'Khalkidhiki', 'Khalkidhiki', 2400), -(320, 58, 'Khania', 'Khania', 2500), -(321, 58, 'Khios', 'Khios', 2600), -(322, 58, 'Kikladhes', 'Kikladhes', 2700), -(323, 58, 'Kilkis', 'Kilkis', 2800), -(324, 58, 'Korinthia', 'Korinthia', 2900), -(325, 58, 'Kozani', 'Kozani', 3000), -(326, 58, 'Lakonia', 'Lakonia', 3100), -(327, 58, 'Larisa', 'Larisa', 3200), -(328, 58, 'Lasithi', 'Lasithi', 3300), -(329, 58, 'Lesvos', 'Lesvos', 3400), -(330, 58, 'Levkas', 'Levkas', 3500), -(331, 58, 'Magnisia', 'Magnisia', 3600), -(332, 58, 'Messinia', 'Messinia', 3700), -(333, 58, 'None', 'None', 3800), -(334, 58, 'Pella', 'Pella', 3900), -(335, 58, 'Pieria', 'Pieria', 4000), -(336, 58, 'Preveza', 'Preveza', 4100), -(337, 58, 'Rethimni', 'Rethimni', 4200), -(338, 58, 'Rodhopi', 'Rodhopi', 4300), -(339, 58, 'Samos', 'Samos', 4400), -(340, 58, 'Serrai', 'Serrai', 4500), -(341, 58, 'Thesprotia', 'Thesprotia', 4600), -(342, 58, 'Thessaloniki', 'Thessaloniki', 4700), -(343, 58, 'Trikala', 'Trikala', 4800), -(344, 58, 'Voiotia', 'Voiotia', 4900), -(345, 58, 'Xanthi', 'Xanthi', 5000), -(346, 58, 'Zakinthos', 'Zakinthos', 5100), -(347, 59, 'Аджария', 'Аджария', 100), -(348, 59, 'Грузия', 'Грузия', 200), -(349, 60, 'Arhus', 'Arhus', 100), -(350, 60, 'Bornholm', 'Bornholm', 200), -(351, 60, 'Frederiksborg', 'Frederiksborg', 300), -(352, 60, 'Fyn', 'Fyn', 400), -(353, 60, 'Kobenhavn', 'Kobenhavn', 500), -(354, 60, 'None', 'None', 600), -(355, 60, 'Nordjylland', 'Nordjylland', 700), -(356, 60, 'Ribe', 'Ribe', 800), -(357, 60, 'Ringkobing', 'Ringkobing', 900), -(358, 60, 'Roskilde', 'Roskilde', 1000), -(359, 60, 'Sonderjylland', 'Sonderjylland', 1100), -(360, 60, 'Staden Kobenhavn', 'Staden Kobenhavn', 1200), -(361, 60, 'Storstrom', 'Storstrom', 1300), -(362, 60, 'Vejle', 'Vejle', 1400), -(363, 60, 'Vestsjalland', 'Vestsjalland', 1500), -(364, 60, 'Viborg', 'Viborg', 1600), -(365, 61, 'Сент-Элье', 'Saint Helier', 100), -(366, 62, 'Джибути', 'Djibouti', 100), -(367, 63, 'Санто-доминго', 'Санто-доминго', 100), -(368, 64, 'Аль-Кахира', 'Al Qhira', 100), -(369, 64, 'Асуан', 'Aswan', 200), -(370, 64, 'Асьют', 'Asyut', 300), -(371, 64, 'Бени-Суэйф', 'Beni Suef', 400), -(372, 64, 'Гарбия', 'Gharbia', 500), -(373, 64, 'Думьят', 'Damietta', 600), -(374, 64, 'Египет', 'Egypt', 700), -(375, 64, 'Синай', 'Sinai', 800), -(376, 65, 'Замбия', 'Zambia', 100), -(377, 66, 'Западная Сахара', 'Western Sahara', 100), -(378, 67, 'Зимбабве', 'Zimbabwe', 100), -(379, 68, 'Вади-Ара', 'Вади-Ара', 100), -(380, 68, 'Иерусалим', 'Иерусалим', 200), -(381, 68, 'Рамат ХаГолан', 'Рамат ХаГолан', 300), -(382, 68, 'Тель-Авив', 'Тель-Авив', 400), -(383, 68, 'Хадаром', 'Хадаром', 500), -(384, 68, 'Хайфа', 'Хайфа', 600), -(385, 68, 'Хамерказ', 'Хамерказ', 700), -(386, 68, 'Хацафон', 'Хацафон', 800), -(387, 69, 'Bangla', 'Bangla', 100), -(388, 69, 'Chhattisgarh', 'Chhattisgarh', 200), -(389, 69, 'Karnataka', 'Karnataka', 300), -(390, 69, 'Андхра-Прадеш', 'Андхра-Прадеш', 400), -(391, 69, 'Ассам', 'Ассам', 500), -(392, 69, 'Бихар', 'Бихар', 600), -(393, 69, 'Гуджарат', 'Гуджарат', 700), -(394, 69, 'Джамму и Кашмир', 'Джамму и Кашмир', 800), -(395, 69, 'Индия', 'Индия', 900), -(396, 69, 'Керала', 'Керала', 1000), -(397, 69, 'Мадхья-Прадеш', 'Мадхья-Прадеш', 1100), -(398, 69, 'Манипур', 'Манипур', 1200), -(399, 69, 'Махараштра', 'Махараштра', 1300), -(400, 69, 'Орисса', 'Орисса', 1400), -(401, 69, 'Пенджаб', 'Пенджаб', 1500), -(402, 69, 'Пондишери', 'Пондишери', 1600), -(403, 69, 'Раджастхан', 'Раджастхан', 1700), -(404, 69, 'Тамилнад', 'Тамилнад', 1800), -(405, 69, 'Трипура', 'Трипура', 1900), -(406, 69, 'Уттар-Прадеш', 'Уттар-Прадеш', 2000), -(407, 69, 'Харьяна', 'Харьяна', 2100), -(408, 69, 'Чандигарх', 'Чандигарх', 2200), -(409, 70, 'Индонезия', 'Индонезия', 100), -(410, 71, 'Иордания', 'Jordan', 100), -(411, 72, 'Багдад', 'Багдад', 100), -(412, 72, 'Басра', 'Басра', 200), -(413, 72, 'Мосул', 'Мосул', 300), -(414, 73, 'Azarbayjan-e Khavari', 'Azarbayjan-e Khavari', 100), -(415, 73, 'Esfahan', 'Esfahan', 200), -(416, 73, 'Hamadan', 'Hamadan', 300), -(417, 73, 'Kordestan', 'Kordestan', 400), -(418, 73, 'Yazd', 'Yazd', 500), -(419, 73, 'Керман', 'Керман', 600), -(420, 73, 'Керманшахан', 'Керманшахан', 700), -(421, 73, 'Мазендеран', 'Мазендеран', 800), -(422, 73, 'Тегеран', 'Тегеран', 900), -(423, 73, 'Фарс', 'Фарс', 1000), -(424, 73, 'Хорасан', 'Хорасан', 1100), -(425, 73, 'Хузистан', 'Хузистан', 1200), -(426, 74, 'Carlow', 'Carlow', 100), -(427, 74, 'Cavan', 'Cavan', 200), -(428, 74, 'Clare', 'Clare', 300), -(429, 74, 'Cork', 'Cork', 400), -(430, 74, 'Donegal', 'Donegal', 500), -(431, 74, 'Dublin', 'Dublin', 600), -(432, 74, 'Galway', 'Galway', 700), -(433, 74, 'Kerry', 'Kerry', 800), -(434, 74, 'Kildare', 'Kildare', 900), -(435, 74, 'Kilkenny', 'Kilkenny', 1000), -(436, 74, 'Laois', 'Laois', 1100), -(437, 74, 'Leitrim', 'Leitrim', 1200), -(438, 74, 'Limerick', 'Limerick', 1300), -(439, 74, 'Longford', 'Longford', 1400), -(440, 74, 'Louth', 'Louth', 1500), -(441, 74, 'Mayo', 'Mayo', 1600), -(442, 74, 'Meath', 'Meath', 1700), -(443, 74, 'Monaghan', 'Monaghan', 1800), -(444, 74, 'Offaly', 'Offaly', 1900), -(445, 74, 'Roscommon', 'Roscommon', 2000), -(446, 74, 'Sligo', 'Sligo', 2100), -(447, 74, 'Tipperary', 'Tipperary', 2200), -(448, 74, 'Waterford', 'Waterford', 2300), -(449, 74, 'Westmeath', 'Westmeath', 2400), -(450, 74, 'Wexford', 'Wexford', 2500), -(451, 74, 'Wicklow', 'Wicklow', 2600), -(452, 75, 'Arnessysla', 'Arnessysla', 100), -(453, 75, 'Austur-Hunavatnssysla', 'Austur-Hunavatnssysla', 200), -(454, 75, 'Borgarfjardarsysla', 'Borgarfjardarsysla', 300), -(455, 75, 'Eyjafjardarsysla', 'Eyjafjardarsysla', 400), -(456, 75, 'Gullbringusysla', 'Gullbringusysla', 500), -(457, 75, 'Myrasysla', 'Myrasysla', 600), -(458, 75, 'None', 'None', 700), -(459, 75, 'Nordur-Tingeyjarsysla', 'Nordur-Tingeyjarsysla', 800), -(460, 75, 'Strandasysla', 'Strandasysla', 900), -(461, 75, 'Sudur-Mulasysla', 'Sudur-Mulasysla', 1000), -(462, 75, 'Vestur-Bardastrandarsysla', 'Vestur-Bardastrandarsysla', 1100), -(463, 76, 'A Corua', 'A Corua', 100), -(464, 76, 'Albacete', 'Albacete', 200), -(465, 76, 'Alicante/Alacant', 'Alicante/Alacant', 300), -(466, 76, 'Almera', 'Almera', 400), -(467, 76, 'Asturias', 'Asturias', 500), -(468, 76, 'Badajoz', 'Badajoz', 600), -(469, 76, 'Barcelona', 'Barcelona', 700), -(470, 76, 'Burgos', 'Burgos', 800), -(471, 76, 'Cantabria', 'Cantabria', 900), -(472, 76, 'Castelln/Castell', 'Castelln/Castell', 1000), -(473, 76, 'Cceres', 'Cceres', 1100), -(474, 76, 'Cdiz', 'Cdiz', 1200), -(475, 76, 'Ceuta', 'Ceuta', 1300), -(476, 76, 'Ciudad Real', 'Ciudad Real', 1400), -(477, 76, 'Crdoba', 'Crdoba', 1500), -(478, 76, 'Cuenca', 'Cuenca', 1600), -(479, 76, 'Girona', 'Girona', 1700), -(480, 76, 'Granada', 'Granada', 1800), -(481, 76, 'Guadalajara', 'Guadalajara', 1900), -(482, 76, 'Guipzcoa', 'Guipzcoa', 2000), -(483, 76, 'Huelva', 'Huelva', 2100), -(484, 76, 'Huesca', 'Huesca', 2200), -(485, 76, 'Illes Balears', 'Illes Balears', 2300), -(486, 76, 'Jan', 'Jan', 2400), -(487, 76, 'La Rioja', 'La Rioja', 2500), -(488, 76, 'Las Palmas', 'Las Palmas', 2600), -(489, 76, 'lava', 'lava', 2700), -(490, 76, 'Len', 'Len', 2800), -(491, 76, 'Lleida', 'Lleida', 2900), -(492, 76, 'Lugo', 'Lugo', 3000), -(493, 76, 'Madrid', 'Madrid', 3100), -(494, 76, 'Melilla', 'Melilla', 3200), -(495, 76, 'Mlaga', 'Mlaga', 3300), -(496, 76, 'Murcia', 'Murcia', 3400), -(497, 76, 'Navarra', 'Navarra', 3500), -(498, 76, 'Ourense', 'Ourense', 3600), -(499, 76, 'Palencia', 'Palencia', 3700), -(500, 76, 'Pontevedra', 'Pontevedra', 3800), -(501, 76, 'Salamanca', 'Salamanca', 3900), -(502, 76, 'Santa Cruz de Tenerife', 'Santa Cruz de Tenerife', 4000), -(503, 76, 'Segovia', 'Segovia', 4100), -(504, 76, 'Sevilla', 'Sevilla', 4200), -(505, 76, 'Soria', 'Soria', 4300), -(506, 76, 'Tarragona', 'Tarragona', 4400), -(507, 76, 'Teruel', 'Teruel', 4500), -(508, 76, 'Toledo', 'Toledo', 4600), -(509, 76, 'Valladolid', 'Valladolid', 4700), -(510, 76, 'Valncia', 'Valncia', 4800), -(511, 76, 'vila', 'vila', 4900), -(512, 76, 'Vizcaya', 'Vizcaya', 5000), -(513, 76, 'Zamora', 'Zamora', 5100), -(514, 76, 'Zaragoza', 'Zaragoza', 5200), -(515, 77, 'Abruzzo - Chieti', 'Abruzzo - Chieti', 100), -(516, 77, 'Abruzzo - L''Aquila', 'Abruzzo - L''Aquila', 200), -(517, 77, 'Abruzzo - Pescara', 'Abruzzo - Pescara', 300), -(518, 77, 'Abruzzo - Teramo', 'Abruzzo - Teramo', 400), -(519, 77, 'Basilicata - Matera', 'Basilicata - Matera', 500), -(520, 77, 'Basilicata - Potenza', 'Basilicata - Potenza', 600), -(521, 77, 'Calabria - Catanzaro', 'Calabria - Catanzaro', 700), -(522, 77, 'Calabria - Cosenza', 'Calabria - Cosenza', 800), -(523, 77, 'Calabria - Crotone', 'Calabria - Crotone', 900), -(524, 77, 'Calabria - Reggio Calabria', 'Calabria - Reggio Calabria', 1000), -(525, 77, 'Calabria - Vibo Valentia', 'Calabria - Vibo Valentia', 1100), -(526, 77, 'Campania - Avellino', 'Campania - Avellino', 1200), -(527, 77, 'Campania - Benevento', 'Campania - Benevento', 1300), -(528, 77, 'Campania - Caserta', 'Campania - Caserta', 1400), -(529, 77, 'Campania - Napoli', 'Campania - Napoli', 1500), -(530, 77, 'Campania - Salerno', 'Campania - Salerno', 1600), -(531, 77, 'Emilia Romagna - Bologna', 'Emilia Romagna - Bologna', 1700), -(532, 77, 'Emilia Romagna - Ferrara', 'Emilia Romagna - Ferrara', 1800), -(533, 77, 'Emilia Romagna - Forl-Cesena', 'Emilia Romagna - Forl-Cesena', 1900), -(534, 77, 'Emilia Romagna - Modena', 'Emilia Romagna - Modena', 2000), -(535, 77, 'Emilia Romagna - Parma', 'Emilia Romagna - Parma', 2100), -(536, 77, 'Emilia Romagna - Piacenza', 'Emilia Romagna - Piacenza', 2200), -(537, 77, 'Emilia Romagna - Ravenna', 'Emilia Romagna - Ravenna', 2300), -(538, 77, 'Emilia Romagna - Reggio Emilia', 'Emilia Romagna - Reggio Emilia', 2400), -(539, 77, 'Emilia Romagna - Rimini', 'Emilia Romagna - Rimini', 2500), -(540, 77, 'Friuli Venezia Giulia - Gorizia', 'Friuli Venezia Giulia - Gorizia', 2600), -(541, 77, 'Friuli Venezia Giulia - Pordenone', 'Friuli Venezia Giulia - Pordenone', 2700), -(542, 77, 'Friuli Venezia Giulia - Trieste', 'Friuli Venezia Giulia - Trieste', 2800), -(543, 77, 'Friuli Venezia Giulia - Udine', 'Friuli Venezia Giulia - Udine', 2900), -(544, 77, 'Lazio - Frosinone', 'Lazio - Frosinone', 3000), -(545, 77, 'Lazio - Latina', 'Lazio - Latina', 3100), -(546, 77, 'Lazio - Rieti', 'Lazio - Rieti', 3200), -(547, 77, 'Lazio - Roma', 'Lazio - Roma', 3300), -(548, 77, 'Lazio - Viterbo', 'Lazio - Viterbo', 3400), -(549, 77, 'Liguria - Genova', 'Liguria - Genova', 3500), -(550, 77, 'Liguria - Imperia', 'Liguria - Imperia', 3600), -(551, 77, 'Liguria - La Spezia', 'Liguria - La Spezia', 3700), -(552, 77, 'Liguria - Savona', 'Liguria - Savona', 3800), -(553, 77, 'Lombardia - Bergamo', 'Lombardia - Bergamo', 3900), -(554, 77, 'Lombardia - Brescia', 'Lombardia - Brescia', 4000), -(555, 77, 'Lombardia - Como', 'Lombardia - Como', 4100), -(556, 77, 'Lombardia - Cremona', 'Lombardia - Cremona', 4200), -(557, 77, 'Lombardia - Lecco', 'Lombardia - Lecco', 4300), -(558, 77, 'Lombardia - Lodi', 'Lombardia - Lodi', 4400), -(559, 77, 'Lombardia - Mantova', 'Lombardia - Mantova', 4500), -(560, 77, 'Lombardia - Milano', 'Lombardia - Milano', 4600), -(561, 77, 'Lombardia - Pavia', 'Lombardia - Pavia', 4700), -(562, 77, 'Lombardia - Sondrio', 'Lombardia - Sondrio', 4800), -(563, 77, 'Lombardia - Varese', 'Lombardia - Varese', 4900), -(564, 77, 'Marche - Ancona', 'Marche - Ancona', 5000), -(565, 77, 'Marche - Ascoli Piceno', 'Marche - Ascoli Piceno', 5100), -(566, 77, 'Marche - Macerata', 'Marche - Macerata', 5200), -(567, 77, 'Marche - Pesaro - Urbino', 'Marche - Pesaro - Urbino', 5300), -(568, 77, 'Molise - Campobasso', 'Molise - Campobasso', 5400), -(569, 77, 'Molise - Isernia', 'Molise - Isernia', 5500), -(570, 77, 'Piemonte - Alessandria', 'Piemonte - Alessandria', 5600), -(571, 77, 'Piemonte - Biella', 'Piemonte - Biella', 5700), -(572, 77, 'Piemonte - Cuneo', 'Piemonte - Cuneo', 5800), -(573, 77, 'Piemonte - Novara', 'Piemonte - Novara', 5900), -(574, 77, 'Piemonte - Torino', 'Piemonte - Torino', 6000), -(575, 77, 'Piemonte - Verbania', 'Piemonte - Verbania', 6100), -(576, 77, 'Piemonte - Vercelli', 'Piemonte - Vercelli', 6200), -(577, 77, 'Puglia - Bari', 'Puglia - Bari', 6300), -(578, 77, 'Puglia - Brindisi', 'Puglia - Brindisi', 6400), -(579, 77, 'Puglia - Foggia', 'Puglia - Foggia', 6500), -(580, 77, 'Puglia - Lecce', 'Puglia - Lecce', 6600), -(581, 77, 'Puglia - Taranto', 'Puglia - Taranto', 6700), -(582, 77, 'Sardegna - Cagliari', 'Sardegna - Cagliari', 6800), -(583, 77, 'Sardegna - Nuoro', 'Sardegna - Nuoro', 6900), -(584, 77, 'Sardegna - Oristano', 'Sardegna - Oristano', 7000), -(585, 77, 'Sardegna - Sassari', 'Sardegna - Sassari', 7100), -(586, 77, 'Sicilia - Agrigento', 'Sicilia - Agrigento', 7200), -(587, 77, 'Sicilia - Catania', 'Sicilia - Catania', 7300), -(588, 77, 'Sicilia - Messina', 'Sicilia - Messina', 7400), -(589, 77, 'Sicilia - Palermo', 'Sicilia - Palermo', 7500), -(590, 77, 'Sicilia - Ragusa', 'Sicilia - Ragusa', 7600), -(591, 77, 'Sicilia - Siracusa', 'Sicilia - Siracusa', 7700), -(592, 77, 'Sicilia - Trapani', 'Sicilia - Trapani', 7800), -(593, 77, 'Toscana - Arezzo', 'Toscana - Arezzo', 7900), -(594, 77, 'Toscana - Firenze', 'Toscana - Firenze', 8000), -(595, 77, 'Toscana - Grosseto', 'Toscana - Grosseto', 8100), -(596, 77, 'Toscana - Livorno', 'Toscana - Livorno', 8200), -(597, 77, 'Toscana - Lucca', 'Toscana - Lucca', 8300), -(598, 77, 'Toscana - Massa Carrara', 'Toscana - Massa Carrara', 8400), -(599, 77, 'Toscana - Pisa', 'Toscana - Pisa', 8500), -(600, 77, 'Toscana - Pistoia', 'Toscana - Pistoia', 8600), -(601, 77, 'Toscana - Prato', 'Toscana - Prato', 8700), -(602, 77, 'Toscana - Siena', 'Toscana - Siena', 8800), -(603, 77, 'Trentino Alto Adige - Bolzano', 'Trentino Alto Adige - Bolzano', 8900), -(604, 77, 'Trentino Alto Adige - Trento', 'Trentino Alto Adige - Trento', 9000), -(605, 77, 'Umbria - Perugia', 'Umbria - Perugia', 9100), -(606, 77, 'Umbria - Terni', 'Umbria - Terni', 9200), -(607, 77, 'Valle d''Aosta - Aosta', 'Valle d''Aosta - Aosta', 9300), -(608, 77, 'Veneto - Belluno', 'Veneto - Belluno', 9400), -(609, 77, 'Veneto - Padova', 'Veneto - Padova', 9500), -(610, 77, 'Veneto - Rovigo', 'Veneto - Rovigo', 9600), -(611, 77, 'Veneto - Treviso', 'Veneto - Treviso', 9700), -(612, 77, 'Veneto - Venezia', 'Veneto - Venezia', 9800), -(613, 77, 'Veneto - Verona', 'Veneto - Verona', 9900), -(614, 77, 'Veneto - Vicenza', 'Veneto - Vicenza', 10000), -(615, 78, 'Йемен', 'Yemen', 100), -(616, 79, 'Кабо-Верде', 'Cape Verde', 100), -(617, 80, 'Акмолинская обл. (Целиноградская обл.)', 'Akmolinskaya obl. (Tselinogradskaya obl.)', 100), -(618, 80, 'Актюбинская обл.', 'Aktyubinskaya obl.', 200), -(619, 80, 'Алма-Атинская обл.', 'Alma-Atinskaya obl.', 300), -(620, 80, 'Восточно-Казахстанская обл.', 'Vostochno-Kazahstanskaya obl.', 400), -(621, 80, 'Гурьевская обл.', 'Gurevskaya obl.', 500), -(622, 80, 'Джезказганская обл.', 'Dzhezkazganskaya obl.', 600), -(623, 80, 'Жамбылская обл. (Джамбулская обл.)', 'Zhambylskaya obl. (Dzhambulskaya obl.)', 700), -(624, 80, 'Западно-Казахстанская обл.', 'Zapadno-Kazahstanskaya obl.', 800), -(625, 80, 'Казахстан', 'Kazahstan', 900), -(626, 80, 'Карагандинская обл.', 'Karagandinskaya obl.', 1000), -(627, 80, 'Кзылординская обл.', 'Kzylordinskaya obl.', 1100), -(628, 80, 'Кокчетавская обл.', 'Kokchetavskaya obl.', 1200), -(629, 80, 'Кустанайская обл.', 'Kustanaiskaya obl.', 1300), -(630, 80, 'Мангыстауская (Мангышлакская обл.)', 'Mangystauskaya (Mangyshlakskaya obl.)', 1400), -(631, 80, 'Павлодарская обл.', 'Pavlodarskaya obl.', 1500), -(632, 80, 'Северо-Казахстанская обл.', 'Severo-Kazahstanskaya obl.', 1600), -(633, 80, 'Талды-Курганская обл.', 'Taldy-Kurganskaya obl.', 1700), -(634, 80, 'Тургайская обл.', 'Turgaiskaya obl.', 1800), -(635, 80, 'Чимкентская обл.', 'Chimkentskaya obl.', 1900), -(636, 81, 'Камбоджа', 'Cambodia', 100), -(637, 82, 'Littoral', 'Littoral', 100), -(638, 82, 'Sudouest', 'Sudouest', 200), -(639, 82, 'Северная', 'North', 300), -(640, 82, 'Центральная', 'Central', 400), -(641, 83, 'Alberta', 'Alberta', 100), -(642, 83, 'British Columbia', 'British Columbia', 200), -(643, 83, 'Manitoba', 'Manitoba', 300), -(644, 83, 'New Brunswick', 'New Brunswick', 400), -(645, 83, 'Newfoundland', 'Newfoundland', 500), -(646, 83, 'Northwest Territories', 'Northwest Territories', 600), -(647, 83, 'Nova Scotia', 'Nova Scotia', 700), -(648, 83, 'Nunavut', 'Nunavut', 800), -(649, 83, 'Ontario', 'Ontario', 900), -(650, 83, 'Prince Edward Island', 'Prince Edward Island', 1000), -(651, 83, 'Quebec', 'Quebec', 1100), -(652, 83, 'Saskatchewan', 'Saskatchewan', 1200), -(653, 83, 'Yukon Territory', 'Yukon Territory', 1300), -(654, 84, 'Доха', 'Doha', 100), -(655, 85, 'Central', 'Central', 100), -(656, 85, 'Coast', 'Coast', 200), -(657, 85, 'Nairobi Area', 'Nairobi Area', 300), -(658, 85, 'North-Eastern', 'North-Eastern', 400), -(659, 85, 'Western', 'Western', 500), -(660, 86, 'Government controlled area', 'Government controlled area', 100), -(661, 86, 'Turkish controlled area', 'Turkish controlled area', 200), -(662, 87, 'None', 'None', 100), -(663, 88, 'Anhui', 'Anhui', 100), -(664, 88, 'Beijing', 'Beijing', 200), -(665, 88, 'Chongqing', 'Chongqing', 300), -(666, 88, 'Fujian', 'Fujian', 400), -(667, 88, 'Gansu', 'Gansu', 500), -(668, 88, 'Guangdong', 'Guangdong', 600), -(669, 88, 'Guangxi', 'Guangxi', 700), -(670, 88, 'Guizhou', 'Guizhou', 800), -(671, 88, 'Hainan', 'Hainan', 900), -(672, 88, 'Hebei', 'Hebei', 1000), -(673, 88, 'Heilongjiang', 'Heilongjiang', 1100), -(674, 88, 'Henan', 'Henan', 1200), -(675, 88, 'Hubei', 'Hubei', 1300), -(676, 88, 'Hunan', 'Hunan', 1400), -(677, 88, 'Jiangsu', 'Jiangsu', 1500), -(678, 88, 'Jiangxi', 'Jiangxi', 1600), -(679, 88, 'Jilin', 'Jilin', 1700), -(680, 88, 'Liaoning', 'Liaoning', 1800), -(681, 88, 'Nei Mongol', 'Nei Mongol', 1900), -(682, 88, 'Ningxia', 'Ningxia', 2000), -(683, 88, 'Qinghai', 'Qinghai', 2100), -(684, 88, 'Shaanxi', 'Shaanxi', 2200), -(685, 88, 'Shandong', 'Shandong', 2300), -(686, 88, 'Shanghai', 'Shanghai', 2400), -(687, 88, 'Shanxi', 'Shanxi', 2500), -(688, 88, 'Sichuan', 'Sichuan', 2600), -(689, 88, 'Tianjin', 'Tianjin', 2700), -(690, 88, 'Xinjiang', 'Xinjiang', 2800), -(691, 88, 'Yunnan', 'Yunnan', 2900), -(692, 88, 'Zhejiang', 'Zhejiang', 3000), -(693, 89, 'Amazonas', 'Amazonas', 100), -(694, 89, 'Antioquia', 'Antioquia', 200), -(695, 89, 'Atlntico', 'Atlntico', 300), -(696, 89, 'Casanare', 'Casanare', 400), -(697, 89, 'Cauca', 'Cauca', 500), -(698, 89, 'Choc', 'Choc', 600), -(699, 89, 'Crdoba', 'Crdoba', 700), -(700, 89, 'Csar', 'Csar', 800), -(701, 89, 'Cundinamarca', 'Cundinamarca', 900), -(702, 89, 'Distrito Especial', 'Distrito Especial', 1000), -(703, 89, 'Huila', 'Huila', 1100), -(704, 89, 'La Guajira', 'La Guajira', 1200), -(705, 89, 'Meta', 'Meta', 1300), -(706, 89, 'Narino', 'Narino', 1400), -(707, 89, 'Norte de Santander', 'Norte de Santander', 1500), -(708, 89, 'Quindo', 'Quindo', 1600), -(709, 89, 'Risaralda', 'Risaralda', 1700), -(710, 89, 'Santander', 'Santander', 1800), -(711, 89, 'Tolima', 'Tolima', 1900), -(712, 90, 'Коморские', 'Comoros', 100), -(713, 91, 'Конго (Brazzaville)', 'Congo (Brazzaville)', 100), -(714, 92, 'Конго', 'Congo', 100), -(715, 93, 'Alajuela', 'Alajuela', 100), -(716, 93, 'Cartago', 'Cartago', 200), -(717, 93, 'Guanacaste', 'Guanacaste', 300), -(718, 93, 'Heredia', 'Heredia', 400), -(719, 93, 'Limn', 'Limn', 500), -(720, 93, 'Puntarenas', 'Puntarenas', 600), -(721, 93, 'San Jos', 'San Jos', 700), -(722, 94, 'Кот-д''Ивуар', 'Cote D''Ivoire', 100), -(723, 95, 'Camaguey', 'Camaguey', 100), -(724, 95, 'Ciego de Avila', 'Ciego de Avila', 200), -(725, 95, 'Ciudad de la Habana', 'Ciudad de la Habana', 300), -(726, 95, 'Granma', 'Granma', 400), -(727, 95, 'Guantanamo', 'Guantanamo', 500), -(728, 95, 'Holguin', 'Holguin', 600), -(729, 95, 'Isla de la Juventud', 'Isla de la Juventud', 700), -(730, 95, 'La Habana', 'La Habana', 800), -(731, 95, 'Las Tunas', 'Las Tunas', 900), -(732, 95, 'Matanzas', 'Matanzas', 1000), -(733, 95, 'None', 'None', 1100), -(734, 95, 'Pinar del Rio', 'Pinar del Rio', 1200), -(735, 95, 'Sancti Spiritus', 'Sancti Spiritus', 1300), -(736, 95, 'Santiago de Cuba', 'Santiago de Cuba', 1400), -(737, 95, 'Villa Clara', 'Villa Clara', 1500), -(738, 96, 'al-Jahra', 'al-Jahra', 100), -(739, 96, 'al-Kuwayt', 'al-Kuwayt', 200), -(740, 97, 'Аваруа', 'Аваруа', 100), -(741, 98, 'Иссык-Кульская обл.', 'Иссык-Кульская обл.', 100), -(742, 98, 'Кыргызстан', 'Кыргызстан', 200), -(743, 98, 'Нарынская обл.', 'Нарынская обл.', 300), -(744, 98, 'Ошская обл.', 'Ошская обл.', 400), -(745, 98, 'Таласская обл.', 'Таласская обл.', 500), -(746, 99, 'Лаос', 'Laos', 100), -(747, 100, 'Латвия', 'Latviya', 100), -(748, 101, 'Лесото', 'Lesotho', 100), -(749, 102, 'Либерия', 'Liberia', 100), -(750, 103, 'Бейрут', 'Beirut', 100), -(751, 104, 'Tarabulus', 'Tarabulus', 100), -(752, 104, 'Бенгази', 'Bengasi', 200), -(753, 105, 'Литва', 'Litva', 100), -(754, 106, 'Balzers', 'Balzers', 100), -(755, 106, 'Eschen', 'Eschen', 200), -(756, 106, 'Ruggell', 'Ruggell', 300), -(757, 106, 'Schellenberg', 'Schellenberg', 400), -(758, 106, 'Triesen', 'Triesen', 500), -(759, 106, 'Vaduz', 'Vaduz', 600), -(760, 107, 'Diekirch', 'Diekirch', 100), -(761, 107, 'Grevenmacher', 'Grevenmacher', 200), -(762, 107, 'Luxembourg', 'Luxembourg', 300), -(763, 107, 'None', 'None', 400), -(764, 108, 'Маврикий', 'Mauritius', 100), -(765, 109, 'Мавритания', 'Mauritania', 100), -(766, 110, 'Мадагаскар', 'Madagascar', 100), -(767, 111, 'Aracinovo', 'Aracinovo', 100), -(768, 111, 'Berovo', 'Berovo', 200), -(769, 111, 'Bitola', 'Bitola', 300), -(770, 111, 'Bosilovo', 'Bosilovo', 400), -(771, 111, 'Dolna Banjica', 'Dolna Banjica', 500), -(772, 111, 'Drugovo', 'Drugovo', 600), -(773, 111, 'Gevgelija', 'Gevgelija', 700), -(774, 111, 'Gostivar', 'Gostivar', 800), -(775, 111, 'Karpos', 'Karpos', 900), -(776, 111, 'Kavadarci', 'Kavadarci', 1000), -(777, 111, 'Kisela Voda', 'Kisela Voda', 1100), -(778, 111, 'Kumanovo', 'Kumanovo', 1200), -(779, 111, 'Makedonska Kamenica', 'Makedonska Kamenica', 1300), -(780, 111, 'Negotino', 'Negotino', 1400), -(781, 111, 'Ohrid', 'Ohrid', 1500), -(782, 111, 'Prilep', 'Prilep', 1600), -(783, 111, 'Radovis', 'Radovis', 1700), -(784, 111, 'Saraj', 'Saraj', 1800), -(785, 111, 'Star Dojran', 'Star Dojran', 1900), -(786, 111, 'Struga', 'Struga', 2000), -(787, 111, 'Strumica', 'Strumica', 2100), -(788, 111, 'Sveti Nikole', 'Sveti Nikole', 2200), -(789, 111, 'Tetovo', 'Tetovo', 2300), -(790, 111, 'Veles', 'Veles', 2400), -(791, 112, 'Малави', 'Malawi', 100), -(792, 113, 'Малайзия', 'Malaysia', 100), -(793, 114, 'Мали', 'Mali', 100), -(794, 115, 'Мальдивские о-ва', 'Maldives', 100), -(795, 116, 'Malta', 'Malta', 100), -(796, 117, 'Марокко', 'Morocco', 100), -(797, 117, 'Танжер', 'Tangier', 200), -(798, 118, 'Фор-де-Франс', 'Fort-de-France', 100), -(799, 119, 'Aguascalientes', 'Aguascalientes', 100), -(800, 119, 'Baja California', 'Baja California', 200), -(801, 119, 'Baja California Sur', 'Baja California Sur', 300), -(802, 119, 'Campeche', 'Campeche', 400), -(803, 119, 'Chiapas', 'Chiapas', 500), -(804, 119, 'Chihuahua', 'Chihuahua', 600), -(805, 119, 'Coahuila de Zaragoza', 'Coahuila de Zaragoza', 700), -(806, 119, 'Colima', 'Colima', 800), -(807, 119, 'Distrito Federal', 'Distrito Federal', 900), -(808, 119, 'Durango', 'Durango', 1000), -(809, 119, 'Guanajuato', 'Guanajuato', 1100), -(810, 119, 'Guerrero', 'Guerrero', 1200), -(811, 119, 'Hidalgo', 'Hidalgo', 1300), -(812, 119, 'Jalisco', 'Jalisco', 1400), -(813, 119, 'Michoacn de Ocampo', 'Michoacn de Ocampo', 1500), -(814, 119, 'Morelos', 'Morelos', 1600), -(815, 119, 'Mxico', 'Mxico', 1700), -(816, 119, 'Nayarit', 'Nayarit', 1800), -(817, 119, 'None', 'None', 1900), -(818, 119, 'Nuevo Len', 'Nuevo Len', 2000), -(819, 119, 'Oaxaca', 'Oaxaca', 2100), -(820, 119, 'Puebla', 'Puebla', 2200), -(821, 119, 'Quertaro de Arteaga', 'Quertaro de Arteaga', 2300), -(822, 119, 'Quintana Roo', 'Quintana Roo', 2400), -(823, 119, 'San Luis Potos', 'San Luis Potos', 2500), -(824, 119, 'Sinaloa', 'Sinaloa', 2600), -(825, 119, 'Sonora', 'Sonora', 2700), -(826, 119, 'Tabasco', 'Tabasco', 2800), -(827, 119, 'Tamaulipas', 'Tamaulipas', 2900), -(828, 119, 'Tlaxcala', 'Tlaxcala', 3000), -(829, 119, 'Veracruz-Llave', 'Veracruz-Llave', 3100), -(830, 119, 'Yucatn', 'Yucatn', 3200), -(831, 120, 'Мозамбик', 'Mozambique', 100), -(832, 121, 'Молдова', 'Moldova', 100), -(833, 122, 'Monaco', 'Monaco', 100), -(834, 123, 'Улан-Батор', 'Ulan Bator', 100), -(835, 124, 'Мьянма (Бирма)', 'Myanmar (Burma)', 100), -(836, 125, 'Остров Мэн', 'Остров Мэн', 100), -(837, 126, 'Намибия', 'Namibia', 100), -(838, 127, 'Науру', 'Nauru', 100), -(839, 128, 'Непал', 'Nepal', 100), -(840, 129, 'Нигер', 'Niger', 100), -(841, 130, 'Нигерия', 'Nigeria', 100), -(842, 131, 'Drenthe', 'Drenthe', 100), -(843, 131, 'Flevoland', 'Flevoland', 200), -(844, 131, 'Friesland', 'Friesland', 300), -(845, 131, 'Gelderland', 'Gelderland', 400), -(846, 131, 'Groningen', 'Groningen', 500), -(847, 131, 'Limburg', 'Limburg', 600), -(848, 131, 'Noord-Brabant', 'Noord-Brabant', 700), -(849, 131, 'Noord-Holland', 'Noord-Holland', 800), -(850, 131, 'Overijssel', 'Overijssel', 900), -(851, 131, 'Utrecht', 'Utrecht', 1000), -(852, 131, 'Zeeland', 'Zeeland', 1100), -(853, 131, 'Zuid-Holland', 'Zuid-Holland', 1200), -(854, 132, 'Granada', 'Granada', 100), -(855, 132, 'Len', 'Len', 200), -(856, 132, 'Managua', 'Managua', 300), -(857, 132, 'Rio San Juan', 'Rio San Juan', 400), -(858, 133, 'Auckland', 'Auckland', 100), -(859, 133, 'Bay of Plenty', 'Bay of Plenty', 200), -(860, 133, 'Canterbury', 'Canterbury', 300), -(861, 133, 'Gisborne', 'Gisborne', 400), -(862, 133, 'Manawatu-Wanganui', 'Manawatu-Wanganui', 500), -(863, 133, 'Marlborough', 'Marlborough', 600), -(864, 133, 'Nelson', 'Nelson', 700), -(865, 133, 'Northland', 'Northland', 800), -(866, 133, 'Otago', 'Otago', 900), -(867, 133, 'Southland', 'Southland', 1000), -(868, 133, 'Taranaki', 'Taranaki', 1100), -(869, 133, 'Tasman', 'Tasman', 1200), -(870, 133, 'Wellington', 'Wellington', 1300), -(871, 133, 'West Coast', 'West Coast', 1400), -(872, 134, 'Нумеа', 'Noumea', 100), -(873, 135, 'Akershus', 'Akershus', 100), -(874, 135, 'Aust-Agder', 'Aust-Agder', 200), -(875, 135, 'Buskerud', 'Buskerud', 300), -(876, 135, 'Finnmark', 'Finnmark', 400), -(877, 135, 'Hedmark', 'Hedmark', 500), -(878, 135, 'Hordaland', 'Hordaland', 600), -(879, 135, 'More og Romsdal', 'More og Romsdal', 700), -(880, 135, 'None', 'None', 800), -(881, 135, 'Nord-Trondelag', 'Nord-Trondelag', 900), -(882, 135, 'Nordland', 'Nordland', 1000), -(883, 135, 'Oppland', 'Oppland', 1100), -(884, 135, 'Oslo', 'Oslo', 1200), -(885, 135, 'Ostfold', 'Ostfold', 1300), -(886, 135, 'Rogaland', 'Rogaland', 1400), -(887, 135, 'Sogn og Fjordane', 'Sogn og Fjordane', 1500), -(888, 135, 'Sor-Trondelag', 'Sor-Trondelag', 1600), -(889, 135, 'Telemark', 'Telemark', 1700), -(890, 135, 'Troms', 'Troms', 1800), -(891, 135, 'Vest-Agder', 'Vest-Agder', 1900), -(892, 135, 'Vestfold', 'Vestfold', 2000), -(893, 136, 'Кингстон', 'Kingston', 100), -(894, 137, 'Абу Даби', 'Abu Dhabi', 100), -(895, 137, 'Дубаи', 'Dubai', 200), -(896, 138, 'Оман', 'Oman', 100), -(897, 139, 'Пакистан', 'Pakistan', 100), -(898, 140, 'Chiriqu', 'Chiriqu', 100), -(899, 140, 'Cocl', 'Cocl', 200), -(900, 140, 'Herrera', 'Herrera', 300), -(901, 140, 'Los Santos', 'Los Santos', 400), -(902, 140, 'Panam', 'Panam', 500), -(903, 141, 'Папуа Новая Гвинея', 'Papua New Guinea', 100), -(904, 142, 'Alto Paran', 'Alto Paran', 100), -(905, 142, 'Central', 'Central', 200), -(906, 142, 'Cordillera', 'Cordillera', 300), -(907, 142, 'Paraguar', 'Paraguar', 400), -(908, 142, 'San Pedro', 'San Pedro', 500), -(909, 143, 'Amazonas', 'Amazonas', 100), -(910, 143, 'Ancash', 'Ancash', 200), -(911, 143, 'Arequipa', 'Arequipa', 300), -(912, 143, 'Ayacucho', 'Ayacucho', 400), -(913, 143, 'Cajamarca', 'Cajamarca', 500), -(914, 143, 'Callao', 'Callao', 600), -(915, 143, 'Cusco', 'Cusco', 700), -(916, 143, 'Hunuco', 'Hunuco', 800), -(917, 143, 'Ica', 'Ica', 900), -(918, 143, 'Junn', 'Junn', 1000), -(919, 143, 'La Libertad', 'La Libertad', 1100), -(920, 143, 'Lambayeque', 'Lambayeque', 1200), -(921, 143, 'Lima', 'Lima', 1300), -(922, 143, 'Loreto', 'Loreto', 1400), -(923, 143, 'Madre de Dios', 'Madre de Dios', 1500), -(924, 143, 'None', 'None', 1600), -(925, 143, 'Pasco', 'Pasco', 1700), -(926, 143, 'Piura', 'Piura', 1800), -(927, 143, 'Puno', 'Puno', 1900), -(928, 143, 'San Martn', 'San Martn', 2000), -(929, 143, 'Tacna', 'Tacna', 2100), -(930, 143, 'Tumbes', 'Tumbes', 2200), -(931, 143, 'Ucayali', 'Ucayali', 2300), -(932, 144, 'Адамстаун', 'Adamstown', 100), -(933, 145, 'Biala Podlaska', 'Biala Podlaska', 100), -(934, 145, 'Bialystok', 'Bialystok', 200), -(935, 145, 'Bielsko', 'Bielsko', 300), -(936, 145, 'Bydgoszcz', 'Bydgoszcz', 400), -(937, 145, 'Chelm', 'Chelm', 500), -(938, 145, 'Czestochowa', 'Czestochowa', 600), -(939, 145, 'Dolnoslaskie', 'Dolnoslaskie', 700), -(940, 145, 'Elblag', 'Elblag', 800), -(941, 145, 'Gdansk', 'Gdansk', 900), -(942, 145, 'Gorzow', 'Gorzow', 1000), -(943, 145, 'Jelenia Gora', 'Jelenia Gora', 1100), -(944, 145, 'Kalisz', 'Kalisz', 1200), -(945, 145, 'Katowice', 'Katowice', 1300), -(946, 145, 'Kielce', 'Kielce', 1400), -(947, 145, 'Konin', 'Konin', 1500), -(948, 145, 'Koszalin', 'Koszalin', 1600), -(949, 145, 'Krakow', 'Krakow', 1700), -(950, 145, 'Kujawsko-Pomorskie', 'Kujawsko-Pomorskie', 1800), -(951, 145, 'Legnica', 'Legnica', 1900), -(952, 145, 'Leszno', 'Leszno', 2000), -(953, 145, 'Lodz', 'Lodz', 2100), -(954, 145, 'Lodzkie', 'Lodzkie', 2200), -(955, 145, 'Lomza', 'Lomza', 2300), -(956, 145, 'Lublin', 'Lublin', 2400), -(957, 145, 'Lubuskie', 'Lubuskie', 2500), -(958, 145, 'Malopolskie', 'Malopolskie', 2600), -(959, 145, 'Mazowieckie', 'Mazowieckie', 2700), -(960, 145, 'None', 'None', 2800), -(961, 145, 'Nowy Sacz', 'Nowy Sacz', 2900), -(962, 145, 'Olsztyn', 'Olsztyn', 3000), -(963, 145, 'Opole', 'Opole', 3100), -(964, 145, 'Ostroleka', 'Ostroleka', 3200), -(965, 145, 'Pila', 'Pila', 3300), -(966, 145, 'Piotrkow', 'Piotrkow', 3400), -(967, 145, 'Plock', 'Plock', 3500), -(968, 145, 'Podkarpackie', 'Podkarpackie', 3600), -(969, 145, 'Pomorskie', 'Pomorskie', 3700), -(970, 145, 'Poznan', 'Poznan', 3800), -(971, 145, 'Przemysl', 'Przemysl', 3900), -(972, 145, 'Radom', 'Radom', 4000), -(973, 145, 'Rzeszow', 'Rzeszow', 4100), -(974, 145, 'Siedlce', 'Siedlce', 4200), -(975, 145, 'Sieradz', 'Sieradz', 4300), -(976, 145, 'Skierniewice', 'Skierniewice', 4400), -(977, 145, 'Slaskie', 'Slaskie', 4500), -(978, 145, 'Slupsk', 'Slupsk', 4600), -(979, 145, 'Suwalki', 'Suwalki', 4700), -(980, 145, 'Swietokrzyskie', 'Swietokrzyskie', 4800), -(981, 145, 'Tarnobrzeg', 'Tarnobrzeg', 4900), -(982, 145, 'Tarnow', 'Tarnow', 5000), -(983, 145, 'Torun', 'Torun', 5100), -(984, 145, 'Walbrzych', 'Walbrzych', 5200), -(985, 145, 'Warminsko-Mazurskie', 'Warminsko-Mazurskie', 5300), -(986, 145, 'Warszawa', 'Warszawa', 5400), -(987, 145, 'Wielkopolskie', 'Wielkopolskie', 5500), -(988, 145, 'Wloclawek', 'Wloclawek', 5600), -(989, 145, 'Wroclaw', 'Wroclaw', 5700), -(990, 145, 'Zachodniopomorskie', 'Zachodniopomorskie', 5800), -(991, 145, 'Zamosc', 'Zamosc', 5900), -(992, 145, 'Zielona Gora', 'Zielona Gora', 6000), -(993, 146, 'Aveiro', 'Aveiro', 100), -(994, 146, 'Azores', 'Azores', 200), -(995, 146, 'Beja', 'Beja', 300), -(996, 146, 'Braga', 'Braga', 400), -(997, 146, 'Braganca', 'Braganca', 500), -(998, 146, 'Castelo Branco', 'Castelo Branco', 600), -(999, 146, 'Coimbra', 'Coimbra', 700), -(1000, 146, 'Evora', 'Evora', 800), -(1001, 146, 'Faro', 'Faro', 900), -(1002, 146, 'Guarda', 'Guarda', 1000), -(1003, 146, 'Leiria', 'Leiria', 1100), -(1004, 146, 'Lisboa', 'Lisboa', 1200), -(1005, 146, 'Madeira', 'Madeira', 1300), -(1006, 146, 'None', 'None', 1400), -(1007, 146, 'Portalegre', 'Portalegre', 1500), -(1008, 146, 'Porto', 'Porto', 1600), -(1009, 146, 'Santarem', 'Santarem', 1700), -(1010, 146, 'Setubal', 'Setubal', 1800), -(1011, 146, 'Viana do Castelo', 'Viana do Castelo', 1900), -(1012, 146, 'Vila Real', 'Vila Real', 2000), -(1013, 146, 'Viseu', 'Viseu', 2100), -(1014, 147, 'Puerto Rico', 'Puerto Rico', 100), -(1015, 148, 'Saint-Denis', 'Saint-Denis', 100), -(1016, 149, 'Адыгея', 'Adygeya', 100), -(1017, 149, 'Алтайский край', 'Altaiskii krai', 200), -(1018, 149, 'Амурская обл.', 'Amurskaya obl.', 300), -(1019, 149, 'Архангельская обл.', 'Arhangelskaya obl.', 400), -(1020, 149, 'Астраханская обл.', 'Astrahanskaya obl.', 500), -(1021, 149, 'Башкортостан(Башкирия)', 'Bashkortostan(Bashkiriya)', 600), -(1022, 149, 'Белгородская обл.', 'Belgorodskaya obl.', 700), -(1023, 149, 'Брянская обл.', 'Bryanskaya obl.', 800), -(1024, 149, 'Бурятия', 'Buryatiya', 900), -(1025, 149, 'Владимирская обл.', 'Vladimirskaya obl.', 1000), -(1026, 149, 'Волгоградская обл.', 'Volgogradskaya obl.', 1100), -(1027, 149, 'Вологодская обл.', 'Vologodskaya obl.', 1200), -(1028, 149, 'Воронежская обл.', 'Voronezhskaya obl.', 1300), -(1029, 149, 'Дагестан', 'Dagestan', 1400), -(1030, 149, 'Еврейская обл.', 'Evreiskaya obl.', 1500), -(1031, 149, 'Ивановская обл.', 'Ivanovskaya obl.', 1600), -(1032, 149, 'Иркутская обл.', 'Irkutskaya obl.', 1700), -(1033, 149, 'Кабардино-Балкария', 'Kabardino-Balkariya', 1800), -(1034, 149, 'Калининградская обл.', 'Kaliningradskaya obl.', 1900), -(1035, 149, 'Калмыкия', 'Kalmykiya', 2000), -(1036, 149, 'Калужская обл.', 'Kaluzhskaya obl.', 2100), -(1037, 149, 'Камчатская обл.', 'Kamchatskaya obl.', 2200), -(1038, 149, 'Карачаево-Черкесская Республика', 'Karachaeva-Cherkesskaya Respublica', 2300), -(1039, 149, 'Карелия', 'Kareliya', 2400), -(1040, 149, 'Кемеровская обл.', 'Kemerovskaya obl.', 2500), -(1041, 149, 'Кировская обл.', 'Kirovskaya obl.', 2600), -(1042, 149, 'Коми', 'Komi', 2700), -(1043, 149, 'Костромская обл.', 'Kostromskaya obl.', 2800), -(1044, 149, 'Краснодарский край', 'Krasnodarskii krai', 2900), -(1045, 149, 'Красноярский край', 'Krasnoyarskii krai', 3000), -(1046, 149, 'Курганская обл.', 'Kurganskaya obl.', 3100), -(1047, 149, 'Курская обл.', 'Kurskaya obl.', 3200), -(1048, 149, 'Липецкая обл.', 'Lipetskaya obl.', 3300), -(1049, 149, 'Магаданская обл.', 'Magadanskaya obl.', 3400), -(1050, 149, 'Марий Эл', 'Marii El', 3500), -(1051, 149, 'Мордовия', 'Mordoviya', 3600), -(1052, 149, 'Москва и Московская обл.', 'Moscow & Moscow Region', 3700), -(1053, 149, 'Мурманская обл.', 'Murmanskaya obl.', 3800), -(1054, 149, 'Нижегородская (Горьковская)', 'Nizhegorodskaya (Gorkovskaya)', 3900), -(1055, 149, 'Новгородская обл.', 'Novgorodskaya obl.', 4000), -(1056, 149, 'Новосибирская обл.', 'Novosibirskaya obl.', 4100), -(1057, 149, 'Омская обл.', 'Omskaya obl.', 4200), -(1058, 149, 'Оренбургская обл.', 'Orenburgskaya obl.', 4300), -(1059, 149, 'Орловская обл.', 'Orlovskaya obl.', 4400), -(1060, 149, 'Пензенская обл.', 'Penzenskaya obl.', 4500), -(1061, 149, 'Пермский край', 'Permskiy krai', 4600), -(1062, 149, 'Приморский край', 'Primorskii krai', 4700), -(1063, 149, 'Псковская обл.', 'Pskovskaya obl.', 4800), -(1064, 149, 'Ростовская обл.', 'Rostovskaya obl.', 4900), -(1065, 149, 'Рязанская обл.', 'Ryazanskaya obl.', 5000), -(1066, 149, 'Самарская обл.', 'Samarskaya obl.', 5100), -(1067, 149, 'Санкт-Петербург и область', 'Saint-Petersburg and Region', 5200), -(1068, 149, 'Саратовская обл.', 'Saratovskaya obl.', 5300), -(1069, 149, 'Саха (Якутия)', 'Saha (Yakutiya)', 5400), -(1070, 149, 'Сахалин', 'Sahalin', 5500), -(1071, 149, 'Свердловская обл.', 'Sverdlovskaya obl.', 5600), -(1072, 149, 'Северная Осетия', 'Severnaya Osetiya', 5700), -(1073, 149, 'Смоленская обл.', 'Smolenskaya obl.', 5800), -(1074, 149, 'Ставропольский край', 'Stavropolskii krai', 5900), -(1075, 149, 'Тамбовская обл.', 'Tambovskaya obl.', 6000), -(1076, 149, 'Татарстан', 'Tatarstan', 6100), -(1077, 149, 'Тверская обл.', 'Tverskaya obl.', 6200), -(1078, 149, 'Томская обл.', 'Tomskaya obl.', 6300), -(1079, 149, 'Тува (Тувинская Респ.)', 'Tuva (Tuvinskaya Resp.)', 6400), -(1080, 149, 'Тульская обл.', 'Tulskaya obl.', 6500); -INSERT INTO `prefix_geo_region` (`id`, `country_id`, `name_ru`, `name_en`, `sort`) VALUES -(1081, 149, 'Тюменская обл. и Ханты-Мансийский АО', 'Tyumenskaya obl. i Hanty-Mansiiskii AO', 6600), -(1082, 149, 'Удмуртия', 'Udmurtiya', 6700), -(1083, 149, 'Ульяновская обл.', 'Ulyanovskaya obl.', 6800), -(1084, 149, 'Уральская обл.', 'Uralskaya obl.', 6900), -(1085, 149, 'Хабаровский край', 'Habarovskii krai', 7000), -(1086, 149, 'Хакасия', 'Hakasiya', 7100), -(1087, 149, 'Челябинская обл.', 'Chelyabinskaya obl.', 7200), -(1088, 149, 'Чечено-Ингушетия', 'Checheno-Ingushetiya', 7300), -(1089, 149, 'Читинская обл.', 'Chitinskaya obl.', 7400), -(1090, 149, 'Чувашия', 'Chuvashiya', 7500), -(1091, 149, 'Чукотский АО', 'Chukotskii AO', 7600), -(1092, 149, 'Ямало-Ненецкий АО', 'Yamalo-Nenetskii AO', 7700), -(1093, 149, 'Ярославская обл.', 'Yaroslavskaya obl.', 7800), -(1094, 150, 'Руанда', 'Rwanda', 100), -(1095, 151, 'Alba', 'Alba', 100), -(1096, 151, 'Arad', 'Arad', 200), -(1097, 151, 'Arges', 'Arges', 300), -(1098, 151, 'Bacau', 'Bacau', 400), -(1099, 151, 'Bihor', 'Bihor', 500), -(1100, 151, 'Bistrita-Nasaud', 'Bistrita-Nasaud', 600), -(1101, 151, 'Botosani', 'Botosani', 700), -(1102, 151, 'Braila', 'Braila', 800), -(1103, 151, 'Brasov', 'Brasov', 900), -(1104, 151, 'Bucuresti', 'Bucuresti', 1000), -(1105, 151, 'Buzau', 'Buzau', 1100), -(1106, 151, 'Calarasi', 'Calarasi', 1200), -(1107, 151, 'Caras-Severin', 'Caras-Severin', 1300), -(1108, 151, 'Cluj', 'Cluj', 1400), -(1109, 151, 'Constanta', 'Constanta', 1500), -(1110, 151, 'Covasna', 'Covasna', 1600), -(1111, 151, 'Dambovita', 'Dambovita', 1700), -(1112, 151, 'Dolj', 'Dolj', 1800), -(1113, 151, 'Galati', 'Galati', 1900), -(1114, 151, 'Giurgiu', 'Giurgiu', 2000), -(1115, 151, 'Gorj', 'Gorj', 2100), -(1116, 151, 'Harghita', 'Harghita', 2200), -(1117, 151, 'Hunedoara', 'Hunedoara', 2300), -(1118, 151, 'Ialomita', 'Ialomita', 2400), -(1119, 151, 'Iasi', 'Iasi', 2500), -(1120, 151, 'Ilfov', 'Ilfov', 2600), -(1121, 151, 'Maramures', 'Maramures', 2700), -(1122, 151, 'Mehedinti', 'Mehedinti', 2800), -(1123, 151, 'Mures', 'Mures', 2900), -(1124, 151, 'Neamt', 'Neamt', 3000), -(1125, 151, 'Olt', 'Olt', 3100), -(1126, 151, 'Prahova', 'Prahova', 3200), -(1127, 151, 'Salaj', 'Salaj', 3300), -(1128, 151, 'Satu Mare', 'Satu Mare', 3400), -(1129, 151, 'Sibiu', 'Sibiu', 3500), -(1130, 151, 'Suceava', 'Suceava', 3600), -(1131, 151, 'Teleorman', 'Teleorman', 3700), -(1132, 151, 'Timis', 'Timis', 3800), -(1133, 151, 'Tulcea', 'Tulcea', 3900), -(1134, 151, 'Valcea', 'Valcea', 4000), -(1135, 151, 'Vaslui', 'Vaslui', 4100), -(1136, 151, 'Vrancea', 'Vrancea', 4200), -(1137, 152, 'Ahuachapan', 'Ahuachapan', 100), -(1138, 152, 'La Libertad', 'La Libertad', 200), -(1139, 152, 'La Paz', 'La Paz', 300), -(1140, 152, 'La Union', 'La Union', 400), -(1141, 152, 'San Miguel', 'San Miguel', 500), -(1142, 152, 'San Salvador', 'San Salvador', 600), -(1143, 153, 'Самоа', 'Samoa', 100), -(1144, 154, 'Acquaviva', 'Acquaviva', 100), -(1145, 154, 'Chiesanuova', 'Chiesanuova', 200), -(1146, 154, 'Serravalle', 'Serravalle', 300), -(1147, 155, 'Сан-Томе', 'San Tome', 100), -(1148, 156, 'Саудовская Аравия', 'Saudi Arabia', 100), -(1149, 157, 'Свазиленд', 'Swaziland', 100), -(1150, 158, 'Кастри', 'Castries', 100), -(1151, 159, 'Джеймстаун', 'Jamestown', 100), -(1152, 160, 'Korea', 'Korea', 100), -(1153, 161, 'Сейшеллы', 'Seychelles', 100), -(1154, 162, 'Сен-Пьер', 'Saint Pierre', 100), -(1155, 163, 'Сенегал', 'Senegal', 100), -(1156, 164, 'Бастер', 'Basseterre', 100), -(1157, 165, 'Кингстаун', 'Kingstown', 100), -(1158, 166, 'Воеводина', 'Vojvodina', 100), -(1159, 166, 'Косово и Метохия', 'Kosovo and Metohija', 200), -(1160, 166, 'Центральная Сербия', 'Central Serbia', 300), -(1161, 167, 'Сингапур', 'Singapore', 100), -(1162, 168, 'Дамаск', 'Damascus', 100), -(1163, 169, 'Bratislava', 'Bratislava', 100), -(1164, 169, 'Kosice', 'Kosice', 200), -(1165, 169, 'Nitra', 'Nitra', 300), -(1166, 169, 'None', 'None', 400), -(1167, 169, 'Presov', 'Presov', 500), -(1168, 169, 'Trencin', 'Trencin', 600), -(1169, 169, 'Trnava', 'Trnava', 700), -(1170, 170, 'Bohinj', 'Bohinj', 100), -(1171, 170, 'Brezovica', 'Brezovica', 200), -(1172, 170, 'None', 'None', 300), -(1173, 171, 'Соломоновы о-ва', 'Solomon Islands', 100), -(1174, 172, 'Могадишо', 'Mogadishu', 100), -(1175, 173, 'Судан', 'Sudan', 100), -(1176, 174, 'Paramaribo', 'Paramaribo', 100), -(1177, 175, 'Alabama', 'Alabama', 100), -(1178, 175, 'Alaska', 'Alaska', 200), -(1179, 175, 'American Samoa', 'American Samoa', 300), -(1180, 175, 'Arizona', 'Arizona', 400), -(1181, 175, 'Arkansas', 'Arkansas', 500), -(1182, 175, 'California', 'California', 600), -(1183, 175, 'Colorado', 'Colorado', 700), -(1184, 175, 'Connecticut', 'Connecticut', 800), -(1185, 175, 'Delaware', 'Delaware', 900), -(1186, 175, 'District of Columbia', 'District of Columbia', 1000), -(1187, 175, 'Florida', 'Florida', 1100), -(1188, 175, 'Georgia', 'Georgia', 1200), -(1189, 175, 'Hawaii', 'Hawaii', 1300), -(1190, 175, 'Idaho', 'Idaho', 1400), -(1191, 175, 'Illinois', 'Illinois', 1500), -(1192, 175, 'Indiana', 'Indiana', 1600), -(1193, 175, 'Iowa', 'Iowa', 1700), -(1194, 175, 'Kansas', 'Kansas', 1800), -(1195, 175, 'Kentucky', 'Kentucky', 1900), -(1196, 175, 'Louisiana', 'Louisiana', 2000), -(1197, 175, 'Maine', 'Maine', 2100), -(1198, 175, 'Maryland', 'Maryland', 2200), -(1199, 175, 'Massachusetts', 'Massachusetts', 2300), -(1200, 175, 'Michigan', 'Michigan', 2400), -(1201, 175, 'Minnesota', 'Minnesota', 2500), -(1202, 175, 'Mississippi', 'Mississippi', 2600), -(1203, 175, 'Missouri', 'Missouri', 2700), -(1204, 175, 'Montana', 'Montana', 2800), -(1205, 175, 'Nebraska', 'Nebraska', 2900), -(1206, 175, 'Nevada', 'Nevada', 3000), -(1207, 175, 'New Hampshire', 'New Hampshire', 3100), -(1208, 175, 'New Jersey', 'New Jersey', 3200), -(1209, 175, 'New Mexico', 'New Mexico', 3300), -(1210, 175, 'New York', 'New York', 3400), -(1211, 175, 'North Carolina', 'North Carolina', 3500), -(1212, 175, 'North Dakota', 'North Dakota', 3600), -(1213, 175, 'Ohio', 'Ohio', 3700), -(1214, 175, 'Oklahoma', 'Oklahoma', 3800), -(1215, 175, 'Oregon', 'Oregon', 3900), -(1216, 175, 'Pennsylvania', 'Pennsylvania', 4000), -(1217, 175, 'Rhode Island', 'Rhode Island', 4100), -(1218, 175, 'South Carolina', 'South Carolina', 4200), -(1219, 175, 'South Dakota', 'South Dakota', 4300), -(1220, 175, 'Tennessee', 'Tennessee', 4400), -(1221, 175, 'Texas', 'Texas', 4500), -(1222, 175, 'Utah', 'Utah', 4600), -(1223, 175, 'Vermont', 'Vermont', 4700), -(1224, 175, 'Virgin Islands', 'Virgin Islands', 4800), -(1225, 175, 'Virginia', 'Virginia', 4900), -(1226, 175, 'Washington', 'Washington', 5000), -(1227, 175, 'West Virginia', 'West Virginia', 5100), -(1228, 175, 'Wisconsin', 'Wisconsin', 5200), -(1229, 175, 'Wyoming', 'Wyoming', 5300), -(1230, 176, 'Фритаун', 'Freetown', 100), -(1231, 177, 'Горно-Бадахшанская обл.', 'Горно-Бадахшанская обл.', 100), -(1232, 177, 'Кулябская обл.', 'Кулябская обл.', 200), -(1233, 177, 'Курган-Тюбинская обл.', 'Курган-Тюбинская обл.', 300), -(1234, 177, 'Согдийская обл.', 'Согдийская обл.', 400), -(1235, 177, 'Таджикистан', 'Таджикистан', 500), -(1236, 178, 'Сураттани', 'Сураттани', 100), -(1237, 178, 'Тайланд', 'Thailand', 200), -(1238, 178, 'Чон Бури', 'Чон Бури', 300), -(1239, 179, 'Тайвань', 'Taiwan', 100), -(1240, 180, 'Танзания', 'Tanzania', 100), -(1241, 181, 'Того', 'Togo', 100), -(1242, 182, 'Факаофо', 'Fakaofo', 100), -(1243, 183, 'Тонга', 'Tonga', 100), -(1244, 184, 'Порт-оф-Спейн', 'Port of Spain', 100), -(1245, 185, 'Тувалу', 'Tuvalu', 100), -(1246, 186, 'Tunisia', 'Tunisia', 100), -(1247, 187, 'Ашхабадская обл.', 'Ашхабадская обл.', 100), -(1248, 187, 'Красноводская обл.', 'Красноводская обл.', 200), -(1249, 187, 'Марыйская обл.', 'Марыйская обл.', 300), -(1250, 187, 'Ташаузская обл.', 'Ташаузская обл.', 400), -(1251, 187, 'Чарджоуская обл.', 'Чарджоуская обл.', 500), -(1252, 188, 'Grand Turk', 'Grand Turk', 100), -(1253, 189, 'Bartin', 'Bartin', 100), -(1254, 189, 'Bayburt', 'Bayburt', 200), -(1255, 189, 'Karabuk', 'Karabuk', 300), -(1256, 189, 'Адана', 'Adana', 400), -(1257, 189, 'Айдын', 'Aydin', 500), -(1258, 189, 'Амасья', 'Amasya', 600), -(1259, 189, 'Анкара', 'Ankara', 700), -(1260, 189, 'Анталья', 'Antalya', 800), -(1261, 189, 'Артвин', 'Artvin', 900), -(1262, 189, 'Афьон', 'Afion', 1000), -(1263, 189, 'Балыкесир', 'Balikesir', 1100), -(1264, 189, 'Биледжик', 'Bilecik', 1200), -(1265, 189, 'Бурса', 'Bursa', 1300), -(1266, 189, 'Газиантеп', 'Gaziantep', 1400), -(1267, 189, 'Денизли', 'Denizli', 1500), -(1268, 189, 'Измир', 'Izmir', 1600), -(1269, 189, 'Испарта', 'Isparta', 1700), -(1270, 189, 'Ичель', 'Icel', 1800), -(1271, 189, 'Кайсери', 'Kayseri', 1900), -(1272, 189, 'Карс', 'Kars', 2000), -(1273, 189, 'Коджаэли', 'Kodjaeli', 2100), -(1274, 189, 'Конья', 'Konya', 2200), -(1275, 189, 'Кыркларели', 'Kirklareli', 2300), -(1276, 189, 'Кютахья', 'Kutahya', 2400), -(1277, 189, 'Малатья', 'Malatya', 2500), -(1278, 189, 'Маниса', 'Manisa', 2600), -(1279, 189, 'Сакарья', 'Sakarya', 2700), -(1280, 189, 'Самсун', 'Samsun', 2800), -(1281, 189, 'Сивас', 'Sivas', 2900), -(1282, 189, 'Стамбул', 'Istanbul', 3000), -(1283, 189, 'Чорум', 'Corum', 3100), -(1284, 189, 'Эдирне', 'Edirne', 3200), -(1285, 189, 'Элязыг', 'Elazig', 3300), -(1286, 189, 'Эрзинджан', 'Erzincan', 3400), -(1287, 189, 'Эрзурум', 'Erzurum', 3500), -(1288, 189, 'Эскишехир', 'Eskisehir', 3600), -(1289, 190, 'Jinja', 'Jinja', 100), -(1290, 190, 'Kampala', 'Kampala', 200), -(1291, 191, 'Андижанская обл.', 'Андижанская обл.', 100), -(1292, 191, 'Бухарская обл.', 'Бухарская обл.', 200), -(1293, 191, 'Джизакская обл.', 'Джизакская обл.', 300), -(1294, 191, 'Каракалпакия', 'Каракалпакия', 400), -(1295, 191, 'Кашкадарьинская обл.', 'Кашкадарьинская обл.', 500), -(1296, 191, 'Навоийская обл.', 'Навоийская обл.', 600), -(1297, 191, 'Наманганская обл.', 'Наманганская обл.', 700), -(1298, 191, 'Самаркандская обл.', 'Самаркандская обл.', 800), -(1299, 191, 'Сурхандарьинская обл.', 'Сурхандарьинская обл.', 900), -(1300, 191, 'Сырдарьинская обл.', 'Сырдарьинская обл.', 1000), -(1301, 191, 'Ташкентская обл.', 'Ташкентская обл.', 1100), -(1302, 191, 'Ферганская обл.', 'Ферганская обл.', 1200), -(1303, 191, 'Хорезмская обл.', 'Хорезмская обл.', 1300), -(1304, 192, 'Винницкая обл.', 'Vinnitskaya obl.', 100), -(1305, 192, 'Волынская обл.', 'Volynskaya obl.', 200), -(1306, 192, 'Днепропетровская обл.', 'Dnepropetrovskaya obl.', 300), -(1307, 192, 'Донецкая обл.', 'Donetskaya obl.', 400), -(1308, 192, 'Житомирская обл.', 'Zhitomirskaya obl.', 500), -(1309, 192, 'Закарпатская обл.', 'Zakarpatskaya obl.', 600), -(1310, 192, 'Запорожская обл.', 'Zaporozhskaya obl.', 700), -(1311, 192, 'Ивано-Франковская обл.', 'Ivano-Frankovskaya obl.', 800), -(1312, 192, 'Киевская обл.', 'Kievskaya obl.', 900), -(1313, 192, 'Кировоградская обл.', 'Kirovogradskaya obl.', 1000), -(1314, 192, 'Крымская обл.', 'Krymskaya obl.', 1100), -(1315, 192, 'Луганская обл.', 'Luganskaya obl.', 1200), -(1316, 192, 'Львовская обл.', 'Lvovskaya obl.', 1300), -(1317, 192, 'Николаевская обл.', 'Nikolaevskaya obl.', 1400), -(1318, 192, 'Одесская обл.', 'Odesskaya obl.', 1500), -(1319, 192, 'Полтавская обл.', 'Poltavskaya obl.', 1600), -(1320, 192, 'Ровенская обл.', 'Rovenskaya obl.', 1700), -(1321, 192, 'Сумская обл.', 'Sumskaya obl.', 1800), -(1322, 192, 'Тернопольская обл.', 'Ternopolskaya obl.', 1900), -(1323, 192, 'Украина', 'Ukraina', 2000), -(1324, 192, 'Харьковская обл.', 'Harkovskaya obl.', 2100), -(1325, 192, 'Херсонская обл.', 'Hersonskaya obl.', 2200), -(1326, 192, 'Хмельницкая обл.', 'Hmelnitskaya obl.', 2300), -(1327, 192, 'Черкасская обл.', 'Cherkasskaya obl.', 2400), -(1328, 192, 'Черниговская обл.', 'Chernigovskaya obl.', 2500), -(1329, 192, 'Черновицкая обл.', 'Chernovitskaya obl.', 2600), -(1330, 193, 'Canelones', 'Canelones', 100), -(1331, 193, 'Colonia', 'Colonia', 200), -(1332, 193, 'Lavalleja', 'Lavalleja', 300), -(1333, 193, 'Maldonado', 'Maldonado', 400), -(1334, 193, 'Montevideo', 'Montevideo', 500), -(1335, 193, 'Paysand', 'Paysand', 600), -(1336, 193, 'Rivera', 'Rivera', 700), -(1337, 193, 'Ro Negro', 'Ro Negro', 800), -(1338, 193, 'Salto', 'Salto', 900), -(1339, 193, 'Tacuaremb', 'Tacuaremb', 1000), -(1340, 193, 'Treinta y Tres', 'Treinta y Tres', 1100), -(1341, 194, 'Торсхавн', 'Торсхавн', 100), -(1342, 195, 'Фиджи', 'Fiji', 100), -(1343, 196, 'Филиппины', 'Philippines', 100), -(1344, 197, 'Eastern Finland', 'Eastern Finland', 100), -(1345, 197, 'Lapland', 'Lapland', 200), -(1346, 197, 'None', 'None', 300), -(1347, 197, 'Oulu', 'Oulu', 400), -(1348, 197, 'Southern Finland', 'Southern Finland', 500), -(1349, 197, 'Western Finland', 'Western Finland', 600), -(1350, 197, '•land', '•land', 700), -(1351, 198, 'Ain', 'Ain', 100), -(1352, 198, 'Aisne', 'Aisne', 200), -(1353, 198, 'Allier', 'Allier', 300), -(1354, 198, 'Alpes-de-Haute-Provence', 'Alpes-de-Haute-Provence', 400), -(1355, 198, 'Alpes-Maritimes', 'Alpes-Maritimes', 500), -(1356, 198, 'Ardche', 'Ardche', 600), -(1357, 198, 'Ardennes', 'Ardennes', 700), -(1358, 198, 'Arige', 'Arige', 800), -(1359, 198, 'Aube', 'Aube', 900), -(1360, 198, 'Aude', 'Aude', 1000), -(1361, 198, 'Aveyron', 'Aveyron', 1100), -(1362, 198, 'Bas Rhin', 'Bas Rhin', 1200), -(1363, 198, 'Bouches-du-Rhne', 'Bouches-du-Rhne', 1300), -(1364, 198, 'Calvados', 'Calvados', 1400), -(1365, 198, 'Cantal', 'Cantal', 1500), -(1366, 198, 'Charente', 'Charente', 1600), -(1367, 198, 'Charente Maritime', 'Charente Maritime', 1700), -(1368, 198, 'Cher', 'Cher', 1800), -(1369, 198, 'Corrze', 'Corrze', 1900), -(1370, 198, 'Corse', 'Corse', 2000), -(1371, 198, 'Creuse', 'Creuse', 2100), -(1372, 198, 'Cte d''Or', 'Cte d''Or', 2200), -(1373, 198, 'Ctes d''Armor', 'Ctes d''Armor', 2300), -(1374, 198, 'Deux-Svres', 'Deux-Svres', 2400), -(1375, 198, 'Dordogne', 'Dordogne', 2500), -(1376, 198, 'Doubs', 'Doubs', 2600), -(1377, 198, 'Drme', 'Drme', 2700), -(1378, 198, 'Essone', 'Essone', 2800), -(1379, 198, 'Eure', 'Eure', 2900), -(1380, 198, 'Eure-et-Loire', 'Eure-et-Loire', 3000), -(1381, 198, 'Finistre', 'Finistre', 3100), -(1382, 198, 'Gard', 'Gard', 3200), -(1383, 198, 'Gers', 'Gers', 3300), -(1384, 198, 'Gironde', 'Gironde', 3400), -(1385, 198, 'Haut Rhin', 'Haut Rhin', 3500), -(1386, 198, 'Haute-Garonne', 'Haute-Garonne', 3600), -(1387, 198, 'Haute-Loire', 'Haute-Loire', 3700), -(1388, 198, 'Haute-Marne', '', 3800), -(1389, 198, 'Haute-Sane', 'Haute-Sane', 3900), -(1390, 198, 'Haute-Savoie', 'Haute-Savoie', 4000), -(1391, 198, 'Haute-Vienne', 'Haute-Vienne', 4100), -(1392, 198, 'Hautes-Alpes', 'Hautes-Alpes', 4200), -(1393, 198, 'Hautes-Pyrnes', 'Hautes-Pyrnes', 4300), -(1394, 198, 'Hauts-de-Seine', 'Hauts-de-Seine', 4400), -(1395, 198, 'Hrault', 'Hrault', 4500), -(1396, 198, 'Ille et Vilaine', 'Ille et Vilaine', 4600), -(1397, 198, 'Indre', 'Indre', 4700), -(1398, 198, 'Indre-et-Loire', 'Indre-et-Loire', 4800), -(1399, 198, 'Isre', 'Isre', 4900), -(1400, 198, 'Jura', 'Jura', 5000), -(1401, 198, 'Landes', 'Landes', 5100), -(1402, 198, 'Loir-et-Cher', 'Loir-et-Cher', 5200), -(1403, 198, 'Loire', 'Loire', 5300), -(1404, 198, 'Loire Atlantique', 'Loire Atlantique', 5400), -(1405, 198, 'Loiret', 'Loiret', 5500), -(1406, 198, 'Lot', 'Lot', 5600), -(1407, 198, 'Lot-et-Garonne', 'Lot-et-Garonne', 5700), -(1408, 198, 'Lozre', 'Lozre', 5800), -(1409, 198, 'Maine et Loire', 'Maine et Loire', 5900), -(1410, 198, 'Manche', 'Manche', 6000), -(1411, 198, 'Marne', 'Marne', 6100), -(1412, 198, 'Mayenne', 'Mayenne', 6200), -(1413, 198, 'Meurthe-et-Moselle', 'Meurthe-et-Moselle', 6300), -(1414, 198, 'Meuse', 'Meuse', 6400), -(1415, 198, 'Morbihan', 'Morbihan', 6500), -(1416, 198, 'Moselle', 'Moselle', 6600), -(1417, 198, 'Nord', 'Nord', 6700), -(1418, 198, 'Oise', 'Oise', 6800), -(1419, 198, 'Orne', 'Orne', 6900), -(1420, 198, 'Paris', 'Paris', 7000), -(1421, 198, 'Pas-de-Calais', 'Pas-de-Calais', 7100), -(1422, 198, 'Puy-de-Dme', 'Puy-de-Dme', 7200), -(1423, 198, 'Pyrnes-Atlantiques', 'Pyrnes-Atlantiques', 7300), -(1424, 198, 'Pyrnes-Orientales', 'Pyrnes-Orientales', 7400), -(1425, 198, 'Rhne', 'Rhne', 7500), -(1426, 198, 'Sane et Loire', 'Sane et Loire', 7600), -(1427, 198, 'Savoie', 'Savoie', 7700), -(1428, 198, 'Seine-et-Marne', 'Seine-et-Marne', 7800), -(1429, 198, 'Seine-Maritime', 'Seine-Maritime', 7900), -(1430, 198, 'Seine-Saint-Denis', 'Seine-Saint-Denis', 8000), -(1431, 198, 'Somme', 'Somme', 8100), -(1432, 198, 'Tarn', 'Tarn', 8200), -(1433, 198, 'Tarn-et-Garonne', 'Tarn-et-Garonne', 8300), -(1434, 198, 'Territoire de Belfort', 'Territoire de Belfort', 8400), -(1435, 198, 'Val-d''Oise', 'Val-d''Oise', 8500), -(1436, 198, 'Val-de-Marne', 'Val-de-Marne', 8600), -(1437, 198, 'Var', 'Var', 8700), -(1438, 198, 'Vaucluse', 'Vaucluse', 8800), -(1439, 198, 'Vende', 'Vende', 8900), -(1440, 198, 'Vienne', 'Vienne', 9000), -(1441, 198, 'Vosges', 'Vosges', 9100), -(1442, 198, 'Yonne', 'Yonne', 9200), -(1443, 198, 'Yvelines', 'Yvelines', 9300), -(1444, 199, 'Caennes', 'Caennes', 100), -(1445, 200, 'Папеэте', 'Папеэте', 100), -(1446, 201, 'Dubrovacko-Neretvanska', 'Dubrovacko-Neretvanska', 100), -(1447, 201, 'Grad Zagreb', 'Grad Zagreb', 200), -(1448, 201, 'Istarska', 'Istarska', 300), -(1449, 201, 'Karlovacka', 'Karlovacka', 400), -(1450, 201, 'Medimurska', 'Medimurska', 500), -(1451, 201, 'None', 'None', 600), -(1452, 201, 'Primorsko-Goranska', 'Primorsko-Goranska', 700), -(1453, 201, 'Sibensko-Kninska', 'Sibensko-Kninska', 800), -(1454, 201, 'Sisacko-Moslavacka', 'Sisacko-Moslavacka', 900), -(1455, 201, 'Splitsko-Dalmatinska', 'Splitsko-Dalmatinska', 1000), -(1456, 201, 'Varazdinska', 'Varazdinska', 1100), -(1457, 201, 'Zagrebacka', 'Zagrebacka', 1200), -(1458, 202, 'Чад', 'Chad', 100), -(1459, 203, 'Черногория', 'Montenegro', 100), -(1460, 204, 'Hlavni Mesto Praha', 'Hlavni Mesto Praha', 100), -(1461, 204, 'Jihocesky Kraj', 'Jihocesky Kraj', 200), -(1462, 204, 'Jihomoravsky Kraj', 'Jihomoravsky Kraj', 300), -(1463, 204, 'Karlovarsky Kraj', 'Karlovarsky Kraj', 400), -(1464, 204, 'Kralovehradecky Kraj', 'Kralovehradecky Kraj', 500), -(1465, 204, 'Liberecky Kraj', 'Liberecky Kraj', 600), -(1466, 204, 'Moravskoslezsky Kraj', 'Moravskoslezsky Kraj', 700), -(1467, 204, 'None', 'None', 800), -(1468, 204, 'Olomoucky Kraj', 'Olomoucky Kraj', 900), -(1469, 204, 'Pardubicky Kraj', 'Pardubicky Kraj', 1000), -(1470, 204, 'Plzensky Kraj', 'Plzensky Kraj', 1100), -(1471, 204, 'Stredocesky Kraj', 'Stredocesky Kraj', 1200), -(1472, 204, 'Ustecky Kraj', 'Ustecky Kraj', 1300), -(1473, 204, 'Vysocina', 'Vysocina', 1400), -(1474, 204, 'Zlinsky Kraj', 'Zlinsky Kraj', 1500), -(1475, 205, 'Aisn del General Carlos Ibnez del Campo', 'Aisn del General Carlos Ibnez del Campo', 100), -(1476, 205, 'Antofagasta', 'Antofagasta', 200), -(1477, 205, 'Araucana', 'Araucana', 300), -(1478, 205, 'Atacama', 'Atacama', 400), -(1479, 205, 'Bo-Bo', 'Bo-Bo', 500), -(1480, 205, 'Coquimbo', 'Coquimbo', 600), -(1481, 205, 'Libertador General Bernardo O''Higgins', 'Libertador General Bernardo O''Higgins', 700), -(1482, 205, 'Los Lagos', 'Los Lagos', 800), -(1483, 205, 'Magallanes y de la Antrtica Chilena', 'Magallanes y de la Antrtica Chilena', 900), -(1484, 205, 'Maule', 'Maule', 1000), -(1485, 205, 'Region Metropolitana', 'Region Metropolitana', 1100), -(1486, 205, 'Tarapac', 'Tarapac', 1200), -(1487, 205, 'Valparaso', 'Valparaso', 1300), -(1488, 206, 'Aargau', 'Aargau', 100), -(1489, 206, 'Appenzell Ausserrhoden', 'Appenzell Ausserrhoden', 200), -(1490, 206, 'Appenzell Innerrhoden', 'Appenzell Innerrhoden', 300), -(1491, 206, 'Basel-Landschaft', 'Basel-Landschaft', 400), -(1492, 206, 'Basel-Stadt', 'Basel-Stadt', 500), -(1493, 206, 'Bern', 'Bern', 600), -(1494, 206, 'Fribourg', 'Fribourg', 700), -(1495, 206, 'Genve', 'Genve', 800), -(1496, 206, 'Glarus', 'Glarus', 900), -(1497, 206, 'Graubnden', 'Graubnden', 1000), -(1498, 206, 'Jura', 'Jura', 1100), -(1499, 206, 'Luzern', 'Luzern', 1200), -(1500, 206, 'Neuchtel', 'Neuchtel', 1300), -(1501, 206, 'Nidwalden', 'Nidwalden', 1400), -(1502, 206, 'Obwalden', 'Obwalden', 1500), -(1503, 206, 'Sankt Gallen', 'Sankt Gallen', 1600), -(1504, 206, 'Schaffhausen', 'Schaffhausen', 1700), -(1505, 206, 'Schwyz', 'Schwyz', 1800), -(1506, 206, 'Solothurn', 'Solothurn', 1900), -(1507, 206, 'Thurgau', 'Thurgau', 2000), -(1508, 206, 'Ticino', 'Ticino', 2100), -(1509, 206, 'Uri', 'Uri', 2200), -(1510, 206, 'Valais', 'Valais', 2300), -(1511, 206, 'Vaud', 'Vaud', 2400), -(1512, 206, 'Zrich', 'Zrich', 2500), -(1513, 206, 'Zug', 'Zug', 2600), -(1514, 207, 'Blekinge Lan', 'Blekinge Lan', 100), -(1515, 207, 'Dalarnas Lan', 'Dalarnas Lan', 200), -(1516, 207, 'Gavleborgs Lan', 'Gavleborgs Lan', 300), -(1517, 207, 'Gotlands Lan', 'Gotlands Lan', 400), -(1518, 207, 'Hallands Lan', 'Hallands Lan', 500), -(1519, 207, 'Jamtlands Lan', 'Jamtlands Lan', 600), -(1520, 207, 'Jonkopings Lan', 'Jonkopings Lan', 700), -(1521, 207, 'Kalmar Lan', 'Kalmar Lan', 800), -(1522, 207, 'Kronobergs Lan', 'Kronobergs Lan', 900), -(1523, 207, 'None', 'None', 1000), -(1524, 207, 'Norrbottens Lan', 'Norrbottens Lan', 1100), -(1525, 207, 'Orebro Lan', 'Orebro Lan', 1200), -(1526, 207, 'Ostergotlands Lan', 'Ostergotlands Lan', 1300), -(1527, 207, 'Skane Lan', 'Skane Lan', 1400), -(1528, 207, 'Sodermanlands Lan', 'Sodermanlands Lan', 1500), -(1529, 207, 'Stockholms Lan', 'Stockholms Lan', 1600), -(1530, 207, 'Uppsala Lan', 'Uppsala Lan', 1700), -(1531, 207, 'Varmlands Lan', 'Varmlands Lan', 1800), -(1532, 207, 'Vasterbottens Lan', 'Vasterbottens Lan', 1900), -(1533, 207, 'Vasternorrlands Lan', 'Vasternorrlands Lan', 2000), -(1534, 207, 'Vastmanlands Lan', 'Vastmanlands Lan', 2100), -(1535, 207, 'Vastra Gotaland', 'Vastra Gotaland', 2200), -(1536, 208, 'Шри-Ланка', 'Sri Lanka', 100), -(1537, 209, 'Azuay', 'Azuay', 100), -(1538, 209, 'Bolvar', 'Bolvar', 200), -(1539, 209, 'Chimborazo', 'Chimborazo', 300), -(1540, 209, 'El Oro', 'El Oro', 400), -(1541, 209, 'Galpagos', 'Galpagos', 500), -(1542, 209, 'Guayas', 'Guayas', 600), -(1543, 209, 'Imbabura', 'Imbabura', 700), -(1544, 209, 'Loja', 'Loja', 800), -(1545, 209, 'Manab', 'Manab', 900), -(1546, 209, 'Napo', 'Napo', 1000), -(1547, 209, 'Pastaza', 'Pastaza', 1100), -(1548, 209, 'Pichincha', 'Pichincha', 1200), -(1549, 209, 'Tungurahua', 'Tungurahua', 1300), -(1550, 210, 'Малабо', 'Малабо', 100), -(1551, 211, 'Эритрея', 'Eritrea', 100), -(1552, 212, 'Эстония', 'Estoniya', 100), -(1553, 213, 'Эфиопия', 'Ethiopia', 100), -(1554, 214, 'Йоханесбург', 'Johannesburg', 100), -(1555, 215, 'Cheju', 'Cheju', 100), -(1556, 215, 'Chollabuk', 'Chollabuk', 200), -(1557, 215, 'Chollanam', 'Chollanam', 300), -(1558, 215, 'Chungcheongbuk', 'Chungcheongbuk', 400), -(1559, 215, 'Chungcheongnam', 'Chungcheongnam', 500), -(1560, 215, 'Incheon', 'Incheon', 600), -(1561, 215, 'Kangweon', 'Kangweon', 700), -(1562, 215, 'Kwangju', 'Kwangju', 800), -(1563, 215, 'Kyeonggi', 'Kyeonggi', 900), -(1564, 215, 'Kyeongsangbuk', 'Kyeongsangbuk', 1000), -(1565, 215, 'Kyeongsangnam', 'Kyeongsangnam', 1100), -(1566, 215, 'Pusan', 'Pusan', 1200), -(1567, 215, 'Seoul', 'Seoul', 1300), -(1568, 215, 'Taegu', 'Taegu', 1400), -(1569, 215, 'Taejeon', 'Taejeon', 1500), -(1570, 215, 'Ulsan', 'Ulsan', 1600), -(1571, 215, 'Южная Корея', 'South Korea', 1700), -(1572, 216, 'Южная Осетия', 'Южная Осетия', 100), -(1573, 217, 'Ямайка', 'Ямайка', 100), -(1574, 218, 'Айти', 'Айти', 100), -(1575, 218, 'Аомори', 'Аомори', 200), -(1576, 218, 'Вакаяма', 'Вакаяма', 300), -(1577, 218, 'Гумма', 'Гумма', 400), -(1578, 218, 'Ибараки', 'Ибараки', 500), -(1579, 218, 'Ивате', 'Ивате', 600), -(1580, 218, 'Исикава', 'Исикава', 700), -(1581, 218, 'Кагосима', 'Кагосима', 800), -(1582, 218, 'Канагава', 'Канагава', 900), -(1583, 218, 'Киото', 'Киото', 1000), -(1584, 218, 'Коти', 'Коти', 1100), -(1585, 218, 'Мияги', 'Мияги', 1200), -(1586, 218, 'Миядзаки', 'Миядзаки', 1300), -(1587, 218, 'Нагано', 'Нагано', 1400), -(1588, 218, 'Нагасаки', 'Нагасаки', 1500), -(1589, 218, 'Нара', 'Нара', 1600), -(1590, 218, 'Ниигата', 'Ниигата', 1700), -(1591, 218, 'Окаяма', 'Окаяма', 1800), -(1592, 218, 'Окинава', 'Окинава', 1900), -(1593, 218, 'Осака', 'Осака', 2000), -(1594, 218, 'Сага', 'Сага', 2100), -(1595, 218, 'Сайтама', 'Сайтама', 2200), -(1596, 218, 'Сига', 'Сига', 2300), -(1597, 218, 'Сидзуока', 'Сидзуока', 2400), -(1598, 218, 'Тиба', 'Тиба', 2500), -(1599, 218, 'Токио', 'Токио', 2600), -(1600, 218, 'Токусима', 'Токусима', 2700), -(1601, 218, 'Тотиги', 'Тотиги', 2800), -(1602, 218, 'Тояма', 'Тояма', 2900), -(1603, 218, 'Фукуи', 'Фукуи', 3000), -(1604, 218, 'Фукуока', 'Фукуока', 3100), -(1605, 218, 'Фукусима', 'Фукусима', 3200), -(1606, 218, 'Хиросима', 'Хиросима', 3300), -(1607, 218, 'Хоккайдо', 'Хоккайдо', 3400), -(1608, 218, 'Хпого', 'Хпого', 3500), -(1609, 218, 'Эхиме', 'Эхиме', 3600), -(1610, 218, 'Ямагути', 'Ямагути', 3700), -(1611, 218, 'Яманаси', 'Яманаси', 3800); - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_geo_target` --- - -CREATE TABLE IF NOT EXISTS `prefix_geo_target` ( - `geo_type` varchar(20) NOT NULL, - `geo_id` int(11) NOT NULL, - `target_type` varchar(20) NOT NULL, - `target_id` int(11) NOT NULL, - `country_id` int(11) DEFAULT NULL, - `region_id` int(11) DEFAULT NULL, - `city_id` int(11) DEFAULT NULL, - PRIMARY KEY (`geo_type`,`geo_id`,`target_type`,`target_id`), - KEY `target_type` (`target_type`,`target_id`), - KEY `country_id` (`country_id`), - KEY `region_id` (`region_id`), - KEY `city_id` (`city_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_geo_target` --- - - --- --- Ограничения внешнего ключа сохраненных таблиц --- - --- --- Ограничения внешнего ключа таблицы `prefix_geo_city` --- -ALTER TABLE `prefix_geo_city` - ADD CONSTRAINT `prefix_geo_city_ibfk_2` FOREIGN KEY (`region_id`) REFERENCES `prefix_geo_region` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_geo_city_ibfk_1` FOREIGN KEY (`country_id`) REFERENCES `prefix_geo_country` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_geo_region` --- -ALTER TABLE `prefix_geo_region` - ADD CONSTRAINT `prefix_geo_region_ibfk_1` FOREIGN KEY (`country_id`) REFERENCES `prefix_geo_country` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_geo_target` --- -ALTER TABLE `prefix_geo_target` - ADD CONSTRAINT `prefix_geo_target_ibfk_3` FOREIGN KEY (`city_id`) REFERENCES `prefix_geo_city` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_geo_target_ibfk_1` FOREIGN KEY (`country_id`) REFERENCES `prefix_geo_country` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_geo_target_ibfk_2` FOREIGN KEY (`region_id`) REFERENCES `prefix_geo_region` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/install/index.php b/install/index.php deleted file mode 100644 index 1eef8174..00000000 --- a/install/index.php +++ /dev/null @@ -1,1923 +0,0 @@ -Assign() - * @see $this->GetRequest() - * @var string - */ - const GET_VAR_FROM_SESSION = 'get'; - /** - * Передача этого ключа как параметра, указавает функции предварительно сохранить - * переменную в сессию с одноименным ключем. - * - * Используется в фукнциях Assign(), GetRequest(). - * - * @see $this->Assign() - * @see $this->GetRequest() - * @var string - */ - const SET_VAR_IN_SESSION = 'set'; - /** - * Массив разрешенных шагов инсталяции - * - * @var array - */ - protected $aSteps = array(0=>'Start',1=>'Db',2=>'Admin',3=>'End',4=>'Extend',5=>'Finish'); - /** - * Шаги в обычном режиме инсталляции - * - * @var array - */ - protected $aSimpleModeSteps = array('Start','Db','Admin','End'); - /** - * Количество шагов, которые необходимо указывать в инсталляционных параметрах - * - * @var int - */ - protected $iStepCount = null; - /** - * Массив сообщений для пользователя - * - * @var array - */ - protected $aMessages = array(); - /** - * Директория с шаблонами - * - * @var string - */ - protected $sTemplatesDir = 'templates'; - /** - * Директория с языковыми файлами инсталлятора - * - * @var string - */ - protected $sLangInstallDir = 'language'; - /** - * Массив с переменными шаблонизатора - * - * @var array - */ - protected $aTemplateVars = array( - '___CONTENT___' => '', - '___FORM_ACTION___' => '', - '___NEXT_STEP_DISABLED___' => '', - '___NEXT_STEP_DISPLAY___' => 'block', - '___PREV_STEP_DISABLED___' => '', - '___PREV_STEP_DISPLAY___' => 'block', - '___SYSTEM_MESSAGES___' => '', - '___INSTALL_VERSION___' => LS_VERSION, - ); - /** - * Описание требований для успешной инсталяции - * - * @var array - */ - protected $aValidEnv = array( - 'safe_mode' => array ('0','off',''), - 'register_globals' => array ('0','off',''), - 'allow_url_fopen' => array ('1','on'), - 'UTF8_support' => '1', - 'http_input' => array ('','pass'), - 'http_output' => array ('0','pass'), - 'func_overload' => array ('0','4', 'no overload'), - ); - /** - * Директория, в которой хранятся конфиг-файлы - * - * @var string - */ - protected $sConfigDir=""; - /** - * Директория хранения скинов сайта - * - * @var string - */ - protected $sSkinDir=""; - /** - * Директория хранения языковых файлов движка - * - * @var string - */ - protected $sLangDir=""; - /** - * Текущий язык инсталлятора - * - * @var string - */ - protected $sLangCurrent = ''; - /** - * Язык инсталлятора, который будет использован по умолчанию - * - * @var string - */ - protected $sLangDefault = 'russian'; - /** - * Языковые текстовки - * - * @var array - */ - protected $aLang = array(); - /** - * Инициализация основных настроек - * - */ - public function __construct() { - $this->sConfigDir = dirname(__FILE__).'/../config'; - $this->sSkinDir = dirname(__FILE__).'/../templates/skin'; - $this->sLangDir = dirname(__FILE__).'/../templates/language'; - /** - * Загружаем языковые файлы - */ - $this->LoadLanguageFile($this->sLangDefault); - if($sLang=$this->GetRequest('lang')) { - $this->sLangCurrent = $sLang; - if($this->sLangCurrent!=$this->sLangDefault) $this->LoadLanguageFile($this->sLangCurrent); - } - /** - * Передаем языковые тикеты во вьювер - */ - foreach ($this->aLang as $sKey=>$sItem) { - $this->Assign("lang_{$sKey}",$sItem); - } - } - /** - * Подгружает указанный языковой файл и записывает поверх существующего языкового массива - * - * @access protected - * @param string $sLang - */ - protected function LoadLanguageFile($sLang) { - $sFilePath=$this->sLangInstallDir.'/'.$sLang.'.php'; - if(!file_exists($sFilePath)) return false; - - $aLang = include($sFilePath); - $this->aLang = array_merge($this->aLang,$aLang); - } - /** - * Возвращает языковую текстовку - * - * @param string $sKey - * @param array $aParams - * @return string - */ - protected function Lang($sKey,$aParams=array()) { - if(!array_key_exists($sKey,$this->aLang)) - return 'Unknown language key'; - - $sValue=$this->aLang[$sKey]; - if(count($aParams)==0) return $sValue; - - foreach ($aParams as $k=>$v) { - $sValue=str_replace("%%{$k}%%",$v,$sValue); - } - return $sValue; - } - /** - * Вытягивает переменную из сессии - * - * @param string $sKey - * @return mixed - */ - protected function GetSessionVar($sKey,$mDefault=null) { - return array_key_exists($sKey,$_SESSION) ? unserialize($_SESSION[$sKey]) : $mDefault; - } - /** - * Вкладывает переменную в сессию - * - * @param string $sKey - * @param mixed $mVar - * @return bool - */ - protected function SetSessionVar($sKey,$mVar) { - $_SESSION[$sKey] = serialize($mVar); - return true; - } - /** - * Уничтожает переменную в сессии - * - * @param string $sKey - * @return bool - */ - protected function DestroySessionVar($sKey) { - if(!array_key_exists($sKey,$_SESSION)) return false; - - unset($_SESSION[$sKey]); - return true; - } - - /** - * Выполняет рендеринг указанного шаблона - * - * @param string $sTemplateName - * @return string - */ - protected function Fetch($sTemplateName) { - if(!file_exists($this->sTemplatesDir.'/'.$sTemplateName)) return false; - - $sTemplate = file_get_contents($this->sTemplatesDir.'/'.$sTemplateName); - return $this->FetchString($sTemplate); - } - /** - * Выполняет рендеринг строки - * - * @param string $sTempString - * @return string - */ - protected function FetchString($sTempString) { - return str_replace(array_keys($this->aTemplateVars),array_values($this->aTemplateVars),$sTempString); - } - /** - * Добавляет переменную для отображение в шаблоне. - * - * Если параметр $sFromSession установлен в значение GET, - * то переменная сначала будет запрошена из сессии. - * - * Если параметр $sFromSession установлен в значение SET, - * то переменная сначала вложена в сессию с одноименным ключем. - * - * @param string $sName - * @param string $sValue - * @param string $sGetFromSession - */ - protected function Assign($sName,$sValue,$sFromSession=null) { - if($sFromSession==self::GET_VAR_FROM_SESSION) $sValue=$this->GetSessionVar($sName,$sValue); - if($sFromSession==self::SET_VAR_IN_SESSION) $this->SetSessionVar($sName,$sValue); - - $this->aTemplateVars['___'.strtoupper($sName).'___'] = $sValue; - } - /** - * Выполняет рендер layout`а (двухуровневый) - * - * @param string $sTemplate - * @return null - */ - protected function Layout($sTemplate) { - if(!$sLayoutContent = $this->Fetch($sTemplate)) { - return false; - } - /** - * Рендерим сообщения по списку - */ - if(count($this->aMessages)) { - /** - * Уникализируем содержимое списка сообщений - */ - $aMessages = array(); - foreach ($this->aMessages as &$sMessage) { - if(array_key_exists('type',$sMessage) and array_key_exists('text',$sMessage)) { - $aMessages[$sMessage['type']][md5(serialize($sMessage))] = "".ucfirst($sMessage['type']).": ".$sMessage['text']; - } - unset($sMessage); - } - $this->aMessages = $aMessages; - - $sMessageContent = ""; - foreach ($this->aMessages as $sType => $aMessageTexts) { - $this->Assign('message_style_class', $sType); - $this->Assign('message_content', implode('
',$aMessageTexts)); - $sMessageContent.=$this->Fetch('message.tpl'); - } - $this->Assign('system_messages',$sMessageContent); - } - - $this->Assign('content', $sLayoutContent); - print $this->Fetch('layout.tpl'); - } - - /** - * Сохранить данные в конфиг-файл - * - * @param string $sName - * @param string $sVar - * @param string $sPath - * @return bool - */ - protected function SaveConfig($sName,$sVar,$sPath) { - if(!file_exists($sPath)) { - $this->aMessages[] = array('type'=>'error', 'text'=>$this->Lang('config_file_not_exists',array('path'=>$sPath))); - return false; - } - if(!is_writeable($sPath)) { - $this->aMessages[] = array('type'=>'error', 'text'=>$this->Lang('config_file_not_writable',array('path'=>$sPath))); - return false; - } - - $sConfig = file_get_contents($sPath); - $sName = '$config[\''.implode('\'][\'', explode('.',$sName)).'\']'; - $sVar = $this->ConvertToString($sVar); - - /** - * Если переменная уже определена в конфиге, - * то меняем значение. - */ - if(substr_count($sConfig, $sName)) { - $sConfig=preg_replace("~".preg_quote($sName).".+;~Ui", $sName.' = '.$sVar.';', $sConfig); - } else { - $sConfig=str_replace('return $config;', $sName.' = '.$sVar.';'.PHP_EOL.'return $config;', $sConfig); - } - file_put_contents($sPath,$sConfig); - return true; - } - /** - * Преобразует переменную в формат для записи в текстовый файл - * - * @param mixed $mVar - * @return string - */ - protected function ConvertToString($mVar) { - switch(true) { - case is_string($mVar): - return "'".addslashes($mVar)."'"; - - case is_bool($mVar): - return ($mVar)?"true":"false"; - - case is_array($mVar): - $sArrayString=""; - foreach($mVar as $sKey=>$sValue) { - $sArrayString .= "'{$sKey}'=>".$this->ConvertToString($sValue).","; - } - return "array(".$sArrayString.")"; - - default: - case is_numeric($mVar): - return "'".(string)$mVar."'"; - } - } - - /** - * Получает значение переданных параметров - * - * @param string $sName - * @param mixed $default - * @return mixed - */ - protected function GetRequest($sName,$default=null,$bSession=null) { - if (array_key_exists($sName,$_REQUEST)) { - $sResult = (is_string($_REQUEST[$sName])) - ? trim(stripslashes($_REQUEST[$sName])) - : $_REQUEST[$sName]; - } else { - $sResult = ($bSession==self::GET_VAR_FROM_SESSION) - ? $this->GetSessionVar($sName,$default) - : $default; - } - /** - * При необходимости сохраняем в сессию - */ - if($bSession==self::SET_VAR_IN_SESSION) $this->SetSessionVar($sName,$sResult); - - return $sResult; - } - - /** - * Функция отвечающая за проверку входных параметров - * и передающая управление на фукнцию текущего шага - * - * @call $this->Step{__Name__} - */ - public function Run($sStepName=null) { - if(is_null($sStepName)){ - $sStepName = $this->GetSessionVar(self::SESSSION_KEY_STEP_NAME, self::INSTALL_DEFAULT_STEP); - } else { - $this->SetSessionVar(self::SESSSION_KEY_STEP_NAME,$sStepName); - } - - if(!in_array($sStepName,$this->aSteps)) die('Unknown step'); - - $iKey = array_search($sStepName,$this->aSteps); - /** - * Если была нажата кнопка "Назад", перемещаемся на шаг назад - */ - if($this->GetRequest('install_step_prev') && $iKey!=0) { - $sStepName = $this->aSteps[--$iKey]; - $this->SetSessionVar(self::SESSSION_KEY_STEP_NAME,$sStepName); - } - - $this->Assign('next_step_display', ($iKey == count($this->aSteps)-1)?'none':'inline-block'); - $this->Assign('prev_step_display', ($iKey == 0) ? 'none' : 'inline-block'); - - /** - * Если шаг отновиться к simple mode, то корректируем количество шагов - */ - if(in_array($sStepName,$this->aSimpleModeSteps)) - $this->SetStepCount(count($this->aSimpleModeSteps)); - /** - * Передаем во вьевер данные для формирование таймлайна шагов - */ - $this->Assign('install_step_number',$iKey+1); - $this->Assign('install_step_count',is_null($this->iStepCount) ? count($this->aSteps) : $this->iStepCount); - /** - * Пердаем управление на метод текущего шага - */ - $sFunctionName = 'Step'.$sStepName; - if(@method_exists($this,$sFunctionName)) { - $this->$sFunctionName(); - } else { - $sFunctionName = 'Step'.self::INSTALL_DEFAULT_STEP; - $this->SetSessionVar(self::SESSSION_KEY_STEP_NAME,self::INSTALL_DEFAULT_STEP); - $this->$sFunctionName(); - } - } - /** - * Сохраняет данные о текущем шаге и передает их во вьювер - * - * @access protected - * @return bool - */ - protected function SetStep($sStepName) { - if(!$sStepName or !in_array($sStepName,$this->aSteps)) return null; - $this->Assign('install_step_number',array_search($sStepName,$this->aSteps)+1); - } - /** - * Устанавливает количество шагов для отображения в шаблонах - * - * @param int $iStepCount - */ - protected function SetStepCount($iStepCount) { - $this->iStepCount = $iStepCount; - } - - /** - * Первый шаг инсталяции. - * Валидация окружения. - */ - protected function StepStart() { - if(!$this->ValidateEnviroment()) { - $this->Assign('next_step_disabled', 'disabled'); - } else { - /** - * Прописываем в конфигурацию абсолютные пути - */ - $this->SavePath(); - - if($this->GetRequest('install_step_next')) { - return $this->Run('Db'); - } - } - $this->SetStep('Start'); - $this->Layout('steps/start.tpl'); - } - /** - * Запрос данных соединения с базой данных. - * Запись полученных данных в лог. - */ - protected function StepDb() { - if(!$this->GetRequest('install_db_params')) { - /** - * Получаем данные из сессии (если они туда были вложены на предыдущих итерациях шага) - */ - $this->Assign('install_db_server', 'localhost', self::GET_VAR_FROM_SESSION); - $this->Assign('install_db_port', '3306', self::GET_VAR_FROM_SESSION); - $this->Assign('install_db_name', 'social', self::GET_VAR_FROM_SESSION); - $this->Assign('install_db_user', 'root', self::GET_VAR_FROM_SESSION); - $this->Assign('install_db_password', '', self::GET_VAR_FROM_SESSION); - $this->Assign('install_db_create_check', '', self::GET_VAR_FROM_SESSION); - $this->Assign('install_db_prefix', 'prefix_', self::GET_VAR_FROM_SESSION); - $this->Assign('install_db_engine', 'InnoDB', self::GET_VAR_FROM_SESSION); - $this->Assign('install_db_engine_innodb', '', self::GET_VAR_FROM_SESSION); - $this->Assign('install_db_engine_myisam', '', self::GET_VAR_FROM_SESSION); - - $this->Layout('steps/db.tpl'); - return true; - } - /** - * Если переданны данные формы, проверяем их на валидность - */ - $aParams['server'] = $this->GetRequest('install_db_server',''); - $aParams['port'] = $this->GetRequest('install_db_port',''); - $aParams['name'] = $this->GetRequest('install_db_name',''); - $aParams['user'] = $this->GetRequest('install_db_user',''); - $aParams['password'] = $this->GetRequest('install_db_password',''); - $aParams['create'] = $this->GetRequest('install_db_create',0); - $aParams['convert'] = $this->GetRequest('install_db_convert',0); - $aParams['convert_from_10'] = $this->GetRequest('install_db_convert_from_10',0); - $aParams['prefix'] = $this->GetRequest('install_db_prefix','prefix_'); - $aParams['engine'] = $this->GetRequest('install_db_engine','InnoDB'); - - $this->Assign('install_db_server', $aParams['server'], self::SET_VAR_IN_SESSION); - $this->Assign('install_db_port', $aParams['port'], self::SET_VAR_IN_SESSION); - $this->Assign('install_db_name', $aParams['name'], self::SET_VAR_IN_SESSION); - $this->Assign('install_db_user', $aParams['user'], self::SET_VAR_IN_SESSION); - $this->Assign('install_db_password', $aParams['password'], self::SET_VAR_IN_SESSION); - $this->Assign('install_db_create_check', (($aParams['create'])?'checked="checked"':''), self::SET_VAR_IN_SESSION); - $this->Assign('install_db_convert_check', (($aParams['convert'])?'checked="checked"':''), self::SET_VAR_IN_SESSION); - $this->Assign('install_db_convert_from_10_check', (($aParams['convert_from_10'])?'checked="checked"':''), self::SET_VAR_IN_SESSION); - $this->Assign('install_db_prefix', $aParams['prefix'], self::SET_VAR_IN_SESSION); - $this->Assign('install_db_engine', $aParams['engine'], self::SET_VAR_IN_SESSION); - /** - * Передаем данные о выделенном пункте в списке tables engine - */ - $this->Assign('install_db_engine_innodb', ($aParams['engine']=='InnoDB')?'selected="selected"':'', self::SET_VAR_IN_SESSION); - $this->Assign('install_db_engine_myisam', ($aParams['engine']=='MyISAM')?'selected="selected"':'', self::SET_VAR_IN_SESSION); - - if($oDb=$this->ValidateDBConnection($aParams)) { - $bSelect = $this->SelectDatabase($aParams['name'],$aParams['create']); - /** - * Если не удалось выбрать базу данных, возвращаем ошибку - */ - if(!$bSelect) { - $this->aMessages[] = array('type'=>'error','text'=>$this->Lang('error_db_invalid')); - $this->Layout('steps/db.tpl'); - return false; - } - - /** - * Сохраняем в config.local.php настройки соединения - */ - $sLocalConfigFile = $this->sConfigDir.'/'.self::LOCAL_CONFIG_FILE_NAME; - if(!file_exists($sLocalConfigFile)) { - $this->aMessages[] = array('type'=>'error','text'=>$this->Lang('error_local_config_invalid')); - $this->Layout('steps/db.tpl'); - return false; - } - @chmod($sLocalConfigFile, 0777); - - $this->SaveConfig('db.params.host', $aParams['server'], $sLocalConfigFile); - $this->SaveConfig('db.params.port', $aParams['port'], $sLocalConfigFile); - $this->SaveConfig('db.params.user', $aParams['user'], $sLocalConfigFile); - $this->SaveConfig('db.params.pass', $aParams['password'], $sLocalConfigFile); - $this->SaveConfig('db.params.dbname',$aParams['name'], $sLocalConfigFile); - $this->SaveConfig('db.table.prefix', $aParams['prefix'], $sLocalConfigFile); - - if($aParams['engine']=='InnoDB') { - /** - * Проверяем поддержку InnoDB в MySQL - */ - $aParams['engine']='MyISAM'; - if($aRes = @mysql_query('SHOW ENGINES')) { - while ($aRow = mysql_fetch_assoc($aRes)) { - if ($aRow['Engine']=='InnoDB' and in_array($aRow['Support'],array('DEFAULT','YES'))) { - $aParams['engine']='InnoDB'; - } - } - } - } - $this->SaveConfig('db.tables.engine',$aParams['engine'], $sLocalConfigFile); - /** - * Сохраняем данные в сессию - */ - $this->SetSessionVar('INSTALL_DATABASE_PARAMS',$aParams); - /** - * Проверяем была ли проведена установка базы в течении сеанса. - * Открываем .sql файл и добавляем в базу недостающие таблицы - */ - if($this->GetSessionVar('INSTALL_DATABASE_DONE','')!=md5(serialize(array($aParams['server'],$aParams['name'])))){ - /** - * Отдельным файлом запускаем создание GEO-базы - */ - $aRes=$this->CreateTables('geo_base.sql',array_merge($aParams,array('check_table'=>'geo_city'))); - if ($aRes) { - list($bResult,$aErrors) = array_values($aRes); - if(!$bResult) { - foreach($aErrors as $sError) $this->aMessages[] = array('type'=>'error','text'=>$sError); - $this->Layout('steps/db.tpl'); - return false; - } - } - - if(!$aParams['convert'] && !$aParams['convert_from_10']) { - $aRes=$this->CreateTables('sql.sql',array_merge($aParams,array('check_table'=>'topic'))); - if ($aRes) { - list($bResult,$aErrors) = array_values($aRes); - if(!$bResult) { - foreach($aErrors as $sError) $this->aMessages[] = array('type'=>'error','text'=>$sError); - $this->Layout('steps/db.tpl'); - return false; - } - } else { - return $this->StepAdmin(); - } - } elseif ($aParams['convert']) { - /** - * Если указана конвертация старой базы данных - */ - list($bResult,$aErrors) = array_values($this->ConvertDatabase('convert_0.5.1_to_1.0.1.sql',$aParams)); - if(!$bResult) { - foreach($aErrors as $sError) $this->aMessages[] = array('type'=>'error','text'=>$sError); - $this->Layout('steps/db.tpl'); - return false; - } - } elseif ($aParams['convert_from_10']) { - /** - * Если указана конвертация старой базы данных (1.0 -> 1.0.1) - */ - list($bResult,$aErrors) = array_values($this->ConvertDatabaseFrom10('convert_1.0_to_1.0.1.sql',$aParams)); - if(!$bResult) { - foreach($aErrors as $sError) $this->aMessages[] = array('type'=>'error','text'=>$sError); - $this->Layout('steps/db.tpl'); - return false; - } - } - } - /** - * Сохраняем в сессии информацию о том, что преобразование базы данных уже было выполнено. - * При этом сохраняем хеш сервера и названия базы данных, для последующего сравнения. - */ - $this->SetSessionVar('INSTALL_DATABASE_DONE',md5(serialize(array($aParams['server'],$aParams['name'])))); - /** - * Передаем управление на следующий шаг - */ - $this->aMessages[] = array('type'=>'notice','text'=>$this->Lang('ok_db_created')); - return $this->StepAdmin(); - } else { - $this->SetStep('Db'); - $this->Layout('steps/db.tpl'); - return false; - } - } - /** - * Запрос данных администратора и сохранение их в базе данных - * - */ - protected function StepAdmin() { - $this->SetSessionVar(self::SESSSION_KEY_STEP_NAME,'Admin'); - $this->SetStep('Admin'); - /** - * Передаем данные из запроса во вьювер, сохраняя значение в сессии - */ - $this->Assign('install_admin_login', $this->GetRequest('install_admin_login','admin',self::GET_VAR_FROM_SESSION), self::SET_VAR_IN_SESSION); - $this->Assign('install_admin_mail', $this->GetRequest('install_admin_mail','admin@admin.adm',self::GET_VAR_FROM_SESSION), self::SET_VAR_IN_SESSION); - /** - * Если данные формы не были отправлены, передаем значения по умолчанию - */ - if(!$this->GetRequest('install_admin_params',false)) { - return $this->Layout('steps/admin.tpl'); - } - /** - * Проверяем валидность введенных данных - */ - list($bResult,$aErrors) = $this->ValidateAdminFields(); - if(!$bResult) { - foreach($aErrors as $sError) $this->aMessages[] = array('type'=>'error','text'=>$sError); - $this->Layout('steps/admin.tpl'); - return false; - } - /** - * Подключаемся к базе данных и сохраняем новые данные администратора - */ - $aParams = $this->GetSessionVar('INSTALL_DATABASE_PARAMS'); - if(!$this->ValidateDBConnection($aParams)) { - $this->aMessages[] = array('type'=>'error','text'=>$this->Lang('error_db_connection_invalid')); - $this->Layout('steps/admin.tpl'); - return false; - } - $this->SelectDatabase($aParams['name']); - - $bUpdated = $this->UpdateDBUser( - $this->GetRequest('install_admin_login'), - $this->GetRequest('install_admin_pass'), - $this->GetRequest('install_admin_mail'), - $aParams['prefix'] - ); - if(!$bUpdated) { - $this->aMessages[] = array('type'=>'error','text'=>$this->Lang('error_db_saved').'
'.mysql_error()); - $this->Layout('steps/admin.tpl'); - return false; - } - /** - * Обновляем данные о пользовательском блоге - */ - $this->UpdateUserBlog("Blog by ".$this->GetRequest('install_admin_login'),$aParams['prefix']); - - /** - * Передаем управление на следующий шаг - */ - return $this->StepEnd(); - } - /** - * Завершающий этап. Переход в расширенный режим - */ - protected function StepEnd() { - $this->SetStep('End'); - $this->Assign('next_step_display','none'); - $this->SetSessionVar(self::SESSSION_KEY_STEP_NAME,'End'); - /** - * Если пользователь выбрал расширенный режим, переводим на новый шаг - */ - return ($this->GetRequest('install_step_extend')) - ? $this->StepExtend() - : $this->Layout('steps/end.tpl'); - } - /** - * Расширенный режим ввода дополнительных настроек. - */ - protected function StepExtend() { - /** - * Выводим на экран кнопку @Next - */ - $this->Assign('next_step_display','inline-block'); - /** - * Сохраняем в сессию название текущего шага - */ - $this->SetSessionVar(self::SESSSION_KEY_STEP_NAME,'Extend'); - $this->SetStep('Extend'); - /** - * Получаем значения запрашиваемых данных либо устанавливаем принятые по умолчанию - */ - $aParams['install_view_name'] = $this->GetRequest('install_view_name','Your Site',self::GET_VAR_FROM_SESSION); - $aParams['install_view_description']= $this->GetRequest('install_view_description','Description your site',self::GET_VAR_FROM_SESSION); - $aParams['install_view_keywords'] = $this->GetRequest('install_view_keywords','site, google, internet',self::GET_VAR_FROM_SESSION); - $aParams['install_view_skin'] = $this->GetRequest('install_view_skin','synio',self::GET_VAR_FROM_SESSION); - - $aParams['install_mail_sender'] = $this->GetRequest('install_mail_sender',$this->GetSessionVar('install_admin_mail','rus.engine@gmail.com'),self::GET_VAR_FROM_SESSION); - $aParams['install_mail_name'] = $this->GetRequest('install_mail_name','Почтовик Your Site',self::GET_VAR_FROM_SESSION); - - $aParams['install_general_close'] = (bool)$this->GetRequest('install_general_close',false,self::GET_VAR_FROM_SESSION); - $aParams['install_general_invite'] = (bool)$this->GetRequest('install_general_invite',false,self::GET_VAR_FROM_SESSION); - $aParams['install_general_active'] = (bool)$this->GetRequest('install_general_active',false,self::GET_VAR_FROM_SESSION); - - $aParams['install_lang_current'] = $this->GetRequest('install_lang_current','russian',self::GET_VAR_FROM_SESSION); - $aParams['install_lang_default'] = $this->GetRequest('install_lang_default','russian',self::GET_VAR_FROM_SESSION); - - /** - * Передаем параметры во Viewer - */ - foreach($aParams as $sName=>$sParam) { - /** - * Если передано булево значение, значит это чек-бокс - */ - if(!is_bool($sParam)) { - $this->Assign($sName,trim($sParam)); - } else { - $this->Assign($sName.'_check',($sParam)?'checked':''); - } - } - /** - * Передаем во вьевер список доступных языков - */ - $aLangs = $this->GetLangList(); - $sLangOptions = ""; - foreach ($aLangs as $sLang) { - $this->Assign('language_array_item',$sLang); - $this->Assign('language_array_item_selected', ($aParams['install_lang_current']==$sLang)?'selected="selected"':''); - $sLangOptions.=$this->FetchString(""); - } - $this->Assign('install_lang_options',$sLangOptions); - /** - * Передаем во вьевер список доступных языков для дефолтного определения - */ - $sLangOptions = ""; - foreach ($aLangs as $sLang) { - $this->Assign('language_array_item',$sLang); - $this->Assign('language_array_item_selected', ($aParams['install_lang_default']==$sLang)?'selected="selected"':''); - $sLangOptions.=$this->FetchString(""); - } - $this->Assign('install_lang_default_options',$sLangOptions); - /** - * Передаем во вьевер список доступных скинов - */ - $aSkins = $this->GetSkinList(); - $sSkinOptions = ""; - foreach ($aSkins as $sSkin) { - $this->Assign('skin_array_item',$sSkin); - $this->Assign('skin_array_item_selected', ($aParams['install_view_skin']==$sSkin)?'selected="selected"':''); - $sSkinOptions.=$this->FetchString(""); - } - $this->Assign('install_view_skin_options',$sSkinOptions); - - /** - * Если были переданные данные формы, то обрабатываем добавление - */ - if($this->GetRequest('install_extend_params')) { - $bOk = true; - $sLocalConfigFile = $this->sConfigDir.'/'.self::LOCAL_CONFIG_FILE_NAME; - - /** - * Название сайта - */ - if($aParams['install_view_name'] && strlen($aParams['install_view_name'])>2){ - if($this->SaveConfig('view.name',$aParams['install_view_name'],$sLocalConfigFile)) - $this->SetSessionVar('install_view_name',$aParams['install_view_name']); - } else { - $bOk = false; - $this->aMessages[] = array('type'=>'error','text'=>$this->Lang('site_name_invalid')); - } - /** - * Описание сайта - */ - if($aParams['install_view_description']){ - if($this->SaveConfig('view.description',$aParams['install_view_description'],$sLocalConfigFile)) - $this->SetSessionVar('install_view_description',$aParams['install_view_description']); - } else { - $bOk = false; - $this->aMessages[] = array('type'=>'error','text'=>$this->Lang('site_description_invalid')); - } - /** - * Ключевые слова - */ - if($aParams['install_view_keywords'] && strlen($aParams['install_view_keywords'])>2){ - if($this->SaveConfig('view.keywords',$aParams['install_view_keywords'],$sLocalConfigFile)) - $this->SetSessionVar('install_view_keywords',$aParams['install_view_keywords']); - } else { - $bOk = false; - $this->aMessages[] = array('type'=>'error','text'=>$this->Lang('site_keywords_invalid')); - } - /** - * Название шаблона оформления - */ - if($aParams['install_view_skin'] && strlen($aParams['install_view_skin'])>1){ - if($this->SaveConfig('view.skin',$aParams['install_view_skin'],$sLocalConfigFile)) - $this->SetSessionVar('install_view_skin',$aParams['install_view_skin']); - } else { - $bOk = false; - $this->aMessages[] = array('type'=>'error','text'=>'skin_name_invalid'); - } - - /** - * E-mail, с которого отправляются уведомления - */ - if($aParams['install_mail_sender'] && strlen($aParams['install_mail_sender'])>5){ - if($this->SaveConfig('sys.mail.from_email',$aParams['install_mail_sender'],$sLocalConfigFile)) - $this->SetSessionVar('install_mail_sender',$aParams['install_mail_sender']); - } else { - $bOk = false; - $this->aMessages[] = array('type'=>'error','text'=>$this->Lang('mail_sender_invalid')); - } - /** - * Имя, от которого отправляются уведомления - */ - if($aParams['install_mail_name'] && strlen($aParams['install_mail_name'])>1){ - if($this->SaveConfig('sys.mail.from_name',$aParams['install_mail_name'],$sLocalConfigFile)) - $this->SetSessionVar('install_mail_name',$aParams['install_mail_name']); - } else { - $bOk = false; - $this->aMessages[] = array('type'=>'error','text'=>$this->Lang('mail_name_invalid')); - } - - /** - * Использовать закрытый режим работы сайта - */ - if($this->SaveConfig('general.close',$aParams['install_general_close'],$sLocalConfigFile)) - $this->SetSessionVar('install_general_close',$aParams['install_general_close']); - /** - * Использовать активацию при регистрации - */ - if($this->SaveConfig('general.reg.activation',$aParams['install_general_active'],$sLocalConfigFile)) - $this->SetSessionVar('install_general_active',$aParams['install_general_active']); - /** - * Использоватьт режим регистрации по приглашению - */ - if($this->SaveConfig('general.reg.invite',$aParams['install_general_invite'],$sLocalConfigFile)) - $this->SetSessionVar('install_general_invite',$aParams['install_general_invite']); - - /** - * Текущий язык - */ - if($aParams['install_lang_current'] && strlen($aParams['install_lang_current'])>1){ - if($this->SaveConfig('lang.current',$aParams['install_lang_current'],$sLocalConfigFile)) { - $this->SetSessionVar('install_lang_current',$aParams['install_lang_current']); - /** - * Если выбран русский язык, то перезаписываем название блога - */ - if($aParams['install_lang_current']=='russian'){ - $aDbParams = $this->GetSessionVar('INSTALL_DATABASE_PARAMS'); - $oDb = $this->ValidateDBConnection($aDbParams); - - if($oDb and $this->SelectDatabase($aDbParams['name'])) $this->UpdateUserBlog("Блог им. ".$this->GetSessionVar('install_admin_login'),$aDbParams['prefix']); - } - } - } else { - $bOk = false; - $this->aMessages[] = array('type'=>'error','text'=>$this->Lang('lang_current_invalid')); - } - /** - * Язык, который будет использоваться по умолчанию - */ - if($aParams['install_lang_default'] && strlen($aParams['install_lang_default'])>1){ - if($this->SaveConfig('lang.default',$aParams['install_lang_default'],$sLocalConfigFile)) - $this->SetSessionVar('install_lang_default',$aParams['install_lang_default']); - } else { - $bOk = false; - $this->aMessages[] = array('type'=>'error','text'=>$this->Lang('lang_default_invalid')); - } - } - - return ($this->GetRequest('install_step_next')) - ? $this->StepFinish() - : $this->Layout('steps/extend.tpl'); - } - /** - * Окончание работы инсталлятора. Предупреждение о необходимости удаления. - */ - protected function StepFinish() { - $this->SetStep('Finish'); - $this->Assign('next_step_display','none'); - $this->SetSessionVar(self::SESSSION_KEY_STEP_NAME,'Finish'); - $this->Layout('steps/finish.tpl'); - } - /** - * Проверяем возможность инсталяции - * - * @return bool - */ - protected function ValidateEnviroment() { - $bOk = true; - - if(!version_compare(PHP_VERSION, '5.2.0', '>=')) { - $bOk = false; - $this->Assign('validate_php_version', ''.$this->Lang('no').''); - } else { - $this->Assign('validate_php_version', ''.$this->Lang('yes').''); - } - - if(!in_array(strtolower(@ini_get('safe_mode')), $this->aValidEnv['safe_mode'])) { - $bOk = false; - $this->Assign('validate_safe_mode', ''.$this->Lang('no').''); - } else { - $this->Assign('validate_safe_mode', ''.$this->Lang('yes').''); - } - - if(@preg_match('//u', '')!=$this->aValidEnv['UTF8_support']) { - $bOk = false; - $this->Assign('validate_utf8', ''.$this->Lang('no').''); - } else { - $this->Assign('validate_utf8', ''.$this->Lang('yes').''); - } - - if (@extension_loaded('mbstring')){ - $this->Assign('validate_mbstring', ''.$this->Lang('yes').''); - } else { - $bOk = false; - $this->Assign('validate_mbstring', ''.$this->Lang('no').''); - } - - if (@extension_loaded('SimpleXML')){ - $this->Assign('validate_simplexml', ''.$this->Lang('yes').''); - } else { - $bOk = false; - $this->Assign('validate_simplexml', ''.$this->Lang('no').''); - } - - $sLocalConfigPath = $this->sConfigDir.'/config.local.php'; - if(!file_exists($sLocalConfigPath) or !is_writeable($sLocalConfigPath)) { - // пытаемся создать файл локального конфига - @copy($this->sConfigDir.'/config.local.php.dist',$sLocalConfigPath); - } - if(!file_exists($sLocalConfigPath) or !is_writeable($sLocalConfigPath)) { - $bOk = false; - $this->Assign('validate_local_config', ''.$this->Lang('no').''); - } else { - $this->Assign('validate_local_config', ''.$this->Lang('yes').''); - } - - /** - * Проверяем доступность и достаточность прав у директории - * для сохранения файлового кеша, /logs, /uploads, /templates/compiled, /plugins - */ - $sTempDir = dirname(dirname(__FILE__)).'/tmp'; - if(!is_dir($sTempDir) or !is_writable($sTempDir)) { - $bOk = false; - $this->Assign('validate_local_temp', ''.$this->Lang('no').''); - } else { - $this->Assign('validate_local_temp', ''.$this->Lang('yes').''); - } - - $sLogsDir = dirname(dirname(__FILE__)).'/logs'; - if(!is_dir($sLogsDir) or !is_writable($sLogsDir)) { - $bOk = false; - $this->Assign('validate_local_logs', ''.$this->Lang('no').''); - } else { - $this->Assign('validate_local_logs', ''.$this->Lang('yes').''); - } - - $sUploadsDir = dirname(dirname(__FILE__)).'/uploads'; - if(!is_dir($sUploadsDir) or !is_writable($sUploadsDir)) { - $bOk = false; - $this->Assign('validate_local_uploads', ''.$this->Lang('no').''); - } else { - $this->Assign('validate_local_uploads', ''.$this->Lang('yes').''); - } - - $sTemplatesDir = dirname(dirname(__FILE__)).'/templates/compiled'; - if(!is_dir($sTemplatesDir) or !is_writable($sTemplatesDir)) { - $bOk = false; - $this->Assign('validate_local_templates', ''.$this->Lang('no').''); - } else { - $this->Assign('validate_local_templates', ''.$this->Lang('yes').''); - } - - - $sTemplatesCacheDir = dirname(dirname(__FILE__)).'/templates/cache'; - if(!is_dir($sTemplatesCacheDir) or !is_writable($sTemplatesCacheDir)) { - $bOk = false; - $this->Assign('validate_local_templates_cache', ''.$this->Lang('no').''); - } else { - $this->Assign('validate_local_templates_cache', ''.$this->Lang('yes').''); - } - - $sPluginsDir = dirname(dirname(__FILE__)).'/plugins'; - if(!is_dir($sPluginsDir) or !is_writable($sPluginsDir)) { - $bOk = false; - $this->Assign('validate_local_plugins', ''.$this->Lang('no').''); - } else { - $this->Assign('validate_local_plugins', ''.$this->Lang('yes').''); - } - - return $bOk; - } - /** - * Проверяет соединение с базой данных - * - * @param array $aParams - * @return mixed - */ - protected function ValidateDBConnection($aParams) { - $oDb = @mysql_connect($aParams['server'].':'.$aParams['port'],$aParams['user'],$aParams['password']); - if( $oDb ) { - /** - * Валидация версии MySQL сервера - */ - if(!version_compare(mysql_get_server_info(), '5.0.0', '>')) { - $this->aMessages[] = array('type'=>'error','text'=>$this->Lang('valid_mysql_server')); - return false; - } - - mysql_query('set names utf8'); - return $oDb; - } - - $this->aMessages[] = array('type'=>'error','text'=>$this->Lang('error_db_connection_invalid')); - return null; - } - /** - * Выбрать базу данных (либо создать в случае необходимости). - * - * @param string $sName - * @param bool $bCreate - * @return bool - */ - protected function SelectDatabase($sName,$bCreate=false) { - if(@mysql_select_db($sName)) return true; - - if($bCreate){ - @mysql_query("CREATE DATABASE $sName"); - return @mysql_select_db($sName); - } - return false; - } - /** - * Добавляет в базу данных необходимые таблицы - * - * @param string $sFilePath - * @return array - */ - protected function CreateTables($sFilePath,$aParams) { - $sFileQuery = @file_get_contents($sFilePath); - if(!$sFileQuery) return array('result'=>false,'errors'=>array($this->Lang("config_file_not_exists", array('path'=>$sFilePath)))); - - if(isset($aParams['prefix'])) $sFileQuery = str_replace('prefix_', $aParams['prefix'], $sFileQuery); - $aQuery=explode(';',$sFileQuery); - /** - * Массив для сбора ошибок - */ - $aErrors = array(); - /** - * Смотрим, какие таблицы существуют в базе данных - */ - $aDbTables = array(); - $aResult = @mysql_query("SHOW TABLES"); - if(!$aResult){ - return array('result'=>false,'errors'=>array($this->Lang('error_db_no_data'))); - } - while($aRow = mysql_fetch_array($aResult, MYSQL_NUM)){ - $aDbTables[] = $aRow[0]; - } - /** - * Если среди таблиц БД уже есть таблица prefix_topic, то выполнять SQL-дамп не нужно - */ - if (in_array($aParams['prefix'].$aParams['check_table'],$aDbTables)) { - return false; - } - /** - * Выполняем запросы по очереди - */ - foreach($aQuery as $sQuery){ - $sQuery = trim($sQuery); - /** - * Заменяем движек, если таковой указан в запросе - */ - if(isset($aParams['engine'])) $sQuery=str_ireplace('ENGINE=InnoDB', "ENGINE={$aParams['engine']}",$sQuery); - - if($sQuery!='' and !$this->IsUseDbTable($sQuery,$aDbTables)) { - $bResult=mysql_query($sQuery); - if(!$bResult) $aErrors[] = mysql_error(); - } - } - - if(count($aErrors)==0) { - return array('result'=>true,'errors'=>null); - } - return array('result'=>false,'errors'=>$aErrors); - } - - /** - * Проверяем, нуждается ли база в конвертации или нет - * - * @param array $aParams - * @return bool - */ - protected function ValidateConvertDatabase($aParams) { - /** - * Проверяем, нуждается ли база в конвертации или нет - * Смотрим, какие таблицы существуют в базе данных - */ - $aDbTables = array(); - $aResult = @mysql_query("SHOW TABLES"); - if(!$aResult){ - return array('result'=>false,'errors'=>array($this->Lang('error_db_no_data'))); - } - while($aRow = mysql_fetch_array($aResult, MYSQL_NUM)){ - $aDbTables[] = $aRow[0]; - } - /** - * Смотрим на наличие в базе таблицы prefix_user_note - */ - return !in_array($aParams['prefix'].'user_note',$aDbTables); - } - /** - * Конвертирует базу данных версии 0.5.1 в базу данных версии 1.0.1 - * - * @return bool - */ - protected function ConvertDatabase($sFilePath,$aParams) { - if(!$this->ValidateConvertDatabase($aParams)) { - return array('result'=>true,'errors'=>array($this->Lang("error_database_converted_already"))); - } - - $sFileQuery = @file_get_contents($sFilePath); - if(!$sFileQuery) return array('result'=>false,'errors'=>array($this->Lang("config_file_not_exists", array('path'=>$sFilePath)))); - - if(isset($aParams['prefix'])) $sFileQuery = str_replace('prefix_', $aParams['prefix'], $sFileQuery); - $aQuery=explode(';',$sFileQuery); - /** - * Массив для сбора ошибок - */ - $aErrors = array(); - - /** - * Выполняем запросы по очереди - */ - foreach($aQuery as $sQuery){ - $sQuery = trim($sQuery); - /** - * Заменяем движек, если таковой указан в запросе - */ - if(isset($aParams['engine'])) $sQuery=str_ireplace('ENGINE=InnoDB', "ENGINE={$aParams['engine']}",$sQuery); - - if($sQuery!='') { - $bResult=mysql_query($sQuery); - if(!$bResult) $aErrors[] = mysql_error(); - } - } - /** - * Необходимая конвертация в 1.0.1 из 0.5.1 - */ - - /** - * Пересчет количества избранного для топиков - */ - $sTable1=$aParams['prefix'].'topic'; - $sTable2=$aParams['prefix'].'favourite'; - $sQuery = " - UPDATE {$sTable1} t - SET t.topic_count_favourite = ( - SELECT count(f.user_id) - FROM {$sTable2} f - WHERE - f.target_id = t.topic_id - AND - f.target_publish = 1 - AND - f.target_type = 'topic' - ) - "; - if(!mysql_query($sQuery)) $aErrors[] = mysql_error(); - /** - * Пересчет количества избранного для комментов - */ - $sTable1=$aParams['prefix'].'comment'; - $sQuery = " - UPDATE {$sTable1} c - SET c.comment_count_favourite = ( - SELECT count(f.user_id) - FROM {$sTable2} f - WHERE - f.target_id = c.comment_id - AND - f.target_publish = 1 - AND - f.target_type = 'comment' - ) - "; - if(!mysql_query($sQuery)) $aErrors[] = mysql_error(); - /** - * Пересчет счетчиков голосования за топик - */ - $sTable1=$aParams['prefix'].'topic'; - $sTable2=$aParams['prefix'].'vote'; - $sQuery = " - UPDATE {$sTable1} t - SET t.topic_count_vote_up = ( - SELECT count(*) - FROM {$sTable2} v - WHERE - v.target_id = t.topic_id - AND - v.vote_direction = 1 - AND - v.target_type = 'topic' - ), t.topic_count_vote_down = ( - SELECT count(*) - FROM {$sTable2} v - WHERE - v.target_id = t.topic_id - AND - v.vote_direction = -1 - AND - v.target_type = 'topic' - ), t.topic_count_vote_abstain = ( - SELECT count(*) - FROM {$sTable2} v - WHERE - v.target_id = t.topic_id - AND - v.vote_direction = 0 - AND - v.target_type = 'topic' - ) - "; - if(!mysql_query($sQuery)) $aErrors[] = mysql_error(); - /** - * Пересчет количества топиков в блогах - */ - $sTable1=$aParams['prefix'].'blog'; - $sTable2=$aParams['prefix'].'topic'; - $sQuery = " - UPDATE {$sTable1} b - SET b.blog_count_topic = ( - SELECT count(*) - FROM {$sTable2} t - WHERE - t.blog_id = b.blog_id - AND - t.topic_publish = 1 - ) - "; - if(!mysql_query($sQuery)) $aErrors[] = mysql_error(); - /** - * Проставляем последнего пользователя и последний комментарий во всех личных сообщениях - */ - $sTable1=$aParams['prefix'].'talk'; - $sTable2=$aParams['prefix'].'comment'; - $iPage=1; - - do { - $iLimitStart=($iPage-1)*100; - $sQuery="SELECT talk_id, user_id FROM {$sTable1} LIMIT {$iLimitStart},100"; - if(!$aResults = mysql_query($sQuery)){ - $aErrors[] = mysql_error(); - break; - } - if (mysql_num_rows($aResults)) { - while($aRow = mysql_fetch_assoc($aResults)) { - $iTalk=$aRow['talk_id']; - $iUserLast=$aRow['user_id']; - $iCommentLast=null; - /** - * Запрашиваем последний комментарий из сообщения - */ - $sQuery2="SELECT comment_id, user_id FROM {$sTable2} WHERE target_id='{$iTalk}' and target_type='talk' ORDER BY comment_id desc LIMIT 0,1"; - if(!$aResults2 = mysql_query($sQuery2)){ - $aErrors[] = mysql_error(); - continue; - } - if($aRow2 = mysql_fetch_assoc($aResults2)) { - $iCommentLast=$aRow2['comment_id']; - $iUserLast=$aRow2['user_id']; - } - /** - * Обновляем значения - */ - $sQuery3="UPDATE {$sTable1} SET talk_user_id_last='{$iUserLast}', talk_comment_id_last=".($iCommentLast ? $iCommentLast : 'null')." WHERE talk_id='{$iTalk}' "; - if(!mysql_query($sQuery3)) { - $aErrors[] = mysql_error(); - continue; - } - } - } else { - break; - } - $iPage++; - } while (1); - /** - * Перенос стран и городов на новую структуру - */ - $sTableUser=$aParams['prefix'].'user'; - $sTableGeoCountry=$aParams['prefix'].'geo_country'; - $sTableGeoCity=$aParams['prefix'].'geo_city'; - $sTableGeoRegion=$aParams['prefix'].'geo_region'; - $sTableGeoTarget=$aParams['prefix'].'geo_target'; - $iPage=1; - do { - $iLimitStart=($iPage-1)*100; - $sQuery="SELECT * FROM {$sTableUser} WHERE - (`user_profile_country` IS NOT NULL and `user_profile_country`<>'') or - (`user_profile_region` IS NOT NULL and `user_profile_region`<>'') or - (`user_profile_city` IS NOT NULL and `user_profile_city`<>'') - - LIMIT {$iLimitStart},100"; - if(!$aResults = mysql_query($sQuery)){ - $aErrors[] = mysql_error(); - break; - } - if (mysql_num_rows($aResults)) { - while($aRow = mysql_fetch_assoc($aResults)) { - /** - * Обрабатываем каждого пользователя - */ - $iUserId=$aRow['user_id']; - if (!$aRow['user_profile_country']) { - $sQuery2="UPDATE {$sTableUser} SET user_profile_country=null, user_profile_region=null, user_profile_city=null WHERE user_id={$iUserId} "; - if(!$aResults2 = mysql_query($sQuery2)){ - $aErrors[] = mysql_error(); - } - continue; - } - $sCountry=mysql_real_escape_string($aRow['user_profile_country']); - $sCity=mysql_real_escape_string((string)$aRow['user_profile_city']); - /** - * Ищем страну в гео-базе - */ - $sQuery2="SELECT id, name_ru FROM {$sTableGeoCountry} WHERE name_ru='{$sCountry}' or name_en='{$sCountry}' LIMIT 0,1"; - if(!($aResults2 = mysql_query($sQuery2))){ - $aErrors[] = mysql_error(); - continue; - } - if($aRow2 = mysql_fetch_assoc($aResults2)) { - $iCountryId=$aRow2['id']; - $sCountryName=mysql_real_escape_string($aRow2['name_ru']); - } else { - $sQuery2="UPDATE {$sTableUser} SET user_profile_country=null, user_profile_region=null, user_profile_city=null WHERE user_id={$iUserId} "; - if(!$aResults2 = mysql_query($sQuery2)){ - $aErrors[] = mysql_error(); - } - continue; - } - /** - * Ищем город в гео-базе - */ - $iCityId=null; - $sCityName=null; - $iRegionId=null; - $sRegionName=null; - if ($sCity) { - $sQuery2="SELECT id, region_id, name_ru FROM {$sTableGeoCity} WHERE country_id='{$iCountryId}' and (name_ru='{$sCity}' or name_en='{$sCity}') LIMIT 0,1"; - if(!($aResults2 = mysql_query($sQuery2))){ - $aErrors[] = mysql_error(); - continue; - } - if($aRow2 = mysql_fetch_assoc($aResults2)) { - $iCityId=$aRow2['id']; - $sCityName=mysql_real_escape_string($aRow2['name_ru']); - $iRegionId=$aRow2['region_id']; - /** - * Получаем название региона - */ - $sQuery3="SELECT name_ru FROM {$sTableGeoRegion} WHERE id='{$iRegionId}' LIMIT 0,1"; - if(!$aResults3 = mysql_query($sQuery3)){ - $aErrors[] = mysql_error(); - continue; - } - if($aRow3 = mysql_fetch_assoc($aResults3)) { - $sRegionName=mysql_real_escape_string($aRow3['name_ru']); - } else { - continue; - } - } - } - /** - * Добавляем связь пользователя с гео-объектом - */ - $iGeoId=$iCountryId; - $sGeoType='country'; - if ($iCityId) { - $iGeoId=$iCityId; - $sGeoType='city'; - } - /** - * Проверяем отсутствие связи - */ - $sQuery2="SELECT * FROM {$sTableGeoTarget} WHERE target_type='user' and target_id='{$iUserId}' LIMIT 0,1"; - if(!($aResults2 = mysql_query($sQuery2))){ - $aErrors[] = mysql_error(); - continue; - } - if($aRow2 = mysql_fetch_assoc($aResults2)) { - // пропускаем этого пользователя - continue; - } - /** - * Создаем новую связь - */ - $sQuery2="INSERT INTO {$sTableGeoTarget} SET geo_type='{$sGeoType}', geo_id='{$iGeoId}', target_type='user', target_id='{$iUserId}', country_id=".($iCountryId ? $iCountryId : 'null').", region_id=".($iRegionId ? $iRegionId : 'null')." , city_id=".($iCityId ? $iCityId : 'null')." "; - if(!($aResults2 = mysql_query($sQuery2))){ - $aErrors[] = mysql_error(); - continue; - } - /** - * Обновляем информацию о пользователе - */ - $sQuery2="UPDATE {$sTableUser} SET user_profile_country=".($iCountryId ? "'$sCountryName'" : 'null').", user_profile_region=".($sRegionName ? "'$sRegionName'" : 'null').", user_profile_city=".($sCityName ? "'$sCityName'" : 'null')." WHERE user_id={$iUserId} "; - if(!($aResults2 = mysql_query($sQuery2))){ - $aErrors[] = mysql_error(); - continue; - } - } - } else { - break; - } - $iPage++; - } while (1); - /** - * Перенос ICQ и сайта из профиля пользователя - */ - $sTableUser=$aParams['prefix'].'user'; - $sTableUserField=$aParams['prefix'].'user_field'; - $sTableUserFieldValue=$aParams['prefix'].'user_field_value'; - - $sFieldIdIcq=null; - $sFieldIdWww=null; - - /** - * Получаем ID необходимых полей - */ - $sQuery2="SELECT id FROM {$sTableUserField} WHERE `type`='contact' and name='icq' LIMIT 0,1"; - if(!($aResults2 = mysql_query($sQuery2))){ - $aErrors[] = mysql_error(); - } else { - if($aRow2 = mysql_fetch_assoc($aResults2)) { - $sFieldIdIcq=$aRow2['id']; - } - } - $sQuery2="SELECT id FROM {$sTableUserField} WHERE `type`='contact' and name='www' LIMIT 0,1"; - if(!($aResults2 = mysql_query($sQuery2))){ - $aErrors[] = mysql_error(); - } else { - if($aRow2 = mysql_fetch_assoc($aResults2)) { - $sFieldIdWww=$aRow2['id']; - } - } - - if ($sFieldIdIcq and $sFieldIdWww) { - $iPage=1; - do { - $iLimitStart=($iPage-1)*100; - $sQuery="SELECT * FROM {$sTableUser} WHERE `user_profile_country` IS NOT NULL and `user_profile_country`<>'' LIMIT {$iLimitStart},100"; - if(!($aResults = mysql_query($sQuery))){ - $aErrors[] = mysql_error(); - break; - } - if (mysql_num_rows($aResults)) { - while($aRow = mysql_fetch_assoc($aResults)) { - $iUserId=$aRow['user_id']; - $sIcq=$aRow['user_profile_icq']; - $sWww=$aRow['user_profile_site']; - if ($sIcq) { - $sIcq=mysql_real_escape_string($sIcq); - /** - * Проверяем отсутствие связи - */ - $sQuery2="SELECT * FROM {$sTableUserFieldValue} WHERE user_id='{$iUserId}' and field_id='{$sFieldIdIcq}' LIMIT 0,1"; - if(!($aResults2 = mysql_query($sQuery2))){ - $aErrors[] = mysql_error(); - } else { - if(!($aRow2 = mysql_fetch_assoc($aResults2))) { - /** - * Создаем новую связь - */ - $sQuery3="INSERT INTO {$sTableUserFieldValue} SET user_id='{$iUserId}', field_id='{$sFieldIdIcq}', value='{$sIcq}' "; - if(!$aResults3 = mysql_query($sQuery3)){ - $aErrors[] = mysql_error(); - } - } - } - } - if ($sWww) { - $sWww=str_replace('https://','',$sWww); - $sWww=str_replace('http://','',$sWww); - } - if ($sWww) { - $sWww=mysql_real_escape_string($sWww); - /** - * Проверяем отсутствие связи - */ - $sQuery2="SELECT * FROM {$sTableUserFieldValue} WHERE user_id='{$iUserId}' and field_id='{$sFieldIdWww}' LIMIT 0,1"; - if(!($aResults2 = mysql_query($sQuery2))){ - $aErrors[] = mysql_error(); - } else { - if(!($aRow2 = mysql_fetch_assoc($aResults2))) { - /** - * Создаем новую связь - */ - $sQuery3="INSERT INTO {$sTableUserFieldValue} SET user_id='{$iUserId}', field_id='{$sFieldIdWww}', value='{$sWww}' "; - if(!$aResults3 = mysql_query($sQuery3)){ - $aErrors[] = mysql_error(); - } - } - } - } - } - } else { - break; - } - $iPage++; - } while (1); - } - /** - * Удаляем поля - */ - $sQuery="ALTER TABLE `{$sTableUser}` DROP `user_profile_site` "; - if(!mysql_query($sQuery)){ - $aErrors[] = mysql_error(); - } - $sQuery="ALTER TABLE `{$sTableUser}` DROP `user_profile_site_name` "; - if(!mysql_query($sQuery)){ - $aErrors[] = mysql_error(); - } - $sQuery="ALTER TABLE `{$sTableUser}` DROP `user_profile_icq` "; - if(!mysql_query($sQuery)){ - $aErrors[] = mysql_error(); - } - /** - * Добавление тегов в избранное - */ - $sTablefFavourite=$aParams['prefix'].'favourite'; - $sTablefTopicTag=$aParams['prefix'].'topic_tag'; - $sTablefFavouriteTag=$aParams['prefix'].'favourite_tag'; - $iPage=1; - do { - $iLimitStart=($iPage-1)*100; - $sQuery="SELECT f.user_id, f.target_id, t.topic_tag_text FROM `{$sTablefFavourite}` as f, `{$sTablefTopicTag}` as t WHERE f.`target_type`='topic' and f.`target_id`=t.topic_id LIMIT {$iLimitStart},100"; - if(!$aResults = mysql_query($sQuery)){ - $aErrors[] = mysql_error(); - break; - } - if (mysql_num_rows($aResults)) { - while($aRow = mysql_fetch_assoc($aResults)) { - $iUserId=$aRow['user_id']; - $iTargetId=$aRow['target_id']; - $sText=mysql_real_escape_string($aRow['topic_tag_text']); - /** - * Проверяем наличие - */ - $sQuery2="SELECT * FROM {$sTablefFavouriteTag} WHERE user_id='{$iUserId}' and target_id='{$iTargetId}' and target_type='topic' and is_user=0 and text='{$sText}' LIMIT 0,1"; - if(!($aResults2 = mysql_query($sQuery2))){ - $aErrors[] = mysql_error(); - continue; - } - if($aRow2 = mysql_fetch_assoc($aResults2)) { - // пропускаем - continue; - } - /** - * Создаем - */ - $sQuery2="INSERT INTO {$sTablefFavouriteTag} SET user_id='{$iUserId}', target_id='{$iTargetId}', target_type='topic', is_user=0, text='{$sText}' "; - if(!($aResults2 = mysql_query($sQuery2))){ - $aErrors[] = mysql_error(); - continue; - } - } - } else { - break; - } - $iPage++; - } while (1); - /** - * Вырезаем теги из информации о пользователе - */ - $sTableUser=$aParams['prefix'].'user'; - $iPage=1; - do { - $iLimitStart=($iPage-1)*100; - $sQuery="SELECT * FROM {$sTableUser} WHERE `user_profile_about` IS NOT NULL and `user_profile_about`<>'' LIMIT {$iLimitStart},100"; - if(!$aResults = mysql_query($sQuery)){ - $aErrors[] = mysql_error(); - break; - } - if (mysql_num_rows($aResults)) { - while($aRow = mysql_fetch_assoc($aResults)) { - $sAbout=mysql_real_escape_string(htmlspecialchars(strip_tags($aRow['user_profile_about']))); - $iUserId=$aRow['user_id']; - /** - * Обновляем информацию о пользователе - */ - $sQuery2="UPDATE {$sTableUser} SET user_profile_about='{$sAbout}' WHERE user_id={$iUserId} "; - if(!($aResults2 = mysql_query($sQuery2))){ - $aErrors[] = mysql_error(); - continue; - } - } - } else { - break; - } - $iPage++; - } while (1); - - if(count($aErrors)==0) { - return array('result'=>true,'errors'=>null); - } - return array('result'=>false,'errors'=>$aErrors); - } - /** - * Проверяем, нуждается ли база в конвертации или нет - * - * @param array $aParams - * @return bool - */ - protected function ValidateConvertDatabaseFrom10($aParams) { - /** - * Проверяем, нуждается ли база в конвертации или нет - * - */ - $sTable=$aParams['prefix'].'user'; - return !$this->isFieldExistsDatabase($sTable,'user_settings_timezone'); - } - /** - * Конвертирует базу данных версии 1.0 в базу данных версии 1.0.1 - * - * @return bool - */ - protected function ConvertDatabaseFrom10($sFilePath,$aParams) { - if(!$this->ValidateConvertDatabaseFrom10($aParams)) { - return array('result'=>false,'errors'=>array($this->Lang("error_database_converted_already"))); - } - - $sFileQuery = @file_get_contents($sFilePath); - if(!$sFileQuery) return array('result'=>false,'errors'=>array($this->Lang("config_file_not_exists", array('path'=>$sFilePath)))); - - if(isset($aParams['prefix'])) $sFileQuery = str_replace('prefix_', $aParams['prefix'], $sFileQuery); - $aQuery=explode(';',$sFileQuery); - /** - * Массив для сбора ошибок - */ - $aErrors = array(); - - /** - * Выполняем запросы по очереди - */ - foreach($aQuery as $sQuery){ - $sQuery = trim($sQuery); - /** - * Заменяем движек, если таковой указан в запросе - */ - if(isset($aParams['engine'])) $sQuery=str_ireplace('ENGINE=InnoDB', "ENGINE={$aParams['engine']}",$sQuery); - - if($sQuery!='') { - $bResult=mysql_query($sQuery); - if(!$bResult) $aErrors[] = mysql_error(); - } - } - - if(count($aErrors)==0) { - return array('result'=>true,'errors'=>null); - } - return array('result'=>false,'errors'=>$aErrors); - } - /** - * Добавление значения в поле таблицы с типом enum - * - * @param unknown_type $sTableName - * @param unknown_type $sFieldName - * @param unknown_type $sType - */ - public function addEnumTypeDatabase($sTableName,$sFieldName,$sType) { - $sQuery="SHOW COLUMNS FROM `{$sTableName}`"; - if ($res=mysql_query($sQuery)) { - while($aRow = mysql_fetch_assoc($res)) { - if ($aRow['Field'] == $sFieldName) break; - } - if (strpos($aRow['Type'], "'{$sType}'") === FALSE) { - $aRow['Type'] =str_ireplace('enum(', "enum('{$sType}',", $aRow['Type']); - $sQuery="ALTER TABLE `{$sTableName}` MODIFY `{$sFieldName}` ".$aRow['Type']; - $sQuery.= ($aRow['Null']=='NO') ? ' NOT NULL ' : ' NULL '; - $sQuery.= is_null($aRow['Default']) ? ' DEFAULT NULL ' : " DEFAULT '{$aRow['Default']}' "; - mysql_query($sQuery); - } - } - } - /** - * Проверяет существование таблицы - * - * @param unknown_type $sTableName - * @return unknown - */ - public function isTableExistsDatabase($sTableName) { - $sQuery="SHOW TABLES LIKE '{$sTableName}'"; - if ($res=mysql_query($sQuery)) { - return true; - } - return false; - } - /** - * Проверяет существование поля таблицы - * - * @param unknown_type $sTableName - * @param unknown_type $sFieldName - * @return unknown - */ - public function isFieldExistsDatabase($sTableName,$sFieldName) { - $sQuery="SHOW FIELDS FROM `{$sTableName}`"; - if ($res=mysql_query($sQuery)) { - while($aRow = mysql_fetch_assoc($res)) { - if ($aRow['Field'] == $sFieldName){ - return true; - } - } - } - return false; - } - /** - * Валидирует данные администратора - * - * @return bool; - */ - protected function ValidateAdminFields() { - $bOk = true; - $aErrors = array(); - - if(!$sLogin=$this->GetRequest('install_admin_login',false) or !preg_match("/^[\da-z\_\-]{3,30}$/i",$sLogin)) { - $bOk = false; - $aErrors[] = $this->Lang('admin_login_invalid'); - } - - if(!$sMail=$this->GetRequest('install_admin_mail',false) or !preg_match("/^[\da-z\_\-\.\+]+@[\da-z_\-\.]+\.[a-z]{2,5}$/i",$sMail)) { - $bOk = false; - $aErrors[] = $this->Lang('admin_mail_invalid'); - } - if(!$sPass=$this->GetRequest('install_admin_pass',false) or strlen($sPass)<3) { - $bOk = false; - $aErrors[] = $this->Lang('admin_password_invalid'); - } - if($this->GetRequest('install_admin_repass','') != $this->GetRequest('install_admin_pass','')) { - $bOk = false; - $aErrors[] = $this->Lang('admin_repassword_invalid'); - } - - return array($bOk, $aErrors); - } - /** - * Сохраняет данные об администраторе в базу данных - * - * @param string $sLogin - * @param string $sPassword - * @param string $sMail - * @param string $sPrefix - * @return bool - */ - protected function UpdateDBUser($sLogin,$sPassword,$sMail,$sPrefix="prefix_") { - $sQuery = " - UPDATE `{$sPrefix}user` - SET - `user_login` = '{$sLogin}', - `user_mail` = '{$sMail}', - `user_password` = md5('{$sPassword}') - WHERE `user_id` = 1"; - - return mysql_query($sQuery); - } - /** - * Перезаписывает название блога в базе данных - * - * @param string $sBlogName - * @param string [$sPrefix = "prefix_" - * @return bool - */ - protected function UpdateUserBlog($sBlogName,$sPrefix="prefix_") { - $sQuery = " - UPDATE `{$sPrefix}blog` - SET - `blog_title` = '".mysql_real_escape_string($sBlogName)."' - WHERE `blog_id` = 1"; - - return mysql_query($sQuery); - } - /** - * Проверяет, использует ли mysql запрос, одну из указанных в массиве таблиц - * - * @param sring $sQuery - * @param array $aTables - * @return bool - */ - protected function IsUseDbTable($sQuery,$aTables) { - foreach($aTables as $sTable){ - if(substr_count($sQuery, "`{$sTable}`")) return true; - } - return false; - } - /** - * Отдает список доступных шаблонов - * - * @return array - */ - protected function GetSkinList() { - /** - * Получаем список каталогов - */ - $aDir=glob($this->sSkinDir.'/*', GLOB_ONLYDIR); - - if(!is_array($aDir)) return array(); - return array_map(create_function('$sDir', 'return basename($sDir);'),$aDir); - } - /** - * Отдает список доступных языков - * - * @return array - */ - protected function GetLangList() { - /** - * Получаем список каталогов - */ - $aDir=glob($this->sLangDir.'/*.php'); - - if(!is_array($aDir)) return array(); - return array_map(create_function('$sDir', 'return basename($sDir,".php");'),$aDir); - } - /** - * Сохраняет в конфигурации абсолютные пути - * - * @access protected - * @return null - */ - protected function SavePath() { - $sLocalConfigFile = $this->sConfigDir.'/'.self::LOCAL_CONFIG_FILE_NAME; - $this->SaveConfig('path.root.web',$this->GetPathRootWeb(), $sLocalConfigFile); - $this->SaveConfig('path.root.server', $this->GetPathRootServer(), $sLocalConfigFile); - - $aDirs=array(); - $sDirs=trim(str_replace('http://'.$_SERVER['HTTP_HOST'],'',$this->GetPathRootWeb()),'/'); - if ($sDirs!='') { - $aDirs=explode('/',$sDirs); - } - $this->SaveConfig('path.offset_request_url', count($aDirs), $sLocalConfigFile); - } - - protected function GetPathRootWeb() { - return rtrim('http://'.$_SERVER['HTTP_HOST'],'/').str_replace('/install/index.php','',$_SERVER['PHP_SELF']); - } - - protected function GetPathRootServer() { - return rtrim(dirname(dirname(__FILE__)),'/'); - } -} - -session_start(); -$oInstaller = new Install; -$oInstaller->Run(); -?> \ No newline at end of file diff --git a/install/language/english.php b/install/language/english.php deleted file mode 100644 index 6eb19b29..00000000 --- a/install/language/english.php +++ /dev/null @@ -1,123 +0,0 @@ -"File %%path%% doesn't exist.", - "config_file_not_writable"=>"File %%path%% is not writable.", - - 'error_db_invalid'=>'Unable to choose or create Database', - 'error_db_connection_invalid'=>"Can't connect to the Database. Please check configuration details.", - 'error_db_saved'=>'Unable to save data into the DB.', - 'error_db_no_data'=>"Unable to get data from the DB.", - - 'error_local_config_invalid'=>"Can't find local configuration file - /config/config.local.php.", - - 'site_name_invalid'=>'Chosen site name is not allowed.', - 'site_description_invalid'=>'Chosen site description is not allowed.', - 'site_keywords_invalid'=>'Chosen keywords are invalid.', - 'skin_name_invalid'=>'Chosen skin name is invalid.', - 'mail_sender_invalid'=>'Chosen invalid e-mail address.', - 'mail_name_invalid'=>'Chosen invalid notification sender name.', - 'lang_current_invalid'=>'Chosen language is not allowed.', - 'lang_default_invalid'=>'Chosen default language is not allowed.', - 'admin_login_invalid'=>'Invalid Administrator login.', - 'admin_mail_invalid'=>'Invalid Administrator e-mail.', - 'admin_password_invalid'=>'Invalid Administrator password.', - 'admin_repassword_invalid'=>'Invalid password confirmation.', - - 'ok_db_created'=>'Database created successfully. Configuration saved into configuration file.', - - 'yes' => 'Yes', - 'no' => 'No', - 'next' => 'Next', - 'prev' => 'Back', - - 'valid_mysql_server'=>'LiveStreet requires MySQL version 5 or higher.', - - 'install_title'=>'LiveStreet Installation', - 'step'=>'Step', - - 'start_paragraph'=>'

Welcome to LiveStreet © 1.0.1 installation.

Notice: You have to rename file - /config/config.local.php.dist to /config/config.local.php and apply read-write (rw) permision to it.

Notice: Make sure that the following directories have rw permissions: /tmp, /logs, /uploads, /templates/compiled, /templates/cache

', - - 'php_params'=>'General PHP Configuration', - 'php_params_version'=>'PHP ver. 5.2.0 or higher', - 'php_params_safe_mode'=>'Safe mode is on', - 'php_params_utf8'=>'UTF8 support in PCRE', - 'php_params_mbstring'=>'Mbstring support', - 'php_params_simplexml'=>'SimpleXML support', - - 'local_config'=>'Local Configuration', - 'local_config_file'=>'File /config/config.local.php exists and writable', - 'local_temp_dir'=>'Directory /tmp exists and writable', - 'local_logs_dir'=>'Directory /logs exists and writable', - 'local_uploads_dir'=>'Directory /uploads exists and writable', - 'local_templates_dir'=>'Directory /templates/compiled exists and writable', - 'local_templates_cache_dir'=>'Directory /templates/cache exists and writable', - 'local_plugins_dir'=>'Directory /plugins exists and writable', - - 'db_params'=>'Database (DB) configuration', - 'db_params_host'=>'DB hostname', - 'db_params_port'=>'DB port', - 'db_params_port_notice'=>'It might be a good choice to leave it as 3306 :)', - 'db_params_name'=>'DB name', - 'db_params_create'=>'Create DB', - 'db_params_convert'=>'Convert 0.5.1 DB to 1.0.1', - 'db_params_convert_from_10'=>'Convert 1.0 DB to 1.0.1', - 'db_params_user'=>'Username', - 'db_params_password'=>'Password', - 'db_params_prefix'=>"Table's prefix", - 'db_params_prefix_notice'=>'This prefix will be appended to all table names', - 'db_params_engine'=>'Tables engine', - 'db_params_engine_notice'=>'InnoDB is recommended', - - 'error_table_select'=>'Query error whilst getting data from %%table%%', - 'error_database_converted_already'=>'DB structure suits v. 1.0.1 hence conversion aborted', - - 'admin_params'=>'Administrator Details Configuration', - 'admin_params_login'=>'Login', - 'admin_params_mail'=>'E-mail', - 'admin_params_pass'=>'Password', - 'admin_params_repass'=>'Confirm password', - - 'end_paragraph' => 'Congratulations! LiveStreet successfully installed.
To ensure that your installation is secure, please delete [Install] directory.

You can continue configuration in extended mode.

Go to the main page

', - 'extend_mode'=> 'Extended mode', - - 'view_params'=> 'HTML view configuration', - 'view_params_name'=> 'Site name', - 'view_params_description'=> 'Site description', - 'view_params_keywords'=> 'Keywords', - 'view_params_skin'=> 'Skin name', - - 'mail_params'=> 'E-mail notification parameters', - 'mail_params_sender'=> 'Sent from E-mail address (for notifications)', - 'mail_params_name'=> 'Sent from Name (ex. John Doe)', - - 'general_params'=> 'General Configuration', - 'general_params_close'=> 'Use "closed mode" for your site', - 'general_params_active'=> 'Use registration activation', - 'general_params_invite'=> 'Use registration by invitation', - - 'language_params'=> 'Language settings', - 'language_params_current'=> 'Current language', - 'language_params_default'=> 'Default language', - - 'finish_paragraph' => 'Congratulations! LiveStreet successfully installed.
To ensure that your installation is secure, please delete [Install] directory.

Then to go to the main page by clicking this link.', -); \ No newline at end of file diff --git a/install/language/russian.php b/install/language/russian.php deleted file mode 100644 index 42a6ec3d..00000000 --- a/install/language/russian.php +++ /dev/null @@ -1,123 +0,0 @@ -"Файл %%path%% не существует.", - "config_file_not_writable"=>"Файл %%path%% недосупен для записи.", - - 'error_db_invalid'=>'Невозможно выбрать или создать базу данных', - 'error_db_connection_invalid'=>'Не удалось подключиться к базе данных. Проверьте корректность введенных вами настроек.', - 'error_db_saved'=>'Не удалось сохранить данные в базе.', - 'error_db_no_data'=>"Не удалось получить данные из базы.", - - 'error_local_config_invalid'=>'Файл локальной конфигурации /config/config.local.php не найден.', - - 'site_name_invalid'=>'Указано недопустимое название сайта.', - 'site_description_invalid'=>'Указано недопустимое описание сайта.', - 'site_keywords_invalid'=>'Указано недопустимые ключевые слова.', - 'skin_name_invalid'=>'Указано недопустимое имя шаблона.', - 'mail_sender_invalid'=>'Указано недопустимый e-mail.', - 'mail_name_invalid'=>'Указано недопустимое имя отправителя уведомлений.', - 'lang_current_invalid'=>'Указан недопустимый язык.', - 'lang_default_invalid'=>'Указан недопустимый язык по-умолчанию.', - 'admin_login_invalid'=>'Логин администратора введен не верно.', - 'admin_mail_invalid'=>'E-mail администратора введен не верно.', - 'admin_password_invalid'=>'Пароль администратора введен не верно.', - 'admin_repassword_invalid'=>'Подтверждение пароля не совпадает с самим паролем.', - - 'ok_db_created'=>'База данных успешно создана. Данные записаны в конфигурационный файл.', - - 'yes' => 'Да', - 'no' => 'Нет', - 'next' => 'Дальше', - 'prev' => 'Назад', - - 'valid_mysql_server'=>'Для работы LiveStreet необходим сервер MySQL версии не ниже 5.', - - 'install_title'=>'Установка LiveStreet', - 'step'=>'Шаг', - - 'start_paragraph'=>'

Добро пожаловать в инсталлятор LiveStreet © 1.0.1. Ознакомьтесь с результатами и следуйте подсказкам.

Внимание. Для успешной иснталяции вы должны переименовать файл /config/config.local.php.dist на /config/config.local.php и дать этому файлу права на запись.

Внимание. Директории /tmp, /logs, /uploads, /templates/compiled, /templates/cache должны иметь права на запись.

', - - 'php_params'=>'Основные настройки PHP', - 'php_params_version'=>'PHP версии не ниже 5.2.0', - 'php_params_safe_mode'=>'Safe mode выключен', - 'php_params_utf8'=>'Поддержка UTF8 в PCRE', - 'php_params_mbstring'=>'Поддержка Mbstring', - 'php_params_simplexml'=>'Поддержка SimpleXML', - - 'local_config'=>'Локальная конфигурация', - 'local_config_file'=>'Файл /config/config.local.php существует и доступен для записи', - 'local_temp_dir'=>'Директория /tmp существует и доступна для записи', - 'local_logs_dir'=>'Директория /logs существует и доступна для записи', - 'local_uploads_dir'=>'Директория /uploads существует и доступна для записи', - 'local_templates_dir'=>'Директория /templates/compiled существует и доступна для записи', - 'local_templates_cache_dir'=>'Директория /templates/cache существует и доступна для записи', - 'local_plugins_dir'=>'Директория /plugins существует и доступна для записи', - - 'db_params'=>'Настройка базы данных', - 'db_params_host'=>'Имя сервера БД', - 'db_params_port'=>'Порт сервера БД', - 'db_params_port_notice'=>'Скорее всего правильным решение будет оставить 3306 :)', - 'db_params_name'=>'Название базы данных', - 'db_params_create'=>'Создать базу данных', - 'db_params_convert'=>'Конвертировать базу 0.5.1 в 1.0.1', - 'db_params_convert_from_10'=>'Конвертировать базу 1.0 в 1.0.1', - 'db_params_user'=>'Имя пользователя', - 'db_params_password'=>'Пароль', - 'db_params_prefix'=>'Префикс таблиц', - 'db_params_prefix_notice'=>'Указанный префикс будет приставлен к названию всех таблиц', - 'db_params_engine'=>'Tables engine', - 'db_params_engine_notice'=>'Рекомендуется использовать InnoDB', - - 'error_table_select'=>'Ошибка запроса на выборку данных из таблицы %%table%%', - 'error_database_converted_already'=>'Конвертация отменена, так как структура базы данных соответствует версии 1.0.1', - - 'admin_params'=>'Настройка данных администратора', - 'admin_params_login'=>'Логин', - 'admin_params_mail'=>'E-mail', - 'admin_params_pass'=>'Пароль', - 'admin_params_repass'=>'Еще раз', - - 'end_paragraph' => 'Примите поздравления! LiveStreet успешно установлена.
Для обеспечения безопасности работы системы, удалите директорию Install.

Вы можете продолжить настройку в расширенном режиме.

Перейти на главную страницу

', - 'extend_mode'=> 'Расширенный режим', - - 'view_params'=> 'Настройки HTML вида', - 'view_params_name'=> 'Название сайта', - 'view_params_description'=> 'Описание сайта', - 'view_params_keywords'=> 'Ключевые слова', - 'view_params_skin'=> 'Название шаблона', - - 'mail_params'=> 'Настройки почтовых уведомлений', - 'mail_params_sender'=> 'E-mail с которого отправляются уведомления', - 'mail_params_name'=> 'Имя от которого отправляются уведомления', - - 'general_params'=> 'Общие настройки', - 'general_params_close'=> 'Использовать закрытый режим работы сайта', - 'general_params_active'=> 'Использовать активацию при регистрации', - 'general_params_invite'=> 'Использовать режим регистрации по приглашению', - - 'language_params'=> 'Языковые настройки', - 'language_params_current'=> 'Текущий язык', - 'language_params_default'=> 'Язык, который будет использоваться по умолчанию', - - 'finish_paragraph' => 'Примите поздравления! LiveStreet успешно установлена.
Для обеспечения безопасности работы системы, удалите директорию Install.

Перейти на главную страницу', -); \ No newline at end of file diff --git a/install/patch.sql b/install/patch.sql new file mode 100644 index 00000000..5f1d496b --- /dev/null +++ b/install/patch.sql @@ -0,0 +1,2 @@ +ALTER TABLE `prefix_subscribe` ADD `user_id` INT( 11 ) UNSIGNED NULL DEFAULT NULL AFTER `target_id` , +ADD INDEX ( `user_id` ) ; \ No newline at end of file diff --git a/install/sphinx.conf b/install/sphinx.conf deleted file mode 100644 index 241d6a41..00000000 --- a/install/sphinx.conf +++ /dev/null @@ -1,165 +0,0 @@ -## Конфигурационный файл Sphinx-а для индексации LiveStreet - -####################### -# -# Описываем индексы -# -####################### - -# Источник-родитель для всех остальных источников. Здесь указываются параметры доступа -# к базе данных сайта -source lsParentSource -{ - type = mysql - sql_host = localhost - sql_user = user - sql_pass = pass - sql_db = livestreet - sql_port = 3306 - # Для ускорения работы прописываем путь до MySQL-го UNIX-сокета (чтобы - # операции с БД происходили не через TCP/IP стек сервера) - sql_sock = /var/run/mysqld/mysqld.sock - - - mysql_connect_flags = 32 # 32- включение сжатие при обмене данными с БД - - # Включам нужную кодировку соединения и выключаем кеш запросов - sql_query_pre = SET NAMES utf8 - sql_query_pre = SET SESSION query_cache_type=OFF -} - -# Источник топиков -source topicsSource : lsParentSource -{ - # запрос на получения данных топиков - sql_query = \ - SELECT t_fast.topic_id, t_fast.topic_title, UNIX_TIMESTAMP(t_fast.topic_date_add) as topic_date_add, \ - tc.topic_text, t_fast.topic_publish \ - FROM prefix_topic as t_fast, prefix_topic_content AS tc \ - WHERE t_fast.topic_id=tc.topic_id AND t_fast.topic_id>=$start AND t_fast.topic_id<=$end - - # запрос для дробления получения топиков на неколько итераций - sql_query_range = SELECT MIN(topic_id),MAX(topic_id) FROM prefix_topic - - # сколько получать объектов за итерацию - sql_range_step = 1000 - - - # Указываем булевый атрибут критерия "топик опубликован". Для возможности указания этого критерия при поиске - sql_attr_uint = topic_publish - - # Атрибут даты добавления, типа "время" - sql_attr_timestamp = topic_date_add - - # мульти-аттрибут "теги топика" - sql_attr_multi = uint tag from query; SELECT topic_id, topic_tag_id FROM prefix_topic_tag - - sql_ranged_throttle = 0 -} - -# Источник комментариев -source commentsSource : lsParentSource -{ - sql_query = \ - SELECT comment_id, comment_text, UNIX_TIMESTAMP(comment_date) as comment_date, comment_delete \ - FROM prefix_comment \ - WHERE target_type='topic' AND comment_id>=$start AND comment_id<=$end AND comment_publish=1 - - sql_query_range = SELECT MIN(comment_id),MAX(comment_id) FROM prefix_comment - sql_range_step = 5000 - - sql_attr_uint = comment_delete - sql_attr_timestamp = comment_date -} - -####################### -# -# Описываем индексы -# -####################### - -index topicsIndex -{ - # Источник, который будет хранить данный индекса - source = topicsSource - path = /var/lib/sphinx/topicIndex - - # Тип хранения аттрибутов - docinfo = extern - - mlock = 0 - - # Используемые морфологические движки - morphology = stem_enru - - # Кодировака данных из источника - charset_type = utf-8 - - - # Из данных источника HTML-код нужно вырезать - html_strip = 1 - html_remove_elements = style, script, code -} - -# Индекс комментариев -index commentsIndex -{ - source = commentsSource - path = /var/lib/sphinx/commentsIndex - - docinfo = extern - - mlock = 0 - - morphology = stem_enru - - charset_type = utf-8 - - # Из данных источника HTML-код нужно вырезать - html_strip = 1 - html_remove_elements = style, script, code -} - -####################### -# -# Настройки индексатора -# -####################### - - -indexer -{ - # Лимит памяти, который может использавать демон-индексатор - mem_limit = 128M -} - -####################### -# -# Настройка демона-поисковика -# -####################### - -searchd -{ - # Адрес, на котором будет прослушиваться порт - address = 127.0.0.1 - - - # Ну и собственно номер порта демона searchd - port = 3312 - - # Лог-файл демона - log = /var/log/sphinx/searchd.log - - # Лог поисковых запросов. Если закомментировать,то логировать поисковые строки не будет - query_log = /var/log/sphinx/query.log - - # Время в секундах, которое ждет демон при обмене данными с клиентом. По исчерпании происходит разрыв коннекта - read_timeout = 5 - - # Максимальное количество одновременно-обрабатываемых запросов. 0 означает дофига, а точнее без ограничения - max_children = 100 - - # Файл, в который сохраняется PID-процесса при запуске - pid_file = /var/log/sphinx/searchd.pid -} \ No newline at end of file diff --git a/install/sql.sql b/install/sql.sql deleted file mode 100644 index d214194a..00000000 --- a/install/sql.sql +++ /dev/null @@ -1,1031 +0,0 @@ --- --- Database LiveStreet version 1.0.1 --- - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_blog` --- - -CREATE TABLE IF NOT EXISTS `prefix_blog` ( - `blog_id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `user_owner_id` int(11) unsigned NOT NULL, - `blog_title` varchar(200) NOT NULL, - `blog_description` text NOT NULL, - `blog_type` enum('personal','open','invite','close') DEFAULT 'personal', - `blog_date_add` datetime NOT NULL, - `blog_date_edit` datetime DEFAULT NULL, - `blog_rating` float(9,3) NOT NULL DEFAULT '0.000', - `blog_count_vote` int(11) unsigned NOT NULL DEFAULT '0', - `blog_count_user` int(11) unsigned NOT NULL DEFAULT '0', - `blog_count_topic` int(10) unsigned NOT NULL DEFAULT '0', - `blog_limit_rating_topic` float(9,3) NOT NULL DEFAULT '0.000', - `blog_url` varchar(200) DEFAULT NULL, - `blog_avatar` varchar(250) DEFAULT NULL, - PRIMARY KEY (`blog_id`), - KEY `user_owner_id` (`user_owner_id`), - KEY `blog_type` (`blog_type`), - KEY `blog_url` (`blog_url`), - KEY `blog_title` (`blog_title`), - KEY `blog_count_topic` (`blog_count_topic`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; - --- --- Дамп данных таблицы `prefix_blog` --- - -INSERT INTO `prefix_blog` (`blog_id`, `user_owner_id`, `blog_title`, `blog_description`, `blog_type`, `blog_date_add`, `blog_date_edit`, `blog_rating`, `blog_count_vote`, `blog_count_user`, `blog_count_topic`, `blog_limit_rating_topic`, `blog_url`, `blog_avatar`) VALUES -(1, 1, 'Blog by admin', 'This is your personal blog.', 'personal', '2012-08-07 00:00:00', NULL, 0.000, 0, 0, 0, -1000.000, NULL, '0'); - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_blog_user` --- - -CREATE TABLE IF NOT EXISTS `prefix_blog_user` ( - `blog_id` int(11) unsigned NOT NULL, - `user_id` int(11) unsigned NOT NULL, - `user_role` int(3) DEFAULT '1', - UNIQUE KEY `blog_id_user_id_uniq` (`blog_id`,`user_id`), - KEY `blog_id` (`blog_id`), - KEY `user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_blog_user` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_comment` --- - -CREATE TABLE IF NOT EXISTS `prefix_comment` ( - `comment_id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `comment_pid` int(11) unsigned DEFAULT NULL, - `comment_left` int(11) NOT NULL DEFAULT '0', - `comment_right` int(11) NOT NULL DEFAULT '0', - `comment_level` int(11) NOT NULL DEFAULT '0', - `target_id` int(11) unsigned DEFAULT NULL, - `target_type` enum('topic','talk') NOT NULL DEFAULT 'topic', - `target_parent_id` int(11) NOT NULL DEFAULT '0', - `user_id` int(11) unsigned NOT NULL, - `comment_text` text NOT NULL, - `comment_text_hash` varchar(32) NOT NULL, - `comment_date` datetime NOT NULL, - `comment_user_ip` varchar(20) NOT NULL, - `comment_rating` float(9,3) NOT NULL DEFAULT '0.000', - `comment_count_vote` int(11) unsigned NOT NULL DEFAULT '0', - `comment_count_favourite` int(11) unsigned NOT NULL DEFAULT '0', - `comment_delete` tinyint(4) NOT NULL DEFAULT '0', - `comment_publish` tinyint(1) NOT NULL DEFAULT '1', - PRIMARY KEY (`comment_id`), - KEY `comment_pid` (`comment_pid`), - KEY `type_date_rating` (`target_type`,`comment_date`,`comment_rating`), - KEY `id_type` (`target_id`,`target_type`), - KEY `type_delete_publish` (`target_type`,`comment_delete`,`comment_publish`), - KEY `user_type` (`user_id`,`target_type`), - KEY `target_parent_id` (`target_parent_id`), - KEY `comment_left` (`comment_left`), - KEY `comment_right` (`comment_right`), - KEY `comment_level` (`comment_level`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- --- Дамп данных таблицы `prefix_comment` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_comment_online` --- - -CREATE TABLE IF NOT EXISTS `prefix_comment_online` ( - `comment_online_id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `target_id` int(11) unsigned DEFAULT NULL, - `target_type` enum('topic','talk') NOT NULL DEFAULT 'topic', - `target_parent_id` int(11) NOT NULL DEFAULT '0', - `comment_id` int(11) unsigned NOT NULL, - PRIMARY KEY (`comment_online_id`), - UNIQUE KEY `id_type` (`target_id`,`target_type`), - KEY `comment_id` (`comment_id`), - KEY `type_parent` (`target_type`,`target_parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- --- Дамп данных таблицы `prefix_comment_online` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_favourite` --- - -CREATE TABLE IF NOT EXISTS `prefix_favourite` ( - `user_id` int(11) unsigned NOT NULL, - `target_id` int(11) unsigned DEFAULT NULL, - `target_type` enum('topic','comment','talk') DEFAULT 'topic', - `target_publish` tinyint(1) DEFAULT '1', - `tags` varchar(250) NOT NULL, - UNIQUE KEY `user_id_target_id_type` (`user_id`,`target_id`,`target_type`), - KEY `target_publish` (`target_publish`), - KEY `id_type` (`target_id`,`target_type`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_favourite` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_favourite_tag` --- - -CREATE TABLE IF NOT EXISTS `prefix_favourite_tag` ( - `user_id` int(10) unsigned NOT NULL, - `target_id` int(11) NOT NULL, - `target_type` enum('topic','comment','talk') NOT NULL, - `is_user` tinyint(1) NOT NULL DEFAULT '0', - `text` varchar(50) NOT NULL, - KEY `user_id_target_type_id` (`user_id`,`target_type`,`target_id`), - KEY `target_type_id` (`target_type`,`target_id`), - KEY `is_user` (`is_user`), - KEY `text` (`text`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_favourite_tag` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_friend` --- - -CREATE TABLE IF NOT EXISTS `prefix_friend` ( - `user_from` int(11) unsigned NOT NULL DEFAULT '0', - `user_to` int(11) unsigned NOT NULL DEFAULT '0', - `status_from` int(4) NOT NULL, - `status_to` int(4) NOT NULL, - PRIMARY KEY (`user_from`,`user_to`), - KEY `user_to` (`user_to`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_friend` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_invite` --- - -CREATE TABLE IF NOT EXISTS `prefix_invite` ( - `invite_id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `invite_code` varchar(32) NOT NULL, - `user_from_id` int(11) unsigned NOT NULL, - `user_to_id` int(11) unsigned DEFAULT NULL, - `invite_date_add` datetime NOT NULL, - `invite_date_used` datetime DEFAULT NULL, - `invite_used` tinyint(1) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`invite_id`), - UNIQUE KEY `invite_code` (`invite_code`), - KEY `user_from_id` (`user_from_id`), - KEY `user_to_id` (`user_to_id`), - KEY `invite_date_add` (`invite_date_add`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- --- Дамп данных таблицы `prefix_invite` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_notify_task` --- - -CREATE TABLE IF NOT EXISTS `prefix_notify_task` ( - `notify_task_id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `user_login` varchar(30) DEFAULT NULL, - `user_mail` varchar(50) DEFAULT NULL, - `notify_subject` varchar(200) DEFAULT NULL, - `notify_text` text, - `date_created` datetime DEFAULT NULL, - `notify_task_status` tinyint(2) unsigned DEFAULT NULL, - PRIMARY KEY (`notify_task_id`), - KEY `date_created` (`date_created`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- --- Дамп данных таблицы `prefix_notify_task` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_reminder` --- - -CREATE TABLE IF NOT EXISTS `prefix_reminder` ( - `reminder_code` varchar(32) NOT NULL, - `user_id` int(11) unsigned NOT NULL, - `reminder_date_add` datetime NOT NULL, - `reminder_date_used` datetime DEFAULT '0000-00-00 00:00:00', - `reminder_date_expire` datetime NOT NULL, - `reminde_is_used` tinyint(1) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`reminder_code`), - UNIQUE KEY `user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_reminder` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_session` --- - -CREATE TABLE IF NOT EXISTS `prefix_session` ( - `session_key` varchar(32) NOT NULL, - `user_id` int(11) unsigned NOT NULL, - `session_ip_create` varchar(15) NOT NULL, - `session_ip_last` varchar(15) NOT NULL, - `session_date_create` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `session_date_last` datetime NOT NULL, - PRIMARY KEY (`session_key`), - UNIQUE KEY `user_id` (`user_id`), - KEY `session_date_last` (`session_date_last`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_session` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_stream_event` --- - -CREATE TABLE IF NOT EXISTS `prefix_stream_event` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `event_type` varchar(100) NOT NULL, - `target_id` int(11) NOT NULL, - `user_id` int(11) unsigned NOT NULL, - `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `publish` tinyint(1) NOT NULL DEFAULT '1', - PRIMARY KEY (`id`), - KEY `event_type` (`event_type`,`user_id`), - KEY `user_id` (`user_id`), - KEY `publish` (`publish`), - KEY `target_id` (`target_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- --- Дамп данных таблицы `prefix_stream_event` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_stream_subscribe` --- - -CREATE TABLE IF NOT EXISTS `prefix_stream_subscribe` ( - `user_id` int(11) unsigned NOT NULL, - `target_user_id` int(11) NOT NULL, - KEY `user_id` (`user_id`,`target_user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_stream_subscribe` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_stream_user_type` --- - -CREATE TABLE IF NOT EXISTS `prefix_stream_user_type` ( - `user_id` int(11) unsigned NOT NULL, - `event_type` varchar(100) DEFAULT NULL, - KEY `user_id` (`user_id`,`event_type`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_stream_user_type` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_subscribe` --- - -CREATE TABLE IF NOT EXISTS `prefix_subscribe` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `target_type` varchar(20) NOT NULL, - `target_id` int(11) DEFAULT NULL, - `mail` varchar(50) NOT NULL, - `date_add` datetime NOT NULL, - `date_remove` datetime DEFAULT NULL, - `ip` varchar(20) NOT NULL, - `key` varchar(32) DEFAULT NULL, - `status` tinyint(1) NOT NULL DEFAULT '1', - PRIMARY KEY (`id`), - KEY `type` (`target_type`), - KEY `mail` (`mail`), - KEY `status` (`status`), - KEY `key` (`key`), - KEY `target_id` (`target_id`), - KEY `ip` (`ip`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- --- Дамп данных таблицы `prefix_subscribe` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_talk` --- - -CREATE TABLE IF NOT EXISTS `prefix_talk` ( - `talk_id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `user_id` int(11) unsigned NOT NULL, - `talk_title` varchar(200) NOT NULL, - `talk_text` text NOT NULL, - `talk_date` datetime NOT NULL, - `talk_date_last` datetime NOT NULL, - `talk_user_id_last` int(11) NOT NULL, - `talk_user_ip` varchar(20) NOT NULL, - `talk_comment_id_last` int(11) DEFAULT NULL, - `talk_count_comment` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`talk_id`), - KEY `user_id` (`user_id`), - KEY `talk_title` (`talk_title`), - KEY `talk_date` (`talk_date`), - KEY `talk_date_last` (`talk_date_last`), - KEY `talk_user_id_last` (`talk_user_id_last`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- --- Дамп данных таблицы `prefix_talk` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_talk_blacklist` --- - -CREATE TABLE IF NOT EXISTS `prefix_talk_blacklist` ( - `user_id` int(10) unsigned NOT NULL, - `user_target_id` int(10) unsigned NOT NULL, - PRIMARY KEY (`user_id`,`user_target_id`), - KEY `prefix_talk_blacklist_fk_target` (`user_target_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_talk_blacklist` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_talk_user` --- - -CREATE TABLE IF NOT EXISTS `prefix_talk_user` ( - `talk_id` int(11) unsigned NOT NULL, - `user_id` int(11) unsigned NOT NULL, - `date_last` datetime DEFAULT NULL, - `comment_id_last` int(11) NOT NULL DEFAULT '0', - `comment_count_new` int(11) NOT NULL DEFAULT '0', - `talk_user_active` tinyint(1) DEFAULT '1', - UNIQUE KEY `talk_id_user_id` (`talk_id`,`user_id`), - KEY `user_id` (`user_id`), - KEY `date_last` (`date_last`), - KEY `date_last_2` (`date_last`), - KEY `talk_user_active` (`talk_user_active`), - KEY `comment_count_new` (`comment_count_new`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_talk_user` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_topic` --- - -CREATE TABLE IF NOT EXISTS `prefix_topic` ( - `topic_id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `blog_id` int(11) unsigned NOT NULL, - `user_id` int(11) unsigned NOT NULL, - `topic_type` enum('topic','link','question','photoset') NOT NULL DEFAULT 'topic', - `topic_title` varchar(200) NOT NULL, - `topic_tags` varchar(250) NOT NULL COMMENT 'tags separated by a comma', - `topic_date_add` datetime NOT NULL, - `topic_date_edit` datetime DEFAULT NULL, - `topic_user_ip` varchar(20) NOT NULL, - `topic_publish` tinyint(1) NOT NULL DEFAULT '0', - `topic_publish_draft` tinyint(1) NOT NULL DEFAULT '1', - `topic_publish_index` tinyint(1) NOT NULL DEFAULT '0', - `topic_rating` float(9,3) NOT NULL DEFAULT '0.000', - `topic_count_vote` int(11) unsigned NOT NULL DEFAULT '0', - `topic_count_vote_up` int(11) NOT NULL DEFAULT '0', - `topic_count_vote_down` int(11) NOT NULL DEFAULT '0', - `topic_count_vote_abstain` int(11) NOT NULL DEFAULT '0', - `topic_count_read` int(11) unsigned NOT NULL DEFAULT '0', - `topic_count_comment` int(11) unsigned NOT NULL DEFAULT '0', - `topic_count_favourite` int(11) unsigned NOT NULL DEFAULT '0', - `topic_cut_text` varchar(100) DEFAULT NULL, - `topic_forbid_comment` tinyint(1) NOT NULL DEFAULT '0', - `topic_text_hash` varchar(32) NOT NULL, - PRIMARY KEY (`topic_id`), - KEY `blog_id` (`blog_id`), - KEY `user_id` (`user_id`), - KEY `topic_date_add` (`topic_date_add`), - KEY `topic_rating` (`topic_rating`), - KEY `topic_publish` (`topic_publish`), - KEY `topic_text_hash` (`topic_text_hash`), - KEY `topic_count_comment` (`topic_count_comment`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- --- Дамп данных таблицы `prefix_topic` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_topic_content` --- - -CREATE TABLE IF NOT EXISTS `prefix_topic_content` ( - `topic_id` int(11) unsigned NOT NULL, - `topic_text` longtext NOT NULL, - `topic_text_short` text NOT NULL, - `topic_text_source` longtext NOT NULL, - `topic_extra` text NOT NULL, - PRIMARY KEY (`topic_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_topic_content` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_topic_photo` --- - -CREATE TABLE IF NOT EXISTS `prefix_topic_photo` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `topic_id` int(11) unsigned DEFAULT NULL, - `path` varchar(255) NOT NULL, - `description` text, - `target_tmp` varchar(40) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `topic_id` (`topic_id`), - KEY `target_tmp` (`target_tmp`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- --- Дамп данных таблицы `prefix_topic_photo` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_topic_question_vote` --- - -CREATE TABLE IF NOT EXISTS `prefix_topic_question_vote` ( - `topic_id` int(11) unsigned NOT NULL, - `user_voter_id` int(11) unsigned NOT NULL, - `answer` tinyint(4) NOT NULL, - UNIQUE KEY `topic_id_user_id` (`topic_id`,`user_voter_id`), - KEY `user_voter_id` (`user_voter_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_topic_question_vote` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_topic_read` --- - -CREATE TABLE IF NOT EXISTS `prefix_topic_read` ( - `topic_id` int(11) unsigned NOT NULL, - `user_id` int(11) unsigned NOT NULL, - `date_read` datetime NOT NULL, - `comment_count_last` int(10) unsigned NOT NULL DEFAULT '0', - `comment_id_last` int(11) NOT NULL DEFAULT '0', - UNIQUE KEY `topic_id_user_id` (`topic_id`,`user_id`), - KEY `user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_topic_read` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_topic_tag` --- - -CREATE TABLE IF NOT EXISTS `prefix_topic_tag` ( - `topic_tag_id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `topic_id` int(11) unsigned NOT NULL, - `user_id` int(11) unsigned NOT NULL, - `blog_id` int(11) unsigned NOT NULL, - `topic_tag_text` varchar(50) NOT NULL, - PRIMARY KEY (`topic_tag_id`), - KEY `topic_id` (`topic_id`), - KEY `user_id` (`user_id`), - KEY `blog_id` (`blog_id`), - KEY `topic_tag_text` (`topic_tag_text`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- --- Дамп данных таблицы `prefix_topic_tag` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_user` --- - -CREATE TABLE IF NOT EXISTS `prefix_user` ( - `user_id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `user_login` varchar(30) NOT NULL, - `user_password` varchar(50) NOT NULL, - `user_mail` varchar(50) NOT NULL, - `user_skill` float(9,3) unsigned NOT NULL DEFAULT '0.000', - `user_date_register` datetime NOT NULL, - `user_date_activate` datetime DEFAULT NULL, - `user_date_comment_last` datetime DEFAULT NULL, - `user_ip_register` varchar(20) NOT NULL, - `user_rating` float(9,3) NOT NULL DEFAULT '0.000', - `user_count_vote` int(11) unsigned NOT NULL DEFAULT '0', - `user_activate` tinyint(1) unsigned NOT NULL DEFAULT '0', - `user_activate_key` varchar(32) DEFAULT NULL, - `user_profile_name` varchar(50) DEFAULT NULL, - `user_profile_sex` enum('man','woman','other') NOT NULL DEFAULT 'other', - `user_profile_country` varchar(30) DEFAULT NULL, - `user_profile_region` varchar(30) DEFAULT NULL, - `user_profile_city` varchar(30) DEFAULT NULL, - `user_profile_birthday` datetime DEFAULT NULL, - `user_profile_about` text, - `user_profile_date` datetime DEFAULT NULL, - `user_profile_avatar` varchar(250) DEFAULT NULL, - `user_profile_foto` varchar(250) DEFAULT NULL, - `user_settings_notice_new_topic` tinyint(1) NOT NULL DEFAULT '1', - `user_settings_notice_new_comment` tinyint(1) NOT NULL DEFAULT '1', - `user_settings_notice_new_talk` tinyint(1) NOT NULL DEFAULT '1', - `user_settings_notice_reply_comment` tinyint(1) NOT NULL DEFAULT '1', - `user_settings_notice_new_friend` tinyint(1) NOT NULL DEFAULT '1', - `user_settings_timezone` varchar(6) DEFAULT NULL, - PRIMARY KEY (`user_id`), - UNIQUE KEY `user_login` (`user_login`), - UNIQUE KEY `user_mail` (`user_mail`), - KEY `user_activate_key` (`user_activate_key`), - KEY `user_activate` (`user_activate`), - KEY `user_rating` (`user_rating`), - KEY `user_profile_sex` (`user_profile_sex`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; - --- --- Дамп данных таблицы `prefix_user` --- - -INSERT INTO `prefix_user` (`user_id`, `user_login`, `user_password`, `user_mail`, `user_skill`, `user_date_register`, `user_date_activate`, `user_date_comment_last`, `user_ip_register`, `user_rating`, `user_count_vote`, `user_activate`, `user_activate_key`, `user_profile_name`, `user_profile_sex`, `user_profile_country`, `user_profile_region`, `user_profile_city`, `user_profile_birthday`, `user_profile_about`, `user_profile_date`, `user_profile_avatar`, `user_profile_foto`, `user_settings_notice_new_topic`, `user_settings_notice_new_comment`, `user_settings_notice_new_talk`, `user_settings_notice_reply_comment`, `user_settings_notice_new_friend`, `user_settings_timezone`) VALUES -(1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'admin@admin.adm', 0.000, '2012-04-10 00:00:00', NULL, NULL, '127.0.0.1', 0.000, 0, 1, NULL, NULL, 'other', NULL, NULL, NULL, NULL, NULL, NULL, '0', NULL, 1, 1, 1, 1, 1, NULL); - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_userfeed_subscribe` --- - -CREATE TABLE IF NOT EXISTS `prefix_userfeed_subscribe` ( - `user_id` int(11) unsigned NOT NULL, - `subscribe_type` tinyint(4) NOT NULL, - `target_id` int(11) NOT NULL, - KEY `user_id` (`user_id`,`subscribe_type`,`target_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_userfeed_subscribe` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_user_administrator` --- - -CREATE TABLE IF NOT EXISTS `prefix_user_administrator` ( - `user_id` int(11) unsigned NOT NULL, - UNIQUE KEY `user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_user_administrator` --- - -INSERT INTO `prefix_user_administrator` (`user_id`) VALUES -(1); - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_user_changemail` --- - -CREATE TABLE IF NOT EXISTS `prefix_user_changemail` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) unsigned NOT NULL, - `date_add` datetime NOT NULL, - `date_used` datetime DEFAULT NULL, - `date_expired` datetime NOT NULL, - `mail_from` varchar(50) NOT NULL, - `mail_to` varchar(50) NOT NULL, - `code_from` varchar(32) NOT NULL, - `code_to` varchar(32) NOT NULL, - `confirm_from` tinyint(1) NOT NULL DEFAULT '0', - `confirm_to` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - KEY `user_id` (`user_id`), - KEY `code_from` (`code_from`), - KEY `code_to` (`code_to`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- --- Дамп данных таблицы `prefix_user_changemail` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_user_field` --- - -CREATE TABLE IF NOT EXISTS `prefix_user_field` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `type` varchar(50) NOT NULL, - `name` varchar(255) NOT NULL, - `title` varchar(255) NOT NULL, - `pattern` varchar(255) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `name` (`name`), - KEY `type` (`type`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; - --- --- Дамп данных таблицы `prefix_user_field` --- - -INSERT INTO `prefix_user_field` (`id`, `type`, `name`, `title`, `pattern`) VALUES -(1, 'contact', 'phone', 'Телефон', ''), -(2, 'contact', 'mail', 'E-mail', '{*}'), -(3, 'contact', 'skype', 'Skype', '{*}'), -(4, 'contact', 'icq', 'ICQ', '{*}'), -(5, 'contact', 'www', 'Сайт', '{*}'), -(6, 'social', 'twitter', 'Twitter', '{*}'), -(7, 'social', 'facebook', 'Facebook', '{*}'), -(8, 'social', 'vkontakte', 'ВКонтакте', '{*}'), -(9, 'social', 'odnoklassniki', 'Одноклассники', '{*}'); - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_user_field_value` --- - -CREATE TABLE IF NOT EXISTS `prefix_user_field_value` ( - `user_id` int(11) unsigned NOT NULL, - `field_id` int(11) DEFAULT NULL, - `value` varchar(255) DEFAULT NULL, - KEY `user_id` (`user_id`,`field_id`), - KEY `field_id` (`field_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_user_field_value` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_user_note` --- - -CREATE TABLE IF NOT EXISTS `prefix_user_note` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `target_user_id` int(11) unsigned NOT NULL, - `user_id` int(11) unsigned NOT NULL, - `text` text NOT NULL, - `date_add` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `user_id` (`user_id`), - KEY `target_user_id` (`target_user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- --- Дамп данных таблицы `prefix_user_note` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_vote` --- - -CREATE TABLE IF NOT EXISTS `prefix_vote` ( - `target_id` int(11) unsigned NOT NULL DEFAULT '0', - `target_type` enum('topic','blog','user','comment') NOT NULL DEFAULT 'topic', - `user_voter_id` int(11) unsigned NOT NULL, - `vote_direction` tinyint(2) DEFAULT '0', - `vote_value` float(9,3) NOT NULL DEFAULT '0.000', - `vote_date` datetime NOT NULL, - `vote_ip` varchar(15) NOT NULL DEFAULT '', - PRIMARY KEY (`target_id`,`target_type`,`user_voter_id`), - KEY `user_voter_id` (`user_voter_id`), - KEY `vote_ip` (`vote_ip`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Дамп данных таблицы `prefix_vote` --- - - --- -------------------------------------------------------- - --- --- Структура таблицы `prefix_wall` --- - -CREATE TABLE IF NOT EXISTS `prefix_wall` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `pid` int(11) DEFAULT NULL, - `wall_user_id` int(11) unsigned NOT NULL, - `user_id` int(11) unsigned NOT NULL, - `count_reply` int(11) NOT NULL DEFAULT '0', - `last_reply` varchar(100) NOT NULL, - `date_add` datetime NOT NULL, - `ip` varchar(20) NOT NULL, - `text` text NOT NULL, - PRIMARY KEY (`id`), - KEY `pid` (`pid`), - KEY `wall_user_id` (`wall_user_id`), - KEY `ip` (`ip`), - KEY `user_id` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- --- Дамп данных таблицы `prefix_wall` --- - - --- --- Ограничения внешнего ключа сохраненных таблиц --- - --- --- Ограничения внешнего ключа таблицы `prefix_blog` --- -ALTER TABLE `prefix_blog` - ADD CONSTRAINT `prefix_blog_fk` FOREIGN KEY (`user_owner_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_blog_user` --- -ALTER TABLE `prefix_blog_user` - ADD CONSTRAINT `prefix_blog_user_fk` FOREIGN KEY (`blog_id`) REFERENCES `prefix_blog` (`blog_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_blog_user_fk1` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_comment` --- -ALTER TABLE `prefix_comment` - ADD CONSTRAINT `prefix_topic_comment_fk` FOREIGN KEY (`comment_pid`) REFERENCES `prefix_comment` (`comment_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `topic_comment_fk1` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_comment_online` --- -ALTER TABLE `prefix_comment_online` - ADD CONSTRAINT `prefix_topic_comment_online_fk1` FOREIGN KEY (`comment_id`) REFERENCES `prefix_comment` (`comment_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_favourite` --- -ALTER TABLE `prefix_favourite` - ADD CONSTRAINT `prefix_favourite_target_fk` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_favourite_tag` --- -ALTER TABLE `prefix_favourite_tag` - ADD CONSTRAINT `prefix_favourite_tag_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_friend` --- -ALTER TABLE `prefix_friend` - ADD CONSTRAINT `prefix_friend_from_fk` FOREIGN KEY (`user_from`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_friend_to_fk` FOREIGN KEY (`user_to`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_invite` --- -ALTER TABLE `prefix_invite` - ADD CONSTRAINT `prefix_invite_fk` FOREIGN KEY (`user_from_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_invite_fk1` FOREIGN KEY (`user_to_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_reminder` --- -ALTER TABLE `prefix_reminder` - ADD CONSTRAINT `prefix_reminder_fk` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_session` --- -ALTER TABLE `prefix_session` - ADD CONSTRAINT `prefix_session_fk` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_stream_event` --- -ALTER TABLE `prefix_stream_event` - ADD CONSTRAINT `prefix_stream_event_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_stream_subscribe` --- -ALTER TABLE `prefix_stream_subscribe` - ADD CONSTRAINT `prefix_stream_subscribe_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_stream_user_type` --- -ALTER TABLE `prefix_stream_user_type` - ADD CONSTRAINT `prefix_stream_user_type_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_talk` --- -ALTER TABLE `prefix_talk` - ADD CONSTRAINT `prefix_talk_fk` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_talk_blacklist` --- -ALTER TABLE `prefix_talk_blacklist` - ADD CONSTRAINT `prefix_talk_blacklist_fk_target` FOREIGN KEY (`user_target_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_talk_blacklist_fk_user` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_talk_user` --- -ALTER TABLE `prefix_talk_user` - ADD CONSTRAINT `prefix_talk_user_fk` FOREIGN KEY (`talk_id`) REFERENCES `prefix_talk` (`talk_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_talk_user_fk1` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_topic` --- -ALTER TABLE `prefix_topic` - ADD CONSTRAINT `prefix_topic_fk` FOREIGN KEY (`blog_id`) REFERENCES `prefix_blog` (`blog_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_topic_fk1` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_topic_content` --- -ALTER TABLE `prefix_topic_content` - ADD CONSTRAINT `prefix_topic_content_fk` FOREIGN KEY (`topic_id`) REFERENCES `prefix_topic` (`topic_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_topic_photo` --- -ALTER TABLE `prefix_topic_photo` - ADD CONSTRAINT `prefix_topic_photo_ibfk_1` FOREIGN KEY (`topic_id`) REFERENCES `prefix_topic` (`topic_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_topic_question_vote` --- -ALTER TABLE `prefix_topic_question_vote` - ADD CONSTRAINT `prefix_topic_question_vote_fk` FOREIGN KEY (`topic_id`) REFERENCES `prefix_topic` (`topic_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_topic_question_vote_fk1` FOREIGN KEY (`user_voter_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_topic_read` --- -ALTER TABLE `prefix_topic_read` - ADD CONSTRAINT `prefix_topic_read_fk` FOREIGN KEY (`topic_id`) REFERENCES `prefix_topic` (`topic_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_topic_read_fk1` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_topic_tag` --- -ALTER TABLE `prefix_topic_tag` - ADD CONSTRAINT `prefix_topic_tag_fk` FOREIGN KEY (`topic_id`) REFERENCES `prefix_topic` (`topic_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_topic_tag_fk1` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_topic_tag_fk2` FOREIGN KEY (`blog_id`) REFERENCES `prefix_blog` (`blog_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_userfeed_subscribe` --- -ALTER TABLE `prefix_userfeed_subscribe` - ADD CONSTRAINT `prefix_userfeed_subscribe_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_user_administrator` --- -ALTER TABLE `prefix_user_administrator` - ADD CONSTRAINT `user_administrator_fk` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_user_changemail` --- -ALTER TABLE `prefix_user_changemail` - ADD CONSTRAINT `prefix_user_changemail_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_user_field_value` --- -ALTER TABLE `prefix_user_field_value` - ADD CONSTRAINT `prefix_user_field_value_ibfk_2` FOREIGN KEY (`field_id`) REFERENCES `prefix_user_field` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_user_field_value_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_user_note` --- -ALTER TABLE `prefix_user_note` - ADD CONSTRAINT `prefix_user_note_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_user_note_ibfk_1` FOREIGN KEY (`target_user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_vote` --- -ALTER TABLE `prefix_vote` - ADD CONSTRAINT `prefix_topic_vote_fk1` FOREIGN KEY (`user_voter_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; - --- --- Ограничения внешнего ключа таблицы `prefix_wall` --- -ALTER TABLE `prefix_wall` - ADD CONSTRAINT `prefix_wall_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, - ADD CONSTRAINT `prefix_wall_ibfk_1` FOREIGN KEY (`wall_user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/install/templates/layout.tpl b/install/templates/layout.tpl deleted file mode 100644 index cffa16f8..00000000 --- a/install/templates/layout.tpl +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - ___LANG_INSTALL_TITLE___ - - - - - -
- - -
- - ___SYSTEM_MESSAGES___ - -
- ___CONTENT___ -
- - - -
-
-
- - - \ No newline at end of file diff --git a/install/templates/message.tpl b/install/templates/message.tpl deleted file mode 100644 index 74fbfbe8..00000000 --- a/install/templates/message.tpl +++ /dev/null @@ -1 +0,0 @@ -
\ No newline at end of file diff --git a/install/templates/steps/admin.tpl b/install/templates/steps/admin.tpl deleted file mode 100644 index a3a841ea..00000000 --- a/install/templates/steps/admin.tpl +++ /dev/null @@ -1,15 +0,0 @@ -

___LANG_ADMIN_PARAMS___

- - - -

-

- -

-

- -

-

- -

-

\ No newline at end of file diff --git a/install/templates/steps/db.tpl b/install/templates/steps/db.tpl deleted file mode 100644 index 33c13114..00000000 --- a/install/templates/steps/db.tpl +++ /dev/null @@ -1,41 +0,0 @@ -

___LANG_DB_PARAMS___

- - - -

- -

- -

- -___LANG_DB_PARAMS_PORT_NOTICE___

- -

- -

- -

- - - -

- -

- -

- -

- -

- -

- -___LANG_DB_PARAMS_PREFIX_NOTICE___

- - -

- -___LANG_DB_PARAMS_ENGINE_NOTICE___

\ No newline at end of file diff --git a/install/templates/steps/end.tpl b/install/templates/steps/end.tpl deleted file mode 100644 index 1aefe706..00000000 --- a/install/templates/steps/end.tpl +++ /dev/null @@ -1,5 +0,0 @@ -

- ___LANG_END_PARAGRAPH___ - - -

\ No newline at end of file diff --git a/install/templates/steps/extend.tpl b/install/templates/steps/extend.tpl deleted file mode 100644 index 041d538e..00000000 --- a/install/templates/steps/extend.tpl +++ /dev/null @@ -1,54 +0,0 @@ - - - -

___LANG_VIEW_PARAMS___

- -

-

- -

-

- -

-

- -

- -

-
- - -

___LANG_MAIL_PARAMS___

- -

-

- -

-

-
- - -

___LANG_GENERAL_PARAMS___

- - - - -
-
- - -

___LANG_LANGUAGE_PARAMS___

- -

- -

- -

- -

diff --git a/install/templates/steps/finish.tpl b/install/templates/steps/finish.tpl deleted file mode 100644 index 5004c837..00000000 --- a/install/templates/steps/finish.tpl +++ /dev/null @@ -1,3 +0,0 @@ -

- ___LANG_FINISH_PARAGRAPH___ -

\ No newline at end of file diff --git a/install/templates/steps/start.tpl b/install/templates/steps/start.tpl deleted file mode 100644 index f8bb0c59..00000000 --- a/install/templates/steps/start.tpl +++ /dev/null @@ -1,48 +0,0 @@ -___LANG_START_PARAGRAPH___ - - -

___LANG_PHP_PARAMS___

- - - - - - - - - - - - - - - - - -
___LANG_PHP_PARAMS_VERSION______VALIDATE_PHP_VERSION___
___LANG_PHP_PARAMS_SAFE_MODE______VALIDATE_SAFE_MODE___
___LANG_PHP_PARAMS_UTF8______VALIDATE_UTF8___
___LANG_PHP_PARAMS_MBSTRING______VALIDATE_MBSTRING___
___LANG_PHP_PARAMS_SIMPLEXML______VALIDATE_SIMPLEXML___
-
- -

___LANG_LOCAL_CONFIG___

- - - - - - - - - - - - - - - - - - - - - - -
___LANG_LOCAL_CONFIG_FILE______VALIDATE_LOCAL_CONFIG___
___LANG_LOCAL_TEMP_DIR______VALIDATE_LOCAL_TEMP___
___LANG_LOCAL_LOGS_DIR______VALIDATE_LOCAL_LOGS___
___LANG_LOCAL_UPLOADS_DIR______VALIDATE_LOCAL_UPLOADS___
___LANG_LOCAL_TEMPLATES_DIR______VALIDATE_LOCAL_TEMPLATES___
___LANG_LOCAL_TEMPLATES_CACHE_DIR______VALIDATE_LOCAL_TEMPLATES_CACHE___
___LANG_LOCAL_PLUGINS_DIR______VALIDATE_LOCAL_PLUGINS___
\ No newline at end of file diff --git a/install/templates/styles/style.css b/install/templates/styles/style.css deleted file mode 100644 index 313ed3ca..00000000 --- a/install/templates/styles/style.css +++ /dev/null @@ -1,185 +0,0 @@ -/* Reset --------------------------------------------------------------------*/ -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, font, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td { padding: 0; margin: 0; } -ul, ol { list-style: none; } -img { border: none; } - - - -/* Body --------------------------------------------------------------------*/ -body { font: 13px/18px Arial, Helvetica, sans-serif; color: #333; background: #FBFCFC; } - -h1, h2, h3, h4, h5, h6 { color: #333; } -h1 { font-size: 22px; line-height: 26px; margin-bottom: 0; } -h2 { font-size: 20px; line-height: 24px; margin-bottom: 10px; } -h3 { font-size: 18px; line-height: 22px; margin-bottom: 10px; } -h4 { font-size: 18px; line-height: 22px; margin-bottom: 5px; } -h5 { font-size: 18px; line-height: 22px; margin-bottom: 5px; } -h6 { font-size: 18px; line-height: 22px; margin-bottom: 5px; } - -a { color: #275EC2; } -a:hover { text-decoration: none; } - -.voting a { outline: none; } - -h1 span { color: #bbb; margin-left: 20px; } - - - -/* Grid --------------------------------------------------------------------*/ -#container { width: 700px; background: #fff; margin: 50px auto; box-shadow: 0 0 5px rgba(0,0,0,.1); border-radius: 10px; overflow: hidden; } -#header { - padding: 20px 30px; - background: rgb(255,255,255); - background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(250,250,250,1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(250,250,250,1))); - background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(250,250,250,1) 100%); - background: -o-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(250,250,250,1) 100%); - background: -ms-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(250,250,250,1) 100%); - background: linear-gradient(top, rgba(255,255,255,1) 0%,rgba(250,250,250,1) 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#fafafa',GradientType=0 ); - - border-bottom: 1px solid #eee; - border-radius: 10px 10px 0 0; - position: relative; -} -#header .lang { position: absolute; top: 23px; right: 30px; text-transform: lowercase; color: #ccc; } -#content { padding: 30px 30px; } - - - -/* Forms --------------------------------------------------------------------*/ -.input-text { - width: 150px; - padding: 5px; - border: 1px solid #c9c9c9; - box-shadow: 0 2px 4px rgba(0,0,0,.07) inset; - border-radius: 3px; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.input-text:focus { border-color: #4D90FE; box-shadow: 0 2px 4px rgba(0,0,0,.07) inset, 0 0 3px #4D90FE; outline: none; } -.input-checkbox { position: relative; top: 1px; margin: 0 2px 0 1px; } - -.input-width-full { width: 100%; } -.input-width-50 { width: 50px; } -.input-width-100 { width: 100px; } -.input-width-150 { width: 150px; } -.input-width-200 { width: 200px; } -.input-width-250 { width: 250px; } -.input-width-300 { width: 300px; } -.input-width-400 { width: 400px; } -.input-width-500 { width: 500px; } - -textarea { -moz-box-sizing: border-box; box-sizing: border-box; } - -select { padding: 4px; border: 1px solid #ddd; border-radius: 3px; } - -fieldset { margin-bottom: 30px; padding-top: 20px; border-top: 1px solid #eaeaea; } -fieldset legend { color: #000; font-size: 18px; padding-right: 10px; } - -form p { margin-bottom: 20px; } -form label { display: block; margin-bottom: 3px; } -form .icon-question-sign { cursor: help; } - -.note { display: block; margin-top: 3px; font-size: 12px; line-height: 16px; color: #aaa; } - - - -/* Notifications --------------------------------------------------------------------*/ -.system-messages-error { background: #f0c8c8; color: #b22626; padding: 10px 15px; margin-bottom: 15px; border-radius: 5px; } -.system-messages-notice { background: #dafad8; color: #4bb23b; padding: 10px 15px; margin-bottom: 15px; border-radius: 5px; } - - - -/* Tables --------------------------------------------------------------------*/ -.table { width: 100%; margin-bottom: 15px; border-collapse: collapse; } -.table td { padding: 10px 10px; background: #fafafa; border-bottom: 2px solid #fff; } -.table tr:hover td { background: #bbffe1; } -.table td.result { width: 50px; text-align: center; } - - - -/* Button --------------------------------------------------------------------*/ - - -.button { - display: inline-block; - - padding: 3px 10px 6px; - *padding: 3px 10px 4px; - text-align: center; - - border: 1px solid #dfe3e8; - border-radius: 5px; - - font-size: 13px; - line-height: 16px; - - color: #434343; - - background: #fbfcfc; - background: -moz-linear-gradient(top, #fbfcfc 0%, #f0f2f5 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fbfcfc), color-stop(100%,#f0f2f5)); - background: -webkit-linear-gradient(top, #fbfcfc 0%,#f0f2f5 100%); - background: -o-linear-gradient(top, #fbfcfc 0%,#f0f2f5 100%); - background: -ms-linear-gradient(top, #fbfcfc 0%,#f0f2f5 100%); - background: linear-gradient(top, #fbfcfc 0%,#f0f2f5 100%); - - font-family: Verdana, sans-serif; - cursor: pointer; - text-decoration: none; - - *margin-right: 5px; -} -.button:hover { text-decoration: none; background: #f0f2f5; } -.button:active { - -moz-box-shadow: 0 0 3px rgba(0, 0, 0, .3) inset; - -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, .3) inset; - box-shadow: 0 0 3px rgba(0, 0, 0, .3) inset; -} -.button.fl-r { *margin-right: 0; } - - -/* Button Primary */ -.button.button-primary { - background: #66cfff; - background: -moz-linear-gradient(top, #66cfff 0%, #2abcfe 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#66cfff), color-stop(100%,#2abcfe)); - background: -webkit-linear-gradient(top, #66cfff 0%,#2abcfe 100%); - background: -o-linear-gradient(top, #66cfff 0%,#2abcfe 100%); - background: -ms-linear-gradient(top, #66cfff 0%,#2abcfe 100%); - background: linear-gradient(top, #66cfff 0%,#2abcfe 100%); - - border: 1px solid #27ace8; - - color: #fff; -} -.button.button-primary:hover { background: #2abcfe; } - - - - - - - - - - - - - diff --git a/plugins/page/templates/skin/default/actions/ActionPage/page.tpl b/plugins/page/templates/skin/default/actions/ActionPage/page.tpl index ca3f3b90..9689ca41 100644 --- a/plugins/page/templates/skin/default/actions/ActionPage/page.tpl +++ b/plugins/page/templates/skin/default/actions/ActionPage/page.tpl @@ -1,6 +1,229 @@ {assign var="noSidebar" value=true} {include file='header.tpl'} + + + + + +Popover + +
+
+
+ + + + +Top tooltip + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+
+ + + + + +
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Hic magnam error eligendi odio nemo itaque ea vero adipisci fugit exercitationem totam quasi asperiores dolores harum saepe laudantium provident. Voluptates tenetur.
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eaque iste vel sit necessitatibus voluptatum cumque quos ipsam ab eligendi blanditiis accusamus nostrum consectetur magnam harum provident dolorem minima iure ex.
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Pariatur esse odit sequi dolorum ab perspiciatis sint eveniet tenetur praesentium cumque deserunt quidem ipsa perferendis reprehenderit corporis vero explicabo ratione suscipit!
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Maxime quam magnam quaerat molestiae provident error blanditiis sequi recusandae nisi adipisci. Voluptatibus optio assumenda in quaerat ab eaque placeat nesciunt animi.
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni similique dolores ab exercitationem sint tempora eius magnam est dignissimos cumque ad id excepturi voluptatibus esse molestiae ut sit voluptates quod!
+
Iure quibusdam eum eveniet autem veritatis aliquid neque repellat labore obcaecati modi facilis eaque in officia magni officiis tempora itaque eos natus quod quidem quam dolorum nobis distinctio possimus quo.
+
Error iure ut nihil voluptate perspiciatis ipsam ex officia quis eveniet reprehenderit hic quod voluptas? Iusto dolore ad fugit ullam quos quis iure vitae quas vero nam repudiandae modi eaque.
+
Sed eos dolorem dolore pariatur perspiciatis atque aspernatur autem cumque perferendis quae ab quisquam quasi hic magnam animi tenetur incidunt impedit nesciunt consequuntur sequi minima ad rerum aperiam dolores veritatis.
+
+ +
+
+ + + + + + + +
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Hic magnam error eligendi odio nemo itaque ea vero adipisci fugit exercitationem totam quasi asperiores dolores harum saepe laudantium provident. Voluptates tenetur.
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eaque iste vel sit necessitatibus voluptatum cumque quos ipsam ab eligendi blanditiis accusamus nostrum consectetur magnam harum provident dolorem minima iure ex.
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Pariatur esse odit sequi dolorum ab perspiciatis sint eveniet tenetur praesentium cumque deserunt quidem ipsa perferendis reprehenderit corporis vero explicabo ratione suscipit!
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Maxime quam magnam quaerat molestiae provident error blanditiis sequi recusandae nisi adipisci. Voluptatibus optio assumenda in quaerat ab eaque placeat nesciunt animi.
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni similique dolores ab exercitationem sint tempora eius magnam est dignissimos cumque ad id excepturi voluptatibus esse molestiae ut sit voluptates quod!
+
Iure quibusdam eum eveniet autem veritatis aliquid neque repellat labore obcaecati modi facilis eaque in officia magni officiis tempora itaque eos natus quod quidem quam dolorum nobis distinctio possimus quo.
+
Error iure ut nihil voluptate perspiciatis ipsam ex officia quis eveniet reprehenderit hic quod voluptas? Iusto dolore ad fugit ullam quos quis iure vitae quas vero nam repudiandae modi eaque.
+
Sed eos dolorem dolore pariatur perspiciatis atque aspernatur autem cumque perferendis quae ab quisquam quasi hic magnam animi tenetur incidunt impedit nesciunt consequuntur sequi minima ad rerum aperiam dolores veritatis.
+
+ +
+
+ + +
{if $oConfig->GetValue('view.tinymce')} diff --git a/templates/framework/css/buttons.css b/templates/framework/css/buttons.css index 1e707e67..7e976a7d 100644 --- a/templates/framework/css/buttons.css +++ b/templates/framework/css/buttons.css @@ -6,6 +6,7 @@ display: inline-block; padding: 4px 12px; + padding: 5px 12px; margin: 0; text-align: center; @@ -14,31 +15,19 @@ font-size: 14px; line-height: 20px; - text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); - - border: 1px solid #ddd; - border-radius: 4px; + border: none; color: #333; background: #fafafa; - background: -moz-linear-gradient(top, #fff 0%, #e6e6e6 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fff), color-stop(100%,#e6e6e6)); - background: -webkit-linear-gradient(top, #fff 0%,#e6e6e6 100%); - background: -o-linear-gradient(top, #fff 0%,#e6e6e6 100%); - background: -ms-linear-gradient(top, #fff 0%,#e6e6e6 100%); - background: linear-gradient(top, #fff 0%,#e6e6e6 100%); - - -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); + background: #eee; cursor: pointer; *margin-right: 5px; *border: 0; } -.button:hover { text-decoration: none; background: #eee; } +.button:hover { text-decoration: none; background: #ddd; } .button:active, .button.active { background: #eaeaea; @@ -53,16 +42,8 @@ /* Button Primary */ .button.button-primary { color: #fff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); background: #006DCC; - background: -moz-linear-gradient(top, #0088cc 0%, #0044cc 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#0088cc), color-stop(100%,#0044cc)); - background: -webkit-linear-gradient(top, #0088cc 0%,#0044cc 100%); - background: -o-linear-gradient(top, #0088cc 0%,#0044cc 100%); - background: -ms-linear-gradient(top, #0088cc 0%,#0044cc 100%); - background: linear-gradient(top, #0088cc 0%,#0044cc 100%); } .button.button-primary:hover { background: #0044cc; } .button.button-primary.active { background: #006DCC; } \ No newline at end of file diff --git a/templates/framework/css/dropdowns.css b/templates/framework/css/dropdowns.css index a932f6f0..299813cf 100644 --- a/templates/framework/css/dropdowns.css +++ b/templates/framework/css/dropdowns.css @@ -12,9 +12,9 @@ *display: inline; *zoom: 1; /* IE7 */ background: #2891d3; color: #fff; - border-radius: 2px; padding: 5px 12px; margin-bottom: 10px; + min-height: 18px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; @@ -54,11 +54,53 @@ padding: 5px 0; background-color: #fff; border: 1px solid #ccc; - border-radius: 6px; box-shadow: 0 5px 10px rgba(0,0,0,.2); } -.dropdown-menu li > a { display: block; padding: 5px 12px; white-space: nowrap; } +.dropdown-menu > li { overflow: hidden; } +.dropdown-menu > li > a { display: block; padding: 5px 12px; white-space: nowrap; } .dropdown-menu > li.active > a { background: #c8ecff; color: #48a4d5; } .dropdown-menu > li > a:hover { background: #0088cc; color: #fff; } -.dropdown-menu > li.divider { height: 0; border-top: 1px solid #e1e1e1; margin: 5px 0; } \ No newline at end of file +.dropdown-menu > li.divider { height: 0; border-top: 1px solid #e1e1e1; margin: 5px 0; } + + +/* Arrow */ +/* +.dropdown-menu:after, +.dropdown-menu:before { + content: ''; + position: absolute; + top: auto; + right: auto; + bottom: auto; + left: auto; + width: 0; + height: 0; + border: 6px solid transparent; +} +.dropdown-menu:after { border-width: 7px; z-index: -1; } + +.dropdown-menu.alignx-left.aligny-top:before { left: 10px; bottom: -12px; border-top-color: #fff; } +.dropdown-menu.alignx-left.aligny-center:before { right: -12px; top: 50%; margin-top: -6px; border-left-color: #fff; } +.dropdown-menu.alignx-left.aligny-bottom:before { left: 10px; top: -12px; border-bottom-color: #fff; } + +.dropdown-menu.alignx-center.aligny-top:before { left: 50%; bottom: -12px; margin-left: -6px; border-top-color: #fff; } +.dropdown-menu.alignx-center.aligny-center:before { display: none; } +.dropdown-menu.alignx-center.aligny-bottom:before { left: 50%; top: -12px; margin-left: -6px; border-bottom-color: #fff; } + +.dropdown-menu.alignx-right.aligny-top:before { right: 10px; bottom: -12px; border-top-color: #fff; } +.dropdown-menu.alignx-right.aligny-center:before { left: -12px; top: 50%; margin-top: -6px; border-right-color: #fff; } +.dropdown-menu.alignx-right.aligny-bottom:before { right: 10px; top: -12px; border-bottom-color: #fff; } + +.dropdown-menu.alignx-left.aligny-top:after { left: 9px; bottom: -14px; border-top-color: #bbb; } +.dropdown-menu.alignx-left.aligny-center:after { right: -14px; top: 50%; margin-top: -7px; border-left-color: #bbb; } +.dropdown-menu.alignx-left.aligny-bottom:after { left: 9px; top: -14px; border-bottom-color: #bbb; } + +.dropdown-menu.alignx-center.aligny-top:after { left: 50%; bottom: -14px; margin-left: -7px; border-top-color: #bbb; } +.dropdown-menu.alignx-center.aligny-center:after { display: none; } +.dropdown-menu.alignx-center.aligny-bottom:after { left: 50%; top: -14px; margin-left: -7px; border-bottom-color: #bbb; } + +.dropdown-menu.alignx-right.aligny-top:after { right: 9px; bottom: -14px; border-top-color: #bbb; } +.dropdown-menu.alignx-right.aligny-center:after { left: -14px; top: 50%; margin-top: -7px; border-right-color: #bbb; } +.dropdown-menu.alignx-right.aligny-bottom:after { right: 9px; top: -14px; border-bottom-color: #bbb; } +*/ \ No newline at end of file diff --git a/templates/framework/css/forms.css b/templates/framework/css/forms.css index 0479bd6b..b435be1a 100644 --- a/templates/framework/css/forms.css +++ b/templates/framework/css/forms.css @@ -9,7 +9,6 @@ input[type="text"], .input-text { padding: 5px; border: 1px solid #ddd; - border-radius: 3px; -webkit-box-shadow: 0 2px 4px rgba(0,0,0,.07) inset; box-shadow: 0 2px 4px rgba(0,0,0,.07) inset; -webkit-box-sizing: border-box; diff --git a/templates/framework/css/helpers.css b/templates/framework/css/helpers.css index d963a9e5..0af14bd6 100644 --- a/templates/framework/css/helpers.css +++ b/templates/framework/css/helpers.css @@ -74,4 +74,15 @@ /* Links */ .link-dashed { text-decoration: none; border-bottom: 1px dashed; } -.link-dotted { text-decoration: none; border-bottom: 1px dotted; } \ No newline at end of file +.link-dotted { text-decoration: none; border-bottom: 1px dotted; } + + +/* Loader */ +/* TODO: Change gif */ +.loading { + width: 100px; + height: 100px; + background-image: url(../images/modal-loader.gif) ; + background-position: 50% 50%; + background-repeat: no-repeat; +} \ No newline at end of file diff --git a/templates/framework/css/modals.css b/templates/framework/css/modals.css index e3eedf23..8df246aa 100644 --- a/templates/framework/css/modals.css +++ b/templates/framework/css/modals.css @@ -11,12 +11,12 @@ color: #333; border: 1px solid #666; background-color: #fff; - border-radius: 5px; -webkit-box-shadow: 0 0 15px rgba(0,0,0,.5); -moz-box-shadow: 0 0 15px rgba(0,0,0,.5); box-shadow: 0 0 15px rgba(0,0,0,.5); overflow: hidden; - z-index: 9999; + z-index: 1000; + position: relative; } @@ -58,6 +58,22 @@ .modal .modal-content { padding: 20px; } +/* Lock */ +.modal .modal-lock { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: #000; + opacity: .2; + filter: alpha(opacity=20); + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + + /* Footer */ .modal .modal-footer { background: #fafafa; border-top: 1px solid #f7f7f7; padding: 15px 20px; } @@ -70,7 +86,20 @@ position: fixed; top: 50%; left: 50%; border-radius: 5px; - background: rgba(0,0,0,.8) url(../img/modal-loader.gif) 50% 50% no-repeat; + background-color: #000; + background: rgba(0,0,0,.8) url(../images/modal-loader.gif) 50% 50% no-repeat; + z-index: 1001; +} +.modal-loader.modal-loader-text { + background-image: none; + color: #eee; + text-align: center; + font-size: 13px; + line-height: 1.2em; + padding: 15px; + width: 300px; + margin-left: -150px; + height: auto; } @@ -82,6 +111,6 @@ width: 100%; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA9JREFUeNpiYmBgaAAIMAAAjwCD5Hc2/AAAAABJRU5ErkJggg==);; background: rgba(0,0,0,.5); - z-index: 9998; + z-index: 999; overflow: auto; } \ No newline at end of file diff --git a/templates/framework/css/navs.css b/templates/framework/css/navs.css index 97ef694f..57357650 100644 --- a/templates/framework/css/navs.css +++ b/templates/framework/css/navs.css @@ -80,45 +80,10 @@ .tab-pane { display: none; } -/* Userbar - * TODO: Fix --------------------------------------------------- */ -#userbar { - border: 1px solid #ddd; - border-top: none; - border-radius: 0 0 4px 4px; - -webkit-box-shadow: 0 0 5px #ddd; box-shadow: 0 0 5px #ddd; - - background: #ffffff; - background: -moz-linear-gradient(top, #ffffff 0%, #f3f3f3 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#f3f3f3)); - background: -webkit-linear-gradient(top, #ffffff 0%,#f3f3f3 100%); - background: -o-linear-gradient(top, #ffffff 0%,#f3f3f3 100%); - background: -ms-linear-gradient(top, #ffffff 0%,#f3f3f3 100%); - background: linear-gradient(top, #ffffff 0%,#f3f3f3 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f3f3f3',GradientType=0 ); -} -#userbar .search { float: left; margin: 5px 0 0 6px; *margin: 4px 0 0 4px; } - -.nav.nav-userbar { float: right; } -.nav.nav-userbar li { border-radius: 0 0 0 4px; border-left: 1px solid #eaeaea; } -.nav.nav-userbar li a { color: #555; } -.nav.nav-userbar li:first-child a { border-radius: 0 0 0 4px; } -.nav.nav-userbar li:last-child a { border-radius: 0 0 4px 0; } -.nav.nav-userbar li.nav-userbar-username a { position: relative; padding-left: 47px; font-weight: bold; color: #333; } -.nav.nav-userbar li.nav-userbar-username .avatar { position: absolute; top: 7px; left: 15px; } -.nav.nav-userbar li .new-messages { color: #4AA731; font-weight: bold; } - -/* Dropdown support */ -.nav.nav-userbar .dropdown-toggle:after { border-top-color: #000; } -.nav.nav-userbar .dropdown-toggle.open { background: #08c; color: #fff; } -.nav.nav-userbar .dropdown-toggle.open:after { border-top-color: #fff; } - - /* Main * TODO: Fix -------------------------------------------------- */ -.nav.nav-main { border-radius: 4px; background: #222; background: -moz-linear-gradient(top, #333 0%, #222 100%); } +.nav.nav-main { background: #222; background: -moz-linear-gradient(top, #333 0%, #222 100%); } .nav.nav-main li a { color: #ddd; } .nav.nav-main li a:hover { background: #333; } .nav.nav-main li:first-child a { border-radius: 4px 0 0 4px; } diff --git a/templates/framework/css/popover.css b/templates/framework/css/popover.css new file mode 100644 index 00000000..8ad19cef --- /dev/null +++ b/templates/framework/css/popover.css @@ -0,0 +1,34 @@ +/** + * Popover + */ + +.popover { + position: absolute; + z-index: 9999; + min-width: 100px; + max-width: 300px; + background-color: #fafafa; + color: #000; + border: 1px solid #ccc; + -webkit-box-shadow: 0 0 5px rgba(0,0,0,.1); + box-shadow: 0 0 5px rgba(0,0,0,.1); +} +.popover .popover-title { background: #eee; padding: 10px 15px; font-weight: bold; } +.popover .popover-content { padding: 10px 15px; } + + +.popover .tip-arrow { + content: ''; + position: absolute; + top: auto; + right: auto; + bottom: auto; + left: auto; + width: 0; + height: 0; + border: 7px solid transparent; +} +.popover.alignx-center.aligny-top .tip-arrow { left: 50%; bottom: -14px; margin-left: -7px; border-top-color: #ccc; } +.popover.alignx-center.aligny-bottom .tip-arrow { left: 50%; top: -14px; margin-left: -7px; border-bottom-color: #ccc; } +.popover.alignx-left.aligny-center .tip-arrow { right: -14px; top: 50%; margin-top: -7px; border-left-color: #ccc; } +.popover.alignx-right.aligny-center .tip-arrow { left: -14px; top: 50%; margin-top: -7px; border-right-color: #ccc; } \ No newline at end of file diff --git a/templates/framework/css/tooltip.css b/templates/framework/css/tooltip.css new file mode 100644 index 00000000..ead6ba94 --- /dev/null +++ b/templates/framework/css/tooltip.css @@ -0,0 +1,33 @@ +/** + * Tooltip + */ + +.tooltip { + display: none; + padding: 12px 15px; + position: absolute; + z-index: 9999; + min-width: 50px; + max-width: 300px; + background: #222; + color: #fff; + -webkit-box-shadow: 0 0 5px rgba(0,0,0,.2); + box-shadow: 0 0 5px rgba(0,0,0,.2); +} +.tooltip .tip-arrow { + content: ''; + position: absolute; + top: auto; + right: auto; + bottom: auto; + left: auto; + width: 0; + height: 0; + border: 6px solid transparent; +} + +/* Arrow */ +.tooltip.alignx-center.aligny-top .tip-arrow { left: 50%; bottom: -12px; margin-left: -6px; border-top-color: #222; } +.tooltip.alignx-center.aligny-bottom .tip-arrow { left: 50%; top: -12px; margin-left: -6px; border-bottom-color: #222; } +.tooltip.alignx-left.aligny-center .tip-arrow { right: -12px; top: 50%; margin-top: -6px; border-left-color: #222; } +.tooltip.alignx-right.aligny-center .tip-arrow { left: -12px; top: 50%; margin-top: -6px; border-right-color: #222; } \ No newline at end of file diff --git a/templates/framework/img/modal-loader.gif b/templates/framework/images/modal-loader.gif similarity index 100% rename from templates/framework/img/modal-loader.gif rename to templates/framework/images/modal-loader.gif diff --git a/templates/framework/js/hook.js b/templates/framework/js/core/hook.js similarity index 100% rename from templates/framework/js/hook.js rename to templates/framework/js/core/hook.js diff --git a/templates/framework/js/main.js b/templates/framework/js/core/main.js similarity index 96% rename from templates/framework/js/main.js rename to templates/framework/js/core/main.js index 2a59c45a..9658f9b1 100644 --- a/templates/framework/js/main.js +++ b/templates/framework/js/core/main.js @@ -382,6 +382,21 @@ ls.tools = (function ($) { } }; + this.getDataOptions = function (element, prefix) { + var prefix = prefix || 'option', + resultOptions = {}, + dataOptions = typeof element === 'string' ? $(element).data() : element.data(); + + for (option in dataOptions) { + // Remove 'option' prefix + if (option.substring(0, prefix.length) == prefix) { + var str = option.substring(prefix.length); + resultOptions[str[0].toLowerCase() + str.substring(1)] = dataOptions[option]; + } + } + + return resultOptions; + }; return this; }).call(ls.tools || {},jQuery); @@ -574,11 +589,9 @@ ls.autocomplete = (function ($) { return this; }).call(ls.autocomplete || {},jQuery); - - /** -* Костыли для ИЕ -*/ + * Костыли для ИЕ + */ ls.ie = (function ($) { // эмуляция border-sizing в IE diff --git a/templates/framework/js/dropdown.js b/templates/framework/js/dropdown.js deleted file mode 100644 index 5dca81d2..00000000 --- a/templates/framework/js/dropdown.js +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Dropdowns - * - * Author: Denis Shakhov - * Version: 1.0 - * - * TODO: Add fixed menu option - */ - -(function($) { - /** - * Constructs dropdown objects - * @constructor - * @class Dropdown - * @param {Object} options Options - */ - var Dropdown = function (element) { - var self = this; - - this.$element = $(element); - this.options = { - menuId : ls.tools.getOption(this.$element,'dropdown-menu'), - align : ls.tools.getOption(this.$element,'dropdown-align', 'left'), - isAjax : ls.tools.getOption(this.$element,'dropdown-ajax', false), - isAppendToBody : ls.tools.getOption(this.$element,'dropdown-append-to-body', true), - isChangeText : ls.tools.getOption(this.$element,'dropdown-change-text', true), - defaultText : this.$element.text() - }; - this.menu = $('#' + this.options.menuId); - - if (this.options.isAppendToBody) this.menu.appendTo('body'); - - this.options.defaultText = this.options.defaultText || Dropdown.settings.defaultActiveText; - - if (this.options.isChangeText) { - var activeText = this.menu.find('li.active').text(); - this.$element.text(this.menu.find('li.active').text() || this.options.defaultText); - } - - // Resize - $(window).resize(function () { - self.position(); - }); - - if (this.options.isAjax) { - this.menu.find('li > a').on('click', function () { - $this = $(this); - if (self.options.isChangeText) self.$element.text($this.text()); - self.menu.find('li').removeClass('active'); - $this.parent('li').addClass('active'); - self.toggle(); - }); - } - }; - - // Common settings - Dropdown.settings = { - dropdownSelector: '[data-toggle=dropdown]', - menuSelector: '.dropdown-menu', - menuTopOffset: 2, - defaultActiveText: '...' - }; - - // Static methods - Dropdown.methods = { - hideAll: function (currentDropdown) { - $(Dropdown.settings.dropdownSelector).removeClass('open'); - $(Dropdown.settings.menuSelector).hide(); - } - }; - - Dropdown.prototype = { - /** - * Toggle dropdown - */ - toggle: function () { - if (!this.menu.is(':visible')) { - Dropdown.methods.hideAll(); - this.position(); - } - this.$element.toggleClass('open'); - this.menu.toggle(); - }, - - /** - * Position menu - */ - position: function () { - var - pos = this.$element.offset(), - height = this.$element.outerHeight(), - width = this.$element.outerWidth(); - - this.menu.css({ - 'top': this.options.isAppendToBody ? pos.top + height + Dropdown.settings.menuTopOffset : height + Dropdown.settings.menuTopOffset, - 'left': this.options.isAppendToBody ? ( this.options.align == 'right' ? 'auto' : pos.left ) : ( this.options.align == 'right' ? 'auto' : 0 ), - 'right': this.options.isAppendToBody ? ( this.options.align == 'right' ? $(window).width() - pos.left - width : 'auto' ) : ( this.options.align == 'right' ? 0 : 'auto' ) - }); - } - }; - - // Init - $(document).ready(function($) { - $('body').on('click', function (e) { - var $target = $(e.target); - // TODO: Fix hide function - if ($target.data('toggle') != 'dropdown' && !$target.hasClass('dropdown-menu')) Dropdown.methods.hideAll(); - }); - }); - - $(document).on('click', Dropdown.settings.dropdownSelector, function () { - var - dropdown = $(this), - object = dropdown.data('object'); - - if (!object) dropdown.data('object', (object = new Dropdown(this))); - - object.toggle(); - return false; - }); -})(jQuery); \ No newline at end of file diff --git a/templates/framework/js/infobox.js b/templates/framework/js/infobox.js deleted file mode 100644 index dfe73922..00000000 --- a/templates/framework/js/infobox.js +++ /dev/null @@ -1,139 +0,0 @@ -var ls = ls || {}; - -/** - * Всплывающие поп-апы - */ -ls.infobox = (function ($) { - - /** - * Шаблон процесс-бара - */ - this.sTemplateProcess=['
process..', - '
'].join(''); - this.aLinks=[]; - this.aOptDef={ - hideOther: true, - className: 'infobox-standart', - showOn: 'none', - alignTo: 'target', - alignX: 'inner-left', - alignY: 'bottom', - offsetX: -14, - offsetY: 5, - fade: false, - slide: false, - bgImageFrameSize: 10, - showTimeout: 500, - hideTimeout: 100, - timeOnScreen: 0, - liveEvents: false, - allowTipHover: true, - followCursor: false, - slideOffset: 8, - showAniDuration: 300, - hideAniDuration: 300, - refreshAniDuration: 200 - }; - - this.show = function(oLink,sContent,aOpt) { - aOpt=$.extend(true,{},this.aOptDef,aOpt || {}); - - if (aOpt.hideOther) { - this.hideAll(); - } - - $oLink=$(oLink); - if ($oLink.data('isPoshytip')) { - $oLink.poshytip('update', sContent); - } else { - $oLink.on('click',function(e){ - e.stopPropagation(); - }); - $oLink.poshytip({ - className: 'js-infobox '+aOpt.className, - content: sContent, - showOn: aOpt.showOn, - alignTo: aOpt.alignTo, - alignX: aOpt.alignX, - fade: aOpt.fade, - slide: aOpt.slide, - alignY: aOpt.alignY, - offsetX: aOpt.offsetX, - offsetY: aOpt.offsetY, - bgImageFrameSize: aOpt.bgImageFrameSize, - showTimeout: aOpt.showTimeout, - hideTimeout: aOpt.hideTimeout, - timeOnScreen: aOpt.timeOnScreen, - liveEvents: aOpt.liveEvents, - allowTipHover: aOpt.allowTipHover, - followCursor: aOpt.followCursor, - slideOffset: aOpt.slideOffset, - showAniDuration: aOpt.showAniDuration, - hideAniDuration: aOpt.hideAniDuration, - refreshAniDuration: aOpt.refreshAniDuration - }); - $oLink.data('isPoshytip',1); - this.aLinks.push($oLink); - } - - $oLink.poshytip('show'); - }; - - this.hideAll = function() { - $.each(this.aLinks,function(k,oLink){ - this.hide(oLink); - }.bind(this)); - }; - - this.hide = function(oLink) { - $(oLink).poshytip('hide'); - return false; - }; - - this.hideIfShow = function(oLink) { - if ($(oLink).data('poshytip') && $(oLink).data('poshytip').$tip.data('active')) { - this.hide(oLink); - return true; - } - return false; - }; - - this.showProcess = function(oLink,aOpt) { - this.show(oLink,this.sTemplateProcess,aOpt); - }; - - - this.showInfoBlog = function(oLink,iBlogId) { - if (this.hideIfShow(oLink)) { - return false; - } - - this.showProcess(oLink); - var url = aRouter['ajax']+'infobox/info/blog/'; - var params = {iBlogId: iBlogId}; - '*showInfoBlogBefore*'; '*/showInfoBlogBefore*'; - ls.ajax(url, params, function(result) { - if (result.bStateError) { - ls.msg.error(null, result.sMsg); - this.hide(oLink); - } else { - this.show(oLink,result.sText); - ls.hook.run('ls_infobox_show_info_blog_after',[oLink, iBlogId, result]); - } - }.bind(this)); - return false; - }; - - jQuery(function($){ - $(document).click(function(e) { - if (e.which==1 && !$(e.target).data('isPoshytip')) { - this.hideAll(); - } - }.bind(this)); - $('body').on("click", ".js-infobox", function(e) { - e.stopPropagation(); - }); - }.bind(this)); - - return this; -}).call(ls.infobox || {},jQuery); \ No newline at end of file diff --git a/templates/framework/js/blocks.js b/templates/framework/js/livestreet/blocks.js similarity index 100% rename from templates/framework/js/blocks.js rename to templates/framework/js/livestreet/blocks.js diff --git a/templates/framework/js/blog.js b/templates/framework/js/livestreet/blog.js similarity index 100% rename from templates/framework/js/blog.js rename to templates/framework/js/livestreet/blog.js diff --git a/templates/framework/js/comments.js b/templates/framework/js/livestreet/comments.js similarity index 100% rename from templates/framework/js/comments.js rename to templates/framework/js/livestreet/comments.js diff --git a/templates/framework/js/favourite.js b/templates/framework/js/livestreet/favourite.js similarity index 100% rename from templates/framework/js/favourite.js rename to templates/framework/js/livestreet/favourite.js diff --git a/templates/framework/js/geo.js b/templates/framework/js/livestreet/geo.js similarity index 100% rename from templates/framework/js/geo.js rename to templates/framework/js/livestreet/geo.js diff --git a/templates/framework/js/photoset.js b/templates/framework/js/livestreet/photoset.js similarity index 100% rename from templates/framework/js/photoset.js rename to templates/framework/js/livestreet/photoset.js diff --git a/templates/framework/js/poll.js b/templates/framework/js/livestreet/poll.js similarity index 100% rename from templates/framework/js/poll.js rename to templates/framework/js/livestreet/poll.js diff --git a/templates/framework/js/settings.js b/templates/framework/js/livestreet/settings.js similarity index 100% rename from templates/framework/js/settings.js rename to templates/framework/js/livestreet/settings.js diff --git a/templates/framework/js/stream.js b/templates/framework/js/livestreet/stream.js similarity index 100% rename from templates/framework/js/stream.js rename to templates/framework/js/livestreet/stream.js diff --git a/templates/framework/js/subscribe.js b/templates/framework/js/livestreet/subscribe.js similarity index 100% rename from templates/framework/js/subscribe.js rename to templates/framework/js/livestreet/subscribe.js diff --git a/templates/framework/js/talk.js b/templates/framework/js/livestreet/talk.js similarity index 100% rename from templates/framework/js/talk.js rename to templates/framework/js/livestreet/talk.js diff --git a/templates/framework/js/toolbar.js b/templates/framework/js/livestreet/toolbar.js similarity index 100% rename from templates/framework/js/toolbar.js rename to templates/framework/js/livestreet/toolbar.js diff --git a/templates/framework/js/topic.js b/templates/framework/js/livestreet/topic.js similarity index 100% rename from templates/framework/js/topic.js rename to templates/framework/js/livestreet/topic.js diff --git a/templates/framework/js/user.js b/templates/framework/js/livestreet/user.js similarity index 100% rename from templates/framework/js/user.js rename to templates/framework/js/livestreet/user.js diff --git a/templates/framework/js/userfeed.js b/templates/framework/js/livestreet/userfeed.js similarity index 100% rename from templates/framework/js/userfeed.js rename to templates/framework/js/livestreet/userfeed.js diff --git a/templates/framework/js/userfield.js b/templates/framework/js/livestreet/userfield.js similarity index 100% rename from templates/framework/js/userfield.js rename to templates/framework/js/livestreet/userfield.js diff --git a/templates/framework/js/usernote.js b/templates/framework/js/livestreet/usernote.js similarity index 100% rename from templates/framework/js/usernote.js rename to templates/framework/js/livestreet/usernote.js diff --git a/templates/framework/js/vote.js b/templates/framework/js/livestreet/vote.js similarity index 100% rename from templates/framework/js/vote.js rename to templates/framework/js/livestreet/vote.js diff --git a/templates/framework/js/wall.js b/templates/framework/js/livestreet/wall.js similarity index 100% rename from templates/framework/js/wall.js rename to templates/framework/js/livestreet/wall.js diff --git a/templates/framework/js/modal.js b/templates/framework/js/modal.js deleted file mode 100644 index f1163135..00000000 --- a/templates/framework/js/modal.js +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Modal - * - * Author: Denis Shakhov - * Version: 1.0 - * - */ - -(function ($) { - /** - * Constructs modal objects - * @constructor - * @class Modal - * @param {Object} options Options - */ - var Modal = function (element, options) { - var $this = this; - - this.options = options || {}; - - this.$element = $(element); - - // TODO: Fix data options - this.center = this.$element.data('center') == undefined ? true : (this.$element.data('center') === "false" ? false : true); - - this.$element.appendTo(Modal.settings._overlay); - - - - this.$element.find(Modal.settings.closeSelector).on('click.modal', function () { - Modal.settings._hideOverlay(); - if ($this.options.isAjax) $this.$element.remove(); - return false; - }); - }; - - /** - * Static methods and vars - * @type {Object} - */ - Modal.settings = { - modalClass: 'modal', - overlayClass: 'modal-overlay', - loaderClass: 'modal-loader', - - modalSelector: '[data-type=modal]', - toggleSelector: '[data-type=modal-toggle]', - closeSelector: '[data-type=modal-close]', - - ajaxVar: 'sText', - - closeOnEsc: true, - - _windowWidth: null, - _windowHeight: null, - _scrollTop: 0, - - _overlay: null, - _loader: null, - - _resize: function () { - Modal.settings._windowWidth = $(window).width(); - Modal.settings._windowHeight = $(window).height(); - Modal.settings._overlay.height(Modal.settings._windowHeight); - }, - /** - * Hide overlay, loader and all modals - */ - _hideOverlay: function (callback) { - if (!Modal.settings._overlay.is(':visible')) return false; - - Modal.settings._overlay.fadeOut(300, function () { - if ($('html').hasClass('ie7')) { - $('html').css('overflow', 'auto'); - } else { - $('html').css('overflow', 'visible'); - } - $('body').css({'margin-right': 0}); - Modal.settings._overlay.find(Modal.settings.modalSelector).hide(); - Modal.settings._loader.hide(); - $(window).scrollTop(Modal.settings._scrollTop); - - callback && callback(); - }); - }, - /** - * Show overlay - */ - _showOverlay: function () { - if (Modal.settings._overlay.is(':visible')) { - Modal.settings._overlay.find(Modal.settings.modalSelector).hide(); - Modal.settings._loader.hide(); - return false; - } - - Modal.settings._scrollTop = $(window).scrollTop(); - - $('html').css({'overflow': 'hidden'}); - - // Prevent content from shifting - $('body').css({'margin-right': $(window).width() - Modal.settings._windowWidth}); - $(window).scrollTop(Modal.settings._scrollTop); - - // Show overlay - Modal.settings._overlay.fadeIn(300); - } - }; - - - Modal.prototype = { - /** - * Show modal - */ - show: function () { - Modal.settings._showOverlay(); - this.$element.show(); - Modal.settings._overlay.scrollTop(0); - - // Center - if (this.center && Modal.settings._windowHeight > this.$element.outerHeight()) { - this.$element.css({'margin-top': (Modal.settings._windowHeight - this.$element.outerHeight()) / 2}); - } - } - }; - - - $(document).ready(function($) { - // Hide scrollbar in IE7 - if ($('html').hasClass('ie7')) { - $('body').attr('scroll', 'no'); - $('html').css('overflow', 'auto'); - } - - Modal.settings._overlay = $('
').height(Modal.settings._windowHeight).appendTo('body'); - Modal.settings._loader = $('
').height(Modal.settings._windowHeight).appendTo(Modal.settings._overlay); - Modal.settings._resize(); - - Modal.settings._overlay.on('click.modal', function (e) { - if (e.target === this) { - Modal.settings._hideOverlay(); - } - }); - - $(window).on('resize.modal', function () { - Modal.settings._resize(); - }); - - // Close on esc - if (Modal.settings.closeOnEsc) { - $(document).on('keyup.modal', function (e) { - e.keyCode === 27 && Modal.settings._hideOverlay(); - }); - } - - // Init modals - $(Modal.settings.modalSelector).each(function () { - var - modal = $(this), - object = modal.data('object'); - - if (!object) modal.data('object', (object = new Modal(this))); - }); - - // Init toggles - $(Modal.settings.toggleSelector).each(function () { - var - toggle = $(this), - url = toggle.data('modal-url'), - modal = $('#' + toggle.data('modal-target')).data('object'); - - - toggle.on('click.modal', function () { - if (url) { - Modal.settings._loader.show(); - Modal.settings._showOverlay(); - - // TODO: Fix params selector - var params = $(this).data() || {}; - - ls.ajax(url, params, function (result) { - if (result.bStateError) { - Modal.settings._hideOverlay(); - ls.msg.error('Error', result.sMsg); - } else { - var modal = $(result[Modal.settings.ajaxVar]); - Modal.settings._loader.hide(); - modal.data('object', (object = new Modal(modal, { isAjax: true }))); - object.show(); - } - }, { - error: function () { - Modal.settings._hideOverlay(function () { - // TODO: Move text to lang file - ls.msg.error('Error', 'Please try again later'); - }); - } - }); - } else { - modal.show(); - } - return false; - }); - }); - }); - - - /** - * Plugin defention - */ - $.fn.jqmShow = $.fn.modalShow = function () { - $(this).data('object').show(); - }; - - $.fn.jqmHide = $.fn.modalHide = function () { - Modal.settings._hideOverlay(); - }; -})(jQuery); \ No newline at end of file diff --git a/templates/framework/js/tab.js b/templates/framework/js/tab.js deleted file mode 100644 index 02b81be4..00000000 --- a/templates/framework/js/tab.js +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Tabs - * - * Author: Denis Shakhov - * Version: 1.0 - * - */ - -(function($) { - /** - * Constructs tab objects - * @constructor - * @class Tab - * @param {Object} options Options - */ - var Tab = function (element, options) { - this.element = $(element); - }; - - /** - * Static methods and vars - * @type {Object} - */ - Tab.settings = { - tabsSelector: '[data-toggle=tabs]', - tabSelector: '[data-toggle=tab]', - contentSelector: '[data-toggle=tab-content]', - paneSelector: '[data-toggle=tab-pane]' - }; - - Tab.prototype = { - /** - * Activate tab - */ - activate: function () { - var - pane = $('#' + this.element.data('tab-target')), - dropdown = this.element.closest('ul').parent('li'); - - this.element - .addClass('active') - .closest(Tab.settings.tabsSelector) - .find('li') // TODO: Fix selector - .not(this.element) - .removeClass('active'); - if (dropdown.length > 0) dropdown.addClass('active'); - pane.show().parent(Tab.settings.contentSelector).find(Tab.settings.paneSelector).not(pane).hide(); - } - }; - - $(document).on('click.tab', Tab.settings.tabSelector, function () { - $(this).data('object').activate(); - return false; - }); - - $.fn.tabActivate = function () { - $(this).data('object').activate(); - }; - - // Init - $(document).ready(function($) { - $(Tab.settings.tabSelector).each(function () { - var - tab = $(this), - tabFirst = tab.closest(Tab.settings.tabsSelector).find('li').eq(0); - object = tab.data('object'); - - if (!object) tab.data('object', (object = new Tab(this))); - if (!tabFirst.hasClass('active')) tabFirst.data('object').activate(); - }); - }); -})(jQuery); \ No newline at end of file diff --git a/templates/framework/js/ui/dropdown.js b/templates/framework/js/ui/dropdown.js new file mode 100644 index 00000000..49788d84 --- /dev/null +++ b/templates/framework/js/ui/dropdown.js @@ -0,0 +1,68 @@ +/** + * Dropdowns + * + * @version 1.0 + * @author Denis Shakhov + */ + +var ls = ls || {}; + +(function($) { + "use strict"; + + var Dropdown = function (element, options) { + this.init('dropdown', element, options); + }; + + Dropdown.prototype = $.extend({}, $.fn.popup.Constructor.prototype, { + constructor: Dropdown, + + hooks : { + onInitTarget: function () { + var self = this; + + // Toggle's text + if (this.options.changeText) { + var activeText = this.$target.find('li.active').text(); + activeText && this.$toggle.text(activeText); + } + + // Change dropdown's text on item click and add 'active' class to clicked item + if (this.options.activateItems || this.options.changeText) { + this.$target.find('li > a').on('click', function (e) { + var $link = $(this); + + if (self.options.activateItems) { + self.$target.find('li').removeClass('active'); + $link.parent('li').addClass('active'); + } + if (self.options.changeText) { + self.$toggle.find('[data-type=dropdown-text]').text($link.text()); + } + self.hide(); + }); + } + } + } + }); + + $.fn.dropdown = function (options, variable, value) { + return ls.popup.initPlugin('dropdown', this, options, variable, value); + }; + + $.fn.dropdown.Constructor = Dropdown; + + $.fn.dropdown.defaults = $.extend({} , $.fn.popup.defaults, { + effect: 'show', + duration: 0 + }); + + $.fn.dropdown.settings = $.extend({} , $.fn.popup.settings, { + toggleSelector: '[data-type=dropdown-toggle]', + targetSelector: '[data-type=dropdown-target]' + }); + + $(document).ready(function($) { + $($.fn.dropdown.settings.toggleSelector).dropdown(); + }); +})(jQuery); \ No newline at end of file diff --git a/templates/framework/js/ui/modal.js b/templates/framework/js/ui/modal.js new file mode 100644 index 00000000..85981a98 --- /dev/null +++ b/templates/framework/js/ui/modal.js @@ -0,0 +1,339 @@ +/* + * Modal + * + * @version 1.0 + * @author Denis Shakhov + */ + +var ls = ls || {}; + +(function ($) { + "use strict"; + + /** + * Private vars and methods + */ + var windowWidth = null, + windowHeight = null, + overlay = null, + loader = null, + scrollTop = 0; + + /** + * Resize + */ + var resize = function () { + windowWidth = $(window).width(); + windowHeight = $(window).height(); + overlay.height(windowHeight); + }; + + /** + * Show overlay + */ + var showOverlay = function () { + if (overlay.is(':visible')) { + overlay.find($.fn.modal.settings.modalSelector).hide(); + Modal.hideLoader(false); + return false; + } + + scrollTop = $(window).scrollTop(); + + $('html').css({'overflow': 'hidden'}); + + // Prevent content from shifting + $('body').css({'margin-right': $(window).width() - windowWidth}); + $(window).scrollTop(scrollTop); + + // Show overlay + overlay.fadeIn(300); + }; + + /** + * Constructs modal objects + * @constructor + * @class Modal + * @param {Object} options Options + */ + var Modal = ls.modal = function (element, options) { + var self = this; + + this.$element = $(element); + this.options = $.extend({}, $.fn.modal.defaults, options); + this.$element.appendTo(overlay); + + this.$element.find($.fn.modal.settings.closeSelector).on('click.modal', function (e) { + Modal.hideAll(); + e.preventDefault(); + }); + + // Close on esc + if (this.options.closeOnEsc) { + $(document).on('keyup.modal', function (e) { + e.keyCode === 27 && Modal.hideAll(); + }); + } + }; + + /** + * Show loader + * @param {Boolean} bText Use text instead of animation + * @param {String} sText Text + * @param {String} bLock Lock overlay and active modal, default: false + * @param {Number} iLockTime Lock time + */ + Modal.showLoader = function (bText, sText, bLock, iLockTime) { + overlay.find('.' + $.fn.modal.settings.lockClass).remove(); + + if ( ! overlay.is(':visible')) showOverlay(); + if (bLock) { + var ts = new Date().getTime(); + + overlay.data('locked', true); + overlay.find($.fn.modal.settings.modalSelector + ':visible').append('
'); + + loader.data('id', ts); + + setTimeout(function () { + if (loader.data('id') == ts) { + Modal.hideAll(); + ls.msg.error('Ошибка', 'Ошибка загрузки'); + } + }, (iLockTime || this.options.lockTime) * 1000); + } + + if (bText) { + loader + .addClass($.fn.modal.settings.loaderTextClass) + .text(sText || this.options.loaderText) + .show(); + } else { + loader.show(); + } + }; + + /** + * Hide loader + */ + Modal.hideLoader = function (bHideOverlay) { + bHideOverlay = typeof bHideOverlay === 'undefined' ? true : bHideOverlay; + + overlay.data('locked', false); + overlay.find('.' + $.fn.modal.settings.lockClass).remove(); + + if (overlay.find($.fn.modal.settings.modalSelector + ':visible').length == 0 && bHideOverlay) Modal.hideAll(); + + loader + .removeClass($.fn.modal.settings.loaderTextClass) + .text('') + .hide(); + }; + + /** + * Init overlay + */ + Modal.initOverlay = function () { + // Hide scrollbar in IE7 + if ($('html').hasClass('ie7')) { + $('body').attr('scroll', 'no'); + $('html').css('overflow', 'auto'); + } + + overlay = $('
').height(windowHeight).appendTo('body'); + loader = $('
').height(windowHeight).css('z-index', 9999).appendTo(overlay); + resize(); + + overlay.on('click.modal', function (e) { + if (e.target === this && overlay.data('locked') !== true) { + Modal.hideAll(); + } + }); + + $(window).on('resize.modal', function () { + resize(); + }); + + /** + * Init toggles + */ + $(document).on('click.modal', $.fn.modal.settings.toggleSelector, function (e) { + var toggle = $(this), + options = ls.tools.getDataOptions(toggle); + + if (options.url) { + Modal.load(options.url, ls.tools.getDataOptions(toggle, 'param'), options); + } else { + $('#' + options.target).data('object').show(); + } + e.preventDefault(); + }); + }; + + /** + * Hide overlay, loader and all modals + * @param {Function} callback onHide callback + */ + Modal.hideAll = function (callback) { + if ( ! overlay.is(':visible')) { + return false; + } + + overlay.fadeOut(300, function () { + if ($('html').hasClass('ie7')) { + $('html').css('overflow', 'auto'); + } else { + $('html').css('overflow', 'visible'); + } + $('body').css({'margin-right': 0}); + + Modal.hideLoader(false); + + overlay.find($.fn.modal.settings.modalSelector).each(function () { + var object = $(this).data('object'); + object.options.url ? object.$element.remove() : object.$element.hide(); + }); + + $(window).scrollTop(scrollTop); + + callback && $.proxy(callback, this)(); + }); + }; + + /** + * Load modal from url + * @param {String} url URL + * @param {Object} params Params + * @param {Object} options Options + */ + Modal.load = function (url, params, options) { + var self = this; + + showOverlay(); + Modal.showLoader(); + + var options = options || {}; + options.url = url; + options.params = params; + + ls.ajax(url, params, function (result) { + if (result.bStateError) { + Modal.hideAll(); + ls.msg.error('Error', result.sMsg); + } else { + var modal = $(result[self.options.ajaxVar]), + object; + + Modal.hideLoader(false); + modal.data('object', (object = new Modal(modal, options))); + object.show(); + } + }, { + error: function () { + Modal.hideLoader(); + Modal.hideAll(function () { + // TODO: Move text to lang file + ls.msg.error('Error', 'Please try again later'); + }); + } + }); + }; + + + Modal.prototype = { + /** + * Show modal + */ + show: function (options) { + if (options) $.extend(this.options, options); + + showOverlay(); + this.$element.show(); + overlay.scrollTop(0); + + // onShow + this.options.onShow && $.proxy(this.options.onShow, this)(); + + // Center + if (this.options.center && windowHeight > this.$element.outerHeight()) { + this.$element.css({'margin-top': (windowHeight - this.$element.outerHeight()) / 2}); + } + }, + + /** + * Hide modal + */ + hide: function () { + Modal.hideAll(); + } + }; + + + /** + * Plugin defention + */ + + // Fallback + $.fn.jqmShow = function (options) { + $(this).modal('show'); + }; + + // Fallback + $.fn.jqmHide = function () { + Modal.hideAll(); + }; + + $.fn.modal = function (options, variable, value) { + var returnValue = false; + + ! $($.fn.modal.settings.overlaySelector).length && Modal.initOverlay(); + + this.each(function () { + var element = $(this), + object = element.data('object'); + + if ( ! object ) element.data('object', (object = new Modal(this, $.extend({}, options, typeof options === 'string' ? {} : options)))); + + if (typeof options === 'string') { + if (options === "option") { + if (value) object.options[variable] = value; else returnValue = object.options[variable]; + } else { + object[options](); + } + } + }); + + return returnValue; + }; + + + /** + * Default options + * @type {Object} + */ + $.fn.modal.defaults = { + url: false, + center: true, + ajaxVar: 'sText', + loaderText: 'Идет загрузка...', + lockTime: 30, + closeOnEsc: true + }; + + /** + * Global settings + * @type {Object} + */ + $.fn.modal.settings = { + modalClass: 'modal', + overlayClass: 'modal-overlay', + loaderClass: 'modal-loader', + loaderTextClass: 'modal-loader-text', + lockClass: 'modal-lock', + + modalSelector: '[data-type=modal]', + toggleSelector: '[data-type=modal-toggle]', + closeSelector: '[data-type=modal-close]', + overlaySelector: '[data-type=modal-overlay]' + }; +})(jQuery); \ No newline at end of file diff --git a/templates/framework/js/ui/popover.js b/templates/framework/js/ui/popover.js new file mode 100644 index 00000000..dee984de --- /dev/null +++ b/templates/framework/js/ui/popover.js @@ -0,0 +1,72 @@ +/** + * Popover + * + * @version 1.0 + * @author Denis Shakhov + */ + +var ls = ls || {}; + +(function($) { + "use strict"; + + var Popover = function (element, options) { + this.init('popover', element, options); + }; + + Popover.prototype = $.extend({}, $.fn.popup.Constructor.prototype, { + constructor: Popover, + + hooks : { + onInitTarget: function () { + if ( ! this.options.target ) { + if ( ! this.options.title ) { + this.options.title = this.$toggle.attr('title'); + this.$toggle.removeAttr('title'); + } + + this.setTitle(this.options.title); + this.setContent(this.options.content); + } + } + }, + + /** + * Set header + */ + setTitle: function (title) { + var $title = this.$target.find('[data-type=' + this.type + '-title]'); + + title ? $title.show().html(title) : $title.hide(); + } + }); + + $.fn.popover = function (options, variable, value) { + return ls.popup.initPlugin('popover', this, options, variable, value); + }; + + $.fn.popover.Constructor = Popover; + + $.fn.popover.defaults = $.extend({} , $.fn.popup.defaults, { + template: '
' + + '
' + + '
' + + '
' + + '
', + alignX: 'center', + alignY: 'top', + offsetY: 10, + duration: 300, + event: 'click' + }); + + $.fn.popover.settings = $.extend({} , $.fn.popup.settings, { + toggleSelector: '[data-type=popover-toggle]', + targetSelector: '[data-type=popover-target]' + }); + + // Init + $(document).ready(function($) { + //$($.fn.popover.settings.toggleSelector).popover(); + }); +})(jQuery); \ No newline at end of file diff --git a/templates/framework/js/ui/popup.js b/templates/framework/js/ui/popup.js new file mode 100644 index 00000000..daa444fc --- /dev/null +++ b/templates/framework/js/ui/popup.js @@ -0,0 +1,357 @@ +/** + * Popups + * + * Base plugin for dropdowns, tooltips and popovers + * + * @version 1.0 + * @author Denis Shakhov + */ + +var ls = ls || {}; + +(function($) { + "use strict"; + + /** + * Constructs popup objects + * @constructor + * @class Popup + * @param {Object} toggle Toggle element + * @param {Object} options Options + */ + var Popup = ls.popup = function (toggle, options) { + this.init('popup', toggle, options); + }; + + /** + * Hide all dropdowns + */ + Popup.hideAll = function (type) { + $($.fn[type].settings.toggleSelector + '.' + $.fn[type].settings.openClass).each(function () { + $(this).data('object').hide(); + }); + }; + + /** + * Init plugin + */ + Popup.initPlugin = function (type, elements, options, variable, value) { + var returnValue = false; + + // Hide when click anywhere but target + $('body').on('click', function (e) { + var el = $($.fn[type].settings.toggleSelector + ', ' + $.fn[type].settings.targetSelector); + + if (el.length && ! el.is(e.target) && el.has(e.target).length === 0) { + Popup.hideAll(type); + } + }); + + // Resize + $(window).resize(function () { + $($.fn[type].settings.toggleSelector + '.' + $.fn[type].settings.openClass).each(function(event) { + $(this).data('object').position(); + }); + }); + + elements.each(function () { + var element = $(this), + object = element.data('object'); + + if ( ! object ) { + element.data('object', (object = new $.fn[type].Constructor(this, $.extend({}, options, ls.tools.getDataOptions(element))))); + object.options.params = ls.tools.getDataOptions(element, 'param'); + } + if (typeof options === 'string') { + if (options === "option") { + if (value) object.options[variable] = value; else returnValue = object.options[variable]; + } else { + object[options](); + } + } + }); + + return returnValue; + }; + + Popup.prototype = { + constructor: Popup, + + /** + * Hooks + * @type {Object} + */ + hooks : { + onInitTarget: false + }, + + /** + * Init + * @param {String} type Type of control + * @param {Object} toggle Toggle element + * @param {Object} options Options + */ + init: function (type, toggle, options) { + this.type = type; + this.timeout = false; + this.open = false; + + this.togglePosition = {}; + this.targetPosition = {}; + + // Default options + this.options = $.extend({}, $.fn[this.type].defaults, options); + + // Toggle + this.$toggle = $(toggle); + + // Events + this.$toggle.on(this.options.event + '.' + this.type, this.options.selector, $.proxy(this.toggle, this)); + + // Init target + ! this.options.template && this.initTarget(this); + }, + + /** + * Init target + */ + initTarget: function () { + var self = this; + + this.$target = this.options.template && ! this.options.target ? $(this.options.template) : $('#' + this.options.target); + this.$target.hide(); + + // Align classes + this.$target.addClass($.fn[this.type].settings.menuAlignPrefixClass + 'x-' + this.options.alignX); + this.$target.addClass($.fn[this.type].settings.menuAlignPrefixClass + 'y-' + this.options.alignY); + + // Append to body + if (this.options.appendToBody) this.$target.appendTo('body'); + + // Target's content + this.options.content && this.setContent(this.options.content); + + // Add classes + this.options.class && this.$target.addClass(this.options.class); + + // Hide + this.$target.find('[data-type=dropdown-hide]').on('click', this.hide); + + // Hook + if (this.hooks.onInitTarget) $.proxy(this.hooks.onInitTarget, this)(); + }, + + /** + * Mouse enter + */ + enter: function () { + var self = this; + + if ( ! this.options.delay ) { + this.show(); + } else { + this.timeout = setTimeout(function() { self.show(); }, this.options.delay); + } + }, + + /** + * Mouse leave + */ + leave: function () { + if ( ! this.options.delay ) { + this.hide(); + } else { + this.open && this.hide(); + clearTimeout(this.timeout); + this.timeout = false; + } + }, + + /** + * Toggle dropdown + */ + toggle: function (e) { + if ( ! this.options.delay) { + ! this.open ? this.enter() : this.leave(); + } else { + this.open || (this.timeout && ! this.open) ? this.leave() : this.enter(); + } + this.options.preventDefault && e.preventDefault(); + }, + + /** + * Show dropdown + */ + show: function () { + var self = this; + + typeof this.options.onShow === 'function' && $.proxy(this.options.onShow, this)(); + + this.options.template && this.initTarget(); + Popup.hideAll(this.type); + this.position(); + this.$toggle.addClass($.fn[this.type].settings.openClass); + this.$target[this.options.effect == 'show' ? 'show' : (this.options.effect == 'fade' ? 'fadeIn' : 'slideDown')](this.options.duration); + this.open = true; + + // Ajax + if (this.options.url) { + this.setContent(''); + this.$target.addClass('loading'); + this.position(); + + ls.ajax(this.options.url, this.options.params, function (result) { + if (result.bStateError) { + self.hide(); + ls.msg.error('Error', result.sMsg); + } else { + self.$target.removeClass('loading'); + self.setContent(result[self.options.ajaxVar]); + self.position(); + } + }, { + error: function () { + self.hide(); + ls.msg.error('Error', 'Please try again later'); + } + }); + } + }, + + /** + * Hide dropdown + */ + hide: function () { + var self = this; + + typeof this.options.onHide === 'function' && $.proxy(this.options.onHide, this)(); + + this.$toggle.removeClass($.fn[this.type].settings.openClass); + this.$target[this.options.effect == 'show' ? 'hide' : (this.options.effect == 'fade' ? 'fadeOut' : 'slideUp')](this.options.duration, function () { + if (self.options.template && ! self.options.target) { + self.$target.remove(); + self.$target = false; + } + self.open = false; + }); + }, + + /** + * Set content + */ + setContent: function (content) { + var contentElement = this.$target.find('[data-type=' + this.type + '-content]'); + if ( ! contentElement.length ) contentElement = this.$target; + + contentElement.html(content); + }, + + /** + * Position menu + */ + position: function () { + var toggleWidth = this.$toggle.outerWidth(), + toggleHeight = this.$toggle.outerHeight(), + targetWidth = this.$target.outerWidth(), + targetHeight = this.$target.outerHeight(); + + this.togglePosition = this.$toggle.offset(); + + if ( ! this.options.appendToBody ) { + this.togglePosition.top = this.togglePosition.left = 0; + } + + switch(this.options.alignY) { + case 'top': + this.targetPosition.top = this.togglePosition.top - targetHeight - this.options.offsetY; + break; + case 'center': + this.targetPosition.top = this.togglePosition.top + (toggleHeight - targetHeight) / 2; + break; + case 'bottom': + this.targetPosition.top = this.togglePosition.top + toggleHeight + this.options.offsetY; + break; + default: + this.targetPosition.top = 0; + } + + switch(this.options.alignX) { + case 'left': + this.targetPosition.left = this.options.alignY == 'center' ? this.togglePosition.left - targetWidth - this.options.offsetY : this.togglePosition.left + this.options.offsetX; + break; + case 'center': + this.targetPosition.left = this.togglePosition.left + (toggleWidth - targetWidth) / 2; + break; + case 'right': + this.targetPosition.left = this.options.alignY == 'center' ? this.togglePosition.left + toggleWidth + this.options.offsetY : this.togglePosition.left + toggleWidth - targetWidth - this.options.offsetX; + break; + default: + this.targetPosition.left = 0; + } + + this.$target.css({ + 'top' : this.targetPosition.top, + 'left' : this.targetPosition.left, + 'bottom' : 'auto', + 'right' : 'auto' + }); + } + }; + + /** + * Plugin defenition + */ + $.fn.popup = function (options, variable, value) { + //Popup.initPlugin('popup', this, options); + }; + + $.fn.popup.Constructor = Popup; + + /** + * Default options + * @type {Object} + */ + $.fn.popup.defaults = { + target : false, // Target ID + selector : false, // Target ID + + alignX : 'left', // left, center, right + alignY : 'bottom', // top, center, bottom + alignTo : false, + + offsetX : 0, // Shift along toggle + offsetY : 3, // Distance from toggle + + appendToBody : true, // Append toggle to body + changeText : false, + activateItems : false, + + event : 'click', + effect : 'fade', // slide, fade, show + delay : 0, + duration : 200, + + url : false, + params : {}, + class : false, + title : false, + content : false, + template : false, + ajaxVar : 'sText', + + onShow : false, + onHide : false, + preventDefault : true + }; + + // Global settings + $.fn.popup.settings = { + // Selectors + toggleSelector: '[data-type=popup-toggle]', + targetSelector: '[data-type=popup-target]', + + // Classes + openClass: 'open', + menuAlignPrefixClass: 'align' + }; +})(jQuery); \ No newline at end of file diff --git a/templates/framework/js/ui/tab.js b/templates/framework/js/ui/tab.js new file mode 100644 index 00000000..cd38c8a0 --- /dev/null +++ b/templates/framework/js/ui/tab.js @@ -0,0 +1,96 @@ +/* + * Tabs + * + * @version 1.0 + * @author Denis Shakhov + */ + +var ls = ls || {}; + +(function($) { + "use strict"; + + /** + * Constructs tab objects + * @constructor + * @class Tab + * @param {Object} options Options + */ + var Tab = function (element, options) { + this.options = $.extend({}, $.fn.tab.defaults, options); + + this.$tab = $(element); + this.$pane = $('#' + this.options.target); + }; + + Tab.prototype = { + /** + * Activate tab + */ + activate: function () { + var dropdown = this.$tab.closest('ul').parent('li'); + + this.$tab + .addClass('active') + .closest($.fn.tab.settings.tabsSelector) + .find('li') // TODO: Fix selector + .not(this.$tab) + .removeClass('active'); + + if (dropdown.length > 0) dropdown.addClass('active'); + + this.$pane.show().parent($.fn.tab.settings.contentSelector).find($.fn.tab.settings.paneSelector).not(this.$pane).hide(); + } + }; + + $.fn.tab = function (options, variable, value) { + var returnValue = false; + + this.each(function () { + var tab = $(this), + object = tab.data('object'); + + if ( ! object ) tab.data('object', (object = new Tab(this, $.extend({}, options, ls.tools.getDataOptions(tab))))); + if (typeof options === 'string') { + if (options === "option") { + if (value) object.options[variable] = value; else returnValue = object.options[variable]; + } else { + object[options](); + } + } + }); + + return returnValue; + }; + + + /** + * Default options + * @type {Object} + */ + $.fn.tab.defaults = { + target: false + }; + + + /** + * Global settings + * @type {Object} + */ + $.fn.tab.settings = { + tabsSelector: '[data-type=tabs]', + tabSelector: '[data-type=tab]', + contentSelector: '[data-type=tab-content]', + paneSelector: '[data-type=tab-pane]' + }; + + $(document).on('click.tab', $.fn.tab.settings.tabSelector, function (e) { + $(this).tab('activate'); + e.preventDefault(); + }); + + // Init + $(document).ready(function($) { + $($.fn.tab.settings.tabSelector).tab(); + }); +})(jQuery); \ No newline at end of file diff --git a/templates/framework/js/ui/tooltip.js b/templates/framework/js/ui/tooltip.js new file mode 100644 index 00000000..7de97006 --- /dev/null +++ b/templates/framework/js/ui/tooltip.js @@ -0,0 +1,60 @@ +/** + * Tooltip + * + * @version 1.0 + * @author Denis Shakhov + */ + +var ls = ls || {}; + +(function($) { + "use strict"; + + var Tooltip = function (element, options) { + this.init('tooltip', element, options); + }; + + Tooltip.prototype = $.extend({}, $.fn.popup.Constructor.prototype, { + constructor: Tooltip, + + hooks : { + onInitTarget: function () { + if ( ! this.options.target ) { + if ( ! this.options.content ) { + this.options.content = this.$toggle.attr('title'); + this.$toggle.removeAttr('title'); + } + + this.setContent(this.options.content); + } + } + } + }); + + $.fn.tooltip = function (options, variable, value) { + return ls.popup.initPlugin('tooltip', this, options, variable, value); + }; + + $.fn.tooltip.Constructor = Tooltip; + + $.fn.tooltip.defaults = $.extend({} , $.fn.popup.defaults, { + template: '
', + alignX: 'center', + alignY: 'top', + effect: 'fade', + offsetY: 10, + duration: 500, + delay: 500, + event: 'hover', + preventDefault: false + }); + + $.fn.tooltip.settings = $.extend({} , $.fn.popup.settings, { + toggleSelector: '[data-type=tooltip-toggle]', + targetSelector: '[data-type=tooltip-target]' + }); + + $(document).ready(function($) { + $($.fn.tooltip.settings.toggleSelector).tooltip(); + }); +})(jQuery); \ No newline at end of file diff --git a/templates/framework/js/vendor/html5shiv.js b/templates/framework/js/vendor/html5shiv.js new file mode 100644 index 00000000..829eb0a2 --- /dev/null +++ b/templates/framework/js/vendor/html5shiv.js @@ -0,0 +1,299 @@ +/** +* @preserve HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +;(function(window, document) { +/*jshint evil:true */ + /** version */ + var version = '3.6.2pre'; + + /** Preset options */ + var options = window.html5 || {}; + + /** Used to skip problem elements */ + var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; + + /** Not all elements can be cloned in IE **/ + var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; + + /** Detect whether the browser supports default html5 styles */ + var supportsHtml5Styles; + + /** Name of the expando, to work with multiple documents or to re-shiv one document */ + var expando = '_html5shiv'; + + /** The id for the the documents expando */ + var expanID = 0; + + /** Cached data for each document */ + var expandoData = {}; + + /** Detect whether the browser supports unknown elements */ + var supportsUnknownElements; + + (function() { + try { + var a = document.createElement('a'); + a.innerHTML = ''; + //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles + supportsHtml5Styles = ('hidden' in a); + + supportsUnknownElements = a.childNodes.length == 1 || (function() { + // assign a false positive if unable to shiv + (document.createElement)('a'); + var frag = document.createDocumentFragment(); + return ( + typeof frag.cloneNode == 'undefined' || + typeof frag.createDocumentFragment == 'undefined' || + typeof frag.createElement == 'undefined' + ); + }()); + } catch(e) { + // assign a false positive if detection fails => unable to shiv + supportsHtml5Styles = true; + supportsUnknownElements = true; + } + + }()); + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a style sheet with the given CSS text and adds it to the document. + * @private + * @param {Document} ownerDocument The document. + * @param {String} cssText The CSS text. + * @returns {StyleSheet} The style element. + */ + function addStyleSheet(ownerDocument, cssText) { + var p = ownerDocument.createElement('p'), + parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; + + p.innerHTML = 'x'; + return parent.insertBefore(p.lastChild, parent.firstChild); + } + + /** + * Returns the value of `html5.elements` as an array. + * @private + * @returns {Array} An array of shived element node names. + */ + function getElements() { + var elements = html5.elements; + return typeof elements == 'string' ? elements.split(' ') : elements; + } + + /** + * Returns the data associated to the given document + * @private + * @param {Document} ownerDocument The document. + * @returns {Object} An object of data. + */ + function getExpandoData(ownerDocument) { + var data = expandoData[ownerDocument[expando]]; + if (!data) { + data = {}; + expanID++; + ownerDocument[expando] = expanID; + expandoData[expanID] = data; + } + return data; + } + + /** + * returns a shived element for the given nodeName and document + * @memberOf html5 + * @param {String} nodeName name of the element + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived element. + */ + function createElement(nodeName, ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createElement(nodeName); + } + if (!data) { + data = getExpandoData(ownerDocument); + } + var node; + + if (data.cache[nodeName]) { + node = data.cache[nodeName].cloneNode(); + } else if (saveClones.test(nodeName)) { + node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); + } else { + node = data.createElem(nodeName); + } + + // Avoid adding some elements to fragments in IE < 9 because + // * Attributes like `name` or `type` cannot be set/changed once an element + // is inserted into a document/fragment + // * Link elements with `src` attributes that are inaccessible, as with + // a 403 response, will cause the tab/window to crash + // * Script elements appended to fragments will execute when their `src` + // or `text` property is set + return node.canHaveChildren && !reSkip.test(nodeName) ? data.frag.appendChild(node) : node; + } + + /** + * returns a shived DocumentFragment for the given document + * @memberOf html5 + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived DocumentFragment. + */ + function createDocumentFragment(ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createDocumentFragment(); + } + data = data || getExpandoData(ownerDocument); + var clone = data.frag.cloneNode(), + i = 0, + elems = getElements(), + l = elems.length; + for(;i)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
a",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="
t
",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj; +return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="
",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&>(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l) +}b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("'; - ifr = document.getElementById('iframe'); - doc = ifr.contentWindow.document; - - // Force absolute CSS urls - css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")]; - css = css.concat(tinymce.explode(ed.settings.content_css) || []); - tinymce.each(css, function(u) { - cssHTML += ''; - }); - - // Write content into iframe - doc.open(); - doc.write('' + cssHTML + ''); - doc.close(); - - doc.designMode = 'on'; - this.resize(); - - window.setTimeout(function() { - ifr.contentWindow.focus(); - }, 10); - }, - - insert : function() { - var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; - - tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); - tinyMCEPopup.close(); - }, - - resize : function() { - var vp = tinyMCEPopup.dom.getViewPort(window), el; - - el = document.getElementById('iframe'); - - if (el) { - el.style.width = (vp.w - 20) + 'px'; - el.style.height = (vp.h - 90) + 'px'; - } - } -}; - -tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog); +tinyMCEPopup.requireLangPack(); + +var PasteWordDialog = { + init : function() { + var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = ''; + + // Create iframe + el.innerHTML = ''; + ifr = document.getElementById('iframe'); + doc = ifr.contentWindow.document; + + // Force absolute CSS urls + css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")]; + css = css.concat(tinymce.explode(ed.settings.content_css) || []); + tinymce.each(css, function(u) { + cssHTML += ''; + }); + + // Write content into iframe + doc.open(); + doc.write('' + cssHTML + ''); + doc.close(); + + doc.designMode = 'on'; + this.resize(); + + window.setTimeout(function() { + ifr.contentWindow.focus(); + }, 10); + }, + + insert : function() { + var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('iframe'); + + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 90) + 'px'; + } + } +}; + +tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog); diff --git a/engine/lib/external/tinymce-jq/plugins/paste/langs/en_dlg.js b/templates/framework/js/vendor/tinymce-jq/plugins/paste/langs/en_dlg.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/paste/langs/en_dlg.js rename to templates/framework/js/vendor/tinymce-jq/plugins/paste/langs/en_dlg.js diff --git a/engine/lib/external/tinymce-jq/plugins/paste/langs/ru_dlg.js b/templates/framework/js/vendor/tinymce-jq/plugins/paste/langs/ru_dlg.js old mode 100755 new mode 100644 similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/paste/langs/ru_dlg.js rename to templates/framework/js/vendor/tinymce-jq/plugins/paste/langs/ru_dlg.js diff --git a/engine/lib/external/tinymce-jq/plugins/paste/pastetext.htm b/templates/framework/js/vendor/tinymce-jq/plugins/paste/pastetext.htm similarity index 97% rename from engine/lib/external/tinymce-jq/plugins/paste/pastetext.htm rename to templates/framework/js/vendor/tinymce-jq/plugins/paste/pastetext.htm index b6559454..8ccfbb97 100644 --- a/engine/lib/external/tinymce-jq/plugins/paste/pastetext.htm +++ b/templates/framework/js/vendor/tinymce-jq/plugins/paste/pastetext.htm @@ -1,27 +1,27 @@ - - - {#paste.paste_text_desc} - - - - - -
{#paste.paste_text_desc}
- -
- -
- -
- -
{#paste_dlg.text_title}
- - - -
- - -
- - + + + {#paste.paste_text_desc} + + + + + +
{#paste.paste_text_desc}
+ +
+ +
+ +
+ +
{#paste_dlg.text_title}
+ + + +
+ + +
+ + \ No newline at end of file diff --git a/engine/lib/external/tinymce-jq/plugins/paste/pasteword.htm b/templates/framework/js/vendor/tinymce-jq/plugins/paste/pasteword.htm similarity index 97% rename from engine/lib/external/tinymce-jq/plugins/paste/pasteword.htm rename to templates/framework/js/vendor/tinymce-jq/plugins/paste/pasteword.htm index 0f6bb412..7731f39c 100644 --- a/engine/lib/external/tinymce-jq/plugins/paste/pasteword.htm +++ b/templates/framework/js/vendor/tinymce-jq/plugins/paste/pasteword.htm @@ -1,21 +1,21 @@ - - - {#paste.paste_word_desc} - - - - - -
{#paste.paste_word_desc}
- -
{#paste_dlg.word_title}
- -
- -
- - -
- - - + + + {#paste.paste_word_desc} + + + + + +
{#paste.paste_word_desc}
+ +
{#paste_dlg.word_title}
+ +
+ +
+ + +
+ + + diff --git a/engine/lib/external/tinymce-jq/plugins/preview/editor_plugin.js b/templates/framework/js/vendor/tinymce-jq/plugins/preview/editor_plugin.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/preview/editor_plugin.js rename to templates/framework/js/vendor/tinymce-jq/plugins/preview/editor_plugin.js diff --git a/engine/lib/external/tinymce-jq/plugins/preview/editor_plugin_src.js b/templates/framework/js/vendor/tinymce-jq/plugins/preview/editor_plugin_src.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/preview/editor_plugin_src.js rename to templates/framework/js/vendor/tinymce-jq/plugins/preview/editor_plugin_src.js diff --git a/engine/lib/external/tinymce-jq/plugins/preview/example.html b/templates/framework/js/vendor/tinymce-jq/plugins/preview/example.html similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/preview/example.html rename to templates/framework/js/vendor/tinymce-jq/plugins/preview/example.html index b2c3d90c..48202224 100644 --- a/engine/lib/external/tinymce-jq/plugins/preview/example.html +++ b/templates/framework/js/vendor/tinymce-jq/plugins/preview/example.html @@ -1,28 +1,28 @@ - - - - - -Example of a custom preview page - - - -Editor contents:
-
- -
- - - + + + + + +Example of a custom preview page + + + +Editor contents:
+
+ +
+ + + diff --git a/engine/lib/external/tinymce-jq/plugins/media/js/embed.js b/templates/framework/js/vendor/tinymce-jq/plugins/preview/jscripts/embed.js similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/media/js/embed.js rename to templates/framework/js/vendor/tinymce-jq/plugins/preview/jscripts/embed.js index f8dc8105..6fe25de0 100644 --- a/engine/lib/external/tinymce-jq/plugins/media/js/embed.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/preview/jscripts/embed.js @@ -1,73 +1,73 @@ -/** - * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. - */ - -function writeFlash(p) { - writeEmbed( - 'D27CDB6E-AE6D-11cf-96B8-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'application/x-shockwave-flash', - p - ); -} - -function writeShockWave(p) { - writeEmbed( - '166B1BCA-3F9C-11CF-8075-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', - 'application/x-director', - p - ); -} - -function writeQuickTime(p) { - writeEmbed( - '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', - 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', - 'video/quicktime', - p - ); -} - -function writeRealMedia(p) { - writeEmbed( - 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'audio/x-pn-realaudio-plugin', - p - ); -} - -function writeWindowsMedia(p) { - p.url = p.src; - writeEmbed( - '6BF52A52-394A-11D3-B153-00C04F79FAA6', - 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', - 'application/x-mplayer2', - p - ); -} - -function writeEmbed(cls, cb, mt, p) { - var h = '', n; - - h += ''; - - h += ''; + + h += ' - - - - - -{#preview.preview_desc} - - - - - + + + + + + +{#preview.preview_desc} + + + + + diff --git a/engine/lib/external/tinymce-jq/plugins/print/editor_plugin.js b/templates/framework/js/vendor/tinymce-jq/plugins/print/editor_plugin.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/print/editor_plugin.js rename to templates/framework/js/vendor/tinymce-jq/plugins/print/editor_plugin.js diff --git a/engine/lib/external/tinymce-jq/plugins/print/editor_plugin_src.js b/templates/framework/js/vendor/tinymce-jq/plugins/print/editor_plugin_src.js similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/print/editor_plugin_src.js rename to templates/framework/js/vendor/tinymce-jq/plugins/print/editor_plugin_src.js index 3933fe65..47e666a3 100644 --- a/engine/lib/external/tinymce-jq/plugins/print/editor_plugin_src.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/print/editor_plugin_src.js @@ -1,34 +1,34 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Print', { - init : function(ed, url) { - ed.addCommand('mcePrint', function() { - ed.getWin().print(); - }); - - ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'}); - }, - - getInfo : function() { - return { - longname : 'Print', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('print', tinymce.plugins.Print); -})(); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Print', { + init : function(ed, url) { + ed.addCommand('mcePrint', function() { + ed.getWin().print(); + }); + + ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'}); + }, + + getInfo : function() { + return { + longname : 'Print', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('print', tinymce.plugins.Print); +})(); diff --git a/engine/lib/external/tinymce-jq/plugins/save/editor_plugin.js b/templates/framework/js/vendor/tinymce-jq/plugins/save/editor_plugin.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/save/editor_plugin.js rename to templates/framework/js/vendor/tinymce-jq/plugins/save/editor_plugin.js diff --git a/engine/lib/external/tinymce-jq/plugins/save/editor_plugin_src.js b/templates/framework/js/vendor/tinymce-jq/plugins/save/editor_plugin_src.js similarity index 95% rename from engine/lib/external/tinymce-jq/plugins/save/editor_plugin_src.js rename to templates/framework/js/vendor/tinymce-jq/plugins/save/editor_plugin_src.js index f5a3de8f..5ab6491c 100644 --- a/engine/lib/external/tinymce-jq/plugins/save/editor_plugin_src.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/save/editor_plugin_src.js @@ -1,101 +1,101 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Save', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceSave', t._save, t); - ed.addCommand('mceCancel', t._cancel, t); - - // Register buttons - ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'}); - ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'}); - - ed.onNodeChange.add(t._nodeChange, t); - ed.addShortcut('ctrl+s', ed.getLang('save.save_desc'), 'mceSave'); - }, - - getInfo : function() { - return { - longname : 'Save', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _nodeChange : function(ed, cm, n) { - var ed = this.editor; - - if (ed.getParam('save_enablewhendirty')) { - cm.setDisabled('save', !ed.isDirty()); - cm.setDisabled('cancel', !ed.isDirty()); - } - }, - - // Private methods - - _save : function() { - var ed = this.editor, formObj, os, i, elementId; - - formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form'); - - if (ed.getParam("save_enablewhendirty") && !ed.isDirty()) - return; - - tinyMCE.triggerSave(); - - // Use callback instead - if (os = ed.getParam("save_onsavecallback")) { - if (ed.execCallback('save_onsavecallback', ed)) { - ed.startContent = tinymce.trim(ed.getContent({format : 'raw'})); - ed.nodeChanged(); - } - - return; - } - - if (formObj) { - ed.isNotDirty = true; - - if (formObj.onsubmit == null || formObj.onsubmit() != false) - formObj.submit(); - - ed.nodeChanged(); - } else - ed.windowManager.alert("Error: No form element found."); - }, - - _cancel : function() { - var ed = this.editor, os, h = tinymce.trim(ed.startContent); - - // Use callback instead - if (os = ed.getParam("save_oncancelcallback")) { - ed.execCallback('save_oncancelcallback', ed); - return; - } - - ed.setContent(h); - ed.undoManager.clear(); - ed.nodeChanged(); - } - }); - - // Register plugin - tinymce.PluginManager.add('save', tinymce.plugins.Save); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.Save', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceSave', t._save, t); + ed.addCommand('mceCancel', t._cancel, t); + + // Register buttons + ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'}); + ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'}); + + ed.onNodeChange.add(t._nodeChange, t); + ed.addShortcut('ctrl+s', ed.getLang('save.save_desc'), 'mceSave'); + }, + + getInfo : function() { + return { + longname : 'Save', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var ed = this.editor; + + if (ed.getParam('save_enablewhendirty')) { + cm.setDisabled('save', !ed.isDirty()); + cm.setDisabled('cancel', !ed.isDirty()); + } + }, + + // Private methods + + _save : function() { + var ed = this.editor, formObj, os, i, elementId; + + formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form'); + + if (ed.getParam("save_enablewhendirty") && !ed.isDirty()) + return; + + tinyMCE.triggerSave(); + + // Use callback instead + if (os = ed.getParam("save_onsavecallback")) { + if (ed.execCallback('save_onsavecallback', ed)) { + ed.startContent = tinymce.trim(ed.getContent({format : 'raw'})); + ed.nodeChanged(); + } + + return; + } + + if (formObj) { + ed.isNotDirty = true; + + if (formObj.onsubmit == null || formObj.onsubmit() != false) + formObj.submit(); + + ed.nodeChanged(); + } else + ed.windowManager.alert("Error: No form element found."); + }, + + _cancel : function() { + var ed = this.editor, os, h = tinymce.trim(ed.startContent); + + // Use callback instead + if (os = ed.getParam("save_oncancelcallback")) { + ed.execCallback('save_oncancelcallback', ed); + return; + } + + ed.setContent(h); + ed.undoManager.clear(); + ed.nodeChanged(); + } + }); + + // Register plugin + tinymce.PluginManager.add('save', tinymce.plugins.Save); })(); \ No newline at end of file diff --git a/engine/lib/external/tinymce-jq/plugins/searchreplace/css/searchreplace.css b/templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/css/searchreplace.css similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/searchreplace/css/searchreplace.css rename to templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/css/searchreplace.css index ecdf58c7..3e2eaf34 100644 --- a/engine/lib/external/tinymce-jq/plugins/searchreplace/css/searchreplace.css +++ b/templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/css/searchreplace.css @@ -1,6 +1,6 @@ -.panel_wrapper {height:85px;} -.panel_wrapper div.current {height:85px;} - -/* IE */ -* html .panel_wrapper {height:100px;} -* html .panel_wrapper div.current {height:100px;} +.panel_wrapper {height:85px;} +.panel_wrapper div.current {height:85px;} + +/* IE */ +* html .panel_wrapper {height:100px;} +* html .panel_wrapper div.current {height:100px;} diff --git a/engine/lib/external/tinymce-jq/plugins/searchreplace/editor_plugin.js b/templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/editor_plugin.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/searchreplace/editor_plugin.js rename to templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/editor_plugin.js diff --git a/engine/lib/external/tinymce-jq/plugins/searchreplace/editor_plugin_src.js b/templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/editor_plugin_src.js similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/searchreplace/editor_plugin_src.js rename to templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/editor_plugin_src.js index 4c87e8fa..b0c013fd 100644 --- a/engine/lib/external/tinymce-jq/plugins/searchreplace/editor_plugin_src.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/editor_plugin_src.js @@ -1,61 +1,61 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.SearchReplacePlugin', { - init : function(ed, url) { - function open(m) { - // Keep IE from writing out the f/r character to the editor - // instance while initializing a new dialog. See: #3131190 - window.focus(); - - ed.windowManager.open({ - file : url + '/searchreplace.htm', - width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), - height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)), - inline : 1, - auto_focus : 0 - }, { - mode : m, - search_string : ed.selection.getContent({format : 'text'}), - plugin_url : url - }); - }; - - // Register commands - ed.addCommand('mceSearch', function() { - open('search'); - }); - - ed.addCommand('mceReplace', function() { - open('replace'); - }); - - // Register buttons - ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); - ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); - - ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); - }, - - getInfo : function() { - return { - longname : 'Search/Replace', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.SearchReplacePlugin', { + init : function(ed, url) { + function open(m) { + // Keep IE from writing out the f/r character to the editor + // instance while initializing a new dialog. See: #3131190 + window.focus(); + + ed.windowManager.open({ + file : url + '/searchreplace.htm', + width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), + height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)), + inline : 1, + auto_focus : 0 + }, { + mode : m, + search_string : ed.selection.getContent({format : 'text'}), + plugin_url : url + }); + }; + + // Register commands + ed.addCommand('mceSearch', function() { + open('search'); + }); + + ed.addCommand('mceReplace', function() { + open('replace'); + }); + + // Register buttons + ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); + ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); + + ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); + }, + + getInfo : function() { + return { + longname : 'Search/Replace', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); })(); \ No newline at end of file diff --git a/engine/lib/external/tinymce-jq/plugins/searchreplace/js/searchreplace.js b/templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/js/searchreplace.js similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/searchreplace/js/searchreplace.js rename to templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/js/searchreplace.js index 80284b9f..b1630ca8 100644 --- a/engine/lib/external/tinymce-jq/plugins/searchreplace/js/searchreplace.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/js/searchreplace.js @@ -1,142 +1,142 @@ -tinyMCEPopup.requireLangPack(); - -var SearchReplaceDialog = { - init : function(ed) { - var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); - - t.switchMode(m); - - f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); - - // Focus input field - f[m + '_panel_searchstring'].focus(); - - mcTabs.onChange.add(function(tab_id, panel_id) { - t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); - }); - }, - - switchMode : function(m) { - var f, lm = this.lastMode; - - if (lm != m) { - f = document.forms[0]; - - if (lm) { - f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; - f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; - f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; - f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; - } - - mcTabs.displayTab(m + '_tab', m + '_panel'); - document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; - document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; - this.lastMode = m; - } - }, - - searchNext : function(a) { - var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; - - // Get input - f = document.forms[0]; - s = f[m + '_panel_searchstring'].value; - b = f[m + '_panel_backwardsu'].checked; - ca = f[m + '_panel_casesensitivebox'].checked; - rs = f['replace_panel_replacestring'].value; - - if (tinymce.isIE) { - r = ed.getDoc().selection.createRange(); - } - - if (s == '') - return; - - function fix() { - // Correct Firefox graphics glitches - // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? - r = se.getRng().cloneRange(); - ed.getDoc().execCommand('SelectAll', false, null); - se.setRng(r); - }; - - function replace() { - ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE - }; - - // IE flags - if (ca) - fl = fl | 4; - - switch (a) { - case 'all': - // Move caret to beginning of text - ed.execCommand('SelectAll'); - ed.selection.collapse(true); - - if (tinymce.isIE) { - ed.focus(); - r = ed.getDoc().selection.createRange(); - - while (r.findText(s, b ? -1 : 1, fl)) { - r.scrollIntoView(); - r.select(); - replace(); - fo = 1; - - if (b) { - r.moveEnd("character", -(rs.length)); // Otherwise will loop forever - } - } - - tinyMCEPopup.storeSelection(); - } else { - while (w.find(s, ca, b, false, false, false, false)) { - replace(); - fo = 1; - } - } - - if (fo) - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); - else - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - - return; - - case 'current': - if (!ed.selection.isCollapsed()) - replace(); - - break; - } - - se.collapse(b); - r = se.getRng(); - - // Whats the point - if (!s) - return; - - if (tinymce.isIE) { - ed.focus(); - r = ed.getDoc().selection.createRange(); - - if (r.findText(s, b ? -1 : 1, fl)) { - r.scrollIntoView(); - r.select(); - } else - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - - tinyMCEPopup.storeSelection(); - } else { - if (!w.find(s, ca, b, false, false, false, false)) - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - else - fix(); - } - } -}; - -tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); +tinyMCEPopup.requireLangPack(); + +var SearchReplaceDialog = { + init : function(ed) { + var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); + + t.switchMode(m); + + f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); + + // Focus input field + f[m + '_panel_searchstring'].focus(); + + mcTabs.onChange.add(function(tab_id, panel_id) { + t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); + }); + }, + + switchMode : function(m) { + var f, lm = this.lastMode; + + if (lm != m) { + f = document.forms[0]; + + if (lm) { + f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; + f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; + f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; + f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; + } + + mcTabs.displayTab(m + '_tab', m + '_panel'); + document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; + document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; + this.lastMode = m; + } + }, + + searchNext : function(a) { + var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; + + // Get input + f = document.forms[0]; + s = f[m + '_panel_searchstring'].value; + b = f[m + '_panel_backwardsu'].checked; + ca = f[m + '_panel_casesensitivebox'].checked; + rs = f['replace_panel_replacestring'].value; + + if (tinymce.isIE) { + r = ed.getDoc().selection.createRange(); + } + + if (s == '') + return; + + function fix() { + // Correct Firefox graphics glitches + // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? + r = se.getRng().cloneRange(); + ed.getDoc().execCommand('SelectAll', false, null); + se.setRng(r); + }; + + function replace() { + ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE + }; + + // IE flags + if (ca) + fl = fl | 4; + + switch (a) { + case 'all': + // Move caret to beginning of text + ed.execCommand('SelectAll'); + ed.selection.collapse(true); + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + while (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + replace(); + fo = 1; + + if (b) { + r.moveEnd("character", -(rs.length)); // Otherwise will loop forever + } + } + + tinyMCEPopup.storeSelection(); + } else { + while (w.find(s, ca, b, false, false, false, false)) { + replace(); + fo = 1; + } + } + + if (fo) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); + else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + return; + + case 'current': + if (!ed.selection.isCollapsed()) + replace(); + + break; + } + + se.collapse(b); + r = se.getRng(); + + // Whats the point + if (!s) + return; + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + if (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + } else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + tinyMCEPopup.storeSelection(); + } else { + if (!w.find(s, ca, b, false, false, false, false)) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + else + fix(); + } + } +}; + +tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); diff --git a/engine/lib/external/tinymce-jq/plugins/searchreplace/langs/en_dlg.js b/templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/langs/en_dlg.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/searchreplace/langs/en_dlg.js rename to templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/langs/en_dlg.js diff --git a/engine/lib/external/tinymce-jq/plugins/searchreplace/langs/ru_dlg.js b/templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/langs/ru_dlg.js old mode 100755 new mode 100644 similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/searchreplace/langs/ru_dlg.js rename to templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/langs/ru_dlg.js diff --git a/engine/lib/external/tinymce-jq/plugins/searchreplace/searchreplace.htm b/templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/searchreplace.htm similarity index 98% rename from engine/lib/external/tinymce-jq/plugins/searchreplace/searchreplace.htm rename to templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/searchreplace.htm index 5a22d8aa..bac5a184 100644 --- a/engine/lib/external/tinymce-jq/plugins/searchreplace/searchreplace.htm +++ b/templates/framework/js/vendor/tinymce-jq/plugins/searchreplace/searchreplace.htm @@ -1,100 +1,100 @@ - - - - {#searchreplace_dlg.replace_title} - - - - - - - - -
- - -
-
-
- - - - - - - - - - -
- - - - - - - - - -
- - - - - -
-
-
- -
- - - - - - - - - - - - - - - -
- - - - - - - - - -
- - - - - -
-
-
- -
- -
- - - - -
- - - + + + + {#searchreplace_dlg.replace_title} + + + + + + + + +
+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + +
+ + + + + +
+
+
+ +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + + + + +
+
+
+ +
+ +
+ + + + +
+
+ + diff --git a/engine/lib/external/tinymce-jq/plugins/spellchecker/css/content.css b/templates/framework/js/vendor/tinymce-jq/plugins/spellchecker/css/content.css similarity index 98% rename from engine/lib/external/tinymce-jq/plugins/spellchecker/css/content.css rename to templates/framework/js/vendor/tinymce-jq/plugins/spellchecker/css/content.css index 24efa021..656ce1ee 100644 --- a/engine/lib/external/tinymce-jq/plugins/spellchecker/css/content.css +++ b/templates/framework/js/vendor/tinymce-jq/plugins/spellchecker/css/content.css @@ -1 +1 @@ -.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} +.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} diff --git a/engine/lib/external/tinymce-jq/plugins/spellchecker/editor_plugin.js b/templates/framework/js/vendor/tinymce-jq/plugins/spellchecker/editor_plugin.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/spellchecker/editor_plugin.js rename to templates/framework/js/vendor/tinymce-jq/plugins/spellchecker/editor_plugin.js diff --git a/engine/lib/external/tinymce-jq/plugins/spellchecker/editor_plugin_src.js b/templates/framework/js/vendor/tinymce-jq/plugins/spellchecker/editor_plugin_src.js similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/spellchecker/editor_plugin_src.js rename to templates/framework/js/vendor/tinymce-jq/plugins/spellchecker/editor_plugin_src.js index fb32af43..0d7cc6eb 100644 --- a/engine/lib/external/tinymce-jq/plugins/spellchecker/editor_plugin_src.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/spellchecker/editor_plugin_src.js @@ -1,436 +1,436 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; - - tinymce.create('tinymce.plugins.SpellcheckerPlugin', { - getInfo : function() { - return { - longname : 'Spellchecker', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - init : function(ed, url) { - var t = this, cm; - - t.url = url; - t.editor = ed; - t.rpcUrl = ed.getParam("spellchecker_rpc_url", "{backend}"); - - if (t.rpcUrl == '{backend}') { - // Sniff if the browser supports native spellchecking (Don't know of a better way) - if (tinymce.isIE) - return; - - t.hasSupport = true; - - // Disable the context menu when spellchecking is active - ed.onContextMenu.addToTop(function(ed, e) { - if (t.active) - return false; - }); - } - - // Register commands - ed.addCommand('mceSpellCheck', function() { - if (t.rpcUrl == '{backend}') { - // Enable/disable native spellchecker - t.editor.getBody().spellcheck = t.active = !t.active; - return; - } - - if (!t.active) { - ed.setProgressState(1); - t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { - if (r.length > 0) { - t.active = 1; - t._markWords(r); - ed.setProgressState(0); - ed.nodeChanged(); - } else { - ed.setProgressState(0); - - if (ed.getParam('spellchecker_report_no_misspellings', true)) - ed.windowManager.alert('spellchecker.no_mpell'); - } - }); - } else - t._done(); - }); - - if (ed.settings.content_css !== false) - ed.contentCSS.push(url + '/css/content.css'); - - ed.onClick.add(t._showMenu, t); - ed.onContextMenu.add(t._showMenu, t); - ed.onBeforeGetContent.add(function() { - if (t.active) - t._removeWords(); - }); - - ed.onNodeChange.add(function(ed, cm) { - cm.setActive('spellchecker', t.active); - }); - - ed.onSetContent.add(function() { - t._done(); - }); - - ed.onBeforeGetContent.add(function() { - t._done(); - }); - - ed.onBeforeExecCommand.add(function(ed, cmd) { - if (cmd == 'mceFullScreen') - t._done(); - }); - - // Find selected language - t.languages = {}; - each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) { - if (k.indexOf('+') === 0) { - k = k.substring(1); - t.selectedLang = v; - } - - t.languages[k] = v; - }); - }, - - createControl : function(n, cm) { - var t = this, c, ed = t.editor; - - if (n == 'spellchecker') { - // Use basic button if we use the native spellchecker - if (t.rpcUrl == '{backend}') { - // Create simple toggle button if we have native support - if (t.hasSupport) - c = cm.createButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); - - return c; - } - - c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); - - c.onRenderMenu.add(function(c, m) { - m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - each(t.languages, function(v, k) { - var o = {icon : 1}, mi; - - o.onclick = function() { - if (v == t.selectedLang) { - return; - } - mi.setSelected(1); - t.selectedItem.setSelected(0); - t.selectedItem = mi; - t.selectedLang = v; - }; - - o.title = k; - mi = m.add(o); - mi.setSelected(v == t.selectedLang); - - if (v == t.selectedLang) - t.selectedItem = mi; - }) - }); - - return c; - } - }, - - // Internal functions - - _walk : function(n, f) { - var d = this.editor.getDoc(), w; - - if (d.createTreeWalker) { - w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); - - while ((n = w.nextNode()) != null) - f.call(this, n); - } else - tinymce.walk(n, f, 'childNodes'); - }, - - _getSeparators : function() { - var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}\u201d\u201c'); - - // Build word separator regexp - for (i=0; i elements content is broken after spellchecking. - // Bug #1408: Preceding whitespace characters are removed - // @TODO: I'm not sure that both are still issues on IE9. - if (tinymce.isIE) { - // Enclose mispelled words with temporal tag - v = v.replace(rx, '$1$2'); - // Loop over the content finding mispelled words - while ((pos = v.indexOf('')) != -1) { - // Add text node for the content before the word - txt = v.substring(0, pos); - if (txt.length) { - node = doc.createTextNode(dom.decode(txt)); - elem.appendChild(node); - } - v = v.substring(pos+10); - pos = v.indexOf(''); - txt = v.substring(0, pos); - v = v.substring(pos+11); - // Add span element for the word - elem.appendChild(dom.create('span', {'class' : 'mceItemHiddenSpellWord'}, txt)); - } - // Add text node for the rest of the content - if (v.length) { - node = doc.createTextNode(dom.decode(v)); - elem.appendChild(node); - } - } else { - // Other browsers preserve whitespace characters on innerHTML usage - elem.innerHTML = v.replace(rx, '$1$2'); - } - - // Finally, replace the node with the container - dom.replace(elem, n); - } - }); - - se.moveToBookmark(b); - }, - - _showMenu : function(ed, e) { - var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()), wordSpan = e.target; - - e = 0; // Fixes IE memory leak - - if (!m) { - m = ed.controlManager.createDropMenu('spellcheckermenu', {'class' : 'mceNoIcons'}); - t._menu = m; - } - - if (dom.hasClass(wordSpan, 'mceItemHiddenSpellWord')) { - m.removeAll(); - m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - - t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(wordSpan.innerHTML)], function(r) { - var ignoreRpc; - - m.removeAll(); - - if (r.length > 0) { - m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - each(r, function(v) { - m.add({title : v, onclick : function() { - dom.replace(ed.getDoc().createTextNode(v), wordSpan); - t._checkDone(); - }}); - }); - - m.addSeparator(); - } else - m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - - if (ed.getParam('show_ignore_words', true)) { - ignoreRpc = t.editor.getParam("spellchecker_enable_ignore_rpc", ''); - m.add({ - title : 'spellchecker.ignore_word', - onclick : function() { - var word = wordSpan.innerHTML; - - dom.remove(wordSpan, 1); - t._checkDone(); - - // tell the server if we need to - if (ignoreRpc) { - ed.setProgressState(1); - t._sendRPC('ignoreWord', [t.selectedLang, word], function(r) { - ed.setProgressState(0); - }); - } - } - }); - - m.add({ - title : 'spellchecker.ignore_words', - onclick : function() { - var word = wordSpan.innerHTML; - - t._removeWords(dom.decode(word)); - t._checkDone(); - - // tell the server if we need to - if (ignoreRpc) { - ed.setProgressState(1); - t._sendRPC('ignoreWords', [t.selectedLang, word], function(r) { - ed.setProgressState(0); - }); - } - } - }); - } - - if (t.editor.getParam("spellchecker_enable_learn_rpc")) { - m.add({ - title : 'spellchecker.learn_word', - onclick : function() { - var word = wordSpan.innerHTML; - - dom.remove(wordSpan, 1); - t._checkDone(); - - ed.setProgressState(1); - t._sendRPC('learnWord', [t.selectedLang, word], function(r) { - ed.setProgressState(0); - }); - } - }); - } - - m.update(); - }); - - p1 = DOM.getPos(ed.getContentAreaContainer()); - m.settings.offset_x = p1.x; - m.settings.offset_y = p1.y; - - ed.selection.select(wordSpan); - p1 = dom.getPos(wordSpan); - m.showMenu(p1.x, p1.y + wordSpan.offsetHeight - vp.y); - - return tinymce.dom.Event.cancel(e); - } else - m.hideMenu(); - }, - - _checkDone : function() { - var t = this, ed = t.editor, dom = ed.dom, o; - - each(dom.select('span'), function(n) { - if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { - o = true; - return false; - } - }); - - if (!o) - t._done(); - }, - - _done : function() { - var t = this, la = t.active; - - if (t.active) { - t.active = 0; - t._removeWords(); - - if (t._menu) - t._menu.hideMenu(); - - if (la) - t.editor.nodeChanged(); - } - }, - - _sendRPC : function(m, p, cb) { - var t = this; - - JSONRequest.sendRPC({ - url : t.rpcUrl, - method : m, - params : p, - success : cb, - error : function(e, x) { - t.editor.setProgressState(0); - t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); - } - }); - } - }); - - // Register plugin - tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); -})(); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; + + tinymce.create('tinymce.plugins.SpellcheckerPlugin', { + getInfo : function() { + return { + longname : 'Spellchecker', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + init : function(ed, url) { + var t = this, cm; + + t.url = url; + t.editor = ed; + t.rpcUrl = ed.getParam("spellchecker_rpc_url", "{backend}"); + + if (t.rpcUrl == '{backend}') { + // Sniff if the browser supports native spellchecking (Don't know of a better way) + if (tinymce.isIE) + return; + + t.hasSupport = true; + + // Disable the context menu when spellchecking is active + ed.onContextMenu.addToTop(function(ed, e) { + if (t.active) + return false; + }); + } + + // Register commands + ed.addCommand('mceSpellCheck', function() { + if (t.rpcUrl == '{backend}') { + // Enable/disable native spellchecker + t.editor.getBody().spellcheck = t.active = !t.active; + return; + } + + if (!t.active) { + ed.setProgressState(1); + t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { + if (r.length > 0) { + t.active = 1; + t._markWords(r); + ed.setProgressState(0); + ed.nodeChanged(); + } else { + ed.setProgressState(0); + + if (ed.getParam('spellchecker_report_no_misspellings', true)) + ed.windowManager.alert('spellchecker.no_mpell'); + } + }); + } else + t._done(); + }); + + if (ed.settings.content_css !== false) + ed.contentCSS.push(url + '/css/content.css'); + + ed.onClick.add(t._showMenu, t); + ed.onContextMenu.add(t._showMenu, t); + ed.onBeforeGetContent.add(function() { + if (t.active) + t._removeWords(); + }); + + ed.onNodeChange.add(function(ed, cm) { + cm.setActive('spellchecker', t.active); + }); + + ed.onSetContent.add(function() { + t._done(); + }); + + ed.onBeforeGetContent.add(function() { + t._done(); + }); + + ed.onBeforeExecCommand.add(function(ed, cmd) { + if (cmd == 'mceFullScreen') + t._done(); + }); + + // Find selected language + t.languages = {}; + each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) { + if (k.indexOf('+') === 0) { + k = k.substring(1); + t.selectedLang = v; + } + + t.languages[k] = v; + }); + }, + + createControl : function(n, cm) { + var t = this, c, ed = t.editor; + + if (n == 'spellchecker') { + // Use basic button if we use the native spellchecker + if (t.rpcUrl == '{backend}') { + // Create simple toggle button if we have native support + if (t.hasSupport) + c = cm.createButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); + + return c; + } + + c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); + + c.onRenderMenu.add(function(c, m) { + m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + each(t.languages, function(v, k) { + var o = {icon : 1}, mi; + + o.onclick = function() { + if (v == t.selectedLang) { + return; + } + mi.setSelected(1); + t.selectedItem.setSelected(0); + t.selectedItem = mi; + t.selectedLang = v; + }; + + o.title = k; + mi = m.add(o); + mi.setSelected(v == t.selectedLang); + + if (v == t.selectedLang) + t.selectedItem = mi; + }) + }); + + return c; + } + }, + + // Internal functions + + _walk : function(n, f) { + var d = this.editor.getDoc(), w; + + if (d.createTreeWalker) { + w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); + + while ((n = w.nextNode()) != null) + f.call(this, n); + } else + tinymce.walk(n, f, 'childNodes'); + }, + + _getSeparators : function() { + var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}\u201d\u201c'); + + // Build word separator regexp + for (i=0; i elements content is broken after spellchecking. + // Bug #1408: Preceding whitespace characters are removed + // @TODO: I'm not sure that both are still issues on IE9. + if (tinymce.isIE) { + // Enclose mispelled words with temporal tag + v = v.replace(rx, '$1$2'); + // Loop over the content finding mispelled words + while ((pos = v.indexOf('')) != -1) { + // Add text node for the content before the word + txt = v.substring(0, pos); + if (txt.length) { + node = doc.createTextNode(dom.decode(txt)); + elem.appendChild(node); + } + v = v.substring(pos+10); + pos = v.indexOf(''); + txt = v.substring(0, pos); + v = v.substring(pos+11); + // Add span element for the word + elem.appendChild(dom.create('span', {'class' : 'mceItemHiddenSpellWord'}, txt)); + } + // Add text node for the rest of the content + if (v.length) { + node = doc.createTextNode(dom.decode(v)); + elem.appendChild(node); + } + } else { + // Other browsers preserve whitespace characters on innerHTML usage + elem.innerHTML = v.replace(rx, '$1$2'); + } + + // Finally, replace the node with the container + dom.replace(elem, n); + } + }); + + se.moveToBookmark(b); + }, + + _showMenu : function(ed, e) { + var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()), wordSpan = e.target; + + e = 0; // Fixes IE memory leak + + if (!m) { + m = ed.controlManager.createDropMenu('spellcheckermenu', {'class' : 'mceNoIcons'}); + t._menu = m; + } + + if (dom.hasClass(wordSpan, 'mceItemHiddenSpellWord')) { + m.removeAll(); + m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + + t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(wordSpan.innerHTML)], function(r) { + var ignoreRpc; + + m.removeAll(); + + if (r.length > 0) { + m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + each(r, function(v) { + m.add({title : v, onclick : function() { + dom.replace(ed.getDoc().createTextNode(v), wordSpan); + t._checkDone(); + }}); + }); + + m.addSeparator(); + } else + m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + + if (ed.getParam('show_ignore_words', true)) { + ignoreRpc = t.editor.getParam("spellchecker_enable_ignore_rpc", ''); + m.add({ + title : 'spellchecker.ignore_word', + onclick : function() { + var word = wordSpan.innerHTML; + + dom.remove(wordSpan, 1); + t._checkDone(); + + // tell the server if we need to + if (ignoreRpc) { + ed.setProgressState(1); + t._sendRPC('ignoreWord', [t.selectedLang, word], function(r) { + ed.setProgressState(0); + }); + } + } + }); + + m.add({ + title : 'spellchecker.ignore_words', + onclick : function() { + var word = wordSpan.innerHTML; + + t._removeWords(dom.decode(word)); + t._checkDone(); + + // tell the server if we need to + if (ignoreRpc) { + ed.setProgressState(1); + t._sendRPC('ignoreWords', [t.selectedLang, word], function(r) { + ed.setProgressState(0); + }); + } + } + }); + } + + if (t.editor.getParam("spellchecker_enable_learn_rpc")) { + m.add({ + title : 'spellchecker.learn_word', + onclick : function() { + var word = wordSpan.innerHTML; + + dom.remove(wordSpan, 1); + t._checkDone(); + + ed.setProgressState(1); + t._sendRPC('learnWord', [t.selectedLang, word], function(r) { + ed.setProgressState(0); + }); + } + }); + } + + m.update(); + }); + + p1 = DOM.getPos(ed.getContentAreaContainer()); + m.settings.offset_x = p1.x; + m.settings.offset_y = p1.y; + + ed.selection.select(wordSpan); + p1 = dom.getPos(wordSpan); + m.showMenu(p1.x, p1.y + wordSpan.offsetHeight - vp.y); + + return tinymce.dom.Event.cancel(e); + } else + m.hideMenu(); + }, + + _checkDone : function() { + var t = this, ed = t.editor, dom = ed.dom, o; + + each(dom.select('span'), function(n) { + if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { + o = true; + return false; + } + }); + + if (!o) + t._done(); + }, + + _done : function() { + var t = this, la = t.active; + + if (t.active) { + t.active = 0; + t._removeWords(); + + if (t._menu) + t._menu.hideMenu(); + + if (la) + t.editor.nodeChanged(); + } + }, + + _sendRPC : function(m, p, cb) { + var t = this; + + JSONRequest.sendRPC({ + url : t.rpcUrl, + method : m, + params : p, + success : cb, + error : function(e, x) { + t.editor.setProgressState(0); + t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); + } + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); +})(); diff --git a/engine/lib/external/tinymce-jq/plugins/spellchecker/img/wline.gif b/templates/framework/js/vendor/tinymce-jq/plugins/spellchecker/img/wline.gif similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/spellchecker/img/wline.gif rename to templates/framework/js/vendor/tinymce-jq/plugins/spellchecker/img/wline.gif diff --git a/engine/lib/external/tinymce-jq/plugins/style/css/props.css b/templates/framework/js/vendor/tinymce-jq/plugins/style/css/props.css similarity index 98% rename from engine/lib/external/tinymce-jq/plugins/style/css/props.css rename to templates/framework/js/vendor/tinymce-jq/plugins/style/css/props.css index eb1f2649..5550b093 100644 --- a/engine/lib/external/tinymce-jq/plugins/style/css/props.css +++ b/templates/framework/js/vendor/tinymce-jq/plugins/style/css/props.css @@ -1,13 +1,13 @@ -#text_font {width:250px;} -#text_size {width:70px;} -.mceAddSelectValue {background:#DDD;} -select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;} -#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;} -#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;} -#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;} -.panel_wrapper div.current {padding-top:10px;height:230px;} -.delim {border-left:1px solid gray;} -.tdelim {border-bottom:1px solid gray;} -#block_display {width:145px;} -#list_type {width:115px;} -.disabled {background:#EEE;} +#text_font {width:250px;} +#text_size {width:70px;} +.mceAddSelectValue {background:#DDD;} +select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;} +#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;} +#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;} +#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;} +.panel_wrapper div.current {padding-top:10px;height:230px;} +.delim {border-left:1px solid gray;} +.tdelim {border-bottom:1px solid gray;} +#block_display {width:145px;} +#list_type {width:115px;} +.disabled {background:#EEE;} diff --git a/engine/lib/external/tinymce-jq/plugins/style/editor_plugin.js b/templates/framework/js/vendor/tinymce-jq/plugins/style/editor_plugin.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/style/editor_plugin.js rename to templates/framework/js/vendor/tinymce-jq/plugins/style/editor_plugin.js diff --git a/engine/lib/external/tinymce-jq/plugins/style/editor_plugin_src.js b/templates/framework/js/vendor/tinymce-jq/plugins/style/editor_plugin_src.js similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/style/editor_plugin_src.js rename to templates/framework/js/vendor/tinymce-jq/plugins/style/editor_plugin_src.js index 5f7755f1..c09d5e81 100644 --- a/engine/lib/external/tinymce-jq/plugins/style/editor_plugin_src.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/style/editor_plugin_src.js @@ -1,55 +1,55 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.StylePlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceStyleProps', function() { - ed.windowManager.open({ - file : url + '/props.htm', - width : 480 + parseInt(ed.getLang('style.delta_width', 0)), - height : 320 + parseInt(ed.getLang('style.delta_height', 0)), - inline : 1 - }, { - plugin_url : url, - style_text : ed.selection.getNode().style.cssText - }); - }); - - ed.addCommand('mceSetElementStyle', function(ui, v) { - if (e = ed.selection.getNode()) { - ed.dom.setAttrib(e, 'style', v); - ed.execCommand('mceRepaint'); - } - }); - - ed.onNodeChange.add(function(ed, cm, n) { - cm.setDisabled('styleprops', n.nodeName === 'BODY'); - }); - - // Register buttons - ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'}); - }, - - getInfo : function() { - return { - longname : 'Style', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.StylePlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceStyleProps', function() { + ed.windowManager.open({ + file : url + '/props.htm', + width : 480 + parseInt(ed.getLang('style.delta_width', 0)), + height : 320 + parseInt(ed.getLang('style.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + style_text : ed.selection.getNode().style.cssText + }); + }); + + ed.addCommand('mceSetElementStyle', function(ui, v) { + if (e = ed.selection.getNode()) { + ed.dom.setAttrib(e, 'style', v); + ed.execCommand('mceRepaint'); + } + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setDisabled('styleprops', n.nodeName === 'BODY'); + }); + + // Register buttons + ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'}); + }, + + getInfo : function() { + return { + longname : 'Style', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin); })(); \ No newline at end of file diff --git a/engine/lib/external/tinymce-jq/plugins/style/js/props.js b/templates/framework/js/vendor/tinymce-jq/plugins/style/js/props.js similarity index 97% rename from engine/lib/external/tinymce-jq/plugins/style/js/props.js rename to templates/framework/js/vendor/tinymce-jq/plugins/style/js/props.js index 07a4c3ef..5c82ec6a 100644 --- a/engine/lib/external/tinymce-jq/plugins/style/js/props.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/style/js/props.js @@ -1,650 +1,650 @@ -tinyMCEPopup.requireLangPack(); - -var defaultFonts = "" + - "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + - "Times New Roman, Times, serif=Times New Roman, Times, serif;" + - "Courier New, Courier, mono=Courier New, Courier, mono;" + - "Times New Roman, Times, serif=Times New Roman, Times, serif;" + - "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + - "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + - "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; - -var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; -var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; -var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%"; -var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; -var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; -var defaultTextStyle = "normal;italic;oblique"; -var defaultVariant = "normal;small-caps"; -var defaultLineHeight = "normal"; -var defaultAttachment = "fixed;scroll"; -var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; -var defaultPosH = "left;center;right"; -var defaultPosV = "top;center;bottom"; -var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; -var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none"; -var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; -var defaultBorderWidth = "thin;medium;thick"; -var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; - -function init() { - var ce = document.getElementById('container'), h; - - ce.style.cssText = tinyMCEPopup.getWindowArg('style_text'); - - h = getBrowserHTML('background_image_browser','background_image','image','advimage'); - document.getElementById("background_image_browser").innerHTML = h; - - document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); - document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); - document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); - document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); - document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); - document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); - - fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); - fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); - fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); - fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); - fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); - fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); - fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); - fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); - fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); - - fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); - fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); - - fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); - fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); - fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); - fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); - fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); - fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); - fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); - fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); - fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); - - fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); - fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); - fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); - fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); - fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); - fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); - - fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); - fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); - fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); - fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); - - fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); - fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); - - fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); - fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); - - fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); - - fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); - - TinyMCE_EditableSelects.init(); - setupFormData(); - showDisabledControls(); -} - -function setupFormData() { - var ce = document.getElementById('container'), f = document.forms[0], s, b, i; - - // Setup text fields - - selectByValue(f, 'text_font', ce.style.fontFamily, true, true); - selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); - selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); - selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); - selectByValue(f, 'text_style', ce.style.fontStyle, true, true); - selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); - selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); - selectByValue(f, 'text_case', ce.style.textTransform, true, true); - selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); - f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); - updateColor('text_color_pick', 'text_color'); - f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); - f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); - f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); - f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); - f.text_none.checked = inStr(ce.style.textDecoration, 'none'); - updateTextDecorations(); - - // Setup background fields - - f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); - updateColor('background_color_pick', 'background_color'); - f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); - selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); - selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); - selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); - selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); - selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); - selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); - - // Setup block fields - - selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); - selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); - selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); - selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); - selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); - selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); - f.block_text_indent.value = getNum(ce.style.textIndent); - selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); - selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); - selectByValue(f, 'block_display', ce.style.display, true, true); - - // Setup box fields - - f.box_width.value = getNum(ce.style.width); - selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); - - f.box_height.value = getNum(ce.style.height); - selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); - selectByValue(f, 'box_float', ce.style.cssFloat || ce.style.styleFloat, true, true); - - selectByValue(f, 'box_clear', ce.style.clear, true, true); - - setupBox(f, ce, 'box_padding', 'padding', ''); - setupBox(f, ce, 'box_margin', 'margin', ''); - - // Setup border fields - - setupBox(f, ce, 'border_style', 'border', 'Style'); - setupBox(f, ce, 'border_width', 'border', 'Width'); - setupBox(f, ce, 'border_color', 'border', 'Color'); - - updateColor('border_color_top_pick', 'border_color_top'); - updateColor('border_color_right_pick', 'border_color_right'); - updateColor('border_color_bottom_pick', 'border_color_bottom'); - updateColor('border_color_left_pick', 'border_color_left'); - - f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); - f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); - f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); - f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); - - // Setup list fields - - selectByValue(f, 'list_type', ce.style.listStyleType, true, true); - selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); - f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); - - // Setup box fields - - selectByValue(f, 'positioning_type', ce.style.position, true, true); - selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); - selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); - f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; - - f.positioning_width.value = getNum(ce.style.width); - selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); - - f.positioning_height.value = getNum(ce.style.height); - selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); - - setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); - - s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); - s = s.replace(/,/g, ' '); - - if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { - f.positioning_clip_top.value = getNum(getVal(s, 0)); - selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); - f.positioning_clip_right.value = getNum(getVal(s, 1)); - selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); - f.positioning_clip_bottom.value = getNum(getVal(s, 2)); - selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); - f.positioning_clip_left.value = getNum(getVal(s, 3)); - selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); - } else { - f.positioning_clip_top.value = getNum(getVal(s, 0)); - selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); - f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; - } - -// setupBox(f, ce, '', 'border', 'Color'); -} - -function getMeasurement(s) { - return s.replace(/^([0-9.]+)(.*)$/, "$2"); -} - -function getNum(s) { - if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s)) - return s.replace(/[^0-9.]/g, ''); - - return s; -} - -function inStr(s, n) { - return new RegExp(n, 'gi').test(s); -} - -function getVal(s, i) { - var a = s.split(' '); - - if (a.length > 1) - return a[i]; - - return ""; -} - -function setValue(f, n, v) { - if (f.elements[n].type == "text") - f.elements[n].value = v; - else - selectByValue(f, n, v, true, true); -} - -function setupBox(f, ce, fp, pr, sf, b) { - if (typeof(b) == "undefined") - b = ['Top', 'Right', 'Bottom', 'Left']; - - if (isSame(ce, pr, sf, b)) { - f.elements[fp + "_same"].checked = true; - - setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); - f.elements[fp + "_top"].disabled = false; - - f.elements[fp + "_right"].value = ""; - f.elements[fp + "_right"].disabled = true; - f.elements[fp + "_bottom"].value = ""; - f.elements[fp + "_bottom"].disabled = true; - f.elements[fp + "_left"].value = ""; - f.elements[fp + "_left"].disabled = true; - - if (f.elements[fp + "_top_measurement"]) { - selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); - f.elements[fp + "_left_measurement"].disabled = true; - f.elements[fp + "_bottom_measurement"].disabled = true; - f.elements[fp + "_right_measurement"].disabled = true; - } - } else { - f.elements[fp + "_same"].checked = false; - - setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); - f.elements[fp + "_top"].disabled = false; - - setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); - f.elements[fp + "_right"].disabled = false; - - setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); - f.elements[fp + "_bottom"].disabled = false; - - setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); - f.elements[fp + "_left"].disabled = false; - - if (f.elements[fp + "_top_measurement"]) { - selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); - selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); - selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); - selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); - f.elements[fp + "_left_measurement"].disabled = false; - f.elements[fp + "_bottom_measurement"].disabled = false; - f.elements[fp + "_right_measurement"].disabled = false; - } - } -} - -function isSame(e, pr, sf, b) { - var a = [], i, x; - - if (typeof(b) == "undefined") - b = ['Top', 'Right', 'Bottom', 'Left']; - - if (typeof(sf) == "undefined" || sf == null) - sf = ""; - - a[0] = e.style[pr + b[0] + sf]; - a[1] = e.style[pr + b[1] + sf]; - a[2] = e.style[pr + b[2] + sf]; - a[3] = e.style[pr + b[3] + sf]; - - for (i=0; i 0 ? s.substring(1) : s; - - if (f.text_none.checked) - s = "none"; - - ce.style.textDecoration = s; - - // Build background styles - - ce.style.backgroundColor = f.background_color.value; - ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; - ce.style.backgroundRepeat = f.background_repeat.value; - ce.style.backgroundAttachment = f.background_attachment.value; - - if (f.background_hpos.value != "") { - s = ""; - s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; - s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); - ce.style.backgroundPosition = s; - } - - // Build block styles - - ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); - ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); - ce.style.verticalAlign = f.block_vertical_alignment.value; - ce.style.textAlign = f.block_text_align.value; - ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); - ce.style.whiteSpace = f.block_whitespace.value; - ce.style.display = f.block_display.value; - - // Build box styles - - ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); - ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); - ce.style.styleFloat = f.box_float.value; - ce.style.cssFloat = f.box_float.value; - - ce.style.clear = f.box_clear.value; - - if (!f.box_padding_same.checked) { - ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); - ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); - ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); - ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); - } else - ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); - - if (!f.box_margin_same.checked) { - ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); - ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); - ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); - ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); - } else - ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); - - // Build border styles - - if (!f.border_style_same.checked) { - ce.style.borderTopStyle = f.border_style_top.value; - ce.style.borderRightStyle = f.border_style_right.value; - ce.style.borderBottomStyle = f.border_style_bottom.value; - ce.style.borderLeftStyle = f.border_style_left.value; - } else - ce.style.borderStyle = f.border_style_top.value; - - if (!f.border_width_same.checked) { - ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); - ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); - ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); - ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); - } else - ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); - - if (!f.border_color_same.checked) { - ce.style.borderTopColor = f.border_color_top.value; - ce.style.borderRightColor = f.border_color_right.value; - ce.style.borderBottomColor = f.border_color_bottom.value; - ce.style.borderLeftColor = f.border_color_left.value; - } else - ce.style.borderColor = f.border_color_top.value; - - // Build list styles - - ce.style.listStyleType = f.list_type.value; - ce.style.listStylePosition = f.list_position.value; - ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; - - // Build positioning styles - - ce.style.position = f.positioning_type.value; - ce.style.visibility = f.positioning_visibility.value; - - if (ce.style.width == "") - ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); - - if (ce.style.height == "") - ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); - - ce.style.zIndex = f.positioning_zindex.value; - ce.style.overflow = f.positioning_overflow.value; - - if (!f.positioning_placement_same.checked) { - ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); - ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); - ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); - ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); - } else { - s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); - ce.style.top = s; - ce.style.right = s; - ce.style.bottom = s; - ce.style.left = s; - } - - if (!f.positioning_clip_same.checked) { - s = "rect("; - s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; - s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; - s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; - s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); - s += ")"; - - if (s != "rect(auto auto auto auto)") - ce.style.clip = s; - } else { - s = "rect("; - t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; - s += t + " "; - s += t + " "; - s += t + " "; - s += t + ")"; - - if (s != "rect(auto auto auto auto)") - ce.style.clip = s; - } - - ce.style.cssText = ce.style.cssText; -} - -function isNum(s) { - return new RegExp('[0-9]+', 'g').test(s); -} - -function showDisabledControls() { - var f = document.forms, i, a; - - for (i=0; i 1) { - addSelectValue(f, s, p[0], p[1]); - - if (se) - selectByValue(f, s, p[1]); - } else { - addSelectValue(f, s, p[0], p[0]); - - if (se) - selectByValue(f, s, p[0]); - } - } -} - -function toggleSame(ce, pre) { - var el = document.forms[0].elements, i; - - if (ce.checked) { - el[pre + "_top"].disabled = false; - el[pre + "_right"].disabled = true; - el[pre + "_bottom"].disabled = true; - el[pre + "_left"].disabled = true; - - if (el[pre + "_top_measurement"]) { - el[pre + "_top_measurement"].disabled = false; - el[pre + "_right_measurement"].disabled = true; - el[pre + "_bottom_measurement"].disabled = true; - el[pre + "_left_measurement"].disabled = true; - } - } else { - el[pre + "_top"].disabled = false; - el[pre + "_right"].disabled = false; - el[pre + "_bottom"].disabled = false; - el[pre + "_left"].disabled = false; - - if (el[pre + "_top_measurement"]) { - el[pre + "_top_measurement"].disabled = false; - el[pre + "_right_measurement"].disabled = false; - el[pre + "_bottom_measurement"].disabled = false; - el[pre + "_left_measurement"].disabled = false; - } - } - - showDisabledControls(); -} - -function synch(fr, to) { - var f = document.forms[0]; - - f.elements[to].value = f.elements[fr].value; - - if (f.elements[fr + "_measurement"]) - selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); -} - -function updateTextDecorations(){ - var el = document.forms[0].elements; - - var textDecorations = ["text_underline", "text_overline", "text_linethrough", "text_blink"]; - var noneChecked = el["text_none"].checked; - tinymce.each(textDecorations, function(id) { - el[id].disabled = noneChecked; - if (noneChecked) { - el[id].checked = false; - } - }); -} - -tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); + +var defaultFonts = "" + + "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Courier New, Courier, mono=Courier New, Courier, mono;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + + "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + + "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; + +var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; +var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; +var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%"; +var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; +var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; +var defaultTextStyle = "normal;italic;oblique"; +var defaultVariant = "normal;small-caps"; +var defaultLineHeight = "normal"; +var defaultAttachment = "fixed;scroll"; +var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; +var defaultPosH = "left;center;right"; +var defaultPosV = "top;center;bottom"; +var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; +var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none"; +var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; +var defaultBorderWidth = "thin;medium;thick"; +var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; + +function init() { + var ce = document.getElementById('container'), h; + + ce.style.cssText = tinyMCEPopup.getWindowArg('style_text'); + + h = getBrowserHTML('background_image_browser','background_image','image','advimage'); + document.getElementById("background_image_browser").innerHTML = h; + + document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); + document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); + document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); + document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); + document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); + document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); + + fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); + fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); + fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); + fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); + fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); + fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); + fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); + fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); + fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); + + fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); + fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); + + fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); + fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); + fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); + fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); + fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); + fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); + fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); + + fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); + fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); + fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); + + fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); + + fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); + fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); + + fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); + fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); + + fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); + + fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); + + TinyMCE_EditableSelects.init(); + setupFormData(); + showDisabledControls(); +} + +function setupFormData() { + var ce = document.getElementById('container'), f = document.forms[0], s, b, i; + + // Setup text fields + + selectByValue(f, 'text_font', ce.style.fontFamily, true, true); + selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); + selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); + selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); + selectByValue(f, 'text_style', ce.style.fontStyle, true, true); + selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); + selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); + selectByValue(f, 'text_case', ce.style.textTransform, true, true); + selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); + f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); + updateColor('text_color_pick', 'text_color'); + f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); + f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); + f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); + f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); + f.text_none.checked = inStr(ce.style.textDecoration, 'none'); + updateTextDecorations(); + + // Setup background fields + + f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); + updateColor('background_color_pick', 'background_color'); + f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); + selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); + selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); + selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); + selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); + selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); + + // Setup block fields + + selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); + selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); + selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); + selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); + selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); + selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); + f.block_text_indent.value = getNum(ce.style.textIndent); + selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); + selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); + selectByValue(f, 'block_display', ce.style.display, true, true); + + // Setup box fields + + f.box_width.value = getNum(ce.style.width); + selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); + + f.box_height.value = getNum(ce.style.height); + selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); + selectByValue(f, 'box_float', ce.style.cssFloat || ce.style.styleFloat, true, true); + + selectByValue(f, 'box_clear', ce.style.clear, true, true); + + setupBox(f, ce, 'box_padding', 'padding', ''); + setupBox(f, ce, 'box_margin', 'margin', ''); + + // Setup border fields + + setupBox(f, ce, 'border_style', 'border', 'Style'); + setupBox(f, ce, 'border_width', 'border', 'Width'); + setupBox(f, ce, 'border_color', 'border', 'Color'); + + updateColor('border_color_top_pick', 'border_color_top'); + updateColor('border_color_right_pick', 'border_color_right'); + updateColor('border_color_bottom_pick', 'border_color_bottom'); + updateColor('border_color_left_pick', 'border_color_left'); + + f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); + f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); + f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); + f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); + + // Setup list fields + + selectByValue(f, 'list_type', ce.style.listStyleType, true, true); + selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); + f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + + // Setup box fields + + selectByValue(f, 'positioning_type', ce.style.position, true, true); + selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); + selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); + f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; + + f.positioning_width.value = getNum(ce.style.width); + selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); + + f.positioning_height.value = getNum(ce.style.height); + selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); + + setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); + + s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); + s = s.replace(/,/g, ' '); + + if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = getNum(getVal(s, 1)); + selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); + f.positioning_clip_bottom.value = getNum(getVal(s, 2)); + selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); + f.positioning_clip_left.value = getNum(getVal(s, 3)); + selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); + } else { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; + } + +// setupBox(f, ce, '', 'border', 'Color'); +} + +function getMeasurement(s) { + return s.replace(/^([0-9.]+)(.*)$/, "$2"); +} + +function getNum(s) { + if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s)) + return s.replace(/[^0-9.]/g, ''); + + return s; +} + +function inStr(s, n) { + return new RegExp(n, 'gi').test(s); +} + +function getVal(s, i) { + var a = s.split(' '); + + if (a.length > 1) + return a[i]; + + return ""; +} + +function setValue(f, n, v) { + if (f.elements[n].type == "text") + f.elements[n].value = v; + else + selectByValue(f, n, v, true, true); +} + +function setupBox(f, ce, fp, pr, sf, b) { + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (isSame(ce, pr, sf, b)) { + f.elements[fp + "_same"].checked = true; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + f.elements[fp + "_right"].value = ""; + f.elements[fp + "_right"].disabled = true; + f.elements[fp + "_bottom"].value = ""; + f.elements[fp + "_bottom"].disabled = true; + f.elements[fp + "_left"].value = ""; + f.elements[fp + "_left"].disabled = true; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + f.elements[fp + "_left_measurement"].disabled = true; + f.elements[fp + "_bottom_measurement"].disabled = true; + f.elements[fp + "_right_measurement"].disabled = true; + } + } else { + f.elements[fp + "_same"].checked = false; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); + f.elements[fp + "_right"].disabled = false; + + setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); + f.elements[fp + "_bottom"].disabled = false; + + setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left"].disabled = false; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); + selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); + selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left_measurement"].disabled = false; + f.elements[fp + "_bottom_measurement"].disabled = false; + f.elements[fp + "_right_measurement"].disabled = false; + } + } +} + +function isSame(e, pr, sf, b) { + var a = [], i, x; + + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (typeof(sf) == "undefined" || sf == null) + sf = ""; + + a[0] = e.style[pr + b[0] + sf]; + a[1] = e.style[pr + b[1] + sf]; + a[2] = e.style[pr + b[2] + sf]; + a[3] = e.style[pr + b[3] + sf]; + + for (i=0; i 0 ? s.substring(1) : s; + + if (f.text_none.checked) + s = "none"; + + ce.style.textDecoration = s; + + // Build background styles + + ce.style.backgroundColor = f.background_color.value; + ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; + ce.style.backgroundRepeat = f.background_repeat.value; + ce.style.backgroundAttachment = f.background_attachment.value; + + if (f.background_hpos.value != "") { + s = ""; + s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; + s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); + ce.style.backgroundPosition = s; + } + + // Build block styles + + ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); + ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); + ce.style.verticalAlign = f.block_vertical_alignment.value; + ce.style.textAlign = f.block_text_align.value; + ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); + ce.style.whiteSpace = f.block_whitespace.value; + ce.style.display = f.block_display.value; + + // Build box styles + + ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); + ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); + ce.style.styleFloat = f.box_float.value; + ce.style.cssFloat = f.box_float.value; + + ce.style.clear = f.box_clear.value; + + if (!f.box_padding_same.checked) { + ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); + ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); + ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); + } else + ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + + if (!f.box_margin_same.checked) { + ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); + ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); + ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); + } else + ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + + // Build border styles + + if (!f.border_style_same.checked) { + ce.style.borderTopStyle = f.border_style_top.value; + ce.style.borderRightStyle = f.border_style_right.value; + ce.style.borderBottomStyle = f.border_style_bottom.value; + ce.style.borderLeftStyle = f.border_style_left.value; + } else + ce.style.borderStyle = f.border_style_top.value; + + if (!f.border_width_same.checked) { + ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); + ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); + ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); + } else + ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + + if (!f.border_color_same.checked) { + ce.style.borderTopColor = f.border_color_top.value; + ce.style.borderRightColor = f.border_color_right.value; + ce.style.borderBottomColor = f.border_color_bottom.value; + ce.style.borderLeftColor = f.border_color_left.value; + } else + ce.style.borderColor = f.border_color_top.value; + + // Build list styles + + ce.style.listStyleType = f.list_type.value; + ce.style.listStylePosition = f.list_position.value; + ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; + + // Build positioning styles + + ce.style.position = f.positioning_type.value; + ce.style.visibility = f.positioning_visibility.value; + + if (ce.style.width == "") + ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); + + if (ce.style.height == "") + ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); + + ce.style.zIndex = f.positioning_zindex.value; + ce.style.overflow = f.positioning_overflow.value; + + if (!f.positioning_placement_same.checked) { + ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); + ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); + ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); + } else { + s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.top = s; + ce.style.right = s; + ce.style.bottom = s; + ce.style.left = s; + } + + if (!f.positioning_clip_same.checked) { + s = "rect("; + s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); + s += ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } else { + s = "rect("; + t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; + s += t + " "; + s += t + " "; + s += t + " "; + s += t + ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } + + ce.style.cssText = ce.style.cssText; +} + +function isNum(s) { + return new RegExp('[0-9]+', 'g').test(s); +} + +function showDisabledControls() { + var f = document.forms, i, a; + + for (i=0; i 1) { + addSelectValue(f, s, p[0], p[1]); + + if (se) + selectByValue(f, s, p[1]); + } else { + addSelectValue(f, s, p[0], p[0]); + + if (se) + selectByValue(f, s, p[0]); + } + } +} + +function toggleSame(ce, pre) { + var el = document.forms[0].elements, i; + + if (ce.checked) { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = true; + el[pre + "_bottom"].disabled = true; + el[pre + "_left"].disabled = true; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = true; + el[pre + "_bottom_measurement"].disabled = true; + el[pre + "_left_measurement"].disabled = true; + } + } else { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = false; + el[pre + "_bottom"].disabled = false; + el[pre + "_left"].disabled = false; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = false; + el[pre + "_bottom_measurement"].disabled = false; + el[pre + "_left_measurement"].disabled = false; + } + } + + showDisabledControls(); +} + +function synch(fr, to) { + var f = document.forms[0]; + + f.elements[to].value = f.elements[fr].value; + + if (f.elements[fr + "_measurement"]) + selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); +} + +function updateTextDecorations(){ + var el = document.forms[0].elements; + + var textDecorations = ["text_underline", "text_overline", "text_linethrough", "text_blink"]; + var noneChecked = el["text_none"].checked; + tinymce.each(textDecorations, function(id) { + el[id].disabled = noneChecked; + if (noneChecked) { + el[id].checked = false; + } + }); +} + +tinyMCEPopup.onInit.add(init); diff --git a/engine/lib/external/tinymce-jq/plugins/style/langs/en_dlg.js b/templates/framework/js/vendor/tinymce-jq/plugins/style/langs/en_dlg.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/style/langs/en_dlg.js rename to templates/framework/js/vendor/tinymce-jq/plugins/style/langs/en_dlg.js diff --git a/engine/lib/external/tinymce-jq/plugins/style/langs/ru_dlg.js b/templates/framework/js/vendor/tinymce-jq/plugins/style/langs/ru_dlg.js old mode 100755 new mode 100644 similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/style/langs/ru_dlg.js rename to templates/framework/js/vendor/tinymce-jq/plugins/style/langs/ru_dlg.js diff --git a/engine/lib/external/tinymce-jq/plugins/style/props.htm b/templates/framework/js/vendor/tinymce-jq/plugins/style/props.htm similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/style/props.htm rename to templates/framework/js/vendor/tinymce-jq/plugins/style/props.htm diff --git a/engine/lib/external/tinymce-jq/plugins/tabfocus/editor_plugin.js b/templates/framework/js/vendor/tinymce-jq/plugins/tabfocus/editor_plugin.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/tabfocus/editor_plugin.js rename to templates/framework/js/vendor/tinymce-jq/plugins/tabfocus/editor_plugin.js diff --git a/engine/lib/external/tinymce-jq/plugins/tabfocus/editor_plugin_src.js b/templates/framework/js/vendor/tinymce-jq/plugins/tabfocus/editor_plugin_src.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/tabfocus/editor_plugin_src.js rename to templates/framework/js/vendor/tinymce-jq/plugins/tabfocus/editor_plugin_src.js diff --git a/engine/lib/external/tinymce-jq/plugins/table/cell.htm b/templates/framework/js/vendor/tinymce-jq/plugins/table/cell.htm similarity index 97% rename from engine/lib/external/tinymce-jq/plugins/table/cell.htm rename to templates/framework/js/vendor/tinymce-jq/plugins/table/cell.htm index a72a8d69..2922f7a2 100644 --- a/engine/lib/external/tinymce-jq/plugins/table/cell.htm +++ b/templates/framework/js/vendor/tinymce-jq/plugins/table/cell.htm @@ -1,180 +1,180 @@ - - - - {#table_dlg.cell_title} - - - - - - - - - -
- - -
-
-
- {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - -
- -
-
-
- -
-
- {#table_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- - - - - -
 
-
- - - - - -
 
-
- - - - - -
 
-
-
-
-
- -
-
- -
- - - -
-
- - + + + + {#table_dlg.cell_title} + + + + + + + + + +
+ + +
+
+
+ {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ +
+
+
+ +
+
+ {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + +
 
+
+ + + + + +
 
+
+ + + + + +
 
+
+
+
+
+ +
+
+ +
+ + + +
+
+ + diff --git a/engine/lib/external/tinymce-jq/plugins/table/css/cell.css b/templates/framework/js/vendor/tinymce-jq/plugins/table/css/cell.css similarity index 91% rename from engine/lib/external/tinymce-jq/plugins/table/css/cell.css rename to templates/framework/js/vendor/tinymce-jq/plugins/table/css/cell.css index a067ecdf..a47cc1a1 100644 --- a/engine/lib/external/tinymce-jq/plugins/table/css/cell.css +++ b/templates/framework/js/vendor/tinymce-jq/plugins/table/css/cell.css @@ -1,17 +1,17 @@ -/* CSS file for cell dialog in the table plugin */ - -.panel_wrapper div.current { - height: 200px; -} - -.advfield { - width: 200px; -} - -#action { - margin-bottom: 3px; -} - -#class { - width: 150px; +/* CSS file for cell dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#class { + width: 150px; } \ No newline at end of file diff --git a/engine/lib/external/tinymce-jq/plugins/table/css/row.css b/templates/framework/js/vendor/tinymce-jq/plugins/table/css/row.css similarity index 91% rename from engine/lib/external/tinymce-jq/plugins/table/css/row.css rename to templates/framework/js/vendor/tinymce-jq/plugins/table/css/row.css index 1f7755da..0e397db3 100644 --- a/engine/lib/external/tinymce-jq/plugins/table/css/row.css +++ b/templates/framework/js/vendor/tinymce-jq/plugins/table/css/row.css @@ -1,25 +1,25 @@ -/* CSS file for row dialog in the table plugin */ - -.panel_wrapper div.current { - height: 200px; -} - -.advfield { - width: 200px; -} - -#action { - margin-bottom: 3px; -} - -#rowtype,#align,#valign,#class,#height { - width: 150px; -} - -#height { - width: 50px; -} - -.col2 { - padding-left: 20px; -} +/* CSS file for row dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#rowtype,#align,#valign,#class,#height { + width: 150px; +} + +#height { + width: 50px; +} + +.col2 { + padding-left: 20px; +} diff --git a/engine/lib/external/tinymce-jq/plugins/table/css/table.css b/templates/framework/js/vendor/tinymce-jq/plugins/table/css/table.css similarity index 92% rename from engine/lib/external/tinymce-jq/plugins/table/css/table.css rename to templates/framework/js/vendor/tinymce-jq/plugins/table/css/table.css index d11c3f69..8f107831 100644 --- a/engine/lib/external/tinymce-jq/plugins/table/css/table.css +++ b/templates/framework/js/vendor/tinymce-jq/plugins/table/css/table.css @@ -1,13 +1,13 @@ -/* CSS file for table dialog in the table plugin */ - -.panel_wrapper div.current { - height: 245px; -} - -.advfield { - width: 200px; -} - -#class { - width: 150px; -} +/* CSS file for table dialog in the table plugin */ + +.panel_wrapper div.current { + height: 245px; +} + +.advfield { + width: 200px; +} + +#class { + width: 150px; +} diff --git a/engine/lib/external/tinymce-jq/plugins/table/editor_plugin.js b/templates/framework/js/vendor/tinymce-jq/plugins/table/editor_plugin.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/table/editor_plugin.js rename to templates/framework/js/vendor/tinymce-jq/plugins/table/editor_plugin.js diff --git a/engine/lib/external/tinymce-jq/plugins/table/editor_plugin_src.js b/templates/framework/js/vendor/tinymce-jq/plugins/table/editor_plugin_src.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/table/editor_plugin_src.js rename to templates/framework/js/vendor/tinymce-jq/plugins/table/editor_plugin_src.js diff --git a/engine/lib/external/tinymce-jq/plugins/table/js/cell.js b/templates/framework/js/vendor/tinymce-jq/plugins/table/js/cell.js similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/table/js/cell.js rename to templates/framework/js/vendor/tinymce-jq/plugins/table/js/cell.js index d6f32905..53bdb54b 100644 --- a/engine/lib/external/tinymce-jq/plugins/table/js/cell.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/table/js/cell.js @@ -1,319 +1,319 @@ -tinyMCEPopup.requireLangPack(); - -var ed; - -function init() { - ed = tinyMCEPopup.editor; - tinyMCEPopup.resizeToInnerSize(); - - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') - - var inst = ed; - var tdElm = ed.dom.getParent(ed.selection.getStart(), "td,th"); - var formObj = document.forms[0]; - var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style")); - - // Get table cell data - var celltype = tdElm.nodeName.toLowerCase(); - var align = ed.dom.getAttrib(tdElm, 'align'); - var valign = ed.dom.getAttrib(tdElm, 'valign'); - var width = trimSize(getStyle(tdElm, 'width', 'width')); - var height = trimSize(getStyle(tdElm, 'height', 'height')); - var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); - var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); - var className = ed.dom.getAttrib(tdElm, 'class'); - var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); - var id = ed.dom.getAttrib(tdElm, 'id'); - var lang = ed.dom.getAttrib(tdElm, 'lang'); - var dir = ed.dom.getAttrib(tdElm, 'dir'); - var scope = ed.dom.getAttrib(tdElm, 'scope'); - - // Setup form - addClassesToList('class', 'table_cell_styles'); - TinyMCE_EditableSelects.init(); - - if (!ed.dom.hasClass(tdElm, 'mceSelected')) { - formObj.bordercolor.value = bordercolor; - formObj.bgcolor.value = bgcolor; - formObj.backgroundimage.value = backgroundimage; - formObj.width.value = width; - formObj.height.value = height; - formObj.id.value = id; - formObj.lang.value = lang; - formObj.style.value = ed.dom.serializeStyle(st); - selectByValue(formObj, 'align', align); - selectByValue(formObj, 'valign', valign); - selectByValue(formObj, 'class', className, true, true); - selectByValue(formObj, 'celltype', celltype); - selectByValue(formObj, 'dir', dir); - selectByValue(formObj, 'scope', scope); - - // Resize some elements - if (isVisible('backgroundimagebrowser')) - document.getElementById('backgroundimage').style.width = '180px'; - - updateColor('bordercolor_pick', 'bordercolor'); - updateColor('bgcolor_pick', 'bgcolor'); - } else - tinyMCEPopup.dom.hide('action'); -} - -function updateAction() { - var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; - - if (!AutoValidator.validate(formObj)) { - tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.'); - return false; - } - - tinyMCEPopup.restoreSelection(); - el = ed.selection.getStart(); - tdElm = ed.dom.getParent(el, "td,th"); - trElm = ed.dom.getParent(el, "tr"); - tableElm = ed.dom.getParent(el, "table"); - - // Cell is selected - if (ed.dom.hasClass(tdElm, 'mceSelected')) { - // Update all selected sells - tinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'), function(td) { - updateCell(td); - }); - - ed.addVisual(); - ed.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - tinyMCEPopup.close(); - return; - } - - switch (getSelectValue(formObj, 'action')) { - case "cell": - var celltype = getSelectValue(formObj, 'celltype'); - var scope = getSelectValue(formObj, 'scope'); - - function doUpdate(s) { - if (s) { - updateCell(tdElm); - - ed.addVisual(); - ed.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - tinyMCEPopup.close(); - } - }; - - if (ed.getParam("accessibility_warnings", 1)) { - if (celltype == "th" && scope == "") - tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate); - else - doUpdate(1); - - return; - } - - updateCell(tdElm); - break; - - case "row": - var cell = trElm.firstChild; - - if (cell.nodeName != "TD" && cell.nodeName != "TH") - cell = nextCell(cell); - - do { - cell = updateCell(cell, true); - } while ((cell = nextCell(cell)) != null); - - break; - - case "col": - var curr, col = 0, cell = trElm.firstChild, rows = tableElm.getElementsByTagName("tr"); - - if (cell.nodeName != "TD" && cell.nodeName != "TH") - cell = nextCell(cell); - - do { - if (cell == tdElm) - break; - col += cell.getAttribute("colspan"); - } while ((cell = nextCell(cell)) != null); - - for (var i=0; i 0) { - tinymce.each(tableElm.rows, function(tr) { - var i; - - for (i = 0; i < tr.cells.length; i++) { - if (dom.hasClass(tr.cells[i], 'mceSelected')) { - updateRow(tr, true); - return; - } - } - }); - - inst.addVisual(); - inst.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - tinyMCEPopup.close(); - return; - } - - switch (action) { - case "row": - updateRow(trElm); - break; - - case "all": - var rows = tableElm.getElementsByTagName("tr"); - - for (var i=0; i 0) { + tinymce.each(tableElm.rows, function(tr) { + var i; + + for (i = 0; i < tr.cells.length; i++) { + if (dom.hasClass(tr.cells[i], 'mceSelected')) { + updateRow(tr, true); + return; + } + } + }); + + inst.addVisual(); + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + return; + } + + switch (action) { + case "row": + updateRow(trElm); + break; + + case "all": + var rows = tableElm.getElementsByTagName("tr"); + + for (var i=0; i colLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); - return false; - } else if (rowLimit && rows > rowLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); - return false; - } else if (cellLimit && cols * rows > cellLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); - return false; - } - - // Update table - if (action == "update") { - dom.setAttrib(elm, 'cellPadding', cellpadding, true); - dom.setAttrib(elm, 'cellSpacing', cellspacing, true); - - if (!isCssSize(border)) { - dom.setAttrib(elm, 'border', border); - } else { - dom.setAttrib(elm, 'border', ''); - } - - if (border == '') { - dom.setStyle(elm, 'border-width', ''); - dom.setStyle(elm, 'border', ''); - dom.setAttrib(elm, 'border', ''); - } - - dom.setAttrib(elm, 'align', align); - dom.setAttrib(elm, 'frame', frame); - dom.setAttrib(elm, 'rules', rules); - dom.setAttrib(elm, 'class', className); - dom.setAttrib(elm, 'style', style); - dom.setAttrib(elm, 'id', id); - dom.setAttrib(elm, 'summary', summary); - dom.setAttrib(elm, 'dir', dir); - dom.setAttrib(elm, 'lang', lang); - - capEl = inst.dom.select('caption', elm)[0]; - - if (capEl && !caption) - capEl.parentNode.removeChild(capEl); - - if (!capEl && caption) { - capEl = elm.ownerDocument.createElement('caption'); - - if (!tinymce.isIE) - capEl.innerHTML = '
'; - - elm.insertBefore(capEl, elm.firstChild); - } - - if (width && inst.settings.inline_styles) { - dom.setStyle(elm, 'width', width); - dom.setAttrib(elm, 'width', ''); - } else { - dom.setAttrib(elm, 'width', width, true); - dom.setStyle(elm, 'width', ''); - } - - // Remove these since they are not valid XHTML - dom.setAttrib(elm, 'borderColor', ''); - dom.setAttrib(elm, 'bgColor', ''); - dom.setAttrib(elm, 'background', ''); - - if (height && inst.settings.inline_styles) { - dom.setStyle(elm, 'height', height); - dom.setAttrib(elm, 'height', ''); - } else { - dom.setAttrib(elm, 'height', height, true); - dom.setStyle(elm, 'height', ''); - } - - if (background != '') - elm.style.backgroundImage = "url('" + background + "')"; - else - elm.style.backgroundImage = ''; - -/* if (tinyMCEPopup.getParam("inline_styles")) { - if (width != '') - elm.style.width = getCSSSize(width); - }*/ - - if (bordercolor != "") { - elm.style.borderColor = bordercolor; - elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; - elm.style.borderWidth = cssSize(border); - } else - elm.style.borderColor = ''; - - elm.style.backgroundColor = bgcolor; - elm.style.height = getCSSSize(height); - - inst.addVisual(); - - // Fix for stange MSIE align bug - //elm.outerHTML = elm.outerHTML; - - inst.nodeChanged(); - inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); - - // Repaint if dimensions changed - if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) - inst.execCommand('mceRepaint'); - - tinyMCEPopup.close(); - return true; - } - - // Create new table - html += ''); - - tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { - if (patt) - patt += ','; - - patt += n + ' ._mce_marker'; - }); - - tinymce.each(inst.dom.select(patt), function(n) { - inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); - }); - - dom.setOuterHTML(dom.select('br._mce_marker')[0], html); - } else - inst.execCommand('mceInsertContent', false, html); - - tinymce.each(dom.select('table[data-mce-new]'), function(node) { - // Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document - if (tinymce.isIE && node.nextSibling == null) { - dom.insertAfter(dom.create('p'), node); - } - - var tdorth = dom.select('td,th', node); - try { - // IE9 might fail to do this selection - inst.selection.setCursorLocation(tdorth[0], 0); - } catch (ex) { - // Ignore - } - - dom.setAttrib(node, 'data-mce-new', ''); - }); - - inst.addVisual(); - inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); - - tinyMCEPopup.close(); -} - -function makeAttrib(attrib, value) { - var formObj = document.forms[0]; - var valueElm = formObj.elements[attrib]; - - if (typeof(value) == "undefined" || value == null) { - value = ""; - - if (valueElm) - value = valueElm.value; - } - - if (value == "") - return ""; - - // XML encode it - value = value.replace(/&/g, '&'); - value = value.replace(/\"/g, '"'); - value = value.replace(//g, '>'); - - return ' ' + attrib + '="' + value + '"'; -} - -function init() { - tinyMCEPopup.resizeToInnerSize(); - - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - - var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); - var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; - var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = ""; - var inst = tinyMCEPopup.editor, dom = inst.dom; - var formObj = document.forms[0]; - var elm = dom.getParent(inst.selection.getNode(), "table"); - - action = tinyMCEPopup.getWindowArg('action'); - - if (!action) - action = elm ? "update" : "insert"; - - if (elm && action != "insert") { - var rowsAr = elm.rows; - var cols = 0; - for (var i=0; i cols) - cols = rowsAr[i].cells.length; - - cols = cols; - rows = rowsAr.length; - - st = dom.parseStyle(dom.getAttrib(elm, "style")); - border = trimSize(getStyle(elm, 'border', 'borderWidth')); - cellpadding = dom.getAttrib(elm, 'cellpadding', ""); - cellspacing = dom.getAttrib(elm, 'cellspacing', ""); - width = trimSize(getStyle(elm, 'width', 'width')); - height = trimSize(getStyle(elm, 'height', 'height')); - bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); - bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); - align = dom.getAttrib(elm, 'align', align); - frame = dom.getAttrib(elm, 'frame'); - rules = dom.getAttrib(elm, 'rules'); - className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); - id = dom.getAttrib(elm, 'id'); - summary = dom.getAttrib(elm, 'summary'); - style = dom.serializeStyle(st); - dir = dom.getAttrib(elm, 'dir'); - lang = dom.getAttrib(elm, 'lang'); - background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); - formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; - - orgTableWidth = width; - orgTableHeight = height; - - action = "update"; - formObj.insert.value = inst.getLang('update'); - } - - addClassesToList('class', "table_styles"); - TinyMCE_EditableSelects.init(); - - // Update form - selectByValue(formObj, 'align', align); - selectByValue(formObj, 'tframe', frame); - selectByValue(formObj, 'rules', rules); - selectByValue(formObj, 'class', className, true, true); - formObj.cols.value = cols; - formObj.rows.value = rows; - formObj.border.value = border; - formObj.cellpadding.value = cellpadding; - formObj.cellspacing.value = cellspacing; - formObj.width.value = width; - formObj.height.value = height; - formObj.bordercolor.value = bordercolor; - formObj.bgcolor.value = bgcolor; - formObj.id.value = id; - formObj.summary.value = summary; - formObj.style.value = style; - formObj.dir.value = dir; - formObj.lang.value = lang; - formObj.backgroundimage.value = background; - - updateColor('bordercolor_pick', 'bordercolor'); - updateColor('bgcolor_pick', 'bgcolor'); - - // Resize some elements - if (isVisible('backgroundimagebrowser')) - document.getElementById('backgroundimage').style.width = '180px'; - - // Disable some fields in update mode - if (action == "update") { - formObj.cols.disabled = true; - formObj.rows.disabled = true; - } -} - -function changedSize() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - -/* var width = formObj.width.value; - if (width != "") - st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; - else - st['width'] = "";*/ - - var height = formObj.height.value; - if (height != "") - st['height'] = getCSSSize(height); - else - st['height'] = ""; - - formObj.style.value = dom.serializeStyle(st); -} - -function isCssSize(value) { - return /^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)$/.test(value); -} - -function cssSize(value, def) { - value = tinymce.trim(value || def); - - if (!isCssSize(value)) { - return parseInt(value, 10) + 'px'; - } - - return value; -} - -function changedBackgroundImage() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; - - formObj.style.value = dom.serializeStyle(st); -} - -function changedBorder() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - // Update border width if the element has a color - if (formObj.border.value != "" && (isCssSize(formObj.border.value) || formObj.bordercolor.value != "")) - st['border-width'] = cssSize(formObj.border.value); - else { - if (!formObj.border.value) { - st['border'] = ''; - st['border-width'] = ''; - } - } - - formObj.style.value = dom.serializeStyle(st); -} - -function changedColor() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - st['background-color'] = formObj.bgcolor.value; - - if (formObj.bordercolor.value != "") { - st['border-color'] = formObj.bordercolor.value; - - // Add border-width if it's missing - if (!st['border-width']) - st['border-width'] = cssSize(formObj.border.value, 1); - } - - formObj.style.value = dom.serializeStyle(st); -} - -function changedStyle() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - if (st['background-image']) - formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); - else - formObj.backgroundimage.value = ''; - - if (st['width']) - formObj.width.value = trimSize(st['width']); - - if (st['height']) - formObj.height.value = trimSize(st['height']); - - if (st['background-color']) { - formObj.bgcolor.value = st['background-color']; - updateColor('bgcolor_pick','bgcolor'); - } - - if (st['border-color']) { - formObj.bordercolor.value = st['border-color']; - updateColor('bordercolor_pick','bordercolor'); - } -} - -tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); + +var action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom; + +function insertTable() { + var formObj = document.forms[0]; + var inst = tinyMCEPopup.editor, dom = inst.dom; + var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules; + var html = '', capEl, elm; + var cellLimit, rowLimit, colLimit; + + tinyMCEPopup.restoreSelection(); + + if (!AutoValidator.validate(formObj)) { + tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.'); + return false; + } + + elm = dom.getParent(inst.selection.getNode(), 'table'); + + // Get form data + cols = formObj.elements['cols'].value; + rows = formObj.elements['rows'].value; + border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0; + cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : ""; + cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : ""; + align = getSelectValue(formObj, "align"); + frame = getSelectValue(formObj, "tframe"); + rules = getSelectValue(formObj, "rules"); + width = formObj.elements['width'].value; + height = formObj.elements['height'].value; + bordercolor = formObj.elements['bordercolor'].value; + bgcolor = formObj.elements['bgcolor'].value; + className = getSelectValue(formObj, "class"); + id = formObj.elements['id'].value; + summary = formObj.elements['summary'].value; + style = formObj.elements['style'].value; + dir = formObj.elements['dir'].value; + lang = formObj.elements['lang'].value; + background = formObj.elements['backgroundimage'].value; + caption = formObj.elements['caption'].checked; + + cellLimit = tinyMCEPopup.getParam('table_cell_limit', false); + rowLimit = tinyMCEPopup.getParam('table_row_limit', false); + colLimit = tinyMCEPopup.getParam('table_col_limit', false); + + // Validate table size + if (colLimit && cols > colLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); + return false; + } else if (rowLimit && rows > rowLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); + return false; + } else if (cellLimit && cols * rows > cellLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); + return false; + } + + // Update table + if (action == "update") { + dom.setAttrib(elm, 'cellPadding', cellpadding, true); + dom.setAttrib(elm, 'cellSpacing', cellspacing, true); + + if (!isCssSize(border)) { + dom.setAttrib(elm, 'border', border); + } else { + dom.setAttrib(elm, 'border', ''); + } + + if (border == '') { + dom.setStyle(elm, 'border-width', ''); + dom.setStyle(elm, 'border', ''); + dom.setAttrib(elm, 'border', ''); + } + + dom.setAttrib(elm, 'align', align); + dom.setAttrib(elm, 'frame', frame); + dom.setAttrib(elm, 'rules', rules); + dom.setAttrib(elm, 'class', className); + dom.setAttrib(elm, 'style', style); + dom.setAttrib(elm, 'id', id); + dom.setAttrib(elm, 'summary', summary); + dom.setAttrib(elm, 'dir', dir); + dom.setAttrib(elm, 'lang', lang); + + capEl = inst.dom.select('caption', elm)[0]; + + if (capEl && !caption) + capEl.parentNode.removeChild(capEl); + + if (!capEl && caption) { + capEl = elm.ownerDocument.createElement('caption'); + + if (!tinymce.isIE) + capEl.innerHTML = '
'; + + elm.insertBefore(capEl, elm.firstChild); + } + + if (width && inst.settings.inline_styles) { + dom.setStyle(elm, 'width', width); + dom.setAttrib(elm, 'width', ''); + } else { + dom.setAttrib(elm, 'width', width, true); + dom.setStyle(elm, 'width', ''); + } + + // Remove these since they are not valid XHTML + dom.setAttrib(elm, 'borderColor', ''); + dom.setAttrib(elm, 'bgColor', ''); + dom.setAttrib(elm, 'background', ''); + + if (height && inst.settings.inline_styles) { + dom.setStyle(elm, 'height', height); + dom.setAttrib(elm, 'height', ''); + } else { + dom.setAttrib(elm, 'height', height, true); + dom.setStyle(elm, 'height', ''); + } + + if (background != '') + elm.style.backgroundImage = "url('" + background + "')"; + else + elm.style.backgroundImage = ''; + +/* if (tinyMCEPopup.getParam("inline_styles")) { + if (width != '') + elm.style.width = getCSSSize(width); + }*/ + + if (bordercolor != "") { + elm.style.borderColor = bordercolor; + elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; + elm.style.borderWidth = cssSize(border); + } else + elm.style.borderColor = ''; + + elm.style.backgroundColor = bgcolor; + elm.style.height = getCSSSize(height); + + inst.addVisual(); + + // Fix for stange MSIE align bug + //elm.outerHTML = elm.outerHTML; + + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); + + // Repaint if dimensions changed + if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) + inst.execCommand('mceRepaint'); + + tinyMCEPopup.close(); + return true; + } + + // Create new table + html += ''); + + tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { + if (patt) + patt += ','; + + patt += n + ' ._mce_marker'; + }); + + tinymce.each(inst.dom.select(patt), function(n) { + inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); + }); + + dom.setOuterHTML(dom.select('br._mce_marker')[0], html); + } else + inst.execCommand('mceInsertContent', false, html); + + tinymce.each(dom.select('table[data-mce-new]'), function(node) { + // Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document + if (tinymce.isIE && node.nextSibling == null) { + dom.insertAfter(dom.create('p'), node); + } + + var tdorth = dom.select('td,th', node); + try { + // IE9 might fail to do this selection + inst.selection.setCursorLocation(tdorth[0], 0); + } catch (ex) { + // Ignore + } + + dom.setAttrib(node, 'data-mce-new', ''); + }); + + inst.addVisual(); + inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); + + tinyMCEPopup.close(); +} + +function makeAttrib(attrib, value) { + var formObj = document.forms[0]; + var valueElm = formObj.elements[attrib]; + + if (typeof(value) == "undefined" || value == null) { + value = ""; + + if (valueElm) + value = valueElm.value; + } + + if (value == "") + return ""; + + // XML encode it + value = value.replace(/&/g, '&'); + value = value.replace(/\"/g, '"'); + value = value.replace(//g, '>'); + + return ' ' + attrib + '="' + value + '"'; +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + + var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); + var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; + var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = ""; + var inst = tinyMCEPopup.editor, dom = inst.dom; + var formObj = document.forms[0]; + var elm = dom.getParent(inst.selection.getNode(), "table"); + + action = tinyMCEPopup.getWindowArg('action'); + + if (!action) + action = elm ? "update" : "insert"; + + if (elm && action != "insert") { + var rowsAr = elm.rows; + var cols = 0; + for (var i=0; i cols) + cols = rowsAr[i].cells.length; + + cols = cols; + rows = rowsAr.length; + + st = dom.parseStyle(dom.getAttrib(elm, "style")); + border = trimSize(getStyle(elm, 'border', 'borderWidth')); + cellpadding = dom.getAttrib(elm, 'cellpadding', ""); + cellspacing = dom.getAttrib(elm, 'cellspacing', ""); + width = trimSize(getStyle(elm, 'width', 'width')); + height = trimSize(getStyle(elm, 'height', 'height')); + bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); + bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); + align = dom.getAttrib(elm, 'align', align); + frame = dom.getAttrib(elm, 'frame'); + rules = dom.getAttrib(elm, 'rules'); + className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); + id = dom.getAttrib(elm, 'id'); + summary = dom.getAttrib(elm, 'summary'); + style = dom.serializeStyle(st); + dir = dom.getAttrib(elm, 'dir'); + lang = dom.getAttrib(elm, 'lang'); + background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; + + orgTableWidth = width; + orgTableHeight = height; + + action = "update"; + formObj.insert.value = inst.getLang('update'); + } + + addClassesToList('class', "table_styles"); + TinyMCE_EditableSelects.init(); + + // Update form + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'tframe', frame); + selectByValue(formObj, 'rules', rules); + selectByValue(formObj, 'class', className, true, true); + formObj.cols.value = cols; + formObj.rows.value = rows; + formObj.border.value = border; + formObj.cellpadding.value = cellpadding; + formObj.cellspacing.value = cellspacing; + formObj.width.value = width; + formObj.height.value = height; + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.id.value = id; + formObj.summary.value = summary; + formObj.style.value = style; + formObj.dir.value = dir; + formObj.lang.value = lang; + formObj.backgroundimage.value = background; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + // Disable some fields in update mode + if (action == "update") { + formObj.cols.disabled = true; + formObj.rows.disabled = true; + } +} + +function changedSize() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + +/* var width = formObj.width.value; + if (width != "") + st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; + else + st['width'] = "";*/ + + var height = formObj.height.value; + if (height != "") + st['height'] = getCSSSize(height); + else + st['height'] = ""; + + formObj.style.value = dom.serializeStyle(st); +} + +function isCssSize(value) { + return /^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)$/.test(value); +} + +function cssSize(value, def) { + value = tinymce.trim(value || def); + + if (!isCssSize(value)) { + return parseInt(value, 10) + 'px'; + } + + return value; +} + +function changedBackgroundImage() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedBorder() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + // Update border width if the element has a color + if (formObj.border.value != "" && (isCssSize(formObj.border.value) || formObj.bordercolor.value != "")) + st['border-width'] = cssSize(formObj.border.value); + else { + if (!formObj.border.value) { + st['border'] = ''; + st['border-width'] = ''; + } + } + + formObj.style.value = dom.serializeStyle(st); +} + +function changedColor() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-color'] = formObj.bgcolor.value; + + if (formObj.bordercolor.value != "") { + st['border-color'] = formObj.bordercolor.value; + + // Add border-width if it's missing + if (!st['border-width']) + st['border-width'] = cssSize(formObj.border.value, 1); + } + + formObj.style.value = dom.serializeStyle(st); +} + +function changedStyle() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + if (st['background-image']) + formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + else + formObj.backgroundimage.value = ''; + + if (st['width']) + formObj.width.value = trimSize(st['width']); + + if (st['height']) + formObj.height.value = trimSize(st['height']); + + if (st['background-color']) { + formObj.bgcolor.value = st['background-color']; + updateColor('bgcolor_pick','bgcolor'); + } + + if (st['border-color']) { + formObj.bordercolor.value = st['border-color']; + updateColor('bordercolor_pick','bordercolor'); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/engine/lib/external/tinymce-jq/plugins/table/langs/en_dlg.js b/templates/framework/js/vendor/tinymce-jq/plugins/table/langs/en_dlg.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/table/langs/en_dlg.js rename to templates/framework/js/vendor/tinymce-jq/plugins/table/langs/en_dlg.js diff --git a/engine/lib/external/tinymce-jq/plugins/table/langs/ru_dlg.js b/templates/framework/js/vendor/tinymce-jq/plugins/table/langs/ru_dlg.js old mode 100755 new mode 100644 similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/table/langs/ru_dlg.js rename to templates/framework/js/vendor/tinymce-jq/plugins/table/langs/ru_dlg.js diff --git a/engine/lib/external/tinymce-jq/plugins/table/merge_cells.htm b/templates/framework/js/vendor/tinymce-jq/plugins/table/merge_cells.htm similarity index 97% rename from engine/lib/external/tinymce-jq/plugins/table/merge_cells.htm rename to templates/framework/js/vendor/tinymce-jq/plugins/table/merge_cells.htm index d231090e..788acf68 100644 --- a/engine/lib/external/tinymce-jq/plugins/table/merge_cells.htm +++ b/templates/framework/js/vendor/tinymce-jq/plugins/table/merge_cells.htm @@ -1,32 +1,32 @@ - - - - {#table_dlg.merge_cells_title} - - - - - - -
-
- {#table_dlg.merge_cells_title} - - - - - - - - - -
:
:
-
- -
- - -
-
- - + + + + {#table_dlg.merge_cells_title} + + + + + + +
+
+ {#table_dlg.merge_cells_title} + + + + + + + + + +
:
:
+
+ +
+ + +
+
+ + diff --git a/engine/lib/external/tinymce-jq/plugins/table/row.htm b/templates/framework/js/vendor/tinymce-jq/plugins/table/row.htm similarity index 97% rename from engine/lib/external/tinymce-jq/plugins/table/row.htm rename to templates/framework/js/vendor/tinymce-jq/plugins/table/row.htm index 1885401f..e0b182b8 100644 --- a/engine/lib/external/tinymce-jq/plugins/table/row.htm +++ b/templates/framework/js/vendor/tinymce-jq/plugins/table/row.htm @@ -1,158 +1,158 @@ - - - - {#table_dlg.row_title} - - - - - - - - - -
- - -
-
-
- {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
-
-
- -
-
- {#table_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- - - - - -
 
-
- - - - - - -
 
-
-
-
-
-
- -
-
- -
- - - -
-
- - + + + + {#table_dlg.row_title} + + + + + + + + + +
+ + +
+
+
+ {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+
+
+ +
+
+ {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + +
 
+
+ + + + + + +
 
+
+
+
+
+
+ +
+
+ +
+ + + +
+
+ + diff --git a/engine/lib/external/tinymce-jq/plugins/table/table.htm b/templates/framework/js/vendor/tinymce-jq/plugins/table/table.htm similarity index 97% rename from engine/lib/external/tinymce-jq/plugins/table/table.htm rename to templates/framework/js/vendor/tinymce-jq/plugins/table/table.htm index b92fa741..52e6bf28 100644 --- a/engine/lib/external/tinymce-jq/plugins/table/table.htm +++ b/templates/framework/js/vendor/tinymce-jq/plugins/table/table.htm @@ -1,188 +1,188 @@ - - - - {#table_dlg.title} - - - - - - - - - - -
- - -
-
-
- {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-
- {#table_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - -
 
-
- -
- -
- -
- - - - - -
 
-
- - - - - -
 
-
-
-
-
- -
- - -
-
- - + + + + {#table_dlg.title} + + + + + + + + + + +
+ + +
+
+
+ {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
 
+
+ +
+ +
+ +
+ + + + + +
 
+
+ + + + + +
 
+
+
+
+
+ +
+ + +
+
+ + diff --git a/engine/lib/external/tinymce-jq/plugins/template/blank.htm b/templates/framework/js/vendor/tinymce-jq/plugins/template/blank.htm similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/template/blank.htm rename to templates/framework/js/vendor/tinymce-jq/plugins/template/blank.htm index ecde53fa..538a3b12 100644 --- a/engine/lib/external/tinymce-jq/plugins/template/blank.htm +++ b/templates/framework/js/vendor/tinymce-jq/plugins/template/blank.htm @@ -1,12 +1,12 @@ - - - blank_page - - - - - - - + + + blank_page + + + + + + + diff --git a/engine/lib/external/tinymce-jq/plugins/template/css/template.css b/templates/framework/js/vendor/tinymce-jq/plugins/template/css/template.css similarity index 91% rename from engine/lib/external/tinymce-jq/plugins/template/css/template.css rename to templates/framework/js/vendor/tinymce-jq/plugins/template/css/template.css index 2d23a493..0a03f2e5 100644 --- a/engine/lib/external/tinymce-jq/plugins/template/css/template.css +++ b/templates/framework/js/vendor/tinymce-jq/plugins/template/css/template.css @@ -1,23 +1,23 @@ -#frmbody { - padding: 10px; - background-color: #FFF; - border: 1px solid #CCC; -} - -.frmRow { - margin-bottom: 10px; -} - -#templatesrc { - border: none; - width: 320px; - height: 240px; -} - -.title { - padding-bottom: 5px; -} - -.mceActionPanel { - padding-top: 5px; -} +#frmbody { + padding: 10px; + background-color: #FFF; + border: 1px solid #CCC; +} + +.frmRow { + margin-bottom: 10px; +} + +#templatesrc { + border: none; + width: 320px; + height: 240px; +} + +.title { + padding-bottom: 5px; +} + +.mceActionPanel { + padding-top: 5px; +} diff --git a/engine/lib/external/tinymce-jq/plugins/template/editor_plugin.js b/templates/framework/js/vendor/tinymce-jq/plugins/template/editor_plugin.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/template/editor_plugin.js rename to templates/framework/js/vendor/tinymce-jq/plugins/template/editor_plugin.js diff --git a/engine/lib/external/tinymce-jq/plugins/template/editor_plugin_src.js b/templates/framework/js/vendor/tinymce-jq/plugins/template/editor_plugin_src.js similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/template/editor_plugin_src.js rename to templates/framework/js/vendor/tinymce-jq/plugins/template/editor_plugin_src.js index 9cac2699..28baed21 100644 --- a/engine/lib/external/tinymce-jq/plugins/template/editor_plugin_src.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/template/editor_plugin_src.js @@ -1,159 +1,159 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var each = tinymce.each; - - tinymce.create('tinymce.plugins.TemplatePlugin', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceTemplate', function(ui) { - ed.windowManager.open({ - file : url + '/template.htm', - width : ed.getParam('template_popup_width', 750), - height : ed.getParam('template_popup_height', 600), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceInsertTemplate', t._insertTemplate, t); - - // Register buttons - ed.addButton('template', {title : 'template.desc', cmd : 'mceTemplate'}); - - ed.onPreProcess.add(function(ed, o) { - var dom = ed.dom; - - each(dom.select('div', o.node), function(e) { - if (dom.hasClass(e, 'mceTmpl')) { - each(dom.select('*', e), function(e) { - if (dom.hasClass(e, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) - e.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); - }); - - t._replaceVals(e); - } - }); - }); - }, - - getInfo : function() { - return { - longname : 'Template plugin', - author : 'Moxiecode Systems AB', - authorurl : 'http://www.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - _insertTemplate : function(ui, v) { - var t = this, ed = t.editor, h, el, dom = ed.dom, sel = ed.selection.getContent(); - - h = v.content; - - each(t.editor.getParam('template_replace_values'), function(v, k) { - if (typeof(v) != 'function') - h = h.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v); - }); - - el = dom.create('div', null, h); - - // Find template element within div - n = dom.select('.mceTmpl', el); - if (n && n.length > 0) { - el = dom.create('div', null); - el.appendChild(n[0].cloneNode(true)); - } - - function hasClass(n, c) { - return new RegExp('\\b' + c + '\\b', 'g').test(n.className); - }; - - each(dom.select('*', el), function(n) { - // Replace cdate - if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) - n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); - - // Replace mdate - if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) - n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); - - // Replace selection - if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) - n.innerHTML = sel; - }); - - t._replaceVals(el); - - ed.execCommand('mceInsertContent', false, el.innerHTML); - ed.addVisual(); - }, - - _replaceVals : function(e) { - var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); - - each(dom.select('*', e), function(e) { - each(vl, function(v, k) { - if (dom.hasClass(e, k)) { - if (typeof(vl[k]) == 'function') - vl[k](e); - } - }); - }); - }, - - _getDateTime : function(d, fmt) { - if (!fmt) - return ""; - - function addZeros(value, len) { - var i; - - value = "" + value; - - if (value.length < len) { - for (i=0; i<(len-value.length); i++) - value = "0" + value; - } - - return value; - } - - fmt = fmt.replace("%D", "%m/%d/%y"); - fmt = fmt.replace("%r", "%I:%M:%S %p"); - fmt = fmt.replace("%Y", "" + d.getFullYear()); - fmt = fmt.replace("%y", "" + d.getYear()); - fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); - fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); - fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); - fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); - fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); - fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); - fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); - fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]); - fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]); - fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]); - fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]); - fmt = fmt.replace("%%", "%"); - - return fmt; - } - }); - - // Register plugin - tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var each = tinymce.each; + + tinymce.create('tinymce.plugins.TemplatePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceTemplate', function(ui) { + ed.windowManager.open({ + file : url + '/template.htm', + width : ed.getParam('template_popup_width', 750), + height : ed.getParam('template_popup_height', 600), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceInsertTemplate', t._insertTemplate, t); + + // Register buttons + ed.addButton('template', {title : 'template.desc', cmd : 'mceTemplate'}); + + ed.onPreProcess.add(function(ed, o) { + var dom = ed.dom; + + each(dom.select('div', o.node), function(e) { + if (dom.hasClass(e, 'mceTmpl')) { + each(dom.select('*', e), function(e) { + if (dom.hasClass(e, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) + e.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); + }); + + t._replaceVals(e); + } + }); + }); + }, + + getInfo : function() { + return { + longname : 'Template plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://www.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + _insertTemplate : function(ui, v) { + var t = this, ed = t.editor, h, el, dom = ed.dom, sel = ed.selection.getContent(); + + h = v.content; + + each(t.editor.getParam('template_replace_values'), function(v, k) { + if (typeof(v) != 'function') + h = h.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v); + }); + + el = dom.create('div', null, h); + + // Find template element within div + n = dom.select('.mceTmpl', el); + if (n && n.length > 0) { + el = dom.create('div', null); + el.appendChild(n[0].cloneNode(true)); + } + + function hasClass(n, c) { + return new RegExp('\\b' + c + '\\b', 'g').test(n.className); + }; + + each(dom.select('*', el), function(n) { + // Replace cdate + if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); + + // Replace mdate + if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); + + // Replace selection + if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) + n.innerHTML = sel; + }); + + t._replaceVals(el); + + ed.execCommand('mceInsertContent', false, el.innerHTML); + ed.addVisual(); + }, + + _replaceVals : function(e) { + var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); + + each(dom.select('*', e), function(e) { + each(vl, function(v, k) { + if (dom.hasClass(e, k)) { + if (typeof(vl[k]) == 'function') + vl[k](e); + } + }); + }); + }, + + _getDateTime : function(d, fmt) { + if (!fmt) + return ""; + + function addZeros(value, len) { + var i; + + value = "" + value; + + if (value.length < len) { + for (i=0; i<(len-value.length); i++) + value = "0" + value; + } + + return value; + } + + fmt = fmt.replace("%D", "%m/%d/%y"); + fmt = fmt.replace("%r", "%I:%M:%S %p"); + fmt = fmt.replace("%Y", "" + d.getFullYear()); + fmt = fmt.replace("%y", "" + d.getYear()); + fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); + fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); + fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); + fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); + fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); + fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); + fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); + fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]); + fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]); + fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]); + fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]); + fmt = fmt.replace("%%", "%"); + + return fmt; + } + }); + + // Register plugin + tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); })(); \ No newline at end of file diff --git a/engine/lib/external/tinymce-jq/plugins/template/js/template.js b/templates/framework/js/vendor/tinymce-jq/plugins/template/js/template.js similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/template/js/template.js rename to templates/framework/js/vendor/tinymce-jq/plugins/template/js/template.js index bc3045d2..673395a9 100644 --- a/engine/lib/external/tinymce-jq/plugins/template/js/template.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/template/js/template.js @@ -1,106 +1,106 @@ -tinyMCEPopup.requireLangPack(); - -var TemplateDialog = { - preInit : function() { - var url = tinyMCEPopup.getParam("template_external_list_url"); - - if (url != null) - document.write(''); - }, - - init : function() { - var ed = tinyMCEPopup.editor, tsrc, sel, x, u; - - tsrc = ed.getParam("template_templates", false); - sel = document.getElementById('tpath'); - - // Setup external template list - if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { - for (x=0, tsrc = []; x'); - }); - }, - - selectTemplate : function(u, ti) { - var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; - - if (!u) - return; - - d.body.innerHTML = this.templateHTML = this.getFileContents(u); - - for (x=0; x'); + }, + + init : function() { + var ed = tinyMCEPopup.editor, tsrc, sel, x, u; + + tsrc = ed.getParam("template_templates", false); + sel = document.getElementById('tpath'); + + // Setup external template list + if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { + for (x=0, tsrc = []; x'); + }); + }, + + selectTemplate : function(u, ti) { + var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; + + if (!u) + return; + + d.body.innerHTML = this.templateHTML = this.getFileContents(u); + + for (x=0; x - - {#template_dlg.title} - - - - - -
-
-
{#template_dlg.desc}
-
- -
-
-
-
- {#template_dlg.preview} - -
-
- -
- - -
-
- - + + + {#template_dlg.title} + + + + + +
+
+
{#template_dlg.desc}
+
+ +
+
+
+
+ {#template_dlg.preview} + +
+
+ +
+ + +
+
+ + diff --git a/engine/lib/external/tinymce-jq/plugins/visualchars/editor_plugin.js b/templates/framework/js/vendor/tinymce-jq/plugins/visualchars/editor_plugin.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/visualchars/editor_plugin.js rename to templates/framework/js/vendor/tinymce-jq/plugins/visualchars/editor_plugin.js diff --git a/engine/lib/external/tinymce-jq/plugins/visualchars/editor_plugin_src.js b/templates/framework/js/vendor/tinymce-jq/plugins/visualchars/editor_plugin_src.js similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/visualchars/editor_plugin_src.js rename to templates/framework/js/vendor/tinymce-jq/plugins/visualchars/editor_plugin_src.js index df985905..0e3572e6 100644 --- a/engine/lib/external/tinymce-jq/plugins/visualchars/editor_plugin_src.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/visualchars/editor_plugin_src.js @@ -1,83 +1,83 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.VisualChars', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceVisualChars', t._toggleVisualChars, t); - - // Register buttons - ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'}); - - ed.onBeforeGetContent.add(function(ed, o) { - if (t.state && o.format != 'raw' && !o.draft) { - t.state = true; - t._toggleVisualChars(false); - } - }); - }, - - getInfo : function() { - return { - longname : 'Visual characters', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _toggleVisualChars : function(bookmark) { - var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo, div, bm; - - t.state = !t.state; - ed.controlManager.setActive('visualchars', t.state); - - if (bookmark) - bm = s.getBookmark(); - - if (t.state) { - nl = []; - tinymce.walk(b, function(n) { - if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1) - nl.push(n); - }, 'childNodes'); - - for (i = 0; i < nl.length; i++) { - nv = nl[i].nodeValue; - nv = nv.replace(/(\u00a0)/g, '$1'); - - div = ed.dom.create('div', null, nv); - while (node = div.lastChild) - ed.dom.insertAfter(node, nl[i]); - - ed.dom.remove(nl[i]); - } - } else { - nl = ed.dom.select('span.mceItemNbsp', b); - - for (i = nl.length - 1; i >= 0; i--) - ed.dom.remove(nl[i], 1); - } - - s.moveToBookmark(bm); - } - }); - - // Register plugin - tinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.VisualChars', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceVisualChars', t._toggleVisualChars, t); + + // Register buttons + ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'}); + + ed.onBeforeGetContent.add(function(ed, o) { + if (t.state && o.format != 'raw' && !o.draft) { + t.state = true; + t._toggleVisualChars(false); + } + }); + }, + + getInfo : function() { + return { + longname : 'Visual characters', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private methods + + _toggleVisualChars : function(bookmark) { + var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo, div, bm; + + t.state = !t.state; + ed.controlManager.setActive('visualchars', t.state); + + if (bookmark) + bm = s.getBookmark(); + + if (t.state) { + nl = []; + tinymce.walk(b, function(n) { + if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1) + nl.push(n); + }, 'childNodes'); + + for (i = 0; i < nl.length; i++) { + nv = nl[i].nodeValue; + nv = nv.replace(/(\u00a0)/g, '$1'); + + div = ed.dom.create('div', null, nv); + while (node = div.lastChild) + ed.dom.insertAfter(node, nl[i]); + + ed.dom.remove(nl[i]); + } + } else { + nl = ed.dom.select('span.mceItemNbsp', b); + + for (i = nl.length - 1; i >= 0; i--) + ed.dom.remove(nl[i], 1); + } + + s.moveToBookmark(bm); + } + }); + + // Register plugin + tinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars); })(); \ No newline at end of file diff --git a/engine/lib/external/tinymce-jq/plugins/wordcount/editor_plugin.js b/templates/framework/js/vendor/tinymce-jq/plugins/wordcount/editor_plugin.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/wordcount/editor_plugin.js rename to templates/framework/js/vendor/tinymce-jq/plugins/wordcount/editor_plugin.js diff --git a/engine/lib/external/tinymce-jq/plugins/wordcount/editor_plugin_src.js b/templates/framework/js/vendor/tinymce-jq/plugins/wordcount/editor_plugin_src.js similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/wordcount/editor_plugin_src.js rename to templates/framework/js/vendor/tinymce-jq/plugins/wordcount/editor_plugin_src.js index 34b26555..3fb8fffa 100644 --- a/engine/lib/external/tinymce-jq/plugins/wordcount/editor_plugin_src.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/wordcount/editor_plugin_src.js @@ -1,122 +1,122 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.WordCount', { - block : 0, - id : null, - countre : null, - cleanre : null, - - init : function(ed, url) { - var t = this, last = 0, VK = tinymce.VK; - - t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == ’ - t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g); - t.update_rate = ed.getParam('wordcount_update_rate', 2000); - t.update_on_delete = ed.getParam('wordcount_update_on_delete', false); - t.id = ed.id + '-word-count'; - - ed.onPostRender.add(function(ed, cm) { - var row, id; - - // Add it to the specified id or the theme advanced path - id = ed.getParam('wordcount_target_id'); - if (!id) { - row = tinymce.DOM.get(ed.id + '_path_row'); - - if (row) - tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '0'); - } else { - tinymce.DOM.add(id, 'span', {}, '0'); - } - }); - - ed.onInit.add(function(ed) { - ed.selection.onSetContent.add(function() { - t._count(ed); - }); - - t._count(ed); - }); - - ed.onSetContent.add(function(ed) { - t._count(ed); - }); - - function checkKeys(key) { - return key !== last && (key === VK.ENTER || last === VK.SPACEBAR || checkDelOrBksp(last)); - } - - function checkDelOrBksp(key) { - return key === VK.DELETE || key === VK.BACKSPACE; - } - - ed.onKeyUp.add(function(ed, e) { - if (checkKeys(e.keyCode) || t.update_on_delete && checkDelOrBksp(e.keyCode)) { - t._count(ed); - } - - last = e.keyCode; - }); - }, - - _getCount : function(ed) { - var tc = 0; - var tx = ed.getContent({ format: 'raw' }); - - if (tx) { - tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces - tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars - - // deal with html entities - tx = tx.replace(/(\w+)(&.+?;)+(\w+)/, "$1$3").replace(/&.+?;/g, ' '); - tx = tx.replace(this.cleanre, ''); // remove numbers and punctuation - - var wordArray = tx.match(this.countre); - if (wordArray) { - tc = wordArray.length; - } - } - - return tc; - }, - - _count : function(ed) { - var t = this; - - // Keep multiple calls from happening at the same time - if (t.block) - return; - - t.block = 1; - - setTimeout(function() { - if (!ed.destroyed) { - var tc = t._getCount(ed); - tinymce.DOM.setHTML(t.id, tc.toString()); - setTimeout(function() {t.block = 0;}, t.update_rate); - } - }, 1); - }, - - getInfo: function() { - return { - longname : 'Word Count plugin', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount); -})(); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.WordCount', { + block : 0, + id : null, + countre : null, + cleanre : null, + + init : function(ed, url) { + var t = this, last = 0, VK = tinymce.VK; + + t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == ’ + t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g); + t.update_rate = ed.getParam('wordcount_update_rate', 2000); + t.update_on_delete = ed.getParam('wordcount_update_on_delete', false); + t.id = ed.id + '-word-count'; + + ed.onPostRender.add(function(ed, cm) { + var row, id; + + // Add it to the specified id or the theme advanced path + id = ed.getParam('wordcount_target_id'); + if (!id) { + row = tinymce.DOM.get(ed.id + '_path_row'); + + if (row) + tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '0'); + } else { + tinymce.DOM.add(id, 'span', {}, '0'); + } + }); + + ed.onInit.add(function(ed) { + ed.selection.onSetContent.add(function() { + t._count(ed); + }); + + t._count(ed); + }); + + ed.onSetContent.add(function(ed) { + t._count(ed); + }); + + function checkKeys(key) { + return key !== last && (key === VK.ENTER || last === VK.SPACEBAR || checkDelOrBksp(last)); + } + + function checkDelOrBksp(key) { + return key === VK.DELETE || key === VK.BACKSPACE; + } + + ed.onKeyUp.add(function(ed, e) { + if (checkKeys(e.keyCode) || t.update_on_delete && checkDelOrBksp(e.keyCode)) { + t._count(ed); + } + + last = e.keyCode; + }); + }, + + _getCount : function(ed) { + var tc = 0; + var tx = ed.getContent({ format: 'raw' }); + + if (tx) { + tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces + tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars + + // deal with html entities + tx = tx.replace(/(\w+)(&.+?;)+(\w+)/, "$1$3").replace(/&.+?;/g, ' '); + tx = tx.replace(this.cleanre, ''); // remove numbers and punctuation + + var wordArray = tx.match(this.countre); + if (wordArray) { + tc = wordArray.length; + } + } + + return tc; + }, + + _count : function(ed) { + var t = this; + + // Keep multiple calls from happening at the same time + if (t.block) + return; + + t.block = 1; + + setTimeout(function() { + if (!ed.destroyed) { + var tc = t._getCount(ed); + tinymce.DOM.setHTML(t.id, tc.toString()); + setTimeout(function() {t.block = 0;}, t.update_rate); + } + }, 1); + }, + + getInfo: function() { + return { + longname : 'Word Count plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount); +})(); diff --git a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/abbr.htm b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/abbr.htm similarity index 97% rename from engine/lib/external/tinymce-jq/plugins/xhtmlxtras/abbr.htm rename to templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/abbr.htm index 30a894f7..d4102180 100644 --- a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/abbr.htm +++ b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/abbr.htm @@ -1,142 +1,142 @@ - - - - {#xhtmlxtras_dlg.title_abbr_element} - - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
: - -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - - -
-
- - + + + + {#xhtmlxtras_dlg.title_abbr_element} + + + + + + + + + + +
+ + +
+
+
+ {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
:
:
: + +
:
: + +
: + +
+
+
+
+
+ {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
:
:
:
:
:
:
:
:
:
:
:
:
+
+
+
+
+ + + +
+
+ + diff --git a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/acronym.htm b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/acronym.htm similarity index 97% rename from engine/lib/external/tinymce-jq/plugins/xhtmlxtras/acronym.htm rename to templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/acronym.htm index c1093459..12b189b4 100644 --- a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/acronym.htm +++ b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/acronym.htm @@ -1,142 +1,142 @@ - - - - {#xhtmlxtras_dlg.title_acronym_element} - - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
: - -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - - -
-
- - + + + + {#xhtmlxtras_dlg.title_acronym_element} + + + + + + + + + + +
+ + +
+
+
+ {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
:
:
: + +
:
: + +
: + +
+
+
+
+
+ {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
:
:
:
:
:
:
:
:
:
:
:
:
+
+
+
+
+ + + +
+
+ + diff --git a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/attributes.htm b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/attributes.htm similarity index 97% rename from engine/lib/external/tinymce-jq/plugins/xhtmlxtras/attributes.htm rename to templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/attributes.htm index e8d606a3..d84f378b 100644 --- a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/attributes.htm +++ b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/attributes.htm @@ -1,149 +1,149 @@ - - - - {#xhtmlxtras_dlg.attribs_title} - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.attribute_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
- -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.attribute_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - -
-
- - + + + + {#xhtmlxtras_dlg.attribs_title} + + + + + + + + + +
+ + +
+
+
+ {#xhtmlxtras_dlg.attribute_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
:
:
+ +
:
: + +
: + +
+
+
+
+
+ {#xhtmlxtras_dlg.attribute_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
:
:
:
:
:
:
:
:
:
:
:
:
+
+
+
+
+ + +
+
+ + diff --git a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/cite.htm b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/cite.htm similarity index 97% rename from engine/lib/external/tinymce-jq/plugins/xhtmlxtras/cite.htm rename to templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/cite.htm index 0ac6bdb6..ab61b330 100644 --- a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/cite.htm +++ b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/cite.htm @@ -1,142 +1,142 @@ - - - - {#xhtmlxtras_dlg.title_cite_element} - - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
: - -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - - -
-
- - + + + + {#xhtmlxtras_dlg.title_cite_element} + + + + + + + + + + +
+ + +
+
+
+ {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
:
:
: + +
:
: + +
: + +
+
+
+
+
+ {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
:
:
:
:
:
:
:
:
:
:
:
:
+
+
+
+
+ + + +
+
+ + diff --git a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/css/attributes.css b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/css/attributes.css similarity index 94% rename from engine/lib/external/tinymce-jq/plugins/xhtmlxtras/css/attributes.css rename to templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/css/attributes.css index 9a6a235c..85b1b376 100644 --- a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/css/attributes.css +++ b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/css/attributes.css @@ -1,11 +1,11 @@ -.panel_wrapper div.current { - height: 290px; -} - -#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey { - width: 200px; -} - -#events_panel input { - width: 200px; -} +.panel_wrapper div.current { + height: 290px; +} + +#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey { + width: 200px; +} + +#events_panel input { + width: 200px; +} diff --git a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/css/popup.css b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/css/popup.css similarity index 98% rename from engine/lib/external/tinymce-jq/plugins/xhtmlxtras/css/popup.css rename to templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/css/popup.css index e67114db..034b9852 100644 --- a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/css/popup.css +++ b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/css/popup.css @@ -1,9 +1,9 @@ -input.field, select.field {width:200px;} -input.picker {width:179px; margin-left: 5px;} -input.disabled {border-color:#F2F2F2;} -img.picker {vertical-align:text-bottom; cursor:pointer;} -h1 {padding: 0 0 5px 0;} -.panel_wrapper div.current {height:160px;} -#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;} -a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;} -#datetime {width:180px;} +input.field, select.field {width:200px;} +input.picker {width:179px; margin-left: 5px;} +input.disabled {border-color:#F2F2F2;} +img.picker {vertical-align:text-bottom; cursor:pointer;} +h1 {padding: 0 0 5px 0;} +.panel_wrapper div.current {height:160px;} +#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;} +a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;} +#datetime {width:180px;} diff --git a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/del.htm b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/del.htm similarity index 97% rename from engine/lib/external/tinymce-jq/plugins/xhtmlxtras/del.htm rename to templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/del.htm index 5f667510..e3f34c7d 100644 --- a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/del.htm +++ b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/del.htm @@ -1,162 +1,162 @@ - - - - {#xhtmlxtras_dlg.title_del_element} - - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.fieldset_general_tab} - - - - - - - - - -
: - - - - - -
-
:
-
-
- {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
: - -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - - -
-
- - + + + + {#xhtmlxtras_dlg.title_del_element} + + + + + + + + + + +
+ + +
+
+
+ {#xhtmlxtras_dlg.fieldset_general_tab} + + + + + + + + + +
: + + + + + +
+
:
+
+
+ {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
:
:
: + +
:
: + +
: + +
+
+
+
+
+ {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
:
:
:
:
:
:
:
:
:
:
:
:
+
+
+
+
+ + + +
+
+ + diff --git a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/editor_plugin.js b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/editor_plugin.js similarity index 100% rename from engine/lib/external/tinymce-jq/plugins/xhtmlxtras/editor_plugin.js rename to templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/editor_plugin.js diff --git a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/editor_plugin_src.js b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/editor_plugin_src.js similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/xhtmlxtras/editor_plugin_src.js rename to templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/editor_plugin_src.js index f2405721..a9c12ef3 100644 --- a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/editor_plugin_src.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/editor_plugin_src.js @@ -1,132 +1,132 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceCite', function() { - ed.windowManager.open({ - file : url + '/cite.htm', - width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)), - height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceAcronym', function() { - ed.windowManager.open({ - file : url + '/acronym.htm', - width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), - height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceAbbr', function() { - ed.windowManager.open({ - file : url + '/abbr.htm', - width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), - height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceDel', function() { - ed.windowManager.open({ - file : url + '/del.htm', - width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), - height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceIns', function() { - ed.windowManager.open({ - file : url + '/ins.htm', - width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), - height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceAttributes', function() { - ed.windowManager.open({ - file : url + '/attributes.htm', - width : 380 + parseInt(ed.getLang('xhtmlxtras.attr_delta_width', 0)), - height : 370 + parseInt(ed.getLang('xhtmlxtras.attr_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'}); - ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'}); - ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'}); - ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'}); - ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'}); - ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'}); - - ed.onNodeChange.add(function(ed, cm, n, co) { - n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS'); - - cm.setDisabled('cite', co); - cm.setDisabled('acronym', co); - cm.setDisabled('abbr', co); - cm.setDisabled('del', co); - cm.setDisabled('ins', co); - cm.setDisabled('attribs', n && n.nodeName == 'BODY'); - cm.setActive('cite', 0); - cm.setActive('acronym', 0); - cm.setActive('abbr', 0); - cm.setActive('del', 0); - cm.setActive('ins', 0); - - // Activate all - if (n) { - do { - cm.setDisabled(n.nodeName.toLowerCase(), 0); - cm.setActive(n.nodeName.toLowerCase(), 1); - } while (n = n.parentNode); - } - }); - - ed.onPreInit.add(function() { - // Fixed IE issue where it can't handle these elements correctly - ed.dom.create('abbr'); - }); - }, - - getInfo : function() { - return { - longname : 'XHTML Xtras Plugin', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin); +/** + * editor_plugin_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceCite', function() { + ed.windowManager.open({ + file : url + '/cite.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAcronym', function() { + ed.windowManager.open({ + file : url + '/acronym.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAbbr', function() { + ed.windowManager.open({ + file : url + '/abbr.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceDel', function() { + ed.windowManager.open({ + file : url + '/del.htm', + width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceIns', function() { + ed.windowManager.open({ + file : url + '/ins.htm', + width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAttributes', function() { + ed.windowManager.open({ + file : url + '/attributes.htm', + width : 380 + parseInt(ed.getLang('xhtmlxtras.attr_delta_width', 0)), + height : 370 + parseInt(ed.getLang('xhtmlxtras.attr_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'}); + ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'}); + ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'}); + ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'}); + ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'}); + ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'}); + + ed.onNodeChange.add(function(ed, cm, n, co) { + n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS'); + + cm.setDisabled('cite', co); + cm.setDisabled('acronym', co); + cm.setDisabled('abbr', co); + cm.setDisabled('del', co); + cm.setDisabled('ins', co); + cm.setDisabled('attribs', n && n.nodeName == 'BODY'); + cm.setActive('cite', 0); + cm.setActive('acronym', 0); + cm.setActive('abbr', 0); + cm.setActive('del', 0); + cm.setActive('ins', 0); + + // Activate all + if (n) { + do { + cm.setDisabled(n.nodeName.toLowerCase(), 0); + cm.setActive(n.nodeName.toLowerCase(), 1); + } while (n = n.parentNode); + } + }); + + ed.onPreInit.add(function() { + // Fixed IE issue where it can't handle these elements correctly + ed.dom.create('abbr'); + }); + }, + + getInfo : function() { + return { + longname : 'XHTML Xtras Plugin', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin); })(); \ No newline at end of file diff --git a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/ins.htm b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/ins.htm similarity index 97% rename from engine/lib/external/tinymce-jq/plugins/xhtmlxtras/ins.htm rename to templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/ins.htm index d001ac7c..226e6053 100644 --- a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/ins.htm +++ b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/ins.htm @@ -1,162 +1,162 @@ - - - - {#xhtmlxtras_dlg.title_ins_element} - - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.fieldset_general_tab} - - - - - - - - - -
: - - - - - -
-
:
-
-
- {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
: - -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - - -
-
- - + + + + {#xhtmlxtras_dlg.title_ins_element} + + + + + + + + + + +
+ + +
+
+
+ {#xhtmlxtras_dlg.fieldset_general_tab} + + + + + + + + + +
: + + + + + +
+
:
+
+
+ {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
:
:
: + +
:
: + +
: + +
+
+
+
+
+ {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
:
:
:
:
:
:
:
:
:
:
:
:
+
+
+
+
+ + + +
+
+ + diff --git a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/abbr.js b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/abbr.js similarity index 94% rename from engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/abbr.js rename to templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/abbr.js index 4b51a257..1790e83d 100644 --- a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/abbr.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/abbr.js @@ -1,28 +1,28 @@ -/** - * abbr.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('abbr'); - if (SXE.currentAction == "update") { - SXE.showRemoveButton(); - } -} - -function insertAbbr() { - SXE.insertElement('abbr'); - tinyMCEPopup.close(); -} - -function removeAbbr() { - SXE.removeElement('abbr'); - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); +/** + * abbr.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('abbr'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertAbbr() { + SXE.insertElement('abbr'); + tinyMCEPopup.close(); +} + +function removeAbbr() { + SXE.removeElement('abbr'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/acronym.js b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/acronym.js similarity index 94% rename from engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/acronym.js rename to templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/acronym.js index 6ec2f887..93b8d259 100644 --- a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/acronym.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/acronym.js @@ -1,28 +1,28 @@ -/** - * acronym.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('acronym'); - if (SXE.currentAction == "update") { - SXE.showRemoveButton(); - } -} - -function insertAcronym() { - SXE.insertElement('acronym'); - tinyMCEPopup.close(); -} - -function removeAcronym() { - SXE.removeElement('acronym'); - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); +/** + * acronym.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('acronym'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertAcronym() { + SXE.insertElement('acronym'); + tinyMCEPopup.close(); +} + +function removeAcronym() { + SXE.removeElement('acronym'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/attributes.js b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/attributes.js similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/attributes.js rename to templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/attributes.js index 9c99995a..9e9b07e6 100644 --- a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/attributes.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/attributes.js @@ -1,111 +1,111 @@ -/** - * attributes.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - tinyMCEPopup.resizeToInnerSize(); - var inst = tinyMCEPopup.editor; - var dom = inst.dom; - var elm = inst.selection.getNode(); - var f = document.forms[0]; - var onclick = dom.getAttrib(elm, 'onclick'); - - setFormValue('title', dom.getAttrib(elm, 'title')); - setFormValue('id', dom.getAttrib(elm, 'id')); - setFormValue('style', dom.getAttrib(elm, "style")); - setFormValue('dir', dom.getAttrib(elm, 'dir')); - setFormValue('lang', dom.getAttrib(elm, 'lang')); - setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); - setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); - setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); - setFormValue('onblur', dom.getAttrib(elm, 'onblur')); - setFormValue('onclick', onclick); - setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); - setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); - setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); - setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); - setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); - setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); - setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); - setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); - setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); - className = dom.getAttrib(elm, 'class'); - - addClassesToList('classlist', 'advlink_styles'); - selectByValue(f, 'classlist', className, true); - - TinyMCE_EditableSelects.init(); -} - -function setFormValue(name, value) { - if(value && document.forms[0].elements[name]){ - document.forms[0].elements[name].value = value; - } -} - -function insertAction() { - var inst = tinyMCEPopup.editor; - var elm = inst.selection.getNode(); - - setAllAttribs(elm); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); -} - -function setAttrib(elm, attrib, value) { - var formObj = document.forms[0]; - var valueElm = formObj.elements[attrib.toLowerCase()]; - var inst = tinyMCEPopup.editor; - var dom = inst.dom; - - if (typeof(value) == "undefined" || value == null) { - value = ""; - - if (valueElm) - value = valueElm.value; - } - - dom.setAttrib(elm, attrib.toLowerCase(), value); -} - -function setAllAttribs(elm) { - var f = document.forms[0]; - - setAttrib(elm, 'title'); - setAttrib(elm, 'id'); - setAttrib(elm, 'style'); - setAttrib(elm, 'class', getSelectValue(f, 'classlist')); - setAttrib(elm, 'dir'); - setAttrib(elm, 'lang'); - setAttrib(elm, 'tabindex'); - setAttrib(elm, 'accesskey'); - setAttrib(elm, 'onfocus'); - setAttrib(elm, 'onblur'); - setAttrib(elm, 'onclick'); - setAttrib(elm, 'ondblclick'); - setAttrib(elm, 'onmousedown'); - setAttrib(elm, 'onmouseup'); - setAttrib(elm, 'onmouseover'); - setAttrib(elm, 'onmousemove'); - setAttrib(elm, 'onmouseout'); - setAttrib(elm, 'onkeypress'); - setAttrib(elm, 'onkeydown'); - setAttrib(elm, 'onkeyup'); - - // Refresh in old MSIE -// if (tinyMCE.isMSIE5) -// elm.outerHTML = elm.outerHTML; -} - -function insertAttribute() { - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); -tinyMCEPopup.requireLangPack(); +/** + * attributes.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + tinyMCEPopup.resizeToInnerSize(); + var inst = tinyMCEPopup.editor; + var dom = inst.dom; + var elm = inst.selection.getNode(); + var f = document.forms[0]; + var onclick = dom.getAttrib(elm, 'onclick'); + + setFormValue('title', dom.getAttrib(elm, 'title')); + setFormValue('id', dom.getAttrib(elm, 'id')); + setFormValue('style', dom.getAttrib(elm, "style")); + setFormValue('dir', dom.getAttrib(elm, 'dir')); + setFormValue('lang', dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); + className = dom.getAttrib(elm, 'class'); + + addClassesToList('classlist', 'advlink_styles'); + selectByValue(f, 'classlist', className, true); + + TinyMCE_EditableSelects.init(); +} + +function setFormValue(name, value) { + if(value && document.forms[0].elements[name]){ + document.forms[0].elements[name].value = value; + } +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + + setAllAttribs(elm); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); +} + +function setAttrib(elm, attrib, value) { + var formObj = document.forms[0]; + var valueElm = formObj.elements[attrib.toLowerCase()]; + var inst = tinyMCEPopup.editor; + var dom = inst.dom; + + if (typeof(value) == "undefined" || value == null) { + value = ""; + + if (valueElm) + value = valueElm.value; + } + + dom.setAttrib(elm, attrib.toLowerCase(), value); +} + +function setAllAttribs(elm) { + var f = document.forms[0]; + + setAttrib(elm, 'title'); + setAttrib(elm, 'id'); + setAttrib(elm, 'style'); + setAttrib(elm, 'class', getSelectValue(f, 'classlist')); + setAttrib(elm, 'dir'); + setAttrib(elm, 'lang'); + setAttrib(elm, 'tabindex'); + setAttrib(elm, 'accesskey'); + setAttrib(elm, 'onfocus'); + setAttrib(elm, 'onblur'); + setAttrib(elm, 'onclick'); + setAttrib(elm, 'ondblclick'); + setAttrib(elm, 'onmousedown'); + setAttrib(elm, 'onmouseup'); + setAttrib(elm, 'onmouseover'); + setAttrib(elm, 'onmousemove'); + setAttrib(elm, 'onmouseout'); + setAttrib(elm, 'onkeypress'); + setAttrib(elm, 'onkeydown'); + setAttrib(elm, 'onkeyup'); + + // Refresh in old MSIE +// if (tinyMCE.isMSIE5) +// elm.outerHTML = elm.outerHTML; +} + +function insertAttribute() { + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); diff --git a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/cite.js b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/cite.js similarity index 94% rename from engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/cite.js rename to templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/cite.js index 009b7154..b73ef473 100644 --- a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/cite.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/cite.js @@ -1,28 +1,28 @@ -/** - * cite.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('cite'); - if (SXE.currentAction == "update") { - SXE.showRemoveButton(); - } -} - -function insertCite() { - SXE.insertElement('cite'); - tinyMCEPopup.close(); -} - -function removeCite() { - SXE.removeElement('cite'); - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); +/** + * cite.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +function init() { + SXE.initElementDialog('cite'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertCite() { + SXE.insertElement('cite'); + tinyMCEPopup.close(); +} + +function removeCite() { + SXE.removeElement('cite'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/del.js b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/del.js similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/del.js rename to templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/del.js index 1f957dc7..a5397f7e 100644 --- a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/del.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/del.js @@ -1,53 +1,53 @@ -/** - * del.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('del'); - if (SXE.currentAction == "update") { - setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); - setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); - SXE.showRemoveButton(); - } -} - -function setElementAttribs(elm) { - setAllCommonAttribs(elm); - setAttrib(elm, 'datetime'); - setAttrib(elm, 'cite'); - elm.removeAttribute('data-mce-new'); -} - -function insertDel() { - var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL'); - - if (elm == null) { - var s = SXE.inst.selection.getContent(); - if(s.length > 0) { - insertInlineElement('del'); - var elementArray = SXE.inst.dom.select('del[data-mce-new]'); - for (var i=0; i 0) { + insertInlineElement('del'); + var elementArray = SXE.inst.dom.select('del[data-mce-new]'); + for (var i=0; i 0) { - tagName = element_name; - - insertInlineElement(element_name); - var elementArray = tinymce.grep(SXE.inst.dom.select(element_name)); - for (var i=0; i -1) ? true : false; -} - -SXE.removeClass = function(elm,cl) { - if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { - return true; - } - var classNames = elm.className.split(" "); - var newClassNames = ""; - for (var x = 0, cnl = classNames.length; x < cnl; x++) { - if (classNames[x] != cl) { - newClassNames += (classNames[x] + " "); - } - } - elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end -} - -SXE.addClass = function(elm,cl) { - if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; - return true; -} - -function insertInlineElement(en) { - var ed = tinyMCEPopup.editor, dom = ed.dom; - - ed.getDoc().execCommand('FontName', false, 'mceinline'); - tinymce.each(dom.select('span,font'), function(n) { - if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') - dom.replace(dom.create(en, {'data-mce-new' : 1}), n, 1); - }); -} +/** + * element_common.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +tinyMCEPopup.requireLangPack(); + +function initCommonAttributes(elm) { + var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; + + // Setup form data for common element attributes + setFormValue('title', dom.getAttrib(elm, 'title')); + setFormValue('id', dom.getAttrib(elm, 'id')); + selectByValue(formObj, 'class', dom.getAttrib(elm, 'class'), true); + setFormValue('style', dom.getAttrib(elm, 'style')); + selectByValue(formObj, 'dir', dom.getAttrib(elm, 'dir')); + setFormValue('lang', dom.getAttrib(elm, 'lang')); + setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', dom.getAttrib(elm, 'onclick')); + setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); +} + +function setFormValue(name, value) { + if(document.forms[0].elements[name]) document.forms[0].elements[name].value = value; +} + +function insertDateTime(id) { + document.getElementById(id).value = getDateTime(new Date(), "%Y-%m-%dT%H:%M:%S"); +} + +function getDateTime(d, fmt) { + fmt = fmt.replace("%D", "%m/%d/%y"); + fmt = fmt.replace("%r", "%I:%M:%S %p"); + fmt = fmt.replace("%Y", "" + d.getFullYear()); + fmt = fmt.replace("%y", "" + d.getYear()); + fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); + fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); + fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); + fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); + fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); + fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); + fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); + fmt = fmt.replace("%%", "%"); + + return fmt; +} + +function addZeros(value, len) { + var i; + + value = "" + value; + + if (value.length < len) { + for (i=0; i<(len-value.length); i++) + value = "0" + value; + } + + return value; +} + +function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { + if (!form_obj || !form_obj.elements[field_name]) + return; + + var sel = form_obj.elements[field_name]; + + var found = false; + for (var i=0; i 0) { + tagName = element_name; + + insertInlineElement(element_name); + var elementArray = tinymce.grep(SXE.inst.dom.select(element_name)); + for (var i=0; i -1) ? true : false; +} + +SXE.removeClass = function(elm,cl) { + if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { + return true; + } + var classNames = elm.className.split(" "); + var newClassNames = ""; + for (var x = 0, cnl = classNames.length; x < cnl; x++) { + if (classNames[x] != cl) { + newClassNames += (classNames[x] + " "); + } + } + elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end +} + +SXE.addClass = function(elm,cl) { + if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; + return true; +} + +function insertInlineElement(en) { + var ed = tinyMCEPopup.editor, dom = ed.dom; + + ed.getDoc().execCommand('FontName', false, 'mceinline'); + tinymce.each(dom.select('span,font'), function(n) { + if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') + dom.replace(dom.create(en, {'data-mce-new' : 1}), n, 1); + }); +} diff --git a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/ins.js b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/ins.js similarity index 96% rename from engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/ins.js rename to templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/ins.js index c4addfb0..71a8a261 100644 --- a/engine/lib/external/tinymce-jq/plugins/xhtmlxtras/js/ins.js +++ b/templates/framework/js/vendor/tinymce-jq/plugins/xhtmlxtras/js/ins.js @@ -1,53 +1,53 @@ -/** - * ins.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('ins'); - if (SXE.currentAction == "update") { - setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); - setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); - SXE.showRemoveButton(); - } -} - -function setElementAttribs(elm) { - setAllCommonAttribs(elm); - setAttrib(elm, 'datetime'); - setAttrib(elm, 'cite'); - elm.removeAttribute('data-mce-new'); -} - -function insertIns() { - var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS'); - - if (elm == null) { - var s = SXE.inst.selection.getContent(); - if(s.length > 0) { - insertInlineElement('ins'); - var elementArray = SXE.inst.dom.select('ins[data-mce-new]'); - for (var i=0; i 0) { + insertInlineElement('ins'); + var elementArray = SXE.inst.dom.select('ins[data-mce-new]'); + for (var i=0; i - - - {#advanced_dlg.about_title} - - - - - - - -
-
-

{#advanced_dlg.about_title}

-

Version: ()

-

TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL - by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

-

Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

-

For more information about this software visit the TinyMCE website.

- -
- Got Moxie? -
-
- -
-
-

{#advanced_dlg.about_loaded}

- -
-
- -

 

-
-
- -
-
-
-
- -
- -
- - + + + + {#advanced_dlg.about_title} + + + + + + + +
+
+

{#advanced_dlg.about_title}

+

Version: ()

+

TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL + by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

+

Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

+

For more information about this software visit the TinyMCE website.

+ +
+ Got Moxie? +
+
+ +
+
+

{#advanced_dlg.about_loaded}

+ +
+
+ +

 

+
+
+ +
+
+
+
+ +
+ +
+ + diff --git a/engine/lib/external/tinymce-jq/themes/advanced/anchor.htm b/templates/framework/js/vendor/tinymce-jq/themes/advanced/anchor.htm similarity index 97% rename from engine/lib/external/tinymce-jq/themes/advanced/anchor.htm rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/anchor.htm index 75c93b79..dc53312d 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/anchor.htm +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/anchor.htm @@ -1,26 +1,26 @@ - - - - {#advanced_dlg.anchor_title} - - - - -
- - - - - - - - -
{#advanced_dlg.anchor_title}
- -
- - -
-
- - + + + + {#advanced_dlg.anchor_title} + + + + +
+ + + + + + + + +
{#advanced_dlg.anchor_title}
+ +
+ + +
+
+ + diff --git a/engine/lib/external/tinymce-jq/themes/advanced/charmap.htm b/templates/framework/js/vendor/tinymce-jq/themes/advanced/charmap.htm similarity index 97% rename from engine/lib/external/tinymce-jq/themes/advanced/charmap.htm rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/charmap.htm index d4b6bdfb..12acfe18 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/charmap.htm +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/charmap.htm @@ -1,55 +1,55 @@ - - - - {#advanced_dlg.charmap_title} - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - -
 
 
-
- - - - - - - - - - - - - - - - -
 
 
 
-
{#advanced_dlg.charmap_usage}
- - + + + + {#advanced_dlg.charmap_title} + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
 
 
+
+ + + + + + + + + + + + + + + + +
 
 
 
+
{#advanced_dlg.charmap_usage}
+ + diff --git a/engine/lib/external/tinymce-jq/themes/advanced/color_picker.htm b/templates/framework/js/vendor/tinymce-jq/themes/advanced/color_picker.htm similarity index 97% rename from engine/lib/external/tinymce-jq/themes/advanced/color_picker.htm rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/color_picker.htm index ad1bb0f6..e7f19aba 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/color_picker.htm +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/color_picker.htm @@ -1,74 +1,74 @@ - - - - {#advanced_dlg.colorpicker_title} - - - - - - -
- - -
-
-
- {#advanced_dlg.colorpicker_picker_title} -
- - -
- -
- -
-
-
-
- -
-
- {#advanced_dlg.colorpicker_palette_title} -
- -
- -
-
-
- -
-
- {#advanced_dlg.colorpicker_named_title} -
- -
- -
- -
- {#advanced_dlg.colorpicker_name} -
-
-
-
- -
- - -
- -
- -
-
-
- - + + + + {#advanced_dlg.colorpicker_title} + + + + + + +
+ + +
+
+
+ {#advanced_dlg.colorpicker_picker_title} +
+ + +
+ +
+ +
+
+
+
+ +
+
+ {#advanced_dlg.colorpicker_palette_title} +
+ +
+ +
+
+
+ +
+
+ {#advanced_dlg.colorpicker_named_title} +
+ +
+ +
+ +
+ {#advanced_dlg.colorpicker_name} +
+
+
+
+ +
+ + +
+ +
+ +
+
+
+ + diff --git a/engine/lib/external/tinymce-jq/themes/advanced/editor_template.js b/templates/framework/js/vendor/tinymce-jq/themes/advanced/editor_template.js similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/editor_template.js rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/editor_template.js diff --git a/engine/lib/external/tinymce-jq/themes/advanced/editor_template_src.js b/templates/framework/js/vendor/tinymce-jq/themes/advanced/editor_template_src.js similarity index 96% rename from engine/lib/external/tinymce-jq/themes/advanced/editor_template_src.js rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/editor_template_src.js index 324e11d0..00b404a3 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/editor_template_src.js +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/editor_template_src.js @@ -1,1362 +1,1362 @@ -/** - * editor_template_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; - - // Tell it to load theme specific language pack(s) - tinymce.ThemeManager.requireLangPack('advanced'); - - tinymce.create('tinymce.themes.AdvancedTheme', { - sizes : [8, 10, 12, 14, 18, 24, 36], - - // Control name lookup, format: title, command - controls : { - bold : ['bold_desc', 'Bold'], - italic : ['italic_desc', 'Italic'], - underline : ['underline_desc', 'Underline'], - strikethrough : ['striketrough_desc', 'Strikethrough'], - justifyleft : ['justifyleft_desc', 'JustifyLeft'], - justifycenter : ['justifycenter_desc', 'JustifyCenter'], - justifyright : ['justifyright_desc', 'JustifyRight'], - justifyfull : ['justifyfull_desc', 'JustifyFull'], - bullist : ['bullist_desc', 'InsertUnorderedList'], - numlist : ['numlist_desc', 'InsertOrderedList'], - outdent : ['outdent_desc', 'Outdent'], - indent : ['indent_desc', 'Indent'], - cut : ['cut_desc', 'Cut'], - copy : ['copy_desc', 'Copy'], - paste : ['paste_desc', 'Paste'], - undo : ['undo_desc', 'Undo'], - redo : ['redo_desc', 'Redo'], - link : ['link_desc', 'mceLink'], - unlink : ['unlink_desc', 'unlink'], - image : ['image_desc', 'mceImage'], - cleanup : ['cleanup_desc', 'mceCleanup'], - help : ['help_desc', 'mceHelp'], - code : ['code_desc', 'mceCodeEditor'], - hr : ['hr_desc', 'InsertHorizontalRule'], - removeformat : ['removeformat_desc', 'RemoveFormat'], - sub : ['sub_desc', 'subscript'], - sup : ['sup_desc', 'superscript'], - forecolor : ['forecolor_desc', 'ForeColor'], - forecolorpicker : ['forecolor_desc', 'mceForeColor'], - backcolor : ['backcolor_desc', 'HiliteColor'], - backcolorpicker : ['backcolor_desc', 'mceBackColor'], - charmap : ['charmap_desc', 'mceCharMap'], - visualaid : ['visualaid_desc', 'mceToggleVisualAid'], - anchor : ['anchor_desc', 'mceInsertAnchor'], - newdocument : ['newdocument_desc', 'mceNewDocument'], - blockquote : ['blockquote_desc', 'mceBlockQuote'] - }, - - stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'], - - init : function(ed, url) { - var t = this, s, v, o; - - t.editor = ed; - t.url = url; - t.onResolveName = new tinymce.util.Dispatcher(this); - - ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast(); - ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin; - - // Default settings - t.settings = s = extend({ - theme_advanced_path : true, - theme_advanced_toolbar_location : 'bottom', - theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect", - theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code", - theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap", - theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6", - theme_advanced_toolbar_align : "center", - theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats", - theme_advanced_more_colors : 1, - theme_advanced_row_height : 23, - theme_advanced_resize_horizontal : 1, - theme_advanced_resizing_use_cookie : 1, - theme_advanced_font_sizes : "1,2,3,4,5,6,7", - theme_advanced_font_selector : "span", - theme_advanced_show_current_color: 0, - readonly : ed.settings.readonly - }, ed.settings); - - // Setup default font_size_style_values - if (!s.font_size_style_values) - s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt"; - - if (tinymce.is(s.theme_advanced_font_sizes, 'string')) { - s.font_size_style_values = tinymce.explode(s.font_size_style_values); - s.font_size_classes = tinymce.explode(s.font_size_classes || ''); - - // Parse string value - o = {}; - ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes; - each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) { - var cl; - - if (k == v && v >= 1 && v <= 7) { - k = v + ' (' + t.sizes[v - 1] + 'pt)'; - cl = s.font_size_classes[v - 1]; - v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); - } - - if (/^\s*\./.test(v)) - cl = v.replace(/\./g, ''); - - o[k] = cl ? {'class' : cl} : {fontSize : v}; - }); - - s.theme_advanced_font_sizes = o; - } - - if ((v = s.theme_advanced_path_location) && v != 'none') - s.theme_advanced_statusbar_location = s.theme_advanced_path_location; - - if (s.theme_advanced_statusbar_location == 'none') - s.theme_advanced_statusbar_location = 0; - - if (ed.settings.content_css !== false) - ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css")); - - // Init editor - ed.onInit.add(function() { - if (!ed.settings.readonly) { - ed.onNodeChange.add(t._nodeChanged, t); - ed.onKeyUp.add(t._updateUndoStatus, t); - ed.onMouseUp.add(t._updateUndoStatus, t); - ed.dom.bind(ed.dom.getRoot(), 'dragend', function() { - t._updateUndoStatus(ed); - }); - } - }); - - ed.onSetProgressState.add(function(ed, b, ti) { - var co, id = ed.id, tb; - - if (b) { - t.progressTimer = setTimeout(function() { - co = ed.getContainer(); - co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); - tb = DOM.get(ed.id + '_tbl'); - - DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); - DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); - }, ti || 0); - } else { - DOM.remove(id + '_blocker'); - DOM.remove(id + '_progress'); - clearTimeout(t.progressTimer); - } - }); - - DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); - - if (s.skin_variant) - DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); - }, - - _isHighContrast : function() { - var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'}); - - actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, ''); - DOM.remove(div); - - return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56'; - }, - - createControl : function(n, cf) { - var cd, c; - - if (c = cf.createControl(n)) - return c; - - switch (n) { - case "styleselect": - return this._createStyleSelect(); - - case "formatselect": - return this._createBlockFormats(); - - case "fontselect": - return this._createFontSelect(); - - case "fontsizeselect": - return this._createFontSizeSelect(); - - case "forecolor": - return this._createForeColorMenu(); - - case "backcolor": - return this._createBackColorMenu(); - } - - if ((cd = this.controls[n])) - return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); - }, - - execCommand : function(cmd, ui, val) { - var f = this['_' + cmd]; - - if (f) { - f.call(this, ui, val); - return true; - } - - return false; - }, - - _importClasses : function(e) { - var ed = this.editor, ctrl = ed.controlManager.get('styleselect'); - - if (ctrl.getLength() == 0) { - each(ed.dom.getClasses(), function(o, idx) { - var name = 'style_' + idx; - - ed.formatter.register(name, { - inline : 'span', - attributes : {'class' : o['class']}, - selector : '*' - }); - - ctrl.add(o['class'], name); - }); - } - }, - - _createStyleSelect : function(n) { - var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl; - - // Setup style select box - ctrl = ctrlMan.createListBox('styleselect', { - title : 'advanced.style_select', - onselect : function(name) { - var matches, formatNames = []; - - each(ctrl.items, function(item) { - formatNames.push(item.value); - }); - - ed.focus(); - ed.undoManager.add(); - - // Toggle off the current format - matches = ed.formatter.matchAll(formatNames); - if (!name || matches[0] == name) { - if (matches[0]) - ed.formatter.remove(matches[0]); - } else - ed.formatter.apply(name); - - ed.undoManager.add(); - ed.nodeChanged(); - - return false; // No auto select - } - }); - - // Handle specified format - ed.onInit.add(function() { - var counter = 0, formats = ed.getParam('style_formats'); - - if (formats) { - each(formats, function(fmt) { - var name, keys = 0; - - each(fmt, function() {keys++;}); - - if (keys > 1) { - name = fmt.name = fmt.name || 'style_' + (counter++); - ed.formatter.register(name, fmt); - ctrl.add(fmt.title, name); - } else - ctrl.add(fmt.title); - }); - } else { - each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) { - var name; - - if (val) { - name = 'style_' + (counter++); - - ed.formatter.register(name, { - inline : 'span', - classes : val, - selector : '*' - }); - - ctrl.add(t.editor.translate(key), name); - } - }); - } - }); - - // Auto import classes if the ctrl box is empty - if (ctrl.getLength() == 0) { - ctrl.onPostRender.add(function(ed, n) { - if (!ctrl.NativeListBox) { - Event.add(n.id + '_text', 'focus', t._importClasses, t); - Event.add(n.id + '_text', 'mousedown', t._importClasses, t); - Event.add(n.id + '_open', 'focus', t._importClasses, t); - Event.add(n.id + '_open', 'mousedown', t._importClasses, t); - } else - Event.add(n.id, 'focus', t._importClasses, t); - }); - } - - return ctrl; - }, - - _createFontSelect : function() { - var c, t = this, ed = t.editor; - - c = ed.controlManager.createListBox('fontselect', { - title : 'advanced.fontdefault', - onselect : function(v) { - var cur = c.items[c.selectedIndex]; - - if (!v && cur) { - ed.execCommand('FontName', false, cur.value); - return; - } - - ed.execCommand('FontName', false, v); - - // Fake selection, execCommand will fire a nodeChange and update the selection - c.select(function(sv) { - return v == sv; - }); - - if (cur && cur.value == v) { - c.select(null); - } - - return false; // No auto select - } - }); - - if (c) { - each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { - c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); - }); - } - - return c; - }, - - _createFontSizeSelect : function() { - var t = this, ed = t.editor, c, i = 0, cl = []; - - c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { - var cur = c.items[c.selectedIndex]; - - if (!v && cur) { - cur = cur.value; - - if (cur['class']) { - ed.formatter.toggle('fontsize_class', {value : cur['class']}); - ed.undoManager.add(); - ed.nodeChanged(); - } else { - ed.execCommand('FontSize', false, cur.fontSize); - } - - return; - } - - if (v['class']) { - ed.focus(); - ed.undoManager.add(); - ed.formatter.toggle('fontsize_class', {value : v['class']}); - ed.undoManager.add(); - ed.nodeChanged(); - } else - ed.execCommand('FontSize', false, v.fontSize); - - // Fake selection, execCommand will fire a nodeChange and update the selection - c.select(function(sv) { - return v == sv; - }); - - if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] && cur.value['class'] == v['class'])) { - c.select(null); - } - - return false; // No auto select - }}); - - if (c) { - each(t.settings.theme_advanced_font_sizes, function(v, k) { - var fz = v.fontSize; - - if (fz >= 1 && fz <= 7) - fz = t.sizes[parseInt(fz) - 1] + 'pt'; - - c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); - }); - } - - return c; - }, - - _createBlockFormats : function() { - var c, fmts = { - p : 'advanced.paragraph', - address : 'advanced.address', - pre : 'advanced.pre', - h1 : 'advanced.h1', - h2 : 'advanced.h2', - h3 : 'advanced.h3', - h4 : 'advanced.h4', - h5 : 'advanced.h5', - h6 : 'advanced.h6', - div : 'advanced.div', - blockquote : 'advanced.blockquote', - code : 'advanced.code', - dt : 'advanced.dt', - dd : 'advanced.dd', - samp : 'advanced.samp' - }, t = this; - - c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) { - t.editor.execCommand('FormatBlock', false, v); - return false; - }}); - - if (c) { - each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { - c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v}); - }); - } - - return c; - }, - - _createForeColorMenu : function() { - var c, t = this, s = t.settings, o = {}, v; - - if (s.theme_advanced_more_colors) { - o.more_colors_func = function() { - t._mceColorPicker(0, { - color : c.value, - func : function(co) { - c.setColor(co); - } - }); - }; - } - - if (v = s.theme_advanced_text_colors) - o.colors = v; - - if (s.theme_advanced_default_foreground_color) - o.default_color = s.theme_advanced_default_foreground_color; - - o.title = 'advanced.forecolor_desc'; - o.cmd = 'ForeColor'; - o.scope = this; - - c = t.editor.controlManager.createColorSplitButton('forecolor', o); - - return c; - }, - - _createBackColorMenu : function() { - var c, t = this, s = t.settings, o = {}, v; - - if (s.theme_advanced_more_colors) { - o.more_colors_func = function() { - t._mceColorPicker(0, { - color : c.value, - func : function(co) { - c.setColor(co); - } - }); - }; - } - - if (v = s.theme_advanced_background_colors) - o.colors = v; - - if (s.theme_advanced_default_background_color) - o.default_color = s.theme_advanced_default_background_color; - - o.title = 'advanced.backcolor_desc'; - o.cmd = 'HiliteColor'; - o.scope = this; - - c = t.editor.controlManager.createColorSplitButton('backcolor', o); - - return c; - }, - - renderUI : function(o) { - var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; - - if (ed.settings) { - ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut'); - } - - // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for. - // Maybe actually inherit it from the original textara? - n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')}); - DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label); - - if (!DOM.boxModel) - n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); - - n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); - n = tb = DOM.add(n, 'tbody'); - - switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { - case "rowlayout": - ic = t._rowLayout(s, tb, o); - break; - - case "customlayout": - ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); - break; - - default: - ic = t._simpleLayout(s, tb, o, p); - } - - n = o.targetNode; - - // Add classes to first and last TRs - nl = sc.rows; - DOM.addClass(nl[0], 'mceFirst'); - DOM.addClass(nl[nl.length - 1], 'mceLast'); - - // Add classes to first and last TDs - each(DOM.select('tr', tb), function(n) { - DOM.addClass(n.firstChild, 'mceFirst'); - DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); - }); - - if (DOM.get(s.theme_advanced_toolbar_container)) - DOM.get(s.theme_advanced_toolbar_container).appendChild(p); - else - DOM.insertAfter(p, n); - - Event.add(ed.id + '_path_row', 'click', function(e) { - e = e.target; - - if (e.nodeName == 'A') { - t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); - - return Event.cancel(e); - } - }); -/* - if (DOM.get(ed.id + '_path_row')) { - Event.add(ed.id + '_tbl', 'mouseover', function(e) { - var re; - - e = e.target; - - if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { - re = DOM.get(ed.id + '_path_row'); - t.lastPath = re.innerHTML; - DOM.setHTML(re, e.parentNode.title); - } - }); - - Event.add(ed.id + '_tbl', 'mouseout', function(e) { - if (t.lastPath) { - DOM.setHTML(ed.id + '_path_row', t.lastPath); - t.lastPath = 0; - } - }); - } -*/ - - if (!ed.getParam('accessibility_focus')) - Event.add(DOM.add(p, 'a', {href : '#'}, ''), 'focus', function() {tinyMCE.get(ed.id).focus();}); - - if (s.theme_advanced_toolbar_location == 'external') - o.deltaHeight = 0; - - t.deltaHeight = o.deltaHeight; - o.targetNode = null; - - ed.onKeyDown.add(function(ed, evt) { - var DOM_VK_F10 = 121, DOM_VK_F11 = 122; - - if (evt.altKey) { - if (evt.keyCode === DOM_VK_F10) { - // Make sure focus is given to toolbar in Safari. - // We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame - if (tinymce.isWebKit) { - window.focus(); - } - t.toolbarGroup.focus(); - return Event.cancel(evt); - } else if (evt.keyCode === DOM_VK_F11) { - DOM.get(ed.id + '_path_row').focus(); - return Event.cancel(evt); - } - } - }); - - // alt+0 is the UK recommended shortcut for accessing the list of access controls. - ed.addShortcut('alt+0', '', 'mceShortcuts', t); - - return { - iframeContainer : ic, - editorContainer : ed.id + '_parent', - sizeContainer : sc, - deltaHeight : o.deltaHeight - }; - }, - - getInfo : function() { - return { - longname : 'Advanced theme', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - version : tinymce.majorVersion + "." + tinymce.minorVersion - } - }, - - resizeBy : function(dw, dh) { - var e = DOM.get(this.editor.id + '_ifr'); - - this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); - }, - - resizeTo : function(w, h, store) { - var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'); - - // Boundery fix box - w = Math.max(s.theme_advanced_resizing_min_width || 100, w); - h = Math.max(s.theme_advanced_resizing_min_height || 100, h); - w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); - h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); - - // Resize iframe and container - DOM.setStyle(e, 'height', ''); - DOM.setStyle(ifr, 'height', h); - - if (s.theme_advanced_resize_horizontal) { - DOM.setStyle(e, 'width', ''); - DOM.setStyle(ifr, 'width', w); - - // Make sure that the size is never smaller than the over all ui - if (w < e.clientWidth) { - w = e.clientWidth; - DOM.setStyle(ifr, 'width', e.clientWidth); - } - } - - // Store away the size - if (store && s.theme_advanced_resizing_use_cookie) { - Cookie.setHash("TinyMCE_" + ed.id + "_size", { - cw : w, - ch : h - }); - } - }, - - destroy : function() { - var id = this.editor.id; - - Event.clear(id + '_resize'); - Event.clear(id + '_path_row'); - Event.clear(id + '_external_close'); - }, - - // Internal functions - - _simpleLayout : function(s, tb, o, p) { - var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; - - if (s.readonly) { - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - return ic; - } - - // Create toolbar container at top - if (lo == 'top') - t._addToolbars(tb, o); - - // Create external toolbar - if (lo == 'external') { - n = c = DOM.create('div', {style : 'position:relative'}); - n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); - DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); - n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); - etb = DOM.add(n, 'tbody'); - - if (p.firstChild.className == 'mceOldBoxModel') - p.firstChild.appendChild(c); - else - p.insertBefore(c, p.firstChild); - - t._addToolbars(etb, o); - - ed.onMouseUp.add(function() { - var e = DOM.get(ed.id + '_external'); - DOM.show(e); - - DOM.hide(lastExtID); - - var f = Event.add(ed.id + '_external_close', 'click', function() { - DOM.hide(ed.id + '_external'); - Event.remove(ed.id + '_external_close', 'click', f); - }); - - DOM.show(e); - DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); - - // Fixes IE rendering bug - DOM.hide(e); - DOM.show(e); - e.style.filter = ''; - - lastExtID = ed.id + '_external'; - - e = null; - }); - } - - if (sl == 'top') - t._addStatusBar(tb, o); - - // Create iframe container - if (!s.theme_advanced_toolbar_container) { - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - } - - // Create toolbar container at bottom - if (lo == 'bottom') - t._addToolbars(tb, o); - - if (sl == 'bottom') - t._addStatusBar(tb, o); - - return ic; - }, - - _rowLayout : function(s, tb, o) { - var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; - - dc = s.theme_advanced_containers_default_class || ''; - da = s.theme_advanced_containers_default_align || 'center'; - - each(explode(s.theme_advanced_containers || ''), function(c, i) { - var v = s['theme_advanced_container_' + c] || ''; - - switch (c.toLowerCase()) { - case 'mceeditor': - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - break; - - case 'mceelementpath': - t._addStatusBar(tb, o); - break; - - default: - a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); - a = 'mce' + t._ufirst(a); - - n = DOM.add(DOM.add(tb, 'tr'), 'td', { - 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da - }); - - to = cf.createToolbar("toolbar" + i); - t._addControls(v, to); - DOM.setHTML(n, to.renderHTML()); - o.deltaHeight -= s.theme_advanced_row_height; - } - }); - - return ic; - }, - - _addControls : function(v, tb) { - var t = this, s = t.settings, di, cf = t.editor.controlManager; - - if (s.theme_advanced_disable && !t._disabled) { - di = {}; - - each(explode(s.theme_advanced_disable), function(v) { - di[v] = 1; - }); - - t._disabled = di; - } else - di = t._disabled; - - each(explode(v), function(n) { - var c; - - if (di && di[n]) - return; - - // Compatiblity with 2.x - if (n == 'tablecontrols') { - each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { - n = t.createControl(n, cf); - - if (n) - tb.add(n); - }); - - return; - } - - c = t.createControl(n, cf); - - if (c) - tb.add(c); - }); - }, - - _addToolbars : function(c, o) { - var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup; - - toolbarGroup = cf.createToolbarGroup('toolbargroup', { - 'name': ed.getLang('advanced.toolbar'), - 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar') - }); - - t.toolbarGroup = toolbarGroup; - - a = s.theme_advanced_toolbar_align.toLowerCase(); - a = 'mce' + t._ufirst(a); - - n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"}); - - // Create toolbar and add the controls - for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { - tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); - - if (s['theme_advanced_buttons' + i + '_add']) - v += ',' + s['theme_advanced_buttons' + i + '_add']; - - if (s['theme_advanced_buttons' + i + '_add_before']) - v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; - - t._addControls(v, tb); - toolbarGroup.add(tb); - - o.deltaHeight -= s.theme_advanced_row_height; - } - h.push(toolbarGroup.renderHTML()); - h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); - DOM.setHTML(n, h.join('')); - }, - - _addStatusBar : function(tb, o) { - var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; - - n = DOM.add(tb, 'tr'); - n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); - n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'}); - if (s.theme_advanced_path) { - DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path')); - DOM.add(n, 'span', {}, ': '); - } else { - DOM.add(n, 'span', {}, ' '); - } - - - if (s.theme_advanced_resizing) { - DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"}); - - if (s.theme_advanced_resizing_use_cookie) { - ed.onPostRender.add(function() { - var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); - - if (!o) - return; - - t.resizeTo(o.cw, o.ch); - }); - } - - ed.onPostRender.add(function() { - Event.add(ed.id + '_resize', 'click', function(e) { - e.preventDefault(); - }); - - Event.add(ed.id + '_resize', 'mousedown', function(e) { - var mouseMoveHandler1, mouseMoveHandler2, - mouseUpHandler1, mouseUpHandler2, - startX, startY, startWidth, startHeight, width, height, ifrElm; - - function resizeOnMove(e) { - e.preventDefault(); - - width = startWidth + (e.screenX - startX); - height = startHeight + (e.screenY - startY); - - t.resizeTo(width, height); - }; - - function endResize(e) { - // Stop listening - Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1); - Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2); - Event.remove(DOM.doc, 'mouseup', mouseUpHandler1); - Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2); - - width = startWidth + (e.screenX - startX); - height = startHeight + (e.screenY - startY); - t.resizeTo(width, height, true); - }; - - e.preventDefault(); - - // Get the current rect size - startX = e.screenX; - startY = e.screenY; - ifrElm = DOM.get(t.editor.id + '_ifr'); - startWidth = width = ifrElm.clientWidth; - startHeight = height = ifrElm.clientHeight; - - // Register envent handlers - mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove); - mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove); - mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize); - mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize); - }); - }); - } - - o.deltaHeight -= 21; - n = tb = null; - }, - - _updateUndoStatus : function(ed) { - var cm = ed.controlManager, um = ed.undoManager; - - cm.setDisabled('undo', !um.hasUndo() && !um.typing); - cm.setDisabled('redo', !um.hasRedo()); - }, - - _nodeChanged : function(ed, cm, n, co, ob) { - var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches; - - tinymce.each(t.stateControls, function(c) { - cm.setActive(c, ed.queryCommandState(t.controls[c][1])); - }); - - function getParent(name) { - var i, parents = ob.parents, func = name; - - if (typeof(name) == 'string') { - func = function(node) { - return node.nodeName == name; - }; - } - - for (i = 0; i < parents.length; i++) { - if (func(parents[i])) - return parents[i]; - } - }; - - cm.setActive('visualaid', ed.hasVisual); - t._updateUndoStatus(ed); - cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); - - p = getParent('A'); - if (c = cm.get('link')) { - if (!p || !p.name) { - c.setDisabled(!p && co); - c.setActive(!!p); - } - } - - if (c = cm.get('unlink')) { - c.setDisabled(!p && co); - c.setActive(!!p && !p.name); - } - - if (c = cm.get('anchor')) { - c.setActive(!co && !!p && p.name); - } - - p = getParent('IMG'); - if (c = cm.get('image')) - c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1); - - if (c = cm.get('styleselect')) { - t._importClasses(); - - formatNames = []; - each(c.items, function(item) { - formatNames.push(item.value); - }); - - matches = ed.formatter.matchAll(formatNames); - c.select(matches[0]); - } - - if (c = cm.get('formatselect')) { - p = getParent(DOM.isBlock); - - if (p) - c.select(p.nodeName.toLowerCase()); - } - - // Find out current fontSize, fontFamily and fontClass - getParent(function(n) { - if (n.nodeName === 'SPAN') { - if (!cl && n.className) - cl = n.className; - } - - if (ed.dom.is(n, s.theme_advanced_font_selector)) { - if (!fz && n.style.fontSize) - fz = n.style.fontSize; - - if (!fn && n.style.fontFamily) - fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); - - if (!fc && n.style.color) - fc = n.style.color; - - if (!bc && n.style.backgroundColor) - bc = n.style.backgroundColor; - } - - return false; - }); - - if (c = cm.get('fontselect')) { - c.select(function(v) { - return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; - }); - } - - // Select font size - if (c = cm.get('fontsizeselect')) { - // Use computed style - if (s.theme_advanced_runtime_fontsize && !fz && !cl) - fz = ed.dom.getStyle(n, 'fontSize', true); - - c.select(function(v) { - if (v.fontSize && v.fontSize === fz) - return true; - - if (v['class'] && v['class'] === cl) - return true; - }); - } - - if (s.theme_advanced_show_current_color) { - function updateColor(controlId, color) { - if (c = cm.get(controlId)) { - if (!color) - color = c.settings.default_color; - if (color !== c.value) { - c.displayColor(color); - } - } - } - updateColor('forecolor', fc); - updateColor('backcolor', bc); - } - - if (s.theme_advanced_show_current_color) { - function updateColor(controlId, color) { - if (c = cm.get(controlId)) { - if (!color) - color = c.settings.default_color; - if (color !== c.value) { - c.displayColor(color); - } - } - }; - - updateColor('forecolor', fc); - updateColor('backcolor', bc); - } - - if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { - p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); - - if (t.statusKeyboardNavigation) { - t.statusKeyboardNavigation.destroy(); - t.statusKeyboardNavigation = null; - } - - DOM.setHTML(p, ''); - - getParent(function(n) { - var na = n.nodeName.toLowerCase(), u, pi, ti = ''; - - // Ignore non element and bogus/hidden elements - if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')) - return; - - // Handle prefix - if (tinymce.isIE && n.scopeName !== 'HTML') - na = n.scopeName + ':' + na; - - // Remove internal prefix - na = na.replace(/mce\:/g, ''); - - // Handle node name - switch (na) { - case 'b': - na = 'strong'; - break; - - case 'i': - na = 'em'; - break; - - case 'img': - if (v = DOM.getAttrib(n, 'src')) - ti += 'src: ' + v + ' '; - - break; - - case 'a': - if (v = DOM.getAttrib(n, 'name')) { - ti += 'name: ' + v + ' '; - na += '#' + v; - } - - if (v = DOM.getAttrib(n, 'href')) - ti += 'href: ' + v + ' '; - - break; - - case 'font': - if (v = DOM.getAttrib(n, 'face')) - ti += 'font: ' + v + ' '; - - if (v = DOM.getAttrib(n, 'size')) - ti += 'size: ' + v + ' '; - - if (v = DOM.getAttrib(n, 'color')) - ti += 'color: ' + v + ' '; - - break; - - case 'span': - if (v = DOM.getAttrib(n, 'style')) - ti += 'style: ' + v + ' '; - - break; - } - - if (v = DOM.getAttrib(n, 'id')) - ti += 'id: ' + v + ' '; - - if (v = n.className) { - v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '') - - if (v) { - ti += 'class: ' + v + ' '; - - if (DOM.isBlock(n) || na == 'img' || na == 'span') - na += '.' + v; - } - } - - na = na.replace(/(html:)/g, ''); - na = {name : na, node : n, title : ti}; - t.onResolveName.dispatch(t, na); - ti = na.title; - na = na.name; - - //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; - pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); - - if (p.hasChildNodes()) { - p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild); - p.insertBefore(pi, p.firstChild); - } else - p.appendChild(pi); - }, ed.getBody()); - - if (DOM.select('a', p).length > 0) { - t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({ - root: ed.id + "_path_row", - items: DOM.select('a', p), - excludeFromTabOrder: true, - onCancel: function() { - ed.focus(); - } - }, DOM); - } - } - }, - - // Commands gets called by execCommand - - _sel : function(v) { - this.editor.execCommand('mceSelectNodeDepth', false, v); - }, - - _mceInsertAnchor : function(ui, v) { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/anchor.htm', - width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), - height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceCharMap : function() { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/charmap.htm', - width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), - height : 265 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceHelp : function() { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/about.htm', - width : 480, - height : 380, - inline : true - }, { - theme_url : this.url - }); - }, - - _mceShortcuts : function() { - var ed = this.editor; - ed.windowManager.open({ - url: this.url + '/shortcuts.htm', - width: 480, - height: 380, - inline: true - }, { - theme_url: this.url - }); - }, - - _mceColorPicker : function(u, v) { - var ed = this.editor; - - v = v || {}; - - ed.windowManager.open({ - url : this.url + '/color_picker.htm', - width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), - height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), - close_previous : false, - inline : true - }, { - input_color : v.color, - func : v.func, - theme_url : this.url - }); - }, - - _mceCodeEditor : function(ui, val) { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/source_editor.htm', - width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), - height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), - inline : true, - resizable : true, - maximizable : true - }, { - theme_url : this.url - }); - }, - - _mceImage : function(ui, val) { - var ed = this.editor; - - // Internal image object like a flash placeholder - if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) - return; - - ed.windowManager.open({ - url : this.url + '/image.htm', - width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), - height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceLink : function(ui, val) { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/link.htm', - width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), - height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceNewDocument : function() { - var ed = this.editor; - - ed.windowManager.confirm('advanced.newdocument', function(s) { - if (s) - ed.execCommand('mceSetContent', false, ''); - }); - }, - - _mceForeColor : function() { - var t = this; - - this._mceColorPicker(0, { - color: t.fgColor, - func : function(co) { - t.fgColor = co; - t.editor.execCommand('ForeColor', false, co); - } - }); - }, - - _mceBackColor : function() { - var t = this; - - this._mceColorPicker(0, { - color: t.bgColor, - func : function(co) { - t.bgColor = co; - t.editor.execCommand('HiliteColor', false, co); - } - }); - }, - - _ufirst : function(s) { - return s.substring(0, 1).toUpperCase() + s.substring(1); - } - }); - - tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); -}(tinymce)); +/** + * editor_template_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function(tinymce) { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('advanced'); + + tinymce.create('tinymce.themes.AdvancedTheme', { + sizes : [8, 10, 12, 14, 18, 24, 36], + + // Control name lookup, format: title, command + controls : { + bold : ['bold_desc', 'Bold'], + italic : ['italic_desc', 'Italic'], + underline : ['underline_desc', 'Underline'], + strikethrough : ['striketrough_desc', 'Strikethrough'], + justifyleft : ['justifyleft_desc', 'JustifyLeft'], + justifycenter : ['justifycenter_desc', 'JustifyCenter'], + justifyright : ['justifyright_desc', 'JustifyRight'], + justifyfull : ['justifyfull_desc', 'JustifyFull'], + bullist : ['bullist_desc', 'InsertUnorderedList'], + numlist : ['numlist_desc', 'InsertOrderedList'], + outdent : ['outdent_desc', 'Outdent'], + indent : ['indent_desc', 'Indent'], + cut : ['cut_desc', 'Cut'], + copy : ['copy_desc', 'Copy'], + paste : ['paste_desc', 'Paste'], + undo : ['undo_desc', 'Undo'], + redo : ['redo_desc', 'Redo'], + link : ['link_desc', 'mceLink'], + unlink : ['unlink_desc', 'unlink'], + image : ['image_desc', 'mceImage'], + cleanup : ['cleanup_desc', 'mceCleanup'], + help : ['help_desc', 'mceHelp'], + code : ['code_desc', 'mceCodeEditor'], + hr : ['hr_desc', 'InsertHorizontalRule'], + removeformat : ['removeformat_desc', 'RemoveFormat'], + sub : ['sub_desc', 'subscript'], + sup : ['sup_desc', 'superscript'], + forecolor : ['forecolor_desc', 'ForeColor'], + forecolorpicker : ['forecolor_desc', 'mceForeColor'], + backcolor : ['backcolor_desc', 'HiliteColor'], + backcolorpicker : ['backcolor_desc', 'mceBackColor'], + charmap : ['charmap_desc', 'mceCharMap'], + visualaid : ['visualaid_desc', 'mceToggleVisualAid'], + anchor : ['anchor_desc', 'mceInsertAnchor'], + newdocument : ['newdocument_desc', 'mceNewDocument'], + blockquote : ['blockquote_desc', 'mceBlockQuote'] + }, + + stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'], + + init : function(ed, url) { + var t = this, s, v, o; + + t.editor = ed; + t.url = url; + t.onResolveName = new tinymce.util.Dispatcher(this); + + ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast(); + ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin; + + // Default settings + t.settings = s = extend({ + theme_advanced_path : true, + theme_advanced_toolbar_location : 'bottom', + theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect", + theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code", + theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap", + theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6", + theme_advanced_toolbar_align : "center", + theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats", + theme_advanced_more_colors : 1, + theme_advanced_row_height : 23, + theme_advanced_resize_horizontal : 1, + theme_advanced_resizing_use_cookie : 1, + theme_advanced_font_sizes : "1,2,3,4,5,6,7", + theme_advanced_font_selector : "span", + theme_advanced_show_current_color: 0, + readonly : ed.settings.readonly + }, ed.settings); + + // Setup default font_size_style_values + if (!s.font_size_style_values) + s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt"; + + if (tinymce.is(s.theme_advanced_font_sizes, 'string')) { + s.font_size_style_values = tinymce.explode(s.font_size_style_values); + s.font_size_classes = tinymce.explode(s.font_size_classes || ''); + + // Parse string value + o = {}; + ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes; + each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) { + var cl; + + if (k == v && v >= 1 && v <= 7) { + k = v + ' (' + t.sizes[v - 1] + 'pt)'; + cl = s.font_size_classes[v - 1]; + v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); + } + + if (/^\s*\./.test(v)) + cl = v.replace(/\./g, ''); + + o[k] = cl ? {'class' : cl} : {fontSize : v}; + }); + + s.theme_advanced_font_sizes = o; + } + + if ((v = s.theme_advanced_path_location) && v != 'none') + s.theme_advanced_statusbar_location = s.theme_advanced_path_location; + + if (s.theme_advanced_statusbar_location == 'none') + s.theme_advanced_statusbar_location = 0; + + if (ed.settings.content_css !== false) + ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css")); + + // Init editor + ed.onInit.add(function() { + if (!ed.settings.readonly) { + ed.onNodeChange.add(t._nodeChanged, t); + ed.onKeyUp.add(t._updateUndoStatus, t); + ed.onMouseUp.add(t._updateUndoStatus, t); + ed.dom.bind(ed.dom.getRoot(), 'dragend', function() { + t._updateUndoStatus(ed); + }); + } + }); + + ed.onSetProgressState.add(function(ed, b, ti) { + var co, id = ed.id, tb; + + if (b) { + t.progressTimer = setTimeout(function() { + co = ed.getContainer(); + co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); + tb = DOM.get(ed.id + '_tbl'); + + DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); + DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); + }, ti || 0); + } else { + DOM.remove(id + '_blocker'); + DOM.remove(id + '_progress'); + clearTimeout(t.progressTimer); + } + }); + + DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); + + if (s.skin_variant) + DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); + }, + + _isHighContrast : function() { + var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'}); + + actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, ''); + DOM.remove(div); + + return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56'; + }, + + createControl : function(n, cf) { + var cd, c; + + if (c = cf.createControl(n)) + return c; + + switch (n) { + case "styleselect": + return this._createStyleSelect(); + + case "formatselect": + return this._createBlockFormats(); + + case "fontselect": + return this._createFontSelect(); + + case "fontsizeselect": + return this._createFontSizeSelect(); + + case "forecolor": + return this._createForeColorMenu(); + + case "backcolor": + return this._createBackColorMenu(); + } + + if ((cd = this.controls[n])) + return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); + }, + + execCommand : function(cmd, ui, val) { + var f = this['_' + cmd]; + + if (f) { + f.call(this, ui, val); + return true; + } + + return false; + }, + + _importClasses : function(e) { + var ed = this.editor, ctrl = ed.controlManager.get('styleselect'); + + if (ctrl.getLength() == 0) { + each(ed.dom.getClasses(), function(o, idx) { + var name = 'style_' + idx; + + ed.formatter.register(name, { + inline : 'span', + attributes : {'class' : o['class']}, + selector : '*' + }); + + ctrl.add(o['class'], name); + }); + } + }, + + _createStyleSelect : function(n) { + var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl; + + // Setup style select box + ctrl = ctrlMan.createListBox('styleselect', { + title : 'advanced.style_select', + onselect : function(name) { + var matches, formatNames = []; + + each(ctrl.items, function(item) { + formatNames.push(item.value); + }); + + ed.focus(); + ed.undoManager.add(); + + // Toggle off the current format + matches = ed.formatter.matchAll(formatNames); + if (!name || matches[0] == name) { + if (matches[0]) + ed.formatter.remove(matches[0]); + } else + ed.formatter.apply(name); + + ed.undoManager.add(); + ed.nodeChanged(); + + return false; // No auto select + } + }); + + // Handle specified format + ed.onInit.add(function() { + var counter = 0, formats = ed.getParam('style_formats'); + + if (formats) { + each(formats, function(fmt) { + var name, keys = 0; + + each(fmt, function() {keys++;}); + + if (keys > 1) { + name = fmt.name = fmt.name || 'style_' + (counter++); + ed.formatter.register(name, fmt); + ctrl.add(fmt.title, name); + } else + ctrl.add(fmt.title); + }); + } else { + each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) { + var name; + + if (val) { + name = 'style_' + (counter++); + + ed.formatter.register(name, { + inline : 'span', + classes : val, + selector : '*' + }); + + ctrl.add(t.editor.translate(key), name); + } + }); + } + }); + + // Auto import classes if the ctrl box is empty + if (ctrl.getLength() == 0) { + ctrl.onPostRender.add(function(ed, n) { + if (!ctrl.NativeListBox) { + Event.add(n.id + '_text', 'focus', t._importClasses, t); + Event.add(n.id + '_text', 'mousedown', t._importClasses, t); + Event.add(n.id + '_open', 'focus', t._importClasses, t); + Event.add(n.id + '_open', 'mousedown', t._importClasses, t); + } else + Event.add(n.id, 'focus', t._importClasses, t); + }); + } + + return ctrl; + }, + + _createFontSelect : function() { + var c, t = this, ed = t.editor; + + c = ed.controlManager.createListBox('fontselect', { + title : 'advanced.fontdefault', + onselect : function(v) { + var cur = c.items[c.selectedIndex]; + + if (!v && cur) { + ed.execCommand('FontName', false, cur.value); + return; + } + + ed.execCommand('FontName', false, v); + + // Fake selection, execCommand will fire a nodeChange and update the selection + c.select(function(sv) { + return v == sv; + }); + + if (cur && cur.value == v) { + c.select(null); + } + + return false; // No auto select + } + }); + + if (c) { + each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { + c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); + }); + } + + return c; + }, + + _createFontSizeSelect : function() { + var t = this, ed = t.editor, c, i = 0, cl = []; + + c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { + var cur = c.items[c.selectedIndex]; + + if (!v && cur) { + cur = cur.value; + + if (cur['class']) { + ed.formatter.toggle('fontsize_class', {value : cur['class']}); + ed.undoManager.add(); + ed.nodeChanged(); + } else { + ed.execCommand('FontSize', false, cur.fontSize); + } + + return; + } + + if (v['class']) { + ed.focus(); + ed.undoManager.add(); + ed.formatter.toggle('fontsize_class', {value : v['class']}); + ed.undoManager.add(); + ed.nodeChanged(); + } else + ed.execCommand('FontSize', false, v.fontSize); + + // Fake selection, execCommand will fire a nodeChange and update the selection + c.select(function(sv) { + return v == sv; + }); + + if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] && cur.value['class'] == v['class'])) { + c.select(null); + } + + return false; // No auto select + }}); + + if (c) { + each(t.settings.theme_advanced_font_sizes, function(v, k) { + var fz = v.fontSize; + + if (fz >= 1 && fz <= 7) + fz = t.sizes[parseInt(fz) - 1] + 'pt'; + + c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); + }); + } + + return c; + }, + + _createBlockFormats : function() { + var c, fmts = { + p : 'advanced.paragraph', + address : 'advanced.address', + pre : 'advanced.pre', + h1 : 'advanced.h1', + h2 : 'advanced.h2', + h3 : 'advanced.h3', + h4 : 'advanced.h4', + h5 : 'advanced.h5', + h6 : 'advanced.h6', + div : 'advanced.div', + blockquote : 'advanced.blockquote', + code : 'advanced.code', + dt : 'advanced.dt', + dd : 'advanced.dd', + samp : 'advanced.samp' + }, t = this; + + c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) { + t.editor.execCommand('FormatBlock', false, v); + return false; + }}); + + if (c) { + each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { + c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v}); + }); + } + + return c; + }, + + _createForeColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_text_colors) + o.colors = v; + + if (s.theme_advanced_default_foreground_color) + o.default_color = s.theme_advanced_default_foreground_color; + + o.title = 'advanced.forecolor_desc'; + o.cmd = 'ForeColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('forecolor', o); + + return c; + }, + + _createBackColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_background_colors) + o.colors = v; + + if (s.theme_advanced_default_background_color) + o.default_color = s.theme_advanced_default_background_color; + + o.title = 'advanced.backcolor_desc'; + o.cmd = 'HiliteColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('backcolor', o); + + return c; + }, + + renderUI : function(o) { + var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; + + if (ed.settings) { + ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut'); + } + + // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for. + // Maybe actually inherit it from the original textara? + n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')}); + DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label); + + if (!DOM.boxModel) + n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); + + n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); + n = tb = DOM.add(n, 'tbody'); + + switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { + case "rowlayout": + ic = t._rowLayout(s, tb, o); + break; + + case "customlayout": + ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); + break; + + default: + ic = t._simpleLayout(s, tb, o, p); + } + + n = o.targetNode; + + // Add classes to first and last TRs + nl = sc.rows; + DOM.addClass(nl[0], 'mceFirst'); + DOM.addClass(nl[nl.length - 1], 'mceLast'); + + // Add classes to first and last TDs + each(DOM.select('tr', tb), function(n) { + DOM.addClass(n.firstChild, 'mceFirst'); + DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); + }); + + if (DOM.get(s.theme_advanced_toolbar_container)) + DOM.get(s.theme_advanced_toolbar_container).appendChild(p); + else + DOM.insertAfter(p, n); + + Event.add(ed.id + '_path_row', 'click', function(e) { + e = e.target; + + if (e.nodeName == 'A') { + t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); + + return Event.cancel(e); + } + }); +/* + if (DOM.get(ed.id + '_path_row')) { + Event.add(ed.id + '_tbl', 'mouseover', function(e) { + var re; + + e = e.target; + + if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { + re = DOM.get(ed.id + '_path_row'); + t.lastPath = re.innerHTML; + DOM.setHTML(re, e.parentNode.title); + } + }); + + Event.add(ed.id + '_tbl', 'mouseout', function(e) { + if (t.lastPath) { + DOM.setHTML(ed.id + '_path_row', t.lastPath); + t.lastPath = 0; + } + }); + } +*/ + + if (!ed.getParam('accessibility_focus')) + Event.add(DOM.add(p, 'a', {href : '#'}, ''), 'focus', function() {tinyMCE.get(ed.id).focus();}); + + if (s.theme_advanced_toolbar_location == 'external') + o.deltaHeight = 0; + + t.deltaHeight = o.deltaHeight; + o.targetNode = null; + + ed.onKeyDown.add(function(ed, evt) { + var DOM_VK_F10 = 121, DOM_VK_F11 = 122; + + if (evt.altKey) { + if (evt.keyCode === DOM_VK_F10) { + // Make sure focus is given to toolbar in Safari. + // We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame + if (tinymce.isWebKit) { + window.focus(); + } + t.toolbarGroup.focus(); + return Event.cancel(evt); + } else if (evt.keyCode === DOM_VK_F11) { + DOM.get(ed.id + '_path_row').focus(); + return Event.cancel(evt); + } + } + }); + + // alt+0 is the UK recommended shortcut for accessing the list of access controls. + ed.addShortcut('alt+0', '', 'mceShortcuts', t); + + return { + iframeContainer : ic, + editorContainer : ed.id + '_parent', + sizeContainer : sc, + deltaHeight : o.deltaHeight + }; + }, + + getInfo : function() { + return { + longname : 'Advanced theme', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + version : tinymce.majorVersion + "." + tinymce.minorVersion + } + }, + + resizeBy : function(dw, dh) { + var e = DOM.get(this.editor.id + '_ifr'); + + this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); + }, + + resizeTo : function(w, h, store) { + var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'); + + // Boundery fix box + w = Math.max(s.theme_advanced_resizing_min_width || 100, w); + h = Math.max(s.theme_advanced_resizing_min_height || 100, h); + w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); + h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); + + // Resize iframe and container + DOM.setStyle(e, 'height', ''); + DOM.setStyle(ifr, 'height', h); + + if (s.theme_advanced_resize_horizontal) { + DOM.setStyle(e, 'width', ''); + DOM.setStyle(ifr, 'width', w); + + // Make sure that the size is never smaller than the over all ui + if (w < e.clientWidth) { + w = e.clientWidth; + DOM.setStyle(ifr, 'width', e.clientWidth); + } + } + + // Store away the size + if (store && s.theme_advanced_resizing_use_cookie) { + Cookie.setHash("TinyMCE_" + ed.id + "_size", { + cw : w, + ch : h + }); + } + }, + + destroy : function() { + var id = this.editor.id; + + Event.clear(id + '_resize'); + Event.clear(id + '_path_row'); + Event.clear(id + '_external_close'); + }, + + // Internal functions + + _simpleLayout : function(s, tb, o, p) { + var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; + + if (s.readonly) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + return ic; + } + + // Create toolbar container at top + if (lo == 'top') + t._addToolbars(tb, o); + + // Create external toolbar + if (lo == 'external') { + n = c = DOM.create('div', {style : 'position:relative'}); + n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); + DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); + n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); + etb = DOM.add(n, 'tbody'); + + if (p.firstChild.className == 'mceOldBoxModel') + p.firstChild.appendChild(c); + else + p.insertBefore(c, p.firstChild); + + t._addToolbars(etb, o); + + ed.onMouseUp.add(function() { + var e = DOM.get(ed.id + '_external'); + DOM.show(e); + + DOM.hide(lastExtID); + + var f = Event.add(ed.id + '_external_close', 'click', function() { + DOM.hide(ed.id + '_external'); + Event.remove(ed.id + '_external_close', 'click', f); + }); + + DOM.show(e); + DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); + + // Fixes IE rendering bug + DOM.hide(e); + DOM.show(e); + e.style.filter = ''; + + lastExtID = ed.id + '_external'; + + e = null; + }); + } + + if (sl == 'top') + t._addStatusBar(tb, o); + + // Create iframe container + if (!s.theme_advanced_toolbar_container) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + } + + // Create toolbar container at bottom + if (lo == 'bottom') + t._addToolbars(tb, o); + + if (sl == 'bottom') + t._addStatusBar(tb, o); + + return ic; + }, + + _rowLayout : function(s, tb, o) { + var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; + + dc = s.theme_advanced_containers_default_class || ''; + da = s.theme_advanced_containers_default_align || 'center'; + + each(explode(s.theme_advanced_containers || ''), function(c, i) { + var v = s['theme_advanced_container_' + c] || ''; + + switch (c.toLowerCase()) { + case 'mceeditor': + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + break; + + case 'mceelementpath': + t._addStatusBar(tb, o); + break; + + default: + a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(tb, 'tr'), 'td', { + 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da + }); + + to = cf.createToolbar("toolbar" + i); + t._addControls(v, to); + DOM.setHTML(n, to.renderHTML()); + o.deltaHeight -= s.theme_advanced_row_height; + } + }); + + return ic; + }, + + _addControls : function(v, tb) { + var t = this, s = t.settings, di, cf = t.editor.controlManager; + + if (s.theme_advanced_disable && !t._disabled) { + di = {}; + + each(explode(s.theme_advanced_disable), function(v) { + di[v] = 1; + }); + + t._disabled = di; + } else + di = t._disabled; + + each(explode(v), function(n) { + var c; + + if (di && di[n]) + return; + + // Compatiblity with 2.x + if (n == 'tablecontrols') { + each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { + n = t.createControl(n, cf); + + if (n) + tb.add(n); + }); + + return; + } + + c = t.createControl(n, cf); + + if (c) + tb.add(c); + }); + }, + + _addToolbars : function(c, o) { + var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup; + + toolbarGroup = cf.createToolbarGroup('toolbargroup', { + 'name': ed.getLang('advanced.toolbar'), + 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar') + }); + + t.toolbarGroup = toolbarGroup; + + a = s.theme_advanced_toolbar_align.toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"}); + + // Create toolbar and add the controls + for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { + tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); + + if (s['theme_advanced_buttons' + i + '_add']) + v += ',' + s['theme_advanced_buttons' + i + '_add']; + + if (s['theme_advanced_buttons' + i + '_add_before']) + v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; + + t._addControls(v, tb); + toolbarGroup.add(tb); + + o.deltaHeight -= s.theme_advanced_row_height; + } + h.push(toolbarGroup.renderHTML()); + h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); + DOM.setHTML(n, h.join('')); + }, + + _addStatusBar : function(tb, o) { + var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; + + n = DOM.add(tb, 'tr'); + n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); + n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'}); + if (s.theme_advanced_path) { + DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path')); + DOM.add(n, 'span', {}, ': '); + } else { + DOM.add(n, 'span', {}, ' '); + } + + + if (s.theme_advanced_resizing) { + DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"}); + + if (s.theme_advanced_resizing_use_cookie) { + ed.onPostRender.add(function() { + var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); + + if (!o) + return; + + t.resizeTo(o.cw, o.ch); + }); + } + + ed.onPostRender.add(function() { + Event.add(ed.id + '_resize', 'click', function(e) { + e.preventDefault(); + }); + + Event.add(ed.id + '_resize', 'mousedown', function(e) { + var mouseMoveHandler1, mouseMoveHandler2, + mouseUpHandler1, mouseUpHandler2, + startX, startY, startWidth, startHeight, width, height, ifrElm; + + function resizeOnMove(e) { + e.preventDefault(); + + width = startWidth + (e.screenX - startX); + height = startHeight + (e.screenY - startY); + + t.resizeTo(width, height); + }; + + function endResize(e) { + // Stop listening + Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1); + Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2); + Event.remove(DOM.doc, 'mouseup', mouseUpHandler1); + Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2); + + width = startWidth + (e.screenX - startX); + height = startHeight + (e.screenY - startY); + t.resizeTo(width, height, true); + }; + + e.preventDefault(); + + // Get the current rect size + startX = e.screenX; + startY = e.screenY; + ifrElm = DOM.get(t.editor.id + '_ifr'); + startWidth = width = ifrElm.clientWidth; + startHeight = height = ifrElm.clientHeight; + + // Register envent handlers + mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove); + mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove); + mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize); + mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize); + }); + }); + } + + o.deltaHeight -= 21; + n = tb = null; + }, + + _updateUndoStatus : function(ed) { + var cm = ed.controlManager, um = ed.undoManager; + + cm.setDisabled('undo', !um.hasUndo() && !um.typing); + cm.setDisabled('redo', !um.hasRedo()); + }, + + _nodeChanged : function(ed, cm, n, co, ob) { + var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches; + + tinymce.each(t.stateControls, function(c) { + cm.setActive(c, ed.queryCommandState(t.controls[c][1])); + }); + + function getParent(name) { + var i, parents = ob.parents, func = name; + + if (typeof(name) == 'string') { + func = function(node) { + return node.nodeName == name; + }; + } + + for (i = 0; i < parents.length; i++) { + if (func(parents[i])) + return parents[i]; + } + }; + + cm.setActive('visualaid', ed.hasVisual); + t._updateUndoStatus(ed); + cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); + + p = getParent('A'); + if (c = cm.get('link')) { + if (!p || !p.name) { + c.setDisabled(!p && co); + c.setActive(!!p); + } + } + + if (c = cm.get('unlink')) { + c.setDisabled(!p && co); + c.setActive(!!p && !p.name); + } + + if (c = cm.get('anchor')) { + c.setActive(!co && !!p && p.name); + } + + p = getParent('IMG'); + if (c = cm.get('image')) + c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1); + + if (c = cm.get('styleselect')) { + t._importClasses(); + + formatNames = []; + each(c.items, function(item) { + formatNames.push(item.value); + }); + + matches = ed.formatter.matchAll(formatNames); + c.select(matches[0]); + } + + if (c = cm.get('formatselect')) { + p = getParent(DOM.isBlock); + + if (p) + c.select(p.nodeName.toLowerCase()); + } + + // Find out current fontSize, fontFamily and fontClass + getParent(function(n) { + if (n.nodeName === 'SPAN') { + if (!cl && n.className) + cl = n.className; + } + + if (ed.dom.is(n, s.theme_advanced_font_selector)) { + if (!fz && n.style.fontSize) + fz = n.style.fontSize; + + if (!fn && n.style.fontFamily) + fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); + + if (!fc && n.style.color) + fc = n.style.color; + + if (!bc && n.style.backgroundColor) + bc = n.style.backgroundColor; + } + + return false; + }); + + if (c = cm.get('fontselect')) { + c.select(function(v) { + return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; + }); + } + + // Select font size + if (c = cm.get('fontsizeselect')) { + // Use computed style + if (s.theme_advanced_runtime_fontsize && !fz && !cl) + fz = ed.dom.getStyle(n, 'fontSize', true); + + c.select(function(v) { + if (v.fontSize && v.fontSize === fz) + return true; + + if (v['class'] && v['class'] === cl) + return true; + }); + } + + if (s.theme_advanced_show_current_color) { + function updateColor(controlId, color) { + if (c = cm.get(controlId)) { + if (!color) + color = c.settings.default_color; + if (color !== c.value) { + c.displayColor(color); + } + } + } + updateColor('forecolor', fc); + updateColor('backcolor', bc); + } + + if (s.theme_advanced_show_current_color) { + function updateColor(controlId, color) { + if (c = cm.get(controlId)) { + if (!color) + color = c.settings.default_color; + if (color !== c.value) { + c.displayColor(color); + } + } + }; + + updateColor('forecolor', fc); + updateColor('backcolor', bc); + } + + if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { + p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); + + if (t.statusKeyboardNavigation) { + t.statusKeyboardNavigation.destroy(); + t.statusKeyboardNavigation = null; + } + + DOM.setHTML(p, ''); + + getParent(function(n) { + var na = n.nodeName.toLowerCase(), u, pi, ti = ''; + + // Ignore non element and bogus/hidden elements + if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')) + return; + + // Handle prefix + if (tinymce.isIE && n.scopeName !== 'HTML') + na = n.scopeName + ':' + na; + + // Remove internal prefix + na = na.replace(/mce\:/g, ''); + + // Handle node name + switch (na) { + case 'b': + na = 'strong'; + break; + + case 'i': + na = 'em'; + break; + + case 'img': + if (v = DOM.getAttrib(n, 'src')) + ti += 'src: ' + v + ' '; + + break; + + case 'a': + if (v = DOM.getAttrib(n, 'name')) { + ti += 'name: ' + v + ' '; + na += '#' + v; + } + + if (v = DOM.getAttrib(n, 'href')) + ti += 'href: ' + v + ' '; + + break; + + case 'font': + if (v = DOM.getAttrib(n, 'face')) + ti += 'font: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'size')) + ti += 'size: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'color')) + ti += 'color: ' + v + ' '; + + break; + + case 'span': + if (v = DOM.getAttrib(n, 'style')) + ti += 'style: ' + v + ' '; + + break; + } + + if (v = DOM.getAttrib(n, 'id')) + ti += 'id: ' + v + ' '; + + if (v = n.className) { + v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '') + + if (v) { + ti += 'class: ' + v + ' '; + + if (DOM.isBlock(n) || na == 'img' || na == 'span') + na += '.' + v; + } + } + + na = na.replace(/(html:)/g, ''); + na = {name : na, node : n, title : ti}; + t.onResolveName.dispatch(t, na); + ti = na.title; + na = na.name; + + //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; + pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); + + if (p.hasChildNodes()) { + p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild); + p.insertBefore(pi, p.firstChild); + } else + p.appendChild(pi); + }, ed.getBody()); + + if (DOM.select('a', p).length > 0) { + t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({ + root: ed.id + "_path_row", + items: DOM.select('a', p), + excludeFromTabOrder: true, + onCancel: function() { + ed.focus(); + } + }, DOM); + } + } + }, + + // Commands gets called by execCommand + + _sel : function(v) { + this.editor.execCommand('mceSelectNodeDepth', false, v); + }, + + _mceInsertAnchor : function(ui, v) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/anchor.htm', + width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), + height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceCharMap : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/charmap.htm', + width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), + height : 265 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceHelp : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/about.htm', + width : 480, + height : 380, + inline : true + }, { + theme_url : this.url + }); + }, + + _mceShortcuts : function() { + var ed = this.editor; + ed.windowManager.open({ + url: this.url + '/shortcuts.htm', + width: 480, + height: 380, + inline: true + }, { + theme_url: this.url + }); + }, + + _mceColorPicker : function(u, v) { + var ed = this.editor; + + v = v || {}; + + ed.windowManager.open({ + url : this.url + '/color_picker.htm', + width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), + height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), + close_previous : false, + inline : true + }, { + input_color : v.color, + func : v.func, + theme_url : this.url + }); + }, + + _mceCodeEditor : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/source_editor.htm', + width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), + height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), + inline : true, + resizable : true, + maximizable : true + }, { + theme_url : this.url + }); + }, + + _mceImage : function(ui, val) { + var ed = this.editor; + + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + url : this.url + '/image.htm', + width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), + height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceLink : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : this.url + '/link.htm', + width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), + height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceNewDocument : function() { + var ed = this.editor; + + ed.windowManager.confirm('advanced.newdocument', function(s) { + if (s) + ed.execCommand('mceSetContent', false, ''); + }); + }, + + _mceForeColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.fgColor, + func : function(co) { + t.fgColor = co; + t.editor.execCommand('ForeColor', false, co); + } + }); + }, + + _mceBackColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.bgColor, + func : function(co) { + t.bgColor = co; + t.editor.execCommand('HiliteColor', false, co); + } + }); + }, + + _ufirst : function(s) { + return s.substring(0, 1).toUpperCase() + s.substring(1); + } + }); + + tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); +}(tinymce)); diff --git a/engine/lib/external/tinymce-jq/themes/advanced/image.htm b/templates/framework/js/vendor/tinymce-jq/themes/advanced/image.htm similarity index 98% rename from engine/lib/external/tinymce-jq/themes/advanced/image.htm rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/image.htm index b8ba729f..884890fb 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/image.htm +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/image.htm @@ -1,80 +1,80 @@ - - - - {#advanced_dlg.image_title} - - - - - - -
- - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
 
- x -
-
-
- -
- - -
-
- - + + + + {#advanced_dlg.image_title} + + + + + + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
 
+ x +
+
+
+ +
+ + +
+
+ + diff --git a/engine/lib/external/tinymce-jq/themes/advanced/img/colorpicker.jpg b/templates/framework/js/vendor/tinymce-jq/themes/advanced/img/colorpicker.jpg similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/img/colorpicker.jpg rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/img/colorpicker.jpg diff --git a/engine/lib/external/tinymce-jq/themes/advanced/img/flash.gif b/templates/framework/js/vendor/tinymce-jq/themes/advanced/img/flash.gif similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/img/flash.gif rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/img/flash.gif diff --git a/engine/lib/external/tinymce-jq/themes/advanced/img/icons.gif b/templates/framework/js/vendor/tinymce-jq/themes/advanced/img/icons.gif similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/img/icons.gif rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/img/icons.gif diff --git a/engine/lib/external/tinymce-jq/themes/advanced/img/iframe.gif b/templates/framework/js/vendor/tinymce-jq/themes/advanced/img/iframe.gif similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/img/iframe.gif rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/img/iframe.gif diff --git a/engine/lib/external/tinymce-jq/themes/advanced/img/pagebreak.gif b/templates/framework/js/vendor/tinymce-jq/themes/advanced/img/pagebreak.gif similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/img/pagebreak.gif rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/img/pagebreak.gif diff --git a/engine/lib/external/tinymce-jq/themes/advanced/img/quicktime.gif b/templates/framework/js/vendor/tinymce-jq/themes/advanced/img/quicktime.gif similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/img/quicktime.gif rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/img/quicktime.gif diff --git a/engine/lib/external/tinymce-jq/themes/advanced/img/realmedia.gif b/templates/framework/js/vendor/tinymce-jq/themes/advanced/img/realmedia.gif similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/img/realmedia.gif rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/img/realmedia.gif diff --git a/engine/lib/external/tinymce-jq/themes/advanced/img/shockwave.gif b/templates/framework/js/vendor/tinymce-jq/themes/advanced/img/shockwave.gif similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/img/shockwave.gif rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/img/shockwave.gif diff --git a/engine/lib/external/tinymce-jq/themes/advanced/img/trans.gif b/templates/framework/js/vendor/tinymce-jq/themes/advanced/img/trans.gif similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/img/trans.gif rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/img/trans.gif diff --git a/engine/lib/external/tinymce-jq/themes/advanced/img/video.gif b/templates/framework/js/vendor/tinymce-jq/themes/advanced/img/video.gif similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/img/video.gif rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/img/video.gif diff --git a/engine/lib/external/tinymce-jq/themes/advanced/img/windowsmedia.gif b/templates/framework/js/vendor/tinymce-jq/themes/advanced/img/windowsmedia.gif similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/img/windowsmedia.gif rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/img/windowsmedia.gif diff --git a/engine/lib/external/tinymce-jq/themes/advanced/js/about.js b/templates/framework/js/vendor/tinymce-jq/themes/advanced/js/about.js similarity index 96% rename from engine/lib/external/tinymce-jq/themes/advanced/js/about.js rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/js/about.js index 5b358457..daf4909a 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/js/about.js +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/js/about.js @@ -1,73 +1,73 @@ -tinyMCEPopup.requireLangPack(); - -function init() { - var ed, tcont; - - tinyMCEPopup.resizeToInnerSize(); - ed = tinyMCEPopup.editor; - - // Give FF some time - window.setTimeout(insertHelpIFrame, 10); - - tcont = document.getElementById('plugintablecontainer'); - document.getElementById('plugins_tab').style.display = 'none'; - - var html = ""; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - - tinymce.each(ed.plugins, function(p, n) { - var info; - - if (!p.getInfo) - return; - - html += ''; - - info = p.getInfo(); - - if (info.infourl != null && info.infourl != '') - html += ''; - else - html += ''; - - if (info.authorurl != null && info.authorurl != '') - html += ''; - else - html += ''; - - html += ''; - html += ''; - - document.getElementById('plugins_tab').style.display = ''; - - }); - - html += ''; - html += '
' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
'; - - tcont.innerHTML = html; - - tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; - tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; -} - -function insertHelpIFrame() { - var html; - - if (tinyMCEPopup.getParam('docs_url')) { - html = ''; - document.getElementById('iframecontainer').innerHTML = html; - document.getElementById('help_tab').style.display = 'block'; - document.getElementById('help_tab').setAttribute("aria-hidden", "false"); - } -} - -tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); + +function init() { + var ed, tcont; + + tinyMCEPopup.resizeToInnerSize(); + ed = tinyMCEPopup.editor; + + // Give FF some time + window.setTimeout(insertHelpIFrame, 10); + + tcont = document.getElementById('plugintablecontainer'); + document.getElementById('plugins_tab').style.display = 'none'; + + var html = ""; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + + tinymce.each(ed.plugins, function(p, n) { + var info; + + if (!p.getInfo) + return; + + html += ''; + + info = p.getInfo(); + + if (info.infourl != null && info.infourl != '') + html += ''; + else + html += ''; + + if (info.authorurl != null && info.authorurl != '') + html += ''; + else + html += ''; + + html += ''; + html += ''; + + document.getElementById('plugins_tab').style.display = ''; + + }); + + html += ''; + html += '
' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
'; + + tcont.innerHTML = html; + + tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; + tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; +} + +function insertHelpIFrame() { + var html; + + if (tinyMCEPopup.getParam('docs_url')) { + html = ''; + document.getElementById('iframecontainer').innerHTML = html; + document.getElementById('help_tab').style.display = 'block'; + document.getElementById('help_tab').setAttribute("aria-hidden", "false"); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/engine/lib/external/tinymce-jq/themes/advanced/js/anchor.js b/templates/framework/js/vendor/tinymce-jq/themes/advanced/js/anchor.js similarity index 95% rename from engine/lib/external/tinymce-jq/themes/advanced/js/anchor.js rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/js/anchor.js index 04f41e0c..b6c5b695 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/js/anchor.js +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/js/anchor.js @@ -1,43 +1,43 @@ -tinyMCEPopup.requireLangPack(); - -var AnchorDialog = { - init : function(ed) { - var action, elm, f = document.forms[0]; - - this.editor = ed; - elm = ed.dom.getParent(ed.selection.getNode(), 'A'); - v = ed.dom.getAttrib(elm, 'name'); - - if (v) { - this.action = 'update'; - f.anchorName.value = v; - } - - f.insert.value = ed.getLang(elm ? 'update' : 'insert'); - }, - - update : function() { - var ed = this.editor, elm, name = document.forms[0].anchorName.value; - - if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { - tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); - return; - } - - tinyMCEPopup.restoreSelection(); - - if (this.action != 'update') - ed.selection.collapse(1); - - elm = ed.dom.getParent(ed.selection.getNode(), 'A'); - if (elm) { - elm.setAttribute('name', name); - elm.name = name; - } else - ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '')); - - tinyMCEPopup.close(); - } -}; - -tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); +tinyMCEPopup.requireLangPack(); + +var AnchorDialog = { + init : function(ed) { + var action, elm, f = document.forms[0]; + + this.editor = ed; + elm = ed.dom.getParent(ed.selection.getNode(), 'A'); + v = ed.dom.getAttrib(elm, 'name'); + + if (v) { + this.action = 'update'; + f.anchorName.value = v; + } + + f.insert.value = ed.getLang(elm ? 'update' : 'insert'); + }, + + update : function() { + var ed = this.editor, elm, name = document.forms[0].anchorName.value; + + if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { + tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); + return; + } + + tinyMCEPopup.restoreSelection(); + + if (this.action != 'update') + ed.selection.collapse(1); + + elm = ed.dom.getParent(ed.selection.getNode(), 'A'); + if (elm) { + elm.setAttribute('name', name); + elm.name = name; + } else + ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '')); + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); diff --git a/engine/lib/external/tinymce-jq/themes/advanced/js/charmap.js b/templates/framework/js/vendor/tinymce-jq/themes/advanced/js/charmap.js similarity index 97% rename from engine/lib/external/tinymce-jq/themes/advanced/js/charmap.js rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/js/charmap.js index bb186955..cbb4172b 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/js/charmap.js +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/js/charmap.js @@ -1,363 +1,363 @@ -/** - * charmap.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -tinyMCEPopup.requireLangPack(); - -var charmap = [ - [' ', ' ', true, 'no-break space'], - ['&', '&', true, 'ampersand'], - ['"', '"', true, 'quotation mark'], -// finance - ['¢', '¢', true, 'cent sign'], - ['€', '€', true, 'euro sign'], - ['£', '£', true, 'pound sign'], - ['¥', '¥', true, 'yen sign'], -// signs - ['©', '©', true, 'copyright sign'], - ['®', '®', true, 'registered sign'], - ['™', '™', true, 'trade mark sign'], - ['‰', '‰', true, 'per mille sign'], - ['µ', 'µ', true, 'micro sign'], - ['·', '·', true, 'middle dot'], - ['•', '•', true, 'bullet'], - ['…', '…', true, 'three dot leader'], - ['′', '′', true, 'minutes / feet'], - ['″', '″', true, 'seconds / inches'], - ['§', '§', true, 'section sign'], - ['¶', '¶', true, 'paragraph sign'], - ['ß', 'ß', true, 'sharp s / ess-zed'], -// quotations - ['‹', '‹', true, 'single left-pointing angle quotation mark'], - ['›', '›', true, 'single right-pointing angle quotation mark'], - ['«', '«', true, 'left pointing guillemet'], - ['»', '»', true, 'right pointing guillemet'], - ['‘', '‘', true, 'left single quotation mark'], - ['’', '’', true, 'right single quotation mark'], - ['“', '“', true, 'left double quotation mark'], - ['”', '”', true, 'right double quotation mark'], - ['‚', '‚', true, 'single low-9 quotation mark'], - ['„', '„', true, 'double low-9 quotation mark'], - ['<', '<', true, 'less-than sign'], - ['>', '>', true, 'greater-than sign'], - ['≤', '≤', true, 'less-than or equal to'], - ['≥', '≥', true, 'greater-than or equal to'], - ['–', '–', true, 'en dash'], - ['—', '—', true, 'em dash'], - ['¯', '¯', true, 'macron'], - ['‾', '‾', true, 'overline'], - ['¤', '¤', true, 'currency sign'], - ['¦', '¦', true, 'broken bar'], - ['¨', '¨', true, 'diaeresis'], - ['¡', '¡', true, 'inverted exclamation mark'], - ['¿', '¿', true, 'turned question mark'], - ['ˆ', 'ˆ', true, 'circumflex accent'], - ['˜', '˜', true, 'small tilde'], - ['°', '°', true, 'degree sign'], - ['−', '−', true, 'minus sign'], - ['±', '±', true, 'plus-minus sign'], - ['÷', '÷', true, 'division sign'], - ['⁄', '⁄', true, 'fraction slash'], - ['×', '×', true, 'multiplication sign'], - ['¹', '¹', true, 'superscript one'], - ['²', '²', true, 'superscript two'], - ['³', '³', true, 'superscript three'], - ['¼', '¼', true, 'fraction one quarter'], - ['½', '½', true, 'fraction one half'], - ['¾', '¾', true, 'fraction three quarters'], -// math / logical - ['ƒ', 'ƒ', true, 'function / florin'], - ['∫', '∫', true, 'integral'], - ['∑', '∑', true, 'n-ary sumation'], - ['∞', '∞', true, 'infinity'], - ['√', '√', true, 'square root'], - ['∼', '∼', false,'similar to'], - ['≅', '≅', false,'approximately equal to'], - ['≈', '≈', true, 'almost equal to'], - ['≠', '≠', true, 'not equal to'], - ['≡', '≡', true, 'identical to'], - ['∈', '∈', false,'element of'], - ['∉', '∉', false,'not an element of'], - ['∋', '∋', false,'contains as member'], - ['∏', '∏', true, 'n-ary product'], - ['∧', '∧', false,'logical and'], - ['∨', '∨', false,'logical or'], - ['¬', '¬', true, 'not sign'], - ['∩', '∩', true, 'intersection'], - ['∪', '∪', false,'union'], - ['∂', '∂', true, 'partial differential'], - ['∀', '∀', false,'for all'], - ['∃', '∃', false,'there exists'], - ['∅', '∅', false,'diameter'], - ['∇', '∇', false,'backward difference'], - ['∗', '∗', false,'asterisk operator'], - ['∝', '∝', false,'proportional to'], - ['∠', '∠', false,'angle'], -// undefined - ['´', '´', true, 'acute accent'], - ['¸', '¸', true, 'cedilla'], - ['ª', 'ª', true, 'feminine ordinal indicator'], - ['º', 'º', true, 'masculine ordinal indicator'], - ['†', '†', true, 'dagger'], - ['‡', '‡', true, 'double dagger'], -// alphabetical special chars - ['À', 'À', true, 'A - grave'], - ['Á', 'Á', true, 'A - acute'], - ['Â', 'Â', true, 'A - circumflex'], - ['Ã', 'Ã', true, 'A - tilde'], - ['Ä', 'Ä', true, 'A - diaeresis'], - ['Å', 'Å', true, 'A - ring above'], - ['Æ', 'Æ', true, 'ligature AE'], - ['Ç', 'Ç', true, 'C - cedilla'], - ['È', 'È', true, 'E - grave'], - ['É', 'É', true, 'E - acute'], - ['Ê', 'Ê', true, 'E - circumflex'], - ['Ë', 'Ë', true, 'E - diaeresis'], - ['Ì', 'Ì', true, 'I - grave'], - ['Í', 'Í', true, 'I - acute'], - ['Î', 'Î', true, 'I - circumflex'], - ['Ï', 'Ï', true, 'I - diaeresis'], - ['Ð', 'Ð', true, 'ETH'], - ['Ñ', 'Ñ', true, 'N - tilde'], - ['Ò', 'Ò', true, 'O - grave'], - ['Ó', 'Ó', true, 'O - acute'], - ['Ô', 'Ô', true, 'O - circumflex'], - ['Õ', 'Õ', true, 'O - tilde'], - ['Ö', 'Ö', true, 'O - diaeresis'], - ['Ø', 'Ø', true, 'O - slash'], - ['Œ', 'Œ', true, 'ligature OE'], - ['Š', 'Š', true, 'S - caron'], - ['Ù', 'Ù', true, 'U - grave'], - ['Ú', 'Ú', true, 'U - acute'], - ['Û', 'Û', true, 'U - circumflex'], - ['Ü', 'Ü', true, 'U - diaeresis'], - ['Ý', 'Ý', true, 'Y - acute'], - ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], - ['Þ', 'Þ', true, 'THORN'], - ['à', 'à', true, 'a - grave'], - ['á', 'á', true, 'a - acute'], - ['â', 'â', true, 'a - circumflex'], - ['ã', 'ã', true, 'a - tilde'], - ['ä', 'ä', true, 'a - diaeresis'], - ['å', 'å', true, 'a - ring above'], - ['æ', 'æ', true, 'ligature ae'], - ['ç', 'ç', true, 'c - cedilla'], - ['è', 'è', true, 'e - grave'], - ['é', 'é', true, 'e - acute'], - ['ê', 'ê', true, 'e - circumflex'], - ['ë', 'ë', true, 'e - diaeresis'], - ['ì', 'ì', true, 'i - grave'], - ['í', 'í', true, 'i - acute'], - ['î', 'î', true, 'i - circumflex'], - ['ï', 'ï', true, 'i - diaeresis'], - ['ð', 'ð', true, 'eth'], - ['ñ', 'ñ', true, 'n - tilde'], - ['ò', 'ò', true, 'o - grave'], - ['ó', 'ó', true, 'o - acute'], - ['ô', 'ô', true, 'o - circumflex'], - ['õ', 'õ', true, 'o - tilde'], - ['ö', 'ö', true, 'o - diaeresis'], - ['ø', 'ø', true, 'o slash'], - ['œ', 'œ', true, 'ligature oe'], - ['š', 'š', true, 's - caron'], - ['ù', 'ù', true, 'u - grave'], - ['ú', 'ú', true, 'u - acute'], - ['û', 'û', true, 'u - circumflex'], - ['ü', 'ü', true, 'u - diaeresis'], - ['ý', 'ý', true, 'y - acute'], - ['þ', 'þ', true, 'thorn'], - ['ÿ', 'ÿ', true, 'y - diaeresis'], - ['Α', 'Α', true, 'Alpha'], - ['Β', 'Β', true, 'Beta'], - ['Γ', 'Γ', true, 'Gamma'], - ['Δ', 'Δ', true, 'Delta'], - ['Ε', 'Ε', true, 'Epsilon'], - ['Ζ', 'Ζ', true, 'Zeta'], - ['Η', 'Η', true, 'Eta'], - ['Θ', 'Θ', true, 'Theta'], - ['Ι', 'Ι', true, 'Iota'], - ['Κ', 'Κ', true, 'Kappa'], - ['Λ', 'Λ', true, 'Lambda'], - ['Μ', 'Μ', true, 'Mu'], - ['Ν', 'Ν', true, 'Nu'], - ['Ξ', 'Ξ', true, 'Xi'], - ['Ο', 'Ο', true, 'Omicron'], - ['Π', 'Π', true, 'Pi'], - ['Ρ', 'Ρ', true, 'Rho'], - ['Σ', 'Σ', true, 'Sigma'], - ['Τ', 'Τ', true, 'Tau'], - ['Υ', 'Υ', true, 'Upsilon'], - ['Φ', 'Φ', true, 'Phi'], - ['Χ', 'Χ', true, 'Chi'], - ['Ψ', 'Ψ', true, 'Psi'], - ['Ω', 'Ω', true, 'Omega'], - ['α', 'α', true, 'alpha'], - ['β', 'β', true, 'beta'], - ['γ', 'γ', true, 'gamma'], - ['δ', 'δ', true, 'delta'], - ['ε', 'ε', true, 'epsilon'], - ['ζ', 'ζ', true, 'zeta'], - ['η', 'η', true, 'eta'], - ['θ', 'θ', true, 'theta'], - ['ι', 'ι', true, 'iota'], - ['κ', 'κ', true, 'kappa'], - ['λ', 'λ', true, 'lambda'], - ['μ', 'μ', true, 'mu'], - ['ν', 'ν', true, 'nu'], - ['ξ', 'ξ', true, 'xi'], - ['ο', 'ο', true, 'omicron'], - ['π', 'π', true, 'pi'], - ['ρ', 'ρ', true, 'rho'], - ['ς', 'ς', true, 'final sigma'], - ['σ', 'σ', true, 'sigma'], - ['τ', 'τ', true, 'tau'], - ['υ', 'υ', true, 'upsilon'], - ['φ', 'φ', true, 'phi'], - ['χ', 'χ', true, 'chi'], - ['ψ', 'ψ', true, 'psi'], - ['ω', 'ω', true, 'omega'], -// symbols - ['ℵ', 'ℵ', false,'alef symbol'], - ['ϖ', 'ϖ', false,'pi symbol'], - ['ℜ', 'ℜ', false,'real part symbol'], - ['ϑ','ϑ', false,'theta symbol'], - ['ϒ', 'ϒ', false,'upsilon - hook symbol'], - ['℘', '℘', false,'Weierstrass p'], - ['ℑ', 'ℑ', false,'imaginary part'], -// arrows - ['←', '←', true, 'leftwards arrow'], - ['↑', '↑', true, 'upwards arrow'], - ['→', '→', true, 'rightwards arrow'], - ['↓', '↓', true, 'downwards arrow'], - ['↔', '↔', true, 'left right arrow'], - ['↵', '↵', false,'carriage return'], - ['⇐', '⇐', false,'leftwards double arrow'], - ['⇑', '⇑', false,'upwards double arrow'], - ['⇒', '⇒', false,'rightwards double arrow'], - ['⇓', '⇓', false,'downwards double arrow'], - ['⇔', '⇔', false,'left right double arrow'], - ['∴', '∴', false,'therefore'], - ['⊂', '⊂', false,'subset of'], - ['⊃', '⊃', false,'superset of'], - ['⊄', '⊄', false,'not a subset of'], - ['⊆', '⊆', false,'subset of or equal to'], - ['⊇', '⊇', false,'superset of or equal to'], - ['⊕', '⊕', false,'circled plus'], - ['⊗', '⊗', false,'circled times'], - ['⊥', '⊥', false,'perpendicular'], - ['⋅', '⋅', false,'dot operator'], - ['⌈', '⌈', false,'left ceiling'], - ['⌉', '⌉', false,'right ceiling'], - ['⌊', '⌊', false,'left floor'], - ['⌋', '⌋', false,'right floor'], - ['⟨', '〈', false,'left-pointing angle bracket'], - ['⟩', '〉', false,'right-pointing angle bracket'], - ['◊', '◊', true, 'lozenge'], - ['♠', '♠', true, 'black spade suit'], - ['♣', '♣', true, 'black club suit'], - ['♥', '♥', true, 'black heart suit'], - ['♦', '♦', true, 'black diamond suit'], - [' ', ' ', false,'en space'], - [' ', ' ', false,'em space'], - [' ', ' ', false,'thin space'], - ['‌', '‌', false,'zero width non-joiner'], - ['‍', '‍', false,'zero width joiner'], - ['‎', '‎', false,'left-to-right mark'], - ['‏', '‏', false,'right-to-left mark'], - ['­', '­', false,'soft hyphen'] -]; - -tinyMCEPopup.onInit.add(function() { - tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); - addKeyboardNavigation(); -}); - -function addKeyboardNavigation(){ - var tableElm, cells, settings; - - cells = tinyMCEPopup.dom.select("a.charmaplink", "charmapgroup"); - - settings ={ - root: "charmapgroup", - items: cells - }; - cells[0].tabindex=0; - tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); - if (tinymce.isGecko) { - cells[0].focus(); - } else { - setTimeout(function(){ - cells[0].focus(); - }, 100); - } - tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); -} - -function renderCharMapHTML() { - var charsPerRow = 20, tdWidth=20, tdHeight=20, i; - var html = '
'+ - ''; - var cols=-1; - - for (i=0; i' - + '' - + charmap[i][1] - + ''; - if ((cols+1) % charsPerRow == 0) - html += ''; - } - } - - if (cols % charsPerRow > 0) { - var padd = charsPerRow - (cols % charsPerRow); - for (var i=0; i '; - } - - html += '
'; - html = html.replace(/<\/tr>/g, ''); - - return html; -} - -function insertChar(chr) { - tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); - - // Refocus in window - if (tinyMCEPopup.isWindow) - window.focus(); - - tinyMCEPopup.editor.focus(); - tinyMCEPopup.close(); -} - -function previewChar(codeA, codeB, codeN) { - var elmA = document.getElementById('codeA'); - var elmB = document.getElementById('codeB'); - var elmV = document.getElementById('codeV'); - var elmN = document.getElementById('codeN'); - - if (codeA=='#160;') { - elmV.innerHTML = '__'; - } else { - elmV.innerHTML = '&' + codeA; - } - - elmB.innerHTML = '&' + codeA; - elmA.innerHTML = '&' + codeB; - elmN.innerHTML = codeN; -} +/** + * charmap.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +tinyMCEPopup.requireLangPack(); + +var charmap = [ + [' ', ' ', true, 'no-break space'], + ['&', '&', true, 'ampersand'], + ['"', '"', true, 'quotation mark'], +// finance + ['¢', '¢', true, 'cent sign'], + ['€', '€', true, 'euro sign'], + ['£', '£', true, 'pound sign'], + ['¥', '¥', true, 'yen sign'], +// signs + ['©', '©', true, 'copyright sign'], + ['®', '®', true, 'registered sign'], + ['™', '™', true, 'trade mark sign'], + ['‰', '‰', true, 'per mille sign'], + ['µ', 'µ', true, 'micro sign'], + ['·', '·', true, 'middle dot'], + ['•', '•', true, 'bullet'], + ['…', '…', true, 'three dot leader'], + ['′', '′', true, 'minutes / feet'], + ['″', '″', true, 'seconds / inches'], + ['§', '§', true, 'section sign'], + ['¶', '¶', true, 'paragraph sign'], + ['ß', 'ß', true, 'sharp s / ess-zed'], +// quotations + ['‹', '‹', true, 'single left-pointing angle quotation mark'], + ['›', '›', true, 'single right-pointing angle quotation mark'], + ['«', '«', true, 'left pointing guillemet'], + ['»', '»', true, 'right pointing guillemet'], + ['‘', '‘', true, 'left single quotation mark'], + ['’', '’', true, 'right single quotation mark'], + ['“', '“', true, 'left double quotation mark'], + ['”', '”', true, 'right double quotation mark'], + ['‚', '‚', true, 'single low-9 quotation mark'], + ['„', '„', true, 'double low-9 quotation mark'], + ['<', '<', true, 'less-than sign'], + ['>', '>', true, 'greater-than sign'], + ['≤', '≤', true, 'less-than or equal to'], + ['≥', '≥', true, 'greater-than or equal to'], + ['–', '–', true, 'en dash'], + ['—', '—', true, 'em dash'], + ['¯', '¯', true, 'macron'], + ['‾', '‾', true, 'overline'], + ['¤', '¤', true, 'currency sign'], + ['¦', '¦', true, 'broken bar'], + ['¨', '¨', true, 'diaeresis'], + ['¡', '¡', true, 'inverted exclamation mark'], + ['¿', '¿', true, 'turned question mark'], + ['ˆ', 'ˆ', true, 'circumflex accent'], + ['˜', '˜', true, 'small tilde'], + ['°', '°', true, 'degree sign'], + ['−', '−', true, 'minus sign'], + ['±', '±', true, 'plus-minus sign'], + ['÷', '÷', true, 'division sign'], + ['⁄', '⁄', true, 'fraction slash'], + ['×', '×', true, 'multiplication sign'], + ['¹', '¹', true, 'superscript one'], + ['²', '²', true, 'superscript two'], + ['³', '³', true, 'superscript three'], + ['¼', '¼', true, 'fraction one quarter'], + ['½', '½', true, 'fraction one half'], + ['¾', '¾', true, 'fraction three quarters'], +// math / logical + ['ƒ', 'ƒ', true, 'function / florin'], + ['∫', '∫', true, 'integral'], + ['∑', '∑', true, 'n-ary sumation'], + ['∞', '∞', true, 'infinity'], + ['√', '√', true, 'square root'], + ['∼', '∼', false,'similar to'], + ['≅', '≅', false,'approximately equal to'], + ['≈', '≈', true, 'almost equal to'], + ['≠', '≠', true, 'not equal to'], + ['≡', '≡', true, 'identical to'], + ['∈', '∈', false,'element of'], + ['∉', '∉', false,'not an element of'], + ['∋', '∋', false,'contains as member'], + ['∏', '∏', true, 'n-ary product'], + ['∧', '∧', false,'logical and'], + ['∨', '∨', false,'logical or'], + ['¬', '¬', true, 'not sign'], + ['∩', '∩', true, 'intersection'], + ['∪', '∪', false,'union'], + ['∂', '∂', true, 'partial differential'], + ['∀', '∀', false,'for all'], + ['∃', '∃', false,'there exists'], + ['∅', '∅', false,'diameter'], + ['∇', '∇', false,'backward difference'], + ['∗', '∗', false,'asterisk operator'], + ['∝', '∝', false,'proportional to'], + ['∠', '∠', false,'angle'], +// undefined + ['´', '´', true, 'acute accent'], + ['¸', '¸', true, 'cedilla'], + ['ª', 'ª', true, 'feminine ordinal indicator'], + ['º', 'º', true, 'masculine ordinal indicator'], + ['†', '†', true, 'dagger'], + ['‡', '‡', true, 'double dagger'], +// alphabetical special chars + ['À', 'À', true, 'A - grave'], + ['Á', 'Á', true, 'A - acute'], + ['Â', 'Â', true, 'A - circumflex'], + ['Ã', 'Ã', true, 'A - tilde'], + ['Ä', 'Ä', true, 'A - diaeresis'], + ['Å', 'Å', true, 'A - ring above'], + ['Æ', 'Æ', true, 'ligature AE'], + ['Ç', 'Ç', true, 'C - cedilla'], + ['È', 'È', true, 'E - grave'], + ['É', 'É', true, 'E - acute'], + ['Ê', 'Ê', true, 'E - circumflex'], + ['Ë', 'Ë', true, 'E - diaeresis'], + ['Ì', 'Ì', true, 'I - grave'], + ['Í', 'Í', true, 'I - acute'], + ['Î', 'Î', true, 'I - circumflex'], + ['Ï', 'Ï', true, 'I - diaeresis'], + ['Ð', 'Ð', true, 'ETH'], + ['Ñ', 'Ñ', true, 'N - tilde'], + ['Ò', 'Ò', true, 'O - grave'], + ['Ó', 'Ó', true, 'O - acute'], + ['Ô', 'Ô', true, 'O - circumflex'], + ['Õ', 'Õ', true, 'O - tilde'], + ['Ö', 'Ö', true, 'O - diaeresis'], + ['Ø', 'Ø', true, 'O - slash'], + ['Œ', 'Œ', true, 'ligature OE'], + ['Š', 'Š', true, 'S - caron'], + ['Ù', 'Ù', true, 'U - grave'], + ['Ú', 'Ú', true, 'U - acute'], + ['Û', 'Û', true, 'U - circumflex'], + ['Ü', 'Ü', true, 'U - diaeresis'], + ['Ý', 'Ý', true, 'Y - acute'], + ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], + ['Þ', 'Þ', true, 'THORN'], + ['à', 'à', true, 'a - grave'], + ['á', 'á', true, 'a - acute'], + ['â', 'â', true, 'a - circumflex'], + ['ã', 'ã', true, 'a - tilde'], + ['ä', 'ä', true, 'a - diaeresis'], + ['å', 'å', true, 'a - ring above'], + ['æ', 'æ', true, 'ligature ae'], + ['ç', 'ç', true, 'c - cedilla'], + ['è', 'è', true, 'e - grave'], + ['é', 'é', true, 'e - acute'], + ['ê', 'ê', true, 'e - circumflex'], + ['ë', 'ë', true, 'e - diaeresis'], + ['ì', 'ì', true, 'i - grave'], + ['í', 'í', true, 'i - acute'], + ['î', 'î', true, 'i - circumflex'], + ['ï', 'ï', true, 'i - diaeresis'], + ['ð', 'ð', true, 'eth'], + ['ñ', 'ñ', true, 'n - tilde'], + ['ò', 'ò', true, 'o - grave'], + ['ó', 'ó', true, 'o - acute'], + ['ô', 'ô', true, 'o - circumflex'], + ['õ', 'õ', true, 'o - tilde'], + ['ö', 'ö', true, 'o - diaeresis'], + ['ø', 'ø', true, 'o slash'], + ['œ', 'œ', true, 'ligature oe'], + ['š', 'š', true, 's - caron'], + ['ù', 'ù', true, 'u - grave'], + ['ú', 'ú', true, 'u - acute'], + ['û', 'û', true, 'u - circumflex'], + ['ü', 'ü', true, 'u - diaeresis'], + ['ý', 'ý', true, 'y - acute'], + ['þ', 'þ', true, 'thorn'], + ['ÿ', 'ÿ', true, 'y - diaeresis'], + ['Α', 'Α', true, 'Alpha'], + ['Β', 'Β', true, 'Beta'], + ['Γ', 'Γ', true, 'Gamma'], + ['Δ', 'Δ', true, 'Delta'], + ['Ε', 'Ε', true, 'Epsilon'], + ['Ζ', 'Ζ', true, 'Zeta'], + ['Η', 'Η', true, 'Eta'], + ['Θ', 'Θ', true, 'Theta'], + ['Ι', 'Ι', true, 'Iota'], + ['Κ', 'Κ', true, 'Kappa'], + ['Λ', 'Λ', true, 'Lambda'], + ['Μ', 'Μ', true, 'Mu'], + ['Ν', 'Ν', true, 'Nu'], + ['Ξ', 'Ξ', true, 'Xi'], + ['Ο', 'Ο', true, 'Omicron'], + ['Π', 'Π', true, 'Pi'], + ['Ρ', 'Ρ', true, 'Rho'], + ['Σ', 'Σ', true, 'Sigma'], + ['Τ', 'Τ', true, 'Tau'], + ['Υ', 'Υ', true, 'Upsilon'], + ['Φ', 'Φ', true, 'Phi'], + ['Χ', 'Χ', true, 'Chi'], + ['Ψ', 'Ψ', true, 'Psi'], + ['Ω', 'Ω', true, 'Omega'], + ['α', 'α', true, 'alpha'], + ['β', 'β', true, 'beta'], + ['γ', 'γ', true, 'gamma'], + ['δ', 'δ', true, 'delta'], + ['ε', 'ε', true, 'epsilon'], + ['ζ', 'ζ', true, 'zeta'], + ['η', 'η', true, 'eta'], + ['θ', 'θ', true, 'theta'], + ['ι', 'ι', true, 'iota'], + ['κ', 'κ', true, 'kappa'], + ['λ', 'λ', true, 'lambda'], + ['μ', 'μ', true, 'mu'], + ['ν', 'ν', true, 'nu'], + ['ξ', 'ξ', true, 'xi'], + ['ο', 'ο', true, 'omicron'], + ['π', 'π', true, 'pi'], + ['ρ', 'ρ', true, 'rho'], + ['ς', 'ς', true, 'final sigma'], + ['σ', 'σ', true, 'sigma'], + ['τ', 'τ', true, 'tau'], + ['υ', 'υ', true, 'upsilon'], + ['φ', 'φ', true, 'phi'], + ['χ', 'χ', true, 'chi'], + ['ψ', 'ψ', true, 'psi'], + ['ω', 'ω', true, 'omega'], +// symbols + ['ℵ', 'ℵ', false,'alef symbol'], + ['ϖ', 'ϖ', false,'pi symbol'], + ['ℜ', 'ℜ', false,'real part symbol'], + ['ϑ','ϑ', false,'theta symbol'], + ['ϒ', 'ϒ', false,'upsilon - hook symbol'], + ['℘', '℘', false,'Weierstrass p'], + ['ℑ', 'ℑ', false,'imaginary part'], +// arrows + ['←', '←', true, 'leftwards arrow'], + ['↑', '↑', true, 'upwards arrow'], + ['→', '→', true, 'rightwards arrow'], + ['↓', '↓', true, 'downwards arrow'], + ['↔', '↔', true, 'left right arrow'], + ['↵', '↵', false,'carriage return'], + ['⇐', '⇐', false,'leftwards double arrow'], + ['⇑', '⇑', false,'upwards double arrow'], + ['⇒', '⇒', false,'rightwards double arrow'], + ['⇓', '⇓', false,'downwards double arrow'], + ['⇔', '⇔', false,'left right double arrow'], + ['∴', '∴', false,'therefore'], + ['⊂', '⊂', false,'subset of'], + ['⊃', '⊃', false,'superset of'], + ['⊄', '⊄', false,'not a subset of'], + ['⊆', '⊆', false,'subset of or equal to'], + ['⊇', '⊇', false,'superset of or equal to'], + ['⊕', '⊕', false,'circled plus'], + ['⊗', '⊗', false,'circled times'], + ['⊥', '⊥', false,'perpendicular'], + ['⋅', '⋅', false,'dot operator'], + ['⌈', '⌈', false,'left ceiling'], + ['⌉', '⌉', false,'right ceiling'], + ['⌊', '⌊', false,'left floor'], + ['⌋', '⌋', false,'right floor'], + ['⟨', '〈', false,'left-pointing angle bracket'], + ['⟩', '〉', false,'right-pointing angle bracket'], + ['◊', '◊', true, 'lozenge'], + ['♠', '♠', true, 'black spade suit'], + ['♣', '♣', true, 'black club suit'], + ['♥', '♥', true, 'black heart suit'], + ['♦', '♦', true, 'black diamond suit'], + [' ', ' ', false,'en space'], + [' ', ' ', false,'em space'], + [' ', ' ', false,'thin space'], + ['‌', '‌', false,'zero width non-joiner'], + ['‍', '‍', false,'zero width joiner'], + ['‎', '‎', false,'left-to-right mark'], + ['‏', '‏', false,'right-to-left mark'], + ['­', '­', false,'soft hyphen'] +]; + +tinyMCEPopup.onInit.add(function() { + tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); + addKeyboardNavigation(); +}); + +function addKeyboardNavigation(){ + var tableElm, cells, settings; + + cells = tinyMCEPopup.dom.select("a.charmaplink", "charmapgroup"); + + settings ={ + root: "charmapgroup", + items: cells + }; + cells[0].tabindex=0; + tinyMCEPopup.dom.addClass(cells[0], "mceFocus"); + if (tinymce.isGecko) { + cells[0].focus(); + } else { + setTimeout(function(){ + cells[0].focus(); + }, 100); + } + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); +} + +function renderCharMapHTML() { + var charsPerRow = 20, tdWidth=20, tdHeight=20, i; + var html = '
'+ + ''; + var cols=-1; + + for (i=0; i' + + '' + + charmap[i][1] + + ''; + if ((cols+1) % charsPerRow == 0) + html += ''; + } + } + + if (cols % charsPerRow > 0) { + var padd = charsPerRow - (cols % charsPerRow); + for (var i=0; i '; + } + + html += '
'; + html = html.replace(/<\/tr>/g, ''); + + return html; +} + +function insertChar(chr) { + tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); + + // Refocus in window + if (tinyMCEPopup.isWindow) + window.focus(); + + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); +} + +function previewChar(codeA, codeB, codeN) { + var elmA = document.getElementById('codeA'); + var elmB = document.getElementById('codeB'); + var elmV = document.getElementById('codeV'); + var elmN = document.getElementById('codeN'); + + if (codeA=='#160;') { + elmV.innerHTML = '__'; + } else { + elmV.innerHTML = '&' + codeA; + } + + elmB.innerHTML = '&' + codeA; + elmA.innerHTML = '&' + codeB; + elmN.innerHTML = codeN; +} diff --git a/engine/lib/external/tinymce-jq/themes/advanced/js/color_picker.js b/templates/framework/js/vendor/tinymce-jq/themes/advanced/js/color_picker.js similarity index 97% rename from engine/lib/external/tinymce-jq/themes/advanced/js/color_picker.js rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/js/color_picker.js index f51e703b..3cbf32c4 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/js/color_picker.js +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/js/color_picker.js @@ -1,329 +1,329 @@ -tinyMCEPopup.requireLangPack(); - -var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false; - -var colors = [ - "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", - "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", - "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", - "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", - "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", - "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", - "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", - "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", - "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", - "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", - "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", - "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", - "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", - "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", - "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", - "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", - "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", - "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", - "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", - "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", - "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", - "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", - "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", - "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", - "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", - "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", - "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" -]; - -var named = { - '#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', - '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown', - '#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue', - '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod', - '#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green', - '#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue', - '#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue', - '#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green', - '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey', - '#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory', - '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue', - '#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green', - '#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey', - '#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', - '#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue', - '#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin', - '#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid', - '#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff', - '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue', - '#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver', - '#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green', - '#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', - '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green' -}; - -var namedLookup = {}; - -function init() { - var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value; - - tinyMCEPopup.resizeToInnerSize(); - - generatePicker(); - generateWebColors(); - generateNamedColors(); - - if (inputColor) { - changeFinalColor(inputColor); - - col = convertHexToRGB(inputColor); - - if (col) - updateLight(col.r, col.g, col.b); - } - - for (key in named) { - value = named[key]; - namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase(); - } -} - -function toHexColor(color) { - var matches, red, green, blue, toInt = parseInt; - - function hex(value) { - value = parseInt(value).toString(16); - - return value.length > 1 ? value : '0' + value; // Padd with leading zero - }; - - color = color.replace(/[\s#]+/g, '').toLowerCase(); - color = namedLookup[color] || color; - matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})|([a-f0-9])([a-f0-9])([a-f0-9])$/.exec(color); - - if (matches) { - if (matches[1]) { - red = toInt(matches[1]); - green = toInt(matches[2]); - blue = toInt(matches[3]); - } else if (matches[4]) { - red = toInt(matches[4], 16); - green = toInt(matches[5], 16); - blue = toInt(matches[6], 16); - } else if (matches[7]) { - red = toInt(matches[7] + matches[7], 16); - green = toInt(matches[8] + matches[8], 16); - blue = toInt(matches[9] + matches[9], 16); - } - - return '#' + hex(red) + hex(green) + hex(blue); - } - - return ''; -} - -function insertAction() { - var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); - - tinyMCEPopup.restoreSelection(); - - if (f) - f(toHexColor(color)); - - tinyMCEPopup.close(); -} - -function showColor(color, name) { - if (name) - document.getElementById("colorname").innerHTML = name; - - document.getElementById("preview").style.backgroundColor = color; - document.getElementById("color").value = color.toUpperCase(); -} - -function convertRGBToHex(col) { - var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); - - if (!col) - return col; - - var rgb = col.replace(re, "$1,$2,$3").split(','); - if (rgb.length == 3) { - r = parseInt(rgb[0]).toString(16); - g = parseInt(rgb[1]).toString(16); - b = parseInt(rgb[2]).toString(16); - - r = r.length == 1 ? '0' + r : r; - g = g.length == 1 ? '0' + g : g; - b = b.length == 1 ? '0' + b : b; - - return "#" + r + g + b; - } - - return col; -} - -function convertHexToRGB(col) { - if (col.indexOf('#') != -1) { - col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); - - r = parseInt(col.substring(0, 2), 16); - g = parseInt(col.substring(2, 4), 16); - b = parseInt(col.substring(4, 6), 16); - - return {r : r, g : g, b : b}; - } - - return null; -} - -function generatePicker() { - var el = document.getElementById('light'), h = '', i; - - for (i = 0; i < detail; i++){ - h += '
'; - } - - el.innerHTML = h; -} - -function generateWebColors() { - var el = document.getElementById('webcolors'), h = '', i; - - if (el.className == 'generated') - return; - - // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby. - h += '
' - + ''; - - for (i=0; i' - + ''; - if (tinyMCEPopup.editor.forcedHighContrastMode) { - h += ''; - } - h += ''; - h += ''; - if ((i+1) % 18 == 0) - h += ''; - } - - h += '
'; - - el.innerHTML = h; - el.className = 'generated'; - - paintCanvas(el); - enableKeyboardNavigation(el.firstChild); -} - -function paintCanvas(el) { - tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) { - var context; - if (canvas.getContext && (context = canvas.getContext("2d"))) { - context.fillStyle = canvas.getAttribute('data-color'); - context.fillRect(0, 0, 10, 10); - } - }); -} -function generateNamedColors() { - var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; - - if (el.className == 'generated') - return; - - for (n in named) { - v = named[n]; - h += ''; - if (tinyMCEPopup.editor.forcedHighContrastMode) { - h += ''; - } - h += ''; - h += ''; - i++; - } - - el.innerHTML = h; - el.className = 'generated'; - - paintCanvas(el); - enableKeyboardNavigation(el); -} - -function enableKeyboardNavigation(el) { - tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { - root: el, - items: tinyMCEPopup.dom.select('a', el) - }, tinyMCEPopup.dom); -} - -function dechex(n) { - return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); -} - -function computeColor(e) { - var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target); - - x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0); - y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0); - - partWidth = document.getElementById('colors').width / 6; - partDetail = detail / 2; - imHeight = document.getElementById('colors').height; - - r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; - g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); - b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); - - coef = (imHeight - y) / imHeight; - r = 128 + (r - 128) * coef; - g = 128 + (g - 128) * coef; - b = 128 + (b - 128) * coef; - - changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); - updateLight(r, g, b); -} - -function updateLight(r, g, b) { - var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; - - for (i=0; i=0) && (i 1 ? value : '0' + value; // Padd with leading zero + }; + + color = color.replace(/[\s#]+/g, '').toLowerCase(); + color = namedLookup[color] || color; + matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})|([a-f0-9])([a-f0-9])([a-f0-9])$/.exec(color); + + if (matches) { + if (matches[1]) { + red = toInt(matches[1]); + green = toInt(matches[2]); + blue = toInt(matches[3]); + } else if (matches[4]) { + red = toInt(matches[4], 16); + green = toInt(matches[5], 16); + blue = toInt(matches[6], 16); + } else if (matches[7]) { + red = toInt(matches[7] + matches[7], 16); + green = toInt(matches[8] + matches[8], 16); + blue = toInt(matches[9] + matches[9], 16); + } + + return '#' + hex(red) + hex(green) + hex(blue); + } + + return ''; +} + +function insertAction() { + var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); + + tinyMCEPopup.restoreSelection(); + + if (f) + f(toHexColor(color)); + + tinyMCEPopup.close(); +} + +function showColor(color, name) { + if (name) + document.getElementById("colorname").innerHTML = name; + + document.getElementById("preview").style.backgroundColor = color; + document.getElementById("color").value = color.toUpperCase(); +} + +function convertRGBToHex(col) { + var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); + + if (!col) + return col; + + var rgb = col.replace(re, "$1,$2,$3").split(','); + if (rgb.length == 3) { + r = parseInt(rgb[0]).toString(16); + g = parseInt(rgb[1]).toString(16); + b = parseInt(rgb[2]).toString(16); + + r = r.length == 1 ? '0' + r : r; + g = g.length == 1 ? '0' + g : g; + b = b.length == 1 ? '0' + b : b; + + return "#" + r + g + b; + } + + return col; +} + +function convertHexToRGB(col) { + if (col.indexOf('#') != -1) { + col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); + + r = parseInt(col.substring(0, 2), 16); + g = parseInt(col.substring(2, 4), 16); + b = parseInt(col.substring(4, 6), 16); + + return {r : r, g : g, b : b}; + } + + return null; +} + +function generatePicker() { + var el = document.getElementById('light'), h = '', i; + + for (i = 0; i < detail; i++){ + h += '
'; + } + + el.innerHTML = h; +} + +function generateWebColors() { + var el = document.getElementById('webcolors'), h = '', i; + + if (el.className == 'generated') + return; + + // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby. + h += '
' + + ''; + + for (i=0; i' + + ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + if ((i+1) % 18 == 0) + h += ''; + } + + h += '
'; + + el.innerHTML = h; + el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el.firstChild); +} + +function paintCanvas(el) { + tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) { + var context; + if (canvas.getContext && (context = canvas.getContext("2d"))) { + context.fillStyle = canvas.getAttribute('data-color'); + context.fillRect(0, 0, 10, 10); + } + }); +} +function generateNamedColors() { + var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; + + if (el.className == 'generated') + return; + + for (n in named) { + v = named[n]; + h += ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + i++; + } + + el.innerHTML = h; + el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el); +} + +function enableKeyboardNavigation(el) { + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { + root: el, + items: tinyMCEPopup.dom.select('a', el) + }, tinyMCEPopup.dom); +} + +function dechex(n) { + return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); +} + +function computeColor(e) { + var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target); + + x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0); + y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0); + + partWidth = document.getElementById('colors').width / 6; + partDetail = detail / 2; + imHeight = document.getElementById('colors').height; + + r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; + g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); + b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); + + coef = (imHeight - y) / imHeight; + r = 128 + (r - 128) * coef; + g = 128 + (g - 128) * coef; + b = 128 + (b - 128) * coef; + + changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); + updateLight(r, g, b); +} + +function updateLight(r, g, b) { + var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; + + for (i=0; i=0) && (i'); - }, - - init : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor; - - // Setup browse button - document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); - if (isVisible('srcbrowser')) - document.getElementById('src').style.width = '180px'; - - e = ed.selection.getNode(); - - this.fillFileList('image_list', tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList')); - - if (e.nodeName == 'IMG') { - f.src.value = ed.dom.getAttrib(e, 'src'); - f.alt.value = ed.dom.getAttrib(e, 'alt'); - f.border.value = this.getAttrib(e, 'border'); - f.vspace.value = this.getAttrib(e, 'vspace'); - f.hspace.value = this.getAttrib(e, 'hspace'); - f.width.value = ed.dom.getAttrib(e, 'width'); - f.height.value = ed.dom.getAttrib(e, 'height'); - f.insert.value = ed.getLang('update'); - this.styleVal = ed.dom.getAttrib(e, 'style'); - selectByValue(f, 'image_list', f.src.value); - selectByValue(f, 'align', this.getAttrib(e, 'align')); - this.updateStyle(); - } - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = typeof(l) === 'function' ? l() : window[l]; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - update : function() { - var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; - - tinyMCEPopup.restoreSelection(); - - if (f.src.value === '') { - if (ed.selection.getNode().nodeName == 'IMG') { - ed.dom.remove(ed.selection.getNode()); - ed.execCommand('mceRepaint'); - } - - tinyMCEPopup.close(); - return; - } - - if (!ed.settings.inline_styles) { - args = tinymce.extend(args, { - vspace : nl.vspace.value, - hspace : nl.hspace.value, - border : nl.border.value, - align : getSelectValue(f, 'align') - }); - } else - args.style = this.styleVal; - - tinymce.extend(args, { - src : f.src.value.replace(/ /g, '%20'), - alt : f.alt.value, - width : f.width.value, - height : f.height.value - }); - - el = ed.selection.getNode(); - - if (el && el.nodeName == 'IMG') { - ed.dom.setAttribs(el, args); - tinyMCEPopup.editor.execCommand('mceRepaint'); - tinyMCEPopup.editor.focus(); - } else { - tinymce.each(args, function(value, name) { - if (value === "") { - delete args[name]; - } - }); - - ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); - ed.undoManager.add(); - } - - tinyMCEPopup.close(); - }, - - updateStyle : function() { - var dom = tinyMCEPopup.dom, st, v, f = document.forms[0]; - - if (tinyMCEPopup.editor.settings.inline_styles) { - st = tinyMCEPopup.dom.parseStyle(this.styleVal); - - // Handle align - v = getSelectValue(f, 'align'); - if (v) { - if (v == 'left' || v == 'right') { - st['float'] = v; - delete st['vertical-align']; - } else { - st['vertical-align'] = v; - delete st['float']; - } - } else { - delete st['float']; - delete st['vertical-align']; - } - - // Handle border - v = f.border.value; - if (v || v == '0') { - if (v == '0') - st['border'] = '0'; - else - st['border'] = v + 'px solid black'; - } else - delete st['border']; - - // Handle hspace - v = f.hspace.value; - if (v) { - delete st['margin']; - st['margin-left'] = v + 'px'; - st['margin-right'] = v + 'px'; - } else { - delete st['margin-left']; - delete st['margin-right']; - } - - // Handle vspace - v = f.vspace.value; - if (v) { - delete st['margin']; - st['margin-top'] = v + 'px'; - st['margin-bottom'] = v + 'px'; - } else { - delete st['margin-top']; - delete st['margin-bottom']; - } - - // Merge - st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img'); - this.styleVal = dom.serializeStyle(st, 'img'); - } - }, - - getAttrib : function(e, at) { - var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; - - if (ed.settings.inline_styles) { - switch (at) { - case 'align': - if (v = dom.getStyle(e, 'float')) - return v; - - if (v = dom.getStyle(e, 'vertical-align')) - return v; - - break; - - case 'hspace': - v = dom.getStyle(e, 'margin-left') - v2 = dom.getStyle(e, 'margin-right'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'vspace': - v = dom.getStyle(e, 'margin-top') - v2 = dom.getStyle(e, 'margin-bottom'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'border': - v = 0; - - tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { - sv = dom.getStyle(e, 'border-' + sv + '-width'); - - // False or not the same as prev - if (!sv || (sv != v && v !== 0)) { - v = 0; - return false; - } - - if (sv) - v = sv; - }); - - if (v) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - } - } - - if (v = dom.getAttrib(e, at)) - return v; - - return ''; - }, - - resetImageData : function() { - var f = document.forms[0]; - - f.width.value = f.height.value = ""; - }, - - updateImageData : function() { - var f = document.forms[0], t = ImageDialog; - - if (f.width.value == "") - f.width.value = t.preloadImg.width; - - if (f.height.value == "") - f.height.value = t.preloadImg.height; - }, - - getImageData : function() { - var f = document.forms[0]; - - this.preloadImg = new Image(); - this.preloadImg.onload = this.updateImageData; - this.preloadImg.onerror = this.resetImageData; - this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); - } -}; - -ImageDialog.preInit(); -tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); +var ImageDialog = { + preInit : function() { + var url; + + tinyMCEPopup.requireLangPack(); + + if (url = tinyMCEPopup.getParam("external_image_list_url")) + document.write(''); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '180px'; + + e = ed.selection.getNode(); + + this.fillFileList('image_list', tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList')); + + if (e.nodeName == 'IMG') { + f.src.value = ed.dom.getAttrib(e, 'src'); + f.alt.value = ed.dom.getAttrib(e, 'alt'); + f.border.value = this.getAttrib(e, 'border'); + f.vspace.value = this.getAttrib(e, 'vspace'); + f.hspace.value = this.getAttrib(e, 'hspace'); + f.width.value = ed.dom.getAttrib(e, 'width'); + f.height.value = ed.dom.getAttrib(e, 'height'); + f.insert.value = ed.getLang('update'); + this.styleVal = ed.dom.getAttrib(e, 'style'); + selectByValue(f, 'image_list', f.src.value); + selectByValue(f, 'align', this.getAttrib(e, 'align')); + this.updateStyle(); + } + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = typeof(l) === 'function' ? l() : window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + update : function() { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (!ed.settings.inline_styles) { + args = tinymce.extend(args, { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }); + } else + args.style = this.styleVal; + + tinymce.extend(args, { + src : f.src.value.replace(/ /g, '%20'), + alt : f.alt.value, + width : f.width.value, + height : f.height.value + }); + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); + } else { + tinymce.each(args, function(value, name) { + if (value === "") { + delete args[name]; + } + }); + + ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1}); + ed.undoManager.add(); + } + + tinyMCEPopup.close(); + }, + + updateStyle : function() { + var dom = tinyMCEPopup.dom, st, v, f = document.forms[0]; + + if (tinyMCEPopup.editor.settings.inline_styles) { + st = tinyMCEPopup.dom.parseStyle(this.styleVal); + + // Handle align + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') { + st['float'] = v; + delete st['vertical-align']; + } else { + st['vertical-align'] = v; + delete st['float']; + } + } else { + delete st['float']; + delete st['vertical-align']; + } + + // Handle border + v = f.border.value; + if (v || v == '0') { + if (v == '0') + st['border'] = '0'; + else + st['border'] = v + 'px solid black'; + } else + delete st['border']; + + // Handle hspace + v = f.hspace.value; + if (v) { + delete st['margin']; + st['margin-left'] = v + 'px'; + st['margin-right'] = v + 'px'; + } else { + delete st['margin-left']; + delete st['margin-right']; + } + + // Handle vspace + v = f.vspace.value; + if (v) { + delete st['margin']; + st['margin-top'] = v + 'px'; + st['margin-bottom'] = v + 'px'; + } else { + delete st['margin-top']; + delete st['margin-bottom']; + } + + // Merge + st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img'); + this.styleVal = dom.serializeStyle(st, 'img'); + } + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.width.value = f.height.value = ""; + }, + + updateImageData : function() { + var f = document.forms[0], t = ImageDialog; + + if (f.width.value == "") + f.width.value = t.preloadImg.width; + + if (f.height.value == "") + f.height.value = t.preloadImg.height; + }, + + getImageData : function() { + var f = document.forms[0]; + + this.preloadImg = new Image(); + this.preloadImg.onload = this.updateImageData; + this.preloadImg.onerror = this.resetImageData; + this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/engine/lib/external/tinymce-jq/themes/advanced/js/link.js b/templates/framework/js/vendor/tinymce-jq/themes/advanced/js/link.js similarity index 96% rename from engine/lib/external/tinymce-jq/themes/advanced/js/link.js rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/js/link.js index 53ff409e..e67d868a 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/js/link.js +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/js/link.js @@ -1,153 +1,153 @@ -tinyMCEPopup.requireLangPack(); - -var LinkDialog = { - preInit : function() { - var url; - - if (url = tinyMCEPopup.getParam("external_link_list_url")) - document.write(''); - }, - - init : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor; - - // Setup browse button - document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); - if (isVisible('hrefbrowser')) - document.getElementById('href').style.width = '180px'; - - this.fillClassList('class_list'); - this.fillFileList('link_list', 'tinyMCELinkList'); - this.fillTargetList('target_list'); - - if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { - f.href.value = ed.dom.getAttrib(e, 'href'); - f.linktitle.value = ed.dom.getAttrib(e, 'title'); - f.insert.value = ed.getLang('update'); - selectByValue(f, 'link_list', f.href.value); - selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); - selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); - } - }, - - update : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20'); - - tinyMCEPopup.restoreSelection(); - e = ed.dom.getParent(ed.selection.getNode(), 'A'); - - // Remove element if there is no href - if (!f.href.value) { - if (e) { - b = ed.selection.getBookmark(); - ed.dom.remove(e, 1); - ed.selection.moveToBookmark(b); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - return; - } - } - - // Create new anchor elements - if (e == null) { - ed.getDoc().execCommand("unlink", false, null); - tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); - - tinymce.each(ed.dom.select("a"), function(n) { - if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { - e = n; - - ed.dom.setAttribs(e, { - href : href, - title : f.linktitle.value, - target : f.target_list ? getSelectValue(f, "target_list") : null, - 'class' : f.class_list ? getSelectValue(f, "class_list") : null - }); - } - }); - } else { - ed.dom.setAttribs(e, { - href : href, - title : f.linktitle.value, - target : f.target_list ? getSelectValue(f, "target_list") : null, - 'class' : f.class_list ? getSelectValue(f, "class_list") : null - }); - } - - // Don't move caret if selection was image - if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { - ed.focus(); - ed.selection.select(e); - ed.selection.collapse(0); - tinyMCEPopup.storeSelection(); - } - - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - }, - - checkPrefix : function(n) { - if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) - n.value = 'mailto:' + n.value; - - if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) - n.value = 'http://' + n.value; - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = window[l]; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillClassList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { - cl = []; - - tinymce.each(v.split(';'), function(v) { - var p = v.split('='); - - cl.push({'title' : p[0], 'class' : p[1]}); - }); - } else - cl = tinyMCEPopup.editor.dom.getClasses(); - - if (cl.length > 0) { - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - - tinymce.each(cl, function(o) { - lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillTargetList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v; - - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); - - if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { - tinymce.each(v.split(','), function(v) { - v = v.split('='); - lst.options[lst.options.length] = new Option(v[0], v[1]); - }); - } - } -}; - -LinkDialog.preInit(); -tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); +tinyMCEPopup.requireLangPack(); + +var LinkDialog = { + preInit : function() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '180px'; + + this.fillClassList('class_list'); + this.fillFileList('link_list', 'tinyMCELinkList'); + this.fillTargetList('target_list'); + + if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { + f.href.value = ed.dom.getAttrib(e, 'href'); + f.linktitle.value = ed.dom.getAttrib(e, 'title'); + f.insert.value = ed.getLang('update'); + selectByValue(f, 'link_list', f.href.value); + selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); + selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); + } + }, + + update : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20'); + + tinyMCEPopup.restoreSelection(); + e = ed.dom.getParent(ed.selection.getNode(), 'A'); + + // Remove element if there is no href + if (!f.href.value) { + if (e) { + b = ed.selection.getBookmark(); + ed.dom.remove(e, 1); + ed.selection.moveToBookmark(b); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + } + + // Create new anchor elements + if (e == null) { + ed.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); + + tinymce.each(ed.dom.select("a"), function(n) { + if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { + e = n; + + ed.dom.setAttribs(e, { + href : href, + title : f.linktitle.value, + target : f.target_list ? getSelectValue(f, "target_list") : null, + 'class' : f.class_list ? getSelectValue(f, "class_list") : null + }); + } + }); + } else { + ed.dom.setAttribs(e, { + href : href, + title : f.linktitle.value, + target : f.target_list ? getSelectValue(f, "target_list") : null, + 'class' : f.class_list ? getSelectValue(f, "class_list") : null + }); + } + + // Don't move caret if selection was image + if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { + ed.focus(); + ed.selection.select(e); + ed.selection.collapse(0); + tinyMCEPopup.storeSelection(); + } + + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + }, + + checkPrefix : function(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) + n.value = 'http://' + n.value; + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillTargetList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v; + + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); + + if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { + tinymce.each(v.split(','), function(v) { + v = v.split('='); + lst.options[lst.options.length] = new Option(v[0], v[1]); + }); + } + } +}; + +LinkDialog.preInit(); +tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); diff --git a/engine/lib/external/tinymce-jq/themes/advanced/js/source_editor.js b/templates/framework/js/vendor/tinymce-jq/themes/advanced/js/source_editor.js similarity index 95% rename from engine/lib/external/tinymce-jq/themes/advanced/js/source_editor.js rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/js/source_editor.js index 84546ad5..9cf6b1a2 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/js/source_editor.js +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/js/source_editor.js @@ -1,56 +1,56 @@ -tinyMCEPopup.requireLangPack(); -tinyMCEPopup.onInit.add(onLoadInit); - -function saveContent() { - tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); - tinyMCEPopup.close(); -} - -function onLoadInit() { - tinyMCEPopup.resizeToInnerSize(); - - // Remove Gecko spellchecking - if (tinymce.isGecko) - document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); - - document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); - - if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { - setWrap('soft'); - document.getElementById('wraped').checked = true; - } - - resizeInputs(); -} - -function setWrap(val) { - var v, n, s = document.getElementById('htmlSource'); - - s.wrap = val; - - if (!tinymce.isIE) { - v = s.value; - n = s.cloneNode(false); - n.setAttribute("wrap", val); - s.parentNode.replaceChild(n, s); - n.value = v; - } -} - -function toggleWordWrap(elm) { - if (elm.checked) - setWrap('soft'); - else - setWrap('off'); -} - -function resizeInputs() { - var vp = tinyMCEPopup.dom.getViewPort(window), el; - - el = document.getElementById('htmlSource'); - - if (el) { - el.style.width = (vp.w - 20) + 'px'; - el.style.height = (vp.h - 65) + 'px'; - } -} +tinyMCEPopup.requireLangPack(); +tinyMCEPopup.onInit.add(onLoadInit); + +function saveContent() { + tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); + tinyMCEPopup.close(); +} + +function onLoadInit() { + tinyMCEPopup.resizeToInnerSize(); + + // Remove Gecko spellchecking + if (tinymce.isGecko) + document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); + + document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); + + if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { + setWrap('soft'); + document.getElementById('wraped').checked = true; + } + + resizeInputs(); +} + +function setWrap(val) { + var v, n, s = document.getElementById('htmlSource'); + + s.wrap = val; + + if (!tinymce.isIE) { + v = s.value; + n = s.cloneNode(false); + n.setAttribute("wrap", val); + s.parentNode.replaceChild(n, s); + n.value = v; + } +} + +function toggleWordWrap(elm) { + if (elm.checked) + setWrap('soft'); + else + setWrap('off'); +} + +function resizeInputs() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('htmlSource'); + + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 65) + 'px'; + } +} diff --git a/engine/lib/external/tinymce-jq/themes/advanced/langs/en.js b/templates/framework/js/vendor/tinymce-jq/themes/advanced/langs/en.js similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/langs/en.js rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/langs/en.js diff --git a/engine/lib/external/tinymce-jq/themes/advanced/langs/en_dlg.js b/templates/framework/js/vendor/tinymce-jq/themes/advanced/langs/en_dlg.js similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/langs/en_dlg.js rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/langs/en_dlg.js diff --git a/engine/lib/external/tinymce-jq/themes/advanced/langs/ru.js b/templates/framework/js/vendor/tinymce-jq/themes/advanced/langs/ru.js old mode 100755 new mode 100644 similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/langs/ru.js rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/langs/ru.js diff --git a/engine/lib/external/tinymce-jq/themes/advanced/langs/ru_dlg.js b/templates/framework/js/vendor/tinymce-jq/themes/advanced/langs/ru_dlg.js old mode 100755 new mode 100644 similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/langs/ru_dlg.js rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/langs/ru_dlg.js diff --git a/engine/lib/external/tinymce-jq/themes/advanced/link.htm b/templates/framework/js/vendor/tinymce-jq/themes/advanced/link.htm similarity index 97% rename from engine/lib/external/tinymce-jq/themes/advanced/link.htm rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/link.htm index 5d9dea9b..4a2459f8 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/link.htm +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/link.htm @@ -1,57 +1,57 @@ - - - - {#advanced_dlg.link_title} - - - - - - - -
- - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - - -
 
-
-
- -
- - -
-
- - + + + + {#advanced_dlg.link_title} + + + + + + + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + +
 
+
+
+ +
+ + +
+
+ + diff --git a/engine/lib/external/tinymce-jq/themes/advanced/shortcuts.htm b/templates/framework/js/vendor/tinymce-jq/themes/advanced/shortcuts.htm similarity index 97% rename from engine/lib/external/tinymce-jq/themes/advanced/shortcuts.htm rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/shortcuts.htm index 20ec2f5a..436091f1 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/shortcuts.htm +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/shortcuts.htm @@ -1,47 +1,47 @@ - - - - {#advanced_dlg.accessibility_help} - - - - -

{#advanced_dlg.accessibility_usage_title}

-

Toolbars

-

Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys. - Press enter to activate a button and return focus to the editor. - Press escape to return focus to the editor without performing any actions.

- -

Status Bar

-

To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path. - Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.

- -

Context Menu

-

Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key. - To close submenus press the left arrow key. Press escape to close the context menu.

- -

Keyboard Shortcuts

- - - - - - - - - - - - - - - - - - - - - -
KeystrokeFunction
Control-BBold
Control-IItalic
Control-ZUndo
Control-YRedo
- - + + + + {#advanced_dlg.accessibility_help} + + + + +

{#advanced_dlg.accessibility_usage_title}

+

Toolbars

+

Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys. + Press enter to activate a button and return focus to the editor. + Press escape to return focus to the editor without performing any actions.

+ +

Status Bar

+

To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path. + Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.

+ +

Context Menu

+

Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key. + To close submenus press the left arrow key. Press escape to close the context menu.

+ +

Keyboard Shortcuts

+ + + + + + + + + + + + + + + + + + + + + +
KeystrokeFunction
Control-BBold
Control-IItalic
Control-ZUndo
Control-YRedo
+ + diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/default/content.css b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/content.css similarity index 98% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/default/content.css rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/content.css index 2fd94a1f..4d63ca98 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/skins/default/content.css +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/content.css @@ -1,50 +1,50 @@ -body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} -body {background:#FFF;} -body.mceForceColors {background:#FFF; color:#000;} -body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-modify:read-only; -moz-user-select:all; -moz-user-modify:read-only; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat center center} -span.mceItemNbsp {background: #DDD} -td.mceSelected, th.mceSelected {background-color:#3399ff !important} -img {border:0;} -table, img, hr, .mceItemAnchor {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr {border-bottom:1px dashed #CCC; cursor:help} - -/* IE */ -* html body { -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -} - -img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} -font[face=mceinline] {font-family:inherit !important} -*[contentEditable]:focus {outline:0} - -.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} -.mceItemShockWave {background-image:url(../../img/shockwave.gif)} -.mceItemFlash {background-image:url(../../img/flash.gif)} -.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} -.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} -.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} -.mceItemVideo {background-image:url(../../img/video.gif)} -.mceItemAudio {background-image:url(../../img/video.gif)} -.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)} -.mceItemIframe {background-image:url(../../img/iframe.gif)} -.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-modify:read-only; -moz-user-select:all; -moz-user-modify:read-only; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat center center} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table, img, hr, .mceItemAnchor {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} + +.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} +.mceItemShockWave {background-image:url(../../img/shockwave.gif)} +.mceItemFlash {background-image:url(../../img/flash.gif)} +.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} +.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} +.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} +.mceItemVideo {background-image:url(../../img/video.gif)} +.mceItemAudio {background-image:url(../../img/video.gif)} +.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)} +.mceItemIframe {background-image:url(../../img/iframe.gif)} +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/default/dialog.css b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/dialog.css similarity index 97% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/default/dialog.css rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/dialog.css index f0122265..1f5598c6 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/skins/default/dialog.css +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/dialog.css @@ -1,117 +1,117 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDDDDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -background:#F0F0EE; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;} -a:hover {color:#2B6FB6;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;} -input.invalid {border:1px solid #EE0000;} -input {background:#FFF; border:1px solid #CCC;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -border:0; margin:0; padding:0; -font-weight:bold; -width:94px; height:26px; -background:url(img/buttons.png) 0 -26px; -cursor:pointer; -padding-bottom:2px; -float:left; -} - -#insert {background:url(img/buttons.png) 0 -52px} -#cancel {background:url(img/buttons.png) 0 0; float:right} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} -.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} -.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} -.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} -#colorpicker #picker_panel fieldset {margin:auto;width:325px;} +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#insert {background:url(img/buttons.png) 0 -52px} +#cancel {background:url(img/buttons.png) 0 0; float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/default/img/buttons.png b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/img/buttons.png similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/default/img/buttons.png rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/img/buttons.png diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/default/img/items.gif b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/img/items.gif similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/default/img/items.gif rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/img/items.gif diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/default/img/menu_arrow.gif b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/img/menu_arrow.gif similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/default/img/menu_arrow.gif rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/img/menu_arrow.gif diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/default/img/menu_check.gif b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/img/menu_check.gif similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/default/img/menu_check.gif rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/img/menu_check.gif diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/default/img/progress.gif b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/img/progress.gif similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/default/img/progress.gif rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/img/progress.gif diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/default/img/tabs.gif b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/img/tabs.gif similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/default/img/tabs.gif rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/img/tabs.gif diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/default/ui.css b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/ui.css similarity index 98% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/default/ui.css rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/ui.css index 2b7c2a59..ab2204d9 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/skins/default/ui.css +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/default/ui.css @@ -1,214 +1,214 @@ -/* Reset */ -.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} -.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} -.defaultSkin table td {vertical-align:middle} - -/* Containers */ -.defaultSkin table {direction:ltr;background:transparent} -.defaultSkin iframe {display:block;} -.defaultSkin .mceToolbar {height:26px} -.defaultSkin .mceLeft {text-align:left} -.defaultSkin .mceRight {text-align:right} - -/* External */ -.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} -.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} -.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} - -/* Layout */ -.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} -.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} -.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} -.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} -.defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top} -.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} -.defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} -.defaultSkin .mceStatusbar div {float:left; margin:2px} -.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} -.defaultSkin .mceStatusbar a:hover {text-decoration:underline} -.defaultSkin table.mceToolbar {margin-left:3px} -.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} -.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} -.defaultSkin td.mceCenter {text-align:center;} -.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} -.defaultSkin td.mceRight table {margin:0 0 0 auto;} - -/* Button */ -.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} -.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} -.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} -.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.defaultSkin .mceButtonLabeled {width:auto} -.defaultSkin .mceButtonLabeled span.mceIcon {float:left} -.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} -.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} - -/* Separator */ -.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} - -/* ListBox */ -.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} -.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} -.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} -.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} -.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} -.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} -.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} -.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} -.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} -.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} - -/* SplitButton */ -.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} -.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} -.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} -.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);} -.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} -.defaultSkin .mceSplitButton span.mceOpen {display:none} -.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} -.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} -.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} -.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} - -/* ColorSplitButton */ -.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} -.defaultSkin .mceColorSplitMenu td {padding:2px} -.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} -.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} -.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} -.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} -.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} -.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} -.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} - -/* Menu */ -.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} -.defaultSkin .mceNoIcons span.mceIcon {width:0;} -.defaultSkin .mceNoIcons a .mceText {padding-left:10px} -.defaultSkin .mceMenu table {background:#FFF} -.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} -.defaultSkin .mceMenu td {height:20px} -.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} -.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} -.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} -.defaultSkin .mceMenu pre.mceText {font-family:Monospace} -.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} -.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} -.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} -.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} -.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} -.defaultSkin .mceMenuItemDisabled .mceText {color:#888} -.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} -.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} -.defaultSkin .mceMenu span.mceMenuLine {display:none} -.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} -.defaultSkin .mceMenuItem td, .defaultSkin .mceMenuItem th {line-height: normal} - -/* Progress,Resize */ -.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} -.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} - -/* Formats */ -.defaultSkin .mce_formatPreview a {font-size:10px} -.defaultSkin .mce_p span.mceText {} -.defaultSkin .mce_address span.mceText {font-style:italic} -.defaultSkin .mce_pre span.mceText {font-family:monospace} -.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} -.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} -.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} -.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} -.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} -.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} - -/* Theme */ -.defaultSkin span.mce_bold {background-position:0 0} -.defaultSkin span.mce_italic {background-position:-60px 0} -.defaultSkin span.mce_underline {background-position:-140px 0} -.defaultSkin span.mce_strikethrough {background-position:-120px 0} -.defaultSkin span.mce_undo {background-position:-160px 0} -.defaultSkin span.mce_redo {background-position:-100px 0} -.defaultSkin span.mce_cleanup {background-position:-40px 0} -.defaultSkin span.mce_bullist {background-position:-20px 0} -.defaultSkin span.mce_numlist {background-position:-80px 0} -.defaultSkin span.mce_justifyleft {background-position:-460px 0} -.defaultSkin span.mce_justifyright {background-position:-480px 0} -.defaultSkin span.mce_justifycenter {background-position:-420px 0} -.defaultSkin span.mce_justifyfull {background-position:-440px 0} -.defaultSkin span.mce_anchor {background-position:-200px 0} -.defaultSkin span.mce_indent {background-position:-400px 0} -.defaultSkin span.mce_outdent {background-position:-540px 0} -.defaultSkin span.mce_link {background-position:-500px 0} -.defaultSkin span.mce_unlink {background-position:-640px 0} -.defaultSkin span.mce_sub {background-position:-600px 0} -.defaultSkin span.mce_sup {background-position:-620px 0} -.defaultSkin span.mce_removeformat {background-position:-580px 0} -.defaultSkin span.mce_newdocument {background-position:-520px 0} -.defaultSkin span.mce_image {background-position:-380px 0} -.defaultSkin span.mce_help {background-position:-340px 0} -.defaultSkin span.mce_code {background-position:-260px 0} -.defaultSkin span.mce_hr {background-position:-360px 0} -.defaultSkin span.mce_visualaid {background-position:-660px 0} -.defaultSkin span.mce_charmap {background-position:-240px 0} -.defaultSkin span.mce_paste {background-position:-560px 0} -.defaultSkin span.mce_copy {background-position:-700px 0} -.defaultSkin span.mce_cut {background-position:-680px 0} -.defaultSkin span.mce_blockquote {background-position:-220px 0} -.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} -.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} -.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} -.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} - -/* Plugins */ -.defaultSkin span.mce_advhr {background-position:-0px -20px} -.defaultSkin span.mce_ltr {background-position:-20px -20px} -.defaultSkin span.mce_rtl {background-position:-40px -20px} -.defaultSkin span.mce_emotions {background-position:-60px -20px} -.defaultSkin span.mce_fullpage {background-position:-80px -20px} -.defaultSkin span.mce_fullscreen {background-position:-100px -20px} -.defaultSkin span.mce_iespell {background-position:-120px -20px} -.defaultSkin span.mce_insertdate {background-position:-140px -20px} -.defaultSkin span.mce_inserttime {background-position:-160px -20px} -.defaultSkin span.mce_absolute {background-position:-180px -20px} -.defaultSkin span.mce_backward {background-position:-200px -20px} -.defaultSkin span.mce_forward {background-position:-220px -20px} -.defaultSkin span.mce_insert_layer {background-position:-240px -20px} -.defaultSkin span.mce_insertlayer {background-position:-260px -20px} -.defaultSkin span.mce_movebackward {background-position:-280px -20px} -.defaultSkin span.mce_moveforward {background-position:-300px -20px} -.defaultSkin span.mce_media {background-position:-320px -20px} -.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} -.defaultSkin span.mce_pastetext {background-position:-360px -20px} -.defaultSkin span.mce_pasteword {background-position:-380px -20px} -.defaultSkin span.mce_selectall {background-position:-400px -20px} -.defaultSkin span.mce_preview {background-position:-420px -20px} -.defaultSkin span.mce_print {background-position:-440px -20px} -.defaultSkin span.mce_cancel {background-position:-460px -20px} -.defaultSkin span.mce_save {background-position:-480px -20px} -.defaultSkin span.mce_replace {background-position:-500px -20px} -.defaultSkin span.mce_search {background-position:-520px -20px} -.defaultSkin span.mce_styleprops {background-position:-560px -20px} -.defaultSkin span.mce_table {background-position:-580px -20px} -.defaultSkin span.mce_cell_props {background-position:-600px -20px} -.defaultSkin span.mce_delete_table {background-position:-620px -20px} -.defaultSkin span.mce_delete_col {background-position:-640px -20px} -.defaultSkin span.mce_delete_row {background-position:-660px -20px} -.defaultSkin span.mce_col_after {background-position:-680px -20px} -.defaultSkin span.mce_col_before {background-position:-700px -20px} -.defaultSkin span.mce_row_after {background-position:-720px -20px} -.defaultSkin span.mce_row_before {background-position:-740px -20px} -.defaultSkin span.mce_merge_cells {background-position:-760px -20px} -.defaultSkin span.mce_table_props {background-position:-980px -20px} -.defaultSkin span.mce_row_props {background-position:-780px -20px} -.defaultSkin span.mce_split_cells {background-position:-800px -20px} -.defaultSkin span.mce_template {background-position:-820px -20px} -.defaultSkin span.mce_visualchars {background-position:-840px -20px} -.defaultSkin span.mce_abbr {background-position:-860px -20px} -.defaultSkin span.mce_acronym {background-position:-880px -20px} -.defaultSkin span.mce_attribs {background-position:-900px -20px} -.defaultSkin span.mce_cite {background-position:-920px -20px} -.defaultSkin span.mce_del {background-position:-940px -20px} -.defaultSkin span.mce_ins {background-position:-960px -20px} -.defaultSkin span.mce_pagebreak {background-position:0 -40px} -.defaultSkin span.mce_restoredraft {background-position:-20px -40px} -.defaultSkin span.mce_spellchecker {background-position:-540px -20px} +/* Reset */ +.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.defaultSkin table td {vertical-align:middle} + +/* Containers */ +.defaultSkin table {direction:ltr;background:transparent} +.defaultSkin iframe {display:block;} +.defaultSkin .mceToolbar {height:26px} +.defaultSkin .mceLeft {text-align:left} +.defaultSkin .mceRight {text-align:right} + +/* External */ +.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} +.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} +.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} +.defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top} +.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} +.defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} +.defaultSkin .mceStatusbar div {float:left; margin:2px} +.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} +.defaultSkin .mceStatusbar a:hover {text-decoration:underline} +.defaultSkin table.mceToolbar {margin-left:3px} +.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.defaultSkin td.mceCenter {text-align:center;} +.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} +.defaultSkin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} +.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceButtonLabeled {width:auto} +.defaultSkin .mceButtonLabeled span.mceIcon {float:left} +.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} + +/* ListBox */ +.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} +.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} +.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} +.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} +.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} +.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} +.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} +.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} + +/* SplitButton */ +.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} +.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} +.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} +.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);} +.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} +.defaultSkin .mceSplitButton span.mceOpen {display:none} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} +.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} + +/* ColorSplitButton */ +.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.defaultSkin .mceColorSplitMenu td {padding:2px} +.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} +.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} +.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} + +/* Menu */ +.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} +.defaultSkin .mceNoIcons span.mceIcon {width:0;} +.defaultSkin .mceNoIcons a .mceText {padding-left:10px} +.defaultSkin .mceMenu table {background:#FFF} +.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} +.defaultSkin .mceMenu td {height:20px} +.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} +.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} +.defaultSkin .mceMenu pre.mceText {font-family:Monospace} +.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} +.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} +.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.defaultSkin .mceMenuItemDisabled .mceText {color:#888} +.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} +.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} +.defaultSkin .mceMenu span.mceMenuLine {display:none} +.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} +.defaultSkin .mceMenuItem td, .defaultSkin .mceMenuItem th {line-height: normal} + +/* Progress,Resize */ +.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} +.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Formats */ +.defaultSkin .mce_formatPreview a {font-size:10px} +.defaultSkin .mce_p span.mceText {} +.defaultSkin .mce_address span.mceText {font-style:italic} +.defaultSkin .mce_pre span.mceText {font-family:monospace} +.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.defaultSkin span.mce_bold {background-position:0 0} +.defaultSkin span.mce_italic {background-position:-60px 0} +.defaultSkin span.mce_underline {background-position:-140px 0} +.defaultSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSkin span.mce_undo {background-position:-160px 0} +.defaultSkin span.mce_redo {background-position:-100px 0} +.defaultSkin span.mce_cleanup {background-position:-40px 0} +.defaultSkin span.mce_bullist {background-position:-20px 0} +.defaultSkin span.mce_numlist {background-position:-80px 0} +.defaultSkin span.mce_justifyleft {background-position:-460px 0} +.defaultSkin span.mce_justifyright {background-position:-480px 0} +.defaultSkin span.mce_justifycenter {background-position:-420px 0} +.defaultSkin span.mce_justifyfull {background-position:-440px 0} +.defaultSkin span.mce_anchor {background-position:-200px 0} +.defaultSkin span.mce_indent {background-position:-400px 0} +.defaultSkin span.mce_outdent {background-position:-540px 0} +.defaultSkin span.mce_link {background-position:-500px 0} +.defaultSkin span.mce_unlink {background-position:-640px 0} +.defaultSkin span.mce_sub {background-position:-600px 0} +.defaultSkin span.mce_sup {background-position:-620px 0} +.defaultSkin span.mce_removeformat {background-position:-580px 0} +.defaultSkin span.mce_newdocument {background-position:-520px 0} +.defaultSkin span.mce_image {background-position:-380px 0} +.defaultSkin span.mce_help {background-position:-340px 0} +.defaultSkin span.mce_code {background-position:-260px 0} +.defaultSkin span.mce_hr {background-position:-360px 0} +.defaultSkin span.mce_visualaid {background-position:-660px 0} +.defaultSkin span.mce_charmap {background-position:-240px 0} +.defaultSkin span.mce_paste {background-position:-560px 0} +.defaultSkin span.mce_copy {background-position:-700px 0} +.defaultSkin span.mce_cut {background-position:-680px 0} +.defaultSkin span.mce_blockquote {background-position:-220px 0} +.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} +.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} +.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} +.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.defaultSkin span.mce_advhr {background-position:-0px -20px} +.defaultSkin span.mce_ltr {background-position:-20px -20px} +.defaultSkin span.mce_rtl {background-position:-40px -20px} +.defaultSkin span.mce_emotions {background-position:-60px -20px} +.defaultSkin span.mce_fullpage {background-position:-80px -20px} +.defaultSkin span.mce_fullscreen {background-position:-100px -20px} +.defaultSkin span.mce_iespell {background-position:-120px -20px} +.defaultSkin span.mce_insertdate {background-position:-140px -20px} +.defaultSkin span.mce_inserttime {background-position:-160px -20px} +.defaultSkin span.mce_absolute {background-position:-180px -20px} +.defaultSkin span.mce_backward {background-position:-200px -20px} +.defaultSkin span.mce_forward {background-position:-220px -20px} +.defaultSkin span.mce_insert_layer {background-position:-240px -20px} +.defaultSkin span.mce_insertlayer {background-position:-260px -20px} +.defaultSkin span.mce_movebackward {background-position:-280px -20px} +.defaultSkin span.mce_moveforward {background-position:-300px -20px} +.defaultSkin span.mce_media {background-position:-320px -20px} +.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} +.defaultSkin span.mce_pastetext {background-position:-360px -20px} +.defaultSkin span.mce_pasteword {background-position:-380px -20px} +.defaultSkin span.mce_selectall {background-position:-400px -20px} +.defaultSkin span.mce_preview {background-position:-420px -20px} +.defaultSkin span.mce_print {background-position:-440px -20px} +.defaultSkin span.mce_cancel {background-position:-460px -20px} +.defaultSkin span.mce_save {background-position:-480px -20px} +.defaultSkin span.mce_replace {background-position:-500px -20px} +.defaultSkin span.mce_search {background-position:-520px -20px} +.defaultSkin span.mce_styleprops {background-position:-560px -20px} +.defaultSkin span.mce_table {background-position:-580px -20px} +.defaultSkin span.mce_cell_props {background-position:-600px -20px} +.defaultSkin span.mce_delete_table {background-position:-620px -20px} +.defaultSkin span.mce_delete_col {background-position:-640px -20px} +.defaultSkin span.mce_delete_row {background-position:-660px -20px} +.defaultSkin span.mce_col_after {background-position:-680px -20px} +.defaultSkin span.mce_col_before {background-position:-700px -20px} +.defaultSkin span.mce_row_after {background-position:-720px -20px} +.defaultSkin span.mce_row_before {background-position:-740px -20px} +.defaultSkin span.mce_merge_cells {background-position:-760px -20px} +.defaultSkin span.mce_table_props {background-position:-980px -20px} +.defaultSkin span.mce_row_props {background-position:-780px -20px} +.defaultSkin span.mce_split_cells {background-position:-800px -20px} +.defaultSkin span.mce_template {background-position:-820px -20px} +.defaultSkin span.mce_visualchars {background-position:-840px -20px} +.defaultSkin span.mce_abbr {background-position:-860px -20px} +.defaultSkin span.mce_acronym {background-position:-880px -20px} +.defaultSkin span.mce_attribs {background-position:-900px -20px} +.defaultSkin span.mce_cite {background-position:-920px -20px} +.defaultSkin span.mce_del {background-position:-940px -20px} +.defaultSkin span.mce_ins {background-position:-960px -20px} +.defaultSkin span.mce_pagebreak {background-position:0 -40px} +.defaultSkin span.mce_restoredraft {background-position:-20px -40px} +.defaultSkin span.mce_spellchecker {background-position:-540px -20px} diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/highcontrast/content.css b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/highcontrast/content.css similarity index 97% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/highcontrast/content.css rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/highcontrast/content.css index cbce6c6a..ee3d369d 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/skins/highcontrast/content.css +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/highcontrast/content.css @@ -1,24 +1,24 @@ -body, td, pre { margin:8px;} -body.mceForceColors {background:#FFF; color:#000;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} -span.mceItemNbsp {background: #DDD} -td.mceSelected, th.mceSelected {background-color:#3399ff !important} -img {border:0;} -table, img, hr, .mceItemAnchor {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr {border-bottom:1px dashed #CCC; cursor:help} - -img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} -font[face=mceinline] {font-family:inherit !important} -*[contentEditable]:focus {outline:0} +body, td, pre { margin:8px;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table, img, hr, .mceItemAnchor {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/highcontrast/dialog.css b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/highcontrast/dialog.css similarity index 97% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/highcontrast/dialog.css rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/highcontrast/dialog.css index b2ed097c..dafcd280 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/skins/highcontrast/dialog.css +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/highcontrast/dialog.css @@ -1,105 +1,105 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; background:#F0F0EE; -color: black; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE; color:#000;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;background-color:transparent;} -a:hover {color:#2B6FB6;background-color:transparent;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;background-color:transparent;} -input.invalid {border:1px solid #EE0000;background-color:transparent;} -input {background:#FFF; border:1px solid #CCC;color:black;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -font-weight:bold; -width:94px; height:23px; -cursor:pointer; -padding-bottom:2px; -float:left; -} - -#cancel {float:right} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; border: 1px solid black; border-bottom:0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block; cursor:pointer;} -.tabs li.current {font-weight: bold; margin-right:2px;} -.tabs span {float:left; display:block; padding:0px 10px 0 0;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} +color: black; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE; color:#000;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;background-color:transparent;} +a:hover {color:#2B6FB6;background-color:transparent;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;background-color:transparent;} +input.invalid {border:1px solid #EE0000;background-color:transparent;} +input {background:#FFF; border:1px solid #CCC;color:black;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +font-weight:bold; +width:94px; height:23px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#cancel {float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; border: 1px solid black; border-bottom:0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block; cursor:pointer;} +.tabs li.current {font-weight: bold; margin-right:2px;} +.tabs span {float:left; display:block; padding:0px 10px 0 0;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/highcontrast/ui.css b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/highcontrast/ui.css similarity index 98% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/highcontrast/ui.css rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/highcontrast/ui.css index a2cfcc39..81da151f 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/skins/highcontrast/ui.css +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/highcontrast/ui.css @@ -1,102 +1,102 @@ -/* Reset */ -.highcontrastSkin table, .highcontrastSkin tbody, .highcontrastSkin a, .highcontrastSkin img, .highcontrastSkin tr, .highcontrastSkin div, .highcontrastSkin td, .highcontrastSkin iframe, .highcontrastSkin span, .highcontrastSkin *, .highcontrastSkin .mceText {border:0; margin:0; padding:0; vertical-align:baseline; border-collapse:separate;} -.highcontrastSkin a:hover, .highcontrastSkin a:link, .highcontrastSkin a:visited, .highcontrastSkin a:active {text-decoration:none; font-weight:normal; cursor:default;} -.highcontrastSkin table td {vertical-align:middle} - -.highcontrastSkin .mceIconOnly {display: block !important;} - -/* External */ -.highcontrastSkin .mceExternalToolbar {position:absolute; border:1px solid; border-bottom:0; display:none; background-color: white;} -.highcontrastSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} -.highcontrastSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px;} - -/* Layout */ -.highcontrastSkin table.mceLayout {border: 1px solid;} -.highcontrastSkin .mceIframeContainer {border-top:1px solid; border-bottom:1px solid} -.highcontrastSkin .mceStatusbar a:hover {text-decoration:underline} -.highcontrastSkin .mceStatusbar {display:block; line-height:1.5em; overflow:visible;} -.highcontrastSkin .mceStatusbar div {float:left} -.highcontrastSkin .mceStatusbar a.mceResize {display:block; float:right; width:20px; height:20px; cursor:se-resize; outline:0} - -.highcontrastSkin .mceToolbar td { display: inline-block; float: left;} -.highcontrastSkin .mceToolbar tr { display: block;} -.highcontrastSkin .mceToolbar table { display: block; } - -/* Button */ - -.highcontrastSkin .mceButton { display:block; margin: 2px; padding: 5px 10px;border: 1px solid; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -ms-border-radius: 3px; height: 2em;} -.highcontrastSkin .mceButton .mceVoiceLabel { height: 100%; vertical-align: center; line-height: 2em} -.highcontrastSkin .mceButtonDisabled .mceVoiceLabel { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} -.highcontrastSkin .mceButtonActive, .highcontrastSkin .mceButton:focus, .highcontrastSkin .mceButton:active { border: 5px solid; padding: 1px 6px;-webkit-focus-ring-color:none;outline:none;} - -/* Separator */ -.highcontrastSkin .mceSeparator {display:block; width:16px; height:26px;} - -/* ListBox */ -.highcontrastSkin .mceListBox { display: block; margin:2px;-webkit-focus-ring-color:none;outline:none;} -.highcontrastSkin .mceListBox .mceText {padding: 5px 6px; line-height: 2em; width: 15ex; overflow: hidden;} -.highcontrastSkin .mceListBoxDisabled .mceText { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} -.highcontrastSkin .mceListBox a.mceText { padding: 5px 10px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} -.highcontrastSkin .mceListBox a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-left: 0; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} -.highcontrastSkin .mceListBox:focus a.mceText, .highcontrastSkin .mceListBox:active a.mceText { border-width: 5px; padding: 1px 10px 1px 6px;} -.highcontrastSkin .mceListBox:focus a.mceOpen, .highcontrastSkin .mceListBox:active a.mceOpen { border-width: 5px; padding: 1px 0px 1px 4px;} - -.highcontrastSkin .mceListBoxMenu {overflow-y:auto} - -/* SplitButton */ -.highcontrastSkin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} - -.highcontrastSkin .mceSplitButton { border-collapse: collapse; margin: 2px; height: 2em; line-height: 2em;-webkit-focus-ring-color:none;outline:none;} -.highcontrastSkin .mceSplitButton td { display: table-cell; float: none; margin: 0; padding: 0; height: 2em;} -.highcontrastSkin .mceSplitButton tr { display: table-row; } -.highcontrastSkin table.mceSplitButton { display: table; } -.highcontrastSkin .mceSplitButton a.mceAction { padding: 5px 10px; display: block; height: 2em; line-height: 2em; overflow: hidden; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} -.highcontrastSkin .mceSplitButton a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} -.highcontrastSkin .mceSplitButton .mceVoiceLabel { height: 2em; vertical-align: center; line-height: 2em; } -.highcontrastSkin .mceSplitButton:focus a.mceAction, .highcontrastSkin .mceSplitButton:active a.mceAction { border-width: 5px; border-right-width: 1px; padding: 1px 10px 1px 6px;-webkit-focus-ring-color:none;outline:none;} -.highcontrastSkin .mceSplitButton:focus a.mceOpen, .highcontrastSkin .mceSplitButton:active a.mceOpen { border-width: 5px; border-left-width: 1px; padding: 1px 0px 1px 4px;-webkit-focus-ring-color:none;outline:none;} - -/* Menu */ -.highcontrastSkin .mceNoIcons span.mceIcon {width:0;} -.highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; } -.highcontrastSkin .mceMenu table {background:white; color: black} -.highcontrastSkin .mceNoIcons a .mceText {padding-left:10px} -.highcontrastSkin .mceMenu a, .highcontrastSkin .mceMenu span, .highcontrastSkin .mceMenu {display:block;background:white; color: black} -.highcontrastSkin .mceMenu td {height:2em} -.highcontrastSkin .mceMenu a {position:relative;padding:3px 0 4px 0; display: block;} -.highcontrastSkin .mceMenu .mceText {position:relative; display:block; cursor:default; margin:0; padding:0 25px 0 25px;} -.highcontrastSkin .mceMenu pre.mceText {font-family:Monospace} -.highcontrastSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:26px;} -.highcontrastSkin td.mceMenuItemSeparator {border-top:1px solid; height:1px} -.highcontrastSkin .mceMenuItemTitle a {border:0; border-bottom:1px solid} -.highcontrastSkin .mceMenuItemTitle span.mceText {font-weight:bold; padding-left:4px} -.highcontrastSkin .mceNoIcons .mceMenuItemSelected span.mceText:before {content: "\2713\A0";} -.highcontrastSkin .mceMenu span.mceMenuLine {display:none} -.highcontrastSkin .mceMenuItemSub a .mceText:after {content: "\A0\25B8"} -.highcontrastSkin .mceMenuItem td, .highcontrastSkin .mceMenuItem th {line-height: normal} - -/* ColorSplitButton */ -.highcontrastSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid; color: #000} -.highcontrastSkin .mceColorSplitMenu td {padding:2px} -.highcontrastSkin .mceColorSplitMenu a {display:block; width:16px; height:16px; overflow:hidden; color:#000; margin: 0; padding: 0;} -.highcontrastSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} -.highcontrastSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} -.highcontrastSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid; background-color:#B6BDD2} -.highcontrastSkin a.mceMoreColors:hover {border:1px solid #0A246A; color: #000;} -.highcontrastSkin .mceColorPreview {display:none;} -.highcontrastSkin .mce_forecolor span.mceAction, .highcontrastSkin .mce_backcolor span.mceAction {height:17px;overflow:hidden} - -/* Progress,Resize */ -.highcontrastSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} -.highcontrastSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} - -/* Formats */ -.highcontrastSkin .mce_p span.mceText {} -.highcontrastSkin .mce_address span.mceText {font-style:italic} -.highcontrastSkin .mce_pre span.mceText {font-family:monospace} -.highcontrastSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} -.highcontrastSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} -.highcontrastSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} -.highcontrastSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} -.highcontrastSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} -.highcontrastSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} +/* Reset */ +.highcontrastSkin table, .highcontrastSkin tbody, .highcontrastSkin a, .highcontrastSkin img, .highcontrastSkin tr, .highcontrastSkin div, .highcontrastSkin td, .highcontrastSkin iframe, .highcontrastSkin span, .highcontrastSkin *, .highcontrastSkin .mceText {border:0; margin:0; padding:0; vertical-align:baseline; border-collapse:separate;} +.highcontrastSkin a:hover, .highcontrastSkin a:link, .highcontrastSkin a:visited, .highcontrastSkin a:active {text-decoration:none; font-weight:normal; cursor:default;} +.highcontrastSkin table td {vertical-align:middle} + +.highcontrastSkin .mceIconOnly {display: block !important;} + +/* External */ +.highcontrastSkin .mceExternalToolbar {position:absolute; border:1px solid; border-bottom:0; display:none; background-color: white;} +.highcontrastSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.highcontrastSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px;} + +/* Layout */ +.highcontrastSkin table.mceLayout {border: 1px solid;} +.highcontrastSkin .mceIframeContainer {border-top:1px solid; border-bottom:1px solid} +.highcontrastSkin .mceStatusbar a:hover {text-decoration:underline} +.highcontrastSkin .mceStatusbar {display:block; line-height:1.5em; overflow:visible;} +.highcontrastSkin .mceStatusbar div {float:left} +.highcontrastSkin .mceStatusbar a.mceResize {display:block; float:right; width:20px; height:20px; cursor:se-resize; outline:0} + +.highcontrastSkin .mceToolbar td { display: inline-block; float: left;} +.highcontrastSkin .mceToolbar tr { display: block;} +.highcontrastSkin .mceToolbar table { display: block; } + +/* Button */ + +.highcontrastSkin .mceButton { display:block; margin: 2px; padding: 5px 10px;border: 1px solid; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -ms-border-radius: 3px; height: 2em;} +.highcontrastSkin .mceButton .mceVoiceLabel { height: 100%; vertical-align: center; line-height: 2em} +.highcontrastSkin .mceButtonDisabled .mceVoiceLabel { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} +.highcontrastSkin .mceButtonActive, .highcontrastSkin .mceButton:focus, .highcontrastSkin .mceButton:active { border: 5px solid; padding: 1px 6px;-webkit-focus-ring-color:none;outline:none;} + +/* Separator */ +.highcontrastSkin .mceSeparator {display:block; width:16px; height:26px;} + +/* ListBox */ +.highcontrastSkin .mceListBox { display: block; margin:2px;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceListBox .mceText {padding: 5px 6px; line-height: 2em; width: 15ex; overflow: hidden;} +.highcontrastSkin .mceListBoxDisabled .mceText { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} +.highcontrastSkin .mceListBox a.mceText { padding: 5px 10px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} +.highcontrastSkin .mceListBox a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-left: 0; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} +.highcontrastSkin .mceListBox:focus a.mceText, .highcontrastSkin .mceListBox:active a.mceText { border-width: 5px; padding: 1px 10px 1px 6px;} +.highcontrastSkin .mceListBox:focus a.mceOpen, .highcontrastSkin .mceListBox:active a.mceOpen { border-width: 5px; padding: 1px 0px 1px 4px;} + +.highcontrastSkin .mceListBoxMenu {overflow-y:auto} + +/* SplitButton */ +.highcontrastSkin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +.highcontrastSkin .mceSplitButton { border-collapse: collapse; margin: 2px; height: 2em; line-height: 2em;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceSplitButton td { display: table-cell; float: none; margin: 0; padding: 0; height: 2em;} +.highcontrastSkin .mceSplitButton tr { display: table-row; } +.highcontrastSkin table.mceSplitButton { display: table; } +.highcontrastSkin .mceSplitButton a.mceAction { padding: 5px 10px; display: block; height: 2em; line-height: 2em; overflow: hidden; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} +.highcontrastSkin .mceSplitButton a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} +.highcontrastSkin .mceSplitButton .mceVoiceLabel { height: 2em; vertical-align: center; line-height: 2em; } +.highcontrastSkin .mceSplitButton:focus a.mceAction, .highcontrastSkin .mceSplitButton:active a.mceAction { border-width: 5px; border-right-width: 1px; padding: 1px 10px 1px 6px;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceSplitButton:focus a.mceOpen, .highcontrastSkin .mceSplitButton:active a.mceOpen { border-width: 5px; border-left-width: 1px; padding: 1px 0px 1px 4px;-webkit-focus-ring-color:none;outline:none;} + +/* Menu */ +.highcontrastSkin .mceNoIcons span.mceIcon {width:0;} +.highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; } +.highcontrastSkin .mceMenu table {background:white; color: black} +.highcontrastSkin .mceNoIcons a .mceText {padding-left:10px} +.highcontrastSkin .mceMenu a, .highcontrastSkin .mceMenu span, .highcontrastSkin .mceMenu {display:block;background:white; color: black} +.highcontrastSkin .mceMenu td {height:2em} +.highcontrastSkin .mceMenu a {position:relative;padding:3px 0 4px 0; display: block;} +.highcontrastSkin .mceMenu .mceText {position:relative; display:block; cursor:default; margin:0; padding:0 25px 0 25px;} +.highcontrastSkin .mceMenu pre.mceText {font-family:Monospace} +.highcontrastSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:26px;} +.highcontrastSkin td.mceMenuItemSeparator {border-top:1px solid; height:1px} +.highcontrastSkin .mceMenuItemTitle a {border:0; border-bottom:1px solid} +.highcontrastSkin .mceMenuItemTitle span.mceText {font-weight:bold; padding-left:4px} +.highcontrastSkin .mceNoIcons .mceMenuItemSelected span.mceText:before {content: "\2713\A0";} +.highcontrastSkin .mceMenu span.mceMenuLine {display:none} +.highcontrastSkin .mceMenuItemSub a .mceText:after {content: "\A0\25B8"} +.highcontrastSkin .mceMenuItem td, .highcontrastSkin .mceMenuItem th {line-height: normal} + +/* ColorSplitButton */ +.highcontrastSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid; color: #000} +.highcontrastSkin .mceColorSplitMenu td {padding:2px} +.highcontrastSkin .mceColorSplitMenu a {display:block; width:16px; height:16px; overflow:hidden; color:#000; margin: 0; padding: 0;} +.highcontrastSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.highcontrastSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.highcontrastSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid; background-color:#B6BDD2} +.highcontrastSkin a.mceMoreColors:hover {border:1px solid #0A246A; color: #000;} +.highcontrastSkin .mceColorPreview {display:none;} +.highcontrastSkin .mce_forecolor span.mceAction, .highcontrastSkin .mce_backcolor span.mceAction {height:17px;overflow:hidden} + +/* Progress,Resize */ +.highcontrastSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} +.highcontrastSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Formats */ +.highcontrastSkin .mce_p span.mceText {} +.highcontrastSkin .mce_address span.mceText {font-style:italic} +.highcontrastSkin .mce_pre span.mceText {font-family:monospace} +.highcontrastSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.highcontrastSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.highcontrastSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.highcontrastSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.highcontrastSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.highcontrastSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/content.css b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/content.css similarity index 97% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/content.css rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/content.css index a1a8f9bd..631fa0ec 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/content.css +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/content.css @@ -1,48 +1,48 @@ -body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} -body {background:#FFF;} -body.mceForceColors {background:#FFF; color:#000;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} -span.mceItemNbsp {background: #DDD} -td.mceSelected, th.mceSelected {background-color:#3399ff !important} -img {border:0;} -table, img, hr, .mceItemAnchor {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr {border-bottom:1px dashed #CCC; cursor:help} - -/* IE */ -* html body { -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -} - -img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} -font[face=mceinline] {font-family:inherit !important} -*[contentEditable]:focus {outline:0} - -.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} -.mceItemShockWave {background-image:url(../../img/shockwave.gif)} -.mceItemFlash {background-image:url(../../img/flash.gif)} -.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} -.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} -.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} -.mceItemVideo {background-image:url(../../img/video.gif)} -.mceItemAudio {background-image:url(../../img/video.gif)} -.mceItemIframe {background-image:url(../../img/iframe.gif)} -.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table, img, hr, .mceItemAnchor {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} +*[contentEditable]:focus {outline:0} + +.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} +.mceItemShockWave {background-image:url(../../img/shockwave.gif)} +.mceItemFlash {background-image:url(../../img/flash.gif)} +.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} +.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} +.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} +.mceItemVideo {background-image:url(../../img/video.gif)} +.mceItemAudio {background-image:url(../../img/video.gif)} +.mceItemIframe {background-image:url(../../img/iframe.gif)} +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/dialog.css b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/dialog.css similarity index 97% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/dialog.css rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/dialog.css index ec087722..c97d38e8 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/dialog.css +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/dialog.css @@ -1,117 +1,117 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDDDDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -background:#F0F0EE; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;} -a:hover {color:#2B6FB6;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;} -input.invalid {border:1px solid #EE0000;} -input {background:#FFF; border:1px solid #CCC;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -border:0; margin:0; padding:0; -font-weight:bold; -width:94px; height:26px; -background:url(../default/img/buttons.png) 0 -26px; -cursor:pointer; -padding-bottom:2px; -float:left; -} - -#insert {background:url(../default/img/buttons.png) 0 -52px} -#cancel {background:url(../default/img/buttons.png) 0 0; float:right} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} -.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} -.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} -.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} -#colorpicker #picker_panel fieldset {margin:auto;width:325px;} +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(../default/img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#insert {background:url(../default/img/buttons.png) 0 -52px} +#cancel {background:url(../default/img/buttons.png) 0 0; float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/img/button_bg.png b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/img/button_bg.png similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/img/button_bg.png rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/img/button_bg.png diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/img/button_bg_black.png b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/img/button_bg_black.png similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/img/button_bg_black.png rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/img/button_bg_black.png diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/img/button_bg_silver.png b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/img/button_bg_silver.png similarity index 100% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/img/button_bg_silver.png rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/img/button_bg_silver.png diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/ui.css b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/ui.css similarity index 98% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/ui.css rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/ui.css index 0916c34e..c0156d2c 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/ui.css +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/ui.css @@ -1,217 +1,217 @@ -/* Reset */ -.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} -.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} -.o2k7Skin table td {vertical-align:middle} - -/* Containers */ -.o2k7Skin table {background:transparent} -.o2k7Skin iframe {display:block;} -.o2k7Skin .mceToolbar {height:26px} - -/* External */ -.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} -.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} -.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} - -/* Layout */ -.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} -.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} -.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} -.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} -.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} -.o2k7Skin td.mceToolbar{background:#E5EFFD} -.o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} -.o2k7Skin .mceStatusbar div {float:left; padding:2px} -.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} -.o2k7Skin .mceStatusbar a:hover {text-decoration:underline} -.o2k7Skin table.mceToolbar {margin-left:3px} -.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} -.o2k7Skin .mceToolbar td.mceFirst span {margin:0} -.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} -.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} -.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} -.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} -.o2k7Skin td.mceCenter {text-align:center;} -.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} -.o2k7Skin td.mceRight table {margin:0 0 0 auto;} - -/* Button */ -.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} -.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} -.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} -.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} -.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} -.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.o2k7Skin .mceButtonLabeled {width:auto} -.o2k7Skin .mceButtonLabeled span.mceIcon {float:left} -.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} -.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} - -/* Separator */ -.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} - -/* ListBox */ -.o2k7Skin .mceListBox {padding-left: 3px} -.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} -.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} -.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} -.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} -.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} -.o2k7Skin .mceListBoxDisabled .mceText {color:gray} -.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden; margin-left:3px} -.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} -.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} - -/* SplitButton */ -.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr} -.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} -.o2k7Skin .mceSplitButton a.mceAction {width:22px} -.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)} -.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} -.o2k7Skin .mceSplitButton span.mceOpen {display:none} -.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} -.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} -.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.o2k7Skin .mceSplitButtonActive {background-position:0 -44px} - -/* ColorSplitButton */ -.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} -.o2k7Skin .mceColorSplitMenu td {padding:2px} -.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} -.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} -.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} -.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} -.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} -.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} -.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} - -/* Menu */ -.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD} -.o2k7Skin .mceNoIcons span.mceIcon {width:0;} -.o2k7Skin .mceNoIcons a .mceText {padding-left:10px} -.o2k7Skin .mceMenu table {background:#FFF} -.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} -.o2k7Skin .mceMenu td {height:20px} -.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} -.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} -.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} -.o2k7Skin .mceMenu pre.mceText {font-family:Monospace} -.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} -.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} -.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} -.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} -.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} -.o2k7Skin .mceMenuItemDisabled .mceText {color:#888} -.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} -.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} -.o2k7Skin .mceMenu span.mceMenuLine {display:none} -.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} -.o2k7Skin .mceMenuItem td, .o2k7Skin .mceMenuItem th {line-height: normal} - -/* Progress,Resize */ -.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} -.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} - -/* Formats */ -.o2k7Skin .mce_formatPreview a {font-size:10px} -.o2k7Skin .mce_p span.mceText {} -.o2k7Skin .mce_address span.mceText {font-style:italic} -.o2k7Skin .mce_pre span.mceText {font-family:monospace} -.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} -.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} -.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} -.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} -.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} -.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} - -/* Theme */ -.o2k7Skin span.mce_bold {background-position:0 0} -.o2k7Skin span.mce_italic {background-position:-60px 0} -.o2k7Skin span.mce_underline {background-position:-140px 0} -.o2k7Skin span.mce_strikethrough {background-position:-120px 0} -.o2k7Skin span.mce_undo {background-position:-160px 0} -.o2k7Skin span.mce_redo {background-position:-100px 0} -.o2k7Skin span.mce_cleanup {background-position:-40px 0} -.o2k7Skin span.mce_bullist {background-position:-20px 0} -.o2k7Skin span.mce_numlist {background-position:-80px 0} -.o2k7Skin span.mce_justifyleft {background-position:-460px 0} -.o2k7Skin span.mce_justifyright {background-position:-480px 0} -.o2k7Skin span.mce_justifycenter {background-position:-420px 0} -.o2k7Skin span.mce_justifyfull {background-position:-440px 0} -.o2k7Skin span.mce_anchor {background-position:-200px 0} -.o2k7Skin span.mce_indent {background-position:-400px 0} -.o2k7Skin span.mce_outdent {background-position:-540px 0} -.o2k7Skin span.mce_link {background-position:-500px 0} -.o2k7Skin span.mce_unlink {background-position:-640px 0} -.o2k7Skin span.mce_sub {background-position:-600px 0} -.o2k7Skin span.mce_sup {background-position:-620px 0} -.o2k7Skin span.mce_removeformat {background-position:-580px 0} -.o2k7Skin span.mce_newdocument {background-position:-520px 0} -.o2k7Skin span.mce_image {background-position:-380px 0} -.o2k7Skin span.mce_help {background-position:-340px 0} -.o2k7Skin span.mce_code {background-position:-260px 0} -.o2k7Skin span.mce_hr {background-position:-360px 0} -.o2k7Skin span.mce_visualaid {background-position:-660px 0} -.o2k7Skin span.mce_charmap {background-position:-240px 0} -.o2k7Skin span.mce_paste {background-position:-560px 0} -.o2k7Skin span.mce_copy {background-position:-700px 0} -.o2k7Skin span.mce_cut {background-position:-680px 0} -.o2k7Skin span.mce_blockquote {background-position:-220px 0} -.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} -.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} -.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} -.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} - -/* Plugins */ -.o2k7Skin span.mce_advhr {background-position:-0px -20px} -.o2k7Skin span.mce_ltr {background-position:-20px -20px} -.o2k7Skin span.mce_rtl {background-position:-40px -20px} -.o2k7Skin span.mce_emotions {background-position:-60px -20px} -.o2k7Skin span.mce_fullpage {background-position:-80px -20px} -.o2k7Skin span.mce_fullscreen {background-position:-100px -20px} -.o2k7Skin span.mce_iespell {background-position:-120px -20px} -.o2k7Skin span.mce_insertdate {background-position:-140px -20px} -.o2k7Skin span.mce_inserttime {background-position:-160px -20px} -.o2k7Skin span.mce_absolute {background-position:-180px -20px} -.o2k7Skin span.mce_backward {background-position:-200px -20px} -.o2k7Skin span.mce_forward {background-position:-220px -20px} -.o2k7Skin span.mce_insert_layer {background-position:-240px -20px} -.o2k7Skin span.mce_insertlayer {background-position:-260px -20px} -.o2k7Skin span.mce_movebackward {background-position:-280px -20px} -.o2k7Skin span.mce_moveforward {background-position:-300px -20px} -.o2k7Skin span.mce_media {background-position:-320px -20px} -.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} -.o2k7Skin span.mce_pastetext {background-position:-360px -20px} -.o2k7Skin span.mce_pasteword {background-position:-380px -20px} -.o2k7Skin span.mce_selectall {background-position:-400px -20px} -.o2k7Skin span.mce_preview {background-position:-420px -20px} -.o2k7Skin span.mce_print {background-position:-440px -20px} -.o2k7Skin span.mce_cancel {background-position:-460px -20px} -.o2k7Skin span.mce_save {background-position:-480px -20px} -.o2k7Skin span.mce_replace {background-position:-500px -20px} -.o2k7Skin span.mce_search {background-position:-520px -20px} -.o2k7Skin span.mce_styleprops {background-position:-560px -20px} -.o2k7Skin span.mce_table {background-position:-580px -20px} -.o2k7Skin span.mce_cell_props {background-position:-600px -20px} -.o2k7Skin span.mce_delete_table {background-position:-620px -20px} -.o2k7Skin span.mce_delete_col {background-position:-640px -20px} -.o2k7Skin span.mce_delete_row {background-position:-660px -20px} -.o2k7Skin span.mce_col_after {background-position:-680px -20px} -.o2k7Skin span.mce_col_before {background-position:-700px -20px} -.o2k7Skin span.mce_row_after {background-position:-720px -20px} -.o2k7Skin span.mce_row_before {background-position:-740px -20px} -.o2k7Skin span.mce_merge_cells {background-position:-760px -20px} -.o2k7Skin span.mce_table_props {background-position:-980px -20px} -.o2k7Skin span.mce_row_props {background-position:-780px -20px} -.o2k7Skin span.mce_split_cells {background-position:-800px -20px} -.o2k7Skin span.mce_template {background-position:-820px -20px} -.o2k7Skin span.mce_visualchars {background-position:-840px -20px} -.o2k7Skin span.mce_abbr {background-position:-860px -20px} -.o2k7Skin span.mce_acronym {background-position:-880px -20px} -.o2k7Skin span.mce_attribs {background-position:-900px -20px} -.o2k7Skin span.mce_cite {background-position:-920px -20px} -.o2k7Skin span.mce_del {background-position:-940px -20px} -.o2k7Skin span.mce_ins {background-position:-960px -20px} -.o2k7Skin span.mce_pagebreak {background-position:0 -40px} -.o2k7Skin span.mce_restoredraft {background-position:-20px -40px} -.o2k7Skin span.mce_spellchecker {background-position:-540px -20px} +/* Reset */ +.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.o2k7Skin table td {vertical-align:middle} + +/* Containers */ +.o2k7Skin table {background:transparent} +.o2k7Skin iframe {display:block;} +.o2k7Skin .mceToolbar {height:26px} + +/* External */ +.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} +.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} +.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} +.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} +.o2k7Skin td.mceToolbar{background:#E5EFFD} +.o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} +.o2k7Skin .mceStatusbar div {float:left; padding:2px} +.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} +.o2k7Skin .mceStatusbar a:hover {text-decoration:underline} +.o2k7Skin table.mceToolbar {margin-left:3px} +.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} +.o2k7Skin .mceToolbar td.mceFirst span {margin:0} +.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} +.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} +.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.o2k7Skin td.mceCenter {text-align:center;} +.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} +.o2k7Skin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} +.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} +.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} +.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceButtonLabeled {width:auto} +.o2k7Skin .mceButtonLabeled span.mceIcon {float:left} +.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* ListBox */ +.o2k7Skin .mceListBox {padding-left: 3px} +.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} +.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} +.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} +.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} +.o2k7Skin .mceListBoxDisabled .mceText {color:gray} +.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden; margin-left:3px} +.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} +.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} + +/* SplitButton */ +.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr} +.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} +.o2k7Skin .mceSplitButton a.mceAction {width:22px} +.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)} +.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} +.o2k7Skin .mceSplitButton span.mceOpen {display:none} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} +.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceSplitButtonActive {background-position:0 -44px} + +/* ColorSplitButton */ +.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.o2k7Skin .mceColorSplitMenu td {padding:2px} +.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} +.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} +.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} + +/* Menu */ +.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD} +.o2k7Skin .mceNoIcons span.mceIcon {width:0;} +.o2k7Skin .mceNoIcons a .mceText {padding-left:10px} +.o2k7Skin .mceMenu table {background:#FFF} +.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} +.o2k7Skin .mceMenu td {height:20px} +.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} +.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} +.o2k7Skin .mceMenu pre.mceText {font-family:Monospace} +.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} +.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} +.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.o2k7Skin .mceMenuItemDisabled .mceText {color:#888} +.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} +.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} +.o2k7Skin .mceMenu span.mceMenuLine {display:none} +.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} +.o2k7Skin .mceMenuItem td, .o2k7Skin .mceMenuItem th {line-height: normal} + +/* Progress,Resize */ +.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} +.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Formats */ +.o2k7Skin .mce_formatPreview a {font-size:10px} +.o2k7Skin .mce_p span.mceText {} +.o2k7Skin .mce_address span.mceText {font-style:italic} +.o2k7Skin .mce_pre span.mceText {font-family:monospace} +.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.o2k7Skin span.mce_bold {background-position:0 0} +.o2k7Skin span.mce_italic {background-position:-60px 0} +.o2k7Skin span.mce_underline {background-position:-140px 0} +.o2k7Skin span.mce_strikethrough {background-position:-120px 0} +.o2k7Skin span.mce_undo {background-position:-160px 0} +.o2k7Skin span.mce_redo {background-position:-100px 0} +.o2k7Skin span.mce_cleanup {background-position:-40px 0} +.o2k7Skin span.mce_bullist {background-position:-20px 0} +.o2k7Skin span.mce_numlist {background-position:-80px 0} +.o2k7Skin span.mce_justifyleft {background-position:-460px 0} +.o2k7Skin span.mce_justifyright {background-position:-480px 0} +.o2k7Skin span.mce_justifycenter {background-position:-420px 0} +.o2k7Skin span.mce_justifyfull {background-position:-440px 0} +.o2k7Skin span.mce_anchor {background-position:-200px 0} +.o2k7Skin span.mce_indent {background-position:-400px 0} +.o2k7Skin span.mce_outdent {background-position:-540px 0} +.o2k7Skin span.mce_link {background-position:-500px 0} +.o2k7Skin span.mce_unlink {background-position:-640px 0} +.o2k7Skin span.mce_sub {background-position:-600px 0} +.o2k7Skin span.mce_sup {background-position:-620px 0} +.o2k7Skin span.mce_removeformat {background-position:-580px 0} +.o2k7Skin span.mce_newdocument {background-position:-520px 0} +.o2k7Skin span.mce_image {background-position:-380px 0} +.o2k7Skin span.mce_help {background-position:-340px 0} +.o2k7Skin span.mce_code {background-position:-260px 0} +.o2k7Skin span.mce_hr {background-position:-360px 0} +.o2k7Skin span.mce_visualaid {background-position:-660px 0} +.o2k7Skin span.mce_charmap {background-position:-240px 0} +.o2k7Skin span.mce_paste {background-position:-560px 0} +.o2k7Skin span.mce_copy {background-position:-700px 0} +.o2k7Skin span.mce_cut {background-position:-680px 0} +.o2k7Skin span.mce_blockquote {background-position:-220px 0} +.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} +.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} +.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} +.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.o2k7Skin span.mce_advhr {background-position:-0px -20px} +.o2k7Skin span.mce_ltr {background-position:-20px -20px} +.o2k7Skin span.mce_rtl {background-position:-40px -20px} +.o2k7Skin span.mce_emotions {background-position:-60px -20px} +.o2k7Skin span.mce_fullpage {background-position:-80px -20px} +.o2k7Skin span.mce_fullscreen {background-position:-100px -20px} +.o2k7Skin span.mce_iespell {background-position:-120px -20px} +.o2k7Skin span.mce_insertdate {background-position:-140px -20px} +.o2k7Skin span.mce_inserttime {background-position:-160px -20px} +.o2k7Skin span.mce_absolute {background-position:-180px -20px} +.o2k7Skin span.mce_backward {background-position:-200px -20px} +.o2k7Skin span.mce_forward {background-position:-220px -20px} +.o2k7Skin span.mce_insert_layer {background-position:-240px -20px} +.o2k7Skin span.mce_insertlayer {background-position:-260px -20px} +.o2k7Skin span.mce_movebackward {background-position:-280px -20px} +.o2k7Skin span.mce_moveforward {background-position:-300px -20px} +.o2k7Skin span.mce_media {background-position:-320px -20px} +.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} +.o2k7Skin span.mce_pastetext {background-position:-360px -20px} +.o2k7Skin span.mce_pasteword {background-position:-380px -20px} +.o2k7Skin span.mce_selectall {background-position:-400px -20px} +.o2k7Skin span.mce_preview {background-position:-420px -20px} +.o2k7Skin span.mce_print {background-position:-440px -20px} +.o2k7Skin span.mce_cancel {background-position:-460px -20px} +.o2k7Skin span.mce_save {background-position:-480px -20px} +.o2k7Skin span.mce_replace {background-position:-500px -20px} +.o2k7Skin span.mce_search {background-position:-520px -20px} +.o2k7Skin span.mce_styleprops {background-position:-560px -20px} +.o2k7Skin span.mce_table {background-position:-580px -20px} +.o2k7Skin span.mce_cell_props {background-position:-600px -20px} +.o2k7Skin span.mce_delete_table {background-position:-620px -20px} +.o2k7Skin span.mce_delete_col {background-position:-640px -20px} +.o2k7Skin span.mce_delete_row {background-position:-660px -20px} +.o2k7Skin span.mce_col_after {background-position:-680px -20px} +.o2k7Skin span.mce_col_before {background-position:-700px -20px} +.o2k7Skin span.mce_row_after {background-position:-720px -20px} +.o2k7Skin span.mce_row_before {background-position:-740px -20px} +.o2k7Skin span.mce_merge_cells {background-position:-760px -20px} +.o2k7Skin span.mce_table_props {background-position:-980px -20px} +.o2k7Skin span.mce_row_props {background-position:-780px -20px} +.o2k7Skin span.mce_split_cells {background-position:-800px -20px} +.o2k7Skin span.mce_template {background-position:-820px -20px} +.o2k7Skin span.mce_visualchars {background-position:-840px -20px} +.o2k7Skin span.mce_abbr {background-position:-860px -20px} +.o2k7Skin span.mce_acronym {background-position:-880px -20px} +.o2k7Skin span.mce_attribs {background-position:-900px -20px} +.o2k7Skin span.mce_cite {background-position:-920px -20px} +.o2k7Skin span.mce_del {background-position:-940px -20px} +.o2k7Skin span.mce_ins {background-position:-960px -20px} +.o2k7Skin span.mce_pagebreak {background-position:0 -40px} +.o2k7Skin span.mce_restoredraft {background-position:-20px -40px} +.o2k7Skin span.mce_spellchecker {background-position:-540px -20px} diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/ui_black.css b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/ui_black.css similarity index 96% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/ui_black.css rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/ui_black.css index 50c9b76a..85812cde 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/ui_black.css +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/ui_black.css @@ -1,8 +1,8 @@ -/* Black */ -.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} -.o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} -.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} -.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} -.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} -.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} +/* Black */ +.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} +.o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} +.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} +.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} +.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} +.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} .o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1} \ No newline at end of file diff --git a/engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/ui_silver.css b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/ui_silver.css similarity index 99% rename from engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/ui_silver.css rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/ui_silver.css index 960a8e47..d64c3616 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/skins/o2k7/ui_silver.css +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/skins/o2k7/ui_silver.css @@ -1,5 +1,5 @@ -/* Silver */ -.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} -.o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} -.o2k7SkinSilver .mceListBox .mceText {background:#FFF} -.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} +/* Silver */ +.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} +.o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} +.o2k7SkinSilver .mceListBox .mceText {background:#FFF} +.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} diff --git a/engine/lib/external/tinymce-jq/themes/advanced/source_editor.htm b/templates/framework/js/vendor/tinymce-jq/themes/advanced/source_editor.htm similarity index 98% rename from engine/lib/external/tinymce-jq/themes/advanced/source_editor.htm rename to templates/framework/js/vendor/tinymce-jq/themes/advanced/source_editor.htm index 3c6d6580..d3f75d66 100644 --- a/engine/lib/external/tinymce-jq/themes/advanced/source_editor.htm +++ b/templates/framework/js/vendor/tinymce-jq/themes/advanced/source_editor.htm @@ -1,25 +1,25 @@ - - - {#advanced_dlg.code_title} - - - - -
-
- -
- -
- -
- - - -
- - -
-
- - + + + {#advanced_dlg.code_title} + + + + +
+
+ +
+ +
+ +
+ + + +
+ + +
+
+ + diff --git a/engine/lib/external/tinymce-jq/themes/simple/editor_template.js b/templates/framework/js/vendor/tinymce-jq/themes/simple/editor_template.js similarity index 100% rename from engine/lib/external/tinymce-jq/themes/simple/editor_template.js rename to templates/framework/js/vendor/tinymce-jq/themes/simple/editor_template.js diff --git a/engine/lib/external/tinymce-jq/themes/simple/editor_template_src.js b/templates/framework/js/vendor/tinymce-jq/themes/simple/editor_template_src.js similarity index 97% rename from engine/lib/external/tinymce-jq/themes/simple/editor_template_src.js rename to templates/framework/js/vendor/tinymce-jq/themes/simple/editor_template_src.js index 01ce87c5..35c19a6b 100644 --- a/engine/lib/external/tinymce-jq/themes/simple/editor_template_src.js +++ b/templates/framework/js/vendor/tinymce-jq/themes/simple/editor_template_src.js @@ -1,84 +1,84 @@ -/** - * editor_template_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var DOM = tinymce.DOM; - - // Tell it to load theme specific language pack(s) - tinymce.ThemeManager.requireLangPack('simple'); - - tinymce.create('tinymce.themes.SimpleTheme', { - init : function(ed, url) { - var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; - - t.editor = ed; - ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css"); - - ed.onInit.add(function() { - ed.onNodeChange.add(function(ed, cm) { - tinymce.each(states, function(c) { - cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); - }); - }); - }); - - DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); - }, - - renderUI : function(o) { - var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc; - - n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n); - n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'}); - n = tb = DOM.add(n, 'tbody'); - - // Create iframe container - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'}); - - // Create toolbar container - n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'}); - - // Create toolbar - tb = t.toolbar = cf.createToolbar("tools1"); - tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'})); - tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'})); - tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'})); - tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'})); - tb.add(cf.createSeparator()); - tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'})); - tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'})); - tb.add(cf.createSeparator()); - tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'})); - tb.add(cf.createSeparator()); - tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'})); - tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'})); - tb.renderTo(n); - - return { - iframeContainer : ic, - editorContainer : ed.id + '_container', - sizeContainer : sc, - deltaHeight : -20 - }; - }, - - getInfo : function() { - return { - longname : 'Simple theme', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - version : tinymce.majorVersion + "." + tinymce.minorVersion - } - } - }); - - tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme); +/** + * editor_template_src.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +(function() { + var DOM = tinymce.DOM; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('simple'); + + tinymce.create('tinymce.themes.SimpleTheme', { + init : function(ed, url) { + var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; + + t.editor = ed; + ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css"); + + ed.onInit.add(function() { + ed.onNodeChange.add(function(ed, cm) { + tinymce.each(states, function(c) { + cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); + }); + }); + }); + + DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); + }, + + renderUI : function(o) { + var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc; + + n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n); + n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'}); + n = tb = DOM.add(n, 'tbody'); + + // Create iframe container + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'}); + + // Create toolbar container + n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'}); + + // Create toolbar + tb = t.toolbar = cf.createToolbar("tools1"); + tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'})); + tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'})); + tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'})); + tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'})); + tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'})); + tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'})); + tb.renderTo(n); + + return { + iframeContainer : ic, + editorContainer : ed.id + '_container', + sizeContainer : sc, + deltaHeight : -20 + }; + }, + + getInfo : function() { + return { + longname : 'Simple theme', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + version : tinymce.majorVersion + "." + tinymce.minorVersion + } + } + }); + + tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme); })(); \ No newline at end of file diff --git a/engine/lib/external/tinymce-jq/themes/simple/img/icons.gif b/templates/framework/js/vendor/tinymce-jq/themes/simple/img/icons.gif similarity index 100% rename from engine/lib/external/tinymce-jq/themes/simple/img/icons.gif rename to templates/framework/js/vendor/tinymce-jq/themes/simple/img/icons.gif diff --git a/engine/lib/external/tinymce-jq/themes/simple/langs/en.js b/templates/framework/js/vendor/tinymce-jq/themes/simple/langs/en.js similarity index 100% rename from engine/lib/external/tinymce-jq/themes/simple/langs/en.js rename to templates/framework/js/vendor/tinymce-jq/themes/simple/langs/en.js diff --git a/engine/lib/external/tinymce-jq/themes/simple/langs/ru.js b/templates/framework/js/vendor/tinymce-jq/themes/simple/langs/ru.js old mode 100755 new mode 100644 similarity index 100% rename from engine/lib/external/tinymce-jq/themes/simple/langs/ru.js rename to templates/framework/js/vendor/tinymce-jq/themes/simple/langs/ru.js diff --git a/engine/lib/external/tinymce-jq/themes/simple/skins/default/content.css b/templates/framework/js/vendor/tinymce-jq/themes/simple/skins/default/content.css similarity index 95% rename from engine/lib/external/tinymce-jq/themes/simple/skins/default/content.css rename to templates/framework/js/vendor/tinymce-jq/themes/simple/skins/default/content.css index 2506c807..783b170f 100644 --- a/engine/lib/external/tinymce-jq/themes/simple/skins/default/content.css +++ b/templates/framework/js/vendor/tinymce-jq/themes/simple/skins/default/content.css @@ -1,25 +1,25 @@ -body, td, pre { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10px; -} - -body { - background-color: #FFFFFF; -} - -.mceVisualAid { - border: 1px dashed #BBBBBB; -} - -/* MSIE specific */ - -* html body { - scrollbar-3dlight-color: #F0F0EE; - scrollbar-arrow-color: #676662; - scrollbar-base-color: #F0F0EE; - scrollbar-darkshadow-color: #DDDDDD; - scrollbar-face-color: #E0E0DD; - scrollbar-highlight-color: #F0F0EE; - scrollbar-shadow-color: #F0F0EE; - scrollbar-track-color: #F5F5F5; -} +body, td, pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +body { + background-color: #FFFFFF; +} + +.mceVisualAid { + border: 1px dashed #BBBBBB; +} + +/* MSIE specific */ + +* html body { + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} diff --git a/engine/lib/external/tinymce-jq/themes/simple/skins/default/ui.css b/templates/framework/js/vendor/tinymce-jq/themes/simple/skins/default/ui.css similarity index 98% rename from engine/lib/external/tinymce-jq/themes/simple/skins/default/ui.css rename to templates/framework/js/vendor/tinymce-jq/themes/simple/skins/default/ui.css index 076fe84e..32feae62 100644 --- a/engine/lib/external/tinymce-jq/themes/simple/skins/default/ui.css +++ b/templates/framework/js/vendor/tinymce-jq/themes/simple/skins/default/ui.css @@ -1,32 +1,32 @@ -/* Reset */ -.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} - -/* Containers */ -.defaultSimpleSkin {position:relative} -.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} -.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} -.defaultSimpleSkin .mceToolbar {height:24px;} - -/* Layout */ -.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px} -.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} - -/* Button */ -.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} -.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} -.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} -.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} - -/* Separator */ -.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px} - -/* Theme */ -.defaultSimpleSkin span.mce_bold {background-position:0 0} -.defaultSimpleSkin span.mce_italic {background-position:-60px 0} -.defaultSimpleSkin span.mce_underline {background-position:-140px 0} -.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0} -.defaultSimpleSkin span.mce_undo {background-position:-160px 0} -.defaultSimpleSkin span.mce_redo {background-position:-100px 0} -.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0} -.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} -.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0} +/* Reset */ +.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} + +/* Containers */ +.defaultSimpleSkin {position:relative} +.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} +.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} +.defaultSimpleSkin .mceToolbar {height:24px;} + +/* Layout */ +.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} +.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +/* Separator */ +.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px} + +/* Theme */ +.defaultSimpleSkin span.mce_bold {background-position:0 0} +.defaultSimpleSkin span.mce_italic {background-position:-60px 0} +.defaultSimpleSkin span.mce_underline {background-position:-140px 0} +.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSimpleSkin span.mce_undo {background-position:-160px 0} +.defaultSimpleSkin span.mce_redo {background-position:-100px 0} +.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0} +.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} +.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/engine/lib/external/tinymce-jq/themes/simple/skins/o2k7/content.css b/templates/framework/js/vendor/tinymce-jq/themes/simple/skins/o2k7/content.css similarity index 96% rename from engine/lib/external/tinymce-jq/themes/simple/skins/o2k7/content.css rename to templates/framework/js/vendor/tinymce-jq/themes/simple/skins/o2k7/content.css index 595809fa..e10558f9 100644 --- a/engine/lib/external/tinymce-jq/themes/simple/skins/o2k7/content.css +++ b/templates/framework/js/vendor/tinymce-jq/themes/simple/skins/o2k7/content.css @@ -1,17 +1,17 @@ -body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} - -body {background: #FFF;} -.mceVisualAid {border: 1px dashed #BBB;} - -/* IE */ - -* html body { -scrollbar-3dlight-color: #F0F0EE; -scrollbar-arrow-color: #676662; -scrollbar-base-color: #F0F0EE; -scrollbar-darkshadow-color: #DDDDDD; -scrollbar-face-color: #E0E0DD; -scrollbar-highlight-color: #F0F0EE; -scrollbar-shadow-color: #F0F0EE; -scrollbar-track-color: #F5F5F5; -} +body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} + +body {background: #FFF;} +.mceVisualAid {border: 1px dashed #BBB;} + +/* IE */ + +* html body { +scrollbar-3dlight-color: #F0F0EE; +scrollbar-arrow-color: #676662; +scrollbar-base-color: #F0F0EE; +scrollbar-darkshadow-color: #DDDDDD; +scrollbar-face-color: #E0E0DD; +scrollbar-highlight-color: #F0F0EE; +scrollbar-shadow-color: #F0F0EE; +scrollbar-track-color: #F5F5F5; +} diff --git a/engine/lib/external/tinymce-jq/themes/simple/skins/o2k7/img/button_bg.png b/templates/framework/js/vendor/tinymce-jq/themes/simple/skins/o2k7/img/button_bg.png similarity index 100% rename from engine/lib/external/tinymce-jq/themes/simple/skins/o2k7/img/button_bg.png rename to templates/framework/js/vendor/tinymce-jq/themes/simple/skins/o2k7/img/button_bg.png diff --git a/engine/lib/external/tinymce-jq/themes/simple/skins/o2k7/ui.css b/templates/framework/js/vendor/tinymce-jq/themes/simple/skins/o2k7/ui.css similarity index 98% rename from engine/lib/external/tinymce-jq/themes/simple/skins/o2k7/ui.css rename to templates/framework/js/vendor/tinymce-jq/themes/simple/skins/o2k7/ui.css index cf6c35d1..021d650f 100644 --- a/engine/lib/external/tinymce-jq/themes/simple/skins/o2k7/ui.css +++ b/templates/framework/js/vendor/tinymce-jq/themes/simple/skins/o2k7/ui.css @@ -1,35 +1,35 @@ -/* Reset */ -.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} - -/* Containers */ -.o2k7SimpleSkin {position:relative} -.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;} -.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;} -.o2k7SimpleSkin .mceToolbar {height:26px;} - -/* Layout */ -.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } -.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} -.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px} -.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} - -/* Button */ -.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} -.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px} -.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} -.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px} -.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} - -/* Separator */ -.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} - -/* Theme */ -.o2k7SimpleSkin span.mce_bold {background-position:0 0} -.o2k7SimpleSkin span.mce_italic {background-position:-60px 0} -.o2k7SimpleSkin span.mce_underline {background-position:-140px 0} -.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0} -.o2k7SimpleSkin span.mce_undo {background-position:-160px 0} -.o2k7SimpleSkin span.mce_redo {background-position:-100px 0} -.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0} -.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} -.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0} +/* Reset */ +.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} + +/* Containers */ +.o2k7SimpleSkin {position:relative} +.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;} +.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;} +.o2k7SimpleSkin .mceToolbar {height:26px;} + +/* Layout */ +.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } +.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px} +.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px} +.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px} +.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +/* Separator */ +.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* Theme */ +.o2k7SimpleSkin span.mce_bold {background-position:0 0} +.o2k7SimpleSkin span.mce_italic {background-position:-60px 0} +.o2k7SimpleSkin span.mce_underline {background-position:-140px 0} +.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0} +.o2k7SimpleSkin span.mce_undo {background-position:-160px 0} +.o2k7SimpleSkin span.mce_redo {background-position:-100px 0} +.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0} +.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} +.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/engine/lib/external/tinymce-jq/tiny_mce.js b/templates/framework/js/vendor/tinymce-jq/tiny_mce.js similarity index 100% rename from engine/lib/external/tinymce-jq/tiny_mce.js rename to templates/framework/js/vendor/tinymce-jq/tiny_mce.js diff --git a/engine/lib/external/tinymce-jq/tiny_mce_popup.js b/templates/framework/js/vendor/tinymce-jq/tiny_mce_popup.js similarity index 100% rename from engine/lib/external/tinymce-jq/tiny_mce_popup.js rename to templates/framework/js/vendor/tinymce-jq/tiny_mce_popup.js diff --git a/engine/lib/external/tinymce-jq/tiny_mce_src.js b/templates/framework/js/vendor/tinymce-jq/tiny_mce_src.js similarity index 96% rename from engine/lib/external/tinymce-jq/tiny_mce_src.js rename to templates/framework/js/vendor/tinymce-jq/tiny_mce_src.js index 9a421a53..a9ef5620 100644 --- a/engine/lib/external/tinymce-jq/tiny_mce_src.js +++ b/templates/framework/js/vendor/tinymce-jq/tiny_mce_src.js @@ -1,16021 +1,16021 @@ -(function(win) { - var whiteSpaceRe = /^\s*|\s*$/g, - undefined, isRegExpBroken = 'B'.replace(/A(.)|B/, '$1') === '$1'; - - var tinymce = { - majorVersion : '3', - - minorVersion : '4.9', - - releaseDate : '2012-02-23', - - _init : function() { - var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v; - - t.isOpera = win.opera && opera.buildNumber; - - t.isWebKit = /WebKit/.test(ua); - - t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName); - - t.isIE6 = t.isIE && /MSIE [56]/.test(ua); - - t.isIE7 = t.isIE && /MSIE [7]/.test(ua); - - t.isIE8 = t.isIE && /MSIE [8]/.test(ua); - - t.isIE9 = t.isIE && /MSIE [9]/.test(ua); - - t.isGecko = !t.isWebKit && /Gecko/.test(ua); - - t.isMac = ua.indexOf('Mac') != -1; - - t.isAir = /adobeair/i.test(ua); - - t.isIDevice = /(iPad|iPhone)/.test(ua); - - t.isIOS5 = t.isIDevice && ua.match(/AppleWebKit\/(\d*)/)[1]>=534; - - // TinyMCE .NET webcontrol might be setting the values for TinyMCE - if (win.tinyMCEPreInit) { - t.suffix = tinyMCEPreInit.suffix; - t.baseURL = tinyMCEPreInit.base; - t.query = tinyMCEPreInit.query; - return; - } - - // Get suffix and base - t.suffix = ''; - - // If base element found, add that infront of baseURL - nl = d.getElementsByTagName('base'); - for (i=0; i : - s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s); - cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name - - // Create namespace for new class - ns = t.createNS(s[3].replace(/\.\w+$/, ''), root); - - // Class already exists - if (ns[cn]) - return; - - // Make pure static class - if (s[2] == 'static') { - ns[cn] = p; - - if (this.onCreate) - this.onCreate(s[2], s[3], ns[cn]); - - return; - } - - // Create default constructor - if (!p[cn]) { - p[cn] = function() {}; - de = 1; - } - - // Add constructor and methods - ns[cn] = p[cn]; - t.extend(ns[cn].prototype, p); - - // Extend - if (s[5]) { - sp = t.resolve(s[5]).prototype; - scn = s[5].match(/\.(\w+)$/i)[1]; // Class name - - // Extend constructor - c = ns[cn]; - if (de) { - // Add passthrough constructor - ns[cn] = function() { - return sp[scn].apply(this, arguments); - }; - } else { - // Add inherit constructor - ns[cn] = function() { - this.parent = sp[scn]; - return c.apply(this, arguments); - }; - } - ns[cn].prototype[cn] = ns[cn]; - - // Add super methods - t.each(sp, function(f, n) { - ns[cn].prototype[n] = sp[n]; - }); - - // Add overridden methods - t.each(p, function(f, n) { - // Extend methods if needed - if (sp[n]) { - ns[cn].prototype[n] = function() { - this.parent = sp[n]; - return f.apply(this, arguments); - }; - } else { - if (n != cn) - ns[cn].prototype[n] = f; - } - }); - } - - // Add static methods - t.each(p['static'], function(f, n) { - ns[cn][n] = f; - }); - - if (this.onCreate) - this.onCreate(s[2], s[3], ns[cn].prototype); - }, - - walk : function(o, f, n, s) { - s = s || this; - - if (o) { - if (n) - o = o[n]; - - tinymce.each(o, function(o, i) { - if (f.call(s, o, i, n) === false) - return false; - - tinymce.walk(o, f, n, s); - }); - } - }, - - createNS : function(n, o) { - var i, v; - - o = o || win; - - n = n.split('.'); - for (i=0; i 0 ? a : [c.scope]); - - if (s === false) - break; - } - - return s; - } - - }); - -(function() { - var each = tinymce.each; - - tinymce.create('tinymce.util.URI', { - URI : function(u, s) { - var t = this, o, a, b, base_url; - - // Trim whitespace - u = tinymce.trim(u); - - // Default settings - s = t.settings = s || {}; - - // Strange app protocol that isn't http/https or local anchor - // For example: mailto,skype,tel etc. - if (/^([\w\-]+):([^\/]{2})/i.test(u) || /^\s*#/.test(u)) { - t.source = u; - return; - } - - // Absolute path with no host, fake host and protocol - if (u.indexOf('/') === 0 && u.indexOf('//') !== 0) - u = (s.base_uri ? s.base_uri.protocol || 'http' : 'http') + '://mce_host' + u; - - // Relative path http:// or protocol relative //path - if (!/^[\w-]*:?\/\//.test(u)) { - base_url = s.base_uri ? s.base_uri.path : new tinymce.util.URI(location.href).directory; - u = ((s.base_uri && s.base_uri.protocol) || 'http') + '://mce_host' + t.toAbsPath(base_url, u); - } - - // Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri) - u = u.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something - u = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u); - each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], function(v, i) { - var s = u[i]; - - // Zope 3 workaround, they use @@something - if (s) - s = s.replace(/\(mce_at\)/g, '@@'); - - t[v] = s; - }); - - if (b = s.base_uri) { - if (!t.protocol) - t.protocol = b.protocol; - - if (!t.userInfo) - t.userInfo = b.userInfo; - - if (!t.port && t.host == 'mce_host') - t.port = b.port; - - if (!t.host || t.host == 'mce_host') - t.host = b.host; - - t.source = ''; - } - - //t.path = t.path || '/'; - }, - - setPath : function(p) { - var t = this; - - p = /^(.*?)\/?(\w+)?$/.exec(p); - - // Update path parts - t.path = p[0]; - t.directory = p[1]; - t.file = p[2]; - - // Rebuild source - t.source = ''; - t.getURI(); - }, - - toRelative : function(u) { - var t = this, o; - - if (u === "./") - return u; - - u = new tinymce.util.URI(u, {base_uri : t}); - - // Not on same domain/port or protocol - if ((u.host != 'mce_host' && t.host != u.host && u.host) || t.port != u.port || t.protocol != u.protocol) - return u.getURI(); - - o = t.toRelPath(t.path, u.path); - - // Add query - if (u.query) - o += '?' + u.query; - - // Add anchor - if (u.anchor) - o += '#' + u.anchor; - - return o; - }, - - toAbsolute : function(u, nh) { - var u = new tinymce.util.URI(u, {base_uri : this}); - - return u.getURI(this.host == u.host && this.protocol == u.protocol ? nh : 0); - }, - - toRelPath : function(base, path) { - var items, bp = 0, out = '', i, l; - - // Split the paths - base = base.substring(0, base.lastIndexOf('/')); - base = base.split('/'); - items = path.split('/'); - - if (base.length >= items.length) { - for (i = 0, l = base.length; i < l; i++) { - if (i >= items.length || base[i] != items[i]) { - bp = i + 1; - break; - } - } - } - - if (base.length < items.length) { - for (i = 0, l = items.length; i < l; i++) { - if (i >= base.length || base[i] != items[i]) { - bp = i + 1; - break; - } - } - } - - if (bp == 1) - return path; - - for (i = 0, l = base.length - (bp - 1); i < l; i++) - out += "../"; - - for (i = bp - 1, l = items.length; i < l; i++) { - if (i != bp - 1) - out += "/" + items[i]; - else - out += items[i]; - } - - return out; - }, - - toAbsPath : function(base, path) { - var i, nb = 0, o = [], tr, outPath; - - // Split paths - tr = /\/$/.test(path) ? '/' : ''; - base = base.split('/'); - path = path.split('/'); - - // Remove empty chunks - each(base, function(k) { - if (k) - o.push(k); - }); - - base = o; - - // Merge relURLParts chunks - for (i = path.length - 1, o = []; i >= 0; i--) { - // Ignore empty or . - if (path[i].length == 0 || path[i] == ".") - continue; - - // Is parent - if (path[i] == '..') { - nb++; - continue; - } - - // Move up - if (nb > 0) { - nb--; - continue; - } - - o.push(path[i]); - } - - i = base.length - nb; - - // If /a/b/c or / - if (i <= 0) - outPath = o.reverse().join('/'); - else - outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/'); - - // Add front / if it's needed - if (outPath.indexOf('/') !== 0) - outPath = '/' + outPath; - - // Add traling / if it's needed - if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) - outPath += tr; - - return outPath; - }, - - getURI : function(nh) { - var s, t = this; - - // Rebuild source - if (!t.source || nh) { - s = ''; - - if (!nh) { - if (t.protocol) - s += t.protocol + '://'; - - if (t.userInfo) - s += t.userInfo + '@'; - - if (t.host) - s += t.host; - - if (t.port) - s += ':' + t.port; - } - - if (t.path) - s += t.path; - - if (t.query) - s += '?' + t.query; - - if (t.anchor) - s += '#' + t.anchor; - - t.source = s; - } - - return t.source; - } - }); -})(); - -(function() { - var each = tinymce.each; - - tinymce.create('static tinymce.util.Cookie', { - getHash : function(n) { - var v = this.get(n), h; - - if (v) { - each(v.split('&'), function(v) { - v = v.split('='); - h = h || {}; - h[unescape(v[0])] = unescape(v[1]); - }); - } - - return h; - }, - - setHash : function(n, v, e, p, d, s) { - var o = ''; - - each(v, function(v, k) { - o += (!o ? '' : '&') + escape(k) + '=' + escape(v); - }); - - this.set(n, o, e, p, d, s); - }, - - get : function(n) { - var c = document.cookie, e, p = n + "=", b; - - // Strict mode - if (!c) - return; - - b = c.indexOf("; " + p); - - if (b == -1) { - b = c.indexOf(p); - - if (b != 0) - return null; - } else - b += 2; - - e = c.indexOf(";", b); - - if (e == -1) - e = c.length; - - return unescape(c.substring(b + p.length, e)); - }, - - set : function(n, v, e, p, d, s) { - document.cookie = n + "=" + escape(v) + - ((e) ? "; expires=" + e.toGMTString() : "") + - ((p) ? "; path=" + escape(p) : "") + - ((d) ? "; domain=" + d : "") + - ((s) ? "; secure" : ""); - }, - - remove : function(n, p) { - var d = new Date(); - - d.setTime(d.getTime() - 1000); - - this.set(n, '', d, p, d); - } - }); -})(); - -(function() { - function serialize(o, quote) { - var i, v, t; - - quote = quote || '"'; - - if (o == null) - return 'null'; - - t = typeof o; - - if (t == 'string') { - v = '\bb\tt\nn\ff\rr\""\'\'\\\\'; - - return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function(a, b) { - // Make sure single quotes never get encoded inside double quotes for JSON compatibility - if (quote === '"' && a === "'") - return a; - - i = v.indexOf(b); - - if (i + 1) - return '\\' + v.charAt(i + 1); - - a = b.charCodeAt().toString(16); - - return '\\u' + '0000'.substring(a.length) + a; - }) + quote; - } - - if (t == 'object') { - if (o.hasOwnProperty && o instanceof Array) { - for (i=0, v = '['; i 0 ? ',' : '') + serialize(o[i], quote); - - return v + ']'; - } - - v = '{'; - - for (i in o) { - if (o.hasOwnProperty(i)) { - v += typeof o[i] != 'function' ? (v.length > 1 ? ',' + quote : quote) + i + quote +':' + serialize(o[i], quote) : ''; - } - } - - return v + '}'; - } - - return '' + o; - }; - - tinymce.util.JSON = { - serialize: serialize, - - parse: function(s) { - try { - return eval('(' + s + ')'); - } catch (ex) { - // Ignore - } - } - - }; -})(); - -tinymce.create('static tinymce.util.XHR', { - send : function(o) { - var x, t, w = window, c = 0; - - // Default settings - o.scope = o.scope || this; - o.success_scope = o.success_scope || o.scope; - o.error_scope = o.error_scope || o.scope; - o.async = o.async === false ? false : true; - o.data = o.data || ''; - - function get(s) { - x = 0; - - try { - x = new ActiveXObject(s); - } catch (ex) { - } - - return x; - }; - - x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Microsoft.XMLHTTP') || get('Msxml2.XMLHTTP'); - - if (x) { - if (x.overrideMimeType) - x.overrideMimeType(o.content_type); - - x.open(o.type || (o.data ? 'POST' : 'GET'), o.url, o.async); - - if (o.content_type) - x.setRequestHeader('Content-Type', o.content_type); - - x.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - - x.send(o.data); - - function ready() { - if (!o.async || x.readyState == 4 || c++ > 10000) { - if (o.success && c < 10000 && x.status == 200) - o.success.call(o.success_scope, '' + x.responseText, x, o); - else if (o.error) - o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o); - - x = null; - } else - w.setTimeout(ready, 10); - }; - - // Syncronous request - if (!o.async) - return ready(); - - // Wait for response, onReadyStateChange can not be used since it leaks memory in IE - t = w.setTimeout(ready, 10); - } - } -}); - -(function() { - var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR; - - tinymce.create('tinymce.util.JSONRequest', { - JSONRequest : function(s) { - this.settings = extend({ - }, s); - this.count = 0; - }, - - send : function(o) { - var ecb = o.error, scb = o.success; - - o = extend(this.settings, o); - - o.success = function(c, x) { - c = JSON.parse(c); - - if (typeof(c) == 'undefined') { - c = { - error : 'JSON Parse error.' - }; - } - - if (c.error) - ecb.call(o.error_scope || o.scope, c.error, x); - else - scb.call(o.success_scope || o.scope, c.result); - }; - - o.error = function(ty, x) { - if (ecb) - ecb.call(o.error_scope || o.scope, ty, x); - }; - - o.data = JSON.serialize({ - id : o.id || 'c' + (this.count++), - method : o.method, - params : o.params - }); - - // JSON content type for Ruby on rails. Bug: #1883287 - o.content_type = 'application/json'; - - XHR.send(o); - }, - - 'static' : { - sendRPC : function(o) { - return new tinymce.util.JSONRequest().send(o); - } - } - }); -}()); -(function(tinymce){ - tinymce.VK = { - DELETE: 46, - BACKSPACE: 8, - ENTER: 13, - TAB: 9, - SPACEBAR: 32, - UP: 38, - DOWN: 40, - modifierPressed: function (e) { - return e.shiftKey || e.ctrlKey || e.altKey; - } - } -})(tinymce); - -(function(tinymce) { - var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE; - - function cleanupStylesWhenDeleting(ed) { - var dom = ed.dom, selection = ed.selection; - - ed.onKeyDown.add(function(ed, e) { - var rng, blockElm, node, clonedSpan, isDelete; - - isDelete = e.keyCode == DELETE; - if ((isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) { - e.preventDefault(); - rng = selection.getRng(); - - // Find root block - blockElm = dom.getParent(rng.startContainer, dom.isBlock); - - // On delete clone the root span of the next block element - if (isDelete) - blockElm = dom.getNext(blockElm, dom.isBlock); - - // Locate root span element and clone it since it would otherwise get merged by the "apple-style-span" on delete/backspace - if (blockElm) { - node = blockElm.firstChild; - - // Ignore empty text nodes - while (node && node.nodeType == 3 && node.nodeValue.length == 0) - node = node.nextSibling; - - if (node && node.nodeName === 'SPAN') { - clonedSpan = node.cloneNode(false); - } - } - - // Do the backspace/delete action - ed.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null); - - // Find all odd apple-style-spans - blockElm = dom.getParent(rng.startContainer, dom.isBlock); - tinymce.each(dom.select('span.Apple-style-span,font.Apple-style-span', blockElm), function(span) { - var bm = selection.getBookmark(); - - if (clonedSpan) { - dom.replace(clonedSpan.cloneNode(false), span, true); - } else { - dom.remove(span, true); - } - - // Restore the selection - selection.moveToBookmark(bm); - }); - } - }); - }; - - function emptyEditorWhenDeleting(ed) { - - function serializeRng(rng) { - var body = ed.dom.create("body"); - var contents = rng.cloneContents(); - body.appendChild(contents); - return ed.selection.serializer.serialize(body, {format: 'html'}); - } - - function allContentsSelected(rng) { - var selection = serializeRng(rng); - - var allRng = ed.dom.createRng(); - allRng.selectNode(ed.getBody()); - - var allSelection = serializeRng(allRng); - return selection === allSelection; - } - - ed.onKeyDown.addToTop(function(ed, e) { - var keyCode = e.keyCode; - if (keyCode == DELETE || keyCode == BACKSPACE) { - var rng = ed.selection.getRng(true); - if (!rng.collapsed && allContentsSelected(rng)) { - ed.setContent('', {format : 'raw'}); - ed.nodeChanged(); - e.preventDefault(); - } - } - }); - - }; - - function inputMethodFocus(ed) { - ed.dom.bind(ed.getDoc(), 'focusin', function() { - ed.selection.setRng(ed.selection.getRng()); - }); - }; - - function removeHrOnBackspace(ed) { - ed.onKeyDown.add(function(ed, e) { - if (e.keyCode === BACKSPACE) { - if (ed.selection.isCollapsed() && ed.selection.getRng(true).startOffset === 0) { - var node = ed.selection.getNode(); - var previousSibling = node.previousSibling; - if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "hr") { - ed.dom.remove(previousSibling); - tinymce.dom.Event.cancel(e); - } - } - } - }) - } - - function focusBody(ed) { - // Fix for a focus bug in FF 3.x where the body element - // wouldn't get proper focus if the user clicked on the HTML element - if (!Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4 - ed.onMouseDown.add(function(ed, e) { - if (e.target.nodeName === "HTML") { - var body = ed.getBody(); - - // Blur the body it's focused but not correctly focused - body.blur(); - - // Refocus the body after a little while - setTimeout(function() { - body.focus(); - }, 0); - } - }); - } - }; - - function selectControlElements(ed) { - ed.onClick.add(function(ed, e) { - e = e.target; - - // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250 - // WebKit can't even do simple things like selecting an image - // Needs tobe the setBaseAndExtend or it will fail to select floated images - if (/^(IMG|HR)$/.test(e.nodeName)) - ed.selection.getSel().setBaseAndExtent(e, 0, e, 1); - - if (e.nodeName == 'A' && ed.dom.hasClass(e, 'mceItemAnchor')) - ed.selection.select(e); - - ed.nodeChanged(); - }); - }; - - function removeStylesOnPTagsInheritedFromHeadingTag(ed) { - ed.onKeyDown.add(function(ed, event) { - function checkInHeadingTag(ed) { - var currentNode = ed.selection.getNode(); - var headingTags = 'h1,h2,h3,h4,h5,h6'; - return ed.dom.is(currentNode, headingTags) || ed.dom.getParent(currentNode, headingTags) !== null; - } - - if (event.keyCode === VK.ENTER && !VK.modifierPressed(event) && checkInHeadingTag(ed)) { - setTimeout(function() { - var currentNode = ed.selection.getNode(); - if (ed.dom.is(currentNode, 'p')) { - ed.dom.setAttrib(currentNode, 'style', null); - // While tiny's content is correct after this method call, the content shown is not representative of it and needs to be 'repainted' - ed.execCommand('mceCleanup'); - } - }, 0); - } - }); - } - function selectionChangeNodeChanged(ed) { - var lastRng, selectionTimer; - - ed.dom.bind(ed.getDoc(), 'selectionchange', function() { - if (selectionTimer) { - clearTimeout(selectionTimer); - selectionTimer = 0; - } - - selectionTimer = window.setTimeout(function() { - var rng = ed.selection.getRng(); - - // Compare the ranges to see if it was a real change or not - if (!lastRng || !tinymce.dom.RangeUtils.compareRanges(rng, lastRng)) { - ed.nodeChanged(); - lastRng = rng; - } - }, 50); - }); - } - - function ensureBodyHasRoleApplication(ed) { - document.body.setAttribute("role", "application"); - } - - tinymce.create('tinymce.util.Quirks', { - Quirks: function(ed) { - // WebKit - if (tinymce.isWebKit) { - cleanupStylesWhenDeleting(ed); - emptyEditorWhenDeleting(ed); - inputMethodFocus(ed); - selectControlElements(ed); - - // iOS - if (tinymce.isIDevice) { - selectionChangeNodeChanged(ed); - } - } - - // IE - if (tinymce.isIE) { - removeHrOnBackspace(ed); - emptyEditorWhenDeleting(ed); - ensureBodyHasRoleApplication(ed); - removeStylesOnPTagsInheritedFromHeadingTag(ed) - } - - // Gecko - if (tinymce.isGecko) { - removeHrOnBackspace(ed); - focusBody(ed); - } - } - }); -})(tinymce); - -(function(tinymce) { - var namedEntities, baseEntities, reverseEntities, - attrsCharsRegExp = /[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, - textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, - rawCharsRegExp = /[<>&\"\']/g, - entityRegExp = /&(#x|#)?([\w]+);/g, - asciiMap = { - 128 : "\u20AC", 130 : "\u201A", 131 : "\u0192", 132 : "\u201E", 133 : "\u2026", 134 : "\u2020", - 135 : "\u2021", 136 : "\u02C6", 137 : "\u2030", 138 : "\u0160", 139 : "\u2039", 140 : "\u0152", - 142 : "\u017D", 145 : "\u2018", 146 : "\u2019", 147 : "\u201C", 148 : "\u201D", 149 : "\u2022", - 150 : "\u2013", 151 : "\u2014", 152 : "\u02DC", 153 : "\u2122", 154 : "\u0161", 155 : "\u203A", - 156 : "\u0153", 158 : "\u017E", 159 : "\u0178" - }; - - // Raw entities - baseEntities = { - '\"' : '"', // Needs to be escaped since the YUI compressor would otherwise break the code - "'" : ''', - '<' : '<', - '>' : '>', - '&' : '&' - }; - - // Reverse lookup table for raw entities - reverseEntities = { - '<' : '<', - '>' : '>', - '&' : '&', - '"' : '"', - ''' : "'" - }; - - // Decodes text by using the browser - function nativeDecode(text) { - var elm; - - elm = document.createElement("div"); - elm.innerHTML = text; - - return elm.textContent || elm.innerText || text; - }; - - // Build a two way lookup table for the entities - function buildEntitiesLookup(items, radix) { - var i, chr, entity, lookup = {}; - - if (items) { - items = items.split(','); - radix = radix || 10; - - // Build entities lookup table - for (i = 0; i < items.length; i += 2) { - chr = String.fromCharCode(parseInt(items[i], radix)); - - // Only add non base entities - if (!baseEntities[chr]) { - entity = '&' + items[i + 1] + ';'; - lookup[chr] = entity; - lookup[entity] = chr; - } - } - - return lookup; - } - }; - - // Unpack entities lookup where the numbers are in radix 32 to reduce the size - namedEntities = buildEntitiesLookup( - '50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' + - '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' + - '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' + - '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' + - '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' + - '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' + - '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' + - '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' + - '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' + - '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' + - 'sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' + - 'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' + - 't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' + - 'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' + - 'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' + - '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' + - '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' + - '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' + - '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' + - '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' + - 'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' + - 'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' + - 'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' + - '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' + - '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro' - , 32); - - tinymce.html = tinymce.html || {}; - - tinymce.html.Entities = { - encodeRaw : function(text, attr) { - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - return baseEntities[chr] || chr; - }); - }, - - encodeAllRaw : function(text) { - return ('' + text).replace(rawCharsRegExp, function(chr) { - return baseEntities[chr] || chr; - }); - }, - - encodeNumeric : function(text, attr) { - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - // Multi byte sequence convert it to a single entity - if (chr.length > 1) - return '&#' + (((chr.charCodeAt(0) - 0xD800) * 0x400) + (chr.charCodeAt(1) - 0xDC00) + 0x10000) + ';'; - - return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';'; - }); - }, - - encodeNamed : function(text, attr, entities) { - entities = entities || namedEntities; - - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - return baseEntities[chr] || entities[chr] || chr; - }); - }, - - getEncodeFunc : function(name, entities) { - var Entities = tinymce.html.Entities; - - entities = buildEntitiesLookup(entities) || namedEntities; - - function encodeNamedAndNumeric(text, attr) { - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - return baseEntities[chr] || entities[chr] || '&#' + chr.charCodeAt(0) + ';' || chr; - }); - }; - - function encodeCustomNamed(text, attr) { - return Entities.encodeNamed(text, attr, entities); - }; - - // Replace + with , to be compatible with previous TinyMCE versions - name = tinymce.makeMap(name.replace(/\+/g, ',')); - - // Named and numeric encoder - if (name.named && name.numeric) - return encodeNamedAndNumeric; - - // Named encoder - if (name.named) { - // Custom names - if (entities) - return encodeCustomNamed; - - return Entities.encodeNamed; - } - - // Numeric - if (name.numeric) - return Entities.encodeNumeric; - - // Raw encoder - return Entities.encodeRaw; - }, - - decode : function(text) { - return text.replace(entityRegExp, function(all, numeric, value) { - if (numeric) { - value = parseInt(value, numeric.length === 2 ? 16 : 10); - - // Support upper UTF - if (value > 0xFFFF) { - value -= 0x10000; - - return String.fromCharCode(0xD800 + (value >> 10), 0xDC00 + (value & 0x3FF)); - } else - return asciiMap[value] || String.fromCharCode(value); - } - - return reverseEntities[all] || namedEntities[all] || nativeDecode(all); - }); - } - }; -})(tinymce); - -tinymce.html.Styles = function(settings, schema) { - var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi, - urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi, - styleRegExp = /\s*([^:]+):\s*([^;]+);?/g, - trimRightRegExp = /\s+$/, - urlColorRegExp = /rgb/, - undef, i, encodingLookup = {}, encodingItems; - - settings = settings || {}; - - encodingItems = '\\" \\\' \\; \\: ; : \uFEFF'.split(' '); - for (i = 0; i < encodingItems.length; i++) { - encodingLookup[encodingItems[i]] = '\uFEFF' + i; - encodingLookup['\uFEFF' + i] = encodingItems[i]; - } - - function toHex(match, r, g, b) { - function hex(val) { - val = parseInt(val).toString(16); - - return val.length > 1 ? val : '0' + val; // 0 -> 00 - }; - - return '#' + hex(r) + hex(g) + hex(b); - }; - - return { - toHex : function(color) { - return color.replace(rgbRegExp, toHex); - }, - - parse : function(css) { - var styles = {}, matches, name, value, isEncoded, urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope || this; - - function compress(prefix, suffix) { - var top, right, bottom, left; - - // Get values and check it it needs compressing - top = styles[prefix + '-top' + suffix]; - if (!top) - return; - - right = styles[prefix + '-right' + suffix]; - if (top != right) - return; - - bottom = styles[prefix + '-bottom' + suffix]; - if (right != bottom) - return; - - left = styles[prefix + '-left' + suffix]; - if (bottom != left) - return; - - // Compress - styles[prefix + suffix] = left; - delete styles[prefix + '-top' + suffix]; - delete styles[prefix + '-right' + suffix]; - delete styles[prefix + '-bottom' + suffix]; - delete styles[prefix + '-left' + suffix]; - }; - - function canCompress(key) { - var value = styles[key], i; - - if (!value || value.indexOf(' ') < 0) - return; - - value = value.split(' '); - i = value.length; - while (i--) { - if (value[i] !== value[0]) - return false; - } - - styles[key] = value[0]; - - return true; - }; - - function compress2(target, a, b, c) { - if (!canCompress(a)) - return; - - if (!canCompress(b)) - return; - - if (!canCompress(c)) - return; - - // Compress - styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c]; - delete styles[a]; - delete styles[b]; - delete styles[c]; - }; - - // Encodes the specified string by replacing all \" \' ; : with _ - function encode(str) { - isEncoded = true; - - return encodingLookup[str]; - }; - - // Decodes the specified string by replacing all _ with it's original value \" \' etc - // It will also decode the \" \' if keep_slashes is set to fale or omitted - function decode(str, keep_slashes) { - if (isEncoded) { - str = str.replace(/\uFEFF[0-9]/g, function(str) { - return encodingLookup[str]; - }); - } - - if (!keep_slashes) - str = str.replace(/\\([\'\";:])/g, "$1"); - - return str; - } - - if (css) { - // Encode \" \' % and ; and : inside strings so they don't interfere with the style parsing - css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function(str) { - return str.replace(/[;:]/g, encode); - }); - - // Parse styles - while (matches = styleRegExp.exec(css)) { - name = matches[1].replace(trimRightRegExp, '').toLowerCase(); - value = matches[2].replace(trimRightRegExp, ''); - - if (name && value.length > 0) { - // Opera will produce 700 instead of bold in their style values - if (name === 'font-weight' && value === '700') - value = 'bold'; - else if (name === 'color' || name === 'background-color') // Lowercase colors like RED - value = value.toLowerCase(); - - // Convert RGB colors to HEX - value = value.replace(rgbRegExp, toHex); - - // Convert URLs and force them into url('value') format - value = value.replace(urlOrStrRegExp, function(match, url, url2, url3, str, str2) { - str = str || str2; - - if (str) { - str = decode(str); - - // Force strings into single quote format - return "'" + str.replace(/\'/g, "\\'") + "'"; - } - - url = decode(url || url2 || url3); - - // Convert the URL to relative/absolute depending on config - if (urlConverter) - url = urlConverter.call(urlConverterScope, url, 'style'); - - // Output new URL format - return "url('" + url.replace(/\'/g, "\\'") + "')"; - }); - - styles[name] = isEncoded ? decode(value, true) : value; - } - - styleRegExp.lastIndex = matches.index + matches[0].length; - } - - // Compress the styles to reduce it's size for example IE will expand styles - compress("border", ""); - compress("border", "-width"); - compress("border", "-color"); - compress("border", "-style"); - compress("padding", ""); - compress("margin", ""); - compress2('border', 'border-width', 'border-style', 'border-color'); - - // Remove pointless border, IE produces these - if (styles.border === 'medium none') - delete styles.border; - } - - return styles; - }, - - serialize : function(styles, element_name) { - var css = '', name, value; - - function serializeStyles(name) { - var styleList, i, l, value; - - styleList = schema.styles[name]; - if (styleList) { - for (i = 0, l = styleList.length; i < l; i++) { - name = styleList[i]; - value = styles[name]; - - if (value !== undef && value.length > 0) - css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; - } - } - }; - - // Serialize styles according to schema - if (element_name && schema && schema.styles) { - // Serialize global styles and element specific styles - serializeStyles('*'); - serializeStyles(element_name); - } else { - // Output the styles in the order they are inside the object - for (name in styles) { - value = styles[name]; - - if (value !== undef && value.length > 0) - css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; - } - } - - return css; - } - }; -}; - -(function(tinymce) { - var transitional = {}, boolAttrMap, blockElementsMap, shortEndedElementsMap, nonEmptyElementsMap, customElementsMap = {}, - defaultWhiteSpaceElementsMap, selfClosingElementsMap, makeMap = tinymce.makeMap, each = tinymce.each; - - function split(str, delim) { - return str.split(delim || ','); - }; - - function unpack(lookup, data) { - var key, elements = {}; - - function replace(value) { - return value.replace(/[A-Z]+/g, function(key) { - return replace(lookup[key]); - }); - }; - - // Unpack lookup - for (key in lookup) { - if (lookup.hasOwnProperty(key)) - lookup[key] = replace(lookup[key]); - } - - // Unpack and parse data into object map - replace(data).replace(/#/g, '#text').replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g, function(str, name, attributes, children) { - attributes = split(attributes, '|'); - - elements[name] = { - attributes : makeMap(attributes), - attributesOrder : attributes, - children : makeMap(children, '|', {'#comment' : {}}) - } - }); - - return elements; - }; - - // Build a lookup table for block elements both lowercase and uppercase - blockElementsMap = 'h1,h2,h3,h4,h5,h6,hr,p,div,address,pre,form,table,tbody,thead,tfoot,' + - 'th,tr,td,li,ol,ul,caption,blockquote,center,dl,dt,dd,dir,fieldset,' + - 'noscript,menu,isindex,samp,header,footer,article,section,hgroup'; - blockElementsMap = makeMap(blockElementsMap, ',', makeMap(blockElementsMap.toUpperCase())); - - // This is the XHTML 1.0 transitional elements with it's attributes and children packed to reduce it's size - transitional = unpack({ - Z : 'H|K|N|O|P', - Y : 'X|form|R|Q', - ZG : 'E|span|width|align|char|charoff|valign', - X : 'p|T|div|U|W|isindex|fieldset|table', - ZF : 'E|align|char|charoff|valign', - W : 'pre|hr|blockquote|address|center|noframes', - ZE : 'abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height', - ZD : '[E][S]', - U : 'ul|ol|dl|menu|dir', - ZC : 'p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q', - T : 'h1|h2|h3|h4|h5|h6', - ZB : 'X|S|Q', - S : 'R|P', - ZA : 'a|G|J|M|O|P', - R : 'a|H|K|N|O', - Q : 'noscript|P', - P : 'ins|del|script', - O : 'input|select|textarea|label|button', - N : 'M|L', - M : 'em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym', - L : 'sub|sup', - K : 'J|I', - J : 'tt|i|b|u|s|strike', - I : 'big|small|font|basefont', - H : 'G|F', - G : 'br|span|bdo', - F : 'object|applet|img|map|iframe', - E : 'A|B|C', - D : 'accesskey|tabindex|onfocus|onblur', - C : 'onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup', - B : 'lang|xml:lang|dir', - A : 'id|class|style|title' - }, 'script[id|charset|type|language|src|defer|xml:space][]' + - 'style[B|id|type|media|title|xml:space][]' + - 'object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]' + - 'param[id|name|value|valuetype|type][]' + - 'p[E|align][#|S]' + - 'a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]' + - 'br[A|clear][]' + - 'span[E][#|S]' + - 'bdo[A|C|B][#|S]' + - 'applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]' + - 'h1[E|align][#|S]' + - 'img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]' + - 'map[B|C|A|name][X|form|Q|area]' + - 'h2[E|align][#|S]' + - 'iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]' + - 'h3[E|align][#|S]' + - 'tt[E][#|S]' + - 'i[E][#|S]' + - 'b[E][#|S]' + - 'u[E][#|S]' + - 's[E][#|S]' + - 'strike[E][#|S]' + - 'big[E][#|S]' + - 'small[E][#|S]' + - 'font[A|B|size|color|face][#|S]' + - 'basefont[id|size|color|face][]' + - 'em[E][#|S]' + - 'strong[E][#|S]' + - 'dfn[E][#|S]' + - 'code[E][#|S]' + - 'q[E|cite][#|S]' + - 'samp[E][#|S]' + - 'kbd[E][#|S]' + - 'var[E][#|S]' + - 'cite[E][#|S]' + - 'abbr[E][#|S]' + - 'acronym[E][#|S]' + - 'sub[E][#|S]' + - 'sup[E][#|S]' + - 'input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]' + - 'select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]' + - 'optgroup[E|disabled|label][option]' + - 'option[E|selected|disabled|label|value][]' + - 'textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]' + - 'label[E|for|accesskey|onfocus|onblur][#|S]' + - 'button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]' + - 'h4[E|align][#|S]' + - 'ins[E|cite|datetime][#|Y]' + - 'h5[E|align][#|S]' + - 'del[E|cite|datetime][#|Y]' + - 'h6[E|align][#|S]' + - 'div[E|align][#|Y]' + - 'ul[E|type|compact][li]' + - 'li[E|type|value][#|Y]' + - 'ol[E|type|compact|start][li]' + - 'dl[E|compact][dt|dd]' + - 'dt[E][#|S]' + - 'dd[E][#|Y]' + - 'menu[E|compact][li]' + - 'dir[E|compact][li]' + - 'pre[E|width|xml:space][#|ZA]' + - 'hr[E|align|noshade|size|width][]' + - 'blockquote[E|cite][#|Y]' + - 'address[E][#|S|p]' + - 'center[E][#|Y]' + - 'noframes[E][#|Y]' + - 'isindex[A|B|prompt][]' + - 'fieldset[E][#|legend|Y]' + - 'legend[E|accesskey|align][#|S]' + - 'table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]' + - 'caption[E|align][#|S]' + - 'col[ZG][]' + - 'colgroup[ZG][col]' + - 'thead[ZF][tr]' + - 'tr[ZF|bgcolor][th|td]' + - 'th[E|ZE][#|Y]' + - 'form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]' + - 'noscript[E][#|Y]' + - 'td[E|ZE][#|Y]' + - 'tfoot[ZF][tr]' + - 'tbody[ZF][tr]' + - 'area[E|D|shape|coords|href|nohref|alt|target][]' + - 'base[id|href|target][]' + - 'body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]' - ); - - boolAttrMap = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected,autoplay,loop,controls'); - shortEndedElementsMap = makeMap('area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,source'); - nonEmptyElementsMap = tinymce.extend(makeMap('td,th,iframe,video,audio,object'), shortEndedElementsMap); - defaultWhiteSpaceElementsMap = makeMap('pre,script,style,textarea'); - selfClosingElementsMap = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'); - - tinymce.html.Schema = function(settings) { - var self = this, elements = {}, children = {}, patternElements = [], validStyles, whiteSpaceElementsMap; - - settings = settings || {}; - - // Allow all elements and attributes if verify_html is set to false - if (settings.verify_html === false) - settings.valid_elements = '*[*]'; - - // Build styles list - if (settings.valid_styles) { - validStyles = {}; - - // Convert styles into a rule list - each(settings.valid_styles, function(value, key) { - validStyles[key] = tinymce.explode(value); - }); - } - - whiteSpaceElementsMap = settings.whitespace_elements ? makeMap(settings.whitespace_elements) : defaultWhiteSpaceElementsMap; - - // Converts a wildcard expression string to a regexp for example *a will become /.*a/. - function patternToRegExp(str) { - return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$'); - }; - - // Parses the specified valid_elements string and adds to the current rules - // This function is a bit hard to read since it's heavily optimized for speed - function addValidElements(valid_elements) { - var ei, el, ai, al, yl, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder, - prefix, outputName, globalAttributes, globalAttributesOrder, transElement, key, childKey, value, - elementRuleRegExp = /^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/, - attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/, - hasPatternsRegExp = /[*?+]/; - - if (valid_elements) { - // Split valid elements into an array with rules - valid_elements = split(valid_elements); - - if (elements['@']) { - globalAttributes = elements['@'].attributes; - globalAttributesOrder = elements['@'].attributesOrder; - } - - // Loop all rules - for (ei = 0, el = valid_elements.length; ei < el; ei++) { - // Parse element rule - matches = elementRuleRegExp.exec(valid_elements[ei]); - if (matches) { - // Setup local names for matches - prefix = matches[1]; - elementName = matches[2]; - outputName = matches[3]; - attrData = matches[4]; - - // Create new attributes and attributesOrder - attributes = {}; - attributesOrder = []; - - // Create the new element - element = { - attributes : attributes, - attributesOrder : attributesOrder - }; - - // Padd empty elements prefix - if (prefix === '#') - element.paddEmpty = true; - - // Remove empty elements prefix - if (prefix === '-') - element.removeEmpty = true; - - // Copy attributes from global rule into current rule - if (globalAttributes) { - for (key in globalAttributes) - attributes[key] = globalAttributes[key]; - - attributesOrder.push.apply(attributesOrder, globalAttributesOrder); - } - - // Attributes defined - if (attrData) { - attrData = split(attrData, '|'); - for (ai = 0, al = attrData.length; ai < al; ai++) { - matches = attrRuleRegExp.exec(attrData[ai]); - if (matches) { - attr = {}; - attrType = matches[1]; - attrName = matches[2].replace(/::/g, ':'); - prefix = matches[3]; - value = matches[4]; - - // Required - if (attrType === '!') { - element.attributesRequired = element.attributesRequired || []; - element.attributesRequired.push(attrName); - attr.required = true; - } - - // Denied from global - if (attrType === '-') { - delete attributes[attrName]; - attributesOrder.splice(tinymce.inArray(attributesOrder, attrName), 1); - continue; - } - - // Default value - if (prefix) { - // Default value - if (prefix === '=') { - element.attributesDefault = element.attributesDefault || []; - element.attributesDefault.push({name: attrName, value: value}); - attr.defaultValue = value; - } - - // Forced value - if (prefix === ':') { - element.attributesForced = element.attributesForced || []; - element.attributesForced.push({name: attrName, value: value}); - attr.forcedValue = value; - } - - // Required values - if (prefix === '<') - attr.validValues = makeMap(value, '?'); - } - - // Check for attribute patterns - if (hasPatternsRegExp.test(attrName)) { - element.attributePatterns = element.attributePatterns || []; - attr.pattern = patternToRegExp(attrName); - element.attributePatterns.push(attr); - } else { - // Add attribute to order list if it doesn't already exist - if (!attributes[attrName]) - attributesOrder.push(attrName); - - attributes[attrName] = attr; - } - } - } - } - - // Global rule, store away these for later usage - if (!globalAttributes && elementName == '@') { - globalAttributes = attributes; - globalAttributesOrder = attributesOrder; - } - - // Handle substitute elements such as b/strong - if (outputName) { - element.outputName = elementName; - elements[outputName] = element; - } - - // Add pattern or exact element - if (hasPatternsRegExp.test(elementName)) { - element.pattern = patternToRegExp(elementName); - patternElements.push(element); - } else - elements[elementName] = element; - } - } - } - }; - - function setValidElements(valid_elements) { - elements = {}; - patternElements = []; - - addValidElements(valid_elements); - - each(transitional, function(element, name) { - children[name] = element.children; - }); - }; - - // Adds custom non HTML elements to the schema - function addCustomElements(custom_elements) { - var customElementRegExp = /^(~)?(.+)$/; - - if (custom_elements) { - each(split(custom_elements), function(rule) { - var matches = customElementRegExp.exec(rule), - inline = matches[1] === '~', - cloneName = inline ? 'span' : 'div', - name = matches[2]; - - children[name] = children[cloneName]; - customElementsMap[name] = cloneName; - - // If it's not marked as inline then add it to valid block elements - if (!inline) - blockElementsMap[name] = {}; - - // Add custom elements at span/div positions - each(children, function(element, child) { - if (element[cloneName]) - element[name] = element[cloneName]; - }); - }); - } - }; - - // Adds valid children to the schema object - function addValidChildren(valid_children) { - var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/; - - if (valid_children) { - each(split(valid_children), function(rule) { - var matches = childRuleRegExp.exec(rule), parent, prefix; - - if (matches) { - prefix = matches[1]; - - // Add/remove items from default - if (prefix) - parent = children[matches[2]]; - else - parent = children[matches[2]] = {'#comment' : {}}; - - parent = children[matches[2]]; - - each(split(matches[3], '|'), function(child) { - if (prefix === '-') - delete parent[child]; - else - parent[child] = {}; - }); - } - }); - } - }; - - function getElementRule(name) { - var element = elements[name], i; - - // Exact match found - if (element) - return element; - - // No exact match then try the patterns - i = patternElements.length; - while (i--) { - element = patternElements[i]; - - if (element.pattern.test(name)) - return element; - } - }; - - if (!settings.valid_elements) { - // No valid elements defined then clone the elements from the transitional spec - each(transitional, function(element, name) { - elements[name] = { - attributes : element.attributes, - attributesOrder : element.attributesOrder - }; - - children[name] = element.children; - }); - - // Switch these - each(split('strong/b,em/i'), function(item) { - item = split(item, '/'); - elements[item[1]].outputName = item[0]; - }); - - // Add default alt attribute for images - elements.img.attributesDefault = [{name: 'alt', value: ''}]; - - // Remove these if they are empty by default - each(split('ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr'), function(name) { - elements[name].removeEmpty = true; - }); - - // Padd these by default - each(split('p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption'), function(name) { - elements[name].paddEmpty = true; - }); - } else - setValidElements(settings.valid_elements); - - addCustomElements(settings.custom_elements); - addValidChildren(settings.valid_children); - addValidElements(settings.extended_valid_elements); - - // Todo: Remove this when we fix list handling to be valid - addValidChildren('+ol[ul|ol],+ul[ul|ol]'); - - // If the user didn't allow span only allow internal spans - if (!getElementRule('span')) - addValidElements('span[!data-mce-type|*]'); - - // Delete invalid elements - if (settings.invalid_elements) { - tinymce.each(tinymce.explode(settings.invalid_elements), function(item) { - if (elements[item]) - delete elements[item]; - }); - } - - self.children = children; - - self.styles = validStyles; - - self.getBoolAttrs = function() { - return boolAttrMap; - }; - - self.getBlockElements = function() { - return blockElementsMap; - }; - - self.getShortEndedElements = function() { - return shortEndedElementsMap; - }; - - self.getSelfClosingElements = function() { - return selfClosingElementsMap; - }; - - self.getNonEmptyElements = function() { - return nonEmptyElementsMap; - }; - - self.getWhiteSpaceElements = function() { - return whiteSpaceElementsMap; - }; - - self.isValidChild = function(name, child) { - var parent = children[name]; - - return !!(parent && parent[child]); - }; - - self.getElementRule = getElementRule; - - self.getCustomElements = function() { - return customElementsMap; - }; - - self.addValidElements = addValidElements; - - self.setValidElements = setValidElements; - - self.addCustomElements = addCustomElements; - - self.addValidChildren = addValidChildren; - }; - - // Expose boolMap and blockElementMap as static properties for usage in DOMUtils - tinymce.html.Schema.boolAttrMap = boolAttrMap; - tinymce.html.Schema.blockElementsMap = blockElementsMap; -})(tinymce); - -(function(tinymce) { - tinymce.html.SaxParser = function(settings, schema) { - var self = this, noop = function() {}; - - settings = settings || {}; - self.schema = schema = schema || new tinymce.html.Schema(); - - if (settings.fix_self_closing !== false) - settings.fix_self_closing = true; - - // Add handler functions from settings and setup default handlers - tinymce.each('comment cdata text start end pi doctype'.split(' '), function(name) { - if (name) - self[name] = settings[name] || noop; - }); - - self.parse = function(html) { - var self = this, matches, index = 0, value, endRegExp, stack = [], attrList, i, text, name, isInternalElement, removeInternalElements, - shortEndedElements, fillAttrsMap, isShortEnded, validate, elementRule, isValidElement, attr, attribsValue, invalidPrefixRegExp, - validAttributesMap, validAttributePatterns, attributesRequired, attributesDefault, attributesForced, selfClosing, - tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0, decode = tinymce.html.Entities.decode, fixSelfClosing, isIE; - - function processEndTag(name) { - var pos, i; - - // Find position of parent of the same type - pos = stack.length; - while (pos--) { - if (stack[pos].name === name) - break; - } - - // Found parent - if (pos >= 0) { - // Close all the open elements - for (i = stack.length - 1; i >= pos; i--) { - name = stack[i]; - - if (name.valid) - self.end(name.name); - } - - // Remove the open elements from the stack - stack.length = pos; - } - }; - - // Precompile RegExps and map objects - tokenRegExp = new RegExp('<(?:' + - '(?:!--([\\w\\W]*?)-->)|' + // Comment - '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + // CDATA - '(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE - '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI - '(?:\\/([^>]+)>)|' + // End element - '(?:([^\\s\\/<>]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/)>)' + // Start element - ')', 'g'); - - attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g; - specialElements = { - 'script' : /<\/script[^>]*>/gi, - 'style' : /<\/style[^>]*>/gi, - 'noscript' : /<\/noscript[^>]*>/gi - }; - - // Setup lookup tables for empty elements and boolean attributes - shortEndedElements = schema.getShortEndedElements(); - selfClosing = schema.getSelfClosingElements(); - fillAttrsMap = schema.getBoolAttrs(); - validate = settings.validate; - removeInternalElements = settings.remove_internals; - fixSelfClosing = settings.fix_self_closing; - isIE = tinymce.isIE; - invalidPrefixRegExp = /^:/; - - while (matches = tokenRegExp.exec(html)) { - // Text - if (index < matches.index) - self.text(decode(html.substr(index, matches.index - index))); - - if (value = matches[6]) { // End element - value = value.toLowerCase(); - - // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements - if (isIE && invalidPrefixRegExp.test(value)) - value = value.substr(1); - - processEndTag(value); - } else if (value = matches[7]) { // Start element - value = value.toLowerCase(); - - // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements - if (isIE && invalidPrefixRegExp.test(value)) - value = value.substr(1); - - isShortEnded = value in shortEndedElements; - - // Is self closing tag for example an
  • after an open
  • - if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) - processEndTag(value); - - // Validate element - if (!validate || (elementRule = schema.getElementRule(value))) { - isValidElement = true; - - // Grab attributes map and patters when validation is enabled - if (validate) { - validAttributesMap = elementRule.attributes; - validAttributePatterns = elementRule.attributePatterns; - } - - // Parse attributes - if (attribsValue = matches[8]) { - isInternalElement = attribsValue.indexOf('data-mce-type') !== -1; // Check if the element is an internal element - - // If the element has internal attributes then remove it if we are told to do so - if (isInternalElement && removeInternalElements) - isValidElement = false; - - attrList = []; - attrList.map = {}; - - attribsValue.replace(attrRegExp, function(match, name, value, val2, val3) { - var attrRule, i; - - name = name.toLowerCase(); - value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute - - // Validate name and value - if (validate && !isInternalElement && name.indexOf('data-') !== 0) { - attrRule = validAttributesMap[name]; - - // Find rule by pattern matching - if (!attrRule && validAttributePatterns) { - i = validAttributePatterns.length; - while (i--) { - attrRule = validAttributePatterns[i]; - if (attrRule.pattern.test(name)) - break; - } - - // No rule matched - if (i === -1) - attrRule = null; - } - - // No attribute rule found - if (!attrRule) - return; - - // Validate value - if (attrRule.validValues && !(value in attrRule.validValues)) - return; - } - - // Add attribute to list and map - attrList.map[name] = value; - attrList.push({ - name: name, - value: value - }); - }); - } else { - attrList = []; - attrList.map = {}; - } - - // Process attributes if validation is enabled - if (validate && !isInternalElement) { - attributesRequired = elementRule.attributesRequired; - attributesDefault = elementRule.attributesDefault; - attributesForced = elementRule.attributesForced; - - // Handle forced attributes - if (attributesForced) { - i = attributesForced.length; - while (i--) { - attr = attributesForced[i]; - name = attr.name; - attrValue = attr.value; - - if (attrValue === '{$uid}') - attrValue = 'mce_' + idCount++; - - attrList.map[name] = attrValue; - attrList.push({name: name, value: attrValue}); - } - } - - // Handle default attributes - if (attributesDefault) { - i = attributesDefault.length; - while (i--) { - attr = attributesDefault[i]; - name = attr.name; - - if (!(name in attrList.map)) { - attrValue = attr.value; - - if (attrValue === '{$uid}') - attrValue = 'mce_' + idCount++; - - attrList.map[name] = attrValue; - attrList.push({name: name, value: attrValue}); - } - } - } - - // Handle required attributes - if (attributesRequired) { - i = attributesRequired.length; - while (i--) { - if (attributesRequired[i] in attrList.map) - break; - } - - // None of the required attributes where found - if (i === -1) - isValidElement = false; - } - - // Invalidate element if it's marked as bogus - if (attrList.map['data-mce-bogus']) - isValidElement = false; - } - - if (isValidElement) - self.start(value, attrList, isShortEnded); - } else - isValidElement = false; - - // Treat script, noscript and style a bit different since they may include code that looks like elements - if (endRegExp = specialElements[value]) { - endRegExp.lastIndex = index = matches.index + matches[0].length; - - if (matches = endRegExp.exec(html)) { - if (isValidElement) - text = html.substr(index, matches.index - index); - - index = matches.index + matches[0].length; - } else { - text = html.substr(index); - index = html.length; - } - - if (isValidElement && text.length > 0) - self.text(text, true); - - if (isValidElement) - self.end(value); - - tokenRegExp.lastIndex = index; - continue; - } - - // Push value on to stack - if (!isShortEnded) { - if (!attribsValue || attribsValue.indexOf('/') != attribsValue.length - 1) - stack.push({name: value, valid: isValidElement}); - else if (isValidElement) - self.end(value); - } - } else if (value = matches[1]) { // Comment - self.comment(value); - } else if (value = matches[2]) { // CDATA - self.cdata(value); - } else if (value = matches[3]) { // DOCTYPE - self.doctype(value); - } else if (value = matches[4]) { // PI - self.pi(value, matches[5]); - } - - index = matches.index + matches[0].length; - } - - // Text - if (index < html.length) - self.text(decode(html.substr(index))); - - // Close any open elements - for (i = stack.length - 1; i >= 0; i--) { - value = stack[i]; - - if (value.valid) - self.end(value.name); - } - }; - } -})(tinymce); - -(function(tinymce) { - var whiteSpaceRegExp = /^[ \t\r\n]*$/, typeLookup = { - '#text' : 3, - '#comment' : 8, - '#cdata' : 4, - '#pi' : 7, - '#doctype' : 10, - '#document-fragment' : 11 - }; - - // Walks the tree left/right - function walk(node, root_node, prev) { - var sibling, parent, startName = prev ? 'lastChild' : 'firstChild', siblingName = prev ? 'prev' : 'next'; - - // Walk into nodes if it has a start - if (node[startName]) - return node[startName]; - - // Return the sibling if it has one - if (node !== root_node) { - sibling = node[siblingName]; - - if (sibling) - return sibling; - - // Walk up the parents to look for siblings - for (parent = node.parent; parent && parent !== root_node; parent = parent.parent) { - sibling = parent[siblingName]; - - if (sibling) - return sibling; - } - } - }; - - function Node(name, type) { - this.name = name; - this.type = type; - - if (type === 1) { - this.attributes = []; - this.attributes.map = {}; - } - } - - tinymce.extend(Node.prototype, { - replace : function(node) { - var self = this; - - if (node.parent) - node.remove(); - - self.insert(node, self); - self.remove(); - - return self; - }, - - attr : function(name, value) { - var self = this, attrs, i, undef; - - if (typeof name !== "string") { - for (i in name) - self.attr(i, name[i]); - - return self; - } - - if (attrs = self.attributes) { - if (value !== undef) { - // Remove attribute - if (value === null) { - if (name in attrs.map) { - delete attrs.map[name]; - - i = attrs.length; - while (i--) { - if (attrs[i].name === name) { - attrs = attrs.splice(i, 1); - return self; - } - } - } - - return self; - } - - // Set attribute - if (name in attrs.map) { - // Set attribute - i = attrs.length; - while (i--) { - if (attrs[i].name === name) { - attrs[i].value = value; - break; - } - } - } else - attrs.push({name: name, value: value}); - - attrs.map[name] = value; - - return self; - } else { - return attrs.map[name]; - } - } - }, - - clone : function() { - var self = this, clone = new Node(self.name, self.type), i, l, selfAttrs, selfAttr, cloneAttrs; - - // Clone element attributes - if (selfAttrs = self.attributes) { - cloneAttrs = []; - cloneAttrs.map = {}; - - for (i = 0, l = selfAttrs.length; i < l; i++) { - selfAttr = selfAttrs[i]; - - // Clone everything except id - if (selfAttr.name !== 'id') { - cloneAttrs[cloneAttrs.length] = {name: selfAttr.name, value: selfAttr.value}; - cloneAttrs.map[selfAttr.name] = selfAttr.value; - } - } - - clone.attributes = cloneAttrs; - } - - clone.value = self.value; - clone.shortEnded = self.shortEnded; - - return clone; - }, - - wrap : function(wrapper) { - var self = this; - - self.parent.insert(wrapper, self); - wrapper.append(self); - - return self; - }, - - unwrap : function() { - var self = this, node, next; - - for (node = self.firstChild; node; ) { - next = node.next; - self.insert(node, self, true); - node = next; - } - - self.remove(); - }, - - remove : function() { - var self = this, parent = self.parent, next = self.next, prev = self.prev; - - if (parent) { - if (parent.firstChild === self) { - parent.firstChild = next; - - if (next) - next.prev = null; - } else { - prev.next = next; - } - - if (parent.lastChild === self) { - parent.lastChild = prev; - - if (prev) - prev.next = null; - } else { - next.prev = prev; - } - - self.parent = self.next = self.prev = null; - } - - return self; - }, - - append : function(node) { - var self = this, last; - - if (node.parent) - node.remove(); - - last = self.lastChild; - if (last) { - last.next = node; - node.prev = last; - self.lastChild = node; - } else - self.lastChild = self.firstChild = node; - - node.parent = self; - - return node; - }, - - insert : function(node, ref_node, before) { - var parent; - - if (node.parent) - node.remove(); - - parent = ref_node.parent || this; - - if (before) { - if (ref_node === parent.firstChild) - parent.firstChild = node; - else - ref_node.prev.next = node; - - node.prev = ref_node.prev; - node.next = ref_node; - ref_node.prev = node; - } else { - if (ref_node === parent.lastChild) - parent.lastChild = node; - else - ref_node.next.prev = node; - - node.next = ref_node.next; - node.prev = ref_node; - ref_node.next = node; - } - - node.parent = parent; - - return node; - }, - - getAll : function(name) { - var self = this, node, collection = []; - - for (node = self.firstChild; node; node = walk(node, self)) { - if (node.name === name) - collection.push(node); - } - - return collection; - }, - - empty : function() { - var self = this, nodes, i, node; - - // Remove all children - if (self.firstChild) { - nodes = []; - - // Collect the children - for (node = self.firstChild; node; node = walk(node, self)) - nodes.push(node); - - // Remove the children - i = nodes.length; - while (i--) { - node = nodes[i]; - node.parent = node.firstChild = node.lastChild = node.next = node.prev = null; - } - } - - self.firstChild = self.lastChild = null; - - return self; - }, - - isEmpty : function(elements) { - var self = this, node = self.firstChild, i, name; - - if (node) { - do { - if (node.type === 1) { - // Ignore bogus elements - if (node.attributes.map['data-mce-bogus']) - continue; - - // Keep empty elements like - if (elements[node.name]) - return false; - - // Keep elements with data attributes or name attribute like - i = node.attributes.length; - while (i--) { - name = node.attributes[i].name; - if (name === "name" || name.indexOf('data-') === 0) - return false; - } - } - - // Keep comments - if (node.type === 8) - return false; - - // Keep non whitespace text nodes - if ((node.type === 3 && !whiteSpaceRegExp.test(node.value))) - return false; - } while (node = walk(node, self)); - } - - return true; - }, - - walk : function(prev) { - return walk(this, null, prev); - } - }); - - tinymce.extend(Node, { - create : function(name, attrs) { - var node, attrName; - - // Create node - node = new Node(name, typeLookup[name] || 1); - - // Add attributes if needed - if (attrs) { - for (attrName in attrs) - node.attr(attrName, attrs[attrName]); - } - - return node; - } - }); - - tinymce.html.Node = Node; -})(tinymce); - -(function(tinymce) { - var Node = tinymce.html.Node; - - tinymce.html.DomParser = function(settings, schema) { - var self = this, nodeFilters = {}, attributeFilters = [], matchedNodes = {}, matchedAttributes = {}; - - settings = settings || {}; - settings.validate = "validate" in settings ? settings.validate : true; - settings.root_name = settings.root_name || 'body'; - self.schema = schema = schema || new tinymce.html.Schema(); - - function fixInvalidChildren(nodes) { - var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i, - childClone, nonEmptyElements, nonSplitableElements, sibling, nextNode; - - nonSplitableElements = tinymce.makeMap('tr,td,th,tbody,thead,tfoot,table'); - nonEmptyElements = schema.getNonEmptyElements(); - - for (ni = 0; ni < nodes.length; ni++) { - node = nodes[ni]; - - // Already removed - if (!node.parent) - continue; - - // Get list of all parent nodes until we find a valid parent to stick the child into - parents = [node]; - for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && !nonSplitableElements[parent.name]; parent = parent.parent) - parents.push(parent); - - // Found a suitable parent - if (parent && parents.length > 1) { - // Reverse the array since it makes looping easier - parents.reverse(); - - // Clone the related parent and insert that after the moved node - newParent = currentNode = self.filterNode(parents[0].clone()); - - // Start cloning and moving children on the left side of the target node - for (i = 0; i < parents.length - 1; i++) { - if (schema.isValidChild(currentNode.name, parents[i].name)) { - tempNode = self.filterNode(parents[i].clone()); - currentNode.append(tempNode); - } else - tempNode = currentNode; - - for (childNode = parents[i].firstChild; childNode && childNode != parents[i + 1]; ) { - nextNode = childNode.next; - tempNode.append(childNode); - childNode = nextNode; - } - - currentNode = tempNode; - } - - if (!newParent.isEmpty(nonEmptyElements)) { - parent.insert(newParent, parents[0], true); - parent.insert(node, newParent); - } else { - parent.insert(node, parents[0], true); - } - - // Check if the element is empty by looking through it's contents and special treatment for


    - parent = parents[0]; - if (parent.isEmpty(nonEmptyElements) || parent.firstChild === parent.lastChild && parent.firstChild.name === 'br') { - parent.empty().remove(); - } - } else if (node.parent) { - // If it's an LI try to find a UL/OL for it or wrap it - if (node.name === 'li') { - sibling = node.prev; - if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { - sibling.append(node); - continue; - } - - sibling = node.next; - if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { - sibling.insert(node, sibling.firstChild, true); - continue; - } - - node.wrap(self.filterNode(new Node('ul', 1))); - continue; - } - - // Try wrapping the element in a DIV - if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) { - node.wrap(self.filterNode(new Node('div', 1))); - } else { - // We failed wrapping it, then remove or unwrap it - if (node.name === 'style' || node.name === 'script') - node.empty().remove(); - else - node.unwrap(); - } - } - } - }; - - self.filterNode = function(node) { - var i, name, list; - - // Run element filters - if (name in nodeFilters) { - list = matchedNodes[name]; - - if (list) - list.push(node); - else - matchedNodes[name] = [node]; - } - - // Run attribute filters - i = attributeFilters.length; - while (i--) { - name = attributeFilters[i].name; - - if (name in node.attributes.map) { - list = matchedAttributes[name]; - - if (list) - list.push(node); - else - matchedAttributes[name] = [node]; - } - } - - return node; - }; - - self.addNodeFilter = function(name, callback) { - tinymce.each(tinymce.explode(name), function(name) { - var list = nodeFilters[name]; - - if (!list) - nodeFilters[name] = list = []; - - list.push(callback); - }); - }; - - self.addAttributeFilter = function(name, callback) { - tinymce.each(tinymce.explode(name), function(name) { - var i; - - for (i = 0; i < attributeFilters.length; i++) { - if (attributeFilters[i].name === name) { - attributeFilters[i].callbacks.push(callback); - return; - } - } - - attributeFilters.push({name: name, callbacks: [callback]}); - }); - }; - - self.parse = function(html, args) { - var parser, rootNode, node, nodes, i, l, fi, fl, list, name, validate, - blockElements, startWhiteSpaceRegExp, invalidChildren = [], - endWhiteSpaceRegExp, allWhiteSpaceRegExp, whiteSpaceElements, children, nonEmptyElements, rootBlockName; - - args = args || {}; - matchedNodes = {}; - matchedAttributes = {}; - blockElements = tinymce.extend(tinymce.makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements()); - nonEmptyElements = schema.getNonEmptyElements(); - children = schema.children; - validate = settings.validate; - rootBlockName = "forced_root_block" in args ? args.forced_root_block : settings.forced_root_block; - - whiteSpaceElements = schema.getWhiteSpaceElements(); - startWhiteSpaceRegExp = /^[ \t\r\n]+/; - endWhiteSpaceRegExp = /[ \t\r\n]+$/; - allWhiteSpaceRegExp = /[ \t\r\n]+/g; - - function addRootBlocks() { - var node = rootNode.firstChild, next, rootBlockNode; - - while (node) { - next = node.next; - - if (node.type == 3 || (node.type == 1 && node.name !== 'p' && !blockElements[node.name] && !node.attr('data-mce-type'))) { - if (!rootBlockNode) { - // Create a new root block element - rootBlockNode = createNode(rootBlockName, 1); - rootNode.insert(rootBlockNode, node); - rootBlockNode.append(node); - } else - rootBlockNode.append(node); - } else { - rootBlockNode = null; - } - - node = next; - }; - }; - - function createNode(name, type) { - var node = new Node(name, type), list; - - if (name in nodeFilters) { - list = matchedNodes[name]; - - if (list) - list.push(node); - else - matchedNodes[name] = [node]; - } - - return node; - }; - - function removeWhitespaceBefore(node) { - var textNode, textVal, sibling; - - for (textNode = node.prev; textNode && textNode.type === 3; ) { - textVal = textNode.value.replace(endWhiteSpaceRegExp, ''); - - if (textVal.length > 0) { - textNode.value = textVal; - textNode = textNode.prev; - } else { - sibling = textNode.prev; - textNode.remove(); - textNode = sibling; - } - } - }; - - parser = new tinymce.html.SaxParser({ - validate : validate, - fix_self_closing : !validate, // Let the DOM parser handle
  • in
  • or

    in

    for better results - - cdata: function(text) { - node.append(createNode('#cdata', 4)).value = text; - }, - - text: function(text, raw) { - var textNode; - - // Trim all redundant whitespace on non white space elements - if (!whiteSpaceElements[node.name]) { - text = text.replace(allWhiteSpaceRegExp, ' '); - - if (node.lastChild && blockElements[node.lastChild.name]) - text = text.replace(startWhiteSpaceRegExp, ''); - } - - // Do we need to create the node - if (text.length !== 0) { - textNode = createNode('#text', 3); - textNode.raw = !!raw; - node.append(textNode).value = text; - } - }, - - comment: function(text) { - node.append(createNode('#comment', 8)).value = text; - }, - - pi: function(name, text) { - node.append(createNode(name, 7)).value = text; - removeWhitespaceBefore(node); - }, - - doctype: function(text) { - var newNode; - - newNode = node.append(createNode('#doctype', 10)); - newNode.value = text; - removeWhitespaceBefore(node); - }, - - start: function(name, attrs, empty) { - var newNode, attrFiltersLen, elementRule, textNode, attrName, text, sibling, parent; - - elementRule = validate ? schema.getElementRule(name) : {}; - if (elementRule) { - newNode = createNode(elementRule.outputName || name, 1); - newNode.attributes = attrs; - newNode.shortEnded = empty; - - node.append(newNode); - - // Check if node is valid child of the parent node is the child is - // unknown we don't collect it since it's probably a custom element - parent = children[node.name]; - if (parent && children[newNode.name] && !parent[newNode.name]) - invalidChildren.push(newNode); - - attrFiltersLen = attributeFilters.length; - while (attrFiltersLen--) { - attrName = attributeFilters[attrFiltersLen].name; - - if (attrName in attrs.map) { - list = matchedAttributes[attrName]; - - if (list) - list.push(newNode); - else - matchedAttributes[attrName] = [newNode]; - } - } - - // Trim whitespace before block - if (blockElements[name]) - removeWhitespaceBefore(newNode); - - // Change current node if the element wasn't empty i.e not
    or - if (!empty) - node = newNode; - } - }, - - end: function(name) { - var textNode, elementRule, text, sibling, tempNode; - - elementRule = validate ? schema.getElementRule(name) : {}; - if (elementRule) { - if (blockElements[name]) { - if (!whiteSpaceElements[node.name]) { - // Trim whitespace at beginning of block - for (textNode = node.firstChild; textNode && textNode.type === 3; ) { - text = textNode.value.replace(startWhiteSpaceRegExp, ''); - - if (text.length > 0) { - textNode.value = text; - textNode = textNode.next; - } else { - sibling = textNode.next; - textNode.remove(); - textNode = sibling; - } - } - - // Trim whitespace at end of block - for (textNode = node.lastChild; textNode && textNode.type === 3; ) { - text = textNode.value.replace(endWhiteSpaceRegExp, ''); - - if (text.length > 0) { - textNode.value = text; - textNode = textNode.prev; - } else { - sibling = textNode.prev; - textNode.remove(); - textNode = sibling; - } - } - } - - // Trim start white space - textNode = node.prev; - if (textNode && textNode.type === 3) { - text = textNode.value.replace(startWhiteSpaceRegExp, ''); - - if (text.length > 0) - textNode.value = text; - else - textNode.remove(); - } - } - - // Handle empty nodes - if (elementRule.removeEmpty || elementRule.paddEmpty) { - if (node.isEmpty(nonEmptyElements)) { - if (elementRule.paddEmpty) - node.empty().append(new Node('#text', '3')).value = '\u00a0'; - else { - // Leave nodes that have a name like - if (!node.attributes.map.name) { - tempNode = node.parent; - node.empty().remove(); - node = tempNode; - return; - } - } - } - } - - node = node.parent; - } - } - }, schema); - - rootNode = node = new Node(args.context || settings.root_name, 11); - - parser.parse(html); - - // Fix invalid children or report invalid children in a contextual parsing - if (validate && invalidChildren.length) { - if (!args.context) - fixInvalidChildren(invalidChildren); - else - args.invalid = true; - } - - // Wrap nodes in the root into block elements if the root is body - if (rootBlockName && rootNode.name == 'body') - addRootBlocks(); - - // Run filters only when the contents is valid - if (!args.invalid) { - // Run node filters - for (name in matchedNodes) { - list = nodeFilters[name]; - nodes = matchedNodes[name]; - - // Remove already removed children - fi = nodes.length; - while (fi--) { - if (!nodes[fi].parent) - nodes.splice(fi, 1); - } - - for (i = 0, l = list.length; i < l; i++) - list[i](nodes, name, args); - } - - // Run attribute filters - for (i = 0, l = attributeFilters.length; i < l; i++) { - list = attributeFilters[i]; - - if (list.name in matchedAttributes) { - nodes = matchedAttributes[list.name]; - - // Remove already removed children - fi = nodes.length; - while (fi--) { - if (!nodes[fi].parent) - nodes.splice(fi, 1); - } - - for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) - list.callbacks[fi](nodes, list.name, args); - } - } - } - - return rootNode; - }; - - // Remove
    at end of block elements Gecko and WebKit injects BR elements to - // make it possible to place the caret inside empty blocks. This logic tries to remove - // these elements and keep br elements that where intended to be there intact - if (settings.remove_trailing_brs) { - self.addNodeFilter('br', function(nodes, name) { - var i, l = nodes.length, node, blockElements = schema.getBlockElements(), - nonEmptyElements = schema.getNonEmptyElements(), parent, prev, prevName; - - // Remove brs from body element as well - blockElements.body = 1; - - // Must loop forwards since it will otherwise remove all brs in

    a


    - for (i = 0; i < l; i++) { - node = nodes[i]; - parent = node.parent; - - if (blockElements[node.parent.name] && node === parent.lastChild) { - // Loop all nodes to the right of the current node and check for other BR elements - // excluding bookmarks since they are invisible - prev = node.prev; - while (prev) { - prevName = prev.name; - - // Ignore bookmarks - if (prevName !== "span" || prev.attr('data-mce-type') !== 'bookmark') { - // Found a non BR element - if (prevName !== "br") - break; - - // Found another br it's a

    structure then don't remove anything - if (prevName === 'br') { - node = null; - break; - } - } - - prev = prev.prev; - } - - if (node) { - node.remove(); - - // Is the parent to be considered empty after we removed the BR - if (parent.isEmpty(nonEmptyElements)) { - elementRule = schema.getElementRule(parent.name); - - // Remove or padd the element depending on schema rule - if (elementRule) { - if (elementRule.removeEmpty) - parent.remove(); - else if (elementRule.paddEmpty) - parent.empty().append(new tinymce.html.Node('#text', 3)).value = '\u00a0'; - } - } - } - } - } - }); - } - } -})(tinymce); - -tinymce.html.Writer = function(settings) { - var html = [], indent, indentBefore, indentAfter, encode, htmlOutput; - - settings = settings || {}; - indent = settings.indent; - indentBefore = tinymce.makeMap(settings.indent_before || ''); - indentAfter = tinymce.makeMap(settings.indent_after || ''); - encode = tinymce.html.Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities); - htmlOutput = settings.element_format == "html"; - - return { - start: function(name, attrs, empty) { - var i, l, attr, value; - - if (indent && indentBefore[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') - html.push('\n'); - } - - html.push('<', name); - - if (attrs) { - for (i = 0, l = attrs.length; i < l; i++) { - attr = attrs[i]; - html.push(' ', attr.name, '="', encode(attr.value, true), '"'); - } - } - - if (!empty || htmlOutput) - html[html.length] = '>'; - else - html[html.length] = ' />'; - - if (empty && indent && indentAfter[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') - html.push('\n'); - } - }, - - end: function(name) { - var value; - - /*if (indent && indentBefore[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') - html.push('\n'); - }*/ - - html.push(''); - - if (indent && indentAfter[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') - html.push('\n'); - } - }, - - text: function(text, raw) { - if (text.length > 0) - html[html.length] = raw ? text : encode(text); - }, - - cdata: function(text) { - html.push(''); - }, - - comment: function(text) { - html.push(''); - }, - - pi: function(name, text) { - if (text) - html.push(''); - else - html.push(''); - - if (indent) - html.push('\n'); - }, - - doctype: function(text) { - html.push('', indent ? '\n' : ''); - }, - - reset: function() { - html.length = 0; - }, - - getContent: function() { - return html.join('').replace(/\n$/, ''); - } - }; -}; - -(function(tinymce) { - tinymce.html.Serializer = function(settings, schema) { - var self = this, writer = new tinymce.html.Writer(settings); - - settings = settings || {}; - settings.validate = "validate" in settings ? settings.validate : true; - - self.schema = schema = schema || new tinymce.html.Schema(); - self.writer = writer; - - self.serialize = function(node) { - var handlers, validate; - - validate = settings.validate; - - handlers = { - // #text - 3: function(node, raw) { - writer.text(node.value, node.raw); - }, - - // #comment - 8: function(node) { - writer.comment(node.value); - }, - - // Processing instruction - 7: function(node) { - writer.pi(node.name, node.value); - }, - - // Doctype - 10: function(node) { - writer.doctype(node.value); - }, - - // CDATA - 4: function(node) { - writer.cdata(node.value); - }, - - // Document fragment - 11: function(node) { - if ((node = node.firstChild)) { - do { - walk(node); - } while (node = node.next); - } - } - }; - - writer.reset(); - - function walk(node) { - var handler = handlers[node.type], name, isEmpty, attrs, attrName, attrValue, sortedAttrs, i, l, elementRule; - - if (!handler) { - name = node.name; - isEmpty = node.shortEnded; - attrs = node.attributes; - - // Sort attributes - if (validate && attrs && attrs.length > 1) { - sortedAttrs = []; - sortedAttrs.map = {}; - - elementRule = schema.getElementRule(node.name); - for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) { - attrName = elementRule.attributesOrder[i]; - - if (attrName in attrs.map) { - attrValue = attrs.map[attrName]; - sortedAttrs.map[attrName] = attrValue; - sortedAttrs.push({name: attrName, value: attrValue}); - } - } - - for (i = 0, l = attrs.length; i < l; i++) { - attrName = attrs[i].name; - - if (!(attrName in sortedAttrs.map)) { - attrValue = attrs.map[attrName]; - sortedAttrs.map[attrName] = attrValue; - sortedAttrs.push({name: attrName, value: attrValue}); - } - } - - attrs = sortedAttrs; - } - - writer.start(node.name, attrs, isEmpty); - - if (!isEmpty) { - if ((node = node.firstChild)) { - do { - walk(node); - } while (node = node.next); - } - - writer.end(name); - } - } else - handler(node); - } - - // Serialize element and treat all non elements as fragments - if (node.type == 1 && !settings.inner) - walk(node); - else - handlers[11](node); - - return writer.getContent(); - }; - } -})(tinymce); - -(function(tinymce) { - // Shorten names - var each = tinymce.each, - is = tinymce.is, - isWebKit = tinymce.isWebKit, - isIE = tinymce.isIE, - Entities = tinymce.html.Entities, - simpleSelectorRe = /^([a-z0-9],?)+$/i, - blockElementsMap = tinymce.html.Schema.blockElementsMap, - whiteSpaceRegExp = /^[ \t\r\n]*$/; - - tinymce.create('tinymce.dom.DOMUtils', { - doc : null, - root : null, - files : null, - pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/, - props : { - "for" : "htmlFor", - "class" : "className", - className : "className", - checked : "checked", - disabled : "disabled", - maxlength : "maxLength", - readonly : "readOnly", - selected : "selected", - value : "value", - id : "id", - name : "name", - type : "type" - }, - - DOMUtils : function(d, s) { - var t = this, globalStyle, name; - - t.doc = d; - t.win = window; - t.files = {}; - t.cssFlicker = false; - t.counter = 0; - t.stdMode = !tinymce.isIE || d.documentMode >= 8; - t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat" || t.stdMode; - t.hasOuterHTML = "outerHTML" in d.createElement("a"); - - t.settings = s = tinymce.extend({ - keep_values : false, - hex_colors : 1 - }, s); - - t.schema = s.schema; - t.styles = new tinymce.html.Styles({ - url_converter : s.url_converter, - url_converter_scope : s.url_converter_scope - }, s.schema); - - // Fix IE6SP2 flicker and check it failed for pre SP2 - if (tinymce.isIE6) { - try { - d.execCommand('BackgroundImageCache', false, true); - } catch (e) { - t.cssFlicker = true; - } - } - - if (isIE && s.schema) { - // Add missing HTML 4/5 elements to IE - ('abbr article aside audio canvas ' + - 'details figcaption figure footer ' + - 'header hgroup mark menu meter nav ' + - 'output progress section summary ' + - 'time video').replace(/\w+/g, function(name) { - d.createElement(name); - }); - - // Create all custom elements - for (name in s.schema.getCustomElements()) { - d.createElement(name); - } - } - - tinymce.addUnload(t.destroy, t); - }, - - getRoot : function() { - var t = this, s = t.settings; - - return (s && t.get(s.root_element)) || t.doc.body; - }, - - getViewPort : function(w) { - var d, b; - - w = !w ? this.win : w; - d = w.document; - b = this.boxModel ? d.documentElement : d.body; - - // Returns viewport size excluding scrollbars - return { - x : w.pageXOffset || b.scrollLeft, - y : w.pageYOffset || b.scrollTop, - w : w.innerWidth || b.clientWidth, - h : w.innerHeight || b.clientHeight - }; - }, - - getRect : function(e) { - var p, t = this, sr; - - e = t.get(e); - p = t.getPos(e); - sr = t.getSize(e); - - return { - x : p.x, - y : p.y, - w : sr.w, - h : sr.h - }; - }, - - getSize : function(e) { - var t = this, w, h; - - e = t.get(e); - w = t.getStyle(e, 'width'); - h = t.getStyle(e, 'height'); - - // Non pixel value, then force offset/clientWidth - if (w.indexOf('px') === -1) - w = 0; - - // Non pixel value, then force offset/clientWidth - if (h.indexOf('px') === -1) - h = 0; - - return { - w : parseInt(w) || e.offsetWidth || e.clientWidth, - h : parseInt(h) || e.offsetHeight || e.clientHeight - }; - }, - - getParent : function(n, f, r) { - return this.getParents(n, f, r, false); - }, - - getParents : function(n, f, r, c) { - var t = this, na, se = t.settings, o = []; - - n = t.get(n); - c = c === undefined; - - if (se.strict_root) - r = r || t.getRoot(); - - // Wrap node name as func - if (is(f, 'string')) { - na = f; - - if (f === '*') { - f = function(n) {return n.nodeType == 1;}; - } else { - f = function(n) { - return t.is(n, na); - }; - } - } - - while (n) { - if (n == r || !n.nodeType || n.nodeType === 9) - break; - - if (!f || f(n)) { - if (c) - o.push(n); - else - return n; - } - - n = n.parentNode; - } - - return c ? o : null; - }, - - get : function(e) { - var n; - - if (e && this.doc && typeof(e) == 'string') { - n = e; - e = this.doc.getElementById(e); - - // IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick - if (e && e.id !== n) - return this.doc.getElementsByName(n)[1]; - } - - return e; - }, - - getNext : function(node, selector) { - return this._findSib(node, selector, 'nextSibling'); - }, - - getPrev : function(node, selector) { - return this._findSib(node, selector, 'previousSibling'); - }, - - - add : function(p, n, a, h, c) { - var t = this; - - return this.run(p, function(p) { - var e, k; - - e = is(n, 'string') ? t.doc.createElement(n) : n; - t.setAttribs(e, a); - - if (h) { - if (h.nodeType) - e.appendChild(h); - else - t.setHTML(e, h); - } - - return !c ? p.appendChild(e) : e; - }); - }, - - create : function(n, a, h) { - return this.add(this.doc.createElement(n), n, a, h, 1); - }, - - createHTML : function(n, a, h) { - var o = '', t = this, k; - - o += '<' + n; - - for (k in a) { - if (a.hasOwnProperty(k)) - o += ' ' + k + '="' + t.encode(a[k]) + '"'; - } - - // A call to tinymce.is doesn't work for some odd reason on IE9 possible bug inside their JS runtime - if (typeof(h) != "undefined") - return o + '>' + h + ''; - - return o + ' />'; - }, - - remove : function(node, keep_children) { - return this.run(node, function(node) { - var child, parent = node.parentNode; - - if (!parent) - return null; - - if (keep_children) { - while (child = node.firstChild) { - // IE 8 will crash if you don't remove completely empty text nodes - if (!tinymce.isIE || child.nodeType !== 3 || child.nodeValue) - parent.insertBefore(child, node); - else - node.removeChild(child); - } - } - - return parent.removeChild(node); - }); - }, - - setStyle : function(n, na, v) { - var t = this; - - return t.run(n, function(e) { - var s, i; - - s = e.style; - - // Camelcase it, if needed - na = na.replace(/-(\D)/g, function(a, b){ - return b.toUpperCase(); - }); - - // Default px suffix on these - if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v))) - v += 'px'; - - switch (na) { - case 'opacity': - // IE specific opacity - if (isIE) { - s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")"; - - if (!n.currentStyle || !n.currentStyle.hasLayout) - s.display = 'inline-block'; - } - - // Fix for older browsers - s[na] = s['-moz-opacity'] = s['-khtml-opacity'] = v || ''; - break; - - case 'float': - isIE ? s.styleFloat = v : s.cssFloat = v; - break; - - default: - s[na] = v || ''; - } - - // Force update of the style data - if (t.settings.update_styles) - t.setAttrib(e, 'data-mce-style'); - }); - }, - - getStyle : function(n, na, c) { - n = this.get(n); - - if (!n) - return; - - // Gecko - if (this.doc.defaultView && c) { - // Remove camelcase - na = na.replace(/[A-Z]/g, function(a){ - return '-' + a; - }); - - try { - return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na); - } catch (ex) { - // Old safari might fail - return null; - } - } - - // Camelcase it, if needed - na = na.replace(/-(\D)/g, function(a, b){ - return b.toUpperCase(); - }); - - if (na == 'float') - na = isIE ? 'styleFloat' : 'cssFloat'; - - // IE & Opera - if (n.currentStyle && c) - return n.currentStyle[na]; - - return n.style ? n.style[na] : undefined; - }, - - setStyles : function(e, o) { - var t = this, s = t.settings, ol; - - ol = s.update_styles; - s.update_styles = 0; - - each(o, function(v, n) { - t.setStyle(e, n, v); - }); - - // Update style info - s.update_styles = ol; - if (s.update_styles) - t.setAttrib(e, s.cssText); - }, - - removeAllAttribs: function(e) { - return this.run(e, function(e) { - var i, attrs = e.attributes; - for (i = attrs.length - 1; i >= 0; i--) { - e.removeAttributeNode(attrs.item(i)); - } - }); - }, - - setAttrib : function(e, n, v) { - var t = this; - - // Whats the point - if (!e || !n) - return; - - // Strict XML mode - if (t.settings.strict) - n = n.toLowerCase(); - - return this.run(e, function(e) { - var s = t.settings; - var originalValue = e.getAttribute(n); - if (v !== null) { - switch (n) { - case "style": - if (!is(v, 'string')) { - each(v, function(v, n) { - t.setStyle(e, n, v); - }); - - return; - } - - // No mce_style for elements with these since they might get resized by the user - if (s.keep_values) { - if (v && !t._isRes(v)) - e.setAttribute('data-mce-style', v, 2); - else - e.removeAttribute('data-mce-style', 2); - } - - e.style.cssText = v; - break; - - case "class": - e.className = v || ''; // Fix IE null bug - break; - - case "src": - case "href": - if (s.keep_values) { - if (s.url_converter) - v = s.url_converter.call(s.url_converter_scope || t, v, n, e); - - t.setAttrib(e, 'data-mce-' + n, v, 2); - } - - break; - - case "shape": - e.setAttribute('data-mce-style', v); - break; - } - } - if (is(v) && v !== null && v.length !== 0) - e.setAttribute(n, '' + v, 2); - else - e.removeAttribute(n, 2); - - // fire onChangeAttrib event for attributes that have changed - if (tinyMCE.activeEditor && originalValue != v) { - var ed = tinyMCE.activeEditor; - ed.onSetAttrib.dispatch(ed, e, n, v); - } - }); - }, - - setAttribs : function(e, o) { - var t = this; - - return this.run(e, function(e) { - each(o, function(v, n) { - t.setAttrib(e, n, v); - }); - }); - }, - - getAttrib : function(e, n, dv) { - var v, t = this, undef; - - e = t.get(e); - - if (!e || e.nodeType !== 1) - return dv === undef ? false : dv; - - if (!is(dv)) - dv = ''; - - // Try the mce variant for these - if (/^(src|href|style|coords|shape)$/.test(n)) { - v = e.getAttribute("data-mce-" + n); - - if (v) - return v; - } - - if (isIE && t.props[n]) { - v = e[t.props[n]]; - v = v && v.nodeValue ? v.nodeValue : v; - } - - if (!v) - v = e.getAttribute(n, 2); - - // Check boolean attribs - if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(n)) { - if (e[t.props[n]] === true && v === '') - return n; - - return v ? n : ''; - } - - // Inner input elements will override attributes on form elements - if (e.nodeName === "FORM" && e.getAttributeNode(n)) - return e.getAttributeNode(n).nodeValue; - - if (n === 'style') { - v = v || e.style.cssText; - - if (v) { - v = t.serializeStyle(t.parseStyle(v), e.nodeName); - - if (t.settings.keep_values && !t._isRes(v)) - e.setAttribute('data-mce-style', v); - } - } - - // Remove Apple and WebKit stuff - if (isWebKit && n === "class" && v) - v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, ''); - - // Handle IE issues - if (isIE) { - switch (n) { - case 'rowspan': - case 'colspan': - // IE returns 1 as default value - if (v === 1) - v = ''; - - break; - - case 'size': - // IE returns +0 as default value for size - if (v === '+0' || v === 20 || v === 0) - v = ''; - - break; - - case 'width': - case 'height': - case 'vspace': - case 'checked': - case 'disabled': - case 'readonly': - if (v === 0) - v = ''; - - break; - - case 'hspace': - // IE returns -1 as default value - if (v === -1) - v = ''; - - break; - - case 'maxlength': - case 'tabindex': - // IE returns default value - if (v === 32768 || v === 2147483647 || v === '32768') - v = ''; - - break; - - case 'multiple': - case 'compact': - case 'noshade': - case 'nowrap': - if (v === 65535) - return n; - - return dv; - - case 'shape': - v = v.toLowerCase(); - break; - - default: - // IE has odd anonymous function for event attributes - if (n.indexOf('on') === 0 && v) - v = tinymce._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, '$1', '' + v); - } - } - - return (v !== undef && v !== null && v !== '') ? '' + v : dv; - }, - - getPos : function(n, ro) { - var t = this, x = 0, y = 0, e, d = t.doc, r; - - n = t.get(n); - ro = ro || d.body; - - if (n) { - // Use getBoundingClientRect if it exists since it's faster than looping offset nodes - if (n.getBoundingClientRect) { - n = n.getBoundingClientRect(); - e = t.boxModel ? d.documentElement : d.body; - - // Add scroll offsets from documentElement or body since IE with the wrong box model will use d.body and so do WebKit - // Also remove the body/documentelement clientTop/clientLeft on IE 6, 7 since they offset the position - x = n.left + (d.documentElement.scrollLeft || d.body.scrollLeft) - e.clientTop; - y = n.top + (d.documentElement.scrollTop || d.body.scrollTop) - e.clientLeft; - - return {x : x, y : y}; - } - - r = n; - while (r && r != ro && r.nodeType) { - x += r.offsetLeft || 0; - y += r.offsetTop || 0; - r = r.offsetParent; - } - - r = n.parentNode; - while (r && r != ro && r.nodeType) { - x -= r.scrollLeft || 0; - y -= r.scrollTop || 0; - r = r.parentNode; - } - } - - return {x : x, y : y}; - }, - - parseStyle : function(st) { - return this.styles.parse(st); - }, - - serializeStyle : function(o, name) { - return this.styles.serialize(o, name); - }, - - loadCSS : function(u) { - var t = this, d = t.doc, head; - - if (!u) - u = ''; - - head = t.select('head')[0]; - - each(u.split(','), function(u) { - var link; - - if (t.files[u]) - return; - - t.files[u] = true; - link = t.create('link', {rel : 'stylesheet', href : tinymce._addVer(u)}); - - // IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug - // This fix seems to resolve that issue by realcing the document ones a stylesheet finishes loading - // It's ugly but it seems to work fine. - if (isIE && d.documentMode && d.recalc) { - link.onload = function() { - if (d.recalc) - d.recalc(); - - link.onload = null; - }; - } - - head.appendChild(link); - }); - }, - - addClass : function(e, c) { - return this.run(e, function(e) { - var o; - - if (!c) - return 0; - - if (this.hasClass(e, c)) - return e.className; - - o = this.removeClass(e, c); - - return e.className = (o != '' ? (o + ' ') : '') + c; - }); - }, - - removeClass : function(e, c) { - var t = this, re; - - return t.run(e, function(e) { - var v; - - if (t.hasClass(e, c)) { - if (!re) - re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g"); - - v = e.className.replace(re, ' '); - v = tinymce.trim(v != ' ' ? v : ''); - - e.className = v; - - // Empty class attr - if (!v) { - e.removeAttribute('class'); - e.removeAttribute('className'); - } - - return v; - } - - return e.className; - }); - }, - - hasClass : function(n, c) { - n = this.get(n); - - if (!n || !c) - return false; - - return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1; - }, - - show : function(e) { - return this.setStyle(e, 'display', 'block'); - }, - - hide : function(e) { - return this.setStyle(e, 'display', 'none'); - }, - - isHidden : function(e) { - e = this.get(e); - - return !e || e.style.display == 'none' || this.getStyle(e, 'display') == 'none'; - }, - - uniqueId : function(p) { - return (!p ? 'mce_' : p) + (this.counter++); - }, - - setHTML : function(element, html) { - var self = this; - - return self.run(element, function(element) { - if (isIE) { - // Remove all child nodes, IE keeps empty text nodes in DOM - while (element.firstChild) - element.removeChild(element.firstChild); - - try { - // IE will remove comments from the beginning - // unless you padd the contents with something - element.innerHTML = '
    ' + html; - element.removeChild(element.firstChild); - } catch (ex) { - // IE sometimes produces an unknown runtime error on innerHTML if it's an block element within a block element for example a div inside a p - // This seems to fix this problem - - // Create new div with HTML contents and a BR infront to keep comments - element = self.create('div'); - element.innerHTML = '
    ' + html; - - // Add all children from div to target - each (element.childNodes, function(node, i) { - // Skip br element - if (i) - element.appendChild(node); - }); - } - } else - element.innerHTML = html; - - return html; - }); - }, - - getOuterHTML : function(elm) { - var doc, self = this; - - elm = self.get(elm); - - if (!elm) - return null; - - if (elm.nodeType === 1 && self.hasOuterHTML) - return elm.outerHTML; - - doc = (elm.ownerDocument || self.doc).createElement("body"); - doc.appendChild(elm.cloneNode(true)); - - return doc.innerHTML; - }, - - setOuterHTML : function(e, h, d) { - var t = this; - - function setHTML(e, h, d) { - var n, tp; - - tp = d.createElement("body"); - tp.innerHTML = h; - - n = tp.lastChild; - while (n) { - t.insertAfter(n.cloneNode(true), e); - n = n.previousSibling; - } - - t.remove(e); - }; - - return this.run(e, function(e) { - e = t.get(e); - - // Only set HTML on elements - if (e.nodeType == 1) { - d = d || e.ownerDocument || t.doc; - - if (isIE) { - try { - // Try outerHTML for IE it sometimes produces an unknown runtime error - if (isIE && e.nodeType == 1) - e.outerHTML = h; - else - setHTML(e, h, d); - } catch (ex) { - // Fix for unknown runtime error - setHTML(e, h, d); - } - } else - setHTML(e, h, d); - } - }); - }, - - decode : Entities.decode, - - encode : Entities.encodeAllRaw, - - insertAfter : function(node, reference_node) { - reference_node = this.get(reference_node); - - return this.run(node, function(node) { - var parent, nextSibling; - - parent = reference_node.parentNode; - nextSibling = reference_node.nextSibling; - - if (nextSibling) - parent.insertBefore(node, nextSibling); - else - parent.appendChild(node); - - return node; - }); - }, - - isBlock : function(node) { - var type = node.nodeType; - - // If it's a node then check the type and use the nodeName - if (type) - return !!(type === 1 && blockElementsMap[node.nodeName]); - - return !!blockElementsMap[node]; - }, - - replace : function(n, o, k) { - var t = this; - - if (is(o, 'array')) - n = n.cloneNode(true); - - return t.run(o, function(o) { - if (k) { - each(tinymce.grep(o.childNodes), function(c) { - n.appendChild(c); - }); - } - - return o.parentNode.replaceChild(n, o); - }); - }, - - rename : function(elm, name) { - var t = this, newElm; - - if (elm.nodeName != name.toUpperCase()) { - // Rename block element - newElm = t.create(name); - - // Copy attribs to new block - each(t.getAttribs(elm), function(attr_node) { - t.setAttrib(newElm, attr_node.nodeName, t.getAttrib(elm, attr_node.nodeName)); - }); - - // Replace block - t.replace(newElm, elm, 1); - } - - return newElm || elm; - }, - - findCommonAncestor : function(a, b) { - var ps = a, pe; - - while (ps) { - pe = b; - - while (pe && ps != pe) - pe = pe.parentNode; - - if (ps == pe) - break; - - ps = ps.parentNode; - } - - if (!ps && a.ownerDocument) - return a.ownerDocument.documentElement; - - return ps; - }, - - toHex : function(s) { - var c = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s); - - function hex(s) { - s = parseInt(s).toString(16); - - return s.length > 1 ? s : '0' + s; // 0 -> 00 - }; - - if (c) { - s = '#' + hex(c[1]) + hex(c[2]) + hex(c[3]); - - return s; - } - - return s; - }, - - getClasses : function() { - var t = this, cl = [], i, lo = {}, f = t.settings.class_filter, ov; - - if (t.classes) - return t.classes; - - function addClasses(s) { - // IE style imports - each(s.imports, function(r) { - addClasses(r); - }); - - each(s.cssRules || s.rules, function(r) { - // Real type or fake it on IE - switch (r.type || 1) { - // Rule - case 1: - if (r.selectorText) { - each(r.selectorText.split(','), function(v) { - v = v.replace(/^\s*|\s*$|^\s\./g, ""); - - // Is internal or it doesn't contain a class - if (/\.mce/.test(v) || !/\.[\w\-]+$/.test(v)) - return; - - // Remove everything but class name - ov = v; - v = tinymce._replace(/.*\.([a-z0-9_\-]+).*/i, '$1', v); - - // Filter classes - if (f && !(v = f(v, ov))) - return; - - if (!lo[v]) { - cl.push({'class' : v}); - lo[v] = 1; - } - }); - } - break; - - // Import - case 3: - addClasses(r.styleSheet); - break; - } - }); - }; - - try { - each(t.doc.styleSheets, addClasses); - } catch (ex) { - // Ignore - } - - if (cl.length > 0) - t.classes = cl; - - return cl; - }, - - run : function(e, f, s) { - var t = this, o; - - if (t.doc && typeof(e) === 'string') - e = t.get(e); - - if (!e) - return false; - - s = s || this; - if (!e.nodeType && (e.length || e.length === 0)) { - o = []; - - each(e, function(e, i) { - if (e) { - if (typeof(e) == 'string') - e = t.doc.getElementById(e); - - o.push(f.call(s, e, i)); - } - }); - - return o; - } - - return f.call(s, e); - }, - - getAttribs : function(n) { - var o; - - n = this.get(n); - - if (!n) - return []; - - if (isIE) { - o = []; - - // Object will throw exception in IE - if (n.nodeName == 'OBJECT') - return n.attributes; - - // IE doesn't keep the selected attribute if you clone option elements - if (n.nodeName === 'OPTION' && this.getAttrib(n, 'selected')) - o.push({specified : 1, nodeName : 'selected'}); - - // It's crazy that this is faster in IE but it's because it returns all attributes all the time - n.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi, '').replace(/[\w:\-]+/gi, function(a) { - o.push({specified : 1, nodeName : a}); - }); - - return o; - } - - return n.attributes; - }, - - isEmpty : function(node, elements) { - var self = this, i, attributes, type, walker, name, parentNode; - - node = node.firstChild; - if (node) { - walker = new tinymce.dom.TreeWalker(node); - elements = elements || self.schema ? self.schema.getNonEmptyElements() : null; - - do { - type = node.nodeType; - - if (type === 1) { - // Ignore bogus elements - if (node.getAttribute('data-mce-bogus')) - continue; - - // Keep empty elements like - name = node.nodeName.toLowerCase(); - if (elements && elements[name]) { - // Ignore single BR elements in blocks like


    - parentNode = node.parentNode; - if (name === 'br' && self.isBlock(parentNode) && parentNode.firstChild === node && parentNode.lastChild === node) { - continue; - } - - return false; - } - - // Keep elements with data-bookmark attributes or name attribute like
    - attributes = self.getAttribs(node); - i = node.attributes.length; - while (i--) { - name = node.attributes[i].nodeName; - if (name === "name" || name === 'data-mce-bookmark') - return false; - } - } - - // Keep comment nodes - if (type == 8) - return false; - - // Keep non whitespace text nodes - if ((type === 3 && !whiteSpaceRegExp.test(node.nodeValue))) - return false; - } while (node = walker.next()); - } - - return true; - }, - - destroy : function(s) { - var t = this; - - if (t.events) - t.events.destroy(); - - t.win = t.doc = t.root = t.events = null; - - // Manual destroy then remove unload handler - if (!s) - tinymce.removeUnload(t.destroy); - }, - - createRng : function() { - var d = this.doc; - - return d.createRange ? d.createRange() : new tinymce.dom.Range(this); - }, - - nodeIndex : function(node, normalized) { - var idx = 0, lastNodeType, lastNode, nodeType; - - if (node) { - for (lastNodeType = node.nodeType, node = node.previousSibling, lastNode = node; node; node = node.previousSibling) { - nodeType = node.nodeType; - - // Normalize text nodes - if (normalized && nodeType == 3) { - if (nodeType == lastNodeType || !node.nodeValue.length) - continue; - } - idx++; - lastNodeType = nodeType; - } - } - - return idx; - }, - - split : function(pe, e, re) { - var t = this, r = t.createRng(), bef, aft, pa; - - // W3C valid browsers tend to leave empty nodes to the left/right side of the contents, this makes sense - // but we don't want that in our code since it serves no purpose for the end user - // For example if this is chopped: - //

    text 1CHOPtext 2

    - // would produce: - //

    text 1

    CHOP

    text 2

    - // this function will then trim of empty edges and produce: - //

    text 1

    CHOP

    text 2

    - function trim(node) { - var i, children = node.childNodes, type = node.nodeType; - - function surroundedBySpans(node) { - var previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN'; - var nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN'; - return previousIsSpan && nextIsSpan; - } - - if (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') - return; - - for (i = children.length - 1; i >= 0; i--) - trim(children[i]); - - if (type != 9) { - // Keep non whitespace text nodes - if (type == 3 && node.nodeValue.length > 0) { - // If parent element isn't a block or there isn't any useful contents for example "

    " - // Also keep text nodes with only spaces if surrounded by spans. - // eg. "

    a b

    " should keep space between a and b - var trimmedLength = tinymce.trim(node.nodeValue).length; - if (!t.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength == 0 && surroundedBySpans(node)) - return; - } else if (type == 1) { - // If the only child is a bookmark then move it up - children = node.childNodes; - if (children.length == 1 && children[0] && children[0].nodeType == 1 && children[0].getAttribute('data-mce-type') == 'bookmark') - node.parentNode.insertBefore(children[0], node); - - // Keep non empty elements or img, hr etc - if (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) - return; - } - - t.remove(node); - } - - return node; - }; - - if (pe && e) { - // Get before chunk - r.setStart(pe.parentNode, t.nodeIndex(pe)); - r.setEnd(e.parentNode, t.nodeIndex(e)); - bef = r.extractContents(); - - // Get after chunk - r = t.createRng(); - r.setStart(e.parentNode, t.nodeIndex(e) + 1); - r.setEnd(pe.parentNode, t.nodeIndex(pe) + 1); - aft = r.extractContents(); - - // Insert before chunk - pa = pe.parentNode; - pa.insertBefore(trim(bef), pe); - - // Insert middle chunk - if (re) - pa.replaceChild(re, e); - else - pa.insertBefore(e, pe); - - // Insert after chunk - pa.insertBefore(trim(aft), pe); - t.remove(pe); - - return re || e; - } - }, - - bind : function(target, name, func, scope) { - var t = this; - - if (!t.events) - t.events = new tinymce.dom.EventUtils(); - - return t.events.add(target, name, func, scope || this); - }, - - unbind : function(target, name, func) { - var t = this; - - if (!t.events) - t.events = new tinymce.dom.EventUtils(); - - return t.events.remove(target, name, func); - }, - - - _findSib : function(node, selector, name) { - var t = this, f = selector; - - if (node) { - // If expression make a function of it using is - if (is(f, 'string')) { - f = function(node) { - return t.is(node, selector); - }; - } - - // Loop all siblings - for (node = node[name]; node; node = node[name]) { - if (f(node)) - return node; - } - } - - return null; - }, - - _isRes : function(c) { - // Is live resizble element - return /^(top|left|bottom|right|width|height)/i.test(c) || /;\s*(top|left|bottom|right|width|height)/i.test(c); - } - - /* - walk : function(n, f, s) { - var d = this.doc, w; - - if (d.createTreeWalker) { - w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); - - while ((n = w.nextNode()) != null) - f.call(s || this, n); - } else - tinymce.walk(n, f, 'childNodes', s); - } - */ - - /* - toRGB : function(s) { - var c = /^\s*?#([0-9A-F]{2})([0-9A-F]{1,2})([0-9A-F]{2})?\s*?$/.exec(s); - - if (c) { - // #FFF -> #FFFFFF - if (!is(c[3])) - c[3] = c[2] = c[1]; - - return "rgb(" + parseInt(c[1], 16) + "," + parseInt(c[2], 16) + "," + parseInt(c[3], 16) + ")"; - } - - return s; - } - */ - }); - - tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0}); -})(tinymce); - -(function(ns) { - // Range constructor - function Range(dom) { - var t = this, - doc = dom.doc, - EXTRACT = 0, - CLONE = 1, - DELETE = 2, - TRUE = true, - FALSE = false, - START_OFFSET = 'startOffset', - START_CONTAINER = 'startContainer', - END_CONTAINER = 'endContainer', - END_OFFSET = 'endOffset', - extend = tinymce.extend, - nodeIndex = dom.nodeIndex; - - extend(t, { - // Inital states - startContainer : doc, - startOffset : 0, - endContainer : doc, - endOffset : 0, - collapsed : TRUE, - commonAncestorContainer : doc, - - // Range constants - START_TO_START : 0, - START_TO_END : 1, - END_TO_END : 2, - END_TO_START : 3, - - // Public methods - setStart : setStart, - setEnd : setEnd, - setStartBefore : setStartBefore, - setStartAfter : setStartAfter, - setEndBefore : setEndBefore, - setEndAfter : setEndAfter, - collapse : collapse, - selectNode : selectNode, - selectNodeContents : selectNodeContents, - compareBoundaryPoints : compareBoundaryPoints, - deleteContents : deleteContents, - extractContents : extractContents, - cloneContents : cloneContents, - insertNode : insertNode, - surroundContents : surroundContents, - cloneRange : cloneRange - }); - - function setStart(n, o) { - _setEndPoint(TRUE, n, o); - }; - - function setEnd(n, o) { - _setEndPoint(FALSE, n, o); - }; - - function setStartBefore(n) { - setStart(n.parentNode, nodeIndex(n)); - }; - - function setStartAfter(n) { - setStart(n.parentNode, nodeIndex(n) + 1); - }; - - function setEndBefore(n) { - setEnd(n.parentNode, nodeIndex(n)); - }; - - function setEndAfter(n) { - setEnd(n.parentNode, nodeIndex(n) + 1); - }; - - function collapse(ts) { - if (ts) { - t[END_CONTAINER] = t[START_CONTAINER]; - t[END_OFFSET] = t[START_OFFSET]; - } else { - t[START_CONTAINER] = t[END_CONTAINER]; - t[START_OFFSET] = t[END_OFFSET]; - } - - t.collapsed = TRUE; - }; - - function selectNode(n) { - setStartBefore(n); - setEndAfter(n); - }; - - function selectNodeContents(n) { - setStart(n, 0); - setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length); - }; - - function compareBoundaryPoints(h, r) { - var sc = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[END_OFFSET], - rsc = r.startContainer, rso = r.startOffset, rec = r.endContainer, reo = r.endOffset; - - // Check START_TO_START - if (h === 0) - return _compareBoundaryPoints(sc, so, rsc, rso); - - // Check START_TO_END - if (h === 1) - return _compareBoundaryPoints(ec, eo, rsc, rso); - - // Check END_TO_END - if (h === 2) - return _compareBoundaryPoints(ec, eo, rec, reo); - - // Check END_TO_START - if (h === 3) - return _compareBoundaryPoints(sc, so, rec, reo); - }; - - function deleteContents() { - _traverse(DELETE); - }; - - function extractContents() { - return _traverse(EXTRACT); - }; - - function cloneContents() { - return _traverse(CLONE); - }; - - function insertNode(n) { - var startContainer = this[START_CONTAINER], - startOffset = this[START_OFFSET], nn, o; - - // Node is TEXT_NODE or CDATA - if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) { - if (!startOffset) { - // At the start of text - startContainer.parentNode.insertBefore(n, startContainer); - } else if (startOffset >= startContainer.nodeValue.length) { - // At the end of text - dom.insertAfter(n, startContainer); - } else { - // Middle, need to split - nn = startContainer.splitText(startOffset); - startContainer.parentNode.insertBefore(n, nn); - } - } else { - // Insert element node - if (startContainer.childNodes.length > 0) - o = startContainer.childNodes[startOffset]; - - if (o) - startContainer.insertBefore(n, o); - else - startContainer.appendChild(n); - } - }; - - function surroundContents(n) { - var f = t.extractContents(); - - t.insertNode(n); - n.appendChild(f); - t.selectNode(n); - }; - - function cloneRange() { - return extend(new Range(dom), { - startContainer : t[START_CONTAINER], - startOffset : t[START_OFFSET], - endContainer : t[END_CONTAINER], - endOffset : t[END_OFFSET], - collapsed : t.collapsed, - commonAncestorContainer : t.commonAncestorContainer - }); - }; - - // Private methods - - function _getSelectedNode(container, offset) { - var child; - - if (container.nodeType == 3 /* TEXT_NODE */) - return container; - - if (offset < 0) - return container; - - child = container.firstChild; - while (child && offset > 0) { - --offset; - child = child.nextSibling; - } - - if (child) - return child; - - return container; - }; - - function _isCollapsed() { - return (t[START_CONTAINER] == t[END_CONTAINER] && t[START_OFFSET] == t[END_OFFSET]); - }; - - function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) { - var c, offsetC, n, cmnRoot, childA, childB; - - // In the first case the boundary-points have the same container. A is before B - // if its offset is less than the offset of B, A is equal to B if its offset is - // equal to the offset of B, and A is after B if its offset is greater than the - // offset of B. - if (containerA == containerB) { - if (offsetA == offsetB) - return 0; // equal - - if (offsetA < offsetB) - return -1; // before - - return 1; // after - } - - // In the second case a child node C of the container of A is an ancestor - // container of B. In this case, A is before B if the offset of A is less than or - // equal to the index of the child node C and A is after B otherwise. - c = containerB; - while (c && c.parentNode != containerA) - c = c.parentNode; - - if (c) { - offsetC = 0; - n = containerA.firstChild; - - while (n != c && offsetC < offsetA) { - offsetC++; - n = n.nextSibling; - } - - if (offsetA <= offsetC) - return -1; // before - - return 1; // after - } - - // In the third case a child node C of the container of B is an ancestor container - // of A. In this case, A is before B if the index of the child node C is less than - // the offset of B and A is after B otherwise. - c = containerA; - while (c && c.parentNode != containerB) { - c = c.parentNode; - } - - if (c) { - offsetC = 0; - n = containerB.firstChild; - - while (n != c && offsetC < offsetB) { - offsetC++; - n = n.nextSibling; - } - - if (offsetC < offsetB) - return -1; // before - - return 1; // after - } - - // In the fourth case, none of three other cases hold: the containers of A and B - // are siblings or descendants of sibling nodes. In this case, A is before B if - // the container of A is before the container of B in a pre-order traversal of the - // Ranges' context tree and A is after B otherwise. - cmnRoot = dom.findCommonAncestor(containerA, containerB); - childA = containerA; - - while (childA && childA.parentNode != cmnRoot) - childA = childA.parentNode; - - if (!childA) - childA = cmnRoot; - - childB = containerB; - while (childB && childB.parentNode != cmnRoot) - childB = childB.parentNode; - - if (!childB) - childB = cmnRoot; - - if (childA == childB) - return 0; // equal - - n = cmnRoot.firstChild; - while (n) { - if (n == childA) - return -1; // before - - if (n == childB) - return 1; // after - - n = n.nextSibling; - } - }; - - function _setEndPoint(st, n, o) { - var ec, sc; - - if (st) { - t[START_CONTAINER] = n; - t[START_OFFSET] = o; - } else { - t[END_CONTAINER] = n; - t[END_OFFSET] = o; - } - - // If one boundary-point of a Range is set to have a root container - // other than the current one for the Range, the Range is collapsed to - // the new position. This enforces the restriction that both boundary- - // points of a Range must have the same root container. - ec = t[END_CONTAINER]; - while (ec.parentNode) - ec = ec.parentNode; - - sc = t[START_CONTAINER]; - while (sc.parentNode) - sc = sc.parentNode; - - if (sc == ec) { - // The start position of a Range is guaranteed to never be after the - // end position. To enforce this restriction, if the start is set to - // be at a position after the end, the Range is collapsed to that - // position. - if (_compareBoundaryPoints(t[START_CONTAINER], t[START_OFFSET], t[END_CONTAINER], t[END_OFFSET]) > 0) - t.collapse(st); - } else - t.collapse(st); - - t.collapsed = _isCollapsed(); - t.commonAncestorContainer = dom.findCommonAncestor(t[START_CONTAINER], t[END_CONTAINER]); - }; - - function _traverse(how) { - var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep; - - if (t[START_CONTAINER] == t[END_CONTAINER]) - return _traverseSameContainer(how); - - for (c = t[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { - if (p == t[START_CONTAINER]) - return _traverseCommonStartContainer(c, how); - - ++endContainerDepth; - } - - for (c = t[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { - if (p == t[END_CONTAINER]) - return _traverseCommonEndContainer(c, how); - - ++startContainerDepth; - } - - depthDiff = startContainerDepth - endContainerDepth; - - startNode = t[START_CONTAINER]; - while (depthDiff > 0) { - startNode = startNode.parentNode; - depthDiff--; - } - - endNode = t[END_CONTAINER]; - while (depthDiff < 0) { - endNode = endNode.parentNode; - depthDiff++; - } - - // ascend the ancestor hierarchy until we have a common parent. - for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) { - startNode = sp; - endNode = ep; - } - - return _traverseCommonAncestors(startNode, endNode, how); - }; - - function _traverseSameContainer(how) { - var frag, s, sub, n, cnt, sibling, xferNode; - - if (how != DELETE) - frag = doc.createDocumentFragment(); - - // If selection is empty, just return the fragment - if (t[START_OFFSET] == t[END_OFFSET]) - return frag; - - // Text node needs special case handling - if (t[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) { - // get the substring - s = t[START_CONTAINER].nodeValue; - sub = s.substring(t[START_OFFSET], t[END_OFFSET]); - - // set the original text node to its new value - if (how != CLONE) { - t[START_CONTAINER].deleteData(t[START_OFFSET], t[END_OFFSET] - t[START_OFFSET]); - - // Nothing is partially selected, so collapse to start point - t.collapse(TRUE); - } - - if (how == DELETE) - return; - - frag.appendChild(doc.createTextNode(sub)); - return frag; - } - - // Copy nodes between the start/end offsets. - n = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]); - cnt = t[END_OFFSET] - t[START_OFFSET]; - - while (cnt > 0) { - sibling = n.nextSibling; - xferNode = _traverseFullySelected(n, how); - - if (frag) - frag.appendChild( xferNode ); - - --cnt; - n = sibling; - } - - // Nothing is partially selected, so collapse to start point - if (how != CLONE) - t.collapse(TRUE); - - return frag; - }; - - function _traverseCommonStartContainer(endAncestor, how) { - var frag, n, endIdx, cnt, sibling, xferNode; - - if (how != DELETE) - frag = doc.createDocumentFragment(); - - n = _traverseRightBoundary(endAncestor, how); - - if (frag) - frag.appendChild(n); - - endIdx = nodeIndex(endAncestor); - cnt = endIdx - t[START_OFFSET]; - - if (cnt <= 0) { - // Collapse to just before the endAncestor, which - // is partially selected. - if (how != CLONE) { - t.setEndBefore(endAncestor); - t.collapse(FALSE); - } - - return frag; - } - - n = endAncestor.previousSibling; - while (cnt > 0) { - sibling = n.previousSibling; - xferNode = _traverseFullySelected(n, how); - - if (frag) - frag.insertBefore(xferNode, frag.firstChild); - - --cnt; - n = sibling; - } - - // Collapse to just before the endAncestor, which - // is partially selected. - if (how != CLONE) { - t.setEndBefore(endAncestor); - t.collapse(FALSE); - } - - return frag; - }; - - function _traverseCommonEndContainer(startAncestor, how) { - var frag, startIdx, n, cnt, sibling, xferNode; - - if (how != DELETE) - frag = doc.createDocumentFragment(); - - n = _traverseLeftBoundary(startAncestor, how); - if (frag) - frag.appendChild(n); - - startIdx = nodeIndex(startAncestor); - ++startIdx; // Because we already traversed it - - cnt = t[END_OFFSET] - startIdx; - n = startAncestor.nextSibling; - while (cnt > 0) { - sibling = n.nextSibling; - xferNode = _traverseFullySelected(n, how); - - if (frag) - frag.appendChild(xferNode); - - --cnt; - n = sibling; - } - - if (how != CLONE) { - t.setStartAfter(startAncestor); - t.collapse(TRUE); - } - - return frag; - }; - - function _traverseCommonAncestors(startAncestor, endAncestor, how) { - var n, frag, commonParent, startOffset, endOffset, cnt, sibling, nextSibling; - - if (how != DELETE) - frag = doc.createDocumentFragment(); - - n = _traverseLeftBoundary(startAncestor, how); - if (frag) - frag.appendChild(n); - - commonParent = startAncestor.parentNode; - startOffset = nodeIndex(startAncestor); - endOffset = nodeIndex(endAncestor); - ++startOffset; - - cnt = endOffset - startOffset; - sibling = startAncestor.nextSibling; - - while (cnt > 0) { - nextSibling = sibling.nextSibling; - n = _traverseFullySelected(sibling, how); - - if (frag) - frag.appendChild(n); - - sibling = nextSibling; - --cnt; - } - - n = _traverseRightBoundary(endAncestor, how); - - if (frag) - frag.appendChild(n); - - if (how != CLONE) { - t.setStartAfter(startAncestor); - t.collapse(TRUE); - } - - return frag; - }; - - function _traverseRightBoundary(root, how) { - var next = _getSelectedNode(t[END_CONTAINER], t[END_OFFSET] - 1), parent, clonedParent, prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != t[END_CONTAINER]; - - if (next == root) - return _traverseNode(next, isFullySelected, FALSE, how); - - parent = next.parentNode; - clonedParent = _traverseNode(parent, FALSE, FALSE, how); - - while (parent) { - while (next) { - prevSibling = next.previousSibling; - clonedChild = _traverseNode(next, isFullySelected, FALSE, how); - - if (how != DELETE) - clonedParent.insertBefore(clonedChild, clonedParent.firstChild); - - isFullySelected = TRUE; - next = prevSibling; - } - - if (parent == root) - return clonedParent; - - next = parent.previousSibling; - parent = parent.parentNode; - - clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how); - - if (how != DELETE) - clonedGrandParent.appendChild(clonedParent); - - clonedParent = clonedGrandParent; - } - }; - - function _traverseLeftBoundary(root, how) { - var next = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]), isFullySelected = next != t[START_CONTAINER], parent, clonedParent, nextSibling, clonedChild, clonedGrandParent; - - if (next == root) - return _traverseNode(next, isFullySelected, TRUE, how); - - parent = next.parentNode; - clonedParent = _traverseNode(parent, FALSE, TRUE, how); - - while (parent) { - while (next) { - nextSibling = next.nextSibling; - clonedChild = _traverseNode(next, isFullySelected, TRUE, how); - - if (how != DELETE) - clonedParent.appendChild(clonedChild); - - isFullySelected = TRUE; - next = nextSibling; - } - - if (parent == root) - return clonedParent; - - next = parent.nextSibling; - parent = parent.parentNode; - - clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how); - - if (how != DELETE) - clonedGrandParent.appendChild(clonedParent); - - clonedParent = clonedGrandParent; - } - }; - - function _traverseNode(n, isFullySelected, isLeft, how) { - var txtValue, newNodeValue, oldNodeValue, offset, newNode; - - if (isFullySelected) - return _traverseFullySelected(n, how); - - if (n.nodeType == 3 /* TEXT_NODE */) { - txtValue = n.nodeValue; - - if (isLeft) { - offset = t[START_OFFSET]; - newNodeValue = txtValue.substring(offset); - oldNodeValue = txtValue.substring(0, offset); - } else { - offset = t[END_OFFSET]; - newNodeValue = txtValue.substring(0, offset); - oldNodeValue = txtValue.substring(offset); - } - - if (how != CLONE) - n.nodeValue = oldNodeValue; - - if (how == DELETE) - return; - - newNode = n.cloneNode(FALSE); - newNode.nodeValue = newNodeValue; - - return newNode; - } - - if (how == DELETE) - return; - - return n.cloneNode(FALSE); - }; - - function _traverseFullySelected(n, how) { - if (how != DELETE) - return how == CLONE ? n.cloneNode(TRUE) : n; - - n.parentNode.removeChild(n); - }; - }; - - ns.Range = Range; -})(tinymce.dom); - -(function() { - function Selection(selection) { - var self = this, dom = selection.dom, TRUE = true, FALSE = false; - - function getPosition(rng, start) { - var checkRng, startIndex = 0, endIndex, inside, - children, child, offset, index, position = -1, parent; - - // Setup test range, collapse it and get the parent - checkRng = rng.duplicate(); - checkRng.collapse(start); - parent = checkRng.parentElement(); - - // Check if the selection is within the right document - if (parent.ownerDocument !== selection.dom.doc) - return; - - // IE will report non editable elements as it's parent so look for an editable one - while (parent.contentEditable === "false") { - parent = parent.parentNode; - } - - // If parent doesn't have any children then return that we are inside the element - if (!parent.hasChildNodes()) { - return {node : parent, inside : 1}; - } - - // Setup node list and endIndex - children = parent.children; - endIndex = children.length - 1; - - // Perform a binary search for the position - while (startIndex <= endIndex) { - index = Math.floor((startIndex + endIndex) / 2); - - // Move selection to node and compare the ranges - child = children[index]; - checkRng.moveToElementText(child); - position = checkRng.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', rng); - - // Before/after or an exact match - if (position > 0) { - endIndex = index - 1; - } else if (position < 0) { - startIndex = index + 1; - } else { - return {node : child}; - } - } - - // Check if child position is before or we didn't find a position - if (position < 0) { - // No element child was found use the parent element and the offset inside that - if (!child) { - checkRng.moveToElementText(parent); - checkRng.collapse(true); - child = parent; - inside = true; - } else - checkRng.collapse(false); - - checkRng.setEndPoint(start ? 'EndToStart' : 'EndToEnd', rng); - - // Fix for edge case:
    ..
    ab|c
    - if (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) > 0) { - checkRng = rng.duplicate(); - checkRng.collapse(start); - - offset = -1; - while (parent == checkRng.parentElement()) { - if (checkRng.move('character', -1) == 0) - break; - - offset++; - } - } - - offset = offset || checkRng.text.replace('\r\n', ' ').length; - } else { - // Child position is after the selection endpoint - checkRng.collapse(true); - checkRng.setEndPoint(start ? 'StartToStart' : 'StartToEnd', rng); - - // Get the length of the text to find where the endpoint is relative to it's container - offset = checkRng.text.replace('\r\n', ' ').length; - } - - return {node : child, position : position, offset : offset, inside : inside}; - }; - - // Returns a W3C DOM compatible range object by using the IE Range API - function getRange() { - var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark, fail; - - // If selection is outside the current document just return an empty range - element = ieRange.item ? ieRange.item(0) : ieRange.parentElement(); - if (element.ownerDocument != dom.doc) - return domRange; - - collapsed = selection.isCollapsed(); - - // Handle control selection - if (ieRange.item) { - domRange.setStart(element.parentNode, dom.nodeIndex(element)); - domRange.setEnd(domRange.startContainer, domRange.startOffset + 1); - - return domRange; - } - - function findEndPoint(start) { - var endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue; - - container = endPoint.node; - offset = endPoint.offset; - - if (endPoint.inside && !container.hasChildNodes()) { - domRange[start ? 'setStart' : 'setEnd'](container, 0); - return; - } - - if (offset === undef) { - domRange[start ? 'setStartBefore' : 'setEndAfter'](container); - return; - } - - if (endPoint.position < 0) { - sibling = endPoint.inside ? container.firstChild : container.nextSibling; - - if (!sibling) { - domRange[start ? 'setStartAfter' : 'setEndAfter'](container); - return; - } - - if (!offset) { - if (sibling.nodeType == 3) - domRange[start ? 'setStart' : 'setEnd'](sibling, 0); - else - domRange[start ? 'setStartBefore' : 'setEndBefore'](sibling); - - return; - } - - // Find the text node and offset - while (sibling) { - nodeValue = sibling.nodeValue; - textNodeOffset += nodeValue.length; - - // We are at or passed the position we where looking for - if (textNodeOffset >= offset) { - container = sibling; - textNodeOffset -= offset; - textNodeOffset = nodeValue.length - textNodeOffset; - break; - } - - sibling = sibling.nextSibling; - } - } else { - // Find the text node and offset - sibling = container.previousSibling; - - if (!sibling) - return domRange[start ? 'setStartBefore' : 'setEndBefore'](container); - - // If there isn't any text to loop then use the first position - if (!offset) { - if (container.nodeType == 3) - domRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length); - else - domRange[start ? 'setStartAfter' : 'setEndAfter'](sibling); - - return; - } - - while (sibling) { - textNodeOffset += sibling.nodeValue.length; - - // We are at or passed the position we where looking for - if (textNodeOffset >= offset) { - container = sibling; - textNodeOffset -= offset; - break; - } - - sibling = sibling.previousSibling; - } - } - - domRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset); - }; - - try { - // Find start point - findEndPoint(true); - - // Find end point if needed - if (!collapsed) - findEndPoint(); - } catch (ex) { - // IE has a nasty bug where text nodes might throw "invalid argument" when you - // access the nodeValue or other properties of text nodes. This seems to happend when - // text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it. - if (ex.number == -2147024809) { - // Get the current selection - bookmark = self.getBookmark(2); - - // Get start element - tmpRange = ieRange.duplicate(); - tmpRange.collapse(true); - element = tmpRange.parentElement(); - - // Get end element - if (!collapsed) { - tmpRange = ieRange.duplicate(); - tmpRange.collapse(false); - element2 = tmpRange.parentElement(); - element2.innerHTML = element2.innerHTML; - } - - // Remove the broken elements - element.innerHTML = element.innerHTML; - - // Restore the selection - self.moveToBookmark(bookmark); - - // Since the range has moved we need to re-get it - ieRange = selection.getRng(); - - // Find start point - findEndPoint(true); - - // Find end point if needed - if (!collapsed) - findEndPoint(); - } else - throw ex; // Throw other errors - } - - return domRange; - }; - - this.getBookmark = function(type) { - var rng = selection.getRng(), start, end, bookmark = {}; - - function getIndexes(node) { - var node, parent, root, children, i, indexes = []; - - parent = node.parentNode; - root = dom.getRoot().parentNode; - - while (parent != root && parent.nodeType !== 9) { - children = parent.children; - - i = children.length; - while (i--) { - if (node === children[i]) { - indexes.push(i); - break; - } - } - - node = parent; - parent = parent.parentNode; - } - - return indexes; - }; - - function getBookmarkEndPoint(start) { - var position; - - position = getPosition(rng, start); - if (position) { - return { - position : position.position, - offset : position.offset, - indexes : getIndexes(position.node), - inside : position.inside - }; - } - }; - - // Non ubstructive bookmark - if (type === 2) { - // Handle text selection - if (!rng.item) { - bookmark.start = getBookmarkEndPoint(true); - - if (!selection.isCollapsed()) - bookmark.end = getBookmarkEndPoint(); - } else - bookmark.start = {ctrl : true, indexes : getIndexes(rng.item(0))}; - } - - return bookmark; - }; - - this.moveToBookmark = function(bookmark) { - var rng, body = dom.doc.body; - - function resolveIndexes(indexes) { - var node, i, idx, children; - - node = dom.getRoot(); - for (i = indexes.length - 1; i >= 0; i--) { - children = node.children; - idx = indexes[i]; - - if (idx <= children.length - 1) { - node = children[idx]; - } - } - - return node; - }; - - function setBookmarkEndPoint(start) { - var endPoint = bookmark[start ? 'start' : 'end'], moveLeft, moveRng, undef; - - if (endPoint) { - moveLeft = endPoint.position > 0; - - moveRng = body.createTextRange(); - moveRng.moveToElementText(resolveIndexes(endPoint.indexes)); - - offset = endPoint.offset; - if (offset !== undef) { - moveRng.collapse(endPoint.inside || moveLeft); - moveRng.moveStart('character', moveLeft ? -offset : offset); - } else - moveRng.collapse(start); - - rng.setEndPoint(start ? 'StartToStart' : 'EndToStart', moveRng); - - if (start) - rng.collapse(true); - } - }; - - if (bookmark.start) { - if (bookmark.start.ctrl) { - rng = body.createControlRange(); - rng.addElement(resolveIndexes(bookmark.start.indexes)); - rng.select(); - } else { - rng = body.createTextRange(); - setBookmarkEndPoint(true); - setBookmarkEndPoint(); - rng.select(); - } - } - }; - - this.addRange = function(rng) { - var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, doc = selection.dom.doc, body = doc.body; - - function setEndPoint(start) { - var container, offset, marker, tmpRng, nodes; - - marker = dom.create('a'); - container = start ? startContainer : endContainer; - offset = start ? startOffset : endOffset; - tmpRng = ieRng.duplicate(); - - if (container == doc || container == doc.documentElement) { - container = body; - offset = 0; - } - - if (container.nodeType == 3) { - container.parentNode.insertBefore(marker, container); - tmpRng.moveToElementText(marker); - tmpRng.moveStart('character', offset); - dom.remove(marker); - ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); - } else { - nodes = container.childNodes; - - if (nodes.length) { - if (offset >= nodes.length) { - dom.insertAfter(marker, nodes[nodes.length - 1]); - } else { - container.insertBefore(marker, nodes[offset]); - } - - tmpRng.moveToElementText(marker); - } else { - // Empty node selection for example
    |
    - marker = doc.createTextNode('\uFEFF'); - container.appendChild(marker); - tmpRng.moveToElementText(marker.parentNode); - tmpRng.collapse(TRUE); - } - - ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); - dom.remove(marker); - } - } - - // Setup some shorter versions - startContainer = rng.startContainer; - startOffset = rng.startOffset; - endContainer = rng.endContainer; - endOffset = rng.endOffset; - ieRng = body.createTextRange(); - - // If single element selection then try making a control selection out of it - if (startContainer == endContainer && startContainer.nodeType == 1 && startOffset == endOffset - 1) { - if (startOffset == endOffset - 1) { - try { - ctrlRng = body.createControlRange(); - ctrlRng.addElement(startContainer.childNodes[startOffset]); - ctrlRng.select(); - return; - } catch (ex) { - // Ignore - } - } - } - - // Set start/end point of selection - setEndPoint(true); - setEndPoint(); - - // Select the new range and scroll it into view - ieRng.select(); - }; - - // Expose range method - this.getRangeAt = getRange; - }; - - // Expose the selection object - tinymce.dom.TridentSelection = Selection; -})(); - - -(function(tinymce) { - // Shorten names - var each = tinymce.each, DOM = tinymce.DOM, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, Event; - - tinymce.create('tinymce.dom.EventUtils', { - EventUtils : function() { - this.inits = []; - this.events = []; - }, - - add : function(o, n, f, s) { - var cb, t = this, el = t.events, r; - - if (n instanceof Array) { - r = []; - - each(n, function(n) { - r.push(t.add(o, n, f, s)); - }); - - return r; - } - - // Handle array - if (o && o.hasOwnProperty && o instanceof Array) { - r = []; - - each(o, function(o) { - o = DOM.get(o); - r.push(t.add(o, n, f, s)); - }); - - return r; - } - - o = DOM.get(o); - - if (!o) - return; - - // Setup event callback - cb = function(e) { - // Is all events disabled - if (t.disabled) - return; - - e = e || window.event; - - // Patch in target, preventDefault and stopPropagation in IE it's W3C valid - if (e && isIE) { - if (!e.target) - e.target = e.srcElement; - - // Patch in preventDefault, stopPropagation methods for W3C compatibility - tinymce.extend(e, t._stoppers); - } - - if (!s) - return f(e); - - return f.call(s, e); - }; - - if (n == 'unload') { - tinymce.unloads.unshift({func : cb}); - return cb; - } - - if (n == 'init') { - if (t.domLoaded) - cb(); - else - t.inits.push(cb); - - return cb; - } - - // Store away listener reference - el.push({ - obj : o, - name : n, - func : f, - cfunc : cb, - scope : s - }); - - t._add(o, n, cb); - - return f; - }, - - remove : function(o, n, f) { - var t = this, a = t.events, s = false, r; - - // Handle array - if (o && o.hasOwnProperty && o instanceof Array) { - r = []; - - each(o, function(o) { - o = DOM.get(o); - r.push(t.remove(o, n, f)); - }); - - return r; - } - - o = DOM.get(o); - - each(a, function(e, i) { - if (e.obj == o && e.name == n && (!f || (e.func == f || e.cfunc == f))) { - a.splice(i, 1); - t._remove(o, n, e.cfunc); - s = true; - return false; - } - }); - - return s; - }, - - clear : function(o) { - var t = this, a = t.events, i, e; - - if (o) { - o = DOM.get(o); - - for (i = a.length - 1; i >= 0; i--) { - e = a[i]; - - if (e.obj === o) { - t._remove(e.obj, e.name, e.cfunc); - e.obj = e.cfunc = null; - a.splice(i, 1); - } - } - } - }, - - cancel : function(e) { - if (!e) - return false; - - this.stop(e); - - return this.prevent(e); - }, - - stop : function(e) { - if (e.stopPropagation) - e.stopPropagation(); - else - e.cancelBubble = true; - - return false; - }, - - prevent : function(e) { - if (e.preventDefault) - e.preventDefault(); - else - e.returnValue = false; - - return false; - }, - - destroy : function() { - var t = this; - - each(t.events, function(e, i) { - t._remove(e.obj, e.name, e.cfunc); - e.obj = e.cfunc = null; - }); - - t.events = []; - t = null; - }, - - _add : function(o, n, f) { - if (o.attachEvent) - o.attachEvent('on' + n, f); - else if (o.addEventListener) - o.addEventListener(n, f, false); - else - o['on' + n] = f; - }, - - _remove : function(o, n, f) { - if (o) { - try { - if (o.detachEvent) - o.detachEvent('on' + n, f); - else if (o.removeEventListener) - o.removeEventListener(n, f, false); - else - o['on' + n] = null; - } catch (ex) { - // Might fail with permission denined on IE so we just ignore that - } - } - }, - - _pageInit : function(win) { - var t = this; - - // Keep it from running more than once - if (t.domLoaded) - return; - - t.domLoaded = true; - - each(t.inits, function(c) { - c(); - }); - - t.inits = []; - }, - - _wait : function(win) { - var t = this, doc = win.document; - - // No need since the document is already loaded - if (win.tinyMCE_GZ && tinyMCE_GZ.loaded) { - t.domLoaded = 1; - return; - } - - // When loaded asynchronously, the DOM Content may already be loaded - if (doc.readyState === 'complete') { - t._pageInit(win); - return; - } - - // Use IE method - if (doc.attachEvent) { - doc.attachEvent("onreadystatechange", function() { - if (doc.readyState === "complete") { - doc.detachEvent("onreadystatechange", arguments.callee); - t._pageInit(win); - } - }); - - if (doc.documentElement.doScroll && win == win.top) { - (function() { - if (t.domLoaded) - return; - - try { - // If IE is used, use the trick by Diego Perini licensed under MIT by request to the author. - // http://javascript.nwbox.com/IEContentLoaded/ - doc.documentElement.doScroll("left"); - } catch (ex) { - setTimeout(arguments.callee, 0); - return; - } - - t._pageInit(win); - })(); - } - } else if (doc.addEventListener) { - t._add(win, 'DOMContentLoaded', function() { - t._pageInit(win); - }); - } - - t._add(win, 'load', function() { - t._pageInit(win); - }); - }, - - _stoppers : { - preventDefault : function() { - this.returnValue = false; - }, - - stopPropagation : function() { - this.cancelBubble = true; - } - } - }); - - Event = tinymce.dom.Event = new tinymce.dom.EventUtils(); - - // Dispatch DOM content loaded event for IE and Safari - Event._wait(window); - - tinymce.addUnload(function() { - Event.destroy(); - }); -})(tinymce); - -(function(tinymce) { - tinymce.dom.Element = function(id, settings) { - var t = this, dom, el; - - t.settings = settings = settings || {}; - t.id = id; - t.dom = dom = settings.dom || tinymce.DOM; - - // Only IE leaks DOM references, this is a lot faster - if (!tinymce.isIE) - el = dom.get(t.id); - - tinymce.each( - ('getPos,getRect,getParent,add,setStyle,getStyle,setStyles,' + - 'setAttrib,setAttribs,getAttrib,addClass,removeClass,' + - 'hasClass,getOuterHTML,setOuterHTML,remove,show,hide,' + - 'isHidden,setHTML,get').split(/,/) - , function(k) { - t[k] = function() { - var a = [id], i; - - for (i = 0; i < arguments.length; i++) - a.push(arguments[i]); - - a = dom[k].apply(dom, a); - t.update(k); - - return a; - }; - }); - - tinymce.extend(t, { - on : function(n, f, s) { - return tinymce.dom.Event.add(t.id, n, f, s); - }, - - getXY : function() { - return { - x : parseInt(t.getStyle('left')), - y : parseInt(t.getStyle('top')) - }; - }, - - getSize : function() { - var n = dom.get(t.id); - - return { - w : parseInt(t.getStyle('width') || n.clientWidth), - h : parseInt(t.getStyle('height') || n.clientHeight) - }; - }, - - moveTo : function(x, y) { - t.setStyles({left : x, top : y}); - }, - - moveBy : function(x, y) { - var p = t.getXY(); - - t.moveTo(p.x + x, p.y + y); - }, - - resizeTo : function(w, h) { - t.setStyles({width : w, height : h}); - }, - - resizeBy : function(w, h) { - var s = t.getSize(); - - t.resizeTo(s.w + w, s.h + h); - }, - - update : function(k) { - var b; - - if (tinymce.isIE6 && settings.blocker) { - k = k || ''; - - // Ignore getters - if (k.indexOf('get') === 0 || k.indexOf('has') === 0 || k.indexOf('is') === 0) - return; - - // Remove blocker on remove - if (k == 'remove') { - dom.remove(t.blocker); - return; - } - - if (!t.blocker) { - t.blocker = dom.uniqueId(); - b = dom.add(settings.container || dom.getRoot(), 'iframe', {id : t.blocker, style : 'position:absolute;', frameBorder : 0, src : 'javascript:""'}); - dom.setStyle(b, 'opacity', 0); - } else - b = dom.get(t.blocker); - - dom.setStyles(b, { - left : t.getStyle('left', 1), - top : t.getStyle('top', 1), - width : t.getStyle('width', 1), - height : t.getStyle('height', 1), - display : t.getStyle('display', 1), - zIndex : parseInt(t.getStyle('zIndex', 1) || 0) - 1 - }); - } - } - }); - }; -})(tinymce); - -(function(tinymce) { - function trimNl(s) { - return s.replace(/[\n\r]+/g, ''); - }; - - // Shorten names - var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each; - - tinymce.create('tinymce.dom.Selection', { - Selection : function(dom, win, serializer) { - var t = this; - - t.dom = dom; - t.win = win; - t.serializer = serializer; - - // Add events - each([ - 'onBeforeSetContent', - - 'onBeforeGetContent', - - 'onSetContent', - - 'onGetContent' - ], function(e) { - t[e] = new tinymce.util.Dispatcher(t); - }); - - // No W3C Range support - if (!t.win.getSelection) - t.tridentSel = new tinymce.dom.TridentSelection(t); - - if (tinymce.isIE && dom.boxModel) - this._fixIESelection(); - - // Prevent leaks - tinymce.addUnload(t.destroy, t); - }, - - setCursorLocation: function(node, offset) { - var t = this; var r = t.dom.createRng(); - r.setStart(node, offset); - r.setEnd(node, offset); - t.setRng(r); - t.collapse(false); - }, - getContent : function(s) { - var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n; - - s = s || {}; - wb = wa = ''; - s.get = true; - s.format = s.format || 'html'; - s.forced_root_block = ''; - t.onBeforeGetContent.dispatch(t, s); - - if (s.format == 'text') - return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : '')); - - if (r.cloneContents) { - n = r.cloneContents(); - - if (n) - e.appendChild(n); - } else if (is(r.item) || is(r.htmlText)) { - // IE will produce invalid markup if elements are present that - // it doesn't understand like custom elements or HTML5 elements. - // Adding a BR in front of the contents and then remoiving it seems to fix it though. - e.innerHTML = '
    ' + (r.item ? r.item(0).outerHTML : r.htmlText); - e.removeChild(e.firstChild); - } else - e.innerHTML = r.toString(); - - // Keep whitespace before and after - if (/^\s/.test(e.innerHTML)) - wb = ' '; - - if (/\s+$/.test(e.innerHTML)) - wa = ' '; - - s.getInner = true; - - s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa; - t.onGetContent.dispatch(t, s); - - return s.content; - }, - - setContent : function(content, args) { - var self = this, rng = self.getRng(), caretNode, doc = self.win.document, frag, temp; - - args = args || {format : 'html'}; - args.set = true; - content = args.content = content; - - // Dispatch before set content event - if (!args.no_events) - self.onBeforeSetContent.dispatch(self, args); - - content = args.content; - - if (rng.insertNode) { - // Make caret marker since insertNode places the caret in the beginning of text after insert - content += '_'; - - // Delete and insert new node - if (rng.startContainer == doc && rng.endContainer == doc) { - // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents - doc.body.innerHTML = content; - } else { - rng.deleteContents(); - - if (doc.body.childNodes.length == 0) { - doc.body.innerHTML = content; - } else { - // createContextualFragment doesn't exists in IE 9 DOMRanges - if (rng.createContextualFragment) { - rng.insertNode(rng.createContextualFragment(content)); - } else { - // Fake createContextualFragment call in IE 9 - frag = doc.createDocumentFragment(); - temp = doc.createElement('div'); - - frag.appendChild(temp); - temp.outerHTML = content; - - rng.insertNode(frag); - } - } - } - - // Move to caret marker - caretNode = self.dom.get('__caret'); - - // Make sure we wrap it compleatly, Opera fails with a simple select call - rng = doc.createRange(); - rng.setStartBefore(caretNode); - rng.setEndBefore(caretNode); - self.setRng(rng); - - // Remove the caret position - self.dom.remove('__caret'); - - try { - self.setRng(rng); - } catch (ex) { - // Might fail on Opera for some odd reason - } - } else { - if (rng.item) { - // Delete content and get caret text selection - doc.execCommand('Delete', false, null); - rng = self.getRng(); - } - - // Explorer removes spaces from the beginning of pasted contents - if (/^\s+/.test(content)) { - rng.pasteHTML('_' + content); - self.dom.remove('__mce_tmp'); - } else - rng.pasteHTML(content); - } - - // Dispatch set content event - if (!args.no_events) - self.onSetContent.dispatch(self, args); - }, - - getStart : function() { - var rng = this.getRng(), startElement, parentElement, checkRng, node; - - if (rng.duplicate || rng.item) { - // Control selection, return first item - if (rng.item) - return rng.item(0); - - // Get start element - checkRng = rng.duplicate(); - checkRng.collapse(1); - startElement = checkRng.parentElement(); - - // Check if range parent is inside the start element, then return the inner parent element - // This will fix issues when a single element is selected, IE would otherwise return the wrong start element - parentElement = node = rng.parentElement(); - while (node = node.parentNode) { - if (node == startElement) { - startElement = parentElement; - break; - } - } - - return startElement; - } else { - startElement = rng.startContainer; - - if (startElement.nodeType == 1 && startElement.hasChildNodes()) - startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)]; - - if (startElement && startElement.nodeType == 3) - return startElement.parentNode; - - return startElement; - } - }, - - getEnd : function() { - var t = this, r = t.getRng(), e, eo; - - if (r.duplicate || r.item) { - if (r.item) - return r.item(0); - - r = r.duplicate(); - r.collapse(0); - e = r.parentElement(); - - if (e && e.nodeName == 'BODY') - return e.lastChild || e; - - return e; - } else { - e = r.endContainer; - eo = r.endOffset; - - if (e.nodeType == 1 && e.hasChildNodes()) - e = e.childNodes[eo > 0 ? eo - 1 : eo]; - - if (e && e.nodeType == 3) - return e.parentNode; - - return e; - } - }, - - getBookmark : function(type, normalized) { - var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, index, chr = '\uFEFF', styles; - - function findIndex(name, element) { - var index = 0; - - each(dom.select(name), function(node, i) { - if (node == element) - index = i; - }); - - return index; - }; - - if (type == 2) { - function getLocation() { - var rng = t.getRng(true), root = dom.getRoot(), bookmark = {}; - - function getPoint(rng, start) { - var container = rng[start ? 'startContainer' : 'endContainer'], - offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0; - - if (container.nodeType == 3) { - if (normalized) { - for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) - offset += node.nodeValue.length; - } - - point.push(offset); - } else { - childNodes = container.childNodes; - - if (offset >= childNodes.length && childNodes.length) { - after = 1; - offset = Math.max(0, childNodes.length - 1); - } - - point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after); - } - - for (; container && container != root; container = container.parentNode) - point.push(t.dom.nodeIndex(container, normalized)); - - return point; - }; - - bookmark.start = getPoint(rng, true); - - if (!t.isCollapsed()) - bookmark.end = getPoint(rng); - - return bookmark; - }; - - if (t.tridentSel) - return t.tridentSel.getBookmark(type); - - return getLocation(); - } - - // Handle simple range - if (type) - return {rng : t.getRng()}; - - rng = t.getRng(); - id = dom.uniqueId(); - collapsed = tinyMCE.activeEditor.selection.isCollapsed(); - styles = 'overflow:hidden;line-height:0px'; - - // Explorer method - if (rng.duplicate || rng.item) { - // Text selection - if (!rng.item) { - rng2 = rng.duplicate(); - - try { - // Insert start marker - rng.collapse(); - rng.pasteHTML('' + chr + ''); - - // Insert end marker - if (!collapsed) { - rng2.collapse(false); - - // Detect the empty space after block elements in IE and move the end back one character

    ] becomes

    ]

    - rng.moveToElementText(rng2.parentElement()); - if (rng.compareEndPoints('StartToEnd', rng2) == 0) - rng2.move('character', -1); - - rng2.pasteHTML('' + chr + ''); - } - } catch (ex) { - // IE might throw unspecified error so lets ignore it - return null; - } - } else { - // Control selection - element = rng.item(0); - name = element.nodeName; - - return {name : name, index : findIndex(name, element)}; - } - } else { - element = t.getNode(); - name = element.nodeName; - if (name == 'IMG') - return {name : name, index : findIndex(name, element)}; - - // W3C method - rng2 = rng.cloneRange(); - - // Insert end marker - if (!collapsed) { - rng2.collapse(false); - rng2.insertNode(dom.create('span', {'data-mce-type' : "bookmark", id : id + '_end', style : styles}, chr)); - } - - rng.collapse(true); - rng.insertNode(dom.create('span', {'data-mce-type' : "bookmark", id : id + '_start', style : styles}, chr)); - } - - t.moveToBookmark({id : id, keep : 1}); - - return {id : id}; - }, - - moveToBookmark : function(bookmark) { - var t = this, dom = t.dom, marker1, marker2, rng, root, startContainer, endContainer, startOffset, endOffset; - - if (bookmark) { - if (bookmark.start) { - rng = dom.createRng(); - root = dom.getRoot(); - - function setEndPoint(start) { - var point = bookmark[start ? 'start' : 'end'], i, node, offset, children; - - if (point) { - offset = point[0]; - - // Find container node - for (node = root, i = point.length - 1; i >= 1; i--) { - children = node.childNodes; - - if (point[i] > children.length - 1) - return; - - node = children[point[i]]; - } - - // Move text offset to best suitable location - if (node.nodeType === 3) - offset = Math.min(point[0], node.nodeValue.length); - - // Move element offset to best suitable location - if (node.nodeType === 1) - offset = Math.min(point[0], node.childNodes.length); - - // Set offset within container node - if (start) - rng.setStart(node, offset); - else - rng.setEnd(node, offset); - } - - return true; - }; - - if (t.tridentSel) - return t.tridentSel.moveToBookmark(bookmark); - - if (setEndPoint(true) && setEndPoint()) { - t.setRng(rng); - } - } else if (bookmark.id) { - function restoreEndPoint(suffix) { - var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep; - - if (marker) { - node = marker.parentNode; - - if (suffix == 'start') { - if (!keep) { - idx = dom.nodeIndex(marker); - } else { - node = marker.firstChild; - idx = 1; - } - - startContainer = endContainer = node; - startOffset = endOffset = idx; - } else { - if (!keep) { - idx = dom.nodeIndex(marker); - } else { - node = marker.firstChild; - idx = 1; - } - - endContainer = node; - endOffset = idx; - } - - if (!keep) { - prev = marker.previousSibling; - next = marker.nextSibling; - - // Remove all marker text nodes - each(tinymce.grep(marker.childNodes), function(node) { - if (node.nodeType == 3) - node.nodeValue = node.nodeValue.replace(/\uFEFF/g, ''); - }); - - // Remove marker but keep children if for example contents where inserted into the marker - // Also remove duplicated instances of the marker for example by a split operation or by WebKit auto split on paste feature - while (marker = dom.get(bookmark.id + '_' + suffix)) - dom.remove(marker, 1); - - // If siblings are text nodes then merge them unless it's Opera since it some how removes the node - // and we are sniffing since adding a lot of detection code for a browser with 3% of the market isn't worth the effort. Sorry, Opera but it's just a fact - if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !tinymce.isOpera) { - idx = prev.nodeValue.length; - prev.appendData(next.nodeValue); - dom.remove(next); - - if (suffix == 'start') { - startContainer = endContainer = prev; - startOffset = endOffset = idx; - } else { - endContainer = prev; - endOffset = idx; - } - } - } - } - }; - - function addBogus(node) { - // Adds a bogus BR element for empty block elements or just a space on IE since it renders BR elements incorrectly - if (dom.isBlock(node) && !node.innerHTML) - node.innerHTML = !isIE ? '
    ' : ' '; - - return node; - }; - - // Restore start/end points - restoreEndPoint('start'); - restoreEndPoint('end'); - - if (startContainer) { - rng = dom.createRng(); - rng.setStart(addBogus(startContainer), startOffset); - rng.setEnd(addBogus(endContainer), endOffset); - t.setRng(rng); - } - } else if (bookmark.name) { - t.select(dom.select(bookmark.name)[bookmark.index]); - } else if (bookmark.rng) - t.setRng(bookmark.rng); - } - }, - - select : function(node, content) { - var t = this, dom = t.dom, rng = dom.createRng(), idx; - - if (node) { - idx = dom.nodeIndex(node); - rng.setStart(node.parentNode, idx); - rng.setEnd(node.parentNode, idx + 1); - - // Find first/last text node or BR element - if (content) { - function setPoint(node, start) { - var walker = new tinymce.dom.TreeWalker(node, node); - - do { - // Text node - if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { - if (start) - rng.setStart(node, 0); - else - rng.setEnd(node, node.nodeValue.length); - - return; - } - - // BR element - if (node.nodeName == 'BR') { - if (start) - rng.setStartBefore(node); - else - rng.setEndBefore(node); - - return; - } - } while (node = (start ? walker.next() : walker.prev())); - }; - - setPoint(node, 1); - setPoint(node); - } - - t.setRng(rng); - } - - return node; - }, - - isCollapsed : function() { - var t = this, r = t.getRng(), s = t.getSel(); - - if (!r || r.item) - return false; - - if (r.compareEndPoints) - return r.compareEndPoints('StartToEnd', r) === 0; - - return !s || r.collapsed; - }, - - collapse : function(to_start) { - var self = this, rng = self.getRng(), node; - - // Control range on IE - if (rng.item) { - node = rng.item(0); - rng = self.win.document.body.createTextRange(); - rng.moveToElementText(node); - } - - rng.collapse(!!to_start); - self.setRng(rng); - }, - - getSel : function() { - var t = this, w = this.win; - - return w.getSelection ? w.getSelection() : w.document.selection; - }, - - getRng : function(w3c) { - var t = this, s, r, elm, doc = t.win.document; - - // Found tridentSel object then we need to use that one - if (w3c && t.tridentSel) - return t.tridentSel.getRangeAt(0); - - try { - if (s = t.getSel()) - r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : doc.createRange()); - } catch (ex) { - // IE throws unspecified error here if TinyMCE is placed in a frame/iframe - } - - // We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet - if (tinymce.isIE && r && r.setStart && doc.selection.createRange().item) { - elm = doc.selection.createRange().item(0); - r = doc.createRange(); - r.setStartBefore(elm); - r.setEndAfter(elm); - } - - // No range found then create an empty one - // This can occur when the editor is placed in a hidden container element on Gecko - // Or on IE when there was an exception - if (!r) - r = doc.createRange ? doc.createRange() : doc.body.createTextRange(); - - if (t.selectedRange && t.explicitRange) { - if (r.compareBoundaryPoints(r.START_TO_START, t.selectedRange) === 0 && r.compareBoundaryPoints(r.END_TO_END, t.selectedRange) === 0) { - // Safari, Opera and Chrome only ever select text which causes the range to change. - // This lets us use the originally set range if the selection hasn't been changed by the user. - r = t.explicitRange; - } else { - t.selectedRange = null; - t.explicitRange = null; - } - } - - return r; - }, - - setRng : function(r) { - var s, t = this; - - if (!t.tridentSel) { - s = t.getSel(); - - if (s) { - t.explicitRange = r; - - try { - s.removeAllRanges(); - } catch (ex) { - // IE9 might throw errors here don't know why - } - - s.addRange(r); - // adding range isn't always successful so we need to check range count otherwise an exception can occur - t.selectedRange = s.rangeCount > 0 ? s.getRangeAt(0) : null; - } - } else { - // Is W3C Range - if (r.cloneRange) { - t.tridentSel.addRange(r); - return; - } - - // Is IE specific range - try { - r.select(); - } catch (ex) { - // Needed for some odd IE bug #1843306 - } - } - }, - - setNode : function(n) { - var t = this; - - t.setContent(t.dom.getOuterHTML(n)); - - return n; - }, - - getNode : function() { - var t = this, rng = t.getRng(), sel = t.getSel(), elm, start = rng.startContainer, end = rng.endContainer; - - // Range maybe lost after the editor is made visible again - if (!rng) - return t.dom.getRoot(); - - if (rng.setStart) { - elm = rng.commonAncestorContainer; - - // Handle selection a image or other control like element such as anchors - if (!rng.collapsed) { - if (rng.startContainer == rng.endContainer) { - if (rng.endOffset - rng.startOffset < 2) { - if (rng.startContainer.hasChildNodes()) - elm = rng.startContainer.childNodes[rng.startOffset]; - } - } - - // If the anchor node is a element instead of a text node then return this element - //if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1) - // return sel.anchorNode.childNodes[sel.anchorOffset]; - - // Handle cases where the selection is immediately wrapped around a node and return that node instead of it's parent. - // This happens when you double click an underlined word in FireFox. - if (start.nodeType === 3 && end.nodeType === 3) { - function skipEmptyTextNodes(n, forwards) { - var orig = n; - while (n && n.nodeType === 3 && n.length === 0) { - n = forwards ? n.nextSibling : n.previousSibling; - } - return n || orig; - } - if (start.length === rng.startOffset) { - start = skipEmptyTextNodes(start.nextSibling, true); - } else { - start = start.parentNode; - } - if (rng.endOffset === 0) { - end = skipEmptyTextNodes(end.previousSibling, false); - } else { - end = end.parentNode; - } - - if (start && start === end) - return start; - } - } - - if (elm && elm.nodeType == 3) - return elm.parentNode; - - return elm; - } - - return rng.item ? rng.item(0) : rng.parentElement(); - }, - - getSelectedBlocks : function(st, en) { - var t = this, dom = t.dom, sb, eb, n, bl = []; - - sb = dom.getParent(st || t.getStart(), dom.isBlock); - eb = dom.getParent(en || t.getEnd(), dom.isBlock); - - if (sb) - bl.push(sb); - - if (sb && eb && sb != eb) { - n = sb; - - var walker = new tinymce.dom.TreeWalker(sb, dom.getRoot()); - while ((n = walker.next()) && n != eb) { - if (dom.isBlock(n)) - bl.push(n); - } - } - - if (eb && sb != eb) - bl.push(eb); - - return bl; - }, - - normalize : function() { - var self = this, rng, normalized; - - // TODO: - // Retain selection direction. - // Lean left/right on Gecko for inline elements. - // Run this on mouse up/key up when the user manually moves the selection - - // Normalize only on non IE browsers for now - if (tinymce.isIE) - return; - - function normalizeEndPoint(start) { - var container, offset, walker, dom = self.dom, body = dom.getRoot(), node; - - container = rng[(start ? 'start' : 'end') + 'Container']; - offset = rng[(start ? 'start' : 'end') + 'Offset']; - - // If the container is a document move it to the body element - if (container.nodeType === 9) { - container = container.body; - offset = 0; - } - - // If the container is body try move it into the closest text node or position - // TODO: Add more logic here to handle element selection cases - if (container === body) { - // Resolve the index - if (container.hasChildNodes()) { - container = container.childNodes[Math.min(!start && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1)]; - offset = 0; - - // Don't walk into elements that doesn't have any child nodes like a IMG - if (container.hasChildNodes()) { - // Walk the DOM to find a text node to place the caret at or a BR - node = container; - walker = new tinymce.dom.TreeWalker(container, body); - do { - // Found a text node use that position - if (node.nodeType === 3) { - offset = start ? 0 : node.nodeValue.length - 1; - container = node; - normalized = true; - break; - } - - // Found a BR/IMG element that we can place the caret before - if (/^(BR|IMG)$/.test(node.nodeName)) { - offset = dom.nodeIndex(node); - container = node.parentNode; - - // Put caret after image when moving the end point - if (node.nodeName == "IMG" && !start) { - offset++; - } - - normalized = true; - break; - } - } while (node = (start ? walker.next() : walker.prev())); - } - } - } - - // Set endpoint if it was normalized - if (normalized) - rng['set' + (start ? 'Start' : 'End')](container, offset); - }; - - rng = self.getRng(); - - // Normalize the end points - normalizeEndPoint(true); - - if (!rng.collapsed) - normalizeEndPoint(); - - // Set the selection if it was normalized - if (normalized) { - //console.log(self.dom.dumpRng(rng)); - self.setRng(rng); - } - }, - - destroy : function(s) { - var t = this; - - t.win = null; - - // Manual destroy then remove unload handler - if (!s) - tinymce.removeUnload(t.destroy); - }, - - // IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode - _fixIESelection : function() { - var dom = this.dom, doc = dom.doc, body = doc.body, started, startRng, htmlElm; - - // Make HTML element unselectable since we are going to handle selection by hand - doc.documentElement.unselectable = true; - - // Return range from point or null if it failed - function rngFromPoint(x, y) { - var rng = body.createTextRange(); - - try { - rng.moveToPoint(x, y); - } catch (ex) { - // IE sometimes throws and exception, so lets just ignore it - rng = null; - } - - return rng; - }; - - // Fires while the selection is changing - function selectionChange(e) { - var pointRng; - - // Check if the button is down or not - if (e.button) { - // Create range from mouse position - pointRng = rngFromPoint(e.x, e.y); - - if (pointRng) { - // Check if pointRange is before/after selection then change the endPoint - if (pointRng.compareEndPoints('StartToStart', startRng) > 0) - pointRng.setEndPoint('StartToStart', startRng); - else - pointRng.setEndPoint('EndToEnd', startRng); - - pointRng.select(); - } - } else - endSelection(); - } - - // Removes listeners - function endSelection() { - var rng = doc.selection.createRange(); - - // If the range is collapsed then use the last start range - if (startRng && !rng.item && rng.compareEndPoints('StartToEnd', rng) === 0) - startRng.select(); - - dom.unbind(doc, 'mouseup', endSelection); - dom.unbind(doc, 'mousemove', selectionChange); - startRng = started = 0; - }; - - // Detect when user selects outside BODY - dom.bind(doc, ['mousedown', 'contextmenu'], function(e) { - if (e.target.nodeName === 'HTML') { - if (started) - endSelection(); - - // Detect vertical scrollbar, since IE will fire a mousedown on the scrollbar and have target set as HTML - htmlElm = doc.documentElement; - if (htmlElm.scrollHeight > htmlElm.clientHeight) - return; - - started = 1; - // Setup start position - startRng = rngFromPoint(e.x, e.y); - if (startRng) { - // Listen for selection change events - dom.bind(doc, 'mouseup', endSelection); - dom.bind(doc, 'mousemove', selectionChange); - - dom.win.focus(); - startRng.select(); - } - } - }); - } - }); -})(tinymce); - -(function(tinymce) { - tinymce.dom.Serializer = function(settings, dom, schema) { - var onPreProcess, onPostProcess, isIE = tinymce.isIE, each = tinymce.each, htmlParser; - - // Support the old apply_source_formatting option - if (!settings.apply_source_formatting) - settings.indent = false; - - // Default DOM and Schema if they are undefined - dom = dom || tinymce.DOM; - schema = schema || new tinymce.html.Schema(settings); - settings.entity_encoding = settings.entity_encoding || 'named'; - settings.remove_trailing_brs = "remove_trailing_brs" in settings ? settings.remove_trailing_brs : true; - - onPreProcess = new tinymce.util.Dispatcher(self); - - onPostProcess = new tinymce.util.Dispatcher(self); - - htmlParser = new tinymce.html.DomParser(settings, schema); - - // Convert move data-mce-src, data-mce-href and data-mce-style into nodes or process them if needed - htmlParser.addAttributeFilter('src,href,style', function(nodes, name) { - var i = nodes.length, node, value, internalName = 'data-mce-' + name, urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope, undef; - - while (i--) { - node = nodes[i]; - - value = node.attributes.map[internalName]; - if (value !== undef) { - // Set external name to internal value and remove internal - node.attr(name, value.length > 0 ? value : null); - node.attr(internalName, null); - } else { - // No internal attribute found then convert the value we have in the DOM - value = node.attributes.map[name]; - - if (name === "style") - value = dom.serializeStyle(dom.parseStyle(value), node.name); - else if (urlConverter) - value = urlConverter.call(urlConverterScope, value, name, node.name); - - node.attr(name, value.length > 0 ? value : null); - } - } - }); - - // Remove internal classes mceItem<..> - htmlParser.addAttributeFilter('class', function(nodes, name) { - var i = nodes.length, node, value; - - while (i--) { - node = nodes[i]; - value = node.attr('class').replace(/\s*mce(Item\w+|Selected)\s*/g, ''); - node.attr('class', value.length > 0 ? value : null); - } - }); - - // Remove bookmark elements - htmlParser.addAttributeFilter('data-mce-type', function(nodes, name, args) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - - if (node.attributes.map['data-mce-type'] === 'bookmark' && !args.cleanup) - node.remove(); - } - }); - - // Force script into CDATA sections and remove the mce- prefix also add comments around styles - htmlParser.addNodeFilter('script,style', function(nodes, name) { - var i = nodes.length, node, value; - - function trim(value) { - return value.replace(/()/g, '\n') - .replace(/^[\r\n]*|[\r\n]*$/g, '') - .replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g, ''); - }; - - while (i--) { - node = nodes[i]; - value = node.firstChild ? node.firstChild.value : ''; - - if (name === "script") { - // Remove mce- prefix from script elements - node.attr('type', (node.attr('type') || 'text/javascript').replace(/^mce\-/, '')); - - if (value.length > 0) - node.firstChild.value = '// '; - } else { - if (value.length > 0) - node.firstChild.value = ''; - } - } - }); - - // Convert comments to cdata and handle protected comments - htmlParser.addNodeFilter('#comment', function(nodes, name) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - - if (node.value.indexOf('[CDATA[') === 0) { - node.name = '#cdata'; - node.type = 4; - node.value = node.value.replace(/^\[CDATA\[|\]\]$/g, ''); - } else if (node.value.indexOf('mce:protected ') === 0) { - node.name = "#text"; - node.type = 3; - node.raw = true; - node.value = unescape(node.value).substr(14); - } - } - }); - - htmlParser.addNodeFilter('xml:namespace,input', function(nodes, name) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - if (node.type === 7) - node.remove(); - else if (node.type === 1) { - if (name === "input" && !("type" in node.attributes.map)) - node.attr('type', 'text'); - } - } - }); - - // Fix list elements, TODO: Replace this later - if (settings.fix_list_elements) { - htmlParser.addNodeFilter('ul,ol', function(nodes, name) { - var i = nodes.length, node, parentNode; - - while (i--) { - node = nodes[i]; - parentNode = node.parent; - - if (parentNode.name === 'ul' || parentNode.name === 'ol') { - if (node.prev && node.prev.name === 'li') { - node.prev.append(node); - } - } - } - }); - } - - // Remove internal data attributes - htmlParser.addAttributeFilter('data-mce-src,data-mce-href,data-mce-style', function(nodes, name) { - var i = nodes.length; - - while (i--) { - nodes[i].attr(name, null); - } - }); - - // Return public methods - return { - schema : schema, - - addNodeFilter : htmlParser.addNodeFilter, - - addAttributeFilter : htmlParser.addAttributeFilter, - - onPreProcess : onPreProcess, - - onPostProcess : onPostProcess, - - serialize : function(node, args) { - var impl, doc, oldDoc, htmlSerializer, content; - - // Explorer won't clone contents of script and style and the - // selected index of select elements are cleared on a clone operation. - if (isIE && dom.select('script,style,select,map').length > 0) { - content = node.innerHTML; - node = node.cloneNode(false); - dom.setHTML(node, content); - } else - node = node.cloneNode(true); - - // Nodes needs to be attached to something in WebKit/Opera - // Older builds of Opera crashes if you attach the node to an document created dynamically - // and since we can't feature detect a crash we need to sniff the acutal build number - // This fix will make DOM ranges and make Sizzle happy! - impl = node.ownerDocument.implementation; - if (impl.createHTMLDocument) { - // Create an empty HTML document - doc = impl.createHTMLDocument(""); - - // Add the element or it's children if it's a body element to the new document - each(node.nodeName == 'BODY' ? node.childNodes : [node], function(node) { - doc.body.appendChild(doc.importNode(node, true)); - }); - - // Grab first child or body element for serialization - if (node.nodeName != 'BODY') - node = doc.body.firstChild; - else - node = doc.body; - - // set the new document in DOMUtils so createElement etc works - oldDoc = dom.doc; - dom.doc = doc; - } - - args = args || {}; - args.format = args.format || 'html'; - - // Pre process - if (!args.no_events) { - args.node = node; - onPreProcess.dispatch(self, args); - } - - // Setup serializer - htmlSerializer = new tinymce.html.Serializer(settings, schema); - - // Parse and serialize HTML - args.content = htmlSerializer.serialize( - htmlParser.parse(args.getInner ? node.innerHTML : tinymce.trim(dom.getOuterHTML(node), args), args) - ); - - // Replace all BOM characters for now until we can find a better solution - if (!args.cleanup) - args.content = args.content.replace(/\uFEFF|\u200B/g, ''); - - // Post process - if (!args.no_events) - onPostProcess.dispatch(self, args); - - // Restore the old document if it was changed - if (oldDoc) - dom.doc = oldDoc; - - args.node = null; - - return args.content; - }, - - addRules : function(rules) { - schema.addValidElements(rules); - }, - - setRules : function(rules) { - schema.setValidElements(rules); - } - }; - }; -})(tinymce); -(function(tinymce) { - tinymce.dom.ScriptLoader = function(settings) { - var QUEUED = 0, - LOADING = 1, - LOADED = 2, - states = {}, - queue = [], - scriptLoadedCallbacks = {}, - queueLoadedCallbacks = [], - loading = 0, - undefined; - - function loadScript(url, callback) { - var t = this, dom = tinymce.DOM, elm, uri, loc, id; - - // Execute callback when script is loaded - function done() { - dom.remove(id); - - if (elm) - elm.onreadystatechange = elm.onload = elm = null; - - callback(); - }; - - function error() { - // Report the error so it's easier for people to spot loading errors - if (typeof(console) !== "undefined" && console.log) - console.log("Failed to load: " + url); - - // We can't mark it as done if there is a load error since - // A) We don't want to produce 404 errors on the server and - // B) the onerror event won't fire on all browsers. - // done(); - }; - - id = dom.uniqueId(); - - if (tinymce.isIE6) { - uri = new tinymce.util.URI(url); - loc = location; - - // If script is from same domain and we - // use IE 6 then use XHR since it's more reliable - if (uri.host == loc.hostname && uri.port == loc.port && (uri.protocol + ':') == loc.protocol && uri.protocol.toLowerCase() != 'file') { - tinymce.util.XHR.send({ - url : tinymce._addVer(uri.getURI()), - success : function(content) { - // Create new temp script element - var script = dom.create('script', { - type : 'text/javascript' - }); - - // Evaluate script in global scope - script.text = content; - document.getElementsByTagName('head')[0].appendChild(script); - dom.remove(script); - - done(); - }, - - error : error - }); - - return; - } - } - - // Create new script element - elm = dom.create('script', { - id : id, - type : 'text/javascript', - src : tinymce._addVer(url) - }); - - // Add onload listener for non IE browsers since IE9 - // fires onload event before the script is parsed and executed - if (!tinymce.isIE) - elm.onload = done; - - // Add onerror event will get fired on some browsers but not all of them - elm.onerror = error; - - // Opera 9.60 doesn't seem to fire the onreadystate event at correctly - if (!tinymce.isOpera) { - elm.onreadystatechange = function() { - var state = elm.readyState; - - // Loaded state is passed on IE 6 however there - // are known issues with this method but we can't use - // XHR in a cross domain loading - if (state == 'complete' || state == 'loaded') - done(); - }; - } - - // Most browsers support this feature so we report errors - // for those at least to help users track their missing plugins etc - // todo: Removed since it produced error if the document is unloaded by navigating away, re-add it as an option - /*elm.onerror = function() { - alert('Failed to load: ' + url); - };*/ - - // Add script to document - (document.getElementsByTagName('head')[0] || document.body).appendChild(elm); - }; - - this.isDone = function(url) { - return states[url] == LOADED; - }; - - this.markDone = function(url) { - states[url] = LOADED; - }; - - this.add = this.load = function(url, callback, scope) { - var item, state = states[url]; - - // Add url to load queue - if (state == undefined) { - queue.push(url); - states[url] = QUEUED; - } - - if (callback) { - // Store away callback for later execution - if (!scriptLoadedCallbacks[url]) - scriptLoadedCallbacks[url] = []; - - scriptLoadedCallbacks[url].push({ - func : callback, - scope : scope || this - }); - } - }; - - this.loadQueue = function(callback, scope) { - this.loadScripts(queue, callback, scope); - }; - - this.loadScripts = function(scripts, callback, scope) { - var loadScripts; - - function execScriptLoadedCallbacks(url) { - // Execute URL callback functions - tinymce.each(scriptLoadedCallbacks[url], function(callback) { - callback.func.call(callback.scope); - }); - - scriptLoadedCallbacks[url] = undefined; - }; - - queueLoadedCallbacks.push({ - func : callback, - scope : scope || this - }); - - loadScripts = function() { - var loadingScripts = tinymce.grep(scripts); - - // Current scripts has been handled - scripts.length = 0; - - // Load scripts that needs to be loaded - tinymce.each(loadingScripts, function(url) { - // Script is already loaded then execute script callbacks directly - if (states[url] == LOADED) { - execScriptLoadedCallbacks(url); - return; - } - - // Is script not loading then start loading it - if (states[url] != LOADING) { - states[url] = LOADING; - loading++; - - loadScript(url, function() { - states[url] = LOADED; - loading--; - - execScriptLoadedCallbacks(url); - - // Load more scripts if they where added by the recently loaded script - loadScripts(); - }); - } - }); - - // No scripts are currently loading then execute all pending queue loaded callbacks - if (!loading) { - tinymce.each(queueLoadedCallbacks, function(callback) { - callback.func.call(callback.scope); - }); - - queueLoadedCallbacks.length = 0; - } - }; - - loadScripts(); - }; - }; - - // Global script loader - tinymce.ScriptLoader = new tinymce.dom.ScriptLoader(); -})(tinymce); - -tinymce.dom.TreeWalker = function(start_node, root_node) { - var node = start_node; - - function findSibling(node, start_name, sibling_name, shallow) { - var sibling, parent; - - if (node) { - // Walk into nodes if it has a start - if (!shallow && node[start_name]) - return node[start_name]; - - // Return the sibling if it has one - if (node != root_node) { - sibling = node[sibling_name]; - if (sibling) - return sibling; - - // Walk up the parents to look for siblings - for (parent = node.parentNode; parent && parent != root_node; parent = parent.parentNode) { - sibling = parent[sibling_name]; - if (sibling) - return sibling; - } - } - } - }; - - this.current = function() { - return node; - }; - - this.next = function(shallow) { - return (node = findSibling(node, 'firstChild', 'nextSibling', shallow)); - }; - - this.prev = function(shallow) { - return (node = findSibling(node, 'lastChild', 'previousSibling', shallow)); - }; -}; - -(function(tinymce) { - tinymce.dom.RangeUtils = function(dom) { - var INVISIBLE_CHAR = '\uFEFF'; - - this.walk = function(rng, callback) { - var startContainer = rng.startContainer, - startOffset = rng.startOffset, - endContainer = rng.endContainer, - endOffset = rng.endOffset, - ancestor, startPoint, - endPoint, node, parent, siblings, nodes; - - // Handle table cell selection the table plugin enables - // you to fake select table cells and perform formatting actions on them - nodes = dom.select('td.mceSelected,th.mceSelected'); - if (nodes.length > 0) { - tinymce.each(nodes, function(node) { - callback([node]); - }); - - return; - } - - function exclude(nodes) { - var node; - - // First node is excluded - node = nodes[0]; - if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) { - nodes.splice(0, 1); - } - - // Last node is excluded - node = nodes[nodes.length - 1]; - if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) { - nodes.splice(nodes.length - 1, 1); - } - - return nodes; - }; - - function collectSiblings(node, name, end_node) { - var siblings = []; - - for (; node && node != end_node; node = node[name]) - siblings.push(node); - - return siblings; - }; - - function findEndPoint(node, root) { - do { - if (node.parentNode == root) - return node; - - node = node.parentNode; - } while(node); - }; - - function walkBoundary(start_node, end_node, next) { - var siblingName = next ? 'nextSibling' : 'previousSibling'; - - for (node = start_node, parent = node.parentNode; node && node != end_node; node = parent) { - parent = node.parentNode; - siblings = collectSiblings(node == start_node ? node : node[siblingName], siblingName); - - if (siblings.length) { - if (!next) - siblings.reverse(); - - callback(exclude(siblings)); - } - } - }; - - // If index based start position then resolve it - if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) - startContainer = startContainer.childNodes[startOffset]; - - // If index based end position then resolve it - if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) - endContainer = endContainer.childNodes[Math.min(endOffset - 1, endContainer.childNodes.length - 1)]; - - // Same container - if (startContainer == endContainer) - return callback(exclude([startContainer])); - - // Find common ancestor and end points - ancestor = dom.findCommonAncestor(startContainer, endContainer); - - // Process left side - for (node = startContainer; node; node = node.parentNode) { - if (node === endContainer) - return walkBoundary(startContainer, ancestor, true); - - if (node === ancestor) - break; - } - - // Process right side - for (node = endContainer; node; node = node.parentNode) { - if (node === startContainer) - return walkBoundary(endContainer, ancestor); - - if (node === ancestor) - break; - } - - // Find start/end point - startPoint = findEndPoint(startContainer, ancestor) || startContainer; - endPoint = findEndPoint(endContainer, ancestor) || endContainer; - - // Walk left leaf - walkBoundary(startContainer, startPoint, true); - - // Walk the middle from start to end point - siblings = collectSiblings( - startPoint == startContainer ? startPoint : startPoint.nextSibling, - 'nextSibling', - endPoint == endContainer ? endPoint.nextSibling : endPoint - ); - - if (siblings.length) - callback(exclude(siblings)); - - // Walk right leaf - walkBoundary(endContainer, endPoint); - }; - - this.split = function(rng) { - var startContainer = rng.startContainer, - startOffset = rng.startOffset, - endContainer = rng.endContainer, - endOffset = rng.endOffset; - - function splitText(node, offset) { - return node.splitText(offset); - }; - - // Handle single text node - if (startContainer == endContainer && startContainer.nodeType == 3) { - if (startOffset > 0 && startOffset < startContainer.nodeValue.length) { - endContainer = splitText(startContainer, startOffset); - startContainer = endContainer.previousSibling; - - if (endOffset > startOffset) { - endOffset = endOffset - startOffset; - startContainer = endContainer = splitText(endContainer, endOffset).previousSibling; - endOffset = endContainer.nodeValue.length; - startOffset = 0; - } else { - endOffset = 0; - } - } - } else { - // Split startContainer text node if needed - if (startContainer.nodeType == 3 && startOffset > 0 && startOffset < startContainer.nodeValue.length) { - startContainer = splitText(startContainer, startOffset); - startOffset = 0; - } - - // Split endContainer text node if needed - if (endContainer.nodeType == 3 && endOffset > 0 && endOffset < endContainer.nodeValue.length) { - endContainer = splitText(endContainer, endOffset).previousSibling; - endOffset = endContainer.nodeValue.length; - } - } - - return { - startContainer : startContainer, - startOffset : startOffset, - endContainer : endContainer, - endOffset : endOffset - }; - }; - - }; - - tinymce.dom.RangeUtils.compareRanges = function(rng1, rng2) { - if (rng1 && rng2) { - // Compare native IE ranges - if (rng1.item || rng1.duplicate) { - // Both are control ranges and the selected element matches - if (rng1.item && rng2.item && rng1.item(0) === rng2.item(0)) - return true; - - // Both are text ranges and the range matches - if (rng1.isEqual && rng2.isEqual && rng2.isEqual(rng1)) - return true; - } else { - // Compare w3c ranges - return rng1.startContainer == rng2.startContainer && rng1.startOffset == rng2.startOffset; - } - } - - return false; - }; -})(tinymce); - -(function(tinymce) { - var Event = tinymce.dom.Event, each = tinymce.each; - - tinymce.create('tinymce.ui.KeyboardNavigation', { - KeyboardNavigation: function(settings, dom) { - var t = this, root = settings.root, items = settings.items, - enableUpDown = settings.enableUpDown, enableLeftRight = settings.enableLeftRight || !settings.enableUpDown, - excludeFromTabOrder = settings.excludeFromTabOrder, - itemFocussed, itemBlurred, rootKeydown, rootFocussed, focussedId; - - dom = dom || tinymce.DOM; - - itemFocussed = function(evt) { - focussedId = evt.target.id; - }; - - itemBlurred = function(evt) { - dom.setAttrib(evt.target.id, 'tabindex', '-1'); - }; - - rootFocussed = function(evt) { - var item = dom.get(focussedId); - dom.setAttrib(item, 'tabindex', '0'); - item.focus(); - }; - - t.focus = function() { - dom.get(focussedId).focus(); - }; - - t.destroy = function() { - each(items, function(item) { - dom.unbind(dom.get(item.id), 'focus', itemFocussed); - dom.unbind(dom.get(item.id), 'blur', itemBlurred); - }); - - dom.unbind(dom.get(root), 'focus', rootFocussed); - dom.unbind(dom.get(root), 'keydown', rootKeydown); - - items = dom = root = t.focus = itemFocussed = itemBlurred = rootKeydown = rootFocussed = null; - t.destroy = function() {}; - }; - - t.moveFocus = function(dir, evt) { - var idx = -1, controls = t.controls, newFocus; - - if (!focussedId) - return; - - each(items, function(item, index) { - if (item.id === focussedId) { - idx = index; - return false; - } - }); - - idx += dir; - if (idx < 0) { - idx = items.length - 1; - } else if (idx >= items.length) { - idx = 0; - } - - newFocus = items[idx]; - dom.setAttrib(focussedId, 'tabindex', '-1'); - dom.setAttrib(newFocus.id, 'tabindex', '0'); - dom.get(newFocus.id).focus(); - - if (settings.actOnFocus) { - settings.onAction(newFocus.id); - } - - if (evt) - Event.cancel(evt); - }; - - rootKeydown = function(evt) { - var DOM_VK_LEFT = 37, DOM_VK_RIGHT = 39, DOM_VK_UP = 38, DOM_VK_DOWN = 40, DOM_VK_ESCAPE = 27, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_SPACE = 32; - - switch (evt.keyCode) { - case DOM_VK_LEFT: - if (enableLeftRight) t.moveFocus(-1); - break; - - case DOM_VK_RIGHT: - if (enableLeftRight) t.moveFocus(1); - break; - - case DOM_VK_UP: - if (enableUpDown) t.moveFocus(-1); - break; - - case DOM_VK_DOWN: - if (enableUpDown) t.moveFocus(1); - break; - - case DOM_VK_ESCAPE: - if (settings.onCancel) { - settings.onCancel(); - Event.cancel(evt); - } - break; - - case DOM_VK_ENTER: - case DOM_VK_RETURN: - case DOM_VK_SPACE: - if (settings.onAction) { - settings.onAction(focussedId); - Event.cancel(evt); - } - break; - } - }; - - // Set up state and listeners for each item. - each(items, function(item, idx) { - var tabindex; - - if (!item.id) { - item.id = dom.uniqueId('_mce_item_'); - } - - if (excludeFromTabOrder) { - dom.bind(item.id, 'blur', itemBlurred); - tabindex = '-1'; - } else { - tabindex = (idx === 0 ? '0' : '-1'); - } - - dom.setAttrib(item.id, 'tabindex', tabindex); - dom.bind(dom.get(item.id), 'focus', itemFocussed); - }); - - // Setup initial state for root element. - if (items[0]){ - focussedId = items[0].id; - } - - dom.setAttrib(root, 'tabindex', '-1'); - - // Setup listeners for root element. - dom.bind(dom.get(root), 'focus', rootFocussed); - dom.bind(dom.get(root), 'keydown', rootKeydown); - } - }); -})(tinymce); - -(function(tinymce) { - // Shorten class names - var DOM = tinymce.DOM, is = tinymce.is; - - tinymce.create('tinymce.ui.Control', { - Control : function(id, s, editor) { - this.id = id; - this.settings = s = s || {}; - this.rendered = false; - this.onRender = new tinymce.util.Dispatcher(this); - this.classPrefix = ''; - this.scope = s.scope || this; - this.disabled = 0; - this.active = 0; - this.editor = editor; - }, - - setAriaProperty : function(property, value) { - var element = DOM.get(this.id + '_aria') || DOM.get(this.id); - if (element) { - DOM.setAttrib(element, 'aria-' + property, !!value); - } - }, - - focus : function() { - DOM.get(this.id).focus(); - }, - - setDisabled : function(s) { - if (s != this.disabled) { - this.setAriaProperty('disabled', s); - - this.setState('Disabled', s); - this.setState('Enabled', !s); - this.disabled = s; - } - }, - - isDisabled : function() { - return this.disabled; - }, - - setActive : function(s) { - if (s != this.active) { - this.setState('Active', s); - this.active = s; - this.setAriaProperty('pressed', s); - } - }, - - isActive : function() { - return this.active; - }, - - setState : function(c, s) { - var n = DOM.get(this.id); - - c = this.classPrefix + c; - - if (s) - DOM.addClass(n, c); - else - DOM.removeClass(n, c); - }, - - isRendered : function() { - return this.rendered; - }, - - renderHTML : function() { - }, - - renderTo : function(n) { - DOM.setHTML(n, this.renderHTML()); - }, - - postRender : function() { - var t = this, b; - - // Set pending states - if (is(t.disabled)) { - b = t.disabled; - t.disabled = -1; - t.setDisabled(b); - } - - if (is(t.active)) { - b = t.active; - t.active = -1; - t.setActive(b); - } - }, - - remove : function() { - DOM.remove(this.id); - this.destroy(); - }, - - destroy : function() { - tinymce.dom.Event.clear(this.id); - } - }); -})(tinymce); -tinymce.create('tinymce.ui.Container:tinymce.ui.Control', { - Container : function(id, s, editor) { - this.parent(id, s, editor); - - this.controls = []; - - this.lookup = {}; - }, - - add : function(c) { - this.lookup[c.id] = c; - this.controls.push(c); - - return c; - }, - - get : function(n) { - return this.lookup[n]; - } -}); - - -tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { - Separator : function(id, s) { - this.parent(id, s); - this.classPrefix = 'mceSeparator'; - this.setDisabled(true); - }, - - renderHTML : function() { - return tinymce.DOM.createHTML('span', {'class' : this.classPrefix, role : 'separator', 'aria-orientation' : 'vertical', tabindex : '-1'}); - } -}); - -(function(tinymce) { - var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk; - - tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control', { - MenuItem : function(id, s) { - this.parent(id, s); - this.classPrefix = 'mceMenuItem'; - }, - - setSelected : function(s) { - this.setState('Selected', s); - this.setAriaProperty('checked', !!s); - this.selected = s; - }, - - isSelected : function() { - return this.selected; - }, - - postRender : function() { - var t = this; - - t.parent(); - - // Set pending state - if (is(t.selected)) - t.setSelected(t.selected); - } - }); -})(tinymce); - -(function(tinymce) { - var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk; - - tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem', { - Menu : function(id, s) { - var t = this; - - t.parent(id, s); - t.items = {}; - t.collapsed = false; - t.menuCount = 0; - t.onAddItem = new tinymce.util.Dispatcher(this); - }, - - expand : function(d) { - var t = this; - - if (d) { - walk(t, function(o) { - if (o.expand) - o.expand(); - }, 'items', t); - } - - t.collapsed = false; - }, - - collapse : function(d) { - var t = this; - - if (d) { - walk(t, function(o) { - if (o.collapse) - o.collapse(); - }, 'items', t); - } - - t.collapsed = true; - }, - - isCollapsed : function() { - return this.collapsed; - }, - - add : function(o) { - if (!o.settings) - o = new tinymce.ui.MenuItem(o.id || DOM.uniqueId(), o); - - this.onAddItem.dispatch(this, o); - - return this.items[o.id] = o; - }, - - addSeparator : function() { - return this.add({separator : true}); - }, - - addMenu : function(o) { - if (!o.collapse) - o = this.createMenu(o); - - this.menuCount++; - - return this.add(o); - }, - - hasMenus : function() { - return this.menuCount !== 0; - }, - - remove : function(o) { - delete this.items[o.id]; - }, - - removeAll : function() { - var t = this; - - walk(t, function(o) { - if (o.removeAll) - o.removeAll(); - else - o.remove(); - - o.destroy(); - }, 'items', t); - - t.items = {}; - }, - - createMenu : function(o) { - var m = new tinymce.ui.Menu(o.id || DOM.uniqueId(), o); - - m.onAddItem.add(this.onAddItem.dispatch, this.onAddItem); - - return m; - } - }); -})(tinymce); -(function(tinymce) { - var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event, Element = tinymce.dom.Element; - - tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu', { - DropMenu : function(id, s) { - s = s || {}; - s.container = s.container || DOM.doc.body; - s.offset_x = s.offset_x || 0; - s.offset_y = s.offset_y || 0; - s.vp_offset_x = s.vp_offset_x || 0; - s.vp_offset_y = s.vp_offset_y || 0; - - if (is(s.icons) && !s.icons) - s['class'] += ' mceNoIcons'; - - this.parent(id, s); - this.onShowMenu = new tinymce.util.Dispatcher(this); - this.onHideMenu = new tinymce.util.Dispatcher(this); - this.classPrefix = 'mceMenu'; - }, - - createMenu : function(s) { - var t = this, cs = t.settings, m; - - s.container = s.container || cs.container; - s.parent = t; - s.constrain = s.constrain || cs.constrain; - s['class'] = s['class'] || cs['class']; - s.vp_offset_x = s.vp_offset_x || cs.vp_offset_x; - s.vp_offset_y = s.vp_offset_y || cs.vp_offset_y; - s.keyboard_focus = cs.keyboard_focus; - m = new tinymce.ui.DropMenu(s.id || DOM.uniqueId(), s); - - m.onAddItem.add(t.onAddItem.dispatch, t.onAddItem); - - return m; - }, - - focus : function() { - var t = this; - if (t.keyboardNav) { - t.keyboardNav.focus(); - } - }, - - update : function() { - var t = this, s = t.settings, tb = DOM.get('menu_' + t.id + '_tbl'), co = DOM.get('menu_' + t.id + '_co'), tw, th; - - tw = s.max_width ? Math.min(tb.clientWidth, s.max_width) : tb.clientWidth; - th = s.max_height ? Math.min(tb.clientHeight, s.max_height) : tb.clientHeight; - - if (!DOM.boxModel) - t.element.setStyles({width : tw + 2, height : th + 2}); - else - t.element.setStyles({width : tw, height : th}); - - if (s.max_width) - DOM.setStyle(co, 'width', tw); - - if (s.max_height) { - DOM.setStyle(co, 'height', th); - - if (tb.clientHeight < s.max_height) - DOM.setStyle(co, 'overflow', 'hidden'); - } - }, - - showMenu : function(x, y, px) { - var t = this, s = t.settings, co, vp = DOM.getViewPort(), w, h, mx, my, ot = 2, dm, tb, cp = t.classPrefix; - - t.collapse(1); - - if (t.isMenuVisible) - return; - - if (!t.rendered) { - co = DOM.add(t.settings.container, t.renderNode()); - - each(t.items, function(o) { - o.postRender(); - }); - - t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container}); - } else - co = DOM.get('menu_' + t.id); - - // Move layer out of sight unless it's Opera since it scrolls to top of page due to an bug - if (!tinymce.isOpera) - DOM.setStyles(co, {left : -0xFFFF , top : -0xFFFF}); - - DOM.show(co); - t.update(); - - x += s.offset_x || 0; - y += s.offset_y || 0; - vp.w -= 4; - vp.h -= 4; - - // Move inside viewport if not submenu - if (s.constrain) { - w = co.clientWidth - ot; - h = co.clientHeight - ot; - mx = vp.x + vp.w; - my = vp.y + vp.h; - - if ((x + s.vp_offset_x + w) > mx) - x = px ? px - w : Math.max(0, (mx - s.vp_offset_x) - w); - - if ((y + s.vp_offset_y + h) > my) - y = Math.max(0, (my - s.vp_offset_y) - h); - } - - DOM.setStyles(co, {left : x , top : y}); - t.element.update(); - - t.isMenuVisible = 1; - t.mouseClickFunc = Event.add(co, 'click', function(e) { - var m; - - e = e.target; - - if (e && (e = DOM.getParent(e, 'tr')) && !DOM.hasClass(e, cp + 'ItemSub')) { - m = t.items[e.id]; - - if (m.isDisabled()) - return; - - dm = t; - - while (dm) { - if (dm.hideMenu) - dm.hideMenu(); - - dm = dm.settings.parent; - } - - if (m.settings.onclick) - m.settings.onclick(e); - - return Event.cancel(e); // Cancel to fix onbeforeunload problem - } - }); - - if (t.hasMenus()) { - t.mouseOverFunc = Event.add(co, 'mouseover', function(e) { - var m, r, mi; - - e = e.target; - if (e && (e = DOM.getParent(e, 'tr'))) { - m = t.items[e.id]; - - if (t.lastMenu) - t.lastMenu.collapse(1); - - if (m.isDisabled()) - return; - - if (e && DOM.hasClass(e, cp + 'ItemSub')) { - //p = DOM.getPos(s.container); - r = DOM.getRect(e); - m.showMenu((r.x + r.w - ot), r.y - ot, r.x); - t.lastMenu = m; - DOM.addClass(DOM.get(m.id).firstChild, cp + 'ItemActive'); - } - } - }); - } - - Event.add(co, 'keydown', t._keyHandler, t); - - t.onShowMenu.dispatch(t); - - if (s.keyboard_focus) { - t._setupKeyboardNav(); - } - }, - - hideMenu : function(c) { - var t = this, co = DOM.get('menu_' + t.id), e; - - if (!t.isMenuVisible) - return; - - if (t.keyboardNav) t.keyboardNav.destroy(); - Event.remove(co, 'mouseover', t.mouseOverFunc); - Event.remove(co, 'click', t.mouseClickFunc); - Event.remove(co, 'keydown', t._keyHandler); - DOM.hide(co); - t.isMenuVisible = 0; - - if (!c) - t.collapse(1); - - if (t.element) - t.element.hide(); - - if (e = DOM.get(t.id)) - DOM.removeClass(e.firstChild, t.classPrefix + 'ItemActive'); - - t.onHideMenu.dispatch(t); - }, - - add : function(o) { - var t = this, co; - - o = t.parent(o); - - if (t.isRendered && (co = DOM.get('menu_' + t.id))) - t._add(DOM.select('tbody', co)[0], o); - - return o; - }, - - collapse : function(d) { - this.parent(d); - this.hideMenu(1); - }, - - remove : function(o) { - DOM.remove(o.id); - this.destroy(); - - return this.parent(o); - }, - - destroy : function() { - var t = this, co = DOM.get('menu_' + t.id); - - if (t.keyboardNav) t.keyboardNav.destroy(); - Event.remove(co, 'mouseover', t.mouseOverFunc); - Event.remove(DOM.select('a', co), 'focus', t.mouseOverFunc); - Event.remove(co, 'click', t.mouseClickFunc); - Event.remove(co, 'keydown', t._keyHandler); - - if (t.element) - t.element.remove(); - - DOM.remove(co); - }, - - renderNode : function() { - var t = this, s = t.settings, n, tb, co, w; - - w = DOM.create('div', {role: 'listbox', id : 'menu_' + t.id, 'class' : s['class'], 'style' : 'position:absolute;left:0;top:0;z-index:200000;outline:0'}); - if (t.settings.parent) { - DOM.setAttrib(w, 'aria-parent', 'menu_' + t.settings.parent.id); - } - co = DOM.add(w, 'div', {role: 'presentation', id : 'menu_' + t.id + '_co', 'class' : t.classPrefix + (s['class'] ? ' ' + s['class'] : '')}); - t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container}); - - if (s.menu_line) - DOM.add(co, 'span', {'class' : t.classPrefix + 'Line'}); - -// n = DOM.add(co, 'div', {id : 'menu_' + t.id + '_co', 'class' : 'mceMenuContainer'}); - n = DOM.add(co, 'table', {role: 'presentation', id : 'menu_' + t.id + '_tbl', border : 0, cellPadding : 0, cellSpacing : 0}); - tb = DOM.add(n, 'tbody'); - - each(t.items, function(o) { - t._add(tb, o); - }); - - t.rendered = true; - - return w; - }, - - // Internal functions - _setupKeyboardNav : function(){ - var contextMenu, menuItems, t=this; - contextMenu = DOM.get('menu_' + t.id); - menuItems = DOM.select('a[role=option]', 'menu_' + t.id); - menuItems.splice(0,0,contextMenu); - t.keyboardNav = new tinymce.ui.KeyboardNavigation({ - root: 'menu_' + t.id, - items: menuItems, - onCancel: function() { - t.hideMenu(); - }, - enableUpDown: true - }); - contextMenu.focus(); - }, - - _keyHandler : function(evt) { - var t = this, e; - switch (evt.keyCode) { - case 37: // Left - if (t.settings.parent) { - t.hideMenu(); - t.settings.parent.focus(); - Event.cancel(evt); - } - break; - case 39: // Right - if (t.mouseOverFunc) - t.mouseOverFunc(evt); - break; - } - }, - - _add : function(tb, o) { - var n, s = o.settings, a, ro, it, cp = this.classPrefix, ic; - - if (s.separator) { - ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'ItemSeparator'}); - DOM.add(ro, 'td', {'class' : cp + 'ItemSeparator'}); - - if (n = ro.previousSibling) - DOM.addClass(n, 'mceLast'); - - return; - } - - n = ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'Item ' + cp + 'ItemEnabled'}); - n = it = DOM.add(n, s.titleItem ? 'th' : 'td'); - n = a = DOM.add(n, 'a', {id: o.id + '_aria', role: s.titleItem ? 'presentation' : 'option', href : 'javascript:;', onclick : "return false;", onmousedown : 'return false;'}); - - if (s.parent) { - DOM.setAttrib(a, 'aria-haspopup', 'true'); - DOM.setAttrib(a, 'aria-owns', 'menu_' + o.id); - } - - DOM.addClass(it, s['class']); -// n = DOM.add(n, 'span', {'class' : 'item'}); - - ic = DOM.add(n, 'span', {'class' : 'mceIcon' + (s.icon ? ' mce_' + s.icon : '')}); - - if (s.icon_src) - DOM.add(ic, 'img', {src : s.icon_src}); - - n = DOM.add(n, s.element || 'span', {'class' : 'mceText', title : o.settings.title}, o.settings.title); - - if (o.settings.style) - DOM.setAttrib(n, 'style', o.settings.style); - - if (tb.childNodes.length == 1) - DOM.addClass(ro, 'mceFirst'); - - if ((n = ro.previousSibling) && DOM.hasClass(n, cp + 'ItemSeparator')) - DOM.addClass(ro, 'mceFirst'); - - if (o.collapse) - DOM.addClass(ro, cp + 'ItemSub'); - - if (n = ro.previousSibling) - DOM.removeClass(n, 'mceLast'); - - DOM.addClass(ro, 'mceLast'); - } - }); -})(tinymce); -(function(tinymce) { - var DOM = tinymce.DOM; - - tinymce.create('tinymce.ui.Button:tinymce.ui.Control', { - Button : function(id, s, ed) { - this.parent(id, s, ed); - this.classPrefix = 'mceButton'; - }, - - renderHTML : function() { - var cp = this.classPrefix, s = this.settings, h, l; - - l = DOM.encode(s.label || ''); - h = ''; - if (s.image && !(this.editor &&this.editor.forcedHighContrastMode) ) - h += '' + DOM.encode(s.title) + '' + l; - else - h += '' + (l ? '' + l + '' : ''); - - h += ''; - h += ''; - return h; - }, - - postRender : function() { - var t = this, s = t.settings, imgBookmark; - - // In IE a large image that occupies the entire editor area will be deselected when a button is clicked, so - // need to keep the selection in case the selection is lost - if (tinymce.isIE && t.editor) { - tinymce.dom.Event.add(t.id, 'mousedown', function(e) { - var nodeName = t.editor.selection.getNode().nodeName; - imgBookmark = nodeName === 'IMG' ? t.editor.selection.getBookmark() : null; - }); - } - tinymce.dom.Event.add(t.id, 'click', function(e) { - if (!t.isDisabled()) { - // restore the selection in case the selection is lost in IE - if (tinymce.isIE && t.editor && imgBookmark !== null) { - t.editor.selection.moveToBookmark(imgBookmark); - } - return s.onclick.call(s.scope, e); - } - }); - tinymce.dom.Event.add(t.id, 'keyup', function(e) { - if (!t.isDisabled() && e.keyCode==tinymce.VK.SPACEBAR) - return s.onclick.call(s.scope, e); - }); - } - }); -})(tinymce); - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher; - - tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control', { - ListBox : function(id, s, ed) { - var t = this; - - t.parent(id, s, ed); - - t.items = []; - - t.onChange = new Dispatcher(t); - - t.onPostRender = new Dispatcher(t); - - t.onAdd = new Dispatcher(t); - - t.onRenderMenu = new tinymce.util.Dispatcher(this); - - t.classPrefix = 'mceListBox'; - }, - - select : function(va) { - var t = this, fv, f; - - if (va == undefined) - return t.selectByIndex(-1); - - // Is string or number make function selector - if (va && typeof(va)=="function") - f = va; - else { - f = function(v) { - return v == va; - }; - } - - // Do we need to do something? - if (va != t.selectedValue) { - // Find item - each(t.items, function(o, i) { - if (f(o.value)) { - fv = 1; - t.selectByIndex(i); - return false; - } - }); - - if (!fv) - t.selectByIndex(-1); - } - }, - - selectByIndex : function(idx) { - var t = this, e, o, label; - - if (idx != t.selectedIndex) { - e = DOM.get(t.id + '_text'); - label = DOM.get(t.id + '_voiceDesc'); - o = t.items[idx]; - - if (o) { - t.selectedValue = o.value; - t.selectedIndex = idx; - DOM.setHTML(e, DOM.encode(o.title)); - DOM.setHTML(label, t.settings.title + " - " + o.title); - DOM.removeClass(e, 'mceTitle'); - DOM.setAttrib(t.id, 'aria-valuenow', o.title); - } else { - DOM.setHTML(e, DOM.encode(t.settings.title)); - DOM.setHTML(label, DOM.encode(t.settings.title)); - DOM.addClass(e, 'mceTitle'); - t.selectedValue = t.selectedIndex = null; - DOM.setAttrib(t.id, 'aria-valuenow', t.settings.title); - } - e = 0; - } - }, - - add : function(n, v, o) { - var t = this; - - o = o || {}; - o = tinymce.extend(o, { - title : n, - value : v - }); - - t.items.push(o); - t.onAdd.dispatch(t, o); - }, - - getLength : function() { - return this.items.length; - }, - - renderHTML : function() { - var h = '', t = this, s = t.settings, cp = t.classPrefix; - - h = ''; - h += ''; - h += ''; - h += ''; - - return h; - }, - - showMenu : function() { - var t = this, p2, e = DOM.get(this.id), m; - - if (t.isDisabled() || t.items.length == 0) - return; - - if (t.menu && t.menu.isMenuVisible) - return t.hideMenu(); - - if (!t.isMenuRendered) { - t.renderMenu(); - t.isMenuRendered = true; - } - - p2 = DOM.getPos(e); - - m = t.menu; - m.settings.offset_x = p2.x; - m.settings.offset_y = p2.y; - m.settings.keyboard_focus = !tinymce.isOpera; // Opera is buggy when it comes to auto focus - - // Select in menu - if (t.oldID) - m.items[t.oldID].setSelected(0); - - each(t.items, function(o) { - if (o.value === t.selectedValue) { - m.items[o.id].setSelected(1); - t.oldID = o.id; - } - }); - - m.showMenu(0, e.clientHeight); - - Event.add(DOM.doc, 'mousedown', t.hideMenu, t); - DOM.addClass(t.id, t.classPrefix + 'Selected'); - - //DOM.get(t.id + '_text').focus(); - }, - - hideMenu : function(e) { - var t = this; - - if (t.menu && t.menu.isMenuVisible) { - DOM.removeClass(t.id, t.classPrefix + 'Selected'); - - // Prevent double toogles by canceling the mouse click event to the button - if (e && e.type == "mousedown" && (e.target.id == t.id + '_text' || e.target.id == t.id + '_open')) - return; - - if (!e || !DOM.getParent(e.target, '.mceMenu')) { - DOM.removeClass(t.id, t.classPrefix + 'Selected'); - Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); - t.menu.hideMenu(); - } - } - }, - - renderMenu : function() { - var t = this, m; - - m = t.settings.control_manager.createDropMenu(t.id + '_menu', { - menu_line : 1, - 'class' : t.classPrefix + 'Menu mceNoIcons', - max_width : 150, - max_height : 150 - }); - - m.onHideMenu.add(function() { - t.hideMenu(); - t.focus(); - }); - - m.add({ - title : t.settings.title, - 'class' : 'mceMenuItemTitle', - onclick : function() { - if (t.settings.onselect('') !== false) - t.select(''); // Must be runned after - } - }); - - each(t.items, function(o) { - // No value then treat it as a title - if (o.value === undefined) { - m.add({ - title : o.title, - role : "option", - 'class' : 'mceMenuItemTitle', - onclick : function() { - if (t.settings.onselect('') !== false) - t.select(''); // Must be runned after - } - }); - } else { - o.id = DOM.uniqueId(); - o.role= "option"; - o.onclick = function() { - if (t.settings.onselect(o.value) !== false) - t.select(o.value); // Must be runned after - }; - - m.add(o); - } - }); - - t.onRenderMenu.dispatch(t, m); - t.menu = m; - }, - - postRender : function() { - var t = this, cp = t.classPrefix; - - Event.add(t.id, 'click', t.showMenu, t); - Event.add(t.id, 'keydown', function(evt) { - if (evt.keyCode == 32) { // Space - t.showMenu(evt); - Event.cancel(evt); - } - }); - Event.add(t.id, 'focus', function() { - if (!t._focused) { - t.keyDownHandler = Event.add(t.id, 'keydown', function(e) { - if (e.keyCode == 40) { - t.showMenu(); - Event.cancel(e); - } - }); - t.keyPressHandler = Event.add(t.id, 'keypress', function(e) { - var v; - if (e.keyCode == 13) { - // Fake select on enter - v = t.selectedValue; - t.selectedValue = null; // Needs to be null to fake change - Event.cancel(e); - t.settings.onselect(v); - } - }); - } - - t._focused = 1; - }); - Event.add(t.id, 'blur', function() { - Event.remove(t.id, 'keydown', t.keyDownHandler); - Event.remove(t.id, 'keypress', t.keyPressHandler); - t._focused = 0; - }); - - // Old IE doesn't have hover on all elements - if (tinymce.isIE6 || !DOM.boxModel) { - Event.add(t.id, 'mouseover', function() { - if (!DOM.hasClass(t.id, cp + 'Disabled')) - DOM.addClass(t.id, cp + 'Hover'); - }); - - Event.add(t.id, 'mouseout', function() { - if (!DOM.hasClass(t.id, cp + 'Disabled')) - DOM.removeClass(t.id, cp + 'Hover'); - }); - } - - t.onPostRender.dispatch(t, DOM.get(t.id)); - }, - - destroy : function() { - this.parent(); - - Event.clear(this.id + '_text'); - Event.clear(this.id + '_open'); - } - }); -})(tinymce); - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher; - - tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox', { - NativeListBox : function(id, s) { - this.parent(id, s); - this.classPrefix = 'mceNativeListBox'; - }, - - setDisabled : function(s) { - DOM.get(this.id).disabled = s; - this.setAriaProperty('disabled', s); - }, - - isDisabled : function() { - return DOM.get(this.id).disabled; - }, - - select : function(va) { - var t = this, fv, f; - - if (va == undefined) - return t.selectByIndex(-1); - - // Is string or number make function selector - if (va && typeof(va)=="function") - f = va; - else { - f = function(v) { - return v == va; - }; - } - - // Do we need to do something? - if (va != t.selectedValue) { - // Find item - each(t.items, function(o, i) { - if (f(o.value)) { - fv = 1; - t.selectByIndex(i); - return false; - } - }); - - if (!fv) - t.selectByIndex(-1); - } - }, - - selectByIndex : function(idx) { - DOM.get(this.id).selectedIndex = idx + 1; - this.selectedValue = this.items[idx] ? this.items[idx].value : null; - }, - - add : function(n, v, a) { - var o, t = this; - - a = a || {}; - a.value = v; - - if (t.isRendered()) - DOM.add(DOM.get(this.id), 'option', a, n); - - o = { - title : n, - value : v, - attribs : a - }; - - t.items.push(o); - t.onAdd.dispatch(t, o); - }, - - getLength : function() { - return this.items.length; - }, - - renderHTML : function() { - var h, t = this; - - h = DOM.createHTML('option', {value : ''}, '-- ' + t.settings.title + ' --'); - - each(t.items, function(it) { - h += DOM.createHTML('option', {value : it.value}, it.title); - }); - - h = DOM.createHTML('select', {id : t.id, 'class' : 'mceNativeListBox', 'aria-labelledby': t.id + '_aria'}, h); - h += DOM.createHTML('span', {id : t.id + '_aria', 'style': 'display: none'}, t.settings.title); - return h; - }, - - postRender : function() { - var t = this, ch, changeListenerAdded = true; - - t.rendered = true; - - function onChange(e) { - var v = t.items[e.target.selectedIndex - 1]; - - if (v && (v = v.value)) { - t.onChange.dispatch(t, v); - - if (t.settings.onselect) - t.settings.onselect(v); - } - }; - - Event.add(t.id, 'change', onChange); - - // Accessibility keyhandler - Event.add(t.id, 'keydown', function(e) { - var bf; - - Event.remove(t.id, 'change', ch); - changeListenerAdded = false; - - bf = Event.add(t.id, 'blur', function() { - if (changeListenerAdded) return; - changeListenerAdded = true; - Event.add(t.id, 'change', onChange); - Event.remove(t.id, 'blur', bf); - }); - - //prevent default left and right keys on chrome - so that the keyboard navigation is used. - if (tinymce.isWebKit && (e.keyCode==37 ||e.keyCode==39)) { - return Event.prevent(e); - } - - if (e.keyCode == 13 || e.keyCode == 32) { - onChange(e); - return Event.cancel(e); - } - }); - - t.onPostRender.dispatch(t, DOM.get(t.id)); - } - }); -})(tinymce); - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each; - - tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button', { - MenuButton : function(id, s, ed) { - this.parent(id, s, ed); - - this.onRenderMenu = new tinymce.util.Dispatcher(this); - - s.menu_container = s.menu_container || DOM.doc.body; - }, - - showMenu : function() { - var t = this, p1, p2, e = DOM.get(t.id), m; - - if (t.isDisabled()) - return; - - if (!t.isMenuRendered) { - t.renderMenu(); - t.isMenuRendered = true; - } - - if (t.isMenuVisible) - return t.hideMenu(); - - p1 = DOM.getPos(t.settings.menu_container); - p2 = DOM.getPos(e); - - m = t.menu; - m.settings.offset_x = p2.x; - m.settings.offset_y = p2.y; - m.settings.vp_offset_x = p2.x; - m.settings.vp_offset_y = p2.y; - m.settings.keyboard_focus = t._focused; - m.showMenu(0, e.clientHeight); - - Event.add(DOM.doc, 'mousedown', t.hideMenu, t); - t.setState('Selected', 1); - - t.isMenuVisible = 1; - }, - - renderMenu : function() { - var t = this, m; - - m = t.settings.control_manager.createDropMenu(t.id + '_menu', { - menu_line : 1, - 'class' : this.classPrefix + 'Menu', - icons : t.settings.icons - }); - - m.onHideMenu.add(function() { - t.hideMenu(); - t.focus(); - }); - - t.onRenderMenu.dispatch(t, m); - t.menu = m; - }, - - hideMenu : function(e) { - var t = this; - - // Prevent double toogles by canceling the mouse click event to the button - if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id || e.id === t.id + '_open';})) - return; - - if (!e || !DOM.getParent(e.target, '.mceMenu')) { - t.setState('Selected', 0); - Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); - if (t.menu) - t.menu.hideMenu(); - } - - t.isMenuVisible = 0; - }, - - postRender : function() { - var t = this, s = t.settings; - - Event.add(t.id, 'click', function() { - if (!t.isDisabled()) { - if (s.onclick) - s.onclick(t.value); - - t.showMenu(); - } - }); - } - }); -})(tinymce); - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each; - - tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton', { - SplitButton : function(id, s, ed) { - this.parent(id, s, ed); - this.classPrefix = 'mceSplitButton'; - }, - - renderHTML : function() { - var h, t = this, s = t.settings, h1; - - h = ''; - - if (s.image) - h1 = DOM.createHTML('img ', {src : s.image, role: 'presentation', 'class' : 'mceAction ' + s['class']}); - else - h1 = DOM.createHTML('span', {'class' : 'mceAction ' + s['class']}, ''); - - h1 += DOM.createHTML('span', {'class': 'mceVoiceLabel mceIconOnly', id: t.id + '_voice', style: 'display:none;'}, s.title); - h += '' + DOM.createHTML('a', {role: 'button', id : t.id + '_action', tabindex: '-1', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + ''; - - h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']}, ''); - h += '' + DOM.createHTML('a', {role: 'button', id : t.id + '_open', tabindex: '-1', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + ''; - - h += ''; - h = DOM.createHTML('table', { role: 'presentation', 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', title : s.title}, h); - return DOM.createHTML('div', {id : t.id, role: 'button', tabindex: '0', 'aria-labelledby': t.id + '_voice', 'aria-haspopup': 'true'}, h); - }, - - postRender : function() { - var t = this, s = t.settings, activate; - - if (s.onclick) { - activate = function(evt) { - if (!t.isDisabled()) { - s.onclick(t.value); - Event.cancel(evt); - } - }; - Event.add(t.id + '_action', 'click', activate); - Event.add(t.id, ['click', 'keydown'], function(evt) { - var DOM_VK_SPACE = 32, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_UP = 38, DOM_VK_DOWN = 40; - if ((evt.keyCode === 32 || evt.keyCode === 13 || evt.keyCode === 14) && !evt.altKey && !evt.ctrlKey && !evt.metaKey) { - activate(); - Event.cancel(evt); - } else if (evt.type === 'click' || evt.keyCode === DOM_VK_DOWN) { - t.showMenu(); - Event.cancel(evt); - } - }); - } - - Event.add(t.id + '_open', 'click', function (evt) { - t.showMenu(); - Event.cancel(evt); - }); - Event.add([t.id, t.id + '_open'], 'focus', function() {t._focused = 1;}); - Event.add([t.id, t.id + '_open'], 'blur', function() {t._focused = 0;}); - - // Old IE doesn't have hover on all elements - if (tinymce.isIE6 || !DOM.boxModel) { - Event.add(t.id, 'mouseover', function() { - if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled')) - DOM.addClass(t.id, 'mceSplitButtonHover'); - }); - - Event.add(t.id, 'mouseout', function() { - if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled')) - DOM.removeClass(t.id, 'mceSplitButtonHover'); - }); - } - }, - - destroy : function() { - this.parent(); - - Event.clear(this.id + '_action'); - Event.clear(this.id + '_open'); - Event.clear(this.id); - } - }); -})(tinymce); - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each; - - tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton', { - ColorSplitButton : function(id, s, ed) { - var t = this; - - t.parent(id, s, ed); - - t.settings = s = tinymce.extend({ - colors : '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF', - grid_width : 8, - default_color : '#888888' - }, t.settings); - - t.onShowMenu = new tinymce.util.Dispatcher(t); - - t.onHideMenu = new tinymce.util.Dispatcher(t); - - t.value = s.default_color; - }, - - showMenu : function() { - var t = this, r, p, e, p2; - - if (t.isDisabled()) - return; - - if (!t.isMenuRendered) { - t.renderMenu(); - t.isMenuRendered = true; - } - - if (t.isMenuVisible) - return t.hideMenu(); - - e = DOM.get(t.id); - DOM.show(t.id + '_menu'); - DOM.addClass(e, 'mceSplitButtonSelected'); - p2 = DOM.getPos(e); - DOM.setStyles(t.id + '_menu', { - left : p2.x, - top : p2.y + e.clientHeight, - zIndex : 200000 - }); - e = 0; - - Event.add(DOM.doc, 'mousedown', t.hideMenu, t); - t.onShowMenu.dispatch(t); - - if (t._focused) { - t._keyHandler = Event.add(t.id + '_menu', 'keydown', function(e) { - if (e.keyCode == 27) - t.hideMenu(); - }); - - DOM.select('a', t.id + '_menu')[0].focus(); // Select first link - } - - t.isMenuVisible = 1; - }, - - hideMenu : function(e) { - var t = this; - - if (t.isMenuVisible) { - // Prevent double toogles by canceling the mouse click event to the button - if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id + '_open';})) - return; - - if (!e || !DOM.getParent(e.target, '.mceSplitButtonMenu')) { - DOM.removeClass(t.id, 'mceSplitButtonSelected'); - Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); - Event.remove(t.id + '_menu', 'keydown', t._keyHandler); - DOM.hide(t.id + '_menu'); - } - - t.isMenuVisible = 0; - t.onHideMenu.dispatch(); - } - }, - - renderMenu : function() { - var t = this, m, i = 0, s = t.settings, n, tb, tr, w, context; - - w = DOM.add(s.menu_container, 'div', {role: 'listbox', id : t.id + '_menu', 'class' : s['menu_class'] + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'}); - m = DOM.add(w, 'div', {'class' : s['class'] + ' mceSplitButtonMenu'}); - DOM.add(m, 'span', {'class' : 'mceMenuLine'}); - - n = DOM.add(m, 'table', {role: 'presentation', 'class' : 'mceColorSplitMenu'}); - tb = DOM.add(n, 'tbody'); - - // Generate color grid - i = 0; - each(is(s.colors, 'array') ? s.colors : s.colors.split(','), function(c) { - c = c.replace(/^#/, ''); - - if (!i--) { - tr = DOM.add(tb, 'tr'); - i = s.grid_width - 1; - } - - n = DOM.add(tr, 'td'); - var settings = { - href : 'javascript:;', - style : { - backgroundColor : '#' + c - }, - 'title': t.editor.getLang('colors.' + c, c), - 'data-mce-color' : '#' + c - }; - - // adding a proper ARIA role = button causes JAWS to read things incorrectly on IE. - if (!tinymce.isIE ) { - settings['role']= 'option'; - } - - n = DOM.add(n, 'a', settings); - - if (t.editor.forcedHighContrastMode) { - n = DOM.add(n, 'canvas', { width: 16, height: 16, 'aria-hidden': 'true' }); - if (n.getContext && (context = n.getContext("2d"))) { - context.fillStyle = '#' + c; - context.fillRect(0, 0, 16, 16); - } else { - // No point leaving a canvas element around if it's not supported for drawing on anyway. - DOM.remove(n); - } - } - }); - - if (s.more_colors_func) { - n = DOM.add(tb, 'tr'); - n = DOM.add(n, 'td', {colspan : s.grid_width, 'class' : 'mceMoreColors'}); - n = DOM.add(n, 'a', {role: 'option', id : t.id + '_more', href : 'javascript:;', onclick : 'return false;', 'class' : 'mceMoreColors'}, s.more_colors_title); - - Event.add(n, 'click', function(e) { - s.more_colors_func.call(s.more_colors_scope || this); - return Event.cancel(e); // Cancel to fix onbeforeunload problem - }); - } - - DOM.addClass(m, 'mceColorSplitMenu'); - - new tinymce.ui.KeyboardNavigation({ - root: t.id + '_menu', - items: DOM.select('a', t.id + '_menu'), - onCancel: function() { - t.hideMenu(); - t.focus(); - } - }); - - // Prevent IE from scrolling and hindering click to occur #4019 - Event.add(t.id + '_menu', 'mousedown', function(e) {return Event.cancel(e);}); - - Event.add(t.id + '_menu', 'click', function(e) { - var c; - - e = DOM.getParent(e.target, 'a', tb); - - if (e && e.nodeName.toLowerCase() == 'a' && (c = e.getAttribute('data-mce-color'))) - t.setColor(c); - - return Event.cancel(e); // Prevent IE auto save warning - }); - - return w; - }, - - setColor : function(c) { - this.displayColor(c); - this.hideMenu(); - this.settings.onselect(c); - }, - - displayColor : function(c) { - var t = this; - - DOM.setStyle(t.id + '_preview', 'backgroundColor', c); - - t.value = c; - }, - - postRender : function() { - var t = this, id = t.id; - - t.parent(); - DOM.add(id + '_action', 'div', {id : id + '_preview', 'class' : 'mceColorPreview'}); - DOM.setStyle(t.id + '_preview', 'backgroundColor', t.value); - }, - - destroy : function() { - this.parent(); - - Event.clear(this.id + '_menu'); - Event.clear(this.id + '_more'); - DOM.remove(this.id + '_menu'); - } - }); -})(tinymce); - -(function(tinymce) { -// Shorten class names -var dom = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event; -tinymce.create('tinymce.ui.ToolbarGroup:tinymce.ui.Container', { - renderHTML : function() { - var t = this, h = [], controls = t.controls, each = tinymce.each, settings = t.settings; - - h.push('
    '); - //TODO: ACC test this out - adding a role = application for getting the landmarks working well. - h.push(""); - h.push(''); - each(controls, function(toolbar) { - h.push(toolbar.renderHTML()); - }); - h.push(""); - h.push('
    '); - - return h.join(''); - }, - - focus : function() { - var t = this; - dom.get(t.id).focus(); - }, - - postRender : function() { - var t = this, items = []; - - each(t.controls, function(toolbar) { - each (toolbar.controls, function(control) { - if (control.id) { - items.push(control); - } - }); - }); - - t.keyNav = new tinymce.ui.KeyboardNavigation({ - root: t.id, - items: items, - onCancel: function() { - //Move focus if webkit so that navigation back will read the item. - if (tinymce.isWebKit) { - dom.get(t.editor.id+"_ifr").focus(); - } - t.editor.focus(); - }, - excludeFromTabOrder: !t.settings.tab_focus_toolbar - }); - }, - - destroy : function() { - var self = this; - - self.parent(); - self.keyNav.destroy(); - Event.clear(self.id); - } -}); -})(tinymce); - -(function(tinymce) { -// Shorten class names -var dom = tinymce.DOM, each = tinymce.each; -tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { - renderHTML : function() { - var t = this, h = '', c, co, s = t.settings, i, pr, nx, cl; - - cl = t.controls; - for (i=0; i')); - } - - // Add toolbar end before list box and after the previous button - // This is to fix the o2k7 editor skins - if (pr && co.ListBox) { - if (pr.Button || pr.SplitButton) - h += dom.createHTML('td', {'class' : 'mceToolbarEnd'}, dom.createHTML('span', null, '')); - } - - // Render control HTML - - // IE 8 quick fix, needed to propertly generate a hit area for anchors - if (dom.stdMode) - h += '' + co.renderHTML() + ''; - else - h += '' + co.renderHTML() + ''; - - // Add toolbar start after list box and before the next button - // This is to fix the o2k7 editor skins - if (nx && co.ListBox) { - if (nx.Button || nx.SplitButton) - h += dom.createHTML('td', {'class' : 'mceToolbarStart'}, dom.createHTML('span', null, '')); - } - } - - c = 'mceToolbarEnd'; - - if (co.Button) - c += ' mceToolbarEndButton'; - else if (co.SplitButton) - c += ' mceToolbarEndSplitButton'; - else if (co.ListBox) - c += ' mceToolbarEndListBox'; - - h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '')); - - return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || '', role: 'presentation', tabindex: '-1'}, '' + h + ''); - } -}); -})(tinymce); - -(function(tinymce) { - var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each; - - tinymce.create('tinymce.AddOnManager', { - AddOnManager : function() { - var self = this; - - self.items = []; - self.urls = {}; - self.lookup = {}; - self.onAdd = new Dispatcher(self); - }, - - get : function(n) { - if (this.lookup[n]) { - return this.lookup[n].instance; - } else { - return undefined; - } - }, - - dependencies : function(n) { - var result; - if (this.lookup[n]) { - result = this.lookup[n].dependencies; - } - return result || []; - }, - - requireLangPack : function(n) { - var s = tinymce.settings; - - if (s && s.language && s.language_load !== false) - tinymce.ScriptLoader.add(this.urls[n] + '/langs/' + s.language + '.js'); - }, - - add : function(id, o, dependencies) { - this.items.push(o); - this.lookup[id] = {instance:o, dependencies:dependencies}; - this.onAdd.dispatch(this, id, o); - - return o; - }, - createUrl: function(baseUrl, dep) { - if (typeof dep === "object") { - return dep - } else { - return {prefix: baseUrl.prefix, resource: dep, suffix: baseUrl.suffix}; - } - }, - - addComponents: function(pluginName, scripts) { - var pluginUrl = this.urls[pluginName]; - tinymce.each(scripts, function(script){ - tinymce.ScriptLoader.add(pluginUrl+"/"+script); - }); - }, - - load : function(n, u, cb, s) { - var t = this, url = u; - - function loadDependencies() { - var dependencies = t.dependencies(n); - tinymce.each(dependencies, function(dep) { - var newUrl = t.createUrl(u, dep); - t.load(newUrl.resource, newUrl, undefined, undefined); - }); - if (cb) { - if (s) { - cb.call(s); - } else { - cb.call(tinymce.ScriptLoader); - } - } - } - - if (t.urls[n]) - return; - if (typeof u === "object") - url = u.prefix + u.resource + u.suffix; - - if (url.indexOf('/') != 0 && url.indexOf('://') == -1) - url = tinymce.baseURL + '/' + url; - - t.urls[n] = url.substring(0, url.lastIndexOf('/')); - - if (t.lookup[n]) { - loadDependencies(); - } else { - tinymce.ScriptLoader.add(url, loadDependencies, s); - } - } - }); - - // Create plugin and theme managers - tinymce.PluginManager = new tinymce.AddOnManager(); - tinymce.ThemeManager = new tinymce.AddOnManager(); -}(tinymce)); - -(function(tinymce) { - // Shorten names - var each = tinymce.each, extend = tinymce.extend, - DOM = tinymce.DOM, Event = tinymce.dom.Event, - ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, - explode = tinymce.explode, - Dispatcher = tinymce.util.Dispatcher, undefined, instanceCounter = 0; - - // Setup some URLs where the editor API is located and where the document is - tinymce.documentBaseURL = window.location.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, ''); - if (!/[\/\\]$/.test(tinymce.documentBaseURL)) - tinymce.documentBaseURL += '/'; - - tinymce.baseURL = new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL); - - tinymce.baseURI = new tinymce.util.URI(tinymce.baseURL); - - // Add before unload listener - // This was required since IE was leaking memory if you added and removed beforeunload listeners - // with attachEvent/detatchEvent so this only adds one listener and instances can the attach to the onBeforeUnload event - tinymce.onBeforeUnload = new Dispatcher(tinymce); - - // Must be on window or IE will leak if the editor is placed in frame or iframe - Event.add(window, 'beforeunload', function(e) { - tinymce.onBeforeUnload.dispatch(tinymce, e); - }); - - tinymce.onAddEditor = new Dispatcher(tinymce); - - tinymce.onRemoveEditor = new Dispatcher(tinymce); - - tinymce.EditorManager = extend(tinymce, { - editors : [], - - i18n : {}, - - activeEditor : null, - - init : function(s) { - var t = this, pl, sl = tinymce.ScriptLoader, e, el = [], ed; - - function execCallback(se, n, s) { - var f = se[n]; - - if (!f) - return; - - if (tinymce.is(f, 'string')) { - s = f.replace(/\.\w+$/, ''); - s = s ? tinymce.resolve(s) : 0; - f = tinymce.resolve(f); - } - - return f.apply(s || this, Array.prototype.slice.call(arguments, 2)); - }; - - s = extend({ - theme : "simple", - language : "en" - }, s); - - t.settings = s; - - // Legacy call - Event.add(document, 'init', function() { - var l, co; - - execCallback(s, 'onpageload'); - - switch (s.mode) { - case "exact": - l = s.elements || ''; - - if(l.length > 0) { - each(explode(l), function(v) { - if (DOM.get(v)) { - ed = new tinymce.Editor(v, s); - el.push(ed); - ed.render(1); - } else { - each(document.forms, function(f) { - each(f.elements, function(e) { - if (e.name === v) { - v = 'mce_editor_' + instanceCounter++; - DOM.setAttrib(e, 'id', v); - - ed = new tinymce.Editor(v, s); - el.push(ed); - ed.render(1); - } - }); - }); - } - }); - } - break; - - case "textareas": - case "specific_textareas": - function hasClass(n, c) { - return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c); - }; - - each(DOM.select('textarea'), function(v) { - if (s.editor_deselector && hasClass(v, s.editor_deselector)) - return; - - if (!s.editor_selector || hasClass(v, s.editor_selector)) { - // Can we use the name - e = DOM.get(v.name); - if (!v.id && !e) - v.id = v.name; - - // Generate unique name if missing or already exists - if (!v.id || t.get(v.id)) - v.id = DOM.uniqueId(); - - ed = new tinymce.Editor(v.id, s); - el.push(ed); - ed.render(1); - } - }); - break; - } - - // Call onInit when all editors are initialized - if (s.oninit) { - l = co = 0; - - each(el, function(ed) { - co++; - - if (!ed.initialized) { - // Wait for it - ed.onInit.add(function() { - l++; - - // All done - if (l == co) - execCallback(s, 'oninit'); - }); - } else - l++; - - // All done - if (l == co) - execCallback(s, 'oninit'); - }); - } - }); - }, - - get : function(id) { - if (id === undefined) - return this.editors; - - return this.editors[id]; - }, - - getInstanceById : function(id) { - return this.get(id); - }, - - add : function(editor) { - var self = this, editors = self.editors; - - // Add named and index editor instance - editors[editor.id] = editor; - editors.push(editor); - - self._setActive(editor); - self.onAddEditor.dispatch(self, editor); - - - // Patch the tinymce.Editor instance with jQuery adapter logic - if (tinymce.adapter) - tinymce.adapter.patchEditor(editor); - - - return editor; - }, - - remove : function(editor) { - var t = this, i, editors = t.editors; - - // Not in the collection - if (!editors[editor.id]) - return null; - - delete editors[editor.id]; - - for (i = 0; i < editors.length; i++) { - if (editors[i] == editor) { - editors.splice(i, 1); - break; - } - } - - // Select another editor since the active one was removed - if (t.activeEditor == editor) - t._setActive(editors[0]); - - editor.destroy(); - t.onRemoveEditor.dispatch(t, editor); - - return editor; - }, - - execCommand : function(c, u, v) { - var t = this, ed = t.get(v), w; - - // Manager commands - switch (c) { - case "mceFocus": - ed.focus(); - return true; - - case "mceAddEditor": - case "mceAddControl": - if (!t.get(v)) - new tinymce.Editor(v, t.settings).render(); - - return true; - - case "mceAddFrameControl": - w = v.window; - - // Add tinyMCE global instance and tinymce namespace to specified window - w.tinyMCE = tinyMCE; - w.tinymce = tinymce; - - tinymce.DOM.doc = w.document; - tinymce.DOM.win = w; - - ed = new tinymce.Editor(v.element_id, v); - ed.render(); - - // Fix IE memory leaks - if (tinymce.isIE) { - function clr() { - ed.destroy(); - w.detachEvent('onunload', clr); - w = w.tinyMCE = w.tinymce = null; // IE leak - }; - - w.attachEvent('onunload', clr); - } - - v.page_window = null; - - return true; - - case "mceRemoveEditor": - case "mceRemoveControl": - if (ed) - ed.remove(); - - return true; - - case 'mceToggleEditor': - if (!ed) { - t.execCommand('mceAddControl', 0, v); - return true; - } - - if (ed.isHidden()) - ed.show(); - else - ed.hide(); - - return true; - } - - // Run command on active editor - if (t.activeEditor) - return t.activeEditor.execCommand(c, u, v); - - return false; - }, - - execInstanceCommand : function(id, c, u, v) { - var ed = this.get(id); - - if (ed) - return ed.execCommand(c, u, v); - - return false; - }, - - triggerSave : function() { - each(this.editors, function(e) { - e.save(); - }); - }, - - addI18n : function(p, o) { - var lo, i18n = this.i18n; - - if (!tinymce.is(p, 'string')) { - each(p, function(o, lc) { - each(o, function(o, g) { - each(o, function(o, k) { - if (g === 'common') - i18n[lc + '.' + k] = o; - else - i18n[lc + '.' + g + '.' + k] = o; - }); - }); - }); - } else { - each(o, function(o, k) { - i18n[p + '.' + k] = o; - }); - } - }, - - // Private methods - - _setActive : function(editor) { - this.selectedInstance = this.activeEditor = editor; - } - }); -})(tinymce); - -(function(tinymce) { - // Shorten these names - var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, - Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isGecko = tinymce.isGecko, - isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, is = tinymce.is, - ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, - inArray = tinymce.inArray, grep = tinymce.grep, explode = tinymce.explode, VK = tinymce.VK; - - tinymce.create('tinymce.Editor', { - Editor : function(id, s) { - var t = this; - - t.id = t.editorId = id; - - t.execCommands = {}; - t.queryStateCommands = {}; - t.queryValueCommands = {}; - - t.isNotDirty = false; - - t.plugins = {}; - - // Add events to the editor - each([ - 'onPreInit', - - 'onBeforeRenderUI', - - 'onPostRender', - - 'onLoad', - - 'onInit', - - 'onRemove', - - 'onActivate', - - 'onDeactivate', - - 'onClick', - - 'onEvent', - - 'onMouseUp', - - 'onMouseDown', - - 'onDblClick', - - 'onKeyDown', - - 'onKeyUp', - - 'onKeyPress', - - 'onContextMenu', - - 'onSubmit', - - 'onReset', - - 'onPaste', - - 'onPreProcess', - - 'onPostProcess', - - 'onBeforeSetContent', - - 'onBeforeGetContent', - - 'onSetContent', - - 'onGetContent', - - 'onLoadContent', - - 'onSaveContent', - - 'onNodeChange', - - 'onChange', - - 'onBeforeExecCommand', - - 'onExecCommand', - - 'onUndo', - - 'onRedo', - - 'onVisualAid', - - 'onSetProgressState', - - 'onSetAttrib' - ], function(e) { - t[e] = new Dispatcher(t); - }); - - t.settings = s = extend({ - id : id, - language : 'en', - docs_language : 'en', - theme : 'simple', - skin : 'default', - delta_width : 0, - delta_height : 0, - popup_css : '', - plugins : '', - document_base_url : tinymce.documentBaseURL, - add_form_submit_trigger : 1, - submit_patch : 1, - add_unload_trigger : 1, - convert_urls : 1, - relative_urls : 1, - remove_script_host : 1, - table_inline_editing : 0, - object_resizing : 1, - cleanup : 1, - accessibility_focus : 1, - custom_shortcuts : 1, - custom_undo_redo_keyboard_shortcuts : 1, - custom_undo_redo_restore_selection : 1, - custom_undo_redo : 1, - doctype : tinymce.isIE6 ? '' : '', // Use old doctype on IE 6 to avoid horizontal scroll - visual_table_class : 'mceItemTable', - visual : 1, - font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large', - font_size_legacy_values : 'xx-small,small,medium,large,x-large,xx-large,300%', // See: http://www.w3.org/TR/CSS2/fonts.html#propdef-font-size - apply_source_formatting : 1, - directionality : 'ltr', - forced_root_block : 'p', - hidden_input : 1, - padd_empty_editor : 1, - render_ui : 1, - init_theme : 1, - force_p_newlines : 1, - indentation : '30px', - keep_styles : 1, - fix_table_elements : 1, - inline_styles : 1, - convert_fonts_to_spans : true, - indent : 'simple', - indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr', - indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr', - validate : true, - entity_encoding : 'named', - url_converter : t.convertURL, - url_converter_scope : t, - ie7_compat : true - }, s); - - t.documentBaseURI = new tinymce.util.URI(s.document_base_url || tinymce.documentBaseURL, { - base_uri : tinyMCE.baseURI - }); - - t.baseURI = tinymce.baseURI; - - t.contentCSS = []; - - // Call setup - t.execCallback('setup', t); - }, - - render : function(nst) { - var t = this, s = t.settings, id = t.id, sl = tinymce.ScriptLoader; - - // Page is not loaded yet, wait for it - if (!Event.domLoaded) { - Event.add(document, 'init', function() { - t.render(); - }); - return; - } - - tinyMCE.settings = s; - - // Element not found, then skip initialization - if (!t.getElement()) - return; - - // Is a iPad/iPhone and not on iOS5, then skip initialization. We need to sniff - // here since the browser says it has contentEditable support but there is no visible - // caret We will remove this check ones Apple implements full contentEditable support - if (tinymce.isIDevice && !tinymce.isIOS5) - return; - - // Add hidden input for non input elements inside form elements - if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form')) - DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id); - - if (tinymce.WindowManager) - t.windowManager = new tinymce.WindowManager(t); - - if (s.encoding == 'xml') { - t.onGetContent.add(function(ed, o) { - if (o.save) - o.content = DOM.encode(o.content); - }); - } - - if (s.add_form_submit_trigger) { - t.onSubmit.addToTop(function() { - if (t.initialized) { - t.save(); - t.isNotDirty = 1; - } - }); - } - - if (s.add_unload_trigger) { - t._beforeUnload = tinyMCE.onBeforeUnload.add(function() { - if (t.initialized && !t.destroyed && !t.isHidden()) - t.save({format : 'raw', no_events : true}); - }); - } - - tinymce.addUnload(t.destroy, t); - - if (s.submit_patch) { - t.onBeforeRenderUI.add(function() { - var n = t.getElement().form; - - if (!n) - return; - - // Already patched - if (n._mceOldSubmit) - return; - - // Check page uses id="submit" or name="submit" for it's submit button - if (!n.submit.nodeType && !n.submit.length) { - t.formElement = n; - n._mceOldSubmit = n.submit; - n.submit = function() { - // Save all instances - tinymce.triggerSave(); - t.isNotDirty = 1; - - return t.formElement._mceOldSubmit(t.formElement); - }; - } - - n = null; - }); - } - - // Load scripts - function loadScripts() { - if (s.language && s.language_load !== false) - sl.add(tinymce.baseURL + '/langs/' + s.language + '.js'); - - if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme]) - ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js'); - - each(explode(s.plugins), function(p) { - if (p &&!PluginManager.urls[p]) { - if (p.charAt(0) == '-') { - p = p.substr(1, p.length); - var dependencies = PluginManager.dependencies(p); - each(dependencies, function(dep) { - var defaultSettings = {prefix:'plugins/', resource: dep, suffix:'/editor_plugin' + tinymce.suffix + '.js'}; - var dep = PluginManager.createUrl(defaultSettings, dep); - PluginManager.load(dep.resource, dep); - - }); - } else { - // Skip safari plugin, since it is removed as of 3.3b1 - if (p == 'safari') { - return; - } - PluginManager.load(p, {prefix:'plugins/', resource: p, suffix:'/editor_plugin' + tinymce.suffix + '.js'}); - } - } - }); - - // Init when que is loaded - sl.loadQueue(function() { - if (!t.removed) - t.init(); - }); - }; - - loadScripts(); - }, - - init : function() { - var n, t = this, s = t.settings, w, h, e = t.getElement(), o, ti, u, bi, bc, re, i, initializedPlugins = []; - - tinymce.add(t); - - s.aria_label = s.aria_label || DOM.getAttrib(e, 'aria-label', t.getLang('aria.rich_text_area')); - - if (s.theme) { - s.theme = s.theme.replace(/-/, ''); - o = ThemeManager.get(s.theme); - t.theme = new o(); - - if (t.theme.init && s.init_theme) - t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, '')); - } - function initPlugin(p) { - var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po; - if (c && tinymce.inArray(initializedPlugins,p) === -1) { - each(PluginManager.dependencies(p), function(dep){ - initPlugin(dep); - }); - po = new c(t, u); - - t.plugins[p] = po; - - if (po.init) { - po.init(t, u); - initializedPlugins.push(p); - } - } - } - - // Create all plugins - each(explode(s.plugins.replace(/\-/g, '')), initPlugin); - - // Setup popup CSS path(s) - if (s.popup_css !== false) { - if (s.popup_css) - s.popup_css = t.documentBaseURI.toAbsolute(s.popup_css); - else - s.popup_css = t.baseURI.toAbsolute("themes/" + s.theme + "/skins/" + s.skin + "/dialog.css"); - } - - if (s.popup_css_add) - s.popup_css += ',' + t.documentBaseURI.toAbsolute(s.popup_css_add); - - t.controlManager = new tinymce.ControlManager(t); - - if (s.custom_undo_redo) { - t.onBeforeExecCommand.add(function(ed, cmd, ui, val, a) { - if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo)) - t.undoManager.beforeChange(); - }); - - t.onExecCommand.add(function(ed, cmd, ui, val, a) { - if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo)) - t.undoManager.add(); - }); - } - - t.onExecCommand.add(function(ed, c) { - // Don't refresh the select lists until caret move - if (!/^(FontName|FontSize)$/.test(c)) - t.nodeChanged(); - }); - - // Remove ghost selections on images and tables in Gecko - if (isGecko) { - function repaint(a, o) { - if (!o || !o.initial) - t.execCommand('mceRepaint'); - }; - - t.onUndo.add(repaint); - t.onRedo.add(repaint); - t.onSetContent.add(repaint); - } - - // Enables users to override the control factory - t.onBeforeRenderUI.dispatch(t, t.controlManager); - - // Measure box - if (s.render_ui) { - w = s.width || e.style.width || e.offsetWidth; - h = s.height || e.style.height || e.offsetHeight; - t.orgDisplay = e.style.display; - re = /^[0-9\.]+(|px)$/i; - - if (re.test('' + w)) - w = Math.max(parseInt(w) + (o.deltaWidth || 0), 100); - - if (re.test('' + h)) - h = Math.max(parseInt(h) + (o.deltaHeight || 0), 100); - - // Render UI - o = t.theme.renderUI({ - targetNode : e, - width : w, - height : h, - deltaWidth : s.delta_width, - deltaHeight : s.delta_height - }); - - t.editorContainer = o.editorContainer; - } - - - // User specified a document.domain value - if (document.domain && location.hostname != document.domain) - tinymce.relaxedDomain = document.domain; - - // Resize editor - DOM.setStyles(o.sizeContainer || o.editorContainer, { - width : w, - height : h - }); - - // Load specified content CSS last - if (s.content_css) { - tinymce.each(explode(s.content_css), function(u) { - t.contentCSS.push(t.documentBaseURI.toAbsolute(u)); - }); - } - - h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : ''); - if (h < 100) - h = 100; - - t.iframeHTML = s.doctype + ''; - - // We only need to override paths if we have to - // IE has a bug where it remove site absolute urls to relative ones if this is specified - if (s.document_base_url != tinymce.documentBaseURL) - t.iframeHTML += ''; - - // IE8 doesn't support carets behind images setting ie7_compat would force IE8+ to run in IE7 compat mode. - if (s.ie7_compat) - t.iframeHTML += ''; - else - t.iframeHTML += ''; - - t.iframeHTML += ''; - - // Load the CSS by injecting them into the HTML this will reduce "flicker" - for (i = 0; i < t.contentCSS.length; i++) { - t.iframeHTML += ''; - } - - t.contentCSS = []; - - bi = s.body_id || 'tinymce'; - if (bi.indexOf('=') != -1) { - bi = t.getParam('body_id', '', 'hash'); - bi = bi[t.id] || bi; - } - - bc = s.body_class || ''; - if (bc.indexOf('=') != -1) { - bc = t.getParam('body_class', '', 'hash'); - bc = bc[t.id] || ''; - } - - t.iframeHTML += '
    '; - - // Domain relaxing enabled, then set document domain - if (tinymce.relaxedDomain && (isIE || (tinymce.isOpera && parseFloat(opera.version()) < 11))) { - // We need to write the contents here in IE since multiple writes messes up refresh button and back button - u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'; - } - - // Create iframe - // TODO: ACC add the appropriate description on this. - n = DOM.add(o.iframeContainer, 'iframe', { - id : t.id + "_ifr", - src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7 - frameBorder : '0', - allowTransparency : "true", - title : s.aria_label, - style : { - width : '100%', - height : h, - display : 'block' // Important for Gecko to render the iframe correctly - } - }); - - t.contentAreaContainer = o.iframeContainer; - DOM.get(o.editorContainer).style.display = t.orgDisplay; - DOM.get(t.id).style.display = 'none'; - DOM.setAttrib(t.id, 'aria-hidden', true); - - if (!tinymce.relaxedDomain || !u) - t.setupIframe(); - - e = n = o = null; // Cleanup - }, - - setupIframe : function() { - var t = this, s = t.settings, e = DOM.get(t.id), d = t.getDoc(), h, b; - - // Setup iframe body - if (!isIE || !tinymce.relaxedDomain) { - d.open(); - d.write(t.iframeHTML); - d.close(); - - if (tinymce.relaxedDomain) - d.domain = tinymce.relaxedDomain; - } - - // It will not steal focus while setting contentEditable - b = t.getBody(); - b.disabled = true; - - if (!s.readonly) - b.contentEditable = true; - - b.disabled = false; - - t.schema = new tinymce.html.Schema(s); - - t.dom = new tinymce.dom.DOMUtils(t.getDoc(), { - keep_values : true, - url_converter : t.convertURL, - url_converter_scope : t, - hex_colors : s.force_hex_style_colors, - class_filter : s.class_filter, - update_styles : 1, - fix_ie_paragraphs : 1, - schema : t.schema - }); - - t.parser = new tinymce.html.DomParser(s, t.schema); - - // Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included. - if (!t.settings.allow_html_in_named_anchor) { - t.parser.addAttributeFilter('name', function(nodes, name) { - var i = nodes.length, sibling, prevSibling, parent, node; - - while (i--) { - node = nodes[i]; - if (node.name === 'a' && node.firstChild) { - parent = node.parent; - - // Move children after current node - sibling = node.lastChild; - do { - prevSibling = sibling.prev; - parent.insert(sibling, node); - sibling = prevSibling; - } while (sibling); - } - } - }); - } - - // Convert src and href into data-mce-src, data-mce-href and data-mce-style - t.parser.addAttributeFilter('src,href,style', function(nodes, name) { - var i = nodes.length, node, dom = t.dom, value, internalName; - - while (i--) { - node = nodes[i]; - value = node.attr(name); - internalName = 'data-mce-' + name; - - // Add internal attribute if we need to we don't on a refresh of the document - if (!node.attributes.map[internalName]) { - if (name === "style") - node.attr(internalName, dom.serializeStyle(dom.parseStyle(value), node.name)); - else - node.attr(internalName, t.convertURL(value, name, node.name)); - } - } - }); - - // Keep scripts from executing - t.parser.addNodeFilter('script', function(nodes, name) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - node.attr('type', 'mce-' + (node.attr('type') || 'text/javascript')); - } - }); - - t.parser.addNodeFilter('#cdata', function(nodes, name) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - node.type = 8; - node.name = '#comment'; - node.value = '[CDATA[' + node.value + ']]'; - } - }); - - t.parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function(nodes, name) { - var i = nodes.length, node, nonEmptyElements = t.schema.getNonEmptyElements(); - - while (i--) { - node = nodes[i]; - - if (node.isEmpty(nonEmptyElements)) - node.empty().append(new tinymce.html.Node('br', 1)).shortEnded = true; - } - }); - - t.serializer = new tinymce.dom.Serializer(s, t.dom, t.schema); - - t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer); - - t.formatter = new tinymce.Formatter(this); - - // Register default formats - t.formatter.register({ - alignleft : [ - {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}}, - {selector : 'img,table', collapsed : false, styles : {'float' : 'left'}} - ], - - aligncenter : [ - {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}}, - {selector : 'img', collapsed : false, styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}}, - {selector : 'table', collapsed : false, styles : {marginLeft : 'auto', marginRight : 'auto'}} - ], - - alignright : [ - {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}}, - {selector : 'img,table', collapsed : false, styles : {'float' : 'right'}} - ], - - alignfull : [ - {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'justify'}} - ], - - bold : [ - {inline : 'strong', remove : 'all'}, - {inline : 'span', styles : {fontWeight : 'bold'}}, - {inline : 'b', remove : 'all'} - ], - - italic : [ - {inline : 'em', remove : 'all'}, - {inline : 'span', styles : {fontStyle : 'italic'}}, - {inline : 'i', remove : 'all'} - ], - - underline : [ - {inline : 'span', styles : {textDecoration : 'underline'}, exact : true}, - {inline : 'u', remove : 'all'} - ], - - strikethrough : [ - {inline : 'span', styles : {textDecoration : 'line-through'}, exact : true}, - {inline : 'strike', remove : 'all'} - ], - - forecolor : {inline : 'span', styles : {color : '%value'}, wrap_links : false}, - hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}, wrap_links : false}, - fontname : {inline : 'span', styles : {fontFamily : '%value'}}, - fontsize : {inline : 'span', styles : {fontSize : '%value'}}, - fontsize_class : {inline : 'span', attributes : {'class' : '%value'}}, - blockquote : {block : 'blockquote', wrapper : 1, remove : 'all'}, - subscript : {inline : 'sub'}, - superscript : {inline : 'sup'}, - - link : {inline : 'a', selector : 'a', remove : 'all', split : true, deep : true, - onmatch : function(node) { - return true; - }, - - onformat : function(elm, fmt, vars) { - each(vars, function(value, key) { - t.dom.setAttrib(elm, key, value); - }); - } - }, - - removeformat : [ - {selector : 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand : true, deep : true}, - {selector : 'span', attributes : ['style', 'class'], remove : 'empty', split : true, expand : false, deep : true}, - {selector : '*', attributes : ['style', 'class'], split : false, expand : false, deep : true} - ] - }); - - // Register default block formats - each('p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp'.split(/\s/), function(name) { - t.formatter.register(name, {block : name, remove : 'all'}); - }); - - // Register user defined formats - t.formatter.register(t.settings.formats); - - t.undoManager = new tinymce.UndoManager(t); - - // Pass through - t.undoManager.onAdd.add(function(um, l) { - if (um.hasUndo()) - return t.onChange.dispatch(t, l, um); - }); - - t.undoManager.onUndo.add(function(um, l) { - return t.onUndo.dispatch(t, l, um); - }); - - t.undoManager.onRedo.add(function(um, l) { - return t.onRedo.dispatch(t, l, um); - }); - - t.forceBlocks = new tinymce.ForceBlocks(t, { - forced_root_block : s.forced_root_block - }); - - t.editorCommands = new tinymce.EditorCommands(t); - - // Pass through - t.serializer.onPreProcess.add(function(se, o) { - return t.onPreProcess.dispatch(t, o, se); - }); - - t.serializer.onPostProcess.add(function(se, o) { - return t.onPostProcess.dispatch(t, o, se); - }); - - t.onPreInit.dispatch(t); - - if (!s.gecko_spellcheck) - t.getBody().spellcheck = 0; - - if (!s.readonly) - t._addEvents(); - - t.controlManager.onPostRender.dispatch(t, t.controlManager); - t.onPostRender.dispatch(t); - - t.quirks = new tinymce.util.Quirks(this); - - if (s.directionality) - t.getBody().dir = s.directionality; - - if (s.nowrap) - t.getBody().style.whiteSpace = "nowrap"; - - if (s.handle_node_change_callback) { - t.onNodeChange.add(function(ed, cm, n) { - t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed()); - }); - } - - if (s.save_callback) { - t.onSaveContent.add(function(ed, o) { - var h = t.execCallback('save_callback', t.id, o.content, t.getBody()); - - if (h) - o.content = h; - }); - } - - if (s.onchange_callback) { - t.onChange.add(function(ed, l) { - t.execCallback('onchange_callback', t, l); - }); - } - - if (s.protect) { - t.onBeforeSetContent.add(function(ed, o) { - if (s.protect) { - each(s.protect, function(pattern) { - o.content = o.content.replace(pattern, function(str) { - return ''; - }); - }); - } - }); - } - - if (s.convert_newlines_to_brs) { - t.onBeforeSetContent.add(function(ed, o) { - if (o.initial) - o.content = o.content.replace(/\r?\n/g, '
    '); - }); - } - - if (s.preformatted) { - t.onPostProcess.add(function(ed, o) { - o.content = o.content.replace(/^\s*/, ''); - o.content = o.content.replace(/<\/pre>\s*$/, ''); - - if (o.set) - o.content = '
    ' + o.content + '
    '; - }); - } - - if (s.verify_css_classes) { - t.serializer.attribValueFilter = function(n, v) { - var s, cl; - - if (n == 'class') { - // Build regexp for classes - if (!t.classesRE) { - cl = t.dom.getClasses(); - - if (cl.length > 0) { - s = ''; - - each (cl, function(o) { - s += (s ? '|' : '') + o['class']; - }); - - t.classesRE = new RegExp('(' + s + ')', 'gi'); - } - } - - return !t.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v) || t.classesRE.test(v) ? v : ''; - } - - return v; - }; - } - - if (s.cleanup_callback) { - t.onBeforeSetContent.add(function(ed, o) { - o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); - }); - - t.onPreProcess.add(function(ed, o) { - if (o.set) - t.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o); - - if (o.get) - t.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o); - }); - - t.onPostProcess.add(function(ed, o) { - if (o.set) - o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); - - if (o.get) - o.content = t.execCallback('cleanup_callback', 'get_from_editor', o.content, o); - }); - } - - if (s.save_callback) { - t.onGetContent.add(function(ed, o) { - if (o.save) - o.content = t.execCallback('save_callback', t.id, o.content, t.getBody()); - }); - } - - if (s.handle_event_callback) { - t.onEvent.add(function(ed, e, o) { - if (t.execCallback('handle_event_callback', e, ed, o) === false) - Event.cancel(e); - }); - } - - // Add visual aids when new contents is added - t.onSetContent.add(function() { - t.addVisual(t.getBody()); - }); - - // Remove empty contents - if (s.padd_empty_editor) { - t.onPostProcess.add(function(ed, o) { - o.content = o.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/, ''); - }); - } - - if (isGecko) { - // Fix gecko link bug, when a link is placed at the end of block elements there is - // no way to move the caret behind the link. This fix adds a bogus br element after the link - function fixLinks(ed, o) { - each(ed.dom.select('a'), function(n) { - var pn = n.parentNode; - - if (ed.dom.isBlock(pn) && pn.lastChild === n) - ed.dom.add(pn, 'br', {'data-mce-bogus' : 1}); - }); - }; - - t.onExecCommand.add(function(ed, cmd) { - if (cmd === 'CreateLink') - fixLinks(ed); - }); - - t.onSetContent.add(t.selection.onSetContent.add(fixLinks)); - } - - t.load({initial : true, format : 'html'}); - t.startContent = t.getContent({format : 'raw'}); - t.undoManager.add(); - t.initialized = true; - - t.onInit.dispatch(t); - t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc()); - t.execCallback('init_instance_callback', t); - t.focus(true); - t.nodeChanged({initial : 1}); - - // Load specified content CSS last - each(t.contentCSS, function(u) { - t.dom.loadCSS(u); - }); - - // Handle auto focus - if (s.auto_focus) { - setTimeout(function () { - var ed = tinymce.get(s.auto_focus); - - ed.selection.select(ed.getBody(), 1); - ed.selection.collapse(1); - ed.getBody().focus(); - ed.getWin().focus(); - }, 100); - } - - e = null; - }, - - - focus : function(sf) { - var oed, t = this, selection = t.selection, ce = t.settings.content_editable, ieRng, controlElm, doc = t.getDoc(); - - if (!sf) { - // Get selected control element - ieRng = selection.getRng(); - if (ieRng.item) { - controlElm = ieRng.item(0); - } - - t._refreshContentEditable(); - - // Is not content editable - if (!ce) - t.getWin().focus(); - - // Focus the body as well since it's contentEditable - if (tinymce.isGecko) { - t.getBody().focus(); - } - - // Restore selected control element - // This is needed when for example an image is selected within a - // layer a call to focus will then remove the control selection - if (controlElm && controlElm.ownerDocument == doc) { - ieRng = doc.body.createControlRange(); - ieRng.addElement(controlElm); - ieRng.select(); - } - - } - - if (tinymce.activeEditor != t) { - if ((oed = tinymce.activeEditor) != null) - oed.onDeactivate.dispatch(oed, t); - - t.onActivate.dispatch(t, oed); - } - - tinymce._setActive(t); - }, - - execCallback : function(n) { - var t = this, f = t.settings[n], s; - - if (!f) - return; - - // Look through lookup - if (t.callbackLookup && (s = t.callbackLookup[n])) { - f = s.func; - s = s.scope; - } - - if (is(f, 'string')) { - s = f.replace(/\.\w+$/, ''); - s = s ? tinymce.resolve(s) : 0; - f = tinymce.resolve(f); - t.callbackLookup = t.callbackLookup || {}; - t.callbackLookup[n] = {func : f, scope : s}; - } - - return f.apply(s || t, Array.prototype.slice.call(arguments, 1)); - }, - - translate : function(s) { - var c = this.settings.language || 'en', i18n = tinymce.i18n; - - if (!s) - return ''; - - return i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) { - return i18n[c + '.' + b] || '{#' + b + '}'; - }); - }, - - getLang : function(n, dv) { - return tinymce.i18n[(this.settings.language || 'en') + '.' + n] || (is(dv) ? dv : '{#' + n + '}'); - }, - - getParam : function(n, dv, ty) { - var tr = tinymce.trim, v = is(this.settings[n]) ? this.settings[n] : dv, o; - - if (ty === 'hash') { - o = {}; - - if (is(v, 'string')) { - each(v.indexOf('=') > 0 ? v.split(/[;,](?![^=;,]*(?:[;,]|$))/) : v.split(','), function(v) { - v = v.split('='); - - if (v.length > 1) - o[tr(v[0])] = tr(v[1]); - else - o[tr(v[0])] = tr(v); - }); - } else - o = v; - - return o; - } - - return v; - }, - - nodeChanged : function(o) { - var t = this, s = t.selection, n = s.getStart() || t.getBody(); - - // Fix for bug #1896577 it seems that this can not be fired while the editor is loading - if (t.initialized) { - o = o || {}; - n = isIE && n.ownerDocument != t.getDoc() ? t.getBody() : n; // Fix for IE initial state - - // Get parents and add them to object - o.parents = []; - t.dom.getParent(n, function(node) { - if (node.nodeName == 'BODY') - return true; - - o.parents.push(node); - }); - - t.onNodeChange.dispatch( - t, - o ? o.controlManager || t.controlManager : t.controlManager, - n, - s.isCollapsed(), - o - ); - } - }, - - addButton : function(n, s) { - var t = this; - - t.buttons = t.buttons || {}; - t.buttons[n] = s; - }, - - addCommand : function(name, callback, scope) { - this.execCommands[name] = {func : callback, scope : scope || this}; - }, - - addQueryStateHandler : function(name, callback, scope) { - this.queryStateCommands[name] = {func : callback, scope : scope || this}; - }, - - addQueryValueHandler : function(name, callback, scope) { - this.queryValueCommands[name] = {func : callback, scope : scope || this}; - }, - - addShortcut : function(pa, desc, cmd_func, sc) { - var t = this, c; - - if (!t.settings.custom_shortcuts) - return false; - - t.shortcuts = t.shortcuts || {}; - - if (is(cmd_func, 'string')) { - c = cmd_func; - - cmd_func = function() { - t.execCommand(c, false, null); - }; - } - - if (is(cmd_func, 'object')) { - c = cmd_func; - - cmd_func = function() { - t.execCommand(c[0], c[1], c[2]); - }; - } - - each(explode(pa), function(pa) { - var o = { - func : cmd_func, - scope : sc || this, - desc : desc, - alt : false, - ctrl : false, - shift : false - }; - - each(explode(pa, '+'), function(v) { - switch (v) { - case 'alt': - case 'ctrl': - case 'shift': - o[v] = true; - break; - - default: - o.charCode = v.charCodeAt(0); - o.keyCode = v.toUpperCase().charCodeAt(0); - } - }); - - t.shortcuts[(o.ctrl ? 'ctrl' : '') + ',' + (o.alt ? 'alt' : '') + ',' + (o.shift ? 'shift' : '') + ',' + o.keyCode] = o; - }); - - return true; - }, - - execCommand : function(cmd, ui, val, a) { - var t = this, s = 0, o, st; - - if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd) && (!a || !a.skip_focus)) - t.focus(); - - a = extend({}, a); - t.onBeforeExecCommand.dispatch(t, cmd, ui, val, a); - if (a.terminate) - return false; - - // Command callback - if (t.execCallback('execcommand_callback', t.id, t.selection.getNode(), cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return true; - } - - // Registred commands - if (o = t.execCommands[cmd]) { - st = o.func.call(o.scope, ui, val); - - // Fall through on true - if (st !== true) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return st; - } - } - - // Plugin commands - each(t.plugins, function(p) { - if (p.execCommand && p.execCommand(cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - s = 1; - return false; - } - }); - - if (s) - return true; - - // Theme commands - if (t.theme && t.theme.execCommand && t.theme.execCommand(cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return true; - } - - // Editor commands - if (t.editorCommands.execCommand(cmd, ui, val)) { - t.onExecCommand.dispatch(t, cmd, ui, val, a); - return true; - } - - // Browser commands - t.getDoc().execCommand(cmd, ui, val); - t.onExecCommand.dispatch(t, cmd, ui, val, a); - }, - - queryCommandState : function(cmd) { - var t = this, o, s; - - // Is hidden then return undefined - if (t._isHidden()) - return; - - // Registred commands - if (o = t.queryStateCommands[cmd]) { - s = o.func.call(o.scope); - - // Fall though on true - if (s !== true) - return s; - } - - // Registred commands - o = t.editorCommands.queryCommandState(cmd); - if (o !== -1) - return o; - - // Browser commands - try { - return this.getDoc().queryCommandState(cmd); - } catch (ex) { - // Fails sometimes see bug: 1896577 - } - }, - - queryCommandValue : function(c) { - var t = this, o, s; - - // Is hidden then return undefined - if (t._isHidden()) - return; - - // Registred commands - if (o = t.queryValueCommands[c]) { - s = o.func.call(o.scope); - - // Fall though on true - if (s !== true) - return s; - } - - // Registred commands - o = t.editorCommands.queryCommandValue(c); - if (is(o)) - return o; - - // Browser commands - try { - return this.getDoc().queryCommandValue(c); - } catch (ex) { - // Fails sometimes see bug: 1896577 - } - }, - - show : function() { - var t = this; - - DOM.show(t.getContainer()); - DOM.hide(t.id); - t.load(); - }, - - hide : function() { - var t = this, d = t.getDoc(); - - // Fixed bug where IE has a blinking cursor left from the editor - if (isIE && d) - d.execCommand('SelectAll'); - - // We must save before we hide so Safari doesn't crash - t.save(); - DOM.hide(t.getContainer()); - DOM.setStyle(t.id, 'display', t.orgDisplay); - }, - - isHidden : function() { - return !DOM.isHidden(this.id); - }, - - setProgressState : function(b, ti, o) { - this.onSetProgressState.dispatch(this, b, ti, o); - - return b; - }, - - load : function(o) { - var t = this, e = t.getElement(), h; - - if (e) { - o = o || {}; - o.load = true; - - // Double encode existing entities in the value - h = t.setContent(is(e.value) ? e.value : e.innerHTML, o); - o.element = e; - - if (!o.no_events) - t.onLoadContent.dispatch(t, o); - - o.element = e = null; - - return h; - } - }, - - save : function(o) { - var t = this, e = t.getElement(), h, f; - - if (!e || !t.initialized) - return; - - o = o || {}; - o.save = true; - - // Add undo level will trigger onchange event - if (!o.no_events) { - t.undoManager.typing = false; - t.undoManager.add(); - } - - o.element = e; - h = o.content = t.getContent(o); - - if (!o.no_events) - t.onSaveContent.dispatch(t, o); - - h = o.content; - - if (!/TEXTAREA|INPUT/i.test(e.nodeName)) { - e.innerHTML = h; - - // Update hidden form element - if (f = DOM.getParent(t.id, 'form')) { - each(f.elements, function(e) { - if (e.name == t.id) { - e.value = h; - return false; - } - }); - } - } else - e.value = h; - - o.element = e = null; - - return h; - }, - - setContent : function(content, args) { - var self = this, rootNode, body = self.getBody(), forcedRootBlockName; - - // Setup args object - args = args || {}; - args.format = args.format || 'html'; - args.set = true; - args.content = content; - - // Do preprocessing - if (!args.no_events) - self.onBeforeSetContent.dispatch(self, args); - - content = args.content; - - // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content - // It will also be impossible to place the caret in the editor unless there is a BR element present - if (!tinymce.isIE && (content.length === 0 || /^\s+$/.test(content))) { - forcedRootBlockName = self.settings.forced_root_block; - if (forcedRootBlockName) - content = '<' + forcedRootBlockName + '>
    '; - else - content = '
    '; - - body.innerHTML = content; - self.selection.select(body, true); - self.selection.collapse(true); - return; - } - - // Parse and serialize the html - if (args.format !== 'raw') { - content = new tinymce.html.Serializer({}, self.schema).serialize( - self.parser.parse(content) - ); - } - - // Set the new cleaned contents to the editor - args.content = tinymce.trim(content); - self.dom.setHTML(body, args.content); - - // Do post processing - if (!args.no_events) - self.onSetContent.dispatch(self, args); - - self.selection.normalize(); - - return args.content; - }, - - getContent : function(args) { - var self = this, content; - - // Setup args object - args = args || {}; - args.format = args.format || 'html'; - args.get = true; - - // Do preprocessing - if (!args.no_events) - self.onBeforeGetContent.dispatch(self, args); - - // Get raw contents or by default the cleaned contents - if (args.format == 'raw') - content = self.getBody().innerHTML; - else - content = self.serializer.serialize(self.getBody(), args); - - args.content = tinymce.trim(content); - - // Do post processing - if (!args.no_events) - self.onGetContent.dispatch(self, args); - - return args.content; - }, - - isDirty : function() { - var self = this; - - return tinymce.trim(self.startContent) != tinymce.trim(self.getContent({format : 'raw', no_events : 1})) && !self.isNotDirty; - }, - - getContainer : function() { - var t = this; - - if (!t.container) - t.container = DOM.get(t.editorContainer || t.id + '_parent'); - - return t.container; - }, - - getContentAreaContainer : function() { - return this.contentAreaContainer; - }, - - getElement : function() { - return DOM.get(this.settings.content_element || this.id); - }, - - getWin : function() { - var t = this, e; - - if (!t.contentWindow) { - e = DOM.get(t.id + "_ifr"); - - if (e) - t.contentWindow = e.contentWindow; - } - - return t.contentWindow; - }, - - getDoc : function() { - var t = this, w; - - if (!t.contentDocument) { - w = t.getWin(); - - if (w) - t.contentDocument = w.document; - } - - return t.contentDocument; - }, - - getBody : function() { - return this.bodyElement || this.getDoc().body; - }, - - convertURL : function(u, n, e) { - var t = this, s = t.settings; - - // Use callback instead - if (s.urlconverter_callback) - return t.execCallback('urlconverter_callback', u, e, true, n); - - // Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs - if (!s.convert_urls || (e && e.nodeName == 'LINK') || u.indexOf('file:') === 0) - return u; - - // Convert to relative - if (s.relative_urls) - return t.documentBaseURI.toRelative(u); - - // Convert to absolute - u = t.documentBaseURI.toAbsolute(u, s.remove_script_host); - - return u; - }, - - addVisual : function(e) { - var t = this, s = t.settings; - - e = e || t.getBody(); - - if (!is(t.hasVisual)) - t.hasVisual = s.visual; - - each(t.dom.select('table,a', e), function(e) { - var v; - - switch (e.nodeName) { - case 'TABLE': - v = t.dom.getAttrib(e, 'border'); - - if (!v || v == '0') { - if (t.hasVisual) - t.dom.addClass(e, s.visual_table_class); - else - t.dom.removeClass(e, s.visual_table_class); - } - - return; - - case 'A': - v = t.dom.getAttrib(e, 'name'); - - if (v) { - if (t.hasVisual) - t.dom.addClass(e, 'mceItemAnchor'); - else - t.dom.removeClass(e, 'mceItemAnchor'); - } - - return; - } - }); - - t.onVisualAid.dispatch(t, e, t.hasVisual); - }, - - remove : function() { - var t = this, e = t.getContainer(); - - t.removed = 1; // Cancels post remove event execution - t.hide(); - - t.execCallback('remove_instance_callback', t); - t.onRemove.dispatch(t); - - // Clear all execCommand listeners this is required to avoid errors if the editor was removed inside another command - t.onExecCommand.listeners = []; - - tinymce.remove(t); - DOM.remove(e); - }, - - destroy : function(s) { - var t = this; - - // One time is enough - if (t.destroyed) - return; - - if (!s) { - tinymce.removeUnload(t.destroy); - tinyMCE.onBeforeUnload.remove(t._beforeUnload); - - // Manual destroy - if (t.theme && t.theme.destroy) - t.theme.destroy(); - - // Destroy controls, selection and dom - t.controlManager.destroy(); - t.selection.destroy(); - t.dom.destroy(); - - // Remove all events - - // Don't clear the window or document if content editable - // is enabled since other instances might still be present - if (!t.settings.content_editable) { - Event.clear(t.getWin()); - Event.clear(t.getDoc()); - } - - Event.clear(t.getBody()); - Event.clear(t.formElement); - } - - if (t.formElement) { - t.formElement.submit = t.formElement._mceOldSubmit; - t.formElement._mceOldSubmit = null; - } - - t.contentAreaContainer = t.formElement = t.container = t.settings.content_element = t.bodyElement = t.contentDocument = t.contentWindow = null; - - if (t.selection) - t.selection = t.selection.win = t.selection.dom = t.selection.dom.doc = null; - - t.destroyed = 1; - }, - - // Internal functions - - _addEvents : function() { - // 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset - var t = this, i, s = t.settings, dom = t.dom, lo = { - mouseup : 'onMouseUp', - mousedown : 'onMouseDown', - click : 'onClick', - keyup : 'onKeyUp', - keydown : 'onKeyDown', - keypress : 'onKeyPress', - submit : 'onSubmit', - reset : 'onReset', - contextmenu : 'onContextMenu', - dblclick : 'onDblClick', - paste : 'onPaste' // Doesn't work in all browsers yet - }; - - function eventHandler(e, o) { - var ty = e.type; - - // Don't fire events when it's removed - if (t.removed) - return; - - // Generic event handler - if (t.onEvent.dispatch(t, e, o) !== false) { - // Specific event handler - t[lo[e.fakeType || e.type]].dispatch(t, e, o); - } - }; - - // Add DOM events - each(lo, function(v, k) { - switch (k) { - case 'contextmenu': - dom.bind(t.getDoc(), k, eventHandler); - break; - - case 'paste': - dom.bind(t.getBody(), k, function(e) { - eventHandler(e); - }); - break; - - case 'submit': - case 'reset': - dom.bind(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler); - break; - - default: - dom.bind(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler); - } - }); - - dom.bind(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) { - t.focus(true); - }); - - - // Fixes bug where a specified document_base_uri could result in broken images - // This will also fix drag drop of images in Gecko - if (tinymce.isGecko) { - dom.bind(t.getDoc(), 'DOMNodeInserted', function(e) { - var v; - - e = e.target; - - if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('data-mce-src'))) - e.src = t.documentBaseURI.toAbsolute(v); - }); - } - - // Set various midas options in Gecko - if (isGecko) { - function setOpts() { - var t = this, d = t.getDoc(), s = t.settings; - - if (isGecko && !s.readonly) { - t._refreshContentEditable(); - - try { - // Try new Gecko method - d.execCommand("styleWithCSS", 0, false); - } catch (ex) { - // Use old method - if (!t._isHidden()) - try {d.execCommand("useCSS", 0, true);} catch (ex) {} - } - - if (!s.table_inline_editing) - try {d.execCommand('enableInlineTableEditing', false, false);} catch (ex) {} - - if (!s.object_resizing) - try {d.execCommand('enableObjectResizing', false, false);} catch (ex) {} - } - }; - - t.onBeforeExecCommand.add(setOpts); - t.onMouseDown.add(setOpts); - } - - // Add node change handlers - t.onMouseUp.add(t.nodeChanged); - //t.onClick.add(t.nodeChanged); - t.onKeyUp.add(function(ed, e) { - var c = e.keyCode; - - if ((c >= 33 && c <= 36) || (c >= 37 && c <= 40) || c == 13 || c == 45 || c == 46 || c == 8 || (tinymce.isMac && (c == 91 || c == 93)) || e.ctrlKey) - t.nodeChanged(); - }); - - - // Add block quote deletion handler - t.onKeyDown.add(function(ed, e) { - if (e.keyCode != VK.BACKSPACE) - return; - - var rng = ed.selection.getRng(); - if (!rng.collapsed) - return; - - var n = rng.startContainer; - var offset = rng.startOffset; - - while (n && n.nodeType && n.nodeType != 1 && n.parentNode) - n = n.parentNode; - - // Is the cursor at the beginning of a blockquote? - if (n && n.parentNode && n.parentNode.tagName === 'BLOCKQUOTE' && n.parentNode.firstChild == n && offset == 0) { - // Remove the blockquote - ed.formatter.toggle('blockquote', null, n.parentNode); - - // Move the caret to the beginning of n - rng.setStart(n, 0); - rng.setEnd(n, 0); - ed.selection.setRng(rng); - ed.selection.collapse(false); - } - }); - - - - // Add reset handler - t.onReset.add(function() { - t.setContent(t.startContent, {format : 'raw'}); - }); - - // Add shortcuts - if (s.custom_shortcuts) { - if (s.custom_undo_redo_keyboard_shortcuts) { - t.addShortcut('ctrl+z', t.getLang('undo_desc'), 'Undo'); - t.addShortcut('ctrl+y', t.getLang('redo_desc'), 'Redo'); - } - - // Add default shortcuts for gecko - t.addShortcut('ctrl+b', t.getLang('bold_desc'), 'Bold'); - t.addShortcut('ctrl+i', t.getLang('italic_desc'), 'Italic'); - t.addShortcut('ctrl+u', t.getLang('underline_desc'), 'Underline'); - - // BlockFormat shortcuts keys - for (i=1; i<=6; i++) - t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]); - - t.addShortcut('ctrl+7', '', ['FormatBlock', false, 'p']); - t.addShortcut('ctrl+8', '', ['FormatBlock', false, 'div']); - t.addShortcut('ctrl+9', '', ['FormatBlock', false, 'address']); - - function find(e) { - var v = null; - - if (!e.altKey && !e.ctrlKey && !e.metaKey) - return v; - - each(t.shortcuts, function(o) { - if (tinymce.isMac && o.ctrl != e.metaKey) - return; - else if (!tinymce.isMac && o.ctrl != e.ctrlKey) - return; - - if (o.alt != e.altKey) - return; - - if (o.shift != e.shiftKey) - return; - - if (e.keyCode == o.keyCode || (e.charCode && e.charCode == o.charCode)) { - v = o; - return false; - } - }); - - return v; - }; - - t.onKeyUp.add(function(ed, e) { - var o = find(e); - - if (o) - return Event.cancel(e); - }); - - t.onKeyPress.add(function(ed, e) { - var o = find(e); - - if (o) - return Event.cancel(e); - }); - - t.onKeyDown.add(function(ed, e) { - var o = find(e); - - if (o) { - o.func.call(o.scope); - return Event.cancel(e); - } - }); - } - - if (tinymce.isIE) { - // Fix so resize will only update the width and height attributes not the styles of an image - // It will also block mceItemNoResize items - dom.bind(t.getDoc(), 'controlselect', function(e) { - var re = t.resizeInfo, cb; - - e = e.target; - - // Don't do this action for non image elements - if (e.nodeName !== 'IMG') - return; - - if (re) - dom.unbind(re.node, re.ev, re.cb); - - if (!dom.hasClass(e, 'mceItemNoResize')) { - ev = 'resizeend'; - cb = dom.bind(e, ev, function(e) { - var v; - - e = e.target; - - if (v = dom.getStyle(e, 'width')) { - dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, '')); - dom.setStyle(e, 'width', ''); - } - - if (v = dom.getStyle(e, 'height')) { - dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, '')); - dom.setStyle(e, 'height', ''); - } - }); - } else { - ev = 'resizestart'; - cb = dom.bind(e, 'resizestart', Event.cancel, Event); - } - - re = t.resizeInfo = { - node : e, - ev : ev, - cb : cb - }; - }); - } - - if (tinymce.isOpera) { - t.onClick.add(function(ed, e) { - Event.prevent(e); - }); - } - - // Add custom undo/redo handlers - if (s.custom_undo_redo) { - function addUndo() { - t.undoManager.typing = false; - t.undoManager.add(); - }; - - var focusLostFunc = tinymce.isGecko ? 'blur' : 'focusout'; - dom.bind(t.getDoc(), focusLostFunc, function(e){ - if (!t.removed && t.undoManager.typing) - addUndo(); - }); - - // Add undo level when contents is drag/dropped within the editor - t.dom.bind(t.dom.getRoot(), 'dragend', function(e) { - addUndo(); - }); - - t.onKeyUp.add(function(ed, e) { - var keyCode = e.keyCode; - - if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45 || e.ctrlKey) - addUndo(); - }); - - t.onKeyDown.add(function(ed, e) { - var keyCode = e.keyCode, sel; - - if (keyCode == 8) { - sel = t.getDoc().selection; - - // Fix IE control + backspace browser bug - if (sel && sel.createRange && sel.createRange().item) { - t.undoManager.beforeChange(); - ed.dom.remove(sel.createRange().item(0)); - addUndo(); - - return Event.cancel(e); - } - } - - // Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter - if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45) { - // Add position before enter key is pressed, used by IE since it still uses the default browser behavior - // Todo: Remove this once we normalize enter behavior on IE - if (tinymce.isIE && keyCode == 13) - t.undoManager.beforeChange(); - - if (t.undoManager.typing) - addUndo(); - - return; - } - - // If key isn't shift,ctrl,alt,capslock,metakey - if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !t.undoManager.typing) { - t.undoManager.beforeChange(); - t.undoManager.typing = true; - t.undoManager.add(); - } - }); - - t.onMouseDown.add(function() { - if (t.undoManager.typing) - addUndo(); - }); - } - - // Bug fix for FireFox keeping styles from end of selection instead of start. - if (tinymce.isGecko) { - function getAttributeApplyFunction() { - var template = t.dom.getAttribs(t.selection.getStart().cloneNode(false)); - - return function() { - var target = t.selection.getStart(); - - if (target !== t.getBody()) { - t.dom.setAttrib(target, "style", null); - - each(template, function(attr) { - target.setAttributeNode(attr.cloneNode(true)); - }); - } - }; - } - - function isSelectionAcrossElements() { - var s = t.selection; - - return !s.isCollapsed() && s.getStart() != s.getEnd(); - } - - t.onKeyPress.add(function(ed, e) { - var applyAttributes; - - if ((e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) { - applyAttributes = getAttributeApplyFunction(); - t.getDoc().execCommand('delete', false, null); - applyAttributes(); - - return Event.cancel(e); - } - }); - - t.dom.bind(t.getDoc(), 'cut', function(e) { - var applyAttributes; - - if (isSelectionAcrossElements()) { - applyAttributes = getAttributeApplyFunction(); - t.onKeyUp.addToTop(Event.cancel, Event); - - setTimeout(function() { - applyAttributes(); - t.onKeyUp.remove(Event.cancel, Event); - }, 0); - } - }); - } - }, - - _refreshContentEditable : function() { - var self = this, body, parent; - - // Check if the editor was hidden and the re-initalize contentEditable mode by removing and adding the body again - if (self._isHidden()) { - body = self.getBody(); - parent = body.parentNode; - - parent.removeChild(body); - parent.appendChild(body); - - body.focus(); - } - }, - - _isHidden : function() { - var s; - - if (!isGecko) - return 0; - - // Weird, wheres that cursor selection? - s = this.selection.getSel(); - return (!s || !s.rangeCount || s.rangeCount == 0); - } - }); -})(tinymce); - -(function(tinymce) { - // Added for compression purposes - var each = tinymce.each, undefined, TRUE = true, FALSE = false; - - tinymce.EditorCommands = function(editor) { - var dom = editor.dom, - selection = editor.selection, - commands = {state: {}, exec : {}, value : {}}, - settings = editor.settings, - formatter = editor.formatter, - bookmark; - - function execCommand(command, ui, value) { - var func; - - command = command.toLowerCase(); - if (func = commands.exec[command]) { - func(command, ui, value); - return TRUE; - } - - return FALSE; - }; - - function queryCommandState(command) { - var func; - - command = command.toLowerCase(); - if (func = commands.state[command]) - return func(command); - - return -1; - }; - - function queryCommandValue(command) { - var func; - - command = command.toLowerCase(); - if (func = commands.value[command]) - return func(command); - - return FALSE; - }; - - function addCommands(command_list, type) { - type = type || 'exec'; - - each(command_list, function(callback, command) { - each(command.toLowerCase().split(','), function(command) { - commands[type][command] = callback; - }); - }); - }; - - // Expose public methods - tinymce.extend(this, { - execCommand : execCommand, - queryCommandState : queryCommandState, - queryCommandValue : queryCommandValue, - addCommands : addCommands - }); - - // Private methods - - function execNativeCommand(command, ui, value) { - if (ui === undefined) - ui = FALSE; - - if (value === undefined) - value = null; - - return editor.getDoc().execCommand(command, ui, value); - }; - - function isFormatMatch(name) { - return formatter.match(name); - }; - - function toggleFormat(name, value) { - formatter.toggle(name, value ? {value : value} : undefined); - }; - - function storeSelection(type) { - bookmark = selection.getBookmark(type); - }; - - function restoreSelection() { - selection.moveToBookmark(bookmark); - }; - - // Add execCommand overrides - addCommands({ - // Ignore these, added for compatibility - 'mceResetDesignMode,mceBeginUndoLevel' : function() {}, - - // Add undo manager logic - 'mceEndUndoLevel,mceAddUndoLevel' : function() { - editor.undoManager.add(); - }, - - 'Cut,Copy,Paste' : function(command) { - var doc = editor.getDoc(), failed; - - // Try executing the native command - try { - execNativeCommand(command); - } catch (ex) { - // Command failed - failed = TRUE; - } - - // Present alert message about clipboard access not being available - if (failed || !doc.queryCommandSupported(command)) { - if (tinymce.isGecko) { - editor.windowManager.confirm(editor.getLang('clipboard_msg'), function(state) { - if (state) - open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', '_blank'); - }); - } else - editor.windowManager.alert(editor.getLang('clipboard_no_support')); - } - }, - - // Override unlink command - unlink : function(command) { - if (selection.isCollapsed()) - selection.select(selection.getNode()); - - execNativeCommand(command); - selection.collapse(FALSE); - }, - - // Override justify commands to use the text formatter engine - 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) { - var align = command.substring(7); - - // Remove all other alignments first - each('left,center,right,full'.split(','), function(name) { - if (align != name) - formatter.remove('align' + name); - }); - - toggleFormat('align' + align); - execCommand('mceRepaint'); - }, - - // Override list commands to fix WebKit bug - 'InsertUnorderedList,InsertOrderedList' : function(command) { - var listElm, listParent; - - execNativeCommand(command); - - // WebKit produces lists within block elements so we need to split them - // we will replace the native list creation logic to custom logic later on - // TODO: Remove this when the list creation logic is removed - listElm = dom.getParent(selection.getNode(), 'ol,ul'); - if (listElm) { - listParent = listElm.parentNode; - - // If list is within a text block then split that block - if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) { - storeSelection(); - dom.split(listParent, listElm); - restoreSelection(); - } - } - }, - - // Override commands to use the text formatter engine - 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript' : function(command) { - toggleFormat(command); - }, - - // Override commands to use the text formatter engine - 'ForeColor,HiliteColor,FontName' : function(command, ui, value) { - toggleFormat(command, value); - }, - - FontSize : function(command, ui, value) { - var fontClasses, fontSizes; - - // Convert font size 1-7 to styles - if (value >= 1 && value <= 7) { - fontSizes = tinymce.explode(settings.font_size_style_values); - fontClasses = tinymce.explode(settings.font_size_classes); - - if (fontClasses) - value = fontClasses[value - 1] || value; - else - value = fontSizes[value - 1] || value; - } - - toggleFormat(command, value); - }, - - RemoveFormat : function(command) { - formatter.remove(command); - }, - - mceBlockQuote : function(command) { - toggleFormat('blockquote'); - }, - - FormatBlock : function(command, ui, value) { - return toggleFormat(value || 'p'); - }, - - mceCleanup : function() { - var bookmark = selection.getBookmark(); - - editor.setContent(editor.getContent({cleanup : TRUE}), {cleanup : TRUE}); - - selection.moveToBookmark(bookmark); - }, - - mceRemoveNode : function(command, ui, value) { - var node = value || selection.getNode(); - - // Make sure that the body node isn't removed - if (node != editor.getBody()) { - storeSelection(); - editor.dom.remove(node, TRUE); - restoreSelection(); - } - }, - - mceSelectNodeDepth : function(command, ui, value) { - var counter = 0; - - dom.getParent(selection.getNode(), function(node) { - if (node.nodeType == 1 && counter++ == value) { - selection.select(node); - return FALSE; - } - }, editor.getBody()); - }, - - mceSelectNode : function(command, ui, value) { - selection.select(value); - }, - - mceInsertContent : function(command, ui, value) { - var parser, serializer, parentNode, rootNode, fragment, args, - marker, nodeRect, viewPortRect, rng, node, node2, bookmarkHtml, viewportBodyElement; - - //selection.normalize(); - - // Setup parser and serializer - parser = editor.parser; - serializer = new tinymce.html.Serializer({}, editor.schema); - bookmarkHtml = '\uFEFF'; - - // Run beforeSetContent handlers on the HTML to be inserted - args = {content: value, format: 'html'}; - selection.onBeforeSetContent.dispatch(selection, args); - value = args.content; - - // Add caret at end of contents if it's missing - if (value.indexOf('{$caret}') == -1) - value += '{$caret}'; - - // Replace the caret marker with a span bookmark element - value = value.replace(/\{\$caret\}/, bookmarkHtml); - - // Insert node maker where we will insert the new HTML and get it's parent - if (!selection.isCollapsed()) - editor.getDoc().execCommand('Delete', false, null); - - parentNode = selection.getNode(); - - // Parse the fragment within the context of the parent node - args = {context : parentNode.nodeName.toLowerCase()}; - fragment = parser.parse(value, args); - - // Move the caret to a more suitable location - node = fragment.lastChild; - if (node.attr('id') == 'mce_marker') { - marker = node; - - for (node = node.prev; node; node = node.walk(true)) { - if (node.type == 3 || !dom.isBlock(node.name)) { - node.parent.insert(marker, node, node.name === 'br'); - break; - } - } - } - - // If parser says valid we can insert the contents into that parent - if (!args.invalid) { - value = serializer.serialize(fragment); - - // Check if parent is empty or only has one BR element then set the innerHTML of that parent - node = parentNode.firstChild; - node2 = parentNode.lastChild; - if (!node || (node === node2 && node.nodeName === 'BR')) - dom.setHTML(parentNode, value); - else - selection.setContent(value); - } else { - // If the fragment was invalid within that context then we need - // to parse and process the parent it's inserted into - - // Insert bookmark node and get the parent - selection.setContent(bookmarkHtml); - parentNode = editor.selection.getNode(); - rootNode = editor.getBody(); - - // Opera will return the document node when selection is in root - if (parentNode.nodeType == 9) - parentNode = node = rootNode; - else - node = parentNode; - - // Find the ancestor just before the root element - while (node !== rootNode) { - parentNode = node; - node = node.parentNode; - } - - // Get the outer/inner HTML depending on if we are in the root and parser and serialize that - value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode); - value = serializer.serialize( - parser.parse( - // Need to replace by using a function since $ in the contents would otherwise be a problem - value.replace(//i, function() { - return serializer.serialize(fragment); - }) - ) - ); - - // Set the inner/outer HTML depending on if we are in the root or not - if (parentNode == rootNode) - dom.setHTML(rootNode, value); - else - dom.setOuterHTML(parentNode, value); - } - - marker = dom.get('mce_marker'); - - // Scroll range into view scrollIntoView on element can't be used since it will scroll the main view port as well - nodeRect = dom.getRect(marker); - viewPortRect = dom.getViewPort(editor.getWin()); - - // Check if node is out side the viewport if it is then scroll to it - if ((nodeRect.y + nodeRect.h > viewPortRect.y + viewPortRect.h || nodeRect.y < viewPortRect.y) || - (nodeRect.x > viewPortRect.x + viewPortRect.w || nodeRect.x < viewPortRect.x)) { - viewportBodyElement = tinymce.isIE ? editor.getDoc().documentElement : editor.getBody(); - viewportBodyElement.scrollLeft = nodeRect.x; - viewportBodyElement.scrollTop = nodeRect.y - viewPortRect.h + 25; - } - - // Move selection before marker and remove it - rng = dom.createRng(); - - // If previous sibling is a text node set the selection to the end of that node - node = marker.previousSibling; - if (node && node.nodeType == 3) { - rng.setStart(node, node.nodeValue.length); - } else { - // If the previous sibling isn't a text node or doesn't exist set the selection before the marker node - rng.setStartBefore(marker); - rng.setEndBefore(marker); - } - - // Remove the marker node and set the new range - dom.remove(marker); - selection.setRng(rng); - - // Dispatch after event and add any visual elements needed - selection.onSetContent.dispatch(selection, args); - editor.addVisual(); - }, - - mceInsertRawHTML : function(command, ui, value) { - selection.setContent('tiny_mce_marker'); - editor.setContent(editor.getContent().replace(/tiny_mce_marker/g, function() { return value })); - }, - - mceSetContent : function(command, ui, value) { - editor.setContent(value); - }, - - 'Indent,Outdent' : function(command) { - var intentValue, indentUnit, value; - - // Setup indent level - intentValue = settings.indentation; - indentUnit = /[a-z%]+$/i.exec(intentValue); - intentValue = parseInt(intentValue); - - if (!queryCommandState('InsertUnorderedList') && !queryCommandState('InsertOrderedList')) { - each(selection.getSelectedBlocks(), function(element) { - if (command == 'outdent') { - value = Math.max(0, parseInt(element.style.paddingLeft || 0) - intentValue); - dom.setStyle(element, 'paddingLeft', value ? value + indentUnit : ''); - } else - dom.setStyle(element, 'paddingLeft', (parseInt(element.style.paddingLeft || 0) + intentValue) + indentUnit); - }); - } else - execNativeCommand(command); - }, - - mceRepaint : function() { - var bookmark; - - if (tinymce.isGecko) { - try { - storeSelection(TRUE); - - if (selection.getSel()) - selection.getSel().selectAllChildren(editor.getBody()); - - selection.collapse(TRUE); - restoreSelection(); - } catch (ex) { - // Ignore - } - } - }, - - mceToggleFormat : function(command, ui, value) { - formatter.toggle(value); - }, - - InsertHorizontalRule : function() { - editor.execCommand('mceInsertContent', false, '
    '); - }, - - mceToggleVisualAid : function() { - editor.hasVisual = !editor.hasVisual; - editor.addVisual(); - }, - - mceReplaceContent : function(command, ui, value) { - editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, selection.getContent({format : 'text'}))); - }, - - mceInsertLink : function(command, ui, value) { - var anchor; - - if (typeof(value) == 'string') - value = {href : value}; - - anchor = dom.getParent(selection.getNode(), 'a'); - - // Spaces are never valid in URLs and it's a very common mistake for people to make so we fix it here. - value.href = value.href.replace(' ', '%20'); - - // Remove existing links if there could be child links or that the href isn't specified - if (!anchor || !value.href) { - formatter.remove('link'); - } - - // Apply new link to selection - if (value.href) { - formatter.apply('link', value, anchor); - } - }, - - selectAll : function() { - var root = dom.getRoot(), rng = dom.createRng(); - - rng.setStart(root, 0); - rng.setEnd(root, root.childNodes.length); - - editor.selection.setRng(rng); - } - }); - - // Add queryCommandState overrides - addCommands({ - // Override justify commands - 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) { - var name = 'align' + command.substring(7); - // Use Formatter.matchNode instead of Formatter.match so that we don't match on parent node. This fixes bug where for both left - // and right align buttons can be active. This could occur when selected nodes have align right and the parent has align left. - var nodes = selection.isCollapsed() ? [selection.getNode()] : selection.getSelectedBlocks(); - var matches = tinymce.map(nodes, function(node) { - return !!formatter.matchNode(node, name); - }); - return tinymce.inArray(matches, TRUE) !== -1; - }, - - 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript' : function(command) { - return isFormatMatch(command); - }, - - mceBlockQuote : function() { - return isFormatMatch('blockquote'); - }, - - Outdent : function() { - var node; - - if (settings.inline_styles) { - if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0) - return TRUE; - - if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0) - return TRUE; - } - - return queryCommandState('InsertUnorderedList') || queryCommandState('InsertOrderedList') || (!settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE')); - }, - - 'InsertUnorderedList,InsertOrderedList' : function(command) { - return dom.getParent(selection.getNode(), command == 'insertunorderedlist' ? 'UL' : 'OL'); - } - }, 'state'); - - // Add queryCommandValue overrides - addCommands({ - 'FontSize,FontName' : function(command) { - var value = 0, parent; - - if (parent = dom.getParent(selection.getNode(), 'span')) { - if (command == 'fontsize') - value = parent.style.fontSize; - else - value = parent.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase(); - } - - return value; - } - }, 'value'); - - // Add undo manager logic - if (settings.custom_undo_redo) { - addCommands({ - Undo : function() { - editor.undoManager.undo(); - }, - - Redo : function() { - editor.undoManager.redo(); - } - }); - } - }; -})(tinymce); - -(function(tinymce) { - var Dispatcher = tinymce.util.Dispatcher; - - tinymce.UndoManager = function(editor) { - var self, index = 0, data = [], beforeBookmark; - - function getContent() { - return tinymce.trim(editor.getContent({format : 'raw', no_events : 1})); - }; - - return self = { - typing : false, - - onAdd : new Dispatcher(self), - - onUndo : new Dispatcher(self), - - onRedo : new Dispatcher(self), - - beforeChange : function() { - beforeBookmark = editor.selection.getBookmark(2, true); - }, - - add : function(level) { - var i, settings = editor.settings, lastLevel; - - level = level || {}; - level.content = getContent(); - - // Add undo level if needed - lastLevel = data[index]; - if (lastLevel && lastLevel.content == level.content) - return null; - - // Set before bookmark on previous level - if (data[index]) - data[index].beforeBookmark = beforeBookmark; - - // Time to compress - if (settings.custom_undo_redo_levels) { - if (data.length > settings.custom_undo_redo_levels) { - for (i = 0; i < data.length - 1; i++) - data[i] = data[i + 1]; - - data.length--; - index = data.length; - } - } - - // Get a non intrusive normalized bookmark - level.bookmark = editor.selection.getBookmark(2, true); - - // Crop array if needed - if (index < data.length - 1) - data.length = index + 1; - - data.push(level); - index = data.length - 1; - - self.onAdd.dispatch(self, level); - editor.isNotDirty = 0; - - return level; - }, - - undo : function() { - var level, i; - - if (self.typing) { - self.add(); - self.typing = false; - } - - if (index > 0) { - level = data[--index]; - - editor.setContent(level.content, {format : 'raw'}); - editor.selection.moveToBookmark(level.beforeBookmark); - - self.onUndo.dispatch(self, level); - } - - return level; - }, - - redo : function() { - var level; - - if (index < data.length - 1) { - level = data[++index]; - - editor.setContent(level.content, {format : 'raw'}); - editor.selection.moveToBookmark(level.bookmark); - - self.onRedo.dispatch(self, level); - } - - return level; - }, - - clear : function() { - data = []; - index = 0; - self.typing = false; - }, - - hasUndo : function() { - return index > 0 || this.typing; - }, - - hasRedo : function() { - return index < data.length - 1 && !this.typing; - } - }; - }; -})(tinymce); - -(function(tinymce) { - // Shorten names - var Event = tinymce.dom.Event, - isIE = tinymce.isIE, - isGecko = tinymce.isGecko, - isOpera = tinymce.isOpera, - each = tinymce.each, - extend = tinymce.extend, - TRUE = true, - FALSE = false; - - function cloneFormats(node) { - var clone, temp, inner; - - do { - if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(node.nodeName)) { - if (clone) { - temp = node.cloneNode(false); - temp.appendChild(clone); - clone = temp; - } else { - clone = inner = node.cloneNode(false); - } - - clone.removeAttribute('id'); - } - } while (node = node.parentNode); - - if (clone) - return {wrapper : clone, inner : inner}; - }; - - // Checks if the selection/caret is at the end of the specified block element - function isAtEnd(rng, par) { - var rng2 = par.ownerDocument.createRange(); - - rng2.setStart(rng.endContainer, rng.endOffset); - rng2.setEndAfter(par); - - // Get number of characters to the right of the cursor if it's zero then we are at the end and need to merge the next block element - return rng2.cloneContents().textContent.length == 0; - }; - - function splitList(selection, dom, li) { - var listBlock, block; - - if (dom.isEmpty(li)) { - listBlock = dom.getParent(li, 'ul,ol'); - - if (!dom.getParent(listBlock.parentNode, 'ul,ol')) { - dom.split(listBlock, li); - block = dom.create('p', 0, '
    '); - dom.replace(block, li); - selection.select(block, 1); - } - - return FALSE; - } - - return TRUE; - }; - - tinymce.create('tinymce.ForceBlocks', { - ForceBlocks : function(ed) { - var t = this, s = ed.settings, elm; - - t.editor = ed; - t.dom = ed.dom; - elm = (s.forced_root_block || 'p').toLowerCase(); - s.element = elm.toUpperCase(); - - ed.onPreInit.add(t.setup, t); - }, - - setup : function() { - var t = this, ed = t.editor, s = ed.settings, dom = ed.dom, selection = ed.selection, blockElements = ed.schema.getBlockElements(); - - // Force root blocks - if (s.forced_root_block) { - function addRootBlocks() { - var node = selection.getStart(), rootNode = ed.getBody(), rng, startContainer, startOffset, endContainer, endOffset, rootBlockNode, tempNode, offset = -0xFFFFFF; - - if (!node || node.nodeType !== 1) - return; - - // Check if node is wrapped in block - while (node != rootNode) { - if (blockElements[node.nodeName]) - return; - - node = node.parentNode; - } - - // Get current selection - rng = selection.getRng(); - if (rng.setStart) { - startContainer = rng.startContainer; - startOffset = rng.startOffset; - endContainer = rng.endContainer; - endOffset = rng.endOffset; - } else { - // Force control range into text range - if (rng.item) { - rng = ed.getDoc().body.createTextRange(); - rng.moveToElementText(rng.item(0)); - } - - tmpRng = rng.duplicate(); - tmpRng.collapse(true); - startOffset = tmpRng.move('character', offset) * -1; - - if (!tmpRng.collapsed) { - tmpRng = rng.duplicate(); - tmpRng.collapse(false); - endOffset = (tmpRng.move('character', offset) * -1) - startOffset; - } - } - - // Wrap non block elements and text nodes - for (node = rootNode.firstChild; node; node) { - if (node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName])) { - if (!rootBlockNode) { - rootBlockNode = dom.create(s.forced_root_block); - node.parentNode.insertBefore(rootBlockNode, node); - } - - tempNode = node; - node = node.nextSibling; - rootBlockNode.appendChild(tempNode); - } else { - rootBlockNode = null; - node = node.nextSibling; - } - } - - if (rng.setStart) { - rng.setStart(startContainer, startOffset); - rng.setEnd(endContainer, endOffset); - selection.setRng(rng); - } else { - try { - rng = ed.getDoc().body.createTextRange(); - rng.moveToElementText(rootNode); - rng.collapse(true); - rng.moveStart('character', startOffset); - - if (endOffset > 0) - rng.moveEnd('character', endOffset); - - rng.select(); - } catch (ex) { - // Ignore - } - } - - ed.nodeChanged(); - }; - - ed.onKeyUp.add(addRootBlocks); - ed.onClick.add(addRootBlocks); - } - - if (s.force_br_newlines) { - // Force IE to produce BRs on enter - if (isIE) { - ed.onKeyPress.add(function(ed, e) { - var n; - - if (e.keyCode == 13 && selection.getNode().nodeName != 'LI') { - selection.setContent('
    ', {format : 'raw'}); - n = dom.get('__'); - n.removeAttribute('id'); - selection.select(n); - selection.collapse(); - return Event.cancel(e); - } - }); - } - } - - if (s.force_p_newlines) { - if (!isIE) { - ed.onKeyPress.add(function(ed, e) { - if (e.keyCode == 13 && !e.shiftKey && !t.insertPara(e)) - Event.cancel(e); - }); - } else { - // Ungly hack to for IE to preserve the formatting when you press - // enter at the end of a block element with formatted contents - // This logic overrides the browsers default logic with - // custom logic that enables us to control the output - tinymce.addUnload(function() { - t._previousFormats = 0; // Fix IE leak - }); - - ed.onKeyPress.add(function(ed, e) { - t._previousFormats = 0; - - // Clone the current formats, this will later be applied to the new block contents - if (e.keyCode == 13 && !e.shiftKey && ed.selection.isCollapsed() && s.keep_styles) - t._previousFormats = cloneFormats(ed.selection.getStart()); - }); - - ed.onKeyUp.add(function(ed, e) { - // Let IE break the element and the wrap the new caret location in the previous formats - if (e.keyCode == 13 && !e.shiftKey) { - var parent = ed.selection.getStart(), fmt = t._previousFormats; - - // Parent is an empty block - if (!parent.hasChildNodes() && fmt) { - parent = dom.getParent(parent, dom.isBlock); - - if (parent && parent.nodeName != 'LI') { - parent.innerHTML = ''; - - if (t._previousFormats) { - parent.appendChild(fmt.wrapper); - fmt.inner.innerHTML = '\uFEFF'; - } else - parent.innerHTML = '\uFEFF'; - - selection.select(parent, 1); - selection.collapse(true); - ed.getDoc().execCommand('Delete', false, null); - t._previousFormats = 0; - } - } - } - }); - } - - if (isGecko) { - ed.onKeyDown.add(function(ed, e) { - if ((e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) - t.backspaceDelete(e, e.keyCode == 8); - }); - } - } - - // Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973 - if (tinymce.isWebKit) { - function insertBr(ed) { - var rng = selection.getRng(), br, div = dom.create('div', null, ' '), divYPos, vpHeight = dom.getViewPort(ed.getWin()).h; - - // Insert BR element - rng.insertNode(br = dom.create('br')); - - // Place caret after BR - rng.setStartAfter(br); - rng.setEndAfter(br); - selection.setRng(rng); - - // Could not place caret after BR then insert an nbsp entity and move the caret - if (selection.getSel().focusNode == br.previousSibling) { - selection.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'), br)); - selection.collapse(TRUE); - } - - // Create a temporary DIV after the BR and get the position as it - // seems like getPos() returns 0 for text nodes and BR elements. - dom.insertAfter(div, br); - divYPos = dom.getPos(div).y; - dom.remove(div); - - // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117 - if (divYPos > vpHeight) // It is not necessary to scroll if the DIV is inside the view port. - ed.getWin().scrollTo(0, divYPos); - }; - - ed.onKeyPress.add(function(ed, e) { - if (e.keyCode == 13 && (e.shiftKey || (s.force_br_newlines && !dom.getParent(selection.getNode(), 'h1,h2,h3,h4,h5,h6,ol,ul')))) { - insertBr(ed); - Event.cancel(e); - } - }); - } - - // IE specific fixes - if (isIE) { - // Replaces IE:s auto generated paragraphs with the specified element name - if (s.element != 'P') { - ed.onKeyPress.add(function(ed, e) { - t.lastElm = selection.getNode().nodeName; - }); - - ed.onKeyUp.add(function(ed, e) { - var bl, n = selection.getNode(), b = ed.getBody(); - - if (b.childNodes.length === 1 && n.nodeName == 'P') { - n = dom.rename(n, s.element); - selection.select(n); - selection.collapse(); - ed.nodeChanged(); - } else if (e.keyCode == 13 && !e.shiftKey && t.lastElm != 'P') { - bl = dom.getParent(n, 'p'); - - if (bl) { - dom.rename(bl, s.element); - ed.nodeChanged(); - } - } - }); - } - } - }, - - getParentBlock : function(n) { - var d = this.dom; - - return d.getParent(n, d.isBlock); - }, - - insertPara : function(e) { - var t = this, ed = t.editor, dom = ed.dom, d = ed.getDoc(), se = ed.settings, s = ed.selection.getSel(), r = s.getRangeAt(0), b = d.body; - var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n, vp = dom.getViewPort(ed.getWin()), y, ch, car; - - ed.undoManager.beforeChange(); - - // If root blocks are forced then use Operas default behavior since it's really good -// Removed due to bug: #1853816 -// if (se.forced_root_block && isOpera) -// return TRUE; - - // Setup before range - rb = d.createRange(); - - // If is before the first block element and in body, then move it into first block element - rb.setStart(s.anchorNode, s.anchorOffset); - rb.collapse(TRUE); - - // Setup after range - ra = d.createRange(); - - // If is before the first block element and in body, then move it into first block element - ra.setStart(s.focusNode, s.focusOffset); - ra.collapse(TRUE); - - // Setup start/end points - dir = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0; - sn = dir ? s.anchorNode : s.focusNode; - so = dir ? s.anchorOffset : s.focusOffset; - en = dir ? s.focusNode : s.anchorNode; - eo = dir ? s.focusOffset : s.anchorOffset; - - // If selection is in empty table cell - if (sn === en && /^(TD|TH)$/.test(sn.nodeName)) { - if (sn.firstChild.nodeName == 'BR') - dom.remove(sn.firstChild); // Remove BR - - // Create two new block elements - if (sn.childNodes.length == 0) { - ed.dom.add(sn, se.element, null, '
    '); - aft = ed.dom.add(sn, se.element, null, '
    '); - } else { - n = sn.innerHTML; - sn.innerHTML = ''; - ed.dom.add(sn, se.element, null, n); - aft = ed.dom.add(sn, se.element, null, '
    '); - } - - // Move caret into the last one - r = d.createRange(); - r.selectNodeContents(aft); - r.collapse(1); - ed.selection.setRng(r); - - return FALSE; - } - - // If the caret is in an invalid location in FF we need to move it into the first block - if (sn == b && en == b && b.firstChild && ed.dom.isBlock(b.firstChild)) { - sn = en = sn.firstChild; - so = eo = 0; - rb = d.createRange(); - rb.setStart(sn, 0); - ra = d.createRange(); - ra.setStart(en, 0); - } - - // If the body is totally empty add a BR element this might happen on webkit - if (!d.body.hasChildNodes()) { - d.body.appendChild(dom.create('br')); - } - - // Never use body as start or end node - sn = sn.nodeName == "HTML" ? d.body : sn; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes - sn = sn.nodeName == "BODY" ? sn.firstChild : sn; - en = en.nodeName == "HTML" ? d.body : en; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes - en = en.nodeName == "BODY" ? en.firstChild : en; - - // Get start and end blocks - sb = t.getParentBlock(sn); - eb = t.getParentBlock(en); - bn = sb ? sb.nodeName : se.element; // Get block name to create - - // Return inside list use default browser behavior - if (n = t.dom.getParent(sb, 'li,pre')) { - if (n.nodeName == 'LI') - return splitList(ed.selection, t.dom, n); - - return TRUE; - } - - // If caption or absolute layers then always generate new blocks within - if (sb && (sb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) { - bn = se.element; - sb = null; - } - - // If caption or absolute layers then always generate new blocks within - if (eb && (eb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) { - bn = se.element; - eb = null; - } - - // Use P instead - if (/(TD|TABLE|TH|CAPTION)/.test(bn) || (sb && bn == "DIV" && /left|right/gi.test(dom.getStyle(sb, 'float', 1)))) { - bn = se.element; - sb = eb = null; - } - - // Setup new before and after blocks - bef = (sb && sb.nodeName == bn) ? sb.cloneNode(0) : ed.dom.create(bn); - aft = (eb && eb.nodeName == bn) ? eb.cloneNode(0) : ed.dom.create(bn); - - // Remove id from after clone - aft.removeAttribute('id'); - - // Is header and cursor is at the end, then force paragraph under - if (/^(H[1-6])$/.test(bn) && isAtEnd(r, sb)) - aft = ed.dom.create(se.element); - - // Find start chop node - n = sc = sn; - do { - if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName)) - break; - - sc = n; - } while ((n = n.previousSibling ? n.previousSibling : n.parentNode)); - - // Find end chop node - n = ec = en; - do { - if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName)) - break; - - ec = n; - } while ((n = n.nextSibling ? n.nextSibling : n.parentNode)); - - // Place first chop part into before block element - if (sc.nodeName == bn) - rb.setStart(sc, 0); - else - rb.setStartBefore(sc); - - rb.setEnd(sn, so); - bef.appendChild(rb.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari - - // Place secnd chop part within new block element - try { - ra.setEndAfter(ec); - } catch(ex) { - //console.debug(s.focusNode, s.focusOffset); - } - - ra.setStart(en, eo); - aft.appendChild(ra.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari - - // Create range around everything - r = d.createRange(); - if (!sc.previousSibling && sc.parentNode.nodeName == bn) { - r.setStartBefore(sc.parentNode); - } else { - if (rb.startContainer.nodeName == bn && rb.startOffset == 0) - r.setStartBefore(rb.startContainer); - else - r.setStart(rb.startContainer, rb.startOffset); - } - - if (!ec.nextSibling && ec.parentNode.nodeName == bn) - r.setEndAfter(ec.parentNode); - else - r.setEnd(ra.endContainer, ra.endOffset); - - // Delete and replace it with new block elements - r.deleteContents(); - - if (isOpera) - ed.getWin().scrollTo(0, vp.y); - - // Never wrap blocks in blocks - if (bef.firstChild && bef.firstChild.nodeName == bn) - bef.innerHTML = bef.firstChild.innerHTML; - - if (aft.firstChild && aft.firstChild.nodeName == bn) - aft.innerHTML = aft.firstChild.innerHTML; - - function appendStyles(e, en) { - var nl = [], nn, n, i; - - e.innerHTML = ''; - - // Make clones of style elements - if (se.keep_styles) { - n = en; - do { - // We only want style specific elements - if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(n.nodeName)) { - nn = n.cloneNode(FALSE); - dom.setAttrib(nn, 'id', ''); // Remove ID since it needs to be unique - nl.push(nn); - } - } while (n = n.parentNode); - } - - // Append style elements to aft - if (nl.length > 0) { - for (i = nl.length - 1, nn = e; i >= 0; i--) - nn = nn.appendChild(nl[i]); - - // Padd most inner style element - nl[0].innerHTML = isOpera ? '\u00a0' : '
    '; // Extra space for Opera so that the caret can move there - return nl[0]; // Move caret to most inner element - } else - e.innerHTML = isOpera ? '\u00a0' : '
    '; // Extra space for Opera so that the caret can move there - }; - - // Padd empty blocks - if (dom.isEmpty(bef)) - appendStyles(bef, sn); - - // Fill empty afterblook with current style - if (dom.isEmpty(aft)) - car = appendStyles(aft, en); - - // Opera needs this one backwards for older versions - if (isOpera && parseFloat(opera.version()) < 9.5) { - r.insertNode(bef); - r.insertNode(aft); - } else { - r.insertNode(aft); - r.insertNode(bef); - } - - // Normalize - aft.normalize(); - bef.normalize(); - - // Move cursor and scroll into view - ed.selection.select(aft, true); - ed.selection.collapse(true); - - // scrollIntoView seems to scroll the parent window in most browsers now including FF 3.0b4 so it's time to stop using it and do it our selfs - y = ed.dom.getPos(aft).y; - //ch = aft.clientHeight; - - // Is element within viewport - if (y < vp.y || y + 25 > vp.y + vp.h) { - ed.getWin().scrollTo(0, y < vp.y ? y : y - vp.h + 25); // Needs to be hardcoded to roughly one line of text if a huge text block is broken into two blocks - - /*console.debug( - 'Element: y=' + y + ', h=' + ch + ', ' + - 'Viewport: y=' + vp.y + ", h=" + vp.h + ', bottom=' + (vp.y + vp.h) - );*/ - } - - ed.undoManager.add(); - - return FALSE; - }, - - backspaceDelete : function(e, bs) { - var t = this, ed = t.editor, b = ed.getBody(), dom = ed.dom, n, se = ed.selection, r = se.getRng(), sc = r.startContainer, n, w, tn, walker; - - // Delete when caret is behind a element doesn't work correctly on Gecko see #3011651 - if (!bs && r.collapsed && sc.nodeType == 1 && r.startOffset == sc.childNodes.length) { - walker = new tinymce.dom.TreeWalker(sc.lastChild, sc); - - // Walk the dom backwards until we find a text node - for (n = sc.lastChild; n; n = walker.prev()) { - if (n.nodeType == 3) { - r.setStart(n, n.nodeValue.length); - r.collapse(true); - se.setRng(r); - return; - } - } - } - - // The caret sometimes gets stuck in Gecko if you delete empty paragraphs - // This workaround removes the element by hand and moves the caret to the previous element - if (sc && ed.dom.isBlock(sc) && !/^(TD|TH)$/.test(sc.nodeName) && bs) { - if (sc.childNodes.length == 0 || (sc.childNodes.length == 1 && sc.firstChild.nodeName == 'BR')) { - // Find previous block element - n = sc; - while ((n = n.previousSibling) && !ed.dom.isBlock(n)) ; - - if (n) { - if (sc != b.firstChild) { - // Find last text node - w = ed.dom.doc.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, FALSE); - while (tn = w.nextNode()) - n = tn; - - // Place caret at the end of last text node - r = ed.getDoc().createRange(); - r.setStart(n, n.nodeValue ? n.nodeValue.length : 0); - r.setEnd(n, n.nodeValue ? n.nodeValue.length : 0); - se.setRng(r); - - // Remove the target container - ed.dom.remove(sc); - } - - return Event.cancel(e); - } - } - } - } - }); -})(tinymce); - -(function(tinymce) { - // Shorten names - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend; - - tinymce.create('tinymce.ControlManager', { - ControlManager : function(ed, s) { - var t = this, i; - - s = s || {}; - t.editor = ed; - t.controls = {}; - t.onAdd = new tinymce.util.Dispatcher(t); - t.onPostRender = new tinymce.util.Dispatcher(t); - t.prefix = s.prefix || ed.id + '_'; - t._cls = {}; - - t.onPostRender.add(function() { - each(t.controls, function(c) { - c.postRender(); - }); - }); - }, - - get : function(id) { - return this.controls[this.prefix + id] || this.controls[id]; - }, - - setActive : function(id, s) { - var c = null; - - if (c = this.get(id)) - c.setActive(s); - - return c; - }, - - setDisabled : function(id, s) { - var c = null; - - if (c = this.get(id)) - c.setDisabled(s); - - return c; - }, - - add : function(c) { - var t = this; - - if (c) { - t.controls[c.id] = c; - t.onAdd.dispatch(c, t); - } - - return c; - }, - - createControl : function(n) { - var c, t = this, ed = t.editor; - - each(ed.plugins, function(p) { - if (p.createControl) { - c = p.createControl(n, t); - - if (c) - return false; - } - }); - - switch (n) { - case "|": - case "separator": - return t.createSeparator(); - } - - if (!c && ed.buttons && (c = ed.buttons[n])) - return t.createButton(n, c); - - return t.add(c); - }, - - createDropMenu : function(id, s, cc) { - var t = this, ed = t.editor, c, bm, v, cls; - - s = extend({ - 'class' : 'mceDropDown', - constrain : ed.settings.constrain_menus - }, s); - - s['class'] = s['class'] + ' ' + ed.getParam('skin') + 'Skin'; - if (v = ed.getParam('skin_variant')) - s['class'] += ' ' + ed.getParam('skin') + 'Skin' + v.substring(0, 1).toUpperCase() + v.substring(1); - - id = t.prefix + id; - cls = cc || t._cls.dropmenu || tinymce.ui.DropMenu; - c = t.controls[id] = new cls(id, s); - c.onAddItem.add(function(c, o) { - var s = o.settings; - - s.title = ed.getLang(s.title, s.title); - - if (!s.onclick) { - s.onclick = function(v) { - if (s.cmd) - ed.execCommand(s.cmd, s.ui || false, s.value); - }; - } - }); - - ed.onRemove.add(function() { - c.destroy(); - }); - - // Fix for bug #1897785, #1898007 - if (tinymce.isIE) { - c.onShowMenu.add(function() { - // IE 8 needs focus in order to store away a range with the current collapsed caret location - ed.focus(); - - bm = ed.selection.getBookmark(1); - }); - - c.onHideMenu.add(function() { - if (bm) { - ed.selection.moveToBookmark(bm); - bm = 0; - } - }); - } - - return t.add(c); - }, - - createListBox : function(id, s, cc) { - var t = this, ed = t.editor, cmd, c, cls; - - if (t.get(id)) - return null; - - s.title = ed.translate(s.title); - s.scope = s.scope || ed; - - if (!s.onselect) { - s.onselect = function(v) { - ed.execCommand(s.cmd, s.ui || false, v || s.value); - }; - } - - s = extend({ - title : s.title, - 'class' : 'mce_' + id, - scope : s.scope, - control_manager : t - }, s); - - id = t.prefix + id; - - - function useNativeListForAccessibility(ed) { - return ed.settings.use_accessible_selects && !tinymce.isGecko - } - - if (ed.settings.use_native_selects || useNativeListForAccessibility(ed)) - c = new tinymce.ui.NativeListBox(id, s); - else { - cls = cc || t._cls.listbox || tinymce.ui.ListBox; - c = new cls(id, s, ed); - } - - t.controls[id] = c; - - // Fix focus problem in Safari - if (tinymce.isWebKit) { - c.onPostRender.add(function(c, n) { - // Store bookmark on mousedown - Event.add(n, 'mousedown', function() { - ed.bookmark = ed.selection.getBookmark(1); - }); - - // Restore on focus, since it might be lost - Event.add(n, 'focus', function() { - ed.selection.moveToBookmark(ed.bookmark); - ed.bookmark = null; - }); - }); - } - - if (c.hideMenu) - ed.onMouseDown.add(c.hideMenu, c); - - return t.add(c); - }, - - createButton : function(id, s, cc) { - var t = this, ed = t.editor, o, c, cls; - - if (t.get(id)) - return null; - - s.title = ed.translate(s.title); - s.label = ed.translate(s.label); - s.scope = s.scope || ed; - - if (!s.onclick && !s.menu_button) { - s.onclick = function() { - ed.execCommand(s.cmd, s.ui || false, s.value); - }; - } - - s = extend({ - title : s.title, - 'class' : 'mce_' + id, - unavailable_prefix : ed.getLang('unavailable', ''), - scope : s.scope, - control_manager : t - }, s); - - id = t.prefix + id; - - if (s.menu_button) { - cls = cc || t._cls.menubutton || tinymce.ui.MenuButton; - c = new cls(id, s, ed); - ed.onMouseDown.add(c.hideMenu, c); - } else { - cls = t._cls.button || tinymce.ui.Button; - c = new cls(id, s, ed); - } - - return t.add(c); - }, - - createMenuButton : function(id, s, cc) { - s = s || {}; - s.menu_button = 1; - - return this.createButton(id, s, cc); - }, - - createSplitButton : function(id, s, cc) { - var t = this, ed = t.editor, cmd, c, cls; - - if (t.get(id)) - return null; - - s.title = ed.translate(s.title); - s.scope = s.scope || ed; - - if (!s.onclick) { - s.onclick = function(v) { - ed.execCommand(s.cmd, s.ui || false, v || s.value); - }; - } - - if (!s.onselect) { - s.onselect = function(v) { - ed.execCommand(s.cmd, s.ui || false, v || s.value); - }; - } - - s = extend({ - title : s.title, - 'class' : 'mce_' + id, - scope : s.scope, - control_manager : t - }, s); - - id = t.prefix + id; - cls = cc || t._cls.splitbutton || tinymce.ui.SplitButton; - c = t.add(new cls(id, s, ed)); - ed.onMouseDown.add(c.hideMenu, c); - - return c; - }, - - createColorSplitButton : function(id, s, cc) { - var t = this, ed = t.editor, cmd, c, cls, bm; - - if (t.get(id)) - return null; - - s.title = ed.translate(s.title); - s.scope = s.scope || ed; - - if (!s.onclick) { - s.onclick = function(v) { - if (tinymce.isIE) - bm = ed.selection.getBookmark(1); - - ed.execCommand(s.cmd, s.ui || false, v || s.value); - }; - } - - if (!s.onselect) { - s.onselect = function(v) { - ed.execCommand(s.cmd, s.ui || false, v || s.value); - }; - } - - s = extend({ - title : s.title, - 'class' : 'mce_' + id, - 'menu_class' : ed.getParam('skin') + 'Skin', - scope : s.scope, - more_colors_title : ed.getLang('more_colors') - }, s); - - id = t.prefix + id; - cls = cc || t._cls.colorsplitbutton || tinymce.ui.ColorSplitButton; - c = new cls(id, s, ed); - ed.onMouseDown.add(c.hideMenu, c); - - // Remove the menu element when the editor is removed - ed.onRemove.add(function() { - c.destroy(); - }); - - // Fix for bug #1897785, #1898007 - if (tinymce.isIE) { - c.onShowMenu.add(function() { - // IE 8 needs focus in order to store away a range with the current collapsed caret location - ed.focus(); - bm = ed.selection.getBookmark(1); - }); - - c.onHideMenu.add(function() { - if (bm) { - ed.selection.moveToBookmark(bm); - bm = 0; - } - }); - } - - return t.add(c); - }, - - createToolbar : function(id, s, cc) { - var c, t = this, cls; - - id = t.prefix + id; - cls = cc || t._cls.toolbar || tinymce.ui.Toolbar; - c = new cls(id, s, t.editor); - - if (t.get(id)) - return null; - - return t.add(c); - }, - - createToolbarGroup : function(id, s, cc) { - var c, t = this, cls; - id = t.prefix + id; - cls = cc || this._cls.toolbarGroup || tinymce.ui.ToolbarGroup; - c = new cls(id, s, t.editor); - - if (t.get(id)) - return null; - - return t.add(c); - }, - - createSeparator : function(cc) { - var cls = cc || this._cls.separator || tinymce.ui.Separator; - - return new cls(); - }, - - setControlType : function(n, c) { - return this._cls[n.toLowerCase()] = c; - }, - - destroy : function() { - each(this.controls, function(c) { - c.destroy(); - }); - - this.controls = null; - } - }); -})(tinymce); - -(function(tinymce) { - var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isIE = tinymce.isIE, isOpera = tinymce.isOpera; - - tinymce.create('tinymce.WindowManager', { - WindowManager : function(ed) { - var t = this; - - t.editor = ed; - t.onOpen = new Dispatcher(t); - t.onClose = new Dispatcher(t); - t.params = {}; - t.features = {}; - }, - - open : function(s, p) { - var t = this, f = '', x, y, mo = t.editor.settings.dialog_type == 'modal', w, sw, sh, vp = tinymce.DOM.getViewPort(), u; - - // Default some options - s = s || {}; - p = p || {}; - sw = isOpera ? vp.w : screen.width; // Opera uses windows inside the Opera window - sh = isOpera ? vp.h : screen.height; - s.name = s.name || 'mc_' + new Date().getTime(); - s.width = parseInt(s.width || 320); - s.height = parseInt(s.height || 240); - s.resizable = true; - s.left = s.left || parseInt(sw / 2.0) - (s.width / 2.0); - s.top = s.top || parseInt(sh / 2.0) - (s.height / 2.0); - p.inline = false; - p.mce_width = s.width; - p.mce_height = s.height; - p.mce_auto_focus = s.auto_focus; - - if (mo) { - if (isIE) { - s.center = true; - s.help = false; - s.dialogWidth = s.width + 'px'; - s.dialogHeight = s.height + 'px'; - s.scroll = s.scrollbars || false; - } - } - - // Build features string - each(s, function(v, k) { - if (tinymce.is(v, 'boolean')) - v = v ? 'yes' : 'no'; - - if (!/^(name|url)$/.test(k)) { - if (isIE && mo) - f += (f ? ';' : '') + k + ':' + v; - else - f += (f ? ',' : '') + k + '=' + v; - } - }); - - t.features = s; - t.params = p; - t.onOpen.dispatch(t, s, p); - - u = s.url || s.file; - u = tinymce._addVer(u); - - try { - if (isIE && mo) { - w = 1; - window.showModalDialog(u, window, f); - } else - w = window.open(u, s.name, f); - } catch (ex) { - // Ignore - } - - if (!w) - alert(t.editor.getLang('popup_blocked')); - }, - - close : function(w) { - w.close(); - this.onClose.dispatch(this); - }, - - createInstance : function(cl, a, b, c, d, e) { - var f = tinymce.resolve(cl); - - return new f(a, b, c, d, e); - }, - - confirm : function(t, cb, s, w) { - w = w || window; - - cb.call(s || this, w.confirm(this._decode(this.editor.getLang(t, t)))); - }, - - alert : function(tx, cb, s, w) { - var t = this; - - w = w || window; - w.alert(t._decode(t.editor.getLang(tx, tx))); - - if (cb) - cb.call(s || t); - }, - - resizeBy : function(dw, dh, win) { - win.resizeBy(dw, dh); - }, - - // Internal functions - - _decode : function(s) { - return tinymce.DOM.decode(s).replace(/\\n/g, '\n'); - } - }); -}(tinymce)); -(function(tinymce) { - tinymce.Formatter = function(ed) { - var formats = {}, - each = tinymce.each, - dom = ed.dom, - selection = ed.selection, - TreeWalker = tinymce.dom.TreeWalker, - rangeUtils = new tinymce.dom.RangeUtils(dom), - isValid = ed.schema.isValidChild, - isBlock = dom.isBlock, - forcedRootBlock = ed.settings.forced_root_block, - nodeIndex = dom.nodeIndex, - INVISIBLE_CHAR = '\uFEFF', - MCE_ATTR_RE = /^(src|href|style)$/, - FALSE = false, - TRUE = true, - undefined; - - function isArray(obj) { - return obj instanceof Array; - }; - - function getParents(node, selector) { - return dom.getParents(node, selector, dom.getRoot()); - }; - - function isCaretNode(node) { - return node.nodeType === 1 && node.id === '_mce_caret'; - }; - - // Public functions - - function get(name) { - return name ? formats[name] : formats; - }; - - function register(name, format) { - if (name) { - if (typeof(name) !== 'string') { - each(name, function(format, name) { - register(name, format); - }); - } else { - // Force format into array and add it to internal collection - format = format.length ? format : [format]; - - each(format, function(format) { - // Set deep to false by default on selector formats this to avoid removing - // alignment on images inside paragraphs when alignment is changed on paragraphs - if (format.deep === undefined) - format.deep = !format.selector; - - // Default to true - if (format.split === undefined) - format.split = !format.selector || format.inline; - - // Default to true - if (format.remove === undefined && format.selector && !format.inline) - format.remove = 'none'; - - // Mark format as a mixed format inline + block level - if (format.selector && format.inline) { - format.mixed = true; - format.block_expand = true; - } - - // Split classes if needed - if (typeof(format.classes) === 'string') - format.classes = format.classes.split(/\s+/); - }); - - formats[name] = format; - } - } - }; - - var getTextDecoration = function(node) { - var decoration; - - ed.dom.getParent(node, function(n) { - decoration = ed.dom.getStyle(n, 'text-decoration'); - return decoration && decoration !== 'none'; - }); - - return decoration; - }; - - var processUnderlineAndColor = function(node) { - var textDecoration; - if (node.nodeType === 1 && node.parentNode && node.parentNode.nodeType === 1) { - textDecoration = getTextDecoration(node.parentNode); - if (ed.dom.getStyle(node, 'color') && textDecoration) { - ed.dom.setStyle(node, 'text-decoration', textDecoration); - } else if (ed.dom.getStyle(node, 'textdecoration') === textDecoration) { - ed.dom.setStyle(node, 'text-decoration', null); - } - } - }; - - function apply(name, vars, node) { - var formatList = get(name), format = formatList[0], bookmark, rng, i, isCollapsed = selection.isCollapsed(); - - function setElementFormat(elm, fmt) { - fmt = fmt || format; - - if (elm) { - if (fmt.onformat) { - fmt.onformat(elm, fmt, vars, node); - } - - each(fmt.styles, function(value, name) { - dom.setStyle(elm, name, replaceVars(value, vars)); - }); - - each(fmt.attributes, function(value, name) { - dom.setAttrib(elm, name, replaceVars(value, vars)); - }); - - each(fmt.classes, function(value) { - value = replaceVars(value, vars); - - if (!dom.hasClass(elm, value)) - dom.addClass(elm, value); - }); - } - }; - function adjustSelectionToVisibleSelection() { - function findSelectionEnd(start, end) { - var walker = new TreeWalker(end); - for (node = walker.current(); node; node = walker.prev()) { - if (node.childNodes.length > 1 || node == start) { - return node; - } - } - }; - - // Adjust selection so that a end container with a end offset of zero is not included in the selection - // as this isn't visible to the user. - var rng = ed.selection.getRng(); - var start = rng.startContainer; - var end = rng.endContainer; - - if (start != end && rng.endOffset == 0) { - var newEnd = findSelectionEnd(start, end); - var endOffset = newEnd.nodeType == 3 ? newEnd.length : newEnd.childNodes.length; - - rng.setEnd(newEnd, endOffset); - } - - return rng; - } - - function applyStyleToList(node, bookmark, wrapElm, newWrappers, process){ - var nodes = [], listIndex = -1, list, startIndex = -1, endIndex = -1, currentWrapElm; - - // find the index of the first child list. - each(node.childNodes, function(n, index) { - if (n.nodeName === "UL" || n.nodeName === "OL") { - listIndex = index; - list = n; - return false; - } - }); - - // get the index of the bookmarks - each(node.childNodes, function(n, index) { - if (n.nodeName === "SPAN" && dom.getAttrib(n, "data-mce-type") == "bookmark") { - if (n.id == bookmark.id + "_start") { - startIndex = index; - } else if (n.id == bookmark.id + "_end") { - endIndex = index; - } - } - }); - - // if the selection spans across an embedded list, or there isn't an embedded list - handle processing normally - if (listIndex <= 0 || (startIndex < listIndex && endIndex > listIndex)) { - each(tinymce.grep(node.childNodes), process); - return 0; - } else { - currentWrapElm = wrapElm.cloneNode(FALSE); - - // create a list of the nodes on the same side of the list as the selection - each(tinymce.grep(node.childNodes), function(n, index) { - if ((startIndex < listIndex && index < listIndex) || (startIndex > listIndex && index > listIndex)) { - nodes.push(n); - n.parentNode.removeChild(n); - } - }); - - // insert the wrapping element either before or after the list. - if (startIndex < listIndex) { - node.insertBefore(currentWrapElm, list); - } else if (startIndex > listIndex) { - node.insertBefore(currentWrapElm, list.nextSibling); - } - - // add the new nodes to the list. - newWrappers.push(currentWrapElm); - - each(nodes, function(node) { - currentWrapElm.appendChild(node); - }); - - return currentWrapElm; - } - }; - - function applyRngStyle(rng, bookmark, node_specific) { - var newWrappers = [], wrapName, wrapElm; - - // Setup wrapper element - wrapName = format.inline || format.block; - wrapElm = dom.create(wrapName); - setElementFormat(wrapElm); - - rangeUtils.walk(rng, function(nodes) { - var currentWrapElm; - - function process(node) { - var nodeName = node.nodeName.toLowerCase(), parentName = node.parentNode.nodeName.toLowerCase(), found; - - // Stop wrapping on br elements - if (isEq(nodeName, 'br')) { - currentWrapElm = 0; - - // Remove any br elements when we wrap things - if (format.block) - dom.remove(node); - - return; - } - - // If node is wrapper type - if (format.wrapper && matchNode(node, name, vars)) { - currentWrapElm = 0; - return; - } - - // Can we rename the block - if (format.block && !format.wrapper && isTextBlock(nodeName)) { - node = dom.rename(node, wrapName); - setElementFormat(node); - newWrappers.push(node); - currentWrapElm = 0; - return; - } - - // Handle selector patterns - if (format.selector) { - // Look for matching formats - each(formatList, function(format) { - // Check collapsed state if it exists - if ('collapsed' in format && format.collapsed !== isCollapsed) { - return; - } - - if (dom.is(node, format.selector) && !isCaretNode(node)) { - setElementFormat(node, format); - found = true; - } - }); - - // Continue processing if a selector match wasn't found and a inline element is defined - if (!format.inline || found) { - currentWrapElm = 0; - return; - } - } - - // Is it valid to wrap this item - if (isValid(wrapName, nodeName) && isValid(parentName, wrapName) && - !(!node_specific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && !isCaretNode(node)) { - // Start wrapping - if (!currentWrapElm) { - // Wrap the node - currentWrapElm = wrapElm.cloneNode(FALSE); - node.parentNode.insertBefore(currentWrapElm, node); - newWrappers.push(currentWrapElm); - } - - currentWrapElm.appendChild(node); - } else if (nodeName == 'li' && bookmark) { - // Start wrapping - if we are in a list node and have a bookmark, then we will always begin by wrapping in a new element. - currentWrapElm = applyStyleToList(node, bookmark, wrapElm, newWrappers, process); - } else { - // Start a new wrapper for possible children - currentWrapElm = 0; - - each(tinymce.grep(node.childNodes), process); - - // End the last wrapper - currentWrapElm = 0; - } - }; - - // Process siblings from range - each(nodes, process); - }); - - // Wrap links inside as well, for example color inside a link when the wrapper is around the link - if (format.wrap_links === false) { - each(newWrappers, function(node) { - function process(node) { - var i, currentWrapElm, children; - - if (node.nodeName === 'A') { - currentWrapElm = wrapElm.cloneNode(FALSE); - newWrappers.push(currentWrapElm); - - children = tinymce.grep(node.childNodes); - for (i = 0; i < children.length; i++) - currentWrapElm.appendChild(children[i]); - - node.appendChild(currentWrapElm); - } - - each(tinymce.grep(node.childNodes), process); - }; - - process(node); - }); - } - - // Cleanup - each(newWrappers, function(node) { - var childCount; - - function getChildCount(node) { - var count = 0; - - each(node.childNodes, function(node) { - if (!isWhiteSpaceNode(node) && !isBookmarkNode(node)) - count++; - }); - - return count; - }; - - function mergeStyles(node) { - var child, clone; - - each(node.childNodes, function(node) { - if (node.nodeType == 1 && !isBookmarkNode(node) && !isCaretNode(node)) { - child = node; - return FALSE; // break loop - } - }); - - // If child was found and of the same type as the current node - if (child && matchName(child, format)) { - clone = child.cloneNode(FALSE); - setElementFormat(clone); - - dom.replace(clone, node, TRUE); - dom.remove(child, 1); - } - - return clone || node; - }; - - childCount = getChildCount(node); - - // Remove empty nodes but only if there is multiple wrappers and they are not block - // elements so never remove single

    since that would remove the currrent empty block element where the caret is at - if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) { - dom.remove(node, 1); - return; - } - - if (format.inline || format.wrapper) { - // Merges the current node with it's children of similar type to reduce the number of elements - if (!format.exact && childCount === 1) - node = mergeStyles(node); - - // Remove/merge children - each(formatList, function(format) { - // Merge all children of similar type will move styles from child to parent - // this: text - // will become: text - each(dom.select(format.inline, node), function(child) { - var parent; - - // When wrap_links is set to false we don't want - // to remove the format on children within links - if (format.wrap_links === false) { - parent = child.parentNode; - - do { - if (parent.nodeName === 'A') - return; - } while (parent = parent.parentNode); - } - - removeFormat(format, vars, child, format.exact ? child : null); - }); - }); - - // Remove child if direct parent is of same type - if (matchNode(node.parentNode, name, vars)) { - dom.remove(node, 1); - node = 0; - return TRUE; - } - - // Look for parent with similar style format - if (format.merge_with_parents) { - dom.getParent(node.parentNode, function(parent) { - if (matchNode(parent, name, vars)) { - dom.remove(node, 1); - node = 0; - return TRUE; - } - }); - } - - // Merge next and previous siblings if they are similar texttext becomes texttext - if (node && format.merge_siblings !== false) { - node = mergeSiblings(getNonWhiteSpaceSibling(node), node); - node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE)); - } - } - }); - }; - - if (format) { - if (node) { - if (node.nodeType) { - rng = dom.createRng(); - rng.setStartBefore(node); - rng.setEndAfter(node); - applyRngStyle(expandRng(rng, formatList), null, true); - } else { - applyRngStyle(node, null, true); - } - } else { - if (!isCollapsed || !format.inline || dom.select('td.mceSelected,th.mceSelected').length) { - // Obtain selection node before selection is unselected by applyRngStyle() - var curSelNode = ed.selection.getNode(); - - // Apply formatting to selection - ed.selection.setRng(adjustSelectionToVisibleSelection()); - bookmark = selection.getBookmark(); - applyRngStyle(expandRng(selection.getRng(TRUE), formatList), bookmark); - - // Colored nodes should be underlined so that the color of the underline matches the text color. - if (format.styles && (format.styles.color || format.styles.textDecoration)) { - tinymce.walk(curSelNode, processUnderlineAndColor, 'childNodes'); - processUnderlineAndColor(curSelNode); - } - - selection.moveToBookmark(bookmark); - moveStart(selection.getRng(TRUE)); - ed.nodeChanged(); - } else - performCaretAction('apply', name, vars); - } - } - }; - - function remove(name, vars, node) { - var formatList = get(name), format = formatList[0], bookmark, i, rng; - - // Merges the styles for each node - function process(node) { - var children, i, l; - - // Grab the children first since the nodelist might be changed - children = tinymce.grep(node.childNodes); - - // Process current node - for (i = 0, l = formatList.length; i < l; i++) { - if (removeFormat(formatList[i], vars, node, node)) - break; - } - - // Process the children - if (format.deep) { - for (i = 0, l = children.length; i < l; i++) - process(children[i]); - } - }; - - function findFormatRoot(container) { - var formatRoot; - - // Find format root - each(getParents(container.parentNode).reverse(), function(parent) { - var format; - - // Find format root element - if (!formatRoot && parent.id != '_start' && parent.id != '_end') { - // Is the node matching the format we are looking for - format = matchNode(parent, name, vars); - if (format && format.split !== false) - formatRoot = parent; - } - }); - - return formatRoot; - }; - - function wrapAndSplit(format_root, container, target, split) { - var parent, clone, lastClone, firstClone, i, formatRootParent; - - // Format root found then clone formats and split it - if (format_root) { - formatRootParent = format_root.parentNode; - - for (parent = container.parentNode; parent && parent != formatRootParent; parent = parent.parentNode) { - clone = parent.cloneNode(FALSE); - - for (i = 0; i < formatList.length; i++) { - if (removeFormat(formatList[i], vars, clone, clone)) { - clone = 0; - break; - } - } - - // Build wrapper node - if (clone) { - if (lastClone) - clone.appendChild(lastClone); - - if (!firstClone) - firstClone = clone; - - lastClone = clone; - } - } - - // Never split block elements if the format is mixed - if (split && (!format.mixed || !isBlock(format_root))) - container = dom.split(format_root, container); - - // Wrap container in cloned formats - if (lastClone) { - target.parentNode.insertBefore(lastClone, target); - firstClone.appendChild(target); - } - } - - return container; - }; - - function splitToFormatRoot(container) { - return wrapAndSplit(findFormatRoot(container), container, container, true); - }; - - function unwrap(start) { - var node = dom.get(start ? '_start' : '_end'), - out = node[start ? 'firstChild' : 'lastChild']; - - // If the end is placed within the start the result will be removed - // So this checks if the out node is a bookmark node if it is it - // checks for another more suitable node - if (isBookmarkNode(out)) - out = out[start ? 'firstChild' : 'lastChild']; - - dom.remove(node, true); - - return out; - }; - - function removeRngStyle(rng) { - var startContainer, endContainer; - - rng = expandRng(rng, formatList, TRUE); - - if (format.split) { - startContainer = getContainer(rng, TRUE); - endContainer = getContainer(rng); - - if (startContainer != endContainer) { - // Wrap start/end nodes in span element since these might be cloned/moved - startContainer = wrap(startContainer, 'span', {id : '_start', 'data-mce-type' : 'bookmark'}); - endContainer = wrap(endContainer, 'span', {id : '_end', 'data-mce-type' : 'bookmark'}); - - // Split start/end - splitToFormatRoot(startContainer); - splitToFormatRoot(endContainer); - - // Unwrap start/end to get real elements again - startContainer = unwrap(TRUE); - endContainer = unwrap(); - } else - startContainer = endContainer = splitToFormatRoot(startContainer); - - // Update range positions since they might have changed after the split operations - rng.startContainer = startContainer.parentNode; - rng.startOffset = nodeIndex(startContainer); - rng.endContainer = endContainer.parentNode; - rng.endOffset = nodeIndex(endContainer) + 1; - } - - // Remove items between start/end - rangeUtils.walk(rng, function(nodes) { - each(nodes, function(node) { - process(node); - - // Remove parent span if it only contains text-decoration: underline, yet a parent node is also underlined. - if (node.nodeType === 1 && ed.dom.getStyle(node, 'text-decoration') === 'underline' && node.parentNode && getTextDecoration(node.parentNode) === 'underline') { - removeFormat({'deep': false, 'exact': true, 'inline': 'span', 'styles': {'textDecoration' : 'underline'}}, null, node); - } - }); - }); - }; - - // Handle node - if (node) { - if (node.nodeType) { - rng = dom.createRng(); - rng.setStartBefore(node); - rng.setEndAfter(node); - removeRngStyle(rng); - } else { - removeRngStyle(node); - } - - return; - } - - if (!selection.isCollapsed() || !format.inline || dom.select('td.mceSelected,th.mceSelected').length) { - bookmark = selection.getBookmark(); - removeRngStyle(selection.getRng(TRUE)); - selection.moveToBookmark(bookmark); - - // Check if start element still has formatting then we are at: "text|text" and need to move the start into the next text node - if (format.inline && match(name, vars, selection.getStart())) { - moveStart(selection.getRng(true)); - } - - ed.nodeChanged(); - } else - performCaretAction('remove', name, vars); - - // When you remove formatting from a table cell in WebKit (cell, not the contents of a cell) there is a rendering issue with column width - if (tinymce.isWebKit) { - ed.execCommand('mceCleanup'); - } - }; - - function toggle(name, vars, node) { - var fmt = get(name); - - if (match(name, vars, node) && (!('toggle' in fmt[0]) || fmt[0]['toggle'])) - remove(name, vars, node); - else - apply(name, vars, node); - }; - - function matchNode(node, name, vars, similar) { - var formatList = get(name), format, i, classes; - - function matchItems(node, format, item_name) { - var key, value, items = format[item_name], i; - - // Custom match - if (format.onmatch) { - return format.onmatch(node, format, item_name); - } - - // Check all items - if (items) { - // Non indexed object - if (items.length === undefined) { - for (key in items) { - if (items.hasOwnProperty(key)) { - if (item_name === 'attributes') - value = dom.getAttrib(node, key); - else - value = getStyle(node, key); - - if (similar && !value && !format.exact) - return; - - if ((!similar || format.exact) && !isEq(value, replaceVars(items[key], vars))) - return; - } - } - } else { - // Only one match needed for indexed arrays - for (i = 0; i < items.length; i++) { - if (item_name === 'attributes' ? dom.getAttrib(node, items[i]) : getStyle(node, items[i])) - return format; - } - } - } - - return format; - }; - - if (formatList && node) { - // Check each format in list - for (i = 0; i < formatList.length; i++) { - format = formatList[i]; - - // Name name, attributes, styles and classes - if (matchName(node, format) && matchItems(node, format, 'attributes') && matchItems(node, format, 'styles')) { - // Match classes - if (classes = format.classes) { - for (i = 0; i < classes.length; i++) { - if (!dom.hasClass(node, classes[i])) - return; - } - } - - return format; - } - } - } - }; - - function match(name, vars, node) { - var startNode; - - function matchParents(node) { - // Find first node with similar format settings - node = dom.getParent(node, function(node) { - return !!matchNode(node, name, vars, true); - }); - - // Do an exact check on the similar format element - return matchNode(node, name, vars); - }; - - // Check specified node - if (node) - return matchParents(node); - - // Check selected node - node = selection.getNode(); - if (matchParents(node)) - return TRUE; - - // Check start node if it's different - startNode = selection.getStart(); - if (startNode != node) { - if (matchParents(startNode)) - return TRUE; - } - - return FALSE; - }; - - function matchAll(names, vars) { - var startElement, matchedFormatNames = [], checkedMap = {}, i, ni, name; - - // Check start of selection for formats - startElement = selection.getStart(); - dom.getParent(startElement, function(node) { - var i, name; - - for (i = 0; i < names.length; i++) { - name = names[i]; - - if (!checkedMap[name] && matchNode(node, name, vars)) { - checkedMap[name] = true; - matchedFormatNames.push(name); - } - } - }); - - return matchedFormatNames; - }; - - function canApply(name) { - var formatList = get(name), startNode, parents, i, x, selector; - - if (formatList) { - startNode = selection.getStart(); - parents = getParents(startNode); - - for (x = formatList.length - 1; x >= 0; x--) { - selector = formatList[x].selector; - - // Format is not selector based, then always return TRUE - if (!selector) - return TRUE; - - for (i = parents.length - 1; i >= 0; i--) { - if (dom.is(parents[i], selector)) - return TRUE; - } - } - } - - return FALSE; - }; - - // Expose to public - tinymce.extend(this, { - get : get, - register : register, - apply : apply, - remove : remove, - toggle : toggle, - match : match, - matchAll : matchAll, - matchNode : matchNode, - canApply : canApply - }); - - // Private functions - - function matchName(node, format) { - // Check for inline match - if (isEq(node, format.inline)) - return TRUE; - - // Check for block match - if (isEq(node, format.block)) - return TRUE; - - // Check for selector match - if (format.selector) - return dom.is(node, format.selector); - }; - - function isEq(str1, str2) { - str1 = str1 || ''; - str2 = str2 || ''; - - str1 = '' + (str1.nodeName || str1); - str2 = '' + (str2.nodeName || str2); - - return str1.toLowerCase() == str2.toLowerCase(); - }; - - function getStyle(node, name) { - var styleVal = dom.getStyle(node, name); - - // Force the format to hex - if (name == 'color' || name == 'backgroundColor') - styleVal = dom.toHex(styleVal); - - // Opera will return bold as 700 - if (name == 'fontWeight' && styleVal == 700) - styleVal = 'bold'; - - return '' + styleVal; - }; - - function replaceVars(value, vars) { - if (typeof(value) != "string") - value = value(vars); - else if (vars) { - value = value.replace(/%(\w+)/g, function(str, name) { - return vars[name] || str; - }); - } - - return value; - }; - - function isWhiteSpaceNode(node) { - return node && node.nodeType === 3 && /^([\t \r\n]+|)$/.test(node.nodeValue); - }; - - function wrap(node, name, attrs) { - var wrapper = dom.create(name, attrs); - - node.parentNode.insertBefore(wrapper, node); - wrapper.appendChild(node); - - return wrapper; - }; - - function expandRng(rng, format, remove) { - var startContainer = rng.startContainer, - startOffset = rng.startOffset, - endContainer = rng.endContainer, - endOffset = rng.endOffset, sibling, lastIdx, leaf, endPoint; - - // This function walks up the tree if there is no siblings before/after the node - function findParentContainer(start) { - var container, parent, child, sibling, siblingName; - - container = parent = start ? startContainer : endContainer; - siblingName = start ? 'previousSibling' : 'nextSibling'; - root = dom.getRoot(); - - // If it's a text node and the offset is inside the text - if (container.nodeType == 3 && !isWhiteSpaceNode(container)) { - if (start ? startOffset > 0 : endOffset < container.nodeValue.length) { - return container; - } - } - - for (;;) { - // Stop expanding on block elements - if (!format[0].block_expand && isBlock(parent)) - return parent; - - // Walk left/right - for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) { - if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling)) { - return parent; - } - } - - // Check if we can move up are we at root level or body level - if (parent.parentNode == root) { - container = parent; - break; - } - - parent = parent.parentNode; - } - - return container; - }; - - // This function walks down the tree to find the leaf at the selection. - // The offset is also returned as if node initially a leaf, the offset may be in the middle of the text node. - function findLeaf(node, offset) { - if (offset === undefined) - offset = node.nodeType === 3 ? node.length : node.childNodes.length; - while (node && node.hasChildNodes()) { - node = node.childNodes[offset]; - if (node) - offset = node.nodeType === 3 ? node.length : node.childNodes.length; - } - return { node: node, offset: offset }; - } - - // If index based start position then resolve it - if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) { - lastIdx = startContainer.childNodes.length - 1; - startContainer = startContainer.childNodes[startOffset > lastIdx ? lastIdx : startOffset]; - - if (startContainer.nodeType == 3) - startOffset = 0; - } - - // If index based end position then resolve it - if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) { - lastIdx = endContainer.childNodes.length - 1; - endContainer = endContainer.childNodes[endOffset > lastIdx ? lastIdx : endOffset - 1]; - - if (endContainer.nodeType == 3) - endOffset = endContainer.nodeValue.length; - } - - // Exclude bookmark nodes if possible - if (isBookmarkNode(startContainer.parentNode) || isBookmarkNode(startContainer)) { - startContainer = isBookmarkNode(startContainer) ? startContainer : startContainer.parentNode; - startContainer = startContainer.nextSibling || startContainer; - - if (startContainer.nodeType == 3) - startOffset = 0; - } - - if (isBookmarkNode(endContainer.parentNode) || isBookmarkNode(endContainer)) { - endContainer = isBookmarkNode(endContainer) ? endContainer : endContainer.parentNode; - endContainer = endContainer.previousSibling || endContainer; - - if (endContainer.nodeType == 3) - endOffset = endContainer.length; - } - - if (format[0].inline) { - if (rng.collapsed) { - function findWordEndPoint(container, offset, start) { - var walker, node, pos, lastTextNode; - - function findSpace(node, offset) { - var pos, pos2, str = node.nodeValue; - - if (typeof(offset) == "undefined") { - offset = start ? str.length : 0; - } - - if (start) { - pos = str.lastIndexOf(' ', offset); - pos2 = str.lastIndexOf('\u00a0', offset); - pos = pos > pos2 ? pos : pos2; - - // Include the space on remove to avoid tag soup - if (pos !== -1 && !remove) { - pos++; - } - } else { - pos = str.indexOf(' ', offset); - pos2 = str.indexOf('\u00a0', offset); - pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2; - } - - return pos; - }; - - if (container.nodeType === 3) { - pos = findSpace(container, offset); - - if (pos !== -1) { - return {container : container, offset : pos}; - } - - lastTextNode = container; - } - - // Walk the nodes inside the block - walker = new TreeWalker(container, dom.getParent(container, isBlock) || ed.getBody()); - while (node = walker[start ? 'prev' : 'next']()) { - if (node.nodeType === 3) { - lastTextNode = node; - pos = findSpace(node); - - if (pos !== -1) { - return {container : node, offset : pos}; - } - } else if (isBlock(node)) { - break; - } - } - - if (lastTextNode) { - if (start) { - offset = 0; - } else { - offset = lastTextNode.length; - } - - return {container: lastTextNode, offset: offset}; - } - } - - // Expand left to closest word boundery - endPoint = findWordEndPoint(startContainer, startOffset, true); - if (endPoint) { - startContainer = endPoint.container; - startOffset = endPoint.offset; - } - - // Expand right to closest word boundery - endPoint = findWordEndPoint(endContainer, endOffset); - if (endPoint) { - endContainer = endPoint.container; - endOffset = endPoint.offset; - } - } - - // Avoid applying formatting to a trailing space. - leaf = findLeaf(endContainer, endOffset); - if (leaf.node) { - while (leaf.node && leaf.offset === 0 && leaf.node.previousSibling) - leaf = findLeaf(leaf.node.previousSibling); - - if (leaf.node && leaf.offset > 0 && leaf.node.nodeType === 3 && - leaf.node.nodeValue.charAt(leaf.offset - 1) === ' ') { - - if (leaf.offset > 1) { - endContainer = leaf.node; - endContainer.splitText(leaf.offset - 1); - } else if (leaf.node.previousSibling) { - // TODO: Figure out why this is in here - //endContainer = leaf.node.previousSibling; - } - } - } - } - - // Move start/end point up the tree if the leaves are sharp and if we are in different containers - // Example * becomes !: !

    *texttext*

    ! - // This will reduce the number of wrapper elements that needs to be created - // Move start point up the tree - if (format[0].inline || format[0].block_expand) { - if (!format[0].inline || (startContainer.nodeType != 3 || startOffset === 0)) { - startContainer = findParentContainer(true); - } - - if (!format[0].inline || (endContainer.nodeType != 3 || endOffset === endContainer.nodeValue.length)) { - endContainer = findParentContainer(); - } - } - - // Expand start/end container to matching selector - if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) { - function findSelectorEndPoint(container, sibling_name) { - var parents, i, y, curFormat; - - if (container.nodeType == 3 && container.nodeValue.length == 0 && container[sibling_name]) - container = container[sibling_name]; - - parents = getParents(container); - for (i = 0; i < parents.length; i++) { - for (y = 0; y < format.length; y++) { - curFormat = format[y]; - - // If collapsed state is set then skip formats that doesn't match that - if ("collapsed" in curFormat && curFormat.collapsed !== rng.collapsed) - continue; - - if (dom.is(parents[i], curFormat.selector)) - return parents[i]; - } - } - - return container; - }; - - // Find new startContainer/endContainer if there is better one - startContainer = findSelectorEndPoint(startContainer, 'previousSibling'); - endContainer = findSelectorEndPoint(endContainer, 'nextSibling'); - } - - // Expand start/end container to matching block element or text node - if (format[0].block || format[0].selector) { - function findBlockEndPoint(container, sibling_name, sibling_name2) { - var node; - - // Expand to block of similar type - if (!format[0].wrapper) - node = dom.getParent(container, format[0].block); - - // Expand to first wrappable block element or any block element - if (!node) - node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isBlock); - - // Exclude inner lists from wrapping - if (node && format[0].wrapper) - node = getParents(node, 'ul,ol').reverse()[0] || node; - - // Didn't find a block element look for first/last wrappable element - if (!node) { - node = container; - - while (node[sibling_name] && !isBlock(node[sibling_name])) { - node = node[sibling_name]; - - // Break on BR but include it will be removed later on - // we can't remove it now since we need to check if it can be wrapped - if (isEq(node, 'br')) - break; - } - } - - return node || container; - }; - - // Find new startContainer/endContainer if there is better one - startContainer = findBlockEndPoint(startContainer, 'previousSibling'); - endContainer = findBlockEndPoint(endContainer, 'nextSibling'); - - // Non block element then try to expand up the leaf - if (format[0].block) { - if (!isBlock(startContainer)) - startContainer = findParentContainer(true); - - if (!isBlock(endContainer)) - endContainer = findParentContainer(); - } - } - - // Setup index for startContainer - if (startContainer.nodeType == 1) { - startOffset = nodeIndex(startContainer); - startContainer = startContainer.parentNode; - } - - // Setup index for endContainer - if (endContainer.nodeType == 1) { - endOffset = nodeIndex(endContainer) + 1; - endContainer = endContainer.parentNode; - } - - // Return new range like object - return { - startContainer : startContainer, - startOffset : startOffset, - endContainer : endContainer, - endOffset : endOffset - }; - } - - function removeFormat(format, vars, node, compare_node) { - var i, attrs, stylesModified; - - // Check if node matches format - if (!matchName(node, format)) - return FALSE; - - // Should we compare with format attribs and styles - if (format.remove != 'all') { - // Remove styles - each(format.styles, function(value, name) { - value = replaceVars(value, vars); - - // Indexed array - if (typeof(name) === 'number') { - name = value; - compare_node = 0; - } - - if (!compare_node || isEq(getStyle(compare_node, name), value)) - dom.setStyle(node, name, ''); - - stylesModified = 1; - }); - - // Remove style attribute if it's empty - if (stylesModified && dom.getAttrib(node, 'style') == '') { - node.removeAttribute('style'); - node.removeAttribute('data-mce-style'); - } - - // Remove attributes - each(format.attributes, function(value, name) { - var valueOut; - - value = replaceVars(value, vars); - - // Indexed array - if (typeof(name) === 'number') { - name = value; - compare_node = 0; - } - - if (!compare_node || isEq(dom.getAttrib(compare_node, name), value)) { - // Keep internal classes - if (name == 'class') { - value = dom.getAttrib(node, name); - if (value) { - // Build new class value where everything is removed except the internal prefixed classes - valueOut = ''; - each(value.split(/\s+/), function(cls) { - if (/mce\w+/.test(cls)) - valueOut += (valueOut ? ' ' : '') + cls; - }); - - // We got some internal classes left - if (valueOut) { - dom.setAttrib(node, name, valueOut); - return; - } - } - } - - // IE6 has a bug where the attribute doesn't get removed correctly - if (name == "class") - node.removeAttribute('className'); - - // Remove mce prefixed attributes - if (MCE_ATTR_RE.test(name)) - node.removeAttribute('data-mce-' + name); - - node.removeAttribute(name); - } - }); - - // Remove classes - each(format.classes, function(value) { - value = replaceVars(value, vars); - - if (!compare_node || dom.hasClass(compare_node, value)) - dom.removeClass(node, value); - }); - - // Check for non internal attributes - attrs = dom.getAttribs(node); - for (i = 0; i < attrs.length; i++) { - if (attrs[i].nodeName.indexOf('_') !== 0) - return FALSE; - } - } - - // Remove the inline child if it's empty for example or - if (format.remove != 'none') { - removeNode(node, format); - return TRUE; - } - }; - - function removeNode(node, format) { - var parentNode = node.parentNode, rootBlockElm; - - if (format.block) { - if (!forcedRootBlock) { - function find(node, next, inc) { - node = getNonWhiteSpaceSibling(node, next, inc); - - return !node || (node.nodeName == 'BR' || isBlock(node)); - }; - - // Append BR elements if needed before we remove the block - if (isBlock(node) && !isBlock(parentNode)) { - if (!find(node, FALSE) && !find(node.firstChild, TRUE, 1)) - node.insertBefore(dom.create('br'), node.firstChild); - - if (!find(node, TRUE) && !find(node.lastChild, FALSE, 1)) - node.appendChild(dom.create('br')); - } - } else { - // Wrap the block in a forcedRootBlock if we are at the root of document - if (parentNode == dom.getRoot()) { - if (!format.list_block || !isEq(node, format.list_block)) { - each(tinymce.grep(node.childNodes), function(node) { - if (isValid(forcedRootBlock, node.nodeName.toLowerCase())) { - if (!rootBlockElm) - rootBlockElm = wrap(node, forcedRootBlock); - else - rootBlockElm.appendChild(node); - } else - rootBlockElm = 0; - }); - } - } - } - } - - // Never remove nodes that isn't the specified inline element if a selector is specified too - if (format.selector && format.inline && !isEq(format.inline, node)) - return; - - dom.remove(node, 1); - }; - - function getNonWhiteSpaceSibling(node, next, inc) { - if (node) { - next = next ? 'nextSibling' : 'previousSibling'; - - for (node = inc ? node : node[next]; node; node = node[next]) { - if (node.nodeType == 1 || !isWhiteSpaceNode(node)) - return node; - } - } - }; - - function isBookmarkNode(node) { - return node && node.nodeType == 1 && node.getAttribute('data-mce-type') == 'bookmark'; - }; - - function mergeSiblings(prev, next) { - var marker, sibling, tmpSibling; - - function compareElements(node1, node2) { - // Not the same name - if (node1.nodeName != node2.nodeName) - return FALSE; - - function getAttribs(node) { - var attribs = {}; - - each(dom.getAttribs(node), function(attr) { - var name = attr.nodeName.toLowerCase(); - - // Don't compare internal attributes or style - if (name.indexOf('_') !== 0 && name !== 'style') - attribs[name] = dom.getAttrib(node, name); - }); - - return attribs; - }; - - function compareObjects(obj1, obj2) { - var value, name; - - for (name in obj1) { - // Obj1 has item obj2 doesn't have - if (obj1.hasOwnProperty(name)) { - value = obj2[name]; - - // Obj2 doesn't have obj1 item - if (value === undefined) - return FALSE; - - // Obj2 item has a different value - if (obj1[name] != value) - return FALSE; - - // Delete similar value - delete obj2[name]; - } - } - - // Check if obj 2 has something obj 1 doesn't have - for (name in obj2) { - // Obj2 has item obj1 doesn't have - if (obj2.hasOwnProperty(name)) - return FALSE; - } - - return TRUE; - }; - - // Attribs are not the same - if (!compareObjects(getAttribs(node1), getAttribs(node2))) - return FALSE; - - // Styles are not the same - if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) - return FALSE; - - return TRUE; - }; - - // Check if next/prev exists and that they are elements - if (prev && next) { - function findElementSibling(node, sibling_name) { - for (sibling = node; sibling; sibling = sibling[sibling_name]) { - if (sibling.nodeType == 3 && sibling.nodeValue.length !== 0) - return node; - - if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) - return sibling; - } - - return node; - }; - - // If previous sibling is empty then jump over it - prev = findElementSibling(prev, 'previousSibling'); - next = findElementSibling(next, 'nextSibling'); - - // Compare next and previous nodes - if (compareElements(prev, next)) { - // Append nodes between - for (sibling = prev.nextSibling; sibling && sibling != next;) { - tmpSibling = sibling; - sibling = sibling.nextSibling; - prev.appendChild(tmpSibling); - } - - // Remove next node - dom.remove(next); - - // Move children into prev node - each(tinymce.grep(next.childNodes), function(node) { - prev.appendChild(node); - }); - - return prev; - } - } - - return next; - }; - - function isTextBlock(name) { - return /^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(name); - }; - - function getContainer(rng, start) { - var container, offset, lastIdx, walker; - - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; - - if (container.nodeType == 1) { - lastIdx = container.childNodes.length - 1; - - if (!start && offset) - offset--; - - container = container.childNodes[offset > lastIdx ? lastIdx : offset]; - } - - // If start text node is excluded then walk to the next node - if (container.nodeType === 3 && start && offset >= container.nodeValue.length) { - container = new TreeWalker(container, ed.getBody()).next() || container; - } - - // If end text node is excluded then walk to the previous node - if (container.nodeType === 3 && !start && offset == 0) { - container = new TreeWalker(container, ed.getBody()).prev() || container; - } - - return container; - }; - - function performCaretAction(type, name, vars) { - var invisibleChar, caretContainerId = '_mce_caret', debug = ed.settings.caret_debug; - - // Setup invisible character use zero width space on Gecko since it doesn't change the heigt of the container - invisibleChar = tinymce.isGecko ? '\u200B' : INVISIBLE_CHAR; - - // Creates a caret container bogus element - function createCaretContainer(fill) { - var caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''}); - - if (fill) { - caretContainer.appendChild(ed.getDoc().createTextNode(invisibleChar)); - } - - return caretContainer; - }; - - function isCaretContainerEmpty(node, nodes) { - while (node) { - if ((node.nodeType === 3 && node.nodeValue !== invisibleChar) || node.childNodes.length > 1) { - return false; - } - - // Collect nodes - if (nodes && node.nodeType === 1) { - nodes.push(node); - } - - node = node.firstChild; - } - - return true; - }; - - // Returns any parent caret container element - function getParentCaretContainer(node) { - while (node) { - if (node.id === caretContainerId) { - return node; - } - - node = node.parentNode; - } - }; - - // Finds the first text node in the specified node - function findFirstTextNode(node) { - var walker; - - if (node) { - walker = new TreeWalker(node, node); - - for (node = walker.current(); node; node = walker.next()) { - if (node.nodeType === 3) { - return node; - } - } - } - }; - - // Removes the caret container for the specified node or all on the current document - function removeCaretContainer(node, move_caret) { - var child, rng; - - if (!node) { - node = getParentCaretContainer(selection.getStart()); - - if (!node) { - while (node = dom.get(caretContainerId)) { - removeCaretContainer(node, false); - } - } - } else { - rng = selection.getRng(true); - - if (isCaretContainerEmpty(node)) { - if (move_caret !== false) { - rng.setStartBefore(node); - rng.setEndBefore(node); - } - - dom.remove(node); - } else { - child = findFirstTextNode(node); - - if (child.nodeValue.charAt(0) === INVISIBLE_CHAR) { - child = child.deleteData(0, 1); - } - - dom.remove(node, 1); - } - - selection.setRng(rng); - } - }; - - // Applies formatting to the caret postion - function applyCaretFormat() { - var rng, caretContainer, textNode, offset, bookmark, container, text; - - rng = selection.getRng(true); - offset = rng.startOffset; - container = rng.startContainer; - text = container.nodeValue; - - caretContainer = getParentCaretContainer(selection.getStart()); - if (caretContainer) { - textNode = findFirstTextNode(caretContainer); - } - - // Expand to word is caret is in the middle of a text node and the char before/after is a alpha numeric character - if (text && offset > 0 && offset < text.length && /\w/.test(text.charAt(offset)) && /\w/.test(text.charAt(offset - 1))) { - // Get bookmark of caret position - bookmark = selection.getBookmark(); - - // Collapse bookmark range (WebKit) - rng.collapse(true); - - // Expand the range to the closest word and split it at those points - rng = expandRng(rng, get(name)); - rng = rangeUtils.split(rng); - - // Apply the format to the range - apply(name, vars, rng); - - // Move selection back to caret position - selection.moveToBookmark(bookmark); - } else { - if (!caretContainer || textNode.nodeValue !== invisibleChar) { - caretContainer = createCaretContainer(true); - textNode = caretContainer.firstChild; - - rng.insertNode(caretContainer); - offset = 1; - - apply(name, vars, caretContainer); - } else { - apply(name, vars, caretContainer); - } - - // Move selection to text node - selection.setCursorLocation(textNode, offset); - } - }; - - function removeCaretFormat() { - var rng = selection.getRng(true), container, offset, bookmark, - hasContentAfter, node, formatNode, parents = [], i, caretContainer; - - container = rng.startContainer; - offset = rng.startOffset; - node = container; - - if (container.nodeType == 3) { - if (offset != container.nodeValue.length || container.nodeValue === invisibleChar) { - hasContentAfter = true; - } - - node = node.parentNode; - } - - while (node) { - if (matchNode(node, name, vars)) { - formatNode = node; - break; - } - - if (node.nextSibling) { - hasContentAfter = true; - } - - parents.push(node); - node = node.parentNode; - } - - // Node doesn't have the specified format - if (!formatNode) { - return; - } - - // Is there contents after the caret then remove the format on the element - if (hasContentAfter) { - // Get bookmark of caret position - bookmark = selection.getBookmark(); - - // Collapse bookmark range (WebKit) - rng.collapse(true); - - // Expand the range to the closest word and split it at those points - rng = expandRng(rng, get(name), true); - rng = rangeUtils.split(rng); - - // Remove the format from the range - remove(name, vars, rng); - - // Move selection back to caret position - selection.moveToBookmark(bookmark); - } else { - caretContainer = createCaretContainer(); - - node = caretContainer; - for (i = parents.length - 1; i >= 0; i--) { - node.appendChild(parents[i].cloneNode(false)); - node = node.firstChild; - } - - // Insert invisible character into inner most format element - node.appendChild(dom.doc.createTextNode(invisibleChar)); - node = node.firstChild; - - // Insert caret container after the formated node - dom.insertAfter(caretContainer, formatNode); - - // Move selection to text node - selection.setCursorLocation(node, 1); - } - }; - - // Only bind the caret events once - if (!self._hasCaretEvents) { - // Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements - ed.onBeforeGetContent.addToTop(function() { - var nodes = [], i; - - if (isCaretContainerEmpty(getParentCaretContainer(selection.getStart()), nodes)) { - // Mark children - i = nodes.length; - while (i--) { - dom.setAttrib(nodes[i], 'data-mce-bogus', '1'); - } - } - }); - - // Remove caret container on mouse up and on key up - tinymce.each('onMouseUp onKeyUp'.split(' '), function(name) { - ed[name].addToTop(function() { - removeCaretContainer(); - }); - }); - - // Remove caret container on keydown and it's a backspace, enter or left/right arrow keys - ed.onKeyDown.addToTop(function(ed, e) { - var keyCode = e.keyCode; - - if (keyCode == 8 || keyCode == 37 || keyCode == 39) { - removeCaretContainer(getParentCaretContainer(selection.getStart())); - } - }); - - self._hasCaretEvents = true; - } - - // Do apply or remove caret format - if (type == "apply") { - applyCaretFormat(); - } else { - removeCaretFormat(); - } - }; - - function moveStart(rng) { - var container = rng.startContainer, - offset = rng.startOffset, - walker, node, nodes, tmpNode; - - // Convert text node into index if possible - if (container.nodeType == 3 && offset >= container.nodeValue.length - 1) { - container = container.parentNode; - offset = nodeIndex(container) + 1; - } - - // Move startContainer/startOffset in to a suitable node - if (container.nodeType == 1) { - nodes = container.childNodes; - container = nodes[Math.min(offset, nodes.length - 1)]; - walker = new TreeWalker(container); - - // If offset is at end of the parent node walk to the next one - if (offset > nodes.length - 1) - walker.next(); - - for (node = walker.current(); node; node = walker.next()) { - if (node.nodeType == 3 && !isWhiteSpaceNode(node)) { - // IE has a "neat" feature where it moves the start node into the closest element - // we can avoid this by inserting an element before it and then remove it after we set the selection - tmpNode = dom.create('a', null, INVISIBLE_CHAR); - node.parentNode.insertBefore(tmpNode, node); - - // Set selection and remove tmpNode - rng.setStart(node, 0); - selection.setRng(rng); - dom.remove(tmpNode); - - return; - } - } - } - }; - - }; -})(tinymce); - -tinymce.onAddEditor.add(function(tinymce, ed) { - var filters, fontSizes, dom, settings = ed.settings; - - if (settings.inline_styles) { - fontSizes = tinymce.explode(settings.font_size_legacy_values); - - function replaceWithSpan(node, styles) { - tinymce.each(styles, function(value, name) { - if (value) - dom.setStyle(node, name, value); - }); - - dom.rename(node, 'span'); - }; - - filters = { - font : function(dom, node) { - replaceWithSpan(node, { - backgroundColor : node.style.backgroundColor, - color : node.color, - fontFamily : node.face, - fontSize : fontSizes[parseInt(node.size) - 1] - }); - }, - - u : function(dom, node) { - replaceWithSpan(node, { - textDecoration : 'underline' - }); - }, - - strike : function(dom, node) { - replaceWithSpan(node, { - textDecoration : 'line-through' - }); - } - }; - - function convert(editor, params) { - dom = editor.dom; - - if (settings.convert_fonts_to_spans) { - tinymce.each(dom.select('font,u,strike', params.node), function(node) { - filters[node.nodeName.toLowerCase()](ed.dom, node); - }); - } - }; - - ed.onPreProcess.add(convert); - ed.onSetContent.add(convert); - - ed.onInit.add(function() { - ed.selection.onSetContent.add(convert); - }); - } -}); - +(function(win) { + var whiteSpaceRe = /^\s*|\s*$/g, + undefined, isRegExpBroken = 'B'.replace(/A(.)|B/, '$1') === '$1'; + + var tinymce = { + majorVersion : '3', + + minorVersion : '4.9', + + releaseDate : '2012-02-23', + + _init : function() { + var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v; + + t.isOpera = win.opera && opera.buildNumber; + + t.isWebKit = /WebKit/.test(ua); + + t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName); + + t.isIE6 = t.isIE && /MSIE [56]/.test(ua); + + t.isIE7 = t.isIE && /MSIE [7]/.test(ua); + + t.isIE8 = t.isIE && /MSIE [8]/.test(ua); + + t.isIE9 = t.isIE && /MSIE [9]/.test(ua); + + t.isGecko = !t.isWebKit && /Gecko/.test(ua); + + t.isMac = ua.indexOf('Mac') != -1; + + t.isAir = /adobeair/i.test(ua); + + t.isIDevice = /(iPad|iPhone)/.test(ua); + + t.isIOS5 = t.isIDevice && ua.match(/AppleWebKit\/(\d*)/)[1]>=534; + + // TinyMCE .NET webcontrol might be setting the values for TinyMCE + if (win.tinyMCEPreInit) { + t.suffix = tinyMCEPreInit.suffix; + t.baseURL = tinyMCEPreInit.base; + t.query = tinyMCEPreInit.query; + return; + } + + // Get suffix and base + t.suffix = ''; + + // If base element found, add that infront of baseURL + nl = d.getElementsByTagName('base'); + for (i=0; i : + s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s); + cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name + + // Create namespace for new class + ns = t.createNS(s[3].replace(/\.\w+$/, ''), root); + + // Class already exists + if (ns[cn]) + return; + + // Make pure static class + if (s[2] == 'static') { + ns[cn] = p; + + if (this.onCreate) + this.onCreate(s[2], s[3], ns[cn]); + + return; + } + + // Create default constructor + if (!p[cn]) { + p[cn] = function() {}; + de = 1; + } + + // Add constructor and methods + ns[cn] = p[cn]; + t.extend(ns[cn].prototype, p); + + // Extend + if (s[5]) { + sp = t.resolve(s[5]).prototype; + scn = s[5].match(/\.(\w+)$/i)[1]; // Class name + + // Extend constructor + c = ns[cn]; + if (de) { + // Add passthrough constructor + ns[cn] = function() { + return sp[scn].apply(this, arguments); + }; + } else { + // Add inherit constructor + ns[cn] = function() { + this.parent = sp[scn]; + return c.apply(this, arguments); + }; + } + ns[cn].prototype[cn] = ns[cn]; + + // Add super methods + t.each(sp, function(f, n) { + ns[cn].prototype[n] = sp[n]; + }); + + // Add overridden methods + t.each(p, function(f, n) { + // Extend methods if needed + if (sp[n]) { + ns[cn].prototype[n] = function() { + this.parent = sp[n]; + return f.apply(this, arguments); + }; + } else { + if (n != cn) + ns[cn].prototype[n] = f; + } + }); + } + + // Add static methods + t.each(p['static'], function(f, n) { + ns[cn][n] = f; + }); + + if (this.onCreate) + this.onCreate(s[2], s[3], ns[cn].prototype); + }, + + walk : function(o, f, n, s) { + s = s || this; + + if (o) { + if (n) + o = o[n]; + + tinymce.each(o, function(o, i) { + if (f.call(s, o, i, n) === false) + return false; + + tinymce.walk(o, f, n, s); + }); + } + }, + + createNS : function(n, o) { + var i, v; + + o = o || win; + + n = n.split('.'); + for (i=0; i 0 ? a : [c.scope]); + + if (s === false) + break; + } + + return s; + } + + }); + +(function() { + var each = tinymce.each; + + tinymce.create('tinymce.util.URI', { + URI : function(u, s) { + var t = this, o, a, b, base_url; + + // Trim whitespace + u = tinymce.trim(u); + + // Default settings + s = t.settings = s || {}; + + // Strange app protocol that isn't http/https or local anchor + // For example: mailto,skype,tel etc. + if (/^([\w\-]+):([^\/]{2})/i.test(u) || /^\s*#/.test(u)) { + t.source = u; + return; + } + + // Absolute path with no host, fake host and protocol + if (u.indexOf('/') === 0 && u.indexOf('//') !== 0) + u = (s.base_uri ? s.base_uri.protocol || 'http' : 'http') + '://mce_host' + u; + + // Relative path http:// or protocol relative //path + if (!/^[\w-]*:?\/\//.test(u)) { + base_url = s.base_uri ? s.base_uri.path : new tinymce.util.URI(location.href).directory; + u = ((s.base_uri && s.base_uri.protocol) || 'http') + '://mce_host' + t.toAbsPath(base_url, u); + } + + // Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri) + u = u.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something + u = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u); + each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], function(v, i) { + var s = u[i]; + + // Zope 3 workaround, they use @@something + if (s) + s = s.replace(/\(mce_at\)/g, '@@'); + + t[v] = s; + }); + + if (b = s.base_uri) { + if (!t.protocol) + t.protocol = b.protocol; + + if (!t.userInfo) + t.userInfo = b.userInfo; + + if (!t.port && t.host == 'mce_host') + t.port = b.port; + + if (!t.host || t.host == 'mce_host') + t.host = b.host; + + t.source = ''; + } + + //t.path = t.path || '/'; + }, + + setPath : function(p) { + var t = this; + + p = /^(.*?)\/?(\w+)?$/.exec(p); + + // Update path parts + t.path = p[0]; + t.directory = p[1]; + t.file = p[2]; + + // Rebuild source + t.source = ''; + t.getURI(); + }, + + toRelative : function(u) { + var t = this, o; + + if (u === "./") + return u; + + u = new tinymce.util.URI(u, {base_uri : t}); + + // Not on same domain/port or protocol + if ((u.host != 'mce_host' && t.host != u.host && u.host) || t.port != u.port || t.protocol != u.protocol) + return u.getURI(); + + o = t.toRelPath(t.path, u.path); + + // Add query + if (u.query) + o += '?' + u.query; + + // Add anchor + if (u.anchor) + o += '#' + u.anchor; + + return o; + }, + + toAbsolute : function(u, nh) { + var u = new tinymce.util.URI(u, {base_uri : this}); + + return u.getURI(this.host == u.host && this.protocol == u.protocol ? nh : 0); + }, + + toRelPath : function(base, path) { + var items, bp = 0, out = '', i, l; + + // Split the paths + base = base.substring(0, base.lastIndexOf('/')); + base = base.split('/'); + items = path.split('/'); + + if (base.length >= items.length) { + for (i = 0, l = base.length; i < l; i++) { + if (i >= items.length || base[i] != items[i]) { + bp = i + 1; + break; + } + } + } + + if (base.length < items.length) { + for (i = 0, l = items.length; i < l; i++) { + if (i >= base.length || base[i] != items[i]) { + bp = i + 1; + break; + } + } + } + + if (bp == 1) + return path; + + for (i = 0, l = base.length - (bp - 1); i < l; i++) + out += "../"; + + for (i = bp - 1, l = items.length; i < l; i++) { + if (i != bp - 1) + out += "/" + items[i]; + else + out += items[i]; + } + + return out; + }, + + toAbsPath : function(base, path) { + var i, nb = 0, o = [], tr, outPath; + + // Split paths + tr = /\/$/.test(path) ? '/' : ''; + base = base.split('/'); + path = path.split('/'); + + // Remove empty chunks + each(base, function(k) { + if (k) + o.push(k); + }); + + base = o; + + // Merge relURLParts chunks + for (i = path.length - 1, o = []; i >= 0; i--) { + // Ignore empty or . + if (path[i].length == 0 || path[i] == ".") + continue; + + // Is parent + if (path[i] == '..') { + nb++; + continue; + } + + // Move up + if (nb > 0) { + nb--; + continue; + } + + o.push(path[i]); + } + + i = base.length - nb; + + // If /a/b/c or / + if (i <= 0) + outPath = o.reverse().join('/'); + else + outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/'); + + // Add front / if it's needed + if (outPath.indexOf('/') !== 0) + outPath = '/' + outPath; + + // Add traling / if it's needed + if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) + outPath += tr; + + return outPath; + }, + + getURI : function(nh) { + var s, t = this; + + // Rebuild source + if (!t.source || nh) { + s = ''; + + if (!nh) { + if (t.protocol) + s += t.protocol + '://'; + + if (t.userInfo) + s += t.userInfo + '@'; + + if (t.host) + s += t.host; + + if (t.port) + s += ':' + t.port; + } + + if (t.path) + s += t.path; + + if (t.query) + s += '?' + t.query; + + if (t.anchor) + s += '#' + t.anchor; + + t.source = s; + } + + return t.source; + } + }); +})(); + +(function() { + var each = tinymce.each; + + tinymce.create('static tinymce.util.Cookie', { + getHash : function(n) { + var v = this.get(n), h; + + if (v) { + each(v.split('&'), function(v) { + v = v.split('='); + h = h || {}; + h[unescape(v[0])] = unescape(v[1]); + }); + } + + return h; + }, + + setHash : function(n, v, e, p, d, s) { + var o = ''; + + each(v, function(v, k) { + o += (!o ? '' : '&') + escape(k) + '=' + escape(v); + }); + + this.set(n, o, e, p, d, s); + }, + + get : function(n) { + var c = document.cookie, e, p = n + "=", b; + + // Strict mode + if (!c) + return; + + b = c.indexOf("; " + p); + + if (b == -1) { + b = c.indexOf(p); + + if (b != 0) + return null; + } else + b += 2; + + e = c.indexOf(";", b); + + if (e == -1) + e = c.length; + + return unescape(c.substring(b + p.length, e)); + }, + + set : function(n, v, e, p, d, s) { + document.cookie = n + "=" + escape(v) + + ((e) ? "; expires=" + e.toGMTString() : "") + + ((p) ? "; path=" + escape(p) : "") + + ((d) ? "; domain=" + d : "") + + ((s) ? "; secure" : ""); + }, + + remove : function(n, p) { + var d = new Date(); + + d.setTime(d.getTime() - 1000); + + this.set(n, '', d, p, d); + } + }); +})(); + +(function() { + function serialize(o, quote) { + var i, v, t; + + quote = quote || '"'; + + if (o == null) + return 'null'; + + t = typeof o; + + if (t == 'string') { + v = '\bb\tt\nn\ff\rr\""\'\'\\\\'; + + return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function(a, b) { + // Make sure single quotes never get encoded inside double quotes for JSON compatibility + if (quote === '"' && a === "'") + return a; + + i = v.indexOf(b); + + if (i + 1) + return '\\' + v.charAt(i + 1); + + a = b.charCodeAt().toString(16); + + return '\\u' + '0000'.substring(a.length) + a; + }) + quote; + } + + if (t == 'object') { + if (o.hasOwnProperty && o instanceof Array) { + for (i=0, v = '['; i 0 ? ',' : '') + serialize(o[i], quote); + + return v + ']'; + } + + v = '{'; + + for (i in o) { + if (o.hasOwnProperty(i)) { + v += typeof o[i] != 'function' ? (v.length > 1 ? ',' + quote : quote) + i + quote +':' + serialize(o[i], quote) : ''; + } + } + + return v + '}'; + } + + return '' + o; + }; + + tinymce.util.JSON = { + serialize: serialize, + + parse: function(s) { + try { + return eval('(' + s + ')'); + } catch (ex) { + // Ignore + } + } + + }; +})(); + +tinymce.create('static tinymce.util.XHR', { + send : function(o) { + var x, t, w = window, c = 0; + + // Default settings + o.scope = o.scope || this; + o.success_scope = o.success_scope || o.scope; + o.error_scope = o.error_scope || o.scope; + o.async = o.async === false ? false : true; + o.data = o.data || ''; + + function get(s) { + x = 0; + + try { + x = new ActiveXObject(s); + } catch (ex) { + } + + return x; + }; + + x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Microsoft.XMLHTTP') || get('Msxml2.XMLHTTP'); + + if (x) { + if (x.overrideMimeType) + x.overrideMimeType(o.content_type); + + x.open(o.type || (o.data ? 'POST' : 'GET'), o.url, o.async); + + if (o.content_type) + x.setRequestHeader('Content-Type', o.content_type); + + x.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + + x.send(o.data); + + function ready() { + if (!o.async || x.readyState == 4 || c++ > 10000) { + if (o.success && c < 10000 && x.status == 200) + o.success.call(o.success_scope, '' + x.responseText, x, o); + else if (o.error) + o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o); + + x = null; + } else + w.setTimeout(ready, 10); + }; + + // Syncronous request + if (!o.async) + return ready(); + + // Wait for response, onReadyStateChange can not be used since it leaks memory in IE + t = w.setTimeout(ready, 10); + } + } +}); + +(function() { + var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR; + + tinymce.create('tinymce.util.JSONRequest', { + JSONRequest : function(s) { + this.settings = extend({ + }, s); + this.count = 0; + }, + + send : function(o) { + var ecb = o.error, scb = o.success; + + o = extend(this.settings, o); + + o.success = function(c, x) { + c = JSON.parse(c); + + if (typeof(c) == 'undefined') { + c = { + error : 'JSON Parse error.' + }; + } + + if (c.error) + ecb.call(o.error_scope || o.scope, c.error, x); + else + scb.call(o.success_scope || o.scope, c.result); + }; + + o.error = function(ty, x) { + if (ecb) + ecb.call(o.error_scope || o.scope, ty, x); + }; + + o.data = JSON.serialize({ + id : o.id || 'c' + (this.count++), + method : o.method, + params : o.params + }); + + // JSON content type for Ruby on rails. Bug: #1883287 + o.content_type = 'application/json'; + + XHR.send(o); + }, + + 'static' : { + sendRPC : function(o) { + return new tinymce.util.JSONRequest().send(o); + } + } + }); +}()); +(function(tinymce){ + tinymce.VK = { + DELETE: 46, + BACKSPACE: 8, + ENTER: 13, + TAB: 9, + SPACEBAR: 32, + UP: 38, + DOWN: 40, + modifierPressed: function (e) { + return e.shiftKey || e.ctrlKey || e.altKey; + } + } +})(tinymce); + +(function(tinymce) { + var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE; + + function cleanupStylesWhenDeleting(ed) { + var dom = ed.dom, selection = ed.selection; + + ed.onKeyDown.add(function(ed, e) { + var rng, blockElm, node, clonedSpan, isDelete; + + isDelete = e.keyCode == DELETE; + if ((isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) { + e.preventDefault(); + rng = selection.getRng(); + + // Find root block + blockElm = dom.getParent(rng.startContainer, dom.isBlock); + + // On delete clone the root span of the next block element + if (isDelete) + blockElm = dom.getNext(blockElm, dom.isBlock); + + // Locate root span element and clone it since it would otherwise get merged by the "apple-style-span" on delete/backspace + if (blockElm) { + node = blockElm.firstChild; + + // Ignore empty text nodes + while (node && node.nodeType == 3 && node.nodeValue.length == 0) + node = node.nextSibling; + + if (node && node.nodeName === 'SPAN') { + clonedSpan = node.cloneNode(false); + } + } + + // Do the backspace/delete action + ed.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null); + + // Find all odd apple-style-spans + blockElm = dom.getParent(rng.startContainer, dom.isBlock); + tinymce.each(dom.select('span.Apple-style-span,font.Apple-style-span', blockElm), function(span) { + var bm = selection.getBookmark(); + + if (clonedSpan) { + dom.replace(clonedSpan.cloneNode(false), span, true); + } else { + dom.remove(span, true); + } + + // Restore the selection + selection.moveToBookmark(bm); + }); + } + }); + }; + + function emptyEditorWhenDeleting(ed) { + + function serializeRng(rng) { + var body = ed.dom.create("body"); + var contents = rng.cloneContents(); + body.appendChild(contents); + return ed.selection.serializer.serialize(body, {format: 'html'}); + } + + function allContentsSelected(rng) { + var selection = serializeRng(rng); + + var allRng = ed.dom.createRng(); + allRng.selectNode(ed.getBody()); + + var allSelection = serializeRng(allRng); + return selection === allSelection; + } + + ed.onKeyDown.addToTop(function(ed, e) { + var keyCode = e.keyCode; + if (keyCode == DELETE || keyCode == BACKSPACE) { + var rng = ed.selection.getRng(true); + if (!rng.collapsed && allContentsSelected(rng)) { + ed.setContent('', {format : 'raw'}); + ed.nodeChanged(); + e.preventDefault(); + } + } + }); + + }; + + function inputMethodFocus(ed) { + ed.dom.bind(ed.getDoc(), 'focusin', function() { + ed.selection.setRng(ed.selection.getRng()); + }); + }; + + function removeHrOnBackspace(ed) { + ed.onKeyDown.add(function(ed, e) { + if (e.keyCode === BACKSPACE) { + if (ed.selection.isCollapsed() && ed.selection.getRng(true).startOffset === 0) { + var node = ed.selection.getNode(); + var previousSibling = node.previousSibling; + if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "hr") { + ed.dom.remove(previousSibling); + tinymce.dom.Event.cancel(e); + } + } + } + }) + } + + function focusBody(ed) { + // Fix for a focus bug in FF 3.x where the body element + // wouldn't get proper focus if the user clicked on the HTML element + if (!Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4 + ed.onMouseDown.add(function(ed, e) { + if (e.target.nodeName === "HTML") { + var body = ed.getBody(); + + // Blur the body it's focused but not correctly focused + body.blur(); + + // Refocus the body after a little while + setTimeout(function() { + body.focus(); + }, 0); + } + }); + } + }; + + function selectControlElements(ed) { + ed.onClick.add(function(ed, e) { + e = e.target; + + // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250 + // WebKit can't even do simple things like selecting an image + // Needs tobe the setBaseAndExtend or it will fail to select floated images + if (/^(IMG|HR)$/.test(e.nodeName)) + ed.selection.getSel().setBaseAndExtent(e, 0, e, 1); + + if (e.nodeName == 'A' && ed.dom.hasClass(e, 'mceItemAnchor')) + ed.selection.select(e); + + ed.nodeChanged(); + }); + }; + + function removeStylesOnPTagsInheritedFromHeadingTag(ed) { + ed.onKeyDown.add(function(ed, event) { + function checkInHeadingTag(ed) { + var currentNode = ed.selection.getNode(); + var headingTags = 'h1,h2,h3,h4,h5,h6'; + return ed.dom.is(currentNode, headingTags) || ed.dom.getParent(currentNode, headingTags) !== null; + } + + if (event.keyCode === VK.ENTER && !VK.modifierPressed(event) && checkInHeadingTag(ed)) { + setTimeout(function() { + var currentNode = ed.selection.getNode(); + if (ed.dom.is(currentNode, 'p')) { + ed.dom.setAttrib(currentNode, 'style', null); + // While tiny's content is correct after this method call, the content shown is not representative of it and needs to be 'repainted' + ed.execCommand('mceCleanup'); + } + }, 0); + } + }); + } + function selectionChangeNodeChanged(ed) { + var lastRng, selectionTimer; + + ed.dom.bind(ed.getDoc(), 'selectionchange', function() { + if (selectionTimer) { + clearTimeout(selectionTimer); + selectionTimer = 0; + } + + selectionTimer = window.setTimeout(function() { + var rng = ed.selection.getRng(); + + // Compare the ranges to see if it was a real change or not + if (!lastRng || !tinymce.dom.RangeUtils.compareRanges(rng, lastRng)) { + ed.nodeChanged(); + lastRng = rng; + } + }, 50); + }); + } + + function ensureBodyHasRoleApplication(ed) { + document.body.setAttribute("role", "application"); + } + + tinymce.create('tinymce.util.Quirks', { + Quirks: function(ed) { + // WebKit + if (tinymce.isWebKit) { + cleanupStylesWhenDeleting(ed); + emptyEditorWhenDeleting(ed); + inputMethodFocus(ed); + selectControlElements(ed); + + // iOS + if (tinymce.isIDevice) { + selectionChangeNodeChanged(ed); + } + } + + // IE + if (tinymce.isIE) { + removeHrOnBackspace(ed); + emptyEditorWhenDeleting(ed); + ensureBodyHasRoleApplication(ed); + removeStylesOnPTagsInheritedFromHeadingTag(ed) + } + + // Gecko + if (tinymce.isGecko) { + removeHrOnBackspace(ed); + focusBody(ed); + } + } + }); +})(tinymce); + +(function(tinymce) { + var namedEntities, baseEntities, reverseEntities, + attrsCharsRegExp = /[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, + textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, + rawCharsRegExp = /[<>&\"\']/g, + entityRegExp = /&(#x|#)?([\w]+);/g, + asciiMap = { + 128 : "\u20AC", 130 : "\u201A", 131 : "\u0192", 132 : "\u201E", 133 : "\u2026", 134 : "\u2020", + 135 : "\u2021", 136 : "\u02C6", 137 : "\u2030", 138 : "\u0160", 139 : "\u2039", 140 : "\u0152", + 142 : "\u017D", 145 : "\u2018", 146 : "\u2019", 147 : "\u201C", 148 : "\u201D", 149 : "\u2022", + 150 : "\u2013", 151 : "\u2014", 152 : "\u02DC", 153 : "\u2122", 154 : "\u0161", 155 : "\u203A", + 156 : "\u0153", 158 : "\u017E", 159 : "\u0178" + }; + + // Raw entities + baseEntities = { + '\"' : '"', // Needs to be escaped since the YUI compressor would otherwise break the code + "'" : ''', + '<' : '<', + '>' : '>', + '&' : '&' + }; + + // Reverse lookup table for raw entities + reverseEntities = { + '<' : '<', + '>' : '>', + '&' : '&', + '"' : '"', + ''' : "'" + }; + + // Decodes text by using the browser + function nativeDecode(text) { + var elm; + + elm = document.createElement("div"); + elm.innerHTML = text; + + return elm.textContent || elm.innerText || text; + }; + + // Build a two way lookup table for the entities + function buildEntitiesLookup(items, radix) { + var i, chr, entity, lookup = {}; + + if (items) { + items = items.split(','); + radix = radix || 10; + + // Build entities lookup table + for (i = 0; i < items.length; i += 2) { + chr = String.fromCharCode(parseInt(items[i], radix)); + + // Only add non base entities + if (!baseEntities[chr]) { + entity = '&' + items[i + 1] + ';'; + lookup[chr] = entity; + lookup[entity] = chr; + } + } + + return lookup; + } + }; + + // Unpack entities lookup where the numbers are in radix 32 to reduce the size + namedEntities = buildEntitiesLookup( + '50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' + + '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' + + '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' + + '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' + + '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' + + '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' + + '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' + + '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' + + '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' + + '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' + + 'sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' + + 'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' + + 't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' + + 'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' + + 'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' + + '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' + + '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' + + '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' + + '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' + + '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' + + 'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' + + 'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' + + 'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' + + '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' + + '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro' + , 32); + + tinymce.html = tinymce.html || {}; + + tinymce.html.Entities = { + encodeRaw : function(text, attr) { + return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { + return baseEntities[chr] || chr; + }); + }, + + encodeAllRaw : function(text) { + return ('' + text).replace(rawCharsRegExp, function(chr) { + return baseEntities[chr] || chr; + }); + }, + + encodeNumeric : function(text, attr) { + return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { + // Multi byte sequence convert it to a single entity + if (chr.length > 1) + return '&#' + (((chr.charCodeAt(0) - 0xD800) * 0x400) + (chr.charCodeAt(1) - 0xDC00) + 0x10000) + ';'; + + return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';'; + }); + }, + + encodeNamed : function(text, attr, entities) { + entities = entities || namedEntities; + + return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { + return baseEntities[chr] || entities[chr] || chr; + }); + }, + + getEncodeFunc : function(name, entities) { + var Entities = tinymce.html.Entities; + + entities = buildEntitiesLookup(entities) || namedEntities; + + function encodeNamedAndNumeric(text, attr) { + return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { + return baseEntities[chr] || entities[chr] || '&#' + chr.charCodeAt(0) + ';' || chr; + }); + }; + + function encodeCustomNamed(text, attr) { + return Entities.encodeNamed(text, attr, entities); + }; + + // Replace + with , to be compatible with previous TinyMCE versions + name = tinymce.makeMap(name.replace(/\+/g, ',')); + + // Named and numeric encoder + if (name.named && name.numeric) + return encodeNamedAndNumeric; + + // Named encoder + if (name.named) { + // Custom names + if (entities) + return encodeCustomNamed; + + return Entities.encodeNamed; + } + + // Numeric + if (name.numeric) + return Entities.encodeNumeric; + + // Raw encoder + return Entities.encodeRaw; + }, + + decode : function(text) { + return text.replace(entityRegExp, function(all, numeric, value) { + if (numeric) { + value = parseInt(value, numeric.length === 2 ? 16 : 10); + + // Support upper UTF + if (value > 0xFFFF) { + value -= 0x10000; + + return String.fromCharCode(0xD800 + (value >> 10), 0xDC00 + (value & 0x3FF)); + } else + return asciiMap[value] || String.fromCharCode(value); + } + + return reverseEntities[all] || namedEntities[all] || nativeDecode(all); + }); + } + }; +})(tinymce); + +tinymce.html.Styles = function(settings, schema) { + var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi, + urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi, + styleRegExp = /\s*([^:]+):\s*([^;]+);?/g, + trimRightRegExp = /\s+$/, + urlColorRegExp = /rgb/, + undef, i, encodingLookup = {}, encodingItems; + + settings = settings || {}; + + encodingItems = '\\" \\\' \\; \\: ; : \uFEFF'.split(' '); + for (i = 0; i < encodingItems.length; i++) { + encodingLookup[encodingItems[i]] = '\uFEFF' + i; + encodingLookup['\uFEFF' + i] = encodingItems[i]; + } + + function toHex(match, r, g, b) { + function hex(val) { + val = parseInt(val).toString(16); + + return val.length > 1 ? val : '0' + val; // 0 -> 00 + }; + + return '#' + hex(r) + hex(g) + hex(b); + }; + + return { + toHex : function(color) { + return color.replace(rgbRegExp, toHex); + }, + + parse : function(css) { + var styles = {}, matches, name, value, isEncoded, urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope || this; + + function compress(prefix, suffix) { + var top, right, bottom, left; + + // Get values and check it it needs compressing + top = styles[prefix + '-top' + suffix]; + if (!top) + return; + + right = styles[prefix + '-right' + suffix]; + if (top != right) + return; + + bottom = styles[prefix + '-bottom' + suffix]; + if (right != bottom) + return; + + left = styles[prefix + '-left' + suffix]; + if (bottom != left) + return; + + // Compress + styles[prefix + suffix] = left; + delete styles[prefix + '-top' + suffix]; + delete styles[prefix + '-right' + suffix]; + delete styles[prefix + '-bottom' + suffix]; + delete styles[prefix + '-left' + suffix]; + }; + + function canCompress(key) { + var value = styles[key], i; + + if (!value || value.indexOf(' ') < 0) + return; + + value = value.split(' '); + i = value.length; + while (i--) { + if (value[i] !== value[0]) + return false; + } + + styles[key] = value[0]; + + return true; + }; + + function compress2(target, a, b, c) { + if (!canCompress(a)) + return; + + if (!canCompress(b)) + return; + + if (!canCompress(c)) + return; + + // Compress + styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c]; + delete styles[a]; + delete styles[b]; + delete styles[c]; + }; + + // Encodes the specified string by replacing all \" \' ; : with _ + function encode(str) { + isEncoded = true; + + return encodingLookup[str]; + }; + + // Decodes the specified string by replacing all _ with it's original value \" \' etc + // It will also decode the \" \' if keep_slashes is set to fale or omitted + function decode(str, keep_slashes) { + if (isEncoded) { + str = str.replace(/\uFEFF[0-9]/g, function(str) { + return encodingLookup[str]; + }); + } + + if (!keep_slashes) + str = str.replace(/\\([\'\";:])/g, "$1"); + + return str; + } + + if (css) { + // Encode \" \' % and ; and : inside strings so they don't interfere with the style parsing + css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function(str) { + return str.replace(/[;:]/g, encode); + }); + + // Parse styles + while (matches = styleRegExp.exec(css)) { + name = matches[1].replace(trimRightRegExp, '').toLowerCase(); + value = matches[2].replace(trimRightRegExp, ''); + + if (name && value.length > 0) { + // Opera will produce 700 instead of bold in their style values + if (name === 'font-weight' && value === '700') + value = 'bold'; + else if (name === 'color' || name === 'background-color') // Lowercase colors like RED + value = value.toLowerCase(); + + // Convert RGB colors to HEX + value = value.replace(rgbRegExp, toHex); + + // Convert URLs and force them into url('value') format + value = value.replace(urlOrStrRegExp, function(match, url, url2, url3, str, str2) { + str = str || str2; + + if (str) { + str = decode(str); + + // Force strings into single quote format + return "'" + str.replace(/\'/g, "\\'") + "'"; + } + + url = decode(url || url2 || url3); + + // Convert the URL to relative/absolute depending on config + if (urlConverter) + url = urlConverter.call(urlConverterScope, url, 'style'); + + // Output new URL format + return "url('" + url.replace(/\'/g, "\\'") + "')"; + }); + + styles[name] = isEncoded ? decode(value, true) : value; + } + + styleRegExp.lastIndex = matches.index + matches[0].length; + } + + // Compress the styles to reduce it's size for example IE will expand styles + compress("border", ""); + compress("border", "-width"); + compress("border", "-color"); + compress("border", "-style"); + compress("padding", ""); + compress("margin", ""); + compress2('border', 'border-width', 'border-style', 'border-color'); + + // Remove pointless border, IE produces these + if (styles.border === 'medium none') + delete styles.border; + } + + return styles; + }, + + serialize : function(styles, element_name) { + var css = '', name, value; + + function serializeStyles(name) { + var styleList, i, l, value; + + styleList = schema.styles[name]; + if (styleList) { + for (i = 0, l = styleList.length; i < l; i++) { + name = styleList[i]; + value = styles[name]; + + if (value !== undef && value.length > 0) + css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; + } + } + }; + + // Serialize styles according to schema + if (element_name && schema && schema.styles) { + // Serialize global styles and element specific styles + serializeStyles('*'); + serializeStyles(element_name); + } else { + // Output the styles in the order they are inside the object + for (name in styles) { + value = styles[name]; + + if (value !== undef && value.length > 0) + css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; + } + } + + return css; + } + }; +}; + +(function(tinymce) { + var transitional = {}, boolAttrMap, blockElementsMap, shortEndedElementsMap, nonEmptyElementsMap, customElementsMap = {}, + defaultWhiteSpaceElementsMap, selfClosingElementsMap, makeMap = tinymce.makeMap, each = tinymce.each; + + function split(str, delim) { + return str.split(delim || ','); + }; + + function unpack(lookup, data) { + var key, elements = {}; + + function replace(value) { + return value.replace(/[A-Z]+/g, function(key) { + return replace(lookup[key]); + }); + }; + + // Unpack lookup + for (key in lookup) { + if (lookup.hasOwnProperty(key)) + lookup[key] = replace(lookup[key]); + } + + // Unpack and parse data into object map + replace(data).replace(/#/g, '#text').replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g, function(str, name, attributes, children) { + attributes = split(attributes, '|'); + + elements[name] = { + attributes : makeMap(attributes), + attributesOrder : attributes, + children : makeMap(children, '|', {'#comment' : {}}) + } + }); + + return elements; + }; + + // Build a lookup table for block elements both lowercase and uppercase + blockElementsMap = 'h1,h2,h3,h4,h5,h6,hr,p,div,address,pre,form,table,tbody,thead,tfoot,' + + 'th,tr,td,li,ol,ul,caption,blockquote,center,dl,dt,dd,dir,fieldset,' + + 'noscript,menu,isindex,samp,header,footer,article,section,hgroup'; + blockElementsMap = makeMap(blockElementsMap, ',', makeMap(blockElementsMap.toUpperCase())); + + // This is the XHTML 1.0 transitional elements with it's attributes and children packed to reduce it's size + transitional = unpack({ + Z : 'H|K|N|O|P', + Y : 'X|form|R|Q', + ZG : 'E|span|width|align|char|charoff|valign', + X : 'p|T|div|U|W|isindex|fieldset|table', + ZF : 'E|align|char|charoff|valign', + W : 'pre|hr|blockquote|address|center|noframes', + ZE : 'abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height', + ZD : '[E][S]', + U : 'ul|ol|dl|menu|dir', + ZC : 'p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q', + T : 'h1|h2|h3|h4|h5|h6', + ZB : 'X|S|Q', + S : 'R|P', + ZA : 'a|G|J|M|O|P', + R : 'a|H|K|N|O', + Q : 'noscript|P', + P : 'ins|del|script', + O : 'input|select|textarea|label|button', + N : 'M|L', + M : 'em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym', + L : 'sub|sup', + K : 'J|I', + J : 'tt|i|b|u|s|strike', + I : 'big|small|font|basefont', + H : 'G|F', + G : 'br|span|bdo', + F : 'object|applet|img|map|iframe', + E : 'A|B|C', + D : 'accesskey|tabindex|onfocus|onblur', + C : 'onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup', + B : 'lang|xml:lang|dir', + A : 'id|class|style|title' + }, 'script[id|charset|type|language|src|defer|xml:space][]' + + 'style[B|id|type|media|title|xml:space][]' + + 'object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]' + + 'param[id|name|value|valuetype|type][]' + + 'p[E|align][#|S]' + + 'a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]' + + 'br[A|clear][]' + + 'span[E][#|S]' + + 'bdo[A|C|B][#|S]' + + 'applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]' + + 'h1[E|align][#|S]' + + 'img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]' + + 'map[B|C|A|name][X|form|Q|area]' + + 'h2[E|align][#|S]' + + 'iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]' + + 'h3[E|align][#|S]' + + 'tt[E][#|S]' + + 'i[E][#|S]' + + 'b[E][#|S]' + + 'u[E][#|S]' + + 's[E][#|S]' + + 'strike[E][#|S]' + + 'big[E][#|S]' + + 'small[E][#|S]' + + 'font[A|B|size|color|face][#|S]' + + 'basefont[id|size|color|face][]' + + 'em[E][#|S]' + + 'strong[E][#|S]' + + 'dfn[E][#|S]' + + 'code[E][#|S]' + + 'q[E|cite][#|S]' + + 'samp[E][#|S]' + + 'kbd[E][#|S]' + + 'var[E][#|S]' + + 'cite[E][#|S]' + + 'abbr[E][#|S]' + + 'acronym[E][#|S]' + + 'sub[E][#|S]' + + 'sup[E][#|S]' + + 'input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]' + + 'select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]' + + 'optgroup[E|disabled|label][option]' + + 'option[E|selected|disabled|label|value][]' + + 'textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]' + + 'label[E|for|accesskey|onfocus|onblur][#|S]' + + 'button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]' + + 'h4[E|align][#|S]' + + 'ins[E|cite|datetime][#|Y]' + + 'h5[E|align][#|S]' + + 'del[E|cite|datetime][#|Y]' + + 'h6[E|align][#|S]' + + 'div[E|align][#|Y]' + + 'ul[E|type|compact][li]' + + 'li[E|type|value][#|Y]' + + 'ol[E|type|compact|start][li]' + + 'dl[E|compact][dt|dd]' + + 'dt[E][#|S]' + + 'dd[E][#|Y]' + + 'menu[E|compact][li]' + + 'dir[E|compact][li]' + + 'pre[E|width|xml:space][#|ZA]' + + 'hr[E|align|noshade|size|width][]' + + 'blockquote[E|cite][#|Y]' + + 'address[E][#|S|p]' + + 'center[E][#|Y]' + + 'noframes[E][#|Y]' + + 'isindex[A|B|prompt][]' + + 'fieldset[E][#|legend|Y]' + + 'legend[E|accesskey|align][#|S]' + + 'table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]' + + 'caption[E|align][#|S]' + + 'col[ZG][]' + + 'colgroup[ZG][col]' + + 'thead[ZF][tr]' + + 'tr[ZF|bgcolor][th|td]' + + 'th[E|ZE][#|Y]' + + 'form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]' + + 'noscript[E][#|Y]' + + 'td[E|ZE][#|Y]' + + 'tfoot[ZF][tr]' + + 'tbody[ZF][tr]' + + 'area[E|D|shape|coords|href|nohref|alt|target][]' + + 'base[id|href|target][]' + + 'body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]' + ); + + boolAttrMap = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected,autoplay,loop,controls'); + shortEndedElementsMap = makeMap('area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,source'); + nonEmptyElementsMap = tinymce.extend(makeMap('td,th,iframe,video,audio,object'), shortEndedElementsMap); + defaultWhiteSpaceElementsMap = makeMap('pre,script,style,textarea'); + selfClosingElementsMap = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'); + + tinymce.html.Schema = function(settings) { + var self = this, elements = {}, children = {}, patternElements = [], validStyles, whiteSpaceElementsMap; + + settings = settings || {}; + + // Allow all elements and attributes if verify_html is set to false + if (settings.verify_html === false) + settings.valid_elements = '*[*]'; + + // Build styles list + if (settings.valid_styles) { + validStyles = {}; + + // Convert styles into a rule list + each(settings.valid_styles, function(value, key) { + validStyles[key] = tinymce.explode(value); + }); + } + + whiteSpaceElementsMap = settings.whitespace_elements ? makeMap(settings.whitespace_elements) : defaultWhiteSpaceElementsMap; + + // Converts a wildcard expression string to a regexp for example *a will become /.*a/. + function patternToRegExp(str) { + return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$'); + }; + + // Parses the specified valid_elements string and adds to the current rules + // This function is a bit hard to read since it's heavily optimized for speed + function addValidElements(valid_elements) { + var ei, el, ai, al, yl, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder, + prefix, outputName, globalAttributes, globalAttributesOrder, transElement, key, childKey, value, + elementRuleRegExp = /^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/, + attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/, + hasPatternsRegExp = /[*?+]/; + + if (valid_elements) { + // Split valid elements into an array with rules + valid_elements = split(valid_elements); + + if (elements['@']) { + globalAttributes = elements['@'].attributes; + globalAttributesOrder = elements['@'].attributesOrder; + } + + // Loop all rules + for (ei = 0, el = valid_elements.length; ei < el; ei++) { + // Parse element rule + matches = elementRuleRegExp.exec(valid_elements[ei]); + if (matches) { + // Setup local names for matches + prefix = matches[1]; + elementName = matches[2]; + outputName = matches[3]; + attrData = matches[4]; + + // Create new attributes and attributesOrder + attributes = {}; + attributesOrder = []; + + // Create the new element + element = { + attributes : attributes, + attributesOrder : attributesOrder + }; + + // Padd empty elements prefix + if (prefix === '#') + element.paddEmpty = true; + + // Remove empty elements prefix + if (prefix === '-') + element.removeEmpty = true; + + // Copy attributes from global rule into current rule + if (globalAttributes) { + for (key in globalAttributes) + attributes[key] = globalAttributes[key]; + + attributesOrder.push.apply(attributesOrder, globalAttributesOrder); + } + + // Attributes defined + if (attrData) { + attrData = split(attrData, '|'); + for (ai = 0, al = attrData.length; ai < al; ai++) { + matches = attrRuleRegExp.exec(attrData[ai]); + if (matches) { + attr = {}; + attrType = matches[1]; + attrName = matches[2].replace(/::/g, ':'); + prefix = matches[3]; + value = matches[4]; + + // Required + if (attrType === '!') { + element.attributesRequired = element.attributesRequired || []; + element.attributesRequired.push(attrName); + attr.required = true; + } + + // Denied from global + if (attrType === '-') { + delete attributes[attrName]; + attributesOrder.splice(tinymce.inArray(attributesOrder, attrName), 1); + continue; + } + + // Default value + if (prefix) { + // Default value + if (prefix === '=') { + element.attributesDefault = element.attributesDefault || []; + element.attributesDefault.push({name: attrName, value: value}); + attr.defaultValue = value; + } + + // Forced value + if (prefix === ':') { + element.attributesForced = element.attributesForced || []; + element.attributesForced.push({name: attrName, value: value}); + attr.forcedValue = value; + } + + // Required values + if (prefix === '<') + attr.validValues = makeMap(value, '?'); + } + + // Check for attribute patterns + if (hasPatternsRegExp.test(attrName)) { + element.attributePatterns = element.attributePatterns || []; + attr.pattern = patternToRegExp(attrName); + element.attributePatterns.push(attr); + } else { + // Add attribute to order list if it doesn't already exist + if (!attributes[attrName]) + attributesOrder.push(attrName); + + attributes[attrName] = attr; + } + } + } + } + + // Global rule, store away these for later usage + if (!globalAttributes && elementName == '@') { + globalAttributes = attributes; + globalAttributesOrder = attributesOrder; + } + + // Handle substitute elements such as b/strong + if (outputName) { + element.outputName = elementName; + elements[outputName] = element; + } + + // Add pattern or exact element + if (hasPatternsRegExp.test(elementName)) { + element.pattern = patternToRegExp(elementName); + patternElements.push(element); + } else + elements[elementName] = element; + } + } + } + }; + + function setValidElements(valid_elements) { + elements = {}; + patternElements = []; + + addValidElements(valid_elements); + + each(transitional, function(element, name) { + children[name] = element.children; + }); + }; + + // Adds custom non HTML elements to the schema + function addCustomElements(custom_elements) { + var customElementRegExp = /^(~)?(.+)$/; + + if (custom_elements) { + each(split(custom_elements), function(rule) { + var matches = customElementRegExp.exec(rule), + inline = matches[1] === '~', + cloneName = inline ? 'span' : 'div', + name = matches[2]; + + children[name] = children[cloneName]; + customElementsMap[name] = cloneName; + + // If it's not marked as inline then add it to valid block elements + if (!inline) + blockElementsMap[name] = {}; + + // Add custom elements at span/div positions + each(children, function(element, child) { + if (element[cloneName]) + element[name] = element[cloneName]; + }); + }); + } + }; + + // Adds valid children to the schema object + function addValidChildren(valid_children) { + var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/; + + if (valid_children) { + each(split(valid_children), function(rule) { + var matches = childRuleRegExp.exec(rule), parent, prefix; + + if (matches) { + prefix = matches[1]; + + // Add/remove items from default + if (prefix) + parent = children[matches[2]]; + else + parent = children[matches[2]] = {'#comment' : {}}; + + parent = children[matches[2]]; + + each(split(matches[3], '|'), function(child) { + if (prefix === '-') + delete parent[child]; + else + parent[child] = {}; + }); + } + }); + } + }; + + function getElementRule(name) { + var element = elements[name], i; + + // Exact match found + if (element) + return element; + + // No exact match then try the patterns + i = patternElements.length; + while (i--) { + element = patternElements[i]; + + if (element.pattern.test(name)) + return element; + } + }; + + if (!settings.valid_elements) { + // No valid elements defined then clone the elements from the transitional spec + each(transitional, function(element, name) { + elements[name] = { + attributes : element.attributes, + attributesOrder : element.attributesOrder + }; + + children[name] = element.children; + }); + + // Switch these + each(split('strong/b,em/i'), function(item) { + item = split(item, '/'); + elements[item[1]].outputName = item[0]; + }); + + // Add default alt attribute for images + elements.img.attributesDefault = [{name: 'alt', value: ''}]; + + // Remove these if they are empty by default + each(split('ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr'), function(name) { + elements[name].removeEmpty = true; + }); + + // Padd these by default + each(split('p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption'), function(name) { + elements[name].paddEmpty = true; + }); + } else + setValidElements(settings.valid_elements); + + addCustomElements(settings.custom_elements); + addValidChildren(settings.valid_children); + addValidElements(settings.extended_valid_elements); + + // Todo: Remove this when we fix list handling to be valid + addValidChildren('+ol[ul|ol],+ul[ul|ol]'); + + // If the user didn't allow span only allow internal spans + if (!getElementRule('span')) + addValidElements('span[!data-mce-type|*]'); + + // Delete invalid elements + if (settings.invalid_elements) { + tinymce.each(tinymce.explode(settings.invalid_elements), function(item) { + if (elements[item]) + delete elements[item]; + }); + } + + self.children = children; + + self.styles = validStyles; + + self.getBoolAttrs = function() { + return boolAttrMap; + }; + + self.getBlockElements = function() { + return blockElementsMap; + }; + + self.getShortEndedElements = function() { + return shortEndedElementsMap; + }; + + self.getSelfClosingElements = function() { + return selfClosingElementsMap; + }; + + self.getNonEmptyElements = function() { + return nonEmptyElementsMap; + }; + + self.getWhiteSpaceElements = function() { + return whiteSpaceElementsMap; + }; + + self.isValidChild = function(name, child) { + var parent = children[name]; + + return !!(parent && parent[child]); + }; + + self.getElementRule = getElementRule; + + self.getCustomElements = function() { + return customElementsMap; + }; + + self.addValidElements = addValidElements; + + self.setValidElements = setValidElements; + + self.addCustomElements = addCustomElements; + + self.addValidChildren = addValidChildren; + }; + + // Expose boolMap and blockElementMap as static properties for usage in DOMUtils + tinymce.html.Schema.boolAttrMap = boolAttrMap; + tinymce.html.Schema.blockElementsMap = blockElementsMap; +})(tinymce); + +(function(tinymce) { + tinymce.html.SaxParser = function(settings, schema) { + var self = this, noop = function() {}; + + settings = settings || {}; + self.schema = schema = schema || new tinymce.html.Schema(); + + if (settings.fix_self_closing !== false) + settings.fix_self_closing = true; + + // Add handler functions from settings and setup default handlers + tinymce.each('comment cdata text start end pi doctype'.split(' '), function(name) { + if (name) + self[name] = settings[name] || noop; + }); + + self.parse = function(html) { + var self = this, matches, index = 0, value, endRegExp, stack = [], attrList, i, text, name, isInternalElement, removeInternalElements, + shortEndedElements, fillAttrsMap, isShortEnded, validate, elementRule, isValidElement, attr, attribsValue, invalidPrefixRegExp, + validAttributesMap, validAttributePatterns, attributesRequired, attributesDefault, attributesForced, selfClosing, + tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0, decode = tinymce.html.Entities.decode, fixSelfClosing, isIE; + + function processEndTag(name) { + var pos, i; + + // Find position of parent of the same type + pos = stack.length; + while (pos--) { + if (stack[pos].name === name) + break; + } + + // Found parent + if (pos >= 0) { + // Close all the open elements + for (i = stack.length - 1; i >= pos; i--) { + name = stack[i]; + + if (name.valid) + self.end(name.name); + } + + // Remove the open elements from the stack + stack.length = pos; + } + }; + + // Precompile RegExps and map objects + tokenRegExp = new RegExp('<(?:' + + '(?:!--([\\w\\W]*?)-->)|' + // Comment + '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + // CDATA + '(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE + '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI + '(?:\\/([^>]+)>)|' + // End element + '(?:([^\\s\\/<>]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/)>)' + // Start element + ')', 'g'); + + attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g; + specialElements = { + 'script' : /<\/script[^>]*>/gi, + 'style' : /<\/style[^>]*>/gi, + 'noscript' : /<\/noscript[^>]*>/gi + }; + + // Setup lookup tables for empty elements and boolean attributes + shortEndedElements = schema.getShortEndedElements(); + selfClosing = schema.getSelfClosingElements(); + fillAttrsMap = schema.getBoolAttrs(); + validate = settings.validate; + removeInternalElements = settings.remove_internals; + fixSelfClosing = settings.fix_self_closing; + isIE = tinymce.isIE; + invalidPrefixRegExp = /^:/; + + while (matches = tokenRegExp.exec(html)) { + // Text + if (index < matches.index) + self.text(decode(html.substr(index, matches.index - index))); + + if (value = matches[6]) { // End element + value = value.toLowerCase(); + + // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements + if (isIE && invalidPrefixRegExp.test(value)) + value = value.substr(1); + + processEndTag(value); + } else if (value = matches[7]) { // Start element + value = value.toLowerCase(); + + // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements + if (isIE && invalidPrefixRegExp.test(value)) + value = value.substr(1); + + isShortEnded = value in shortEndedElements; + + // Is self closing tag for example an
  • after an open
  • + if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) + processEndTag(value); + + // Validate element + if (!validate || (elementRule = schema.getElementRule(value))) { + isValidElement = true; + + // Grab attributes map and patters when validation is enabled + if (validate) { + validAttributesMap = elementRule.attributes; + validAttributePatterns = elementRule.attributePatterns; + } + + // Parse attributes + if (attribsValue = matches[8]) { + isInternalElement = attribsValue.indexOf('data-mce-type') !== -1; // Check if the element is an internal element + + // If the element has internal attributes then remove it if we are told to do so + if (isInternalElement && removeInternalElements) + isValidElement = false; + + attrList = []; + attrList.map = {}; + + attribsValue.replace(attrRegExp, function(match, name, value, val2, val3) { + var attrRule, i; + + name = name.toLowerCase(); + value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute + + // Validate name and value + if (validate && !isInternalElement && name.indexOf('data-') !== 0) { + attrRule = validAttributesMap[name]; + + // Find rule by pattern matching + if (!attrRule && validAttributePatterns) { + i = validAttributePatterns.length; + while (i--) { + attrRule = validAttributePatterns[i]; + if (attrRule.pattern.test(name)) + break; + } + + // No rule matched + if (i === -1) + attrRule = null; + } + + // No attribute rule found + if (!attrRule) + return; + + // Validate value + if (attrRule.validValues && !(value in attrRule.validValues)) + return; + } + + // Add attribute to list and map + attrList.map[name] = value; + attrList.push({ + name: name, + value: value + }); + }); + } else { + attrList = []; + attrList.map = {}; + } + + // Process attributes if validation is enabled + if (validate && !isInternalElement) { + attributesRequired = elementRule.attributesRequired; + attributesDefault = elementRule.attributesDefault; + attributesForced = elementRule.attributesForced; + + // Handle forced attributes + if (attributesForced) { + i = attributesForced.length; + while (i--) { + attr = attributesForced[i]; + name = attr.name; + attrValue = attr.value; + + if (attrValue === '{$uid}') + attrValue = 'mce_' + idCount++; + + attrList.map[name] = attrValue; + attrList.push({name: name, value: attrValue}); + } + } + + // Handle default attributes + if (attributesDefault) { + i = attributesDefault.length; + while (i--) { + attr = attributesDefault[i]; + name = attr.name; + + if (!(name in attrList.map)) { + attrValue = attr.value; + + if (attrValue === '{$uid}') + attrValue = 'mce_' + idCount++; + + attrList.map[name] = attrValue; + attrList.push({name: name, value: attrValue}); + } + } + } + + // Handle required attributes + if (attributesRequired) { + i = attributesRequired.length; + while (i--) { + if (attributesRequired[i] in attrList.map) + break; + } + + // None of the required attributes where found + if (i === -1) + isValidElement = false; + } + + // Invalidate element if it's marked as bogus + if (attrList.map['data-mce-bogus']) + isValidElement = false; + } + + if (isValidElement) + self.start(value, attrList, isShortEnded); + } else + isValidElement = false; + + // Treat script, noscript and style a bit different since they may include code that looks like elements + if (endRegExp = specialElements[value]) { + endRegExp.lastIndex = index = matches.index + matches[0].length; + + if (matches = endRegExp.exec(html)) { + if (isValidElement) + text = html.substr(index, matches.index - index); + + index = matches.index + matches[0].length; + } else { + text = html.substr(index); + index = html.length; + } + + if (isValidElement && text.length > 0) + self.text(text, true); + + if (isValidElement) + self.end(value); + + tokenRegExp.lastIndex = index; + continue; + } + + // Push value on to stack + if (!isShortEnded) { + if (!attribsValue || attribsValue.indexOf('/') != attribsValue.length - 1) + stack.push({name: value, valid: isValidElement}); + else if (isValidElement) + self.end(value); + } + } else if (value = matches[1]) { // Comment + self.comment(value); + } else if (value = matches[2]) { // CDATA + self.cdata(value); + } else if (value = matches[3]) { // DOCTYPE + self.doctype(value); + } else if (value = matches[4]) { // PI + self.pi(value, matches[5]); + } + + index = matches.index + matches[0].length; + } + + // Text + if (index < html.length) + self.text(decode(html.substr(index))); + + // Close any open elements + for (i = stack.length - 1; i >= 0; i--) { + value = stack[i]; + + if (value.valid) + self.end(value.name); + } + }; + } +})(tinymce); + +(function(tinymce) { + var whiteSpaceRegExp = /^[ \t\r\n]*$/, typeLookup = { + '#text' : 3, + '#comment' : 8, + '#cdata' : 4, + '#pi' : 7, + '#doctype' : 10, + '#document-fragment' : 11 + }; + + // Walks the tree left/right + function walk(node, root_node, prev) { + var sibling, parent, startName = prev ? 'lastChild' : 'firstChild', siblingName = prev ? 'prev' : 'next'; + + // Walk into nodes if it has a start + if (node[startName]) + return node[startName]; + + // Return the sibling if it has one + if (node !== root_node) { + sibling = node[siblingName]; + + if (sibling) + return sibling; + + // Walk up the parents to look for siblings + for (parent = node.parent; parent && parent !== root_node; parent = parent.parent) { + sibling = parent[siblingName]; + + if (sibling) + return sibling; + } + } + }; + + function Node(name, type) { + this.name = name; + this.type = type; + + if (type === 1) { + this.attributes = []; + this.attributes.map = {}; + } + } + + tinymce.extend(Node.prototype, { + replace : function(node) { + var self = this; + + if (node.parent) + node.remove(); + + self.insert(node, self); + self.remove(); + + return self; + }, + + attr : function(name, value) { + var self = this, attrs, i, undef; + + if (typeof name !== "string") { + for (i in name) + self.attr(i, name[i]); + + return self; + } + + if (attrs = self.attributes) { + if (value !== undef) { + // Remove attribute + if (value === null) { + if (name in attrs.map) { + delete attrs.map[name]; + + i = attrs.length; + while (i--) { + if (attrs[i].name === name) { + attrs = attrs.splice(i, 1); + return self; + } + } + } + + return self; + } + + // Set attribute + if (name in attrs.map) { + // Set attribute + i = attrs.length; + while (i--) { + if (attrs[i].name === name) { + attrs[i].value = value; + break; + } + } + } else + attrs.push({name: name, value: value}); + + attrs.map[name] = value; + + return self; + } else { + return attrs.map[name]; + } + } + }, + + clone : function() { + var self = this, clone = new Node(self.name, self.type), i, l, selfAttrs, selfAttr, cloneAttrs; + + // Clone element attributes + if (selfAttrs = self.attributes) { + cloneAttrs = []; + cloneAttrs.map = {}; + + for (i = 0, l = selfAttrs.length; i < l; i++) { + selfAttr = selfAttrs[i]; + + // Clone everything except id + if (selfAttr.name !== 'id') { + cloneAttrs[cloneAttrs.length] = {name: selfAttr.name, value: selfAttr.value}; + cloneAttrs.map[selfAttr.name] = selfAttr.value; + } + } + + clone.attributes = cloneAttrs; + } + + clone.value = self.value; + clone.shortEnded = self.shortEnded; + + return clone; + }, + + wrap : function(wrapper) { + var self = this; + + self.parent.insert(wrapper, self); + wrapper.append(self); + + return self; + }, + + unwrap : function() { + var self = this, node, next; + + for (node = self.firstChild; node; ) { + next = node.next; + self.insert(node, self, true); + node = next; + } + + self.remove(); + }, + + remove : function() { + var self = this, parent = self.parent, next = self.next, prev = self.prev; + + if (parent) { + if (parent.firstChild === self) { + parent.firstChild = next; + + if (next) + next.prev = null; + } else { + prev.next = next; + } + + if (parent.lastChild === self) { + parent.lastChild = prev; + + if (prev) + prev.next = null; + } else { + next.prev = prev; + } + + self.parent = self.next = self.prev = null; + } + + return self; + }, + + append : function(node) { + var self = this, last; + + if (node.parent) + node.remove(); + + last = self.lastChild; + if (last) { + last.next = node; + node.prev = last; + self.lastChild = node; + } else + self.lastChild = self.firstChild = node; + + node.parent = self; + + return node; + }, + + insert : function(node, ref_node, before) { + var parent; + + if (node.parent) + node.remove(); + + parent = ref_node.parent || this; + + if (before) { + if (ref_node === parent.firstChild) + parent.firstChild = node; + else + ref_node.prev.next = node; + + node.prev = ref_node.prev; + node.next = ref_node; + ref_node.prev = node; + } else { + if (ref_node === parent.lastChild) + parent.lastChild = node; + else + ref_node.next.prev = node; + + node.next = ref_node.next; + node.prev = ref_node; + ref_node.next = node; + } + + node.parent = parent; + + return node; + }, + + getAll : function(name) { + var self = this, node, collection = []; + + for (node = self.firstChild; node; node = walk(node, self)) { + if (node.name === name) + collection.push(node); + } + + return collection; + }, + + empty : function() { + var self = this, nodes, i, node; + + // Remove all children + if (self.firstChild) { + nodes = []; + + // Collect the children + for (node = self.firstChild; node; node = walk(node, self)) + nodes.push(node); + + // Remove the children + i = nodes.length; + while (i--) { + node = nodes[i]; + node.parent = node.firstChild = node.lastChild = node.next = node.prev = null; + } + } + + self.firstChild = self.lastChild = null; + + return self; + }, + + isEmpty : function(elements) { + var self = this, node = self.firstChild, i, name; + + if (node) { + do { + if (node.type === 1) { + // Ignore bogus elements + if (node.attributes.map['data-mce-bogus']) + continue; + + // Keep empty elements like + if (elements[node.name]) + return false; + + // Keep elements with data attributes or name attribute like + i = node.attributes.length; + while (i--) { + name = node.attributes[i].name; + if (name === "name" || name.indexOf('data-') === 0) + return false; + } + } + + // Keep comments + if (node.type === 8) + return false; + + // Keep non whitespace text nodes + if ((node.type === 3 && !whiteSpaceRegExp.test(node.value))) + return false; + } while (node = walk(node, self)); + } + + return true; + }, + + walk : function(prev) { + return walk(this, null, prev); + } + }); + + tinymce.extend(Node, { + create : function(name, attrs) { + var node, attrName; + + // Create node + node = new Node(name, typeLookup[name] || 1); + + // Add attributes if needed + if (attrs) { + for (attrName in attrs) + node.attr(attrName, attrs[attrName]); + } + + return node; + } + }); + + tinymce.html.Node = Node; +})(tinymce); + +(function(tinymce) { + var Node = tinymce.html.Node; + + tinymce.html.DomParser = function(settings, schema) { + var self = this, nodeFilters = {}, attributeFilters = [], matchedNodes = {}, matchedAttributes = {}; + + settings = settings || {}; + settings.validate = "validate" in settings ? settings.validate : true; + settings.root_name = settings.root_name || 'body'; + self.schema = schema = schema || new tinymce.html.Schema(); + + function fixInvalidChildren(nodes) { + var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i, + childClone, nonEmptyElements, nonSplitableElements, sibling, nextNode; + + nonSplitableElements = tinymce.makeMap('tr,td,th,tbody,thead,tfoot,table'); + nonEmptyElements = schema.getNonEmptyElements(); + + for (ni = 0; ni < nodes.length; ni++) { + node = nodes[ni]; + + // Already removed + if (!node.parent) + continue; + + // Get list of all parent nodes until we find a valid parent to stick the child into + parents = [node]; + for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && !nonSplitableElements[parent.name]; parent = parent.parent) + parents.push(parent); + + // Found a suitable parent + if (parent && parents.length > 1) { + // Reverse the array since it makes looping easier + parents.reverse(); + + // Clone the related parent and insert that after the moved node + newParent = currentNode = self.filterNode(parents[0].clone()); + + // Start cloning and moving children on the left side of the target node + for (i = 0; i < parents.length - 1; i++) { + if (schema.isValidChild(currentNode.name, parents[i].name)) { + tempNode = self.filterNode(parents[i].clone()); + currentNode.append(tempNode); + } else + tempNode = currentNode; + + for (childNode = parents[i].firstChild; childNode && childNode != parents[i + 1]; ) { + nextNode = childNode.next; + tempNode.append(childNode); + childNode = nextNode; + } + + currentNode = tempNode; + } + + if (!newParent.isEmpty(nonEmptyElements)) { + parent.insert(newParent, parents[0], true); + parent.insert(node, newParent); + } else { + parent.insert(node, parents[0], true); + } + + // Check if the element is empty by looking through it's contents and special treatment for


    + parent = parents[0]; + if (parent.isEmpty(nonEmptyElements) || parent.firstChild === parent.lastChild && parent.firstChild.name === 'br') { + parent.empty().remove(); + } + } else if (node.parent) { + // If it's an LI try to find a UL/OL for it or wrap it + if (node.name === 'li') { + sibling = node.prev; + if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { + sibling.append(node); + continue; + } + + sibling = node.next; + if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { + sibling.insert(node, sibling.firstChild, true); + continue; + } + + node.wrap(self.filterNode(new Node('ul', 1))); + continue; + } + + // Try wrapping the element in a DIV + if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) { + node.wrap(self.filterNode(new Node('div', 1))); + } else { + // We failed wrapping it, then remove or unwrap it + if (node.name === 'style' || node.name === 'script') + node.empty().remove(); + else + node.unwrap(); + } + } + } + }; + + self.filterNode = function(node) { + var i, name, list; + + // Run element filters + if (name in nodeFilters) { + list = matchedNodes[name]; + + if (list) + list.push(node); + else + matchedNodes[name] = [node]; + } + + // Run attribute filters + i = attributeFilters.length; + while (i--) { + name = attributeFilters[i].name; + + if (name in node.attributes.map) { + list = matchedAttributes[name]; + + if (list) + list.push(node); + else + matchedAttributes[name] = [node]; + } + } + + return node; + }; + + self.addNodeFilter = function(name, callback) { + tinymce.each(tinymce.explode(name), function(name) { + var list = nodeFilters[name]; + + if (!list) + nodeFilters[name] = list = []; + + list.push(callback); + }); + }; + + self.addAttributeFilter = function(name, callback) { + tinymce.each(tinymce.explode(name), function(name) { + var i; + + for (i = 0; i < attributeFilters.length; i++) { + if (attributeFilters[i].name === name) { + attributeFilters[i].callbacks.push(callback); + return; + } + } + + attributeFilters.push({name: name, callbacks: [callback]}); + }); + }; + + self.parse = function(html, args) { + var parser, rootNode, node, nodes, i, l, fi, fl, list, name, validate, + blockElements, startWhiteSpaceRegExp, invalidChildren = [], + endWhiteSpaceRegExp, allWhiteSpaceRegExp, whiteSpaceElements, children, nonEmptyElements, rootBlockName; + + args = args || {}; + matchedNodes = {}; + matchedAttributes = {}; + blockElements = tinymce.extend(tinymce.makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements()); + nonEmptyElements = schema.getNonEmptyElements(); + children = schema.children; + validate = settings.validate; + rootBlockName = "forced_root_block" in args ? args.forced_root_block : settings.forced_root_block; + + whiteSpaceElements = schema.getWhiteSpaceElements(); + startWhiteSpaceRegExp = /^[ \t\r\n]+/; + endWhiteSpaceRegExp = /[ \t\r\n]+$/; + allWhiteSpaceRegExp = /[ \t\r\n]+/g; + + function addRootBlocks() { + var node = rootNode.firstChild, next, rootBlockNode; + + while (node) { + next = node.next; + + if (node.type == 3 || (node.type == 1 && node.name !== 'p' && !blockElements[node.name] && !node.attr('data-mce-type'))) { + if (!rootBlockNode) { + // Create a new root block element + rootBlockNode = createNode(rootBlockName, 1); + rootNode.insert(rootBlockNode, node); + rootBlockNode.append(node); + } else + rootBlockNode.append(node); + } else { + rootBlockNode = null; + } + + node = next; + }; + }; + + function createNode(name, type) { + var node = new Node(name, type), list; + + if (name in nodeFilters) { + list = matchedNodes[name]; + + if (list) + list.push(node); + else + matchedNodes[name] = [node]; + } + + return node; + }; + + function removeWhitespaceBefore(node) { + var textNode, textVal, sibling; + + for (textNode = node.prev; textNode && textNode.type === 3; ) { + textVal = textNode.value.replace(endWhiteSpaceRegExp, ''); + + if (textVal.length > 0) { + textNode.value = textVal; + textNode = textNode.prev; + } else { + sibling = textNode.prev; + textNode.remove(); + textNode = sibling; + } + } + }; + + parser = new tinymce.html.SaxParser({ + validate : validate, + fix_self_closing : !validate, // Let the DOM parser handle
  • in
  • or

    in

    for better results + + cdata: function(text) { + node.append(createNode('#cdata', 4)).value = text; + }, + + text: function(text, raw) { + var textNode; + + // Trim all redundant whitespace on non white space elements + if (!whiteSpaceElements[node.name]) { + text = text.replace(allWhiteSpaceRegExp, ' '); + + if (node.lastChild && blockElements[node.lastChild.name]) + text = text.replace(startWhiteSpaceRegExp, ''); + } + + // Do we need to create the node + if (text.length !== 0) { + textNode = createNode('#text', 3); + textNode.raw = !!raw; + node.append(textNode).value = text; + } + }, + + comment: function(text) { + node.append(createNode('#comment', 8)).value = text; + }, + + pi: function(name, text) { + node.append(createNode(name, 7)).value = text; + removeWhitespaceBefore(node); + }, + + doctype: function(text) { + var newNode; + + newNode = node.append(createNode('#doctype', 10)); + newNode.value = text; + removeWhitespaceBefore(node); + }, + + start: function(name, attrs, empty) { + var newNode, attrFiltersLen, elementRule, textNode, attrName, text, sibling, parent; + + elementRule = validate ? schema.getElementRule(name) : {}; + if (elementRule) { + newNode = createNode(elementRule.outputName || name, 1); + newNode.attributes = attrs; + newNode.shortEnded = empty; + + node.append(newNode); + + // Check if node is valid child of the parent node is the child is + // unknown we don't collect it since it's probably a custom element + parent = children[node.name]; + if (parent && children[newNode.name] && !parent[newNode.name]) + invalidChildren.push(newNode); + + attrFiltersLen = attributeFilters.length; + while (attrFiltersLen--) { + attrName = attributeFilters[attrFiltersLen].name; + + if (attrName in attrs.map) { + list = matchedAttributes[attrName]; + + if (list) + list.push(newNode); + else + matchedAttributes[attrName] = [newNode]; + } + } + + // Trim whitespace before block + if (blockElements[name]) + removeWhitespaceBefore(newNode); + + // Change current node if the element wasn't empty i.e not
    or + if (!empty) + node = newNode; + } + }, + + end: function(name) { + var textNode, elementRule, text, sibling, tempNode; + + elementRule = validate ? schema.getElementRule(name) : {}; + if (elementRule) { + if (blockElements[name]) { + if (!whiteSpaceElements[node.name]) { + // Trim whitespace at beginning of block + for (textNode = node.firstChild; textNode && textNode.type === 3; ) { + text = textNode.value.replace(startWhiteSpaceRegExp, ''); + + if (text.length > 0) { + textNode.value = text; + textNode = textNode.next; + } else { + sibling = textNode.next; + textNode.remove(); + textNode = sibling; + } + } + + // Trim whitespace at end of block + for (textNode = node.lastChild; textNode && textNode.type === 3; ) { + text = textNode.value.replace(endWhiteSpaceRegExp, ''); + + if (text.length > 0) { + textNode.value = text; + textNode = textNode.prev; + } else { + sibling = textNode.prev; + textNode.remove(); + textNode = sibling; + } + } + } + + // Trim start white space + textNode = node.prev; + if (textNode && textNode.type === 3) { + text = textNode.value.replace(startWhiteSpaceRegExp, ''); + + if (text.length > 0) + textNode.value = text; + else + textNode.remove(); + } + } + + // Handle empty nodes + if (elementRule.removeEmpty || elementRule.paddEmpty) { + if (node.isEmpty(nonEmptyElements)) { + if (elementRule.paddEmpty) + node.empty().append(new Node('#text', '3')).value = '\u00a0'; + else { + // Leave nodes that have a name like + if (!node.attributes.map.name) { + tempNode = node.parent; + node.empty().remove(); + node = tempNode; + return; + } + } + } + } + + node = node.parent; + } + } + }, schema); + + rootNode = node = new Node(args.context || settings.root_name, 11); + + parser.parse(html); + + // Fix invalid children or report invalid children in a contextual parsing + if (validate && invalidChildren.length) { + if (!args.context) + fixInvalidChildren(invalidChildren); + else + args.invalid = true; + } + + // Wrap nodes in the root into block elements if the root is body + if (rootBlockName && rootNode.name == 'body') + addRootBlocks(); + + // Run filters only when the contents is valid + if (!args.invalid) { + // Run node filters + for (name in matchedNodes) { + list = nodeFilters[name]; + nodes = matchedNodes[name]; + + // Remove already removed children + fi = nodes.length; + while (fi--) { + if (!nodes[fi].parent) + nodes.splice(fi, 1); + } + + for (i = 0, l = list.length; i < l; i++) + list[i](nodes, name, args); + } + + // Run attribute filters + for (i = 0, l = attributeFilters.length; i < l; i++) { + list = attributeFilters[i]; + + if (list.name in matchedAttributes) { + nodes = matchedAttributes[list.name]; + + // Remove already removed children + fi = nodes.length; + while (fi--) { + if (!nodes[fi].parent) + nodes.splice(fi, 1); + } + + for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) + list.callbacks[fi](nodes, list.name, args); + } + } + } + + return rootNode; + }; + + // Remove
    at end of block elements Gecko and WebKit injects BR elements to + // make it possible to place the caret inside empty blocks. This logic tries to remove + // these elements and keep br elements that where intended to be there intact + if (settings.remove_trailing_brs) { + self.addNodeFilter('br', function(nodes, name) { + var i, l = nodes.length, node, blockElements = schema.getBlockElements(), + nonEmptyElements = schema.getNonEmptyElements(), parent, prev, prevName; + + // Remove brs from body element as well + blockElements.body = 1; + + // Must loop forwards since it will otherwise remove all brs in

    a


    + for (i = 0; i < l; i++) { + node = nodes[i]; + parent = node.parent; + + if (blockElements[node.parent.name] && node === parent.lastChild) { + // Loop all nodes to the right of the current node and check for other BR elements + // excluding bookmarks since they are invisible + prev = node.prev; + while (prev) { + prevName = prev.name; + + // Ignore bookmarks + if (prevName !== "span" || prev.attr('data-mce-type') !== 'bookmark') { + // Found a non BR element + if (prevName !== "br") + break; + + // Found another br it's a

    structure then don't remove anything + if (prevName === 'br') { + node = null; + break; + } + } + + prev = prev.prev; + } + + if (node) { + node.remove(); + + // Is the parent to be considered empty after we removed the BR + if (parent.isEmpty(nonEmptyElements)) { + elementRule = schema.getElementRule(parent.name); + + // Remove or padd the element depending on schema rule + if (elementRule) { + if (elementRule.removeEmpty) + parent.remove(); + else if (elementRule.paddEmpty) + parent.empty().append(new tinymce.html.Node('#text', 3)).value = '\u00a0'; + } + } + } + } + } + }); + } + } +})(tinymce); + +tinymce.html.Writer = function(settings) { + var html = [], indent, indentBefore, indentAfter, encode, htmlOutput; + + settings = settings || {}; + indent = settings.indent; + indentBefore = tinymce.makeMap(settings.indent_before || ''); + indentAfter = tinymce.makeMap(settings.indent_after || ''); + encode = tinymce.html.Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities); + htmlOutput = settings.element_format == "html"; + + return { + start: function(name, attrs, empty) { + var i, l, attr, value; + + if (indent && indentBefore[name] && html.length > 0) { + value = html[html.length - 1]; + + if (value.length > 0 && value !== '\n') + html.push('\n'); + } + + html.push('<', name); + + if (attrs) { + for (i = 0, l = attrs.length; i < l; i++) { + attr = attrs[i]; + html.push(' ', attr.name, '="', encode(attr.value, true), '"'); + } + } + + if (!empty || htmlOutput) + html[html.length] = '>'; + else + html[html.length] = ' />'; + + if (empty && indent && indentAfter[name] && html.length > 0) { + value = html[html.length - 1]; + + if (value.length > 0 && value !== '\n') + html.push('\n'); + } + }, + + end: function(name) { + var value; + + /*if (indent && indentBefore[name] && html.length > 0) { + value = html[html.length - 1]; + + if (value.length > 0 && value !== '\n') + html.push('\n'); + }*/ + + html.push(''); + + if (indent && indentAfter[name] && html.length > 0) { + value = html[html.length - 1]; + + if (value.length > 0 && value !== '\n') + html.push('\n'); + } + }, + + text: function(text, raw) { + if (text.length > 0) + html[html.length] = raw ? text : encode(text); + }, + + cdata: function(text) { + html.push(''); + }, + + comment: function(text) { + html.push(''); + }, + + pi: function(name, text) { + if (text) + html.push(''); + else + html.push(''); + + if (indent) + html.push('\n'); + }, + + doctype: function(text) { + html.push('', indent ? '\n' : ''); + }, + + reset: function() { + html.length = 0; + }, + + getContent: function() { + return html.join('').replace(/\n$/, ''); + } + }; +}; + +(function(tinymce) { + tinymce.html.Serializer = function(settings, schema) { + var self = this, writer = new tinymce.html.Writer(settings); + + settings = settings || {}; + settings.validate = "validate" in settings ? settings.validate : true; + + self.schema = schema = schema || new tinymce.html.Schema(); + self.writer = writer; + + self.serialize = function(node) { + var handlers, validate; + + validate = settings.validate; + + handlers = { + // #text + 3: function(node, raw) { + writer.text(node.value, node.raw); + }, + + // #comment + 8: function(node) { + writer.comment(node.value); + }, + + // Processing instruction + 7: function(node) { + writer.pi(node.name, node.value); + }, + + // Doctype + 10: function(node) { + writer.doctype(node.value); + }, + + // CDATA + 4: function(node) { + writer.cdata(node.value); + }, + + // Document fragment + 11: function(node) { + if ((node = node.firstChild)) { + do { + walk(node); + } while (node = node.next); + } + } + }; + + writer.reset(); + + function walk(node) { + var handler = handlers[node.type], name, isEmpty, attrs, attrName, attrValue, sortedAttrs, i, l, elementRule; + + if (!handler) { + name = node.name; + isEmpty = node.shortEnded; + attrs = node.attributes; + + // Sort attributes + if (validate && attrs && attrs.length > 1) { + sortedAttrs = []; + sortedAttrs.map = {}; + + elementRule = schema.getElementRule(node.name); + for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) { + attrName = elementRule.attributesOrder[i]; + + if (attrName in attrs.map) { + attrValue = attrs.map[attrName]; + sortedAttrs.map[attrName] = attrValue; + sortedAttrs.push({name: attrName, value: attrValue}); + } + } + + for (i = 0, l = attrs.length; i < l; i++) { + attrName = attrs[i].name; + + if (!(attrName in sortedAttrs.map)) { + attrValue = attrs.map[attrName]; + sortedAttrs.map[attrName] = attrValue; + sortedAttrs.push({name: attrName, value: attrValue}); + } + } + + attrs = sortedAttrs; + } + + writer.start(node.name, attrs, isEmpty); + + if (!isEmpty) { + if ((node = node.firstChild)) { + do { + walk(node); + } while (node = node.next); + } + + writer.end(name); + } + } else + handler(node); + } + + // Serialize element and treat all non elements as fragments + if (node.type == 1 && !settings.inner) + walk(node); + else + handlers[11](node); + + return writer.getContent(); + }; + } +})(tinymce); + +(function(tinymce) { + // Shorten names + var each = tinymce.each, + is = tinymce.is, + isWebKit = tinymce.isWebKit, + isIE = tinymce.isIE, + Entities = tinymce.html.Entities, + simpleSelectorRe = /^([a-z0-9],?)+$/i, + blockElementsMap = tinymce.html.Schema.blockElementsMap, + whiteSpaceRegExp = /^[ \t\r\n]*$/; + + tinymce.create('tinymce.dom.DOMUtils', { + doc : null, + root : null, + files : null, + pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/, + props : { + "for" : "htmlFor", + "class" : "className", + className : "className", + checked : "checked", + disabled : "disabled", + maxlength : "maxLength", + readonly : "readOnly", + selected : "selected", + value : "value", + id : "id", + name : "name", + type : "type" + }, + + DOMUtils : function(d, s) { + var t = this, globalStyle, name; + + t.doc = d; + t.win = window; + t.files = {}; + t.cssFlicker = false; + t.counter = 0; + t.stdMode = !tinymce.isIE || d.documentMode >= 8; + t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat" || t.stdMode; + t.hasOuterHTML = "outerHTML" in d.createElement("a"); + + t.settings = s = tinymce.extend({ + keep_values : false, + hex_colors : 1 + }, s); + + t.schema = s.schema; + t.styles = new tinymce.html.Styles({ + url_converter : s.url_converter, + url_converter_scope : s.url_converter_scope + }, s.schema); + + // Fix IE6SP2 flicker and check it failed for pre SP2 + if (tinymce.isIE6) { + try { + d.execCommand('BackgroundImageCache', false, true); + } catch (e) { + t.cssFlicker = true; + } + } + + if (isIE && s.schema) { + // Add missing HTML 4/5 elements to IE + ('abbr article aside audio canvas ' + + 'details figcaption figure footer ' + + 'header hgroup mark menu meter nav ' + + 'output progress section summary ' + + 'time video').replace(/\w+/g, function(name) { + d.createElement(name); + }); + + // Create all custom elements + for (name in s.schema.getCustomElements()) { + d.createElement(name); + } + } + + tinymce.addUnload(t.destroy, t); + }, + + getRoot : function() { + var t = this, s = t.settings; + + return (s && t.get(s.root_element)) || t.doc.body; + }, + + getViewPort : function(w) { + var d, b; + + w = !w ? this.win : w; + d = w.document; + b = this.boxModel ? d.documentElement : d.body; + + // Returns viewport size excluding scrollbars + return { + x : w.pageXOffset || b.scrollLeft, + y : w.pageYOffset || b.scrollTop, + w : w.innerWidth || b.clientWidth, + h : w.innerHeight || b.clientHeight + }; + }, + + getRect : function(e) { + var p, t = this, sr; + + e = t.get(e); + p = t.getPos(e); + sr = t.getSize(e); + + return { + x : p.x, + y : p.y, + w : sr.w, + h : sr.h + }; + }, + + getSize : function(e) { + var t = this, w, h; + + e = t.get(e); + w = t.getStyle(e, 'width'); + h = t.getStyle(e, 'height'); + + // Non pixel value, then force offset/clientWidth + if (w.indexOf('px') === -1) + w = 0; + + // Non pixel value, then force offset/clientWidth + if (h.indexOf('px') === -1) + h = 0; + + return { + w : parseInt(w) || e.offsetWidth || e.clientWidth, + h : parseInt(h) || e.offsetHeight || e.clientHeight + }; + }, + + getParent : function(n, f, r) { + return this.getParents(n, f, r, false); + }, + + getParents : function(n, f, r, c) { + var t = this, na, se = t.settings, o = []; + + n = t.get(n); + c = c === undefined; + + if (se.strict_root) + r = r || t.getRoot(); + + // Wrap node name as func + if (is(f, 'string')) { + na = f; + + if (f === '*') { + f = function(n) {return n.nodeType == 1;}; + } else { + f = function(n) { + return t.is(n, na); + }; + } + } + + while (n) { + if (n == r || !n.nodeType || n.nodeType === 9) + break; + + if (!f || f(n)) { + if (c) + o.push(n); + else + return n; + } + + n = n.parentNode; + } + + return c ? o : null; + }, + + get : function(e) { + var n; + + if (e && this.doc && typeof(e) == 'string') { + n = e; + e = this.doc.getElementById(e); + + // IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick + if (e && e.id !== n) + return this.doc.getElementsByName(n)[1]; + } + + return e; + }, + + getNext : function(node, selector) { + return this._findSib(node, selector, 'nextSibling'); + }, + + getPrev : function(node, selector) { + return this._findSib(node, selector, 'previousSibling'); + }, + + + add : function(p, n, a, h, c) { + var t = this; + + return this.run(p, function(p) { + var e, k; + + e = is(n, 'string') ? t.doc.createElement(n) : n; + t.setAttribs(e, a); + + if (h) { + if (h.nodeType) + e.appendChild(h); + else + t.setHTML(e, h); + } + + return !c ? p.appendChild(e) : e; + }); + }, + + create : function(n, a, h) { + return this.add(this.doc.createElement(n), n, a, h, 1); + }, + + createHTML : function(n, a, h) { + var o = '', t = this, k; + + o += '<' + n; + + for (k in a) { + if (a.hasOwnProperty(k)) + o += ' ' + k + '="' + t.encode(a[k]) + '"'; + } + + // A call to tinymce.is doesn't work for some odd reason on IE9 possible bug inside their JS runtime + if (typeof(h) != "undefined") + return o + '>' + h + ''; + + return o + ' />'; + }, + + remove : function(node, keep_children) { + return this.run(node, function(node) { + var child, parent = node.parentNode; + + if (!parent) + return null; + + if (keep_children) { + while (child = node.firstChild) { + // IE 8 will crash if you don't remove completely empty text nodes + if (!tinymce.isIE || child.nodeType !== 3 || child.nodeValue) + parent.insertBefore(child, node); + else + node.removeChild(child); + } + } + + return parent.removeChild(node); + }); + }, + + setStyle : function(n, na, v) { + var t = this; + + return t.run(n, function(e) { + var s, i; + + s = e.style; + + // Camelcase it, if needed + na = na.replace(/-(\D)/g, function(a, b){ + return b.toUpperCase(); + }); + + // Default px suffix on these + if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v))) + v += 'px'; + + switch (na) { + case 'opacity': + // IE specific opacity + if (isIE) { + s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")"; + + if (!n.currentStyle || !n.currentStyle.hasLayout) + s.display = 'inline-block'; + } + + // Fix for older browsers + s[na] = s['-moz-opacity'] = s['-khtml-opacity'] = v || ''; + break; + + case 'float': + isIE ? s.styleFloat = v : s.cssFloat = v; + break; + + default: + s[na] = v || ''; + } + + // Force update of the style data + if (t.settings.update_styles) + t.setAttrib(e, 'data-mce-style'); + }); + }, + + getStyle : function(n, na, c) { + n = this.get(n); + + if (!n) + return; + + // Gecko + if (this.doc.defaultView && c) { + // Remove camelcase + na = na.replace(/[A-Z]/g, function(a){ + return '-' + a; + }); + + try { + return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na); + } catch (ex) { + // Old safari might fail + return null; + } + } + + // Camelcase it, if needed + na = na.replace(/-(\D)/g, function(a, b){ + return b.toUpperCase(); + }); + + if (na == 'float') + na = isIE ? 'styleFloat' : 'cssFloat'; + + // IE & Opera + if (n.currentStyle && c) + return n.currentStyle[na]; + + return n.style ? n.style[na] : undefined; + }, + + setStyles : function(e, o) { + var t = this, s = t.settings, ol; + + ol = s.update_styles; + s.update_styles = 0; + + each(o, function(v, n) { + t.setStyle(e, n, v); + }); + + // Update style info + s.update_styles = ol; + if (s.update_styles) + t.setAttrib(e, s.cssText); + }, + + removeAllAttribs: function(e) { + return this.run(e, function(e) { + var i, attrs = e.attributes; + for (i = attrs.length - 1; i >= 0; i--) { + e.removeAttributeNode(attrs.item(i)); + } + }); + }, + + setAttrib : function(e, n, v) { + var t = this; + + // Whats the point + if (!e || !n) + return; + + // Strict XML mode + if (t.settings.strict) + n = n.toLowerCase(); + + return this.run(e, function(e) { + var s = t.settings; + var originalValue = e.getAttribute(n); + if (v !== null) { + switch (n) { + case "style": + if (!is(v, 'string')) { + each(v, function(v, n) { + t.setStyle(e, n, v); + }); + + return; + } + + // No mce_style for elements with these since they might get resized by the user + if (s.keep_values) { + if (v && !t._isRes(v)) + e.setAttribute('data-mce-style', v, 2); + else + e.removeAttribute('data-mce-style', 2); + } + + e.style.cssText = v; + break; + + case "class": + e.className = v || ''; // Fix IE null bug + break; + + case "src": + case "href": + if (s.keep_values) { + if (s.url_converter) + v = s.url_converter.call(s.url_converter_scope || t, v, n, e); + + t.setAttrib(e, 'data-mce-' + n, v, 2); + } + + break; + + case "shape": + e.setAttribute('data-mce-style', v); + break; + } + } + if (is(v) && v !== null && v.length !== 0) + e.setAttribute(n, '' + v, 2); + else + e.removeAttribute(n, 2); + + // fire onChangeAttrib event for attributes that have changed + if (tinyMCE.activeEditor && originalValue != v) { + var ed = tinyMCE.activeEditor; + ed.onSetAttrib.dispatch(ed, e, n, v); + } + }); + }, + + setAttribs : function(e, o) { + var t = this; + + return this.run(e, function(e) { + each(o, function(v, n) { + t.setAttrib(e, n, v); + }); + }); + }, + + getAttrib : function(e, n, dv) { + var v, t = this, undef; + + e = t.get(e); + + if (!e || e.nodeType !== 1) + return dv === undef ? false : dv; + + if (!is(dv)) + dv = ''; + + // Try the mce variant for these + if (/^(src|href|style|coords|shape)$/.test(n)) { + v = e.getAttribute("data-mce-" + n); + + if (v) + return v; + } + + if (isIE && t.props[n]) { + v = e[t.props[n]]; + v = v && v.nodeValue ? v.nodeValue : v; + } + + if (!v) + v = e.getAttribute(n, 2); + + // Check boolean attribs + if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(n)) { + if (e[t.props[n]] === true && v === '') + return n; + + return v ? n : ''; + } + + // Inner input elements will override attributes on form elements + if (e.nodeName === "FORM" && e.getAttributeNode(n)) + return e.getAttributeNode(n).nodeValue; + + if (n === 'style') { + v = v || e.style.cssText; + + if (v) { + v = t.serializeStyle(t.parseStyle(v), e.nodeName); + + if (t.settings.keep_values && !t._isRes(v)) + e.setAttribute('data-mce-style', v); + } + } + + // Remove Apple and WebKit stuff + if (isWebKit && n === "class" && v) + v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, ''); + + // Handle IE issues + if (isIE) { + switch (n) { + case 'rowspan': + case 'colspan': + // IE returns 1 as default value + if (v === 1) + v = ''; + + break; + + case 'size': + // IE returns +0 as default value for size + if (v === '+0' || v === 20 || v === 0) + v = ''; + + break; + + case 'width': + case 'height': + case 'vspace': + case 'checked': + case 'disabled': + case 'readonly': + if (v === 0) + v = ''; + + break; + + case 'hspace': + // IE returns -1 as default value + if (v === -1) + v = ''; + + break; + + case 'maxlength': + case 'tabindex': + // IE returns default value + if (v === 32768 || v === 2147483647 || v === '32768') + v = ''; + + break; + + case 'multiple': + case 'compact': + case 'noshade': + case 'nowrap': + if (v === 65535) + return n; + + return dv; + + case 'shape': + v = v.toLowerCase(); + break; + + default: + // IE has odd anonymous function for event attributes + if (n.indexOf('on') === 0 && v) + v = tinymce._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, '$1', '' + v); + } + } + + return (v !== undef && v !== null && v !== '') ? '' + v : dv; + }, + + getPos : function(n, ro) { + var t = this, x = 0, y = 0, e, d = t.doc, r; + + n = t.get(n); + ro = ro || d.body; + + if (n) { + // Use getBoundingClientRect if it exists since it's faster than looping offset nodes + if (n.getBoundingClientRect) { + n = n.getBoundingClientRect(); + e = t.boxModel ? d.documentElement : d.body; + + // Add scroll offsets from documentElement or body since IE with the wrong box model will use d.body and so do WebKit + // Also remove the body/documentelement clientTop/clientLeft on IE 6, 7 since they offset the position + x = n.left + (d.documentElement.scrollLeft || d.body.scrollLeft) - e.clientTop; + y = n.top + (d.documentElement.scrollTop || d.body.scrollTop) - e.clientLeft; + + return {x : x, y : y}; + } + + r = n; + while (r && r != ro && r.nodeType) { + x += r.offsetLeft || 0; + y += r.offsetTop || 0; + r = r.offsetParent; + } + + r = n.parentNode; + while (r && r != ro && r.nodeType) { + x -= r.scrollLeft || 0; + y -= r.scrollTop || 0; + r = r.parentNode; + } + } + + return {x : x, y : y}; + }, + + parseStyle : function(st) { + return this.styles.parse(st); + }, + + serializeStyle : function(o, name) { + return this.styles.serialize(o, name); + }, + + loadCSS : function(u) { + var t = this, d = t.doc, head; + + if (!u) + u = ''; + + head = t.select('head')[0]; + + each(u.split(','), function(u) { + var link; + + if (t.files[u]) + return; + + t.files[u] = true; + link = t.create('link', {rel : 'stylesheet', href : tinymce._addVer(u)}); + + // IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug + // This fix seems to resolve that issue by realcing the document ones a stylesheet finishes loading + // It's ugly but it seems to work fine. + if (isIE && d.documentMode && d.recalc) { + link.onload = function() { + if (d.recalc) + d.recalc(); + + link.onload = null; + }; + } + + head.appendChild(link); + }); + }, + + addClass : function(e, c) { + return this.run(e, function(e) { + var o; + + if (!c) + return 0; + + if (this.hasClass(e, c)) + return e.className; + + o = this.removeClass(e, c); + + return e.className = (o != '' ? (o + ' ') : '') + c; + }); + }, + + removeClass : function(e, c) { + var t = this, re; + + return t.run(e, function(e) { + var v; + + if (t.hasClass(e, c)) { + if (!re) + re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g"); + + v = e.className.replace(re, ' '); + v = tinymce.trim(v != ' ' ? v : ''); + + e.className = v; + + // Empty class attr + if (!v) { + e.removeAttribute('class'); + e.removeAttribute('className'); + } + + return v; + } + + return e.className; + }); + }, + + hasClass : function(n, c) { + n = this.get(n); + + if (!n || !c) + return false; + + return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1; + }, + + show : function(e) { + return this.setStyle(e, 'display', 'block'); + }, + + hide : function(e) { + return this.setStyle(e, 'display', 'none'); + }, + + isHidden : function(e) { + e = this.get(e); + + return !e || e.style.display == 'none' || this.getStyle(e, 'display') == 'none'; + }, + + uniqueId : function(p) { + return (!p ? 'mce_' : p) + (this.counter++); + }, + + setHTML : function(element, html) { + var self = this; + + return self.run(element, function(element) { + if (isIE) { + // Remove all child nodes, IE keeps empty text nodes in DOM + while (element.firstChild) + element.removeChild(element.firstChild); + + try { + // IE will remove comments from the beginning + // unless you padd the contents with something + element.innerHTML = '
    ' + html; + element.removeChild(element.firstChild); + } catch (ex) { + // IE sometimes produces an unknown runtime error on innerHTML if it's an block element within a block element for example a div inside a p + // This seems to fix this problem + + // Create new div with HTML contents and a BR infront to keep comments + element = self.create('div'); + element.innerHTML = '
    ' + html; + + // Add all children from div to target + each (element.childNodes, function(node, i) { + // Skip br element + if (i) + element.appendChild(node); + }); + } + } else + element.innerHTML = html; + + return html; + }); + }, + + getOuterHTML : function(elm) { + var doc, self = this; + + elm = self.get(elm); + + if (!elm) + return null; + + if (elm.nodeType === 1 && self.hasOuterHTML) + return elm.outerHTML; + + doc = (elm.ownerDocument || self.doc).createElement("body"); + doc.appendChild(elm.cloneNode(true)); + + return doc.innerHTML; + }, + + setOuterHTML : function(e, h, d) { + var t = this; + + function setHTML(e, h, d) { + var n, tp; + + tp = d.createElement("body"); + tp.innerHTML = h; + + n = tp.lastChild; + while (n) { + t.insertAfter(n.cloneNode(true), e); + n = n.previousSibling; + } + + t.remove(e); + }; + + return this.run(e, function(e) { + e = t.get(e); + + // Only set HTML on elements + if (e.nodeType == 1) { + d = d || e.ownerDocument || t.doc; + + if (isIE) { + try { + // Try outerHTML for IE it sometimes produces an unknown runtime error + if (isIE && e.nodeType == 1) + e.outerHTML = h; + else + setHTML(e, h, d); + } catch (ex) { + // Fix for unknown runtime error + setHTML(e, h, d); + } + } else + setHTML(e, h, d); + } + }); + }, + + decode : Entities.decode, + + encode : Entities.encodeAllRaw, + + insertAfter : function(node, reference_node) { + reference_node = this.get(reference_node); + + return this.run(node, function(node) { + var parent, nextSibling; + + parent = reference_node.parentNode; + nextSibling = reference_node.nextSibling; + + if (nextSibling) + parent.insertBefore(node, nextSibling); + else + parent.appendChild(node); + + return node; + }); + }, + + isBlock : function(node) { + var type = node.nodeType; + + // If it's a node then check the type and use the nodeName + if (type) + return !!(type === 1 && blockElementsMap[node.nodeName]); + + return !!blockElementsMap[node]; + }, + + replace : function(n, o, k) { + var t = this; + + if (is(o, 'array')) + n = n.cloneNode(true); + + return t.run(o, function(o) { + if (k) { + each(tinymce.grep(o.childNodes), function(c) { + n.appendChild(c); + }); + } + + return o.parentNode.replaceChild(n, o); + }); + }, + + rename : function(elm, name) { + var t = this, newElm; + + if (elm.nodeName != name.toUpperCase()) { + // Rename block element + newElm = t.create(name); + + // Copy attribs to new block + each(t.getAttribs(elm), function(attr_node) { + t.setAttrib(newElm, attr_node.nodeName, t.getAttrib(elm, attr_node.nodeName)); + }); + + // Replace block + t.replace(newElm, elm, 1); + } + + return newElm || elm; + }, + + findCommonAncestor : function(a, b) { + var ps = a, pe; + + while (ps) { + pe = b; + + while (pe && ps != pe) + pe = pe.parentNode; + + if (ps == pe) + break; + + ps = ps.parentNode; + } + + if (!ps && a.ownerDocument) + return a.ownerDocument.documentElement; + + return ps; + }, + + toHex : function(s) { + var c = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s); + + function hex(s) { + s = parseInt(s).toString(16); + + return s.length > 1 ? s : '0' + s; // 0 -> 00 + }; + + if (c) { + s = '#' + hex(c[1]) + hex(c[2]) + hex(c[3]); + + return s; + } + + return s; + }, + + getClasses : function() { + var t = this, cl = [], i, lo = {}, f = t.settings.class_filter, ov; + + if (t.classes) + return t.classes; + + function addClasses(s) { + // IE style imports + each(s.imports, function(r) { + addClasses(r); + }); + + each(s.cssRules || s.rules, function(r) { + // Real type or fake it on IE + switch (r.type || 1) { + // Rule + case 1: + if (r.selectorText) { + each(r.selectorText.split(','), function(v) { + v = v.replace(/^\s*|\s*$|^\s\./g, ""); + + // Is internal or it doesn't contain a class + if (/\.mce/.test(v) || !/\.[\w\-]+$/.test(v)) + return; + + // Remove everything but class name + ov = v; + v = tinymce._replace(/.*\.([a-z0-9_\-]+).*/i, '$1', v); + + // Filter classes + if (f && !(v = f(v, ov))) + return; + + if (!lo[v]) { + cl.push({'class' : v}); + lo[v] = 1; + } + }); + } + break; + + // Import + case 3: + addClasses(r.styleSheet); + break; + } + }); + }; + + try { + each(t.doc.styleSheets, addClasses); + } catch (ex) { + // Ignore + } + + if (cl.length > 0) + t.classes = cl; + + return cl; + }, + + run : function(e, f, s) { + var t = this, o; + + if (t.doc && typeof(e) === 'string') + e = t.get(e); + + if (!e) + return false; + + s = s || this; + if (!e.nodeType && (e.length || e.length === 0)) { + o = []; + + each(e, function(e, i) { + if (e) { + if (typeof(e) == 'string') + e = t.doc.getElementById(e); + + o.push(f.call(s, e, i)); + } + }); + + return o; + } + + return f.call(s, e); + }, + + getAttribs : function(n) { + var o; + + n = this.get(n); + + if (!n) + return []; + + if (isIE) { + o = []; + + // Object will throw exception in IE + if (n.nodeName == 'OBJECT') + return n.attributes; + + // IE doesn't keep the selected attribute if you clone option elements + if (n.nodeName === 'OPTION' && this.getAttrib(n, 'selected')) + o.push({specified : 1, nodeName : 'selected'}); + + // It's crazy that this is faster in IE but it's because it returns all attributes all the time + n.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi, '').replace(/[\w:\-]+/gi, function(a) { + o.push({specified : 1, nodeName : a}); + }); + + return o; + } + + return n.attributes; + }, + + isEmpty : function(node, elements) { + var self = this, i, attributes, type, walker, name, parentNode; + + node = node.firstChild; + if (node) { + walker = new tinymce.dom.TreeWalker(node); + elements = elements || self.schema ? self.schema.getNonEmptyElements() : null; + + do { + type = node.nodeType; + + if (type === 1) { + // Ignore bogus elements + if (node.getAttribute('data-mce-bogus')) + continue; + + // Keep empty elements like + name = node.nodeName.toLowerCase(); + if (elements && elements[name]) { + // Ignore single BR elements in blocks like


    + parentNode = node.parentNode; + if (name === 'br' && self.isBlock(parentNode) && parentNode.firstChild === node && parentNode.lastChild === node) { + continue; + } + + return false; + } + + // Keep elements with data-bookmark attributes or name attribute like
    + attributes = self.getAttribs(node); + i = node.attributes.length; + while (i--) { + name = node.attributes[i].nodeName; + if (name === "name" || name === 'data-mce-bookmark') + return false; + } + } + + // Keep comment nodes + if (type == 8) + return false; + + // Keep non whitespace text nodes + if ((type === 3 && !whiteSpaceRegExp.test(node.nodeValue))) + return false; + } while (node = walker.next()); + } + + return true; + }, + + destroy : function(s) { + var t = this; + + if (t.events) + t.events.destroy(); + + t.win = t.doc = t.root = t.events = null; + + // Manual destroy then remove unload handler + if (!s) + tinymce.removeUnload(t.destroy); + }, + + createRng : function() { + var d = this.doc; + + return d.createRange ? d.createRange() : new tinymce.dom.Range(this); + }, + + nodeIndex : function(node, normalized) { + var idx = 0, lastNodeType, lastNode, nodeType; + + if (node) { + for (lastNodeType = node.nodeType, node = node.previousSibling, lastNode = node; node; node = node.previousSibling) { + nodeType = node.nodeType; + + // Normalize text nodes + if (normalized && nodeType == 3) { + if (nodeType == lastNodeType || !node.nodeValue.length) + continue; + } + idx++; + lastNodeType = nodeType; + } + } + + return idx; + }, + + split : function(pe, e, re) { + var t = this, r = t.createRng(), bef, aft, pa; + + // W3C valid browsers tend to leave empty nodes to the left/right side of the contents, this makes sense + // but we don't want that in our code since it serves no purpose for the end user + // For example if this is chopped: + //

    text 1CHOPtext 2

    + // would produce: + //

    text 1

    CHOP

    text 2

    + // this function will then trim of empty edges and produce: + //

    text 1

    CHOP

    text 2

    + function trim(node) { + var i, children = node.childNodes, type = node.nodeType; + + function surroundedBySpans(node) { + var previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN'; + var nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN'; + return previousIsSpan && nextIsSpan; + } + + if (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') + return; + + for (i = children.length - 1; i >= 0; i--) + trim(children[i]); + + if (type != 9) { + // Keep non whitespace text nodes + if (type == 3 && node.nodeValue.length > 0) { + // If parent element isn't a block or there isn't any useful contents for example "

    " + // Also keep text nodes with only spaces if surrounded by spans. + // eg. "

    a b

    " should keep space between a and b + var trimmedLength = tinymce.trim(node.nodeValue).length; + if (!t.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength == 0 && surroundedBySpans(node)) + return; + } else if (type == 1) { + // If the only child is a bookmark then move it up + children = node.childNodes; + if (children.length == 1 && children[0] && children[0].nodeType == 1 && children[0].getAttribute('data-mce-type') == 'bookmark') + node.parentNode.insertBefore(children[0], node); + + // Keep non empty elements or img, hr etc + if (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) + return; + } + + t.remove(node); + } + + return node; + }; + + if (pe && e) { + // Get before chunk + r.setStart(pe.parentNode, t.nodeIndex(pe)); + r.setEnd(e.parentNode, t.nodeIndex(e)); + bef = r.extractContents(); + + // Get after chunk + r = t.createRng(); + r.setStart(e.parentNode, t.nodeIndex(e) + 1); + r.setEnd(pe.parentNode, t.nodeIndex(pe) + 1); + aft = r.extractContents(); + + // Insert before chunk + pa = pe.parentNode; + pa.insertBefore(trim(bef), pe); + + // Insert middle chunk + if (re) + pa.replaceChild(re, e); + else + pa.insertBefore(e, pe); + + // Insert after chunk + pa.insertBefore(trim(aft), pe); + t.remove(pe); + + return re || e; + } + }, + + bind : function(target, name, func, scope) { + var t = this; + + if (!t.events) + t.events = new tinymce.dom.EventUtils(); + + return t.events.add(target, name, func, scope || this); + }, + + unbind : function(target, name, func) { + var t = this; + + if (!t.events) + t.events = new tinymce.dom.EventUtils(); + + return t.events.remove(target, name, func); + }, + + + _findSib : function(node, selector, name) { + var t = this, f = selector; + + if (node) { + // If expression make a function of it using is + if (is(f, 'string')) { + f = function(node) { + return t.is(node, selector); + }; + } + + // Loop all siblings + for (node = node[name]; node; node = node[name]) { + if (f(node)) + return node; + } + } + + return null; + }, + + _isRes : function(c) { + // Is live resizble element + return /^(top|left|bottom|right|width|height)/i.test(c) || /;\s*(top|left|bottom|right|width|height)/i.test(c); + } + + /* + walk : function(n, f, s) { + var d = this.doc, w; + + if (d.createTreeWalker) { + w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); + + while ((n = w.nextNode()) != null) + f.call(s || this, n); + } else + tinymce.walk(n, f, 'childNodes', s); + } + */ + + /* + toRGB : function(s) { + var c = /^\s*?#([0-9A-F]{2})([0-9A-F]{1,2})([0-9A-F]{2})?\s*?$/.exec(s); + + if (c) { + // #FFF -> #FFFFFF + if (!is(c[3])) + c[3] = c[2] = c[1]; + + return "rgb(" + parseInt(c[1], 16) + "," + parseInt(c[2], 16) + "," + parseInt(c[3], 16) + ")"; + } + + return s; + } + */ + }); + + tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0}); +})(tinymce); + +(function(ns) { + // Range constructor + function Range(dom) { + var t = this, + doc = dom.doc, + EXTRACT = 0, + CLONE = 1, + DELETE = 2, + TRUE = true, + FALSE = false, + START_OFFSET = 'startOffset', + START_CONTAINER = 'startContainer', + END_CONTAINER = 'endContainer', + END_OFFSET = 'endOffset', + extend = tinymce.extend, + nodeIndex = dom.nodeIndex; + + extend(t, { + // Inital states + startContainer : doc, + startOffset : 0, + endContainer : doc, + endOffset : 0, + collapsed : TRUE, + commonAncestorContainer : doc, + + // Range constants + START_TO_START : 0, + START_TO_END : 1, + END_TO_END : 2, + END_TO_START : 3, + + // Public methods + setStart : setStart, + setEnd : setEnd, + setStartBefore : setStartBefore, + setStartAfter : setStartAfter, + setEndBefore : setEndBefore, + setEndAfter : setEndAfter, + collapse : collapse, + selectNode : selectNode, + selectNodeContents : selectNodeContents, + compareBoundaryPoints : compareBoundaryPoints, + deleteContents : deleteContents, + extractContents : extractContents, + cloneContents : cloneContents, + insertNode : insertNode, + surroundContents : surroundContents, + cloneRange : cloneRange + }); + + function setStart(n, o) { + _setEndPoint(TRUE, n, o); + }; + + function setEnd(n, o) { + _setEndPoint(FALSE, n, o); + }; + + function setStartBefore(n) { + setStart(n.parentNode, nodeIndex(n)); + }; + + function setStartAfter(n) { + setStart(n.parentNode, nodeIndex(n) + 1); + }; + + function setEndBefore(n) { + setEnd(n.parentNode, nodeIndex(n)); + }; + + function setEndAfter(n) { + setEnd(n.parentNode, nodeIndex(n) + 1); + }; + + function collapse(ts) { + if (ts) { + t[END_CONTAINER] = t[START_CONTAINER]; + t[END_OFFSET] = t[START_OFFSET]; + } else { + t[START_CONTAINER] = t[END_CONTAINER]; + t[START_OFFSET] = t[END_OFFSET]; + } + + t.collapsed = TRUE; + }; + + function selectNode(n) { + setStartBefore(n); + setEndAfter(n); + }; + + function selectNodeContents(n) { + setStart(n, 0); + setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length); + }; + + function compareBoundaryPoints(h, r) { + var sc = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[END_OFFSET], + rsc = r.startContainer, rso = r.startOffset, rec = r.endContainer, reo = r.endOffset; + + // Check START_TO_START + if (h === 0) + return _compareBoundaryPoints(sc, so, rsc, rso); + + // Check START_TO_END + if (h === 1) + return _compareBoundaryPoints(ec, eo, rsc, rso); + + // Check END_TO_END + if (h === 2) + return _compareBoundaryPoints(ec, eo, rec, reo); + + // Check END_TO_START + if (h === 3) + return _compareBoundaryPoints(sc, so, rec, reo); + }; + + function deleteContents() { + _traverse(DELETE); + }; + + function extractContents() { + return _traverse(EXTRACT); + }; + + function cloneContents() { + return _traverse(CLONE); + }; + + function insertNode(n) { + var startContainer = this[START_CONTAINER], + startOffset = this[START_OFFSET], nn, o; + + // Node is TEXT_NODE or CDATA + if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) { + if (!startOffset) { + // At the start of text + startContainer.parentNode.insertBefore(n, startContainer); + } else if (startOffset >= startContainer.nodeValue.length) { + // At the end of text + dom.insertAfter(n, startContainer); + } else { + // Middle, need to split + nn = startContainer.splitText(startOffset); + startContainer.parentNode.insertBefore(n, nn); + } + } else { + // Insert element node + if (startContainer.childNodes.length > 0) + o = startContainer.childNodes[startOffset]; + + if (o) + startContainer.insertBefore(n, o); + else + startContainer.appendChild(n); + } + }; + + function surroundContents(n) { + var f = t.extractContents(); + + t.insertNode(n); + n.appendChild(f); + t.selectNode(n); + }; + + function cloneRange() { + return extend(new Range(dom), { + startContainer : t[START_CONTAINER], + startOffset : t[START_OFFSET], + endContainer : t[END_CONTAINER], + endOffset : t[END_OFFSET], + collapsed : t.collapsed, + commonAncestorContainer : t.commonAncestorContainer + }); + }; + + // Private methods + + function _getSelectedNode(container, offset) { + var child; + + if (container.nodeType == 3 /* TEXT_NODE */) + return container; + + if (offset < 0) + return container; + + child = container.firstChild; + while (child && offset > 0) { + --offset; + child = child.nextSibling; + } + + if (child) + return child; + + return container; + }; + + function _isCollapsed() { + return (t[START_CONTAINER] == t[END_CONTAINER] && t[START_OFFSET] == t[END_OFFSET]); + }; + + function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) { + var c, offsetC, n, cmnRoot, childA, childB; + + // In the first case the boundary-points have the same container. A is before B + // if its offset is less than the offset of B, A is equal to B if its offset is + // equal to the offset of B, and A is after B if its offset is greater than the + // offset of B. + if (containerA == containerB) { + if (offsetA == offsetB) + return 0; // equal + + if (offsetA < offsetB) + return -1; // before + + return 1; // after + } + + // In the second case a child node C of the container of A is an ancestor + // container of B. In this case, A is before B if the offset of A is less than or + // equal to the index of the child node C and A is after B otherwise. + c = containerB; + while (c && c.parentNode != containerA) + c = c.parentNode; + + if (c) { + offsetC = 0; + n = containerA.firstChild; + + while (n != c && offsetC < offsetA) { + offsetC++; + n = n.nextSibling; + } + + if (offsetA <= offsetC) + return -1; // before + + return 1; // after + } + + // In the third case a child node C of the container of B is an ancestor container + // of A. In this case, A is before B if the index of the child node C is less than + // the offset of B and A is after B otherwise. + c = containerA; + while (c && c.parentNode != containerB) { + c = c.parentNode; + } + + if (c) { + offsetC = 0; + n = containerB.firstChild; + + while (n != c && offsetC < offsetB) { + offsetC++; + n = n.nextSibling; + } + + if (offsetC < offsetB) + return -1; // before + + return 1; // after + } + + // In the fourth case, none of three other cases hold: the containers of A and B + // are siblings or descendants of sibling nodes. In this case, A is before B if + // the container of A is before the container of B in a pre-order traversal of the + // Ranges' context tree and A is after B otherwise. + cmnRoot = dom.findCommonAncestor(containerA, containerB); + childA = containerA; + + while (childA && childA.parentNode != cmnRoot) + childA = childA.parentNode; + + if (!childA) + childA = cmnRoot; + + childB = containerB; + while (childB && childB.parentNode != cmnRoot) + childB = childB.parentNode; + + if (!childB) + childB = cmnRoot; + + if (childA == childB) + return 0; // equal + + n = cmnRoot.firstChild; + while (n) { + if (n == childA) + return -1; // before + + if (n == childB) + return 1; // after + + n = n.nextSibling; + } + }; + + function _setEndPoint(st, n, o) { + var ec, sc; + + if (st) { + t[START_CONTAINER] = n; + t[START_OFFSET] = o; + } else { + t[END_CONTAINER] = n; + t[END_OFFSET] = o; + } + + // If one boundary-point of a Range is set to have a root container + // other than the current one for the Range, the Range is collapsed to + // the new position. This enforces the restriction that both boundary- + // points of a Range must have the same root container. + ec = t[END_CONTAINER]; + while (ec.parentNode) + ec = ec.parentNode; + + sc = t[START_CONTAINER]; + while (sc.parentNode) + sc = sc.parentNode; + + if (sc == ec) { + // The start position of a Range is guaranteed to never be after the + // end position. To enforce this restriction, if the start is set to + // be at a position after the end, the Range is collapsed to that + // position. + if (_compareBoundaryPoints(t[START_CONTAINER], t[START_OFFSET], t[END_CONTAINER], t[END_OFFSET]) > 0) + t.collapse(st); + } else + t.collapse(st); + + t.collapsed = _isCollapsed(); + t.commonAncestorContainer = dom.findCommonAncestor(t[START_CONTAINER], t[END_CONTAINER]); + }; + + function _traverse(how) { + var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep; + + if (t[START_CONTAINER] == t[END_CONTAINER]) + return _traverseSameContainer(how); + + for (c = t[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { + if (p == t[START_CONTAINER]) + return _traverseCommonStartContainer(c, how); + + ++endContainerDepth; + } + + for (c = t[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { + if (p == t[END_CONTAINER]) + return _traverseCommonEndContainer(c, how); + + ++startContainerDepth; + } + + depthDiff = startContainerDepth - endContainerDepth; + + startNode = t[START_CONTAINER]; + while (depthDiff > 0) { + startNode = startNode.parentNode; + depthDiff--; + } + + endNode = t[END_CONTAINER]; + while (depthDiff < 0) { + endNode = endNode.parentNode; + depthDiff++; + } + + // ascend the ancestor hierarchy until we have a common parent. + for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) { + startNode = sp; + endNode = ep; + } + + return _traverseCommonAncestors(startNode, endNode, how); + }; + + function _traverseSameContainer(how) { + var frag, s, sub, n, cnt, sibling, xferNode; + + if (how != DELETE) + frag = doc.createDocumentFragment(); + + // If selection is empty, just return the fragment + if (t[START_OFFSET] == t[END_OFFSET]) + return frag; + + // Text node needs special case handling + if (t[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) { + // get the substring + s = t[START_CONTAINER].nodeValue; + sub = s.substring(t[START_OFFSET], t[END_OFFSET]); + + // set the original text node to its new value + if (how != CLONE) { + t[START_CONTAINER].deleteData(t[START_OFFSET], t[END_OFFSET] - t[START_OFFSET]); + + // Nothing is partially selected, so collapse to start point + t.collapse(TRUE); + } + + if (how == DELETE) + return; + + frag.appendChild(doc.createTextNode(sub)); + return frag; + } + + // Copy nodes between the start/end offsets. + n = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]); + cnt = t[END_OFFSET] - t[START_OFFSET]; + + while (cnt > 0) { + sibling = n.nextSibling; + xferNode = _traverseFullySelected(n, how); + + if (frag) + frag.appendChild( xferNode ); + + --cnt; + n = sibling; + } + + // Nothing is partially selected, so collapse to start point + if (how != CLONE) + t.collapse(TRUE); + + return frag; + }; + + function _traverseCommonStartContainer(endAncestor, how) { + var frag, n, endIdx, cnt, sibling, xferNode; + + if (how != DELETE) + frag = doc.createDocumentFragment(); + + n = _traverseRightBoundary(endAncestor, how); + + if (frag) + frag.appendChild(n); + + endIdx = nodeIndex(endAncestor); + cnt = endIdx - t[START_OFFSET]; + + if (cnt <= 0) { + // Collapse to just before the endAncestor, which + // is partially selected. + if (how != CLONE) { + t.setEndBefore(endAncestor); + t.collapse(FALSE); + } + + return frag; + } + + n = endAncestor.previousSibling; + while (cnt > 0) { + sibling = n.previousSibling; + xferNode = _traverseFullySelected(n, how); + + if (frag) + frag.insertBefore(xferNode, frag.firstChild); + + --cnt; + n = sibling; + } + + // Collapse to just before the endAncestor, which + // is partially selected. + if (how != CLONE) { + t.setEndBefore(endAncestor); + t.collapse(FALSE); + } + + return frag; + }; + + function _traverseCommonEndContainer(startAncestor, how) { + var frag, startIdx, n, cnt, sibling, xferNode; + + if (how != DELETE) + frag = doc.createDocumentFragment(); + + n = _traverseLeftBoundary(startAncestor, how); + if (frag) + frag.appendChild(n); + + startIdx = nodeIndex(startAncestor); + ++startIdx; // Because we already traversed it + + cnt = t[END_OFFSET] - startIdx; + n = startAncestor.nextSibling; + while (cnt > 0) { + sibling = n.nextSibling; + xferNode = _traverseFullySelected(n, how); + + if (frag) + frag.appendChild(xferNode); + + --cnt; + n = sibling; + } + + if (how != CLONE) { + t.setStartAfter(startAncestor); + t.collapse(TRUE); + } + + return frag; + }; + + function _traverseCommonAncestors(startAncestor, endAncestor, how) { + var n, frag, commonParent, startOffset, endOffset, cnt, sibling, nextSibling; + + if (how != DELETE) + frag = doc.createDocumentFragment(); + + n = _traverseLeftBoundary(startAncestor, how); + if (frag) + frag.appendChild(n); + + commonParent = startAncestor.parentNode; + startOffset = nodeIndex(startAncestor); + endOffset = nodeIndex(endAncestor); + ++startOffset; + + cnt = endOffset - startOffset; + sibling = startAncestor.nextSibling; + + while (cnt > 0) { + nextSibling = sibling.nextSibling; + n = _traverseFullySelected(sibling, how); + + if (frag) + frag.appendChild(n); + + sibling = nextSibling; + --cnt; + } + + n = _traverseRightBoundary(endAncestor, how); + + if (frag) + frag.appendChild(n); + + if (how != CLONE) { + t.setStartAfter(startAncestor); + t.collapse(TRUE); + } + + return frag; + }; + + function _traverseRightBoundary(root, how) { + var next = _getSelectedNode(t[END_CONTAINER], t[END_OFFSET] - 1), parent, clonedParent, prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != t[END_CONTAINER]; + + if (next == root) + return _traverseNode(next, isFullySelected, FALSE, how); + + parent = next.parentNode; + clonedParent = _traverseNode(parent, FALSE, FALSE, how); + + while (parent) { + while (next) { + prevSibling = next.previousSibling; + clonedChild = _traverseNode(next, isFullySelected, FALSE, how); + + if (how != DELETE) + clonedParent.insertBefore(clonedChild, clonedParent.firstChild); + + isFullySelected = TRUE; + next = prevSibling; + } + + if (parent == root) + return clonedParent; + + next = parent.previousSibling; + parent = parent.parentNode; + + clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how); + + if (how != DELETE) + clonedGrandParent.appendChild(clonedParent); + + clonedParent = clonedGrandParent; + } + }; + + function _traverseLeftBoundary(root, how) { + var next = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]), isFullySelected = next != t[START_CONTAINER], parent, clonedParent, nextSibling, clonedChild, clonedGrandParent; + + if (next == root) + return _traverseNode(next, isFullySelected, TRUE, how); + + parent = next.parentNode; + clonedParent = _traverseNode(parent, FALSE, TRUE, how); + + while (parent) { + while (next) { + nextSibling = next.nextSibling; + clonedChild = _traverseNode(next, isFullySelected, TRUE, how); + + if (how != DELETE) + clonedParent.appendChild(clonedChild); + + isFullySelected = TRUE; + next = nextSibling; + } + + if (parent == root) + return clonedParent; + + next = parent.nextSibling; + parent = parent.parentNode; + + clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how); + + if (how != DELETE) + clonedGrandParent.appendChild(clonedParent); + + clonedParent = clonedGrandParent; + } + }; + + function _traverseNode(n, isFullySelected, isLeft, how) { + var txtValue, newNodeValue, oldNodeValue, offset, newNode; + + if (isFullySelected) + return _traverseFullySelected(n, how); + + if (n.nodeType == 3 /* TEXT_NODE */) { + txtValue = n.nodeValue; + + if (isLeft) { + offset = t[START_OFFSET]; + newNodeValue = txtValue.substring(offset); + oldNodeValue = txtValue.substring(0, offset); + } else { + offset = t[END_OFFSET]; + newNodeValue = txtValue.substring(0, offset); + oldNodeValue = txtValue.substring(offset); + } + + if (how != CLONE) + n.nodeValue = oldNodeValue; + + if (how == DELETE) + return; + + newNode = n.cloneNode(FALSE); + newNode.nodeValue = newNodeValue; + + return newNode; + } + + if (how == DELETE) + return; + + return n.cloneNode(FALSE); + }; + + function _traverseFullySelected(n, how) { + if (how != DELETE) + return how == CLONE ? n.cloneNode(TRUE) : n; + + n.parentNode.removeChild(n); + }; + }; + + ns.Range = Range; +})(tinymce.dom); + +(function() { + function Selection(selection) { + var self = this, dom = selection.dom, TRUE = true, FALSE = false; + + function getPosition(rng, start) { + var checkRng, startIndex = 0, endIndex, inside, + children, child, offset, index, position = -1, parent; + + // Setup test range, collapse it and get the parent + checkRng = rng.duplicate(); + checkRng.collapse(start); + parent = checkRng.parentElement(); + + // Check if the selection is within the right document + if (parent.ownerDocument !== selection.dom.doc) + return; + + // IE will report non editable elements as it's parent so look for an editable one + while (parent.contentEditable === "false") { + parent = parent.parentNode; + } + + // If parent doesn't have any children then return that we are inside the element + if (!parent.hasChildNodes()) { + return {node : parent, inside : 1}; + } + + // Setup node list and endIndex + children = parent.children; + endIndex = children.length - 1; + + // Perform a binary search for the position + while (startIndex <= endIndex) { + index = Math.floor((startIndex + endIndex) / 2); + + // Move selection to node and compare the ranges + child = children[index]; + checkRng.moveToElementText(child); + position = checkRng.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', rng); + + // Before/after or an exact match + if (position > 0) { + endIndex = index - 1; + } else if (position < 0) { + startIndex = index + 1; + } else { + return {node : child}; + } + } + + // Check if child position is before or we didn't find a position + if (position < 0) { + // No element child was found use the parent element and the offset inside that + if (!child) { + checkRng.moveToElementText(parent); + checkRng.collapse(true); + child = parent; + inside = true; + } else + checkRng.collapse(false); + + checkRng.setEndPoint(start ? 'EndToStart' : 'EndToEnd', rng); + + // Fix for edge case:
    ..
    ab|c
    + if (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) > 0) { + checkRng = rng.duplicate(); + checkRng.collapse(start); + + offset = -1; + while (parent == checkRng.parentElement()) { + if (checkRng.move('character', -1) == 0) + break; + + offset++; + } + } + + offset = offset || checkRng.text.replace('\r\n', ' ').length; + } else { + // Child position is after the selection endpoint + checkRng.collapse(true); + checkRng.setEndPoint(start ? 'StartToStart' : 'StartToEnd', rng); + + // Get the length of the text to find where the endpoint is relative to it's container + offset = checkRng.text.replace('\r\n', ' ').length; + } + + return {node : child, position : position, offset : offset, inside : inside}; + }; + + // Returns a W3C DOM compatible range object by using the IE Range API + function getRange() { + var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark, fail; + + // If selection is outside the current document just return an empty range + element = ieRange.item ? ieRange.item(0) : ieRange.parentElement(); + if (element.ownerDocument != dom.doc) + return domRange; + + collapsed = selection.isCollapsed(); + + // Handle control selection + if (ieRange.item) { + domRange.setStart(element.parentNode, dom.nodeIndex(element)); + domRange.setEnd(domRange.startContainer, domRange.startOffset + 1); + + return domRange; + } + + function findEndPoint(start) { + var endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue; + + container = endPoint.node; + offset = endPoint.offset; + + if (endPoint.inside && !container.hasChildNodes()) { + domRange[start ? 'setStart' : 'setEnd'](container, 0); + return; + } + + if (offset === undef) { + domRange[start ? 'setStartBefore' : 'setEndAfter'](container); + return; + } + + if (endPoint.position < 0) { + sibling = endPoint.inside ? container.firstChild : container.nextSibling; + + if (!sibling) { + domRange[start ? 'setStartAfter' : 'setEndAfter'](container); + return; + } + + if (!offset) { + if (sibling.nodeType == 3) + domRange[start ? 'setStart' : 'setEnd'](sibling, 0); + else + domRange[start ? 'setStartBefore' : 'setEndBefore'](sibling); + + return; + } + + // Find the text node and offset + while (sibling) { + nodeValue = sibling.nodeValue; + textNodeOffset += nodeValue.length; + + // We are at or passed the position we where looking for + if (textNodeOffset >= offset) { + container = sibling; + textNodeOffset -= offset; + textNodeOffset = nodeValue.length - textNodeOffset; + break; + } + + sibling = sibling.nextSibling; + } + } else { + // Find the text node and offset + sibling = container.previousSibling; + + if (!sibling) + return domRange[start ? 'setStartBefore' : 'setEndBefore'](container); + + // If there isn't any text to loop then use the first position + if (!offset) { + if (container.nodeType == 3) + domRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length); + else + domRange[start ? 'setStartAfter' : 'setEndAfter'](sibling); + + return; + } + + while (sibling) { + textNodeOffset += sibling.nodeValue.length; + + // We are at or passed the position we where looking for + if (textNodeOffset >= offset) { + container = sibling; + textNodeOffset -= offset; + break; + } + + sibling = sibling.previousSibling; + } + } + + domRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset); + }; + + try { + // Find start point + findEndPoint(true); + + // Find end point if needed + if (!collapsed) + findEndPoint(); + } catch (ex) { + // IE has a nasty bug where text nodes might throw "invalid argument" when you + // access the nodeValue or other properties of text nodes. This seems to happend when + // text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it. + if (ex.number == -2147024809) { + // Get the current selection + bookmark = self.getBookmark(2); + + // Get start element + tmpRange = ieRange.duplicate(); + tmpRange.collapse(true); + element = tmpRange.parentElement(); + + // Get end element + if (!collapsed) { + tmpRange = ieRange.duplicate(); + tmpRange.collapse(false); + element2 = tmpRange.parentElement(); + element2.innerHTML = element2.innerHTML; + } + + // Remove the broken elements + element.innerHTML = element.innerHTML; + + // Restore the selection + self.moveToBookmark(bookmark); + + // Since the range has moved we need to re-get it + ieRange = selection.getRng(); + + // Find start point + findEndPoint(true); + + // Find end point if needed + if (!collapsed) + findEndPoint(); + } else + throw ex; // Throw other errors + } + + return domRange; + }; + + this.getBookmark = function(type) { + var rng = selection.getRng(), start, end, bookmark = {}; + + function getIndexes(node) { + var node, parent, root, children, i, indexes = []; + + parent = node.parentNode; + root = dom.getRoot().parentNode; + + while (parent != root && parent.nodeType !== 9) { + children = parent.children; + + i = children.length; + while (i--) { + if (node === children[i]) { + indexes.push(i); + break; + } + } + + node = parent; + parent = parent.parentNode; + } + + return indexes; + }; + + function getBookmarkEndPoint(start) { + var position; + + position = getPosition(rng, start); + if (position) { + return { + position : position.position, + offset : position.offset, + indexes : getIndexes(position.node), + inside : position.inside + }; + } + }; + + // Non ubstructive bookmark + if (type === 2) { + // Handle text selection + if (!rng.item) { + bookmark.start = getBookmarkEndPoint(true); + + if (!selection.isCollapsed()) + bookmark.end = getBookmarkEndPoint(); + } else + bookmark.start = {ctrl : true, indexes : getIndexes(rng.item(0))}; + } + + return bookmark; + }; + + this.moveToBookmark = function(bookmark) { + var rng, body = dom.doc.body; + + function resolveIndexes(indexes) { + var node, i, idx, children; + + node = dom.getRoot(); + for (i = indexes.length - 1; i >= 0; i--) { + children = node.children; + idx = indexes[i]; + + if (idx <= children.length - 1) { + node = children[idx]; + } + } + + return node; + }; + + function setBookmarkEndPoint(start) { + var endPoint = bookmark[start ? 'start' : 'end'], moveLeft, moveRng, undef; + + if (endPoint) { + moveLeft = endPoint.position > 0; + + moveRng = body.createTextRange(); + moveRng.moveToElementText(resolveIndexes(endPoint.indexes)); + + offset = endPoint.offset; + if (offset !== undef) { + moveRng.collapse(endPoint.inside || moveLeft); + moveRng.moveStart('character', moveLeft ? -offset : offset); + } else + moveRng.collapse(start); + + rng.setEndPoint(start ? 'StartToStart' : 'EndToStart', moveRng); + + if (start) + rng.collapse(true); + } + }; + + if (bookmark.start) { + if (bookmark.start.ctrl) { + rng = body.createControlRange(); + rng.addElement(resolveIndexes(bookmark.start.indexes)); + rng.select(); + } else { + rng = body.createTextRange(); + setBookmarkEndPoint(true); + setBookmarkEndPoint(); + rng.select(); + } + } + }; + + this.addRange = function(rng) { + var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, doc = selection.dom.doc, body = doc.body; + + function setEndPoint(start) { + var container, offset, marker, tmpRng, nodes; + + marker = dom.create('a'); + container = start ? startContainer : endContainer; + offset = start ? startOffset : endOffset; + tmpRng = ieRng.duplicate(); + + if (container == doc || container == doc.documentElement) { + container = body; + offset = 0; + } + + if (container.nodeType == 3) { + container.parentNode.insertBefore(marker, container); + tmpRng.moveToElementText(marker); + tmpRng.moveStart('character', offset); + dom.remove(marker); + ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); + } else { + nodes = container.childNodes; + + if (nodes.length) { + if (offset >= nodes.length) { + dom.insertAfter(marker, nodes[nodes.length - 1]); + } else { + container.insertBefore(marker, nodes[offset]); + } + + tmpRng.moveToElementText(marker); + } else { + // Empty node selection for example
    |
    + marker = doc.createTextNode('\uFEFF'); + container.appendChild(marker); + tmpRng.moveToElementText(marker.parentNode); + tmpRng.collapse(TRUE); + } + + ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); + dom.remove(marker); + } + } + + // Setup some shorter versions + startContainer = rng.startContainer; + startOffset = rng.startOffset; + endContainer = rng.endContainer; + endOffset = rng.endOffset; + ieRng = body.createTextRange(); + + // If single element selection then try making a control selection out of it + if (startContainer == endContainer && startContainer.nodeType == 1 && startOffset == endOffset - 1) { + if (startOffset == endOffset - 1) { + try { + ctrlRng = body.createControlRange(); + ctrlRng.addElement(startContainer.childNodes[startOffset]); + ctrlRng.select(); + return; + } catch (ex) { + // Ignore + } + } + } + + // Set start/end point of selection + setEndPoint(true); + setEndPoint(); + + // Select the new range and scroll it into view + ieRng.select(); + }; + + // Expose range method + this.getRangeAt = getRange; + }; + + // Expose the selection object + tinymce.dom.TridentSelection = Selection; +})(); + + +(function(tinymce) { + // Shorten names + var each = tinymce.each, DOM = tinymce.DOM, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, Event; + + tinymce.create('tinymce.dom.EventUtils', { + EventUtils : function() { + this.inits = []; + this.events = []; + }, + + add : function(o, n, f, s) { + var cb, t = this, el = t.events, r; + + if (n instanceof Array) { + r = []; + + each(n, function(n) { + r.push(t.add(o, n, f, s)); + }); + + return r; + } + + // Handle array + if (o && o.hasOwnProperty && o instanceof Array) { + r = []; + + each(o, function(o) { + o = DOM.get(o); + r.push(t.add(o, n, f, s)); + }); + + return r; + } + + o = DOM.get(o); + + if (!o) + return; + + // Setup event callback + cb = function(e) { + // Is all events disabled + if (t.disabled) + return; + + e = e || window.event; + + // Patch in target, preventDefault and stopPropagation in IE it's W3C valid + if (e && isIE) { + if (!e.target) + e.target = e.srcElement; + + // Patch in preventDefault, stopPropagation methods for W3C compatibility + tinymce.extend(e, t._stoppers); + } + + if (!s) + return f(e); + + return f.call(s, e); + }; + + if (n == 'unload') { + tinymce.unloads.unshift({func : cb}); + return cb; + } + + if (n == 'init') { + if (t.domLoaded) + cb(); + else + t.inits.push(cb); + + return cb; + } + + // Store away listener reference + el.push({ + obj : o, + name : n, + func : f, + cfunc : cb, + scope : s + }); + + t._add(o, n, cb); + + return f; + }, + + remove : function(o, n, f) { + var t = this, a = t.events, s = false, r; + + // Handle array + if (o && o.hasOwnProperty && o instanceof Array) { + r = []; + + each(o, function(o) { + o = DOM.get(o); + r.push(t.remove(o, n, f)); + }); + + return r; + } + + o = DOM.get(o); + + each(a, function(e, i) { + if (e.obj == o && e.name == n && (!f || (e.func == f || e.cfunc == f))) { + a.splice(i, 1); + t._remove(o, n, e.cfunc); + s = true; + return false; + } + }); + + return s; + }, + + clear : function(o) { + var t = this, a = t.events, i, e; + + if (o) { + o = DOM.get(o); + + for (i = a.length - 1; i >= 0; i--) { + e = a[i]; + + if (e.obj === o) { + t._remove(e.obj, e.name, e.cfunc); + e.obj = e.cfunc = null; + a.splice(i, 1); + } + } + } + }, + + cancel : function(e) { + if (!e) + return false; + + this.stop(e); + + return this.prevent(e); + }, + + stop : function(e) { + if (e.stopPropagation) + e.stopPropagation(); + else + e.cancelBubble = true; + + return false; + }, + + prevent : function(e) { + if (e.preventDefault) + e.preventDefault(); + else + e.returnValue = false; + + return false; + }, + + destroy : function() { + var t = this; + + each(t.events, function(e, i) { + t._remove(e.obj, e.name, e.cfunc); + e.obj = e.cfunc = null; + }); + + t.events = []; + t = null; + }, + + _add : function(o, n, f) { + if (o.attachEvent) + o.attachEvent('on' + n, f); + else if (o.addEventListener) + o.addEventListener(n, f, false); + else + o['on' + n] = f; + }, + + _remove : function(o, n, f) { + if (o) { + try { + if (o.detachEvent) + o.detachEvent('on' + n, f); + else if (o.removeEventListener) + o.removeEventListener(n, f, false); + else + o['on' + n] = null; + } catch (ex) { + // Might fail with permission denined on IE so we just ignore that + } + } + }, + + _pageInit : function(win) { + var t = this; + + // Keep it from running more than once + if (t.domLoaded) + return; + + t.domLoaded = true; + + each(t.inits, function(c) { + c(); + }); + + t.inits = []; + }, + + _wait : function(win) { + var t = this, doc = win.document; + + // No need since the document is already loaded + if (win.tinyMCE_GZ && tinyMCE_GZ.loaded) { + t.domLoaded = 1; + return; + } + + // When loaded asynchronously, the DOM Content may already be loaded + if (doc.readyState === 'complete') { + t._pageInit(win); + return; + } + + // Use IE method + if (doc.attachEvent) { + doc.attachEvent("onreadystatechange", function() { + if (doc.readyState === "complete") { + doc.detachEvent("onreadystatechange", arguments.callee); + t._pageInit(win); + } + }); + + if (doc.documentElement.doScroll && win == win.top) { + (function() { + if (t.domLoaded) + return; + + try { + // If IE is used, use the trick by Diego Perini licensed under MIT by request to the author. + // http://javascript.nwbox.com/IEContentLoaded/ + doc.documentElement.doScroll("left"); + } catch (ex) { + setTimeout(arguments.callee, 0); + return; + } + + t._pageInit(win); + })(); + } + } else if (doc.addEventListener) { + t._add(win, 'DOMContentLoaded', function() { + t._pageInit(win); + }); + } + + t._add(win, 'load', function() { + t._pageInit(win); + }); + }, + + _stoppers : { + preventDefault : function() { + this.returnValue = false; + }, + + stopPropagation : function() { + this.cancelBubble = true; + } + } + }); + + Event = tinymce.dom.Event = new tinymce.dom.EventUtils(); + + // Dispatch DOM content loaded event for IE and Safari + Event._wait(window); + + tinymce.addUnload(function() { + Event.destroy(); + }); +})(tinymce); + +(function(tinymce) { + tinymce.dom.Element = function(id, settings) { + var t = this, dom, el; + + t.settings = settings = settings || {}; + t.id = id; + t.dom = dom = settings.dom || tinymce.DOM; + + // Only IE leaks DOM references, this is a lot faster + if (!tinymce.isIE) + el = dom.get(t.id); + + tinymce.each( + ('getPos,getRect,getParent,add,setStyle,getStyle,setStyles,' + + 'setAttrib,setAttribs,getAttrib,addClass,removeClass,' + + 'hasClass,getOuterHTML,setOuterHTML,remove,show,hide,' + + 'isHidden,setHTML,get').split(/,/) + , function(k) { + t[k] = function() { + var a = [id], i; + + for (i = 0; i < arguments.length; i++) + a.push(arguments[i]); + + a = dom[k].apply(dom, a); + t.update(k); + + return a; + }; + }); + + tinymce.extend(t, { + on : function(n, f, s) { + return tinymce.dom.Event.add(t.id, n, f, s); + }, + + getXY : function() { + return { + x : parseInt(t.getStyle('left')), + y : parseInt(t.getStyle('top')) + }; + }, + + getSize : function() { + var n = dom.get(t.id); + + return { + w : parseInt(t.getStyle('width') || n.clientWidth), + h : parseInt(t.getStyle('height') || n.clientHeight) + }; + }, + + moveTo : function(x, y) { + t.setStyles({left : x, top : y}); + }, + + moveBy : function(x, y) { + var p = t.getXY(); + + t.moveTo(p.x + x, p.y + y); + }, + + resizeTo : function(w, h) { + t.setStyles({width : w, height : h}); + }, + + resizeBy : function(w, h) { + var s = t.getSize(); + + t.resizeTo(s.w + w, s.h + h); + }, + + update : function(k) { + var b; + + if (tinymce.isIE6 && settings.blocker) { + k = k || ''; + + // Ignore getters + if (k.indexOf('get') === 0 || k.indexOf('has') === 0 || k.indexOf('is') === 0) + return; + + // Remove blocker on remove + if (k == 'remove') { + dom.remove(t.blocker); + return; + } + + if (!t.blocker) { + t.blocker = dom.uniqueId(); + b = dom.add(settings.container || dom.getRoot(), 'iframe', {id : t.blocker, style : 'position:absolute;', frameBorder : 0, src : 'javascript:""'}); + dom.setStyle(b, 'opacity', 0); + } else + b = dom.get(t.blocker); + + dom.setStyles(b, { + left : t.getStyle('left', 1), + top : t.getStyle('top', 1), + width : t.getStyle('width', 1), + height : t.getStyle('height', 1), + display : t.getStyle('display', 1), + zIndex : parseInt(t.getStyle('zIndex', 1) || 0) - 1 + }); + } + } + }); + }; +})(tinymce); + +(function(tinymce) { + function trimNl(s) { + return s.replace(/[\n\r]+/g, ''); + }; + + // Shorten names + var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each; + + tinymce.create('tinymce.dom.Selection', { + Selection : function(dom, win, serializer) { + var t = this; + + t.dom = dom; + t.win = win; + t.serializer = serializer; + + // Add events + each([ + 'onBeforeSetContent', + + 'onBeforeGetContent', + + 'onSetContent', + + 'onGetContent' + ], function(e) { + t[e] = new tinymce.util.Dispatcher(t); + }); + + // No W3C Range support + if (!t.win.getSelection) + t.tridentSel = new tinymce.dom.TridentSelection(t); + + if (tinymce.isIE && dom.boxModel) + this._fixIESelection(); + + // Prevent leaks + tinymce.addUnload(t.destroy, t); + }, + + setCursorLocation: function(node, offset) { + var t = this; var r = t.dom.createRng(); + r.setStart(node, offset); + r.setEnd(node, offset); + t.setRng(r); + t.collapse(false); + }, + getContent : function(s) { + var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n; + + s = s || {}; + wb = wa = ''; + s.get = true; + s.format = s.format || 'html'; + s.forced_root_block = ''; + t.onBeforeGetContent.dispatch(t, s); + + if (s.format == 'text') + return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : '')); + + if (r.cloneContents) { + n = r.cloneContents(); + + if (n) + e.appendChild(n); + } else if (is(r.item) || is(r.htmlText)) { + // IE will produce invalid markup if elements are present that + // it doesn't understand like custom elements or HTML5 elements. + // Adding a BR in front of the contents and then remoiving it seems to fix it though. + e.innerHTML = '
    ' + (r.item ? r.item(0).outerHTML : r.htmlText); + e.removeChild(e.firstChild); + } else + e.innerHTML = r.toString(); + + // Keep whitespace before and after + if (/^\s/.test(e.innerHTML)) + wb = ' '; + + if (/\s+$/.test(e.innerHTML)) + wa = ' '; + + s.getInner = true; + + s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa; + t.onGetContent.dispatch(t, s); + + return s.content; + }, + + setContent : function(content, args) { + var self = this, rng = self.getRng(), caretNode, doc = self.win.document, frag, temp; + + args = args || {format : 'html'}; + args.set = true; + content = args.content = content; + + // Dispatch before set content event + if (!args.no_events) + self.onBeforeSetContent.dispatch(self, args); + + content = args.content; + + if (rng.insertNode) { + // Make caret marker since insertNode places the caret in the beginning of text after insert + content += '_'; + + // Delete and insert new node + if (rng.startContainer == doc && rng.endContainer == doc) { + // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents + doc.body.innerHTML = content; + } else { + rng.deleteContents(); + + if (doc.body.childNodes.length == 0) { + doc.body.innerHTML = content; + } else { + // createContextualFragment doesn't exists in IE 9 DOMRanges + if (rng.createContextualFragment) { + rng.insertNode(rng.createContextualFragment(content)); + } else { + // Fake createContextualFragment call in IE 9 + frag = doc.createDocumentFragment(); + temp = doc.createElement('div'); + + frag.appendChild(temp); + temp.outerHTML = content; + + rng.insertNode(frag); + } + } + } + + // Move to caret marker + caretNode = self.dom.get('__caret'); + + // Make sure we wrap it compleatly, Opera fails with a simple select call + rng = doc.createRange(); + rng.setStartBefore(caretNode); + rng.setEndBefore(caretNode); + self.setRng(rng); + + // Remove the caret position + self.dom.remove('__caret'); + + try { + self.setRng(rng); + } catch (ex) { + // Might fail on Opera for some odd reason + } + } else { + if (rng.item) { + // Delete content and get caret text selection + doc.execCommand('Delete', false, null); + rng = self.getRng(); + } + + // Explorer removes spaces from the beginning of pasted contents + if (/^\s+/.test(content)) { + rng.pasteHTML('_' + content); + self.dom.remove('__mce_tmp'); + } else + rng.pasteHTML(content); + } + + // Dispatch set content event + if (!args.no_events) + self.onSetContent.dispatch(self, args); + }, + + getStart : function() { + var rng = this.getRng(), startElement, parentElement, checkRng, node; + + if (rng.duplicate || rng.item) { + // Control selection, return first item + if (rng.item) + return rng.item(0); + + // Get start element + checkRng = rng.duplicate(); + checkRng.collapse(1); + startElement = checkRng.parentElement(); + + // Check if range parent is inside the start element, then return the inner parent element + // This will fix issues when a single element is selected, IE would otherwise return the wrong start element + parentElement = node = rng.parentElement(); + while (node = node.parentNode) { + if (node == startElement) { + startElement = parentElement; + break; + } + } + + return startElement; + } else { + startElement = rng.startContainer; + + if (startElement.nodeType == 1 && startElement.hasChildNodes()) + startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)]; + + if (startElement && startElement.nodeType == 3) + return startElement.parentNode; + + return startElement; + } + }, + + getEnd : function() { + var t = this, r = t.getRng(), e, eo; + + if (r.duplicate || r.item) { + if (r.item) + return r.item(0); + + r = r.duplicate(); + r.collapse(0); + e = r.parentElement(); + + if (e && e.nodeName == 'BODY') + return e.lastChild || e; + + return e; + } else { + e = r.endContainer; + eo = r.endOffset; + + if (e.nodeType == 1 && e.hasChildNodes()) + e = e.childNodes[eo > 0 ? eo - 1 : eo]; + + if (e && e.nodeType == 3) + return e.parentNode; + + return e; + } + }, + + getBookmark : function(type, normalized) { + var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, index, chr = '\uFEFF', styles; + + function findIndex(name, element) { + var index = 0; + + each(dom.select(name), function(node, i) { + if (node == element) + index = i; + }); + + return index; + }; + + if (type == 2) { + function getLocation() { + var rng = t.getRng(true), root = dom.getRoot(), bookmark = {}; + + function getPoint(rng, start) { + var container = rng[start ? 'startContainer' : 'endContainer'], + offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0; + + if (container.nodeType == 3) { + if (normalized) { + for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) + offset += node.nodeValue.length; + } + + point.push(offset); + } else { + childNodes = container.childNodes; + + if (offset >= childNodes.length && childNodes.length) { + after = 1; + offset = Math.max(0, childNodes.length - 1); + } + + point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after); + } + + for (; container && container != root; container = container.parentNode) + point.push(t.dom.nodeIndex(container, normalized)); + + return point; + }; + + bookmark.start = getPoint(rng, true); + + if (!t.isCollapsed()) + bookmark.end = getPoint(rng); + + return bookmark; + }; + + if (t.tridentSel) + return t.tridentSel.getBookmark(type); + + return getLocation(); + } + + // Handle simple range + if (type) + return {rng : t.getRng()}; + + rng = t.getRng(); + id = dom.uniqueId(); + collapsed = tinyMCE.activeEditor.selection.isCollapsed(); + styles = 'overflow:hidden;line-height:0px'; + + // Explorer method + if (rng.duplicate || rng.item) { + // Text selection + if (!rng.item) { + rng2 = rng.duplicate(); + + try { + // Insert start marker + rng.collapse(); + rng.pasteHTML('' + chr + ''); + + // Insert end marker + if (!collapsed) { + rng2.collapse(false); + + // Detect the empty space after block elements in IE and move the end back one character

    ] becomes

    ]

    + rng.moveToElementText(rng2.parentElement()); + if (rng.compareEndPoints('StartToEnd', rng2) == 0) + rng2.move('character', -1); + + rng2.pasteHTML('' + chr + ''); + } + } catch (ex) { + // IE might throw unspecified error so lets ignore it + return null; + } + } else { + // Control selection + element = rng.item(0); + name = element.nodeName; + + return {name : name, index : findIndex(name, element)}; + } + } else { + element = t.getNode(); + name = element.nodeName; + if (name == 'IMG') + return {name : name, index : findIndex(name, element)}; + + // W3C method + rng2 = rng.cloneRange(); + + // Insert end marker + if (!collapsed) { + rng2.collapse(false); + rng2.insertNode(dom.create('span', {'data-mce-type' : "bookmark", id : id + '_end', style : styles}, chr)); + } + + rng.collapse(true); + rng.insertNode(dom.create('span', {'data-mce-type' : "bookmark", id : id + '_start', style : styles}, chr)); + } + + t.moveToBookmark({id : id, keep : 1}); + + return {id : id}; + }, + + moveToBookmark : function(bookmark) { + var t = this, dom = t.dom, marker1, marker2, rng, root, startContainer, endContainer, startOffset, endOffset; + + if (bookmark) { + if (bookmark.start) { + rng = dom.createRng(); + root = dom.getRoot(); + + function setEndPoint(start) { + var point = bookmark[start ? 'start' : 'end'], i, node, offset, children; + + if (point) { + offset = point[0]; + + // Find container node + for (node = root, i = point.length - 1; i >= 1; i--) { + children = node.childNodes; + + if (point[i] > children.length - 1) + return; + + node = children[point[i]]; + } + + // Move text offset to best suitable location + if (node.nodeType === 3) + offset = Math.min(point[0], node.nodeValue.length); + + // Move element offset to best suitable location + if (node.nodeType === 1) + offset = Math.min(point[0], node.childNodes.length); + + // Set offset within container node + if (start) + rng.setStart(node, offset); + else + rng.setEnd(node, offset); + } + + return true; + }; + + if (t.tridentSel) + return t.tridentSel.moveToBookmark(bookmark); + + if (setEndPoint(true) && setEndPoint()) { + t.setRng(rng); + } + } else if (bookmark.id) { + function restoreEndPoint(suffix) { + var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep; + + if (marker) { + node = marker.parentNode; + + if (suffix == 'start') { + if (!keep) { + idx = dom.nodeIndex(marker); + } else { + node = marker.firstChild; + idx = 1; + } + + startContainer = endContainer = node; + startOffset = endOffset = idx; + } else { + if (!keep) { + idx = dom.nodeIndex(marker); + } else { + node = marker.firstChild; + idx = 1; + } + + endContainer = node; + endOffset = idx; + } + + if (!keep) { + prev = marker.previousSibling; + next = marker.nextSibling; + + // Remove all marker text nodes + each(tinymce.grep(marker.childNodes), function(node) { + if (node.nodeType == 3) + node.nodeValue = node.nodeValue.replace(/\uFEFF/g, ''); + }); + + // Remove marker but keep children if for example contents where inserted into the marker + // Also remove duplicated instances of the marker for example by a split operation or by WebKit auto split on paste feature + while (marker = dom.get(bookmark.id + '_' + suffix)) + dom.remove(marker, 1); + + // If siblings are text nodes then merge them unless it's Opera since it some how removes the node + // and we are sniffing since adding a lot of detection code for a browser with 3% of the market isn't worth the effort. Sorry, Opera but it's just a fact + if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !tinymce.isOpera) { + idx = prev.nodeValue.length; + prev.appendData(next.nodeValue); + dom.remove(next); + + if (suffix == 'start') { + startContainer = endContainer = prev; + startOffset = endOffset = idx; + } else { + endContainer = prev; + endOffset = idx; + } + } + } + } + }; + + function addBogus(node) { + // Adds a bogus BR element for empty block elements or just a space on IE since it renders BR elements incorrectly + if (dom.isBlock(node) && !node.innerHTML) + node.innerHTML = !isIE ? '
    ' : ' '; + + return node; + }; + + // Restore start/end points + restoreEndPoint('start'); + restoreEndPoint('end'); + + if (startContainer) { + rng = dom.createRng(); + rng.setStart(addBogus(startContainer), startOffset); + rng.setEnd(addBogus(endContainer), endOffset); + t.setRng(rng); + } + } else if (bookmark.name) { + t.select(dom.select(bookmark.name)[bookmark.index]); + } else if (bookmark.rng) + t.setRng(bookmark.rng); + } + }, + + select : function(node, content) { + var t = this, dom = t.dom, rng = dom.createRng(), idx; + + if (node) { + idx = dom.nodeIndex(node); + rng.setStart(node.parentNode, idx); + rng.setEnd(node.parentNode, idx + 1); + + // Find first/last text node or BR element + if (content) { + function setPoint(node, start) { + var walker = new tinymce.dom.TreeWalker(node, node); + + do { + // Text node + if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { + if (start) + rng.setStart(node, 0); + else + rng.setEnd(node, node.nodeValue.length); + + return; + } + + // BR element + if (node.nodeName == 'BR') { + if (start) + rng.setStartBefore(node); + else + rng.setEndBefore(node); + + return; + } + } while (node = (start ? walker.next() : walker.prev())); + }; + + setPoint(node, 1); + setPoint(node); + } + + t.setRng(rng); + } + + return node; + }, + + isCollapsed : function() { + var t = this, r = t.getRng(), s = t.getSel(); + + if (!r || r.item) + return false; + + if (r.compareEndPoints) + return r.compareEndPoints('StartToEnd', r) === 0; + + return !s || r.collapsed; + }, + + collapse : function(to_start) { + var self = this, rng = self.getRng(), node; + + // Control range on IE + if (rng.item) { + node = rng.item(0); + rng = self.win.document.body.createTextRange(); + rng.moveToElementText(node); + } + + rng.collapse(!!to_start); + self.setRng(rng); + }, + + getSel : function() { + var t = this, w = this.win; + + return w.getSelection ? w.getSelection() : w.document.selection; + }, + + getRng : function(w3c) { + var t = this, s, r, elm, doc = t.win.document; + + // Found tridentSel object then we need to use that one + if (w3c && t.tridentSel) + return t.tridentSel.getRangeAt(0); + + try { + if (s = t.getSel()) + r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : doc.createRange()); + } catch (ex) { + // IE throws unspecified error here if TinyMCE is placed in a frame/iframe + } + + // We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet + if (tinymce.isIE && r && r.setStart && doc.selection.createRange().item) { + elm = doc.selection.createRange().item(0); + r = doc.createRange(); + r.setStartBefore(elm); + r.setEndAfter(elm); + } + + // No range found then create an empty one + // This can occur when the editor is placed in a hidden container element on Gecko + // Or on IE when there was an exception + if (!r) + r = doc.createRange ? doc.createRange() : doc.body.createTextRange(); + + if (t.selectedRange && t.explicitRange) { + if (r.compareBoundaryPoints(r.START_TO_START, t.selectedRange) === 0 && r.compareBoundaryPoints(r.END_TO_END, t.selectedRange) === 0) { + // Safari, Opera and Chrome only ever select text which causes the range to change. + // This lets us use the originally set range if the selection hasn't been changed by the user. + r = t.explicitRange; + } else { + t.selectedRange = null; + t.explicitRange = null; + } + } + + return r; + }, + + setRng : function(r) { + var s, t = this; + + if (!t.tridentSel) { + s = t.getSel(); + + if (s) { + t.explicitRange = r; + + try { + s.removeAllRanges(); + } catch (ex) { + // IE9 might throw errors here don't know why + } + + s.addRange(r); + // adding range isn't always successful so we need to check range count otherwise an exception can occur + t.selectedRange = s.rangeCount > 0 ? s.getRangeAt(0) : null; + } + } else { + // Is W3C Range + if (r.cloneRange) { + t.tridentSel.addRange(r); + return; + } + + // Is IE specific range + try { + r.select(); + } catch (ex) { + // Needed for some odd IE bug #1843306 + } + } + }, + + setNode : function(n) { + var t = this; + + t.setContent(t.dom.getOuterHTML(n)); + + return n; + }, + + getNode : function() { + var t = this, rng = t.getRng(), sel = t.getSel(), elm, start = rng.startContainer, end = rng.endContainer; + + // Range maybe lost after the editor is made visible again + if (!rng) + return t.dom.getRoot(); + + if (rng.setStart) { + elm = rng.commonAncestorContainer; + + // Handle selection a image or other control like element such as anchors + if (!rng.collapsed) { + if (rng.startContainer == rng.endContainer) { + if (rng.endOffset - rng.startOffset < 2) { + if (rng.startContainer.hasChildNodes()) + elm = rng.startContainer.childNodes[rng.startOffset]; + } + } + + // If the anchor node is a element instead of a text node then return this element + //if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1) + // return sel.anchorNode.childNodes[sel.anchorOffset]; + + // Handle cases where the selection is immediately wrapped around a node and return that node instead of it's parent. + // This happens when you double click an underlined word in FireFox. + if (start.nodeType === 3 && end.nodeType === 3) { + function skipEmptyTextNodes(n, forwards) { + var orig = n; + while (n && n.nodeType === 3 && n.length === 0) { + n = forwards ? n.nextSibling : n.previousSibling; + } + return n || orig; + } + if (start.length === rng.startOffset) { + start = skipEmptyTextNodes(start.nextSibling, true); + } else { + start = start.parentNode; + } + if (rng.endOffset === 0) { + end = skipEmptyTextNodes(end.previousSibling, false); + } else { + end = end.parentNode; + } + + if (start && start === end) + return start; + } + } + + if (elm && elm.nodeType == 3) + return elm.parentNode; + + return elm; + } + + return rng.item ? rng.item(0) : rng.parentElement(); + }, + + getSelectedBlocks : function(st, en) { + var t = this, dom = t.dom, sb, eb, n, bl = []; + + sb = dom.getParent(st || t.getStart(), dom.isBlock); + eb = dom.getParent(en || t.getEnd(), dom.isBlock); + + if (sb) + bl.push(sb); + + if (sb && eb && sb != eb) { + n = sb; + + var walker = new tinymce.dom.TreeWalker(sb, dom.getRoot()); + while ((n = walker.next()) && n != eb) { + if (dom.isBlock(n)) + bl.push(n); + } + } + + if (eb && sb != eb) + bl.push(eb); + + return bl; + }, + + normalize : function() { + var self = this, rng, normalized; + + // TODO: + // Retain selection direction. + // Lean left/right on Gecko for inline elements. + // Run this on mouse up/key up when the user manually moves the selection + + // Normalize only on non IE browsers for now + if (tinymce.isIE) + return; + + function normalizeEndPoint(start) { + var container, offset, walker, dom = self.dom, body = dom.getRoot(), node; + + container = rng[(start ? 'start' : 'end') + 'Container']; + offset = rng[(start ? 'start' : 'end') + 'Offset']; + + // If the container is a document move it to the body element + if (container.nodeType === 9) { + container = container.body; + offset = 0; + } + + // If the container is body try move it into the closest text node or position + // TODO: Add more logic here to handle element selection cases + if (container === body) { + // Resolve the index + if (container.hasChildNodes()) { + container = container.childNodes[Math.min(!start && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1)]; + offset = 0; + + // Don't walk into elements that doesn't have any child nodes like a IMG + if (container.hasChildNodes()) { + // Walk the DOM to find a text node to place the caret at or a BR + node = container; + walker = new tinymce.dom.TreeWalker(container, body); + do { + // Found a text node use that position + if (node.nodeType === 3) { + offset = start ? 0 : node.nodeValue.length - 1; + container = node; + normalized = true; + break; + } + + // Found a BR/IMG element that we can place the caret before + if (/^(BR|IMG)$/.test(node.nodeName)) { + offset = dom.nodeIndex(node); + container = node.parentNode; + + // Put caret after image when moving the end point + if (node.nodeName == "IMG" && !start) { + offset++; + } + + normalized = true; + break; + } + } while (node = (start ? walker.next() : walker.prev())); + } + } + } + + // Set endpoint if it was normalized + if (normalized) + rng['set' + (start ? 'Start' : 'End')](container, offset); + }; + + rng = self.getRng(); + + // Normalize the end points + normalizeEndPoint(true); + + if (!rng.collapsed) + normalizeEndPoint(); + + // Set the selection if it was normalized + if (normalized) { + //console.log(self.dom.dumpRng(rng)); + self.setRng(rng); + } + }, + + destroy : function(s) { + var t = this; + + t.win = null; + + // Manual destroy then remove unload handler + if (!s) + tinymce.removeUnload(t.destroy); + }, + + // IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode + _fixIESelection : function() { + var dom = this.dom, doc = dom.doc, body = doc.body, started, startRng, htmlElm; + + // Make HTML element unselectable since we are going to handle selection by hand + doc.documentElement.unselectable = true; + + // Return range from point or null if it failed + function rngFromPoint(x, y) { + var rng = body.createTextRange(); + + try { + rng.moveToPoint(x, y); + } catch (ex) { + // IE sometimes throws and exception, so lets just ignore it + rng = null; + } + + return rng; + }; + + // Fires while the selection is changing + function selectionChange(e) { + var pointRng; + + // Check if the button is down or not + if (e.button) { + // Create range from mouse position + pointRng = rngFromPoint(e.x, e.y); + + if (pointRng) { + // Check if pointRange is before/after selection then change the endPoint + if (pointRng.compareEndPoints('StartToStart', startRng) > 0) + pointRng.setEndPoint('StartToStart', startRng); + else + pointRng.setEndPoint('EndToEnd', startRng); + + pointRng.select(); + } + } else + endSelection(); + } + + // Removes listeners + function endSelection() { + var rng = doc.selection.createRange(); + + // If the range is collapsed then use the last start range + if (startRng && !rng.item && rng.compareEndPoints('StartToEnd', rng) === 0) + startRng.select(); + + dom.unbind(doc, 'mouseup', endSelection); + dom.unbind(doc, 'mousemove', selectionChange); + startRng = started = 0; + }; + + // Detect when user selects outside BODY + dom.bind(doc, ['mousedown', 'contextmenu'], function(e) { + if (e.target.nodeName === 'HTML') { + if (started) + endSelection(); + + // Detect vertical scrollbar, since IE will fire a mousedown on the scrollbar and have target set as HTML + htmlElm = doc.documentElement; + if (htmlElm.scrollHeight > htmlElm.clientHeight) + return; + + started = 1; + // Setup start position + startRng = rngFromPoint(e.x, e.y); + if (startRng) { + // Listen for selection change events + dom.bind(doc, 'mouseup', endSelection); + dom.bind(doc, 'mousemove', selectionChange); + + dom.win.focus(); + startRng.select(); + } + } + }); + } + }); +})(tinymce); + +(function(tinymce) { + tinymce.dom.Serializer = function(settings, dom, schema) { + var onPreProcess, onPostProcess, isIE = tinymce.isIE, each = tinymce.each, htmlParser; + + // Support the old apply_source_formatting option + if (!settings.apply_source_formatting) + settings.indent = false; + + // Default DOM and Schema if they are undefined + dom = dom || tinymce.DOM; + schema = schema || new tinymce.html.Schema(settings); + settings.entity_encoding = settings.entity_encoding || 'named'; + settings.remove_trailing_brs = "remove_trailing_brs" in settings ? settings.remove_trailing_brs : true; + + onPreProcess = new tinymce.util.Dispatcher(self); + + onPostProcess = new tinymce.util.Dispatcher(self); + + htmlParser = new tinymce.html.DomParser(settings, schema); + + // Convert move data-mce-src, data-mce-href and data-mce-style into nodes or process them if needed + htmlParser.addAttributeFilter('src,href,style', function(nodes, name) { + var i = nodes.length, node, value, internalName = 'data-mce-' + name, urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope, undef; + + while (i--) { + node = nodes[i]; + + value = node.attributes.map[internalName]; + if (value !== undef) { + // Set external name to internal value and remove internal + node.attr(name, value.length > 0 ? value : null); + node.attr(internalName, null); + } else { + // No internal attribute found then convert the value we have in the DOM + value = node.attributes.map[name]; + + if (name === "style") + value = dom.serializeStyle(dom.parseStyle(value), node.name); + else if (urlConverter) + value = urlConverter.call(urlConverterScope, value, name, node.name); + + node.attr(name, value.length > 0 ? value : null); + } + } + }); + + // Remove internal classes mceItem<..> + htmlParser.addAttributeFilter('class', function(nodes, name) { + var i = nodes.length, node, value; + + while (i--) { + node = nodes[i]; + value = node.attr('class').replace(/\s*mce(Item\w+|Selected)\s*/g, ''); + node.attr('class', value.length > 0 ? value : null); + } + }); + + // Remove bookmark elements + htmlParser.addAttributeFilter('data-mce-type', function(nodes, name, args) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + + if (node.attributes.map['data-mce-type'] === 'bookmark' && !args.cleanup) + node.remove(); + } + }); + + // Force script into CDATA sections and remove the mce- prefix also add comments around styles + htmlParser.addNodeFilter('script,style', function(nodes, name) { + var i = nodes.length, node, value; + + function trim(value) { + return value.replace(/()/g, '\n') + .replace(/^[\r\n]*|[\r\n]*$/g, '') + .replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g, ''); + }; + + while (i--) { + node = nodes[i]; + value = node.firstChild ? node.firstChild.value : ''; + + if (name === "script") { + // Remove mce- prefix from script elements + node.attr('type', (node.attr('type') || 'text/javascript').replace(/^mce\-/, '')); + + if (value.length > 0) + node.firstChild.value = '// '; + } else { + if (value.length > 0) + node.firstChild.value = ''; + } + } + }); + + // Convert comments to cdata and handle protected comments + htmlParser.addNodeFilter('#comment', function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + + if (node.value.indexOf('[CDATA[') === 0) { + node.name = '#cdata'; + node.type = 4; + node.value = node.value.replace(/^\[CDATA\[|\]\]$/g, ''); + } else if (node.value.indexOf('mce:protected ') === 0) { + node.name = "#text"; + node.type = 3; + node.raw = true; + node.value = unescape(node.value).substr(14); + } + } + }); + + htmlParser.addNodeFilter('xml:namespace,input', function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + if (node.type === 7) + node.remove(); + else if (node.type === 1) { + if (name === "input" && !("type" in node.attributes.map)) + node.attr('type', 'text'); + } + } + }); + + // Fix list elements, TODO: Replace this later + if (settings.fix_list_elements) { + htmlParser.addNodeFilter('ul,ol', function(nodes, name) { + var i = nodes.length, node, parentNode; + + while (i--) { + node = nodes[i]; + parentNode = node.parent; + + if (parentNode.name === 'ul' || parentNode.name === 'ol') { + if (node.prev && node.prev.name === 'li') { + node.prev.append(node); + } + } + } + }); + } + + // Remove internal data attributes + htmlParser.addAttributeFilter('data-mce-src,data-mce-href,data-mce-style', function(nodes, name) { + var i = nodes.length; + + while (i--) { + nodes[i].attr(name, null); + } + }); + + // Return public methods + return { + schema : schema, + + addNodeFilter : htmlParser.addNodeFilter, + + addAttributeFilter : htmlParser.addAttributeFilter, + + onPreProcess : onPreProcess, + + onPostProcess : onPostProcess, + + serialize : function(node, args) { + var impl, doc, oldDoc, htmlSerializer, content; + + // Explorer won't clone contents of script and style and the + // selected index of select elements are cleared on a clone operation. + if (isIE && dom.select('script,style,select,map').length > 0) { + content = node.innerHTML; + node = node.cloneNode(false); + dom.setHTML(node, content); + } else + node = node.cloneNode(true); + + // Nodes needs to be attached to something in WebKit/Opera + // Older builds of Opera crashes if you attach the node to an document created dynamically + // and since we can't feature detect a crash we need to sniff the acutal build number + // This fix will make DOM ranges and make Sizzle happy! + impl = node.ownerDocument.implementation; + if (impl.createHTMLDocument) { + // Create an empty HTML document + doc = impl.createHTMLDocument(""); + + // Add the element or it's children if it's a body element to the new document + each(node.nodeName == 'BODY' ? node.childNodes : [node], function(node) { + doc.body.appendChild(doc.importNode(node, true)); + }); + + // Grab first child or body element for serialization + if (node.nodeName != 'BODY') + node = doc.body.firstChild; + else + node = doc.body; + + // set the new document in DOMUtils so createElement etc works + oldDoc = dom.doc; + dom.doc = doc; + } + + args = args || {}; + args.format = args.format || 'html'; + + // Pre process + if (!args.no_events) { + args.node = node; + onPreProcess.dispatch(self, args); + } + + // Setup serializer + htmlSerializer = new tinymce.html.Serializer(settings, schema); + + // Parse and serialize HTML + args.content = htmlSerializer.serialize( + htmlParser.parse(args.getInner ? node.innerHTML : tinymce.trim(dom.getOuterHTML(node), args), args) + ); + + // Replace all BOM characters for now until we can find a better solution + if (!args.cleanup) + args.content = args.content.replace(/\uFEFF|\u200B/g, ''); + + // Post process + if (!args.no_events) + onPostProcess.dispatch(self, args); + + // Restore the old document if it was changed + if (oldDoc) + dom.doc = oldDoc; + + args.node = null; + + return args.content; + }, + + addRules : function(rules) { + schema.addValidElements(rules); + }, + + setRules : function(rules) { + schema.setValidElements(rules); + } + }; + }; +})(tinymce); +(function(tinymce) { + tinymce.dom.ScriptLoader = function(settings) { + var QUEUED = 0, + LOADING = 1, + LOADED = 2, + states = {}, + queue = [], + scriptLoadedCallbacks = {}, + queueLoadedCallbacks = [], + loading = 0, + undefined; + + function loadScript(url, callback) { + var t = this, dom = tinymce.DOM, elm, uri, loc, id; + + // Execute callback when script is loaded + function done() { + dom.remove(id); + + if (elm) + elm.onreadystatechange = elm.onload = elm = null; + + callback(); + }; + + function error() { + // Report the error so it's easier for people to spot loading errors + if (typeof(console) !== "undefined" && console.log) + console.log("Failed to load: " + url); + + // We can't mark it as done if there is a load error since + // A) We don't want to produce 404 errors on the server and + // B) the onerror event won't fire on all browsers. + // done(); + }; + + id = dom.uniqueId(); + + if (tinymce.isIE6) { + uri = new tinymce.util.URI(url); + loc = location; + + // If script is from same domain and we + // use IE 6 then use XHR since it's more reliable + if (uri.host == loc.hostname && uri.port == loc.port && (uri.protocol + ':') == loc.protocol && uri.protocol.toLowerCase() != 'file') { + tinymce.util.XHR.send({ + url : tinymce._addVer(uri.getURI()), + success : function(content) { + // Create new temp script element + var script = dom.create('script', { + type : 'text/javascript' + }); + + // Evaluate script in global scope + script.text = content; + document.getElementsByTagName('head')[0].appendChild(script); + dom.remove(script); + + done(); + }, + + error : error + }); + + return; + } + } + + // Create new script element + elm = dom.create('script', { + id : id, + type : 'text/javascript', + src : tinymce._addVer(url) + }); + + // Add onload listener for non IE browsers since IE9 + // fires onload event before the script is parsed and executed + if (!tinymce.isIE) + elm.onload = done; + + // Add onerror event will get fired on some browsers but not all of them + elm.onerror = error; + + // Opera 9.60 doesn't seem to fire the onreadystate event at correctly + if (!tinymce.isOpera) { + elm.onreadystatechange = function() { + var state = elm.readyState; + + // Loaded state is passed on IE 6 however there + // are known issues with this method but we can't use + // XHR in a cross domain loading + if (state == 'complete' || state == 'loaded') + done(); + }; + } + + // Most browsers support this feature so we report errors + // for those at least to help users track their missing plugins etc + // todo: Removed since it produced error if the document is unloaded by navigating away, re-add it as an option + /*elm.onerror = function() { + alert('Failed to load: ' + url); + };*/ + + // Add script to document + (document.getElementsByTagName('head')[0] || document.body).appendChild(elm); + }; + + this.isDone = function(url) { + return states[url] == LOADED; + }; + + this.markDone = function(url) { + states[url] = LOADED; + }; + + this.add = this.load = function(url, callback, scope) { + var item, state = states[url]; + + // Add url to load queue + if (state == undefined) { + queue.push(url); + states[url] = QUEUED; + } + + if (callback) { + // Store away callback for later execution + if (!scriptLoadedCallbacks[url]) + scriptLoadedCallbacks[url] = []; + + scriptLoadedCallbacks[url].push({ + func : callback, + scope : scope || this + }); + } + }; + + this.loadQueue = function(callback, scope) { + this.loadScripts(queue, callback, scope); + }; + + this.loadScripts = function(scripts, callback, scope) { + var loadScripts; + + function execScriptLoadedCallbacks(url) { + // Execute URL callback functions + tinymce.each(scriptLoadedCallbacks[url], function(callback) { + callback.func.call(callback.scope); + }); + + scriptLoadedCallbacks[url] = undefined; + }; + + queueLoadedCallbacks.push({ + func : callback, + scope : scope || this + }); + + loadScripts = function() { + var loadingScripts = tinymce.grep(scripts); + + // Current scripts has been handled + scripts.length = 0; + + // Load scripts that needs to be loaded + tinymce.each(loadingScripts, function(url) { + // Script is already loaded then execute script callbacks directly + if (states[url] == LOADED) { + execScriptLoadedCallbacks(url); + return; + } + + // Is script not loading then start loading it + if (states[url] != LOADING) { + states[url] = LOADING; + loading++; + + loadScript(url, function() { + states[url] = LOADED; + loading--; + + execScriptLoadedCallbacks(url); + + // Load more scripts if they where added by the recently loaded script + loadScripts(); + }); + } + }); + + // No scripts are currently loading then execute all pending queue loaded callbacks + if (!loading) { + tinymce.each(queueLoadedCallbacks, function(callback) { + callback.func.call(callback.scope); + }); + + queueLoadedCallbacks.length = 0; + } + }; + + loadScripts(); + }; + }; + + // Global script loader + tinymce.ScriptLoader = new tinymce.dom.ScriptLoader(); +})(tinymce); + +tinymce.dom.TreeWalker = function(start_node, root_node) { + var node = start_node; + + function findSibling(node, start_name, sibling_name, shallow) { + var sibling, parent; + + if (node) { + // Walk into nodes if it has a start + if (!shallow && node[start_name]) + return node[start_name]; + + // Return the sibling if it has one + if (node != root_node) { + sibling = node[sibling_name]; + if (sibling) + return sibling; + + // Walk up the parents to look for siblings + for (parent = node.parentNode; parent && parent != root_node; parent = parent.parentNode) { + sibling = parent[sibling_name]; + if (sibling) + return sibling; + } + } + } + }; + + this.current = function() { + return node; + }; + + this.next = function(shallow) { + return (node = findSibling(node, 'firstChild', 'nextSibling', shallow)); + }; + + this.prev = function(shallow) { + return (node = findSibling(node, 'lastChild', 'previousSibling', shallow)); + }; +}; + +(function(tinymce) { + tinymce.dom.RangeUtils = function(dom) { + var INVISIBLE_CHAR = '\uFEFF'; + + this.walk = function(rng, callback) { + var startContainer = rng.startContainer, + startOffset = rng.startOffset, + endContainer = rng.endContainer, + endOffset = rng.endOffset, + ancestor, startPoint, + endPoint, node, parent, siblings, nodes; + + // Handle table cell selection the table plugin enables + // you to fake select table cells and perform formatting actions on them + nodes = dom.select('td.mceSelected,th.mceSelected'); + if (nodes.length > 0) { + tinymce.each(nodes, function(node) { + callback([node]); + }); + + return; + } + + function exclude(nodes) { + var node; + + // First node is excluded + node = nodes[0]; + if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) { + nodes.splice(0, 1); + } + + // Last node is excluded + node = nodes[nodes.length - 1]; + if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) { + nodes.splice(nodes.length - 1, 1); + } + + return nodes; + }; + + function collectSiblings(node, name, end_node) { + var siblings = []; + + for (; node && node != end_node; node = node[name]) + siblings.push(node); + + return siblings; + }; + + function findEndPoint(node, root) { + do { + if (node.parentNode == root) + return node; + + node = node.parentNode; + } while(node); + }; + + function walkBoundary(start_node, end_node, next) { + var siblingName = next ? 'nextSibling' : 'previousSibling'; + + for (node = start_node, parent = node.parentNode; node && node != end_node; node = parent) { + parent = node.parentNode; + siblings = collectSiblings(node == start_node ? node : node[siblingName], siblingName); + + if (siblings.length) { + if (!next) + siblings.reverse(); + + callback(exclude(siblings)); + } + } + }; + + // If index based start position then resolve it + if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) + startContainer = startContainer.childNodes[startOffset]; + + // If index based end position then resolve it + if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) + endContainer = endContainer.childNodes[Math.min(endOffset - 1, endContainer.childNodes.length - 1)]; + + // Same container + if (startContainer == endContainer) + return callback(exclude([startContainer])); + + // Find common ancestor and end points + ancestor = dom.findCommonAncestor(startContainer, endContainer); + + // Process left side + for (node = startContainer; node; node = node.parentNode) { + if (node === endContainer) + return walkBoundary(startContainer, ancestor, true); + + if (node === ancestor) + break; + } + + // Process right side + for (node = endContainer; node; node = node.parentNode) { + if (node === startContainer) + return walkBoundary(endContainer, ancestor); + + if (node === ancestor) + break; + } + + // Find start/end point + startPoint = findEndPoint(startContainer, ancestor) || startContainer; + endPoint = findEndPoint(endContainer, ancestor) || endContainer; + + // Walk left leaf + walkBoundary(startContainer, startPoint, true); + + // Walk the middle from start to end point + siblings = collectSiblings( + startPoint == startContainer ? startPoint : startPoint.nextSibling, + 'nextSibling', + endPoint == endContainer ? endPoint.nextSibling : endPoint + ); + + if (siblings.length) + callback(exclude(siblings)); + + // Walk right leaf + walkBoundary(endContainer, endPoint); + }; + + this.split = function(rng) { + var startContainer = rng.startContainer, + startOffset = rng.startOffset, + endContainer = rng.endContainer, + endOffset = rng.endOffset; + + function splitText(node, offset) { + return node.splitText(offset); + }; + + // Handle single text node + if (startContainer == endContainer && startContainer.nodeType == 3) { + if (startOffset > 0 && startOffset < startContainer.nodeValue.length) { + endContainer = splitText(startContainer, startOffset); + startContainer = endContainer.previousSibling; + + if (endOffset > startOffset) { + endOffset = endOffset - startOffset; + startContainer = endContainer = splitText(endContainer, endOffset).previousSibling; + endOffset = endContainer.nodeValue.length; + startOffset = 0; + } else { + endOffset = 0; + } + } + } else { + // Split startContainer text node if needed + if (startContainer.nodeType == 3 && startOffset > 0 && startOffset < startContainer.nodeValue.length) { + startContainer = splitText(startContainer, startOffset); + startOffset = 0; + } + + // Split endContainer text node if needed + if (endContainer.nodeType == 3 && endOffset > 0 && endOffset < endContainer.nodeValue.length) { + endContainer = splitText(endContainer, endOffset).previousSibling; + endOffset = endContainer.nodeValue.length; + } + } + + return { + startContainer : startContainer, + startOffset : startOffset, + endContainer : endContainer, + endOffset : endOffset + }; + }; + + }; + + tinymce.dom.RangeUtils.compareRanges = function(rng1, rng2) { + if (rng1 && rng2) { + // Compare native IE ranges + if (rng1.item || rng1.duplicate) { + // Both are control ranges and the selected element matches + if (rng1.item && rng2.item && rng1.item(0) === rng2.item(0)) + return true; + + // Both are text ranges and the range matches + if (rng1.isEqual && rng2.isEqual && rng2.isEqual(rng1)) + return true; + } else { + // Compare w3c ranges + return rng1.startContainer == rng2.startContainer && rng1.startOffset == rng2.startOffset; + } + } + + return false; + }; +})(tinymce); + +(function(tinymce) { + var Event = tinymce.dom.Event, each = tinymce.each; + + tinymce.create('tinymce.ui.KeyboardNavigation', { + KeyboardNavigation: function(settings, dom) { + var t = this, root = settings.root, items = settings.items, + enableUpDown = settings.enableUpDown, enableLeftRight = settings.enableLeftRight || !settings.enableUpDown, + excludeFromTabOrder = settings.excludeFromTabOrder, + itemFocussed, itemBlurred, rootKeydown, rootFocussed, focussedId; + + dom = dom || tinymce.DOM; + + itemFocussed = function(evt) { + focussedId = evt.target.id; + }; + + itemBlurred = function(evt) { + dom.setAttrib(evt.target.id, 'tabindex', '-1'); + }; + + rootFocussed = function(evt) { + var item = dom.get(focussedId); + dom.setAttrib(item, 'tabindex', '0'); + item.focus(); + }; + + t.focus = function() { + dom.get(focussedId).focus(); + }; + + t.destroy = function() { + each(items, function(item) { + dom.unbind(dom.get(item.id), 'focus', itemFocussed); + dom.unbind(dom.get(item.id), 'blur', itemBlurred); + }); + + dom.unbind(dom.get(root), 'focus', rootFocussed); + dom.unbind(dom.get(root), 'keydown', rootKeydown); + + items = dom = root = t.focus = itemFocussed = itemBlurred = rootKeydown = rootFocussed = null; + t.destroy = function() {}; + }; + + t.moveFocus = function(dir, evt) { + var idx = -1, controls = t.controls, newFocus; + + if (!focussedId) + return; + + each(items, function(item, index) { + if (item.id === focussedId) { + idx = index; + return false; + } + }); + + idx += dir; + if (idx < 0) { + idx = items.length - 1; + } else if (idx >= items.length) { + idx = 0; + } + + newFocus = items[idx]; + dom.setAttrib(focussedId, 'tabindex', '-1'); + dom.setAttrib(newFocus.id, 'tabindex', '0'); + dom.get(newFocus.id).focus(); + + if (settings.actOnFocus) { + settings.onAction(newFocus.id); + } + + if (evt) + Event.cancel(evt); + }; + + rootKeydown = function(evt) { + var DOM_VK_LEFT = 37, DOM_VK_RIGHT = 39, DOM_VK_UP = 38, DOM_VK_DOWN = 40, DOM_VK_ESCAPE = 27, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_SPACE = 32; + + switch (evt.keyCode) { + case DOM_VK_LEFT: + if (enableLeftRight) t.moveFocus(-1); + break; + + case DOM_VK_RIGHT: + if (enableLeftRight) t.moveFocus(1); + break; + + case DOM_VK_UP: + if (enableUpDown) t.moveFocus(-1); + break; + + case DOM_VK_DOWN: + if (enableUpDown) t.moveFocus(1); + break; + + case DOM_VK_ESCAPE: + if (settings.onCancel) { + settings.onCancel(); + Event.cancel(evt); + } + break; + + case DOM_VK_ENTER: + case DOM_VK_RETURN: + case DOM_VK_SPACE: + if (settings.onAction) { + settings.onAction(focussedId); + Event.cancel(evt); + } + break; + } + }; + + // Set up state and listeners for each item. + each(items, function(item, idx) { + var tabindex; + + if (!item.id) { + item.id = dom.uniqueId('_mce_item_'); + } + + if (excludeFromTabOrder) { + dom.bind(item.id, 'blur', itemBlurred); + tabindex = '-1'; + } else { + tabindex = (idx === 0 ? '0' : '-1'); + } + + dom.setAttrib(item.id, 'tabindex', tabindex); + dom.bind(dom.get(item.id), 'focus', itemFocussed); + }); + + // Setup initial state for root element. + if (items[0]){ + focussedId = items[0].id; + } + + dom.setAttrib(root, 'tabindex', '-1'); + + // Setup listeners for root element. + dom.bind(dom.get(root), 'focus', rootFocussed); + dom.bind(dom.get(root), 'keydown', rootKeydown); + } + }); +})(tinymce); + +(function(tinymce) { + // Shorten class names + var DOM = tinymce.DOM, is = tinymce.is; + + tinymce.create('tinymce.ui.Control', { + Control : function(id, s, editor) { + this.id = id; + this.settings = s = s || {}; + this.rendered = false; + this.onRender = new tinymce.util.Dispatcher(this); + this.classPrefix = ''; + this.scope = s.scope || this; + this.disabled = 0; + this.active = 0; + this.editor = editor; + }, + + setAriaProperty : function(property, value) { + var element = DOM.get(this.id + '_aria') || DOM.get(this.id); + if (element) { + DOM.setAttrib(element, 'aria-' + property, !!value); + } + }, + + focus : function() { + DOM.get(this.id).focus(); + }, + + setDisabled : function(s) { + if (s != this.disabled) { + this.setAriaProperty('disabled', s); + + this.setState('Disabled', s); + this.setState('Enabled', !s); + this.disabled = s; + } + }, + + isDisabled : function() { + return this.disabled; + }, + + setActive : function(s) { + if (s != this.active) { + this.setState('Active', s); + this.active = s; + this.setAriaProperty('pressed', s); + } + }, + + isActive : function() { + return this.active; + }, + + setState : function(c, s) { + var n = DOM.get(this.id); + + c = this.classPrefix + c; + + if (s) + DOM.addClass(n, c); + else + DOM.removeClass(n, c); + }, + + isRendered : function() { + return this.rendered; + }, + + renderHTML : function() { + }, + + renderTo : function(n) { + DOM.setHTML(n, this.renderHTML()); + }, + + postRender : function() { + var t = this, b; + + // Set pending states + if (is(t.disabled)) { + b = t.disabled; + t.disabled = -1; + t.setDisabled(b); + } + + if (is(t.active)) { + b = t.active; + t.active = -1; + t.setActive(b); + } + }, + + remove : function() { + DOM.remove(this.id); + this.destroy(); + }, + + destroy : function() { + tinymce.dom.Event.clear(this.id); + } + }); +})(tinymce); +tinymce.create('tinymce.ui.Container:tinymce.ui.Control', { + Container : function(id, s, editor) { + this.parent(id, s, editor); + + this.controls = []; + + this.lookup = {}; + }, + + add : function(c) { + this.lookup[c.id] = c; + this.controls.push(c); + + return c; + }, + + get : function(n) { + return this.lookup[n]; + } +}); + + +tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { + Separator : function(id, s) { + this.parent(id, s); + this.classPrefix = 'mceSeparator'; + this.setDisabled(true); + }, + + renderHTML : function() { + return tinymce.DOM.createHTML('span', {'class' : this.classPrefix, role : 'separator', 'aria-orientation' : 'vertical', tabindex : '-1'}); + } +}); + +(function(tinymce) { + var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk; + + tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control', { + MenuItem : function(id, s) { + this.parent(id, s); + this.classPrefix = 'mceMenuItem'; + }, + + setSelected : function(s) { + this.setState('Selected', s); + this.setAriaProperty('checked', !!s); + this.selected = s; + }, + + isSelected : function() { + return this.selected; + }, + + postRender : function() { + var t = this; + + t.parent(); + + // Set pending state + if (is(t.selected)) + t.setSelected(t.selected); + } + }); +})(tinymce); + +(function(tinymce) { + var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk; + + tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem', { + Menu : function(id, s) { + var t = this; + + t.parent(id, s); + t.items = {}; + t.collapsed = false; + t.menuCount = 0; + t.onAddItem = new tinymce.util.Dispatcher(this); + }, + + expand : function(d) { + var t = this; + + if (d) { + walk(t, function(o) { + if (o.expand) + o.expand(); + }, 'items', t); + } + + t.collapsed = false; + }, + + collapse : function(d) { + var t = this; + + if (d) { + walk(t, function(o) { + if (o.collapse) + o.collapse(); + }, 'items', t); + } + + t.collapsed = true; + }, + + isCollapsed : function() { + return this.collapsed; + }, + + add : function(o) { + if (!o.settings) + o = new tinymce.ui.MenuItem(o.id || DOM.uniqueId(), o); + + this.onAddItem.dispatch(this, o); + + return this.items[o.id] = o; + }, + + addSeparator : function() { + return this.add({separator : true}); + }, + + addMenu : function(o) { + if (!o.collapse) + o = this.createMenu(o); + + this.menuCount++; + + return this.add(o); + }, + + hasMenus : function() { + return this.menuCount !== 0; + }, + + remove : function(o) { + delete this.items[o.id]; + }, + + removeAll : function() { + var t = this; + + walk(t, function(o) { + if (o.removeAll) + o.removeAll(); + else + o.remove(); + + o.destroy(); + }, 'items', t); + + t.items = {}; + }, + + createMenu : function(o) { + var m = new tinymce.ui.Menu(o.id || DOM.uniqueId(), o); + + m.onAddItem.add(this.onAddItem.dispatch, this.onAddItem); + + return m; + } + }); +})(tinymce); +(function(tinymce) { + var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event, Element = tinymce.dom.Element; + + tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu', { + DropMenu : function(id, s) { + s = s || {}; + s.container = s.container || DOM.doc.body; + s.offset_x = s.offset_x || 0; + s.offset_y = s.offset_y || 0; + s.vp_offset_x = s.vp_offset_x || 0; + s.vp_offset_y = s.vp_offset_y || 0; + + if (is(s.icons) && !s.icons) + s['class'] += ' mceNoIcons'; + + this.parent(id, s); + this.onShowMenu = new tinymce.util.Dispatcher(this); + this.onHideMenu = new tinymce.util.Dispatcher(this); + this.classPrefix = 'mceMenu'; + }, + + createMenu : function(s) { + var t = this, cs = t.settings, m; + + s.container = s.container || cs.container; + s.parent = t; + s.constrain = s.constrain || cs.constrain; + s['class'] = s['class'] || cs['class']; + s.vp_offset_x = s.vp_offset_x || cs.vp_offset_x; + s.vp_offset_y = s.vp_offset_y || cs.vp_offset_y; + s.keyboard_focus = cs.keyboard_focus; + m = new tinymce.ui.DropMenu(s.id || DOM.uniqueId(), s); + + m.onAddItem.add(t.onAddItem.dispatch, t.onAddItem); + + return m; + }, + + focus : function() { + var t = this; + if (t.keyboardNav) { + t.keyboardNav.focus(); + } + }, + + update : function() { + var t = this, s = t.settings, tb = DOM.get('menu_' + t.id + '_tbl'), co = DOM.get('menu_' + t.id + '_co'), tw, th; + + tw = s.max_width ? Math.min(tb.clientWidth, s.max_width) : tb.clientWidth; + th = s.max_height ? Math.min(tb.clientHeight, s.max_height) : tb.clientHeight; + + if (!DOM.boxModel) + t.element.setStyles({width : tw + 2, height : th + 2}); + else + t.element.setStyles({width : tw, height : th}); + + if (s.max_width) + DOM.setStyle(co, 'width', tw); + + if (s.max_height) { + DOM.setStyle(co, 'height', th); + + if (tb.clientHeight < s.max_height) + DOM.setStyle(co, 'overflow', 'hidden'); + } + }, + + showMenu : function(x, y, px) { + var t = this, s = t.settings, co, vp = DOM.getViewPort(), w, h, mx, my, ot = 2, dm, tb, cp = t.classPrefix; + + t.collapse(1); + + if (t.isMenuVisible) + return; + + if (!t.rendered) { + co = DOM.add(t.settings.container, t.renderNode()); + + each(t.items, function(o) { + o.postRender(); + }); + + t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container}); + } else + co = DOM.get('menu_' + t.id); + + // Move layer out of sight unless it's Opera since it scrolls to top of page due to an bug + if (!tinymce.isOpera) + DOM.setStyles(co, {left : -0xFFFF , top : -0xFFFF}); + + DOM.show(co); + t.update(); + + x += s.offset_x || 0; + y += s.offset_y || 0; + vp.w -= 4; + vp.h -= 4; + + // Move inside viewport if not submenu + if (s.constrain) { + w = co.clientWidth - ot; + h = co.clientHeight - ot; + mx = vp.x + vp.w; + my = vp.y + vp.h; + + if ((x + s.vp_offset_x + w) > mx) + x = px ? px - w : Math.max(0, (mx - s.vp_offset_x) - w); + + if ((y + s.vp_offset_y + h) > my) + y = Math.max(0, (my - s.vp_offset_y) - h); + } + + DOM.setStyles(co, {left : x , top : y}); + t.element.update(); + + t.isMenuVisible = 1; + t.mouseClickFunc = Event.add(co, 'click', function(e) { + var m; + + e = e.target; + + if (e && (e = DOM.getParent(e, 'tr')) && !DOM.hasClass(e, cp + 'ItemSub')) { + m = t.items[e.id]; + + if (m.isDisabled()) + return; + + dm = t; + + while (dm) { + if (dm.hideMenu) + dm.hideMenu(); + + dm = dm.settings.parent; + } + + if (m.settings.onclick) + m.settings.onclick(e); + + return Event.cancel(e); // Cancel to fix onbeforeunload problem + } + }); + + if (t.hasMenus()) { + t.mouseOverFunc = Event.add(co, 'mouseover', function(e) { + var m, r, mi; + + e = e.target; + if (e && (e = DOM.getParent(e, 'tr'))) { + m = t.items[e.id]; + + if (t.lastMenu) + t.lastMenu.collapse(1); + + if (m.isDisabled()) + return; + + if (e && DOM.hasClass(e, cp + 'ItemSub')) { + //p = DOM.getPos(s.container); + r = DOM.getRect(e); + m.showMenu((r.x + r.w - ot), r.y - ot, r.x); + t.lastMenu = m; + DOM.addClass(DOM.get(m.id).firstChild, cp + 'ItemActive'); + } + } + }); + } + + Event.add(co, 'keydown', t._keyHandler, t); + + t.onShowMenu.dispatch(t); + + if (s.keyboard_focus) { + t._setupKeyboardNav(); + } + }, + + hideMenu : function(c) { + var t = this, co = DOM.get('menu_' + t.id), e; + + if (!t.isMenuVisible) + return; + + if (t.keyboardNav) t.keyboardNav.destroy(); + Event.remove(co, 'mouseover', t.mouseOverFunc); + Event.remove(co, 'click', t.mouseClickFunc); + Event.remove(co, 'keydown', t._keyHandler); + DOM.hide(co); + t.isMenuVisible = 0; + + if (!c) + t.collapse(1); + + if (t.element) + t.element.hide(); + + if (e = DOM.get(t.id)) + DOM.removeClass(e.firstChild, t.classPrefix + 'ItemActive'); + + t.onHideMenu.dispatch(t); + }, + + add : function(o) { + var t = this, co; + + o = t.parent(o); + + if (t.isRendered && (co = DOM.get('menu_' + t.id))) + t._add(DOM.select('tbody', co)[0], o); + + return o; + }, + + collapse : function(d) { + this.parent(d); + this.hideMenu(1); + }, + + remove : function(o) { + DOM.remove(o.id); + this.destroy(); + + return this.parent(o); + }, + + destroy : function() { + var t = this, co = DOM.get('menu_' + t.id); + + if (t.keyboardNav) t.keyboardNav.destroy(); + Event.remove(co, 'mouseover', t.mouseOverFunc); + Event.remove(DOM.select('a', co), 'focus', t.mouseOverFunc); + Event.remove(co, 'click', t.mouseClickFunc); + Event.remove(co, 'keydown', t._keyHandler); + + if (t.element) + t.element.remove(); + + DOM.remove(co); + }, + + renderNode : function() { + var t = this, s = t.settings, n, tb, co, w; + + w = DOM.create('div', {role: 'listbox', id : 'menu_' + t.id, 'class' : s['class'], 'style' : 'position:absolute;left:0;top:0;z-index:200000;outline:0'}); + if (t.settings.parent) { + DOM.setAttrib(w, 'aria-parent', 'menu_' + t.settings.parent.id); + } + co = DOM.add(w, 'div', {role: 'presentation', id : 'menu_' + t.id + '_co', 'class' : t.classPrefix + (s['class'] ? ' ' + s['class'] : '')}); + t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container}); + + if (s.menu_line) + DOM.add(co, 'span', {'class' : t.classPrefix + 'Line'}); + +// n = DOM.add(co, 'div', {id : 'menu_' + t.id + '_co', 'class' : 'mceMenuContainer'}); + n = DOM.add(co, 'table', {role: 'presentation', id : 'menu_' + t.id + '_tbl', border : 0, cellPadding : 0, cellSpacing : 0}); + tb = DOM.add(n, 'tbody'); + + each(t.items, function(o) { + t._add(tb, o); + }); + + t.rendered = true; + + return w; + }, + + // Internal functions + _setupKeyboardNav : function(){ + var contextMenu, menuItems, t=this; + contextMenu = DOM.get('menu_' + t.id); + menuItems = DOM.select('a[role=option]', 'menu_' + t.id); + menuItems.splice(0,0,contextMenu); + t.keyboardNav = new tinymce.ui.KeyboardNavigation({ + root: 'menu_' + t.id, + items: menuItems, + onCancel: function() { + t.hideMenu(); + }, + enableUpDown: true + }); + contextMenu.focus(); + }, + + _keyHandler : function(evt) { + var t = this, e; + switch (evt.keyCode) { + case 37: // Left + if (t.settings.parent) { + t.hideMenu(); + t.settings.parent.focus(); + Event.cancel(evt); + } + break; + case 39: // Right + if (t.mouseOverFunc) + t.mouseOverFunc(evt); + break; + } + }, + + _add : function(tb, o) { + var n, s = o.settings, a, ro, it, cp = this.classPrefix, ic; + + if (s.separator) { + ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'ItemSeparator'}); + DOM.add(ro, 'td', {'class' : cp + 'ItemSeparator'}); + + if (n = ro.previousSibling) + DOM.addClass(n, 'mceLast'); + + return; + } + + n = ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'Item ' + cp + 'ItemEnabled'}); + n = it = DOM.add(n, s.titleItem ? 'th' : 'td'); + n = a = DOM.add(n, 'a', {id: o.id + '_aria', role: s.titleItem ? 'presentation' : 'option', href : 'javascript:;', onclick : "return false;", onmousedown : 'return false;'}); + + if (s.parent) { + DOM.setAttrib(a, 'aria-haspopup', 'true'); + DOM.setAttrib(a, 'aria-owns', 'menu_' + o.id); + } + + DOM.addClass(it, s['class']); +// n = DOM.add(n, 'span', {'class' : 'item'}); + + ic = DOM.add(n, 'span', {'class' : 'mceIcon' + (s.icon ? ' mce_' + s.icon : '')}); + + if (s.icon_src) + DOM.add(ic, 'img', {src : s.icon_src}); + + n = DOM.add(n, s.element || 'span', {'class' : 'mceText', title : o.settings.title}, o.settings.title); + + if (o.settings.style) + DOM.setAttrib(n, 'style', o.settings.style); + + if (tb.childNodes.length == 1) + DOM.addClass(ro, 'mceFirst'); + + if ((n = ro.previousSibling) && DOM.hasClass(n, cp + 'ItemSeparator')) + DOM.addClass(ro, 'mceFirst'); + + if (o.collapse) + DOM.addClass(ro, cp + 'ItemSub'); + + if (n = ro.previousSibling) + DOM.removeClass(n, 'mceLast'); + + DOM.addClass(ro, 'mceLast'); + } + }); +})(tinymce); +(function(tinymce) { + var DOM = tinymce.DOM; + + tinymce.create('tinymce.ui.Button:tinymce.ui.Control', { + Button : function(id, s, ed) { + this.parent(id, s, ed); + this.classPrefix = 'mceButton'; + }, + + renderHTML : function() { + var cp = this.classPrefix, s = this.settings, h, l; + + l = DOM.encode(s.label || ''); + h = ''; + if (s.image && !(this.editor &&this.editor.forcedHighContrastMode) ) + h += '' + DOM.encode(s.title) + '' + l; + else + h += '' + (l ? '' + l + '' : ''); + + h += ''; + h += ''; + return h; + }, + + postRender : function() { + var t = this, s = t.settings, imgBookmark; + + // In IE a large image that occupies the entire editor area will be deselected when a button is clicked, so + // need to keep the selection in case the selection is lost + if (tinymce.isIE && t.editor) { + tinymce.dom.Event.add(t.id, 'mousedown', function(e) { + var nodeName = t.editor.selection.getNode().nodeName; + imgBookmark = nodeName === 'IMG' ? t.editor.selection.getBookmark() : null; + }); + } + tinymce.dom.Event.add(t.id, 'click', function(e) { + if (!t.isDisabled()) { + // restore the selection in case the selection is lost in IE + if (tinymce.isIE && t.editor && imgBookmark !== null) { + t.editor.selection.moveToBookmark(imgBookmark); + } + return s.onclick.call(s.scope, e); + } + }); + tinymce.dom.Event.add(t.id, 'keyup', function(e) { + if (!t.isDisabled() && e.keyCode==tinymce.VK.SPACEBAR) + return s.onclick.call(s.scope, e); + }); + } + }); +})(tinymce); + +(function(tinymce) { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher; + + tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control', { + ListBox : function(id, s, ed) { + var t = this; + + t.parent(id, s, ed); + + t.items = []; + + t.onChange = new Dispatcher(t); + + t.onPostRender = new Dispatcher(t); + + t.onAdd = new Dispatcher(t); + + t.onRenderMenu = new tinymce.util.Dispatcher(this); + + t.classPrefix = 'mceListBox'; + }, + + select : function(va) { + var t = this, fv, f; + + if (va == undefined) + return t.selectByIndex(-1); + + // Is string or number make function selector + if (va && typeof(va)=="function") + f = va; + else { + f = function(v) { + return v == va; + }; + } + + // Do we need to do something? + if (va != t.selectedValue) { + // Find item + each(t.items, function(o, i) { + if (f(o.value)) { + fv = 1; + t.selectByIndex(i); + return false; + } + }); + + if (!fv) + t.selectByIndex(-1); + } + }, + + selectByIndex : function(idx) { + var t = this, e, o, label; + + if (idx != t.selectedIndex) { + e = DOM.get(t.id + '_text'); + label = DOM.get(t.id + '_voiceDesc'); + o = t.items[idx]; + + if (o) { + t.selectedValue = o.value; + t.selectedIndex = idx; + DOM.setHTML(e, DOM.encode(o.title)); + DOM.setHTML(label, t.settings.title + " - " + o.title); + DOM.removeClass(e, 'mceTitle'); + DOM.setAttrib(t.id, 'aria-valuenow', o.title); + } else { + DOM.setHTML(e, DOM.encode(t.settings.title)); + DOM.setHTML(label, DOM.encode(t.settings.title)); + DOM.addClass(e, 'mceTitle'); + t.selectedValue = t.selectedIndex = null; + DOM.setAttrib(t.id, 'aria-valuenow', t.settings.title); + } + e = 0; + } + }, + + add : function(n, v, o) { + var t = this; + + o = o || {}; + o = tinymce.extend(o, { + title : n, + value : v + }); + + t.items.push(o); + t.onAdd.dispatch(t, o); + }, + + getLength : function() { + return this.items.length; + }, + + renderHTML : function() { + var h = '', t = this, s = t.settings, cp = t.classPrefix; + + h = ''; + h += ''; + h += ''; + h += ''; + + return h; + }, + + showMenu : function() { + var t = this, p2, e = DOM.get(this.id), m; + + if (t.isDisabled() || t.items.length == 0) + return; + + if (t.menu && t.menu.isMenuVisible) + return t.hideMenu(); + + if (!t.isMenuRendered) { + t.renderMenu(); + t.isMenuRendered = true; + } + + p2 = DOM.getPos(e); + + m = t.menu; + m.settings.offset_x = p2.x; + m.settings.offset_y = p2.y; + m.settings.keyboard_focus = !tinymce.isOpera; // Opera is buggy when it comes to auto focus + + // Select in menu + if (t.oldID) + m.items[t.oldID].setSelected(0); + + each(t.items, function(o) { + if (o.value === t.selectedValue) { + m.items[o.id].setSelected(1); + t.oldID = o.id; + } + }); + + m.showMenu(0, e.clientHeight); + + Event.add(DOM.doc, 'mousedown', t.hideMenu, t); + DOM.addClass(t.id, t.classPrefix + 'Selected'); + + //DOM.get(t.id + '_text').focus(); + }, + + hideMenu : function(e) { + var t = this; + + if (t.menu && t.menu.isMenuVisible) { + DOM.removeClass(t.id, t.classPrefix + 'Selected'); + + // Prevent double toogles by canceling the mouse click event to the button + if (e && e.type == "mousedown" && (e.target.id == t.id + '_text' || e.target.id == t.id + '_open')) + return; + + if (!e || !DOM.getParent(e.target, '.mceMenu')) { + DOM.removeClass(t.id, t.classPrefix + 'Selected'); + Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); + t.menu.hideMenu(); + } + } + }, + + renderMenu : function() { + var t = this, m; + + m = t.settings.control_manager.createDropMenu(t.id + '_menu', { + menu_line : 1, + 'class' : t.classPrefix + 'Menu mceNoIcons', + max_width : 150, + max_height : 150 + }); + + m.onHideMenu.add(function() { + t.hideMenu(); + t.focus(); + }); + + m.add({ + title : t.settings.title, + 'class' : 'mceMenuItemTitle', + onclick : function() { + if (t.settings.onselect('') !== false) + t.select(''); // Must be runned after + } + }); + + each(t.items, function(o) { + // No value then treat it as a title + if (o.value === undefined) { + m.add({ + title : o.title, + role : "option", + 'class' : 'mceMenuItemTitle', + onclick : function() { + if (t.settings.onselect('') !== false) + t.select(''); // Must be runned after + } + }); + } else { + o.id = DOM.uniqueId(); + o.role= "option"; + o.onclick = function() { + if (t.settings.onselect(o.value) !== false) + t.select(o.value); // Must be runned after + }; + + m.add(o); + } + }); + + t.onRenderMenu.dispatch(t, m); + t.menu = m; + }, + + postRender : function() { + var t = this, cp = t.classPrefix; + + Event.add(t.id, 'click', t.showMenu, t); + Event.add(t.id, 'keydown', function(evt) { + if (evt.keyCode == 32) { // Space + t.showMenu(evt); + Event.cancel(evt); + } + }); + Event.add(t.id, 'focus', function() { + if (!t._focused) { + t.keyDownHandler = Event.add(t.id, 'keydown', function(e) { + if (e.keyCode == 40) { + t.showMenu(); + Event.cancel(e); + } + }); + t.keyPressHandler = Event.add(t.id, 'keypress', function(e) { + var v; + if (e.keyCode == 13) { + // Fake select on enter + v = t.selectedValue; + t.selectedValue = null; // Needs to be null to fake change + Event.cancel(e); + t.settings.onselect(v); + } + }); + } + + t._focused = 1; + }); + Event.add(t.id, 'blur', function() { + Event.remove(t.id, 'keydown', t.keyDownHandler); + Event.remove(t.id, 'keypress', t.keyPressHandler); + t._focused = 0; + }); + + // Old IE doesn't have hover on all elements + if (tinymce.isIE6 || !DOM.boxModel) { + Event.add(t.id, 'mouseover', function() { + if (!DOM.hasClass(t.id, cp + 'Disabled')) + DOM.addClass(t.id, cp + 'Hover'); + }); + + Event.add(t.id, 'mouseout', function() { + if (!DOM.hasClass(t.id, cp + 'Disabled')) + DOM.removeClass(t.id, cp + 'Hover'); + }); + } + + t.onPostRender.dispatch(t, DOM.get(t.id)); + }, + + destroy : function() { + this.parent(); + + Event.clear(this.id + '_text'); + Event.clear(this.id + '_open'); + } + }); +})(tinymce); + +(function(tinymce) { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher; + + tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox', { + NativeListBox : function(id, s) { + this.parent(id, s); + this.classPrefix = 'mceNativeListBox'; + }, + + setDisabled : function(s) { + DOM.get(this.id).disabled = s; + this.setAriaProperty('disabled', s); + }, + + isDisabled : function() { + return DOM.get(this.id).disabled; + }, + + select : function(va) { + var t = this, fv, f; + + if (va == undefined) + return t.selectByIndex(-1); + + // Is string or number make function selector + if (va && typeof(va)=="function") + f = va; + else { + f = function(v) { + return v == va; + }; + } + + // Do we need to do something? + if (va != t.selectedValue) { + // Find item + each(t.items, function(o, i) { + if (f(o.value)) { + fv = 1; + t.selectByIndex(i); + return false; + } + }); + + if (!fv) + t.selectByIndex(-1); + } + }, + + selectByIndex : function(idx) { + DOM.get(this.id).selectedIndex = idx + 1; + this.selectedValue = this.items[idx] ? this.items[idx].value : null; + }, + + add : function(n, v, a) { + var o, t = this; + + a = a || {}; + a.value = v; + + if (t.isRendered()) + DOM.add(DOM.get(this.id), 'option', a, n); + + o = { + title : n, + value : v, + attribs : a + }; + + t.items.push(o); + t.onAdd.dispatch(t, o); + }, + + getLength : function() { + return this.items.length; + }, + + renderHTML : function() { + var h, t = this; + + h = DOM.createHTML('option', {value : ''}, '-- ' + t.settings.title + ' --'); + + each(t.items, function(it) { + h += DOM.createHTML('option', {value : it.value}, it.title); + }); + + h = DOM.createHTML('select', {id : t.id, 'class' : 'mceNativeListBox', 'aria-labelledby': t.id + '_aria'}, h); + h += DOM.createHTML('span', {id : t.id + '_aria', 'style': 'display: none'}, t.settings.title); + return h; + }, + + postRender : function() { + var t = this, ch, changeListenerAdded = true; + + t.rendered = true; + + function onChange(e) { + var v = t.items[e.target.selectedIndex - 1]; + + if (v && (v = v.value)) { + t.onChange.dispatch(t, v); + + if (t.settings.onselect) + t.settings.onselect(v); + } + }; + + Event.add(t.id, 'change', onChange); + + // Accessibility keyhandler + Event.add(t.id, 'keydown', function(e) { + var bf; + + Event.remove(t.id, 'change', ch); + changeListenerAdded = false; + + bf = Event.add(t.id, 'blur', function() { + if (changeListenerAdded) return; + changeListenerAdded = true; + Event.add(t.id, 'change', onChange); + Event.remove(t.id, 'blur', bf); + }); + + //prevent default left and right keys on chrome - so that the keyboard navigation is used. + if (tinymce.isWebKit && (e.keyCode==37 ||e.keyCode==39)) { + return Event.prevent(e); + } + + if (e.keyCode == 13 || e.keyCode == 32) { + onChange(e); + return Event.cancel(e); + } + }); + + t.onPostRender.dispatch(t, DOM.get(t.id)); + } + }); +})(tinymce); + +(function(tinymce) { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each; + + tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button', { + MenuButton : function(id, s, ed) { + this.parent(id, s, ed); + + this.onRenderMenu = new tinymce.util.Dispatcher(this); + + s.menu_container = s.menu_container || DOM.doc.body; + }, + + showMenu : function() { + var t = this, p1, p2, e = DOM.get(t.id), m; + + if (t.isDisabled()) + return; + + if (!t.isMenuRendered) { + t.renderMenu(); + t.isMenuRendered = true; + } + + if (t.isMenuVisible) + return t.hideMenu(); + + p1 = DOM.getPos(t.settings.menu_container); + p2 = DOM.getPos(e); + + m = t.menu; + m.settings.offset_x = p2.x; + m.settings.offset_y = p2.y; + m.settings.vp_offset_x = p2.x; + m.settings.vp_offset_y = p2.y; + m.settings.keyboard_focus = t._focused; + m.showMenu(0, e.clientHeight); + + Event.add(DOM.doc, 'mousedown', t.hideMenu, t); + t.setState('Selected', 1); + + t.isMenuVisible = 1; + }, + + renderMenu : function() { + var t = this, m; + + m = t.settings.control_manager.createDropMenu(t.id + '_menu', { + menu_line : 1, + 'class' : this.classPrefix + 'Menu', + icons : t.settings.icons + }); + + m.onHideMenu.add(function() { + t.hideMenu(); + t.focus(); + }); + + t.onRenderMenu.dispatch(t, m); + t.menu = m; + }, + + hideMenu : function(e) { + var t = this; + + // Prevent double toogles by canceling the mouse click event to the button + if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id || e.id === t.id + '_open';})) + return; + + if (!e || !DOM.getParent(e.target, '.mceMenu')) { + t.setState('Selected', 0); + Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); + if (t.menu) + t.menu.hideMenu(); + } + + t.isMenuVisible = 0; + }, + + postRender : function() { + var t = this, s = t.settings; + + Event.add(t.id, 'click', function() { + if (!t.isDisabled()) { + if (s.onclick) + s.onclick(t.value); + + t.showMenu(); + } + }); + } + }); +})(tinymce); + +(function(tinymce) { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each; + + tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton', { + SplitButton : function(id, s, ed) { + this.parent(id, s, ed); + this.classPrefix = 'mceSplitButton'; + }, + + renderHTML : function() { + var h, t = this, s = t.settings, h1; + + h = ''; + + if (s.image) + h1 = DOM.createHTML('img ', {src : s.image, role: 'presentation', 'class' : 'mceAction ' + s['class']}); + else + h1 = DOM.createHTML('span', {'class' : 'mceAction ' + s['class']}, ''); + + h1 += DOM.createHTML('span', {'class': 'mceVoiceLabel mceIconOnly', id: t.id + '_voice', style: 'display:none;'}, s.title); + h += '' + DOM.createHTML('a', {role: 'button', id : t.id + '_action', tabindex: '-1', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + ''; + + h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']}, ''); + h += '' + DOM.createHTML('a', {role: 'button', id : t.id + '_open', tabindex: '-1', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + ''; + + h += ''; + h = DOM.createHTML('table', { role: 'presentation', 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', title : s.title}, h); + return DOM.createHTML('div', {id : t.id, role: 'button', tabindex: '0', 'aria-labelledby': t.id + '_voice', 'aria-haspopup': 'true'}, h); + }, + + postRender : function() { + var t = this, s = t.settings, activate; + + if (s.onclick) { + activate = function(evt) { + if (!t.isDisabled()) { + s.onclick(t.value); + Event.cancel(evt); + } + }; + Event.add(t.id + '_action', 'click', activate); + Event.add(t.id, ['click', 'keydown'], function(evt) { + var DOM_VK_SPACE = 32, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_UP = 38, DOM_VK_DOWN = 40; + if ((evt.keyCode === 32 || evt.keyCode === 13 || evt.keyCode === 14) && !evt.altKey && !evt.ctrlKey && !evt.metaKey) { + activate(); + Event.cancel(evt); + } else if (evt.type === 'click' || evt.keyCode === DOM_VK_DOWN) { + t.showMenu(); + Event.cancel(evt); + } + }); + } + + Event.add(t.id + '_open', 'click', function (evt) { + t.showMenu(); + Event.cancel(evt); + }); + Event.add([t.id, t.id + '_open'], 'focus', function() {t._focused = 1;}); + Event.add([t.id, t.id + '_open'], 'blur', function() {t._focused = 0;}); + + // Old IE doesn't have hover on all elements + if (tinymce.isIE6 || !DOM.boxModel) { + Event.add(t.id, 'mouseover', function() { + if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled')) + DOM.addClass(t.id, 'mceSplitButtonHover'); + }); + + Event.add(t.id, 'mouseout', function() { + if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled')) + DOM.removeClass(t.id, 'mceSplitButtonHover'); + }); + } + }, + + destroy : function() { + this.parent(); + + Event.clear(this.id + '_action'); + Event.clear(this.id + '_open'); + Event.clear(this.id); + } + }); +})(tinymce); + +(function(tinymce) { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each; + + tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton', { + ColorSplitButton : function(id, s, ed) { + var t = this; + + t.parent(id, s, ed); + + t.settings = s = tinymce.extend({ + colors : '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF', + grid_width : 8, + default_color : '#888888' + }, t.settings); + + t.onShowMenu = new tinymce.util.Dispatcher(t); + + t.onHideMenu = new tinymce.util.Dispatcher(t); + + t.value = s.default_color; + }, + + showMenu : function() { + var t = this, r, p, e, p2; + + if (t.isDisabled()) + return; + + if (!t.isMenuRendered) { + t.renderMenu(); + t.isMenuRendered = true; + } + + if (t.isMenuVisible) + return t.hideMenu(); + + e = DOM.get(t.id); + DOM.show(t.id + '_menu'); + DOM.addClass(e, 'mceSplitButtonSelected'); + p2 = DOM.getPos(e); + DOM.setStyles(t.id + '_menu', { + left : p2.x, + top : p2.y + e.clientHeight, + zIndex : 200000 + }); + e = 0; + + Event.add(DOM.doc, 'mousedown', t.hideMenu, t); + t.onShowMenu.dispatch(t); + + if (t._focused) { + t._keyHandler = Event.add(t.id + '_menu', 'keydown', function(e) { + if (e.keyCode == 27) + t.hideMenu(); + }); + + DOM.select('a', t.id + '_menu')[0].focus(); // Select first link + } + + t.isMenuVisible = 1; + }, + + hideMenu : function(e) { + var t = this; + + if (t.isMenuVisible) { + // Prevent double toogles by canceling the mouse click event to the button + if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id + '_open';})) + return; + + if (!e || !DOM.getParent(e.target, '.mceSplitButtonMenu')) { + DOM.removeClass(t.id, 'mceSplitButtonSelected'); + Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); + Event.remove(t.id + '_menu', 'keydown', t._keyHandler); + DOM.hide(t.id + '_menu'); + } + + t.isMenuVisible = 0; + t.onHideMenu.dispatch(); + } + }, + + renderMenu : function() { + var t = this, m, i = 0, s = t.settings, n, tb, tr, w, context; + + w = DOM.add(s.menu_container, 'div', {role: 'listbox', id : t.id + '_menu', 'class' : s['menu_class'] + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'}); + m = DOM.add(w, 'div', {'class' : s['class'] + ' mceSplitButtonMenu'}); + DOM.add(m, 'span', {'class' : 'mceMenuLine'}); + + n = DOM.add(m, 'table', {role: 'presentation', 'class' : 'mceColorSplitMenu'}); + tb = DOM.add(n, 'tbody'); + + // Generate color grid + i = 0; + each(is(s.colors, 'array') ? s.colors : s.colors.split(','), function(c) { + c = c.replace(/^#/, ''); + + if (!i--) { + tr = DOM.add(tb, 'tr'); + i = s.grid_width - 1; + } + + n = DOM.add(tr, 'td'); + var settings = { + href : 'javascript:;', + style : { + backgroundColor : '#' + c + }, + 'title': t.editor.getLang('colors.' + c, c), + 'data-mce-color' : '#' + c + }; + + // adding a proper ARIA role = button causes JAWS to read things incorrectly on IE. + if (!tinymce.isIE ) { + settings['role']= 'option'; + } + + n = DOM.add(n, 'a', settings); + + if (t.editor.forcedHighContrastMode) { + n = DOM.add(n, 'canvas', { width: 16, height: 16, 'aria-hidden': 'true' }); + if (n.getContext && (context = n.getContext("2d"))) { + context.fillStyle = '#' + c; + context.fillRect(0, 0, 16, 16); + } else { + // No point leaving a canvas element around if it's not supported for drawing on anyway. + DOM.remove(n); + } + } + }); + + if (s.more_colors_func) { + n = DOM.add(tb, 'tr'); + n = DOM.add(n, 'td', {colspan : s.grid_width, 'class' : 'mceMoreColors'}); + n = DOM.add(n, 'a', {role: 'option', id : t.id + '_more', href : 'javascript:;', onclick : 'return false;', 'class' : 'mceMoreColors'}, s.more_colors_title); + + Event.add(n, 'click', function(e) { + s.more_colors_func.call(s.more_colors_scope || this); + return Event.cancel(e); // Cancel to fix onbeforeunload problem + }); + } + + DOM.addClass(m, 'mceColorSplitMenu'); + + new tinymce.ui.KeyboardNavigation({ + root: t.id + '_menu', + items: DOM.select('a', t.id + '_menu'), + onCancel: function() { + t.hideMenu(); + t.focus(); + } + }); + + // Prevent IE from scrolling and hindering click to occur #4019 + Event.add(t.id + '_menu', 'mousedown', function(e) {return Event.cancel(e);}); + + Event.add(t.id + '_menu', 'click', function(e) { + var c; + + e = DOM.getParent(e.target, 'a', tb); + + if (e && e.nodeName.toLowerCase() == 'a' && (c = e.getAttribute('data-mce-color'))) + t.setColor(c); + + return Event.cancel(e); // Prevent IE auto save warning + }); + + return w; + }, + + setColor : function(c) { + this.displayColor(c); + this.hideMenu(); + this.settings.onselect(c); + }, + + displayColor : function(c) { + var t = this; + + DOM.setStyle(t.id + '_preview', 'backgroundColor', c); + + t.value = c; + }, + + postRender : function() { + var t = this, id = t.id; + + t.parent(); + DOM.add(id + '_action', 'div', {id : id + '_preview', 'class' : 'mceColorPreview'}); + DOM.setStyle(t.id + '_preview', 'backgroundColor', t.value); + }, + + destroy : function() { + this.parent(); + + Event.clear(this.id + '_menu'); + Event.clear(this.id + '_more'); + DOM.remove(this.id + '_menu'); + } + }); +})(tinymce); + +(function(tinymce) { +// Shorten class names +var dom = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event; +tinymce.create('tinymce.ui.ToolbarGroup:tinymce.ui.Container', { + renderHTML : function() { + var t = this, h = [], controls = t.controls, each = tinymce.each, settings = t.settings; + + h.push('
    '); + //TODO: ACC test this out - adding a role = application for getting the landmarks working well. + h.push(""); + h.push(''); + each(controls, function(toolbar) { + h.push(toolbar.renderHTML()); + }); + h.push(""); + h.push('
    '); + + return h.join(''); + }, + + focus : function() { + var t = this; + dom.get(t.id).focus(); + }, + + postRender : function() { + var t = this, items = []; + + each(t.controls, function(toolbar) { + each (toolbar.controls, function(control) { + if (control.id) { + items.push(control); + } + }); + }); + + t.keyNav = new tinymce.ui.KeyboardNavigation({ + root: t.id, + items: items, + onCancel: function() { + //Move focus if webkit so that navigation back will read the item. + if (tinymce.isWebKit) { + dom.get(t.editor.id+"_ifr").focus(); + } + t.editor.focus(); + }, + excludeFromTabOrder: !t.settings.tab_focus_toolbar + }); + }, + + destroy : function() { + var self = this; + + self.parent(); + self.keyNav.destroy(); + Event.clear(self.id); + } +}); +})(tinymce); + +(function(tinymce) { +// Shorten class names +var dom = tinymce.DOM, each = tinymce.each; +tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { + renderHTML : function() { + var t = this, h = '', c, co, s = t.settings, i, pr, nx, cl; + + cl = t.controls; + for (i=0; i')); + } + + // Add toolbar end before list box and after the previous button + // This is to fix the o2k7 editor skins + if (pr && co.ListBox) { + if (pr.Button || pr.SplitButton) + h += dom.createHTML('td', {'class' : 'mceToolbarEnd'}, dom.createHTML('span', null, '')); + } + + // Render control HTML + + // IE 8 quick fix, needed to propertly generate a hit area for anchors + if (dom.stdMode) + h += '' + co.renderHTML() + ''; + else + h += '' + co.renderHTML() + ''; + + // Add toolbar start after list box and before the next button + // This is to fix the o2k7 editor skins + if (nx && co.ListBox) { + if (nx.Button || nx.SplitButton) + h += dom.createHTML('td', {'class' : 'mceToolbarStart'}, dom.createHTML('span', null, '')); + } + } + + c = 'mceToolbarEnd'; + + if (co.Button) + c += ' mceToolbarEndButton'; + else if (co.SplitButton) + c += ' mceToolbarEndSplitButton'; + else if (co.ListBox) + c += ' mceToolbarEndListBox'; + + h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '')); + + return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || '', role: 'presentation', tabindex: '-1'}, '' + h + ''); + } +}); +})(tinymce); + +(function(tinymce) { + var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each; + + tinymce.create('tinymce.AddOnManager', { + AddOnManager : function() { + var self = this; + + self.items = []; + self.urls = {}; + self.lookup = {}; + self.onAdd = new Dispatcher(self); + }, + + get : function(n) { + if (this.lookup[n]) { + return this.lookup[n].instance; + } else { + return undefined; + } + }, + + dependencies : function(n) { + var result; + if (this.lookup[n]) { + result = this.lookup[n].dependencies; + } + return result || []; + }, + + requireLangPack : function(n) { + var s = tinymce.settings; + + if (s && s.language && s.language_load !== false) + tinymce.ScriptLoader.add(this.urls[n] + '/langs/' + s.language + '.js'); + }, + + add : function(id, o, dependencies) { + this.items.push(o); + this.lookup[id] = {instance:o, dependencies:dependencies}; + this.onAdd.dispatch(this, id, o); + + return o; + }, + createUrl: function(baseUrl, dep) { + if (typeof dep === "object") { + return dep + } else { + return {prefix: baseUrl.prefix, resource: dep, suffix: baseUrl.suffix}; + } + }, + + addComponents: function(pluginName, scripts) { + var pluginUrl = this.urls[pluginName]; + tinymce.each(scripts, function(script){ + tinymce.ScriptLoader.add(pluginUrl+"/"+script); + }); + }, + + load : function(n, u, cb, s) { + var t = this, url = u; + + function loadDependencies() { + var dependencies = t.dependencies(n); + tinymce.each(dependencies, function(dep) { + var newUrl = t.createUrl(u, dep); + t.load(newUrl.resource, newUrl, undefined, undefined); + }); + if (cb) { + if (s) { + cb.call(s); + } else { + cb.call(tinymce.ScriptLoader); + } + } + } + + if (t.urls[n]) + return; + if (typeof u === "object") + url = u.prefix + u.resource + u.suffix; + + if (url.indexOf('/') != 0 && url.indexOf('://') == -1) + url = tinymce.baseURL + '/' + url; + + t.urls[n] = url.substring(0, url.lastIndexOf('/')); + + if (t.lookup[n]) { + loadDependencies(); + } else { + tinymce.ScriptLoader.add(url, loadDependencies, s); + } + } + }); + + // Create plugin and theme managers + tinymce.PluginManager = new tinymce.AddOnManager(); + tinymce.ThemeManager = new tinymce.AddOnManager(); +}(tinymce)); + +(function(tinymce) { + // Shorten names + var each = tinymce.each, extend = tinymce.extend, + DOM = tinymce.DOM, Event = tinymce.dom.Event, + ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, + explode = tinymce.explode, + Dispatcher = tinymce.util.Dispatcher, undefined, instanceCounter = 0; + + // Setup some URLs where the editor API is located and where the document is + tinymce.documentBaseURL = window.location.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, ''); + if (!/[\/\\]$/.test(tinymce.documentBaseURL)) + tinymce.documentBaseURL += '/'; + + tinymce.baseURL = new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL); + + tinymce.baseURI = new tinymce.util.URI(tinymce.baseURL); + + // Add before unload listener + // This was required since IE was leaking memory if you added and removed beforeunload listeners + // with attachEvent/detatchEvent so this only adds one listener and instances can the attach to the onBeforeUnload event + tinymce.onBeforeUnload = new Dispatcher(tinymce); + + // Must be on window or IE will leak if the editor is placed in frame or iframe + Event.add(window, 'beforeunload', function(e) { + tinymce.onBeforeUnload.dispatch(tinymce, e); + }); + + tinymce.onAddEditor = new Dispatcher(tinymce); + + tinymce.onRemoveEditor = new Dispatcher(tinymce); + + tinymce.EditorManager = extend(tinymce, { + editors : [], + + i18n : {}, + + activeEditor : null, + + init : function(s) { + var t = this, pl, sl = tinymce.ScriptLoader, e, el = [], ed; + + function execCallback(se, n, s) { + var f = se[n]; + + if (!f) + return; + + if (tinymce.is(f, 'string')) { + s = f.replace(/\.\w+$/, ''); + s = s ? tinymce.resolve(s) : 0; + f = tinymce.resolve(f); + } + + return f.apply(s || this, Array.prototype.slice.call(arguments, 2)); + }; + + s = extend({ + theme : "simple", + language : "en" + }, s); + + t.settings = s; + + // Legacy call + Event.add(document, 'init', function() { + var l, co; + + execCallback(s, 'onpageload'); + + switch (s.mode) { + case "exact": + l = s.elements || ''; + + if(l.length > 0) { + each(explode(l), function(v) { + if (DOM.get(v)) { + ed = new tinymce.Editor(v, s); + el.push(ed); + ed.render(1); + } else { + each(document.forms, function(f) { + each(f.elements, function(e) { + if (e.name === v) { + v = 'mce_editor_' + instanceCounter++; + DOM.setAttrib(e, 'id', v); + + ed = new tinymce.Editor(v, s); + el.push(ed); + ed.render(1); + } + }); + }); + } + }); + } + break; + + case "textareas": + case "specific_textareas": + function hasClass(n, c) { + return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c); + }; + + each(DOM.select('textarea'), function(v) { + if (s.editor_deselector && hasClass(v, s.editor_deselector)) + return; + + if (!s.editor_selector || hasClass(v, s.editor_selector)) { + // Can we use the name + e = DOM.get(v.name); + if (!v.id && !e) + v.id = v.name; + + // Generate unique name if missing or already exists + if (!v.id || t.get(v.id)) + v.id = DOM.uniqueId(); + + ed = new tinymce.Editor(v.id, s); + el.push(ed); + ed.render(1); + } + }); + break; + } + + // Call onInit when all editors are initialized + if (s.oninit) { + l = co = 0; + + each(el, function(ed) { + co++; + + if (!ed.initialized) { + // Wait for it + ed.onInit.add(function() { + l++; + + // All done + if (l == co) + execCallback(s, 'oninit'); + }); + } else + l++; + + // All done + if (l == co) + execCallback(s, 'oninit'); + }); + } + }); + }, + + get : function(id) { + if (id === undefined) + return this.editors; + + return this.editors[id]; + }, + + getInstanceById : function(id) { + return this.get(id); + }, + + add : function(editor) { + var self = this, editors = self.editors; + + // Add named and index editor instance + editors[editor.id] = editor; + editors.push(editor); + + self._setActive(editor); + self.onAddEditor.dispatch(self, editor); + + + // Patch the tinymce.Editor instance with jQuery adapter logic + if (tinymce.adapter) + tinymce.adapter.patchEditor(editor); + + + return editor; + }, + + remove : function(editor) { + var t = this, i, editors = t.editors; + + // Not in the collection + if (!editors[editor.id]) + return null; + + delete editors[editor.id]; + + for (i = 0; i < editors.length; i++) { + if (editors[i] == editor) { + editors.splice(i, 1); + break; + } + } + + // Select another editor since the active one was removed + if (t.activeEditor == editor) + t._setActive(editors[0]); + + editor.destroy(); + t.onRemoveEditor.dispatch(t, editor); + + return editor; + }, + + execCommand : function(c, u, v) { + var t = this, ed = t.get(v), w; + + // Manager commands + switch (c) { + case "mceFocus": + ed.focus(); + return true; + + case "mceAddEditor": + case "mceAddControl": + if (!t.get(v)) + new tinymce.Editor(v, t.settings).render(); + + return true; + + case "mceAddFrameControl": + w = v.window; + + // Add tinyMCE global instance and tinymce namespace to specified window + w.tinyMCE = tinyMCE; + w.tinymce = tinymce; + + tinymce.DOM.doc = w.document; + tinymce.DOM.win = w; + + ed = new tinymce.Editor(v.element_id, v); + ed.render(); + + // Fix IE memory leaks + if (tinymce.isIE) { + function clr() { + ed.destroy(); + w.detachEvent('onunload', clr); + w = w.tinyMCE = w.tinymce = null; // IE leak + }; + + w.attachEvent('onunload', clr); + } + + v.page_window = null; + + return true; + + case "mceRemoveEditor": + case "mceRemoveControl": + if (ed) + ed.remove(); + + return true; + + case 'mceToggleEditor': + if (!ed) { + t.execCommand('mceAddControl', 0, v); + return true; + } + + if (ed.isHidden()) + ed.show(); + else + ed.hide(); + + return true; + } + + // Run command on active editor + if (t.activeEditor) + return t.activeEditor.execCommand(c, u, v); + + return false; + }, + + execInstanceCommand : function(id, c, u, v) { + var ed = this.get(id); + + if (ed) + return ed.execCommand(c, u, v); + + return false; + }, + + triggerSave : function() { + each(this.editors, function(e) { + e.save(); + }); + }, + + addI18n : function(p, o) { + var lo, i18n = this.i18n; + + if (!tinymce.is(p, 'string')) { + each(p, function(o, lc) { + each(o, function(o, g) { + each(o, function(o, k) { + if (g === 'common') + i18n[lc + '.' + k] = o; + else + i18n[lc + '.' + g + '.' + k] = o; + }); + }); + }); + } else { + each(o, function(o, k) { + i18n[p + '.' + k] = o; + }); + } + }, + + // Private methods + + _setActive : function(editor) { + this.selectedInstance = this.activeEditor = editor; + } + }); +})(tinymce); + +(function(tinymce) { + // Shorten these names + var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, + Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isGecko = tinymce.isGecko, + isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, is = tinymce.is, + ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, + inArray = tinymce.inArray, grep = tinymce.grep, explode = tinymce.explode, VK = tinymce.VK; + + tinymce.create('tinymce.Editor', { + Editor : function(id, s) { + var t = this; + + t.id = t.editorId = id; + + t.execCommands = {}; + t.queryStateCommands = {}; + t.queryValueCommands = {}; + + t.isNotDirty = false; + + t.plugins = {}; + + // Add events to the editor + each([ + 'onPreInit', + + 'onBeforeRenderUI', + + 'onPostRender', + + 'onLoad', + + 'onInit', + + 'onRemove', + + 'onActivate', + + 'onDeactivate', + + 'onClick', + + 'onEvent', + + 'onMouseUp', + + 'onMouseDown', + + 'onDblClick', + + 'onKeyDown', + + 'onKeyUp', + + 'onKeyPress', + + 'onContextMenu', + + 'onSubmit', + + 'onReset', + + 'onPaste', + + 'onPreProcess', + + 'onPostProcess', + + 'onBeforeSetContent', + + 'onBeforeGetContent', + + 'onSetContent', + + 'onGetContent', + + 'onLoadContent', + + 'onSaveContent', + + 'onNodeChange', + + 'onChange', + + 'onBeforeExecCommand', + + 'onExecCommand', + + 'onUndo', + + 'onRedo', + + 'onVisualAid', + + 'onSetProgressState', + + 'onSetAttrib' + ], function(e) { + t[e] = new Dispatcher(t); + }); + + t.settings = s = extend({ + id : id, + language : 'en', + docs_language : 'en', + theme : 'simple', + skin : 'default', + delta_width : 0, + delta_height : 0, + popup_css : '', + plugins : '', + document_base_url : tinymce.documentBaseURL, + add_form_submit_trigger : 1, + submit_patch : 1, + add_unload_trigger : 1, + convert_urls : 1, + relative_urls : 1, + remove_script_host : 1, + table_inline_editing : 0, + object_resizing : 1, + cleanup : 1, + accessibility_focus : 1, + custom_shortcuts : 1, + custom_undo_redo_keyboard_shortcuts : 1, + custom_undo_redo_restore_selection : 1, + custom_undo_redo : 1, + doctype : tinymce.isIE6 ? '' : '', // Use old doctype on IE 6 to avoid horizontal scroll + visual_table_class : 'mceItemTable', + visual : 1, + font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large', + font_size_legacy_values : 'xx-small,small,medium,large,x-large,xx-large,300%', // See: http://www.w3.org/TR/CSS2/fonts.html#propdef-font-size + apply_source_formatting : 1, + directionality : 'ltr', + forced_root_block : 'p', + hidden_input : 1, + padd_empty_editor : 1, + render_ui : 1, + init_theme : 1, + force_p_newlines : 1, + indentation : '30px', + keep_styles : 1, + fix_table_elements : 1, + inline_styles : 1, + convert_fonts_to_spans : true, + indent : 'simple', + indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr', + indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr', + validate : true, + entity_encoding : 'named', + url_converter : t.convertURL, + url_converter_scope : t, + ie7_compat : true + }, s); + + t.documentBaseURI = new tinymce.util.URI(s.document_base_url || tinymce.documentBaseURL, { + base_uri : tinyMCE.baseURI + }); + + t.baseURI = tinymce.baseURI; + + t.contentCSS = []; + + // Call setup + t.execCallback('setup', t); + }, + + render : function(nst) { + var t = this, s = t.settings, id = t.id, sl = tinymce.ScriptLoader; + + // Page is not loaded yet, wait for it + if (!Event.domLoaded) { + Event.add(document, 'init', function() { + t.render(); + }); + return; + } + + tinyMCE.settings = s; + + // Element not found, then skip initialization + if (!t.getElement()) + return; + + // Is a iPad/iPhone and not on iOS5, then skip initialization. We need to sniff + // here since the browser says it has contentEditable support but there is no visible + // caret We will remove this check ones Apple implements full contentEditable support + if (tinymce.isIDevice && !tinymce.isIOS5) + return; + + // Add hidden input for non input elements inside form elements + if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form')) + DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id); + + if (tinymce.WindowManager) + t.windowManager = new tinymce.WindowManager(t); + + if (s.encoding == 'xml') { + t.onGetContent.add(function(ed, o) { + if (o.save) + o.content = DOM.encode(o.content); + }); + } + + if (s.add_form_submit_trigger) { + t.onSubmit.addToTop(function() { + if (t.initialized) { + t.save(); + t.isNotDirty = 1; + } + }); + } + + if (s.add_unload_trigger) { + t._beforeUnload = tinyMCE.onBeforeUnload.add(function() { + if (t.initialized && !t.destroyed && !t.isHidden()) + t.save({format : 'raw', no_events : true}); + }); + } + + tinymce.addUnload(t.destroy, t); + + if (s.submit_patch) { + t.onBeforeRenderUI.add(function() { + var n = t.getElement().form; + + if (!n) + return; + + // Already patched + if (n._mceOldSubmit) + return; + + // Check page uses id="submit" or name="submit" for it's submit button + if (!n.submit.nodeType && !n.submit.length) { + t.formElement = n; + n._mceOldSubmit = n.submit; + n.submit = function() { + // Save all instances + tinymce.triggerSave(); + t.isNotDirty = 1; + + return t.formElement._mceOldSubmit(t.formElement); + }; + } + + n = null; + }); + } + + // Load scripts + function loadScripts() { + if (s.language && s.language_load !== false) + sl.add(tinymce.baseURL + '/langs/' + s.language + '.js'); + + if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme]) + ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js'); + + each(explode(s.plugins), function(p) { + if (p &&!PluginManager.urls[p]) { + if (p.charAt(0) == '-') { + p = p.substr(1, p.length); + var dependencies = PluginManager.dependencies(p); + each(dependencies, function(dep) { + var defaultSettings = {prefix:'plugins/', resource: dep, suffix:'/editor_plugin' + tinymce.suffix + '.js'}; + var dep = PluginManager.createUrl(defaultSettings, dep); + PluginManager.load(dep.resource, dep); + + }); + } else { + // Skip safari plugin, since it is removed as of 3.3b1 + if (p == 'safari') { + return; + } + PluginManager.load(p, {prefix:'plugins/', resource: p, suffix:'/editor_plugin' + tinymce.suffix + '.js'}); + } + } + }); + + // Init when que is loaded + sl.loadQueue(function() { + if (!t.removed) + t.init(); + }); + }; + + loadScripts(); + }, + + init : function() { + var n, t = this, s = t.settings, w, h, e = t.getElement(), o, ti, u, bi, bc, re, i, initializedPlugins = []; + + tinymce.add(t); + + s.aria_label = s.aria_label || DOM.getAttrib(e, 'aria-label', t.getLang('aria.rich_text_area')); + + if (s.theme) { + s.theme = s.theme.replace(/-/, ''); + o = ThemeManager.get(s.theme); + t.theme = new o(); + + if (t.theme.init && s.init_theme) + t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, '')); + } + function initPlugin(p) { + var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po; + if (c && tinymce.inArray(initializedPlugins,p) === -1) { + each(PluginManager.dependencies(p), function(dep){ + initPlugin(dep); + }); + po = new c(t, u); + + t.plugins[p] = po; + + if (po.init) { + po.init(t, u); + initializedPlugins.push(p); + } + } + } + + // Create all plugins + each(explode(s.plugins.replace(/\-/g, '')), initPlugin); + + // Setup popup CSS path(s) + if (s.popup_css !== false) { + if (s.popup_css) + s.popup_css = t.documentBaseURI.toAbsolute(s.popup_css); + else + s.popup_css = t.baseURI.toAbsolute("themes/" + s.theme + "/skins/" + s.skin + "/dialog.css"); + } + + if (s.popup_css_add) + s.popup_css += ',' + t.documentBaseURI.toAbsolute(s.popup_css_add); + + t.controlManager = new tinymce.ControlManager(t); + + if (s.custom_undo_redo) { + t.onBeforeExecCommand.add(function(ed, cmd, ui, val, a) { + if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo)) + t.undoManager.beforeChange(); + }); + + t.onExecCommand.add(function(ed, cmd, ui, val, a) { + if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo)) + t.undoManager.add(); + }); + } + + t.onExecCommand.add(function(ed, c) { + // Don't refresh the select lists until caret move + if (!/^(FontName|FontSize)$/.test(c)) + t.nodeChanged(); + }); + + // Remove ghost selections on images and tables in Gecko + if (isGecko) { + function repaint(a, o) { + if (!o || !o.initial) + t.execCommand('mceRepaint'); + }; + + t.onUndo.add(repaint); + t.onRedo.add(repaint); + t.onSetContent.add(repaint); + } + + // Enables users to override the control factory + t.onBeforeRenderUI.dispatch(t, t.controlManager); + + // Measure box + if (s.render_ui) { + w = s.width || e.style.width || e.offsetWidth; + h = s.height || e.style.height || e.offsetHeight; + t.orgDisplay = e.style.display; + re = /^[0-9\.]+(|px)$/i; + + if (re.test('' + w)) + w = Math.max(parseInt(w) + (o.deltaWidth || 0), 100); + + if (re.test('' + h)) + h = Math.max(parseInt(h) + (o.deltaHeight || 0), 100); + + // Render UI + o = t.theme.renderUI({ + targetNode : e, + width : w, + height : h, + deltaWidth : s.delta_width, + deltaHeight : s.delta_height + }); + + t.editorContainer = o.editorContainer; + } + + + // User specified a document.domain value + if (document.domain && location.hostname != document.domain) + tinymce.relaxedDomain = document.domain; + + // Resize editor + DOM.setStyles(o.sizeContainer || o.editorContainer, { + width : w, + height : h + }); + + // Load specified content CSS last + if (s.content_css) { + tinymce.each(explode(s.content_css), function(u) { + t.contentCSS.push(t.documentBaseURI.toAbsolute(u)); + }); + } + + h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : ''); + if (h < 100) + h = 100; + + t.iframeHTML = s.doctype + ''; + + // We only need to override paths if we have to + // IE has a bug where it remove site absolute urls to relative ones if this is specified + if (s.document_base_url != tinymce.documentBaseURL) + t.iframeHTML += ''; + + // IE8 doesn't support carets behind images setting ie7_compat would force IE8+ to run in IE7 compat mode. + if (s.ie7_compat) + t.iframeHTML += ''; + else + t.iframeHTML += ''; + + t.iframeHTML += ''; + + // Load the CSS by injecting them into the HTML this will reduce "flicker" + for (i = 0; i < t.contentCSS.length; i++) { + t.iframeHTML += ''; + } + + t.contentCSS = []; + + bi = s.body_id || 'tinymce'; + if (bi.indexOf('=') != -1) { + bi = t.getParam('body_id', '', 'hash'); + bi = bi[t.id] || bi; + } + + bc = s.body_class || ''; + if (bc.indexOf('=') != -1) { + bc = t.getParam('body_class', '', 'hash'); + bc = bc[t.id] || ''; + } + + t.iframeHTML += '
    '; + + // Domain relaxing enabled, then set document domain + if (tinymce.relaxedDomain && (isIE || (tinymce.isOpera && parseFloat(opera.version()) < 11))) { + // We need to write the contents here in IE since multiple writes messes up refresh button and back button + u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'; + } + + // Create iframe + // TODO: ACC add the appropriate description on this. + n = DOM.add(o.iframeContainer, 'iframe', { + id : t.id + "_ifr", + src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7 + frameBorder : '0', + allowTransparency : "true", + title : s.aria_label, + style : { + width : '100%', + height : h, + display : 'block' // Important for Gecko to render the iframe correctly + } + }); + + t.contentAreaContainer = o.iframeContainer; + DOM.get(o.editorContainer).style.display = t.orgDisplay; + DOM.get(t.id).style.display = 'none'; + DOM.setAttrib(t.id, 'aria-hidden', true); + + if (!tinymce.relaxedDomain || !u) + t.setupIframe(); + + e = n = o = null; // Cleanup + }, + + setupIframe : function() { + var t = this, s = t.settings, e = DOM.get(t.id), d = t.getDoc(), h, b; + + // Setup iframe body + if (!isIE || !tinymce.relaxedDomain) { + d.open(); + d.write(t.iframeHTML); + d.close(); + + if (tinymce.relaxedDomain) + d.domain = tinymce.relaxedDomain; + } + + // It will not steal focus while setting contentEditable + b = t.getBody(); + b.disabled = true; + + if (!s.readonly) + b.contentEditable = true; + + b.disabled = false; + + t.schema = new tinymce.html.Schema(s); + + t.dom = new tinymce.dom.DOMUtils(t.getDoc(), { + keep_values : true, + url_converter : t.convertURL, + url_converter_scope : t, + hex_colors : s.force_hex_style_colors, + class_filter : s.class_filter, + update_styles : 1, + fix_ie_paragraphs : 1, + schema : t.schema + }); + + t.parser = new tinymce.html.DomParser(s, t.schema); + + // Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included. + if (!t.settings.allow_html_in_named_anchor) { + t.parser.addAttributeFilter('name', function(nodes, name) { + var i = nodes.length, sibling, prevSibling, parent, node; + + while (i--) { + node = nodes[i]; + if (node.name === 'a' && node.firstChild) { + parent = node.parent; + + // Move children after current node + sibling = node.lastChild; + do { + prevSibling = sibling.prev; + parent.insert(sibling, node); + sibling = prevSibling; + } while (sibling); + } + } + }); + } + + // Convert src and href into data-mce-src, data-mce-href and data-mce-style + t.parser.addAttributeFilter('src,href,style', function(nodes, name) { + var i = nodes.length, node, dom = t.dom, value, internalName; + + while (i--) { + node = nodes[i]; + value = node.attr(name); + internalName = 'data-mce-' + name; + + // Add internal attribute if we need to we don't on a refresh of the document + if (!node.attributes.map[internalName]) { + if (name === "style") + node.attr(internalName, dom.serializeStyle(dom.parseStyle(value), node.name)); + else + node.attr(internalName, t.convertURL(value, name, node.name)); + } + } + }); + + // Keep scripts from executing + t.parser.addNodeFilter('script', function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + node.attr('type', 'mce-' + (node.attr('type') || 'text/javascript')); + } + }); + + t.parser.addNodeFilter('#cdata', function(nodes, name) { + var i = nodes.length, node; + + while (i--) { + node = nodes[i]; + node.type = 8; + node.name = '#comment'; + node.value = '[CDATA[' + node.value + ']]'; + } + }); + + t.parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function(nodes, name) { + var i = nodes.length, node, nonEmptyElements = t.schema.getNonEmptyElements(); + + while (i--) { + node = nodes[i]; + + if (node.isEmpty(nonEmptyElements)) + node.empty().append(new tinymce.html.Node('br', 1)).shortEnded = true; + } + }); + + t.serializer = new tinymce.dom.Serializer(s, t.dom, t.schema); + + t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer); + + t.formatter = new tinymce.Formatter(this); + + // Register default formats + t.formatter.register({ + alignleft : [ + {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}}, + {selector : 'img,table', collapsed : false, styles : {'float' : 'left'}} + ], + + aligncenter : [ + {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}}, + {selector : 'img', collapsed : false, styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}}, + {selector : 'table', collapsed : false, styles : {marginLeft : 'auto', marginRight : 'auto'}} + ], + + alignright : [ + {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}}, + {selector : 'img,table', collapsed : false, styles : {'float' : 'right'}} + ], + + alignfull : [ + {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'justify'}} + ], + + bold : [ + {inline : 'strong', remove : 'all'}, + {inline : 'span', styles : {fontWeight : 'bold'}}, + {inline : 'b', remove : 'all'} + ], + + italic : [ + {inline : 'em', remove : 'all'}, + {inline : 'span', styles : {fontStyle : 'italic'}}, + {inline : 'i', remove : 'all'} + ], + + underline : [ + {inline : 'span', styles : {textDecoration : 'underline'}, exact : true}, + {inline : 'u', remove : 'all'} + ], + + strikethrough : [ + {inline : 'span', styles : {textDecoration : 'line-through'}, exact : true}, + {inline : 'strike', remove : 'all'} + ], + + forecolor : {inline : 'span', styles : {color : '%value'}, wrap_links : false}, + hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}, wrap_links : false}, + fontname : {inline : 'span', styles : {fontFamily : '%value'}}, + fontsize : {inline : 'span', styles : {fontSize : '%value'}}, + fontsize_class : {inline : 'span', attributes : {'class' : '%value'}}, + blockquote : {block : 'blockquote', wrapper : 1, remove : 'all'}, + subscript : {inline : 'sub'}, + superscript : {inline : 'sup'}, + + link : {inline : 'a', selector : 'a', remove : 'all', split : true, deep : true, + onmatch : function(node) { + return true; + }, + + onformat : function(elm, fmt, vars) { + each(vars, function(value, key) { + t.dom.setAttrib(elm, key, value); + }); + } + }, + + removeformat : [ + {selector : 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand : true, deep : true}, + {selector : 'span', attributes : ['style', 'class'], remove : 'empty', split : true, expand : false, deep : true}, + {selector : '*', attributes : ['style', 'class'], split : false, expand : false, deep : true} + ] + }); + + // Register default block formats + each('p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp'.split(/\s/), function(name) { + t.formatter.register(name, {block : name, remove : 'all'}); + }); + + // Register user defined formats + t.formatter.register(t.settings.formats); + + t.undoManager = new tinymce.UndoManager(t); + + // Pass through + t.undoManager.onAdd.add(function(um, l) { + if (um.hasUndo()) + return t.onChange.dispatch(t, l, um); + }); + + t.undoManager.onUndo.add(function(um, l) { + return t.onUndo.dispatch(t, l, um); + }); + + t.undoManager.onRedo.add(function(um, l) { + return t.onRedo.dispatch(t, l, um); + }); + + t.forceBlocks = new tinymce.ForceBlocks(t, { + forced_root_block : s.forced_root_block + }); + + t.editorCommands = new tinymce.EditorCommands(t); + + // Pass through + t.serializer.onPreProcess.add(function(se, o) { + return t.onPreProcess.dispatch(t, o, se); + }); + + t.serializer.onPostProcess.add(function(se, o) { + return t.onPostProcess.dispatch(t, o, se); + }); + + t.onPreInit.dispatch(t); + + if (!s.gecko_spellcheck) + t.getBody().spellcheck = 0; + + if (!s.readonly) + t._addEvents(); + + t.controlManager.onPostRender.dispatch(t, t.controlManager); + t.onPostRender.dispatch(t); + + t.quirks = new tinymce.util.Quirks(this); + + if (s.directionality) + t.getBody().dir = s.directionality; + + if (s.nowrap) + t.getBody().style.whiteSpace = "nowrap"; + + if (s.handle_node_change_callback) { + t.onNodeChange.add(function(ed, cm, n) { + t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed()); + }); + } + + if (s.save_callback) { + t.onSaveContent.add(function(ed, o) { + var h = t.execCallback('save_callback', t.id, o.content, t.getBody()); + + if (h) + o.content = h; + }); + } + + if (s.onchange_callback) { + t.onChange.add(function(ed, l) { + t.execCallback('onchange_callback', t, l); + }); + } + + if (s.protect) { + t.onBeforeSetContent.add(function(ed, o) { + if (s.protect) { + each(s.protect, function(pattern) { + o.content = o.content.replace(pattern, function(str) { + return ''; + }); + }); + } + }); + } + + if (s.convert_newlines_to_brs) { + t.onBeforeSetContent.add(function(ed, o) { + if (o.initial) + o.content = o.content.replace(/\r?\n/g, '
    '); + }); + } + + if (s.preformatted) { + t.onPostProcess.add(function(ed, o) { + o.content = o.content.replace(/^\s*/, ''); + o.content = o.content.replace(/<\/pre>\s*$/, ''); + + if (o.set) + o.content = '
    ' + o.content + '
    '; + }); + } + + if (s.verify_css_classes) { + t.serializer.attribValueFilter = function(n, v) { + var s, cl; + + if (n == 'class') { + // Build regexp for classes + if (!t.classesRE) { + cl = t.dom.getClasses(); + + if (cl.length > 0) { + s = ''; + + each (cl, function(o) { + s += (s ? '|' : '') + o['class']; + }); + + t.classesRE = new RegExp('(' + s + ')', 'gi'); + } + } + + return !t.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v) || t.classesRE.test(v) ? v : ''; + } + + return v; + }; + } + + if (s.cleanup_callback) { + t.onBeforeSetContent.add(function(ed, o) { + o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); + }); + + t.onPreProcess.add(function(ed, o) { + if (o.set) + t.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o); + + if (o.get) + t.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o); + }); + + t.onPostProcess.add(function(ed, o) { + if (o.set) + o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); + + if (o.get) + o.content = t.execCallback('cleanup_callback', 'get_from_editor', o.content, o); + }); + } + + if (s.save_callback) { + t.onGetContent.add(function(ed, o) { + if (o.save) + o.content = t.execCallback('save_callback', t.id, o.content, t.getBody()); + }); + } + + if (s.handle_event_callback) { + t.onEvent.add(function(ed, e, o) { + if (t.execCallback('handle_event_callback', e, ed, o) === false) + Event.cancel(e); + }); + } + + // Add visual aids when new contents is added + t.onSetContent.add(function() { + t.addVisual(t.getBody()); + }); + + // Remove empty contents + if (s.padd_empty_editor) { + t.onPostProcess.add(function(ed, o) { + o.content = o.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/, ''); + }); + } + + if (isGecko) { + // Fix gecko link bug, when a link is placed at the end of block elements there is + // no way to move the caret behind the link. This fix adds a bogus br element after the link + function fixLinks(ed, o) { + each(ed.dom.select('a'), function(n) { + var pn = n.parentNode; + + if (ed.dom.isBlock(pn) && pn.lastChild === n) + ed.dom.add(pn, 'br', {'data-mce-bogus' : 1}); + }); + }; + + t.onExecCommand.add(function(ed, cmd) { + if (cmd === 'CreateLink') + fixLinks(ed); + }); + + t.onSetContent.add(t.selection.onSetContent.add(fixLinks)); + } + + t.load({initial : true, format : 'html'}); + t.startContent = t.getContent({format : 'raw'}); + t.undoManager.add(); + t.initialized = true; + + t.onInit.dispatch(t); + t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc()); + t.execCallback('init_instance_callback', t); + t.focus(true); + t.nodeChanged({initial : 1}); + + // Load specified content CSS last + each(t.contentCSS, function(u) { + t.dom.loadCSS(u); + }); + + // Handle auto focus + if (s.auto_focus) { + setTimeout(function () { + var ed = tinymce.get(s.auto_focus); + + ed.selection.select(ed.getBody(), 1); + ed.selection.collapse(1); + ed.getBody().focus(); + ed.getWin().focus(); + }, 100); + } + + e = null; + }, + + + focus : function(sf) { + var oed, t = this, selection = t.selection, ce = t.settings.content_editable, ieRng, controlElm, doc = t.getDoc(); + + if (!sf) { + // Get selected control element + ieRng = selection.getRng(); + if (ieRng.item) { + controlElm = ieRng.item(0); + } + + t._refreshContentEditable(); + + // Is not content editable + if (!ce) + t.getWin().focus(); + + // Focus the body as well since it's contentEditable + if (tinymce.isGecko) { + t.getBody().focus(); + } + + // Restore selected control element + // This is needed when for example an image is selected within a + // layer a call to focus will then remove the control selection + if (controlElm && controlElm.ownerDocument == doc) { + ieRng = doc.body.createControlRange(); + ieRng.addElement(controlElm); + ieRng.select(); + } + + } + + if (tinymce.activeEditor != t) { + if ((oed = tinymce.activeEditor) != null) + oed.onDeactivate.dispatch(oed, t); + + t.onActivate.dispatch(t, oed); + } + + tinymce._setActive(t); + }, + + execCallback : function(n) { + var t = this, f = t.settings[n], s; + + if (!f) + return; + + // Look through lookup + if (t.callbackLookup && (s = t.callbackLookup[n])) { + f = s.func; + s = s.scope; + } + + if (is(f, 'string')) { + s = f.replace(/\.\w+$/, ''); + s = s ? tinymce.resolve(s) : 0; + f = tinymce.resolve(f); + t.callbackLookup = t.callbackLookup || {}; + t.callbackLookup[n] = {func : f, scope : s}; + } + + return f.apply(s || t, Array.prototype.slice.call(arguments, 1)); + }, + + translate : function(s) { + var c = this.settings.language || 'en', i18n = tinymce.i18n; + + if (!s) + return ''; + + return i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) { + return i18n[c + '.' + b] || '{#' + b + '}'; + }); + }, + + getLang : function(n, dv) { + return tinymce.i18n[(this.settings.language || 'en') + '.' + n] || (is(dv) ? dv : '{#' + n + '}'); + }, + + getParam : function(n, dv, ty) { + var tr = tinymce.trim, v = is(this.settings[n]) ? this.settings[n] : dv, o; + + if (ty === 'hash') { + o = {}; + + if (is(v, 'string')) { + each(v.indexOf('=') > 0 ? v.split(/[;,](?![^=;,]*(?:[;,]|$))/) : v.split(','), function(v) { + v = v.split('='); + + if (v.length > 1) + o[tr(v[0])] = tr(v[1]); + else + o[tr(v[0])] = tr(v); + }); + } else + o = v; + + return o; + } + + return v; + }, + + nodeChanged : function(o) { + var t = this, s = t.selection, n = s.getStart() || t.getBody(); + + // Fix for bug #1896577 it seems that this can not be fired while the editor is loading + if (t.initialized) { + o = o || {}; + n = isIE && n.ownerDocument != t.getDoc() ? t.getBody() : n; // Fix for IE initial state + + // Get parents and add them to object + o.parents = []; + t.dom.getParent(n, function(node) { + if (node.nodeName == 'BODY') + return true; + + o.parents.push(node); + }); + + t.onNodeChange.dispatch( + t, + o ? o.controlManager || t.controlManager : t.controlManager, + n, + s.isCollapsed(), + o + ); + } + }, + + addButton : function(n, s) { + var t = this; + + t.buttons = t.buttons || {}; + t.buttons[n] = s; + }, + + addCommand : function(name, callback, scope) { + this.execCommands[name] = {func : callback, scope : scope || this}; + }, + + addQueryStateHandler : function(name, callback, scope) { + this.queryStateCommands[name] = {func : callback, scope : scope || this}; + }, + + addQueryValueHandler : function(name, callback, scope) { + this.queryValueCommands[name] = {func : callback, scope : scope || this}; + }, + + addShortcut : function(pa, desc, cmd_func, sc) { + var t = this, c; + + if (!t.settings.custom_shortcuts) + return false; + + t.shortcuts = t.shortcuts || {}; + + if (is(cmd_func, 'string')) { + c = cmd_func; + + cmd_func = function() { + t.execCommand(c, false, null); + }; + } + + if (is(cmd_func, 'object')) { + c = cmd_func; + + cmd_func = function() { + t.execCommand(c[0], c[1], c[2]); + }; + } + + each(explode(pa), function(pa) { + var o = { + func : cmd_func, + scope : sc || this, + desc : desc, + alt : false, + ctrl : false, + shift : false + }; + + each(explode(pa, '+'), function(v) { + switch (v) { + case 'alt': + case 'ctrl': + case 'shift': + o[v] = true; + break; + + default: + o.charCode = v.charCodeAt(0); + o.keyCode = v.toUpperCase().charCodeAt(0); + } + }); + + t.shortcuts[(o.ctrl ? 'ctrl' : '') + ',' + (o.alt ? 'alt' : '') + ',' + (o.shift ? 'shift' : '') + ',' + o.keyCode] = o; + }); + + return true; + }, + + execCommand : function(cmd, ui, val, a) { + var t = this, s = 0, o, st; + + if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd) && (!a || !a.skip_focus)) + t.focus(); + + a = extend({}, a); + t.onBeforeExecCommand.dispatch(t, cmd, ui, val, a); + if (a.terminate) + return false; + + // Command callback + if (t.execCallback('execcommand_callback', t.id, t.selection.getNode(), cmd, ui, val)) { + t.onExecCommand.dispatch(t, cmd, ui, val, a); + return true; + } + + // Registred commands + if (o = t.execCommands[cmd]) { + st = o.func.call(o.scope, ui, val); + + // Fall through on true + if (st !== true) { + t.onExecCommand.dispatch(t, cmd, ui, val, a); + return st; + } + } + + // Plugin commands + each(t.plugins, function(p) { + if (p.execCommand && p.execCommand(cmd, ui, val)) { + t.onExecCommand.dispatch(t, cmd, ui, val, a); + s = 1; + return false; + } + }); + + if (s) + return true; + + // Theme commands + if (t.theme && t.theme.execCommand && t.theme.execCommand(cmd, ui, val)) { + t.onExecCommand.dispatch(t, cmd, ui, val, a); + return true; + } + + // Editor commands + if (t.editorCommands.execCommand(cmd, ui, val)) { + t.onExecCommand.dispatch(t, cmd, ui, val, a); + return true; + } + + // Browser commands + t.getDoc().execCommand(cmd, ui, val); + t.onExecCommand.dispatch(t, cmd, ui, val, a); + }, + + queryCommandState : function(cmd) { + var t = this, o, s; + + // Is hidden then return undefined + if (t._isHidden()) + return; + + // Registred commands + if (o = t.queryStateCommands[cmd]) { + s = o.func.call(o.scope); + + // Fall though on true + if (s !== true) + return s; + } + + // Registred commands + o = t.editorCommands.queryCommandState(cmd); + if (o !== -1) + return o; + + // Browser commands + try { + return this.getDoc().queryCommandState(cmd); + } catch (ex) { + // Fails sometimes see bug: 1896577 + } + }, + + queryCommandValue : function(c) { + var t = this, o, s; + + // Is hidden then return undefined + if (t._isHidden()) + return; + + // Registred commands + if (o = t.queryValueCommands[c]) { + s = o.func.call(o.scope); + + // Fall though on true + if (s !== true) + return s; + } + + // Registred commands + o = t.editorCommands.queryCommandValue(c); + if (is(o)) + return o; + + // Browser commands + try { + return this.getDoc().queryCommandValue(c); + } catch (ex) { + // Fails sometimes see bug: 1896577 + } + }, + + show : function() { + var t = this; + + DOM.show(t.getContainer()); + DOM.hide(t.id); + t.load(); + }, + + hide : function() { + var t = this, d = t.getDoc(); + + // Fixed bug where IE has a blinking cursor left from the editor + if (isIE && d) + d.execCommand('SelectAll'); + + // We must save before we hide so Safari doesn't crash + t.save(); + DOM.hide(t.getContainer()); + DOM.setStyle(t.id, 'display', t.orgDisplay); + }, + + isHidden : function() { + return !DOM.isHidden(this.id); + }, + + setProgressState : function(b, ti, o) { + this.onSetProgressState.dispatch(this, b, ti, o); + + return b; + }, + + load : function(o) { + var t = this, e = t.getElement(), h; + + if (e) { + o = o || {}; + o.load = true; + + // Double encode existing entities in the value + h = t.setContent(is(e.value) ? e.value : e.innerHTML, o); + o.element = e; + + if (!o.no_events) + t.onLoadContent.dispatch(t, o); + + o.element = e = null; + + return h; + } + }, + + save : function(o) { + var t = this, e = t.getElement(), h, f; + + if (!e || !t.initialized) + return; + + o = o || {}; + o.save = true; + + // Add undo level will trigger onchange event + if (!o.no_events) { + t.undoManager.typing = false; + t.undoManager.add(); + } + + o.element = e; + h = o.content = t.getContent(o); + + if (!o.no_events) + t.onSaveContent.dispatch(t, o); + + h = o.content; + + if (!/TEXTAREA|INPUT/i.test(e.nodeName)) { + e.innerHTML = h; + + // Update hidden form element + if (f = DOM.getParent(t.id, 'form')) { + each(f.elements, function(e) { + if (e.name == t.id) { + e.value = h; + return false; + } + }); + } + } else + e.value = h; + + o.element = e = null; + + return h; + }, + + setContent : function(content, args) { + var self = this, rootNode, body = self.getBody(), forcedRootBlockName; + + // Setup args object + args = args || {}; + args.format = args.format || 'html'; + args.set = true; + args.content = content; + + // Do preprocessing + if (!args.no_events) + self.onBeforeSetContent.dispatch(self, args); + + content = args.content; + + // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content + // It will also be impossible to place the caret in the editor unless there is a BR element present + if (!tinymce.isIE && (content.length === 0 || /^\s+$/.test(content))) { + forcedRootBlockName = self.settings.forced_root_block; + if (forcedRootBlockName) + content = '<' + forcedRootBlockName + '>
    '; + else + content = '
    '; + + body.innerHTML = content; + self.selection.select(body, true); + self.selection.collapse(true); + return; + } + + // Parse and serialize the html + if (args.format !== 'raw') { + content = new tinymce.html.Serializer({}, self.schema).serialize( + self.parser.parse(content) + ); + } + + // Set the new cleaned contents to the editor + args.content = tinymce.trim(content); + self.dom.setHTML(body, args.content); + + // Do post processing + if (!args.no_events) + self.onSetContent.dispatch(self, args); + + self.selection.normalize(); + + return args.content; + }, + + getContent : function(args) { + var self = this, content; + + // Setup args object + args = args || {}; + args.format = args.format || 'html'; + args.get = true; + + // Do preprocessing + if (!args.no_events) + self.onBeforeGetContent.dispatch(self, args); + + // Get raw contents or by default the cleaned contents + if (args.format == 'raw') + content = self.getBody().innerHTML; + else + content = self.serializer.serialize(self.getBody(), args); + + args.content = tinymce.trim(content); + + // Do post processing + if (!args.no_events) + self.onGetContent.dispatch(self, args); + + return args.content; + }, + + isDirty : function() { + var self = this; + + return tinymce.trim(self.startContent) != tinymce.trim(self.getContent({format : 'raw', no_events : 1})) && !self.isNotDirty; + }, + + getContainer : function() { + var t = this; + + if (!t.container) + t.container = DOM.get(t.editorContainer || t.id + '_parent'); + + return t.container; + }, + + getContentAreaContainer : function() { + return this.contentAreaContainer; + }, + + getElement : function() { + return DOM.get(this.settings.content_element || this.id); + }, + + getWin : function() { + var t = this, e; + + if (!t.contentWindow) { + e = DOM.get(t.id + "_ifr"); + + if (e) + t.contentWindow = e.contentWindow; + } + + return t.contentWindow; + }, + + getDoc : function() { + var t = this, w; + + if (!t.contentDocument) { + w = t.getWin(); + + if (w) + t.contentDocument = w.document; + } + + return t.contentDocument; + }, + + getBody : function() { + return this.bodyElement || this.getDoc().body; + }, + + convertURL : function(u, n, e) { + var t = this, s = t.settings; + + // Use callback instead + if (s.urlconverter_callback) + return t.execCallback('urlconverter_callback', u, e, true, n); + + // Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs + if (!s.convert_urls || (e && e.nodeName == 'LINK') || u.indexOf('file:') === 0) + return u; + + // Convert to relative + if (s.relative_urls) + return t.documentBaseURI.toRelative(u); + + // Convert to absolute + u = t.documentBaseURI.toAbsolute(u, s.remove_script_host); + + return u; + }, + + addVisual : function(e) { + var t = this, s = t.settings; + + e = e || t.getBody(); + + if (!is(t.hasVisual)) + t.hasVisual = s.visual; + + each(t.dom.select('table,a', e), function(e) { + var v; + + switch (e.nodeName) { + case 'TABLE': + v = t.dom.getAttrib(e, 'border'); + + if (!v || v == '0') { + if (t.hasVisual) + t.dom.addClass(e, s.visual_table_class); + else + t.dom.removeClass(e, s.visual_table_class); + } + + return; + + case 'A': + v = t.dom.getAttrib(e, 'name'); + + if (v) { + if (t.hasVisual) + t.dom.addClass(e, 'mceItemAnchor'); + else + t.dom.removeClass(e, 'mceItemAnchor'); + } + + return; + } + }); + + t.onVisualAid.dispatch(t, e, t.hasVisual); + }, + + remove : function() { + var t = this, e = t.getContainer(); + + t.removed = 1; // Cancels post remove event execution + t.hide(); + + t.execCallback('remove_instance_callback', t); + t.onRemove.dispatch(t); + + // Clear all execCommand listeners this is required to avoid errors if the editor was removed inside another command + t.onExecCommand.listeners = []; + + tinymce.remove(t); + DOM.remove(e); + }, + + destroy : function(s) { + var t = this; + + // One time is enough + if (t.destroyed) + return; + + if (!s) { + tinymce.removeUnload(t.destroy); + tinyMCE.onBeforeUnload.remove(t._beforeUnload); + + // Manual destroy + if (t.theme && t.theme.destroy) + t.theme.destroy(); + + // Destroy controls, selection and dom + t.controlManager.destroy(); + t.selection.destroy(); + t.dom.destroy(); + + // Remove all events + + // Don't clear the window or document if content editable + // is enabled since other instances might still be present + if (!t.settings.content_editable) { + Event.clear(t.getWin()); + Event.clear(t.getDoc()); + } + + Event.clear(t.getBody()); + Event.clear(t.formElement); + } + + if (t.formElement) { + t.formElement.submit = t.formElement._mceOldSubmit; + t.formElement._mceOldSubmit = null; + } + + t.contentAreaContainer = t.formElement = t.container = t.settings.content_element = t.bodyElement = t.contentDocument = t.contentWindow = null; + + if (t.selection) + t.selection = t.selection.win = t.selection.dom = t.selection.dom.doc = null; + + t.destroyed = 1; + }, + + // Internal functions + + _addEvents : function() { + // 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset + var t = this, i, s = t.settings, dom = t.dom, lo = { + mouseup : 'onMouseUp', + mousedown : 'onMouseDown', + click : 'onClick', + keyup : 'onKeyUp', + keydown : 'onKeyDown', + keypress : 'onKeyPress', + submit : 'onSubmit', + reset : 'onReset', + contextmenu : 'onContextMenu', + dblclick : 'onDblClick', + paste : 'onPaste' // Doesn't work in all browsers yet + }; + + function eventHandler(e, o) { + var ty = e.type; + + // Don't fire events when it's removed + if (t.removed) + return; + + // Generic event handler + if (t.onEvent.dispatch(t, e, o) !== false) { + // Specific event handler + t[lo[e.fakeType || e.type]].dispatch(t, e, o); + } + }; + + // Add DOM events + each(lo, function(v, k) { + switch (k) { + case 'contextmenu': + dom.bind(t.getDoc(), k, eventHandler); + break; + + case 'paste': + dom.bind(t.getBody(), k, function(e) { + eventHandler(e); + }); + break; + + case 'submit': + case 'reset': + dom.bind(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler); + break; + + default: + dom.bind(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler); + } + }); + + dom.bind(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) { + t.focus(true); + }); + + + // Fixes bug where a specified document_base_uri could result in broken images + // This will also fix drag drop of images in Gecko + if (tinymce.isGecko) { + dom.bind(t.getDoc(), 'DOMNodeInserted', function(e) { + var v; + + e = e.target; + + if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('data-mce-src'))) + e.src = t.documentBaseURI.toAbsolute(v); + }); + } + + // Set various midas options in Gecko + if (isGecko) { + function setOpts() { + var t = this, d = t.getDoc(), s = t.settings; + + if (isGecko && !s.readonly) { + t._refreshContentEditable(); + + try { + // Try new Gecko method + d.execCommand("styleWithCSS", 0, false); + } catch (ex) { + // Use old method + if (!t._isHidden()) + try {d.execCommand("useCSS", 0, true);} catch (ex) {} + } + + if (!s.table_inline_editing) + try {d.execCommand('enableInlineTableEditing', false, false);} catch (ex) {} + + if (!s.object_resizing) + try {d.execCommand('enableObjectResizing', false, false);} catch (ex) {} + } + }; + + t.onBeforeExecCommand.add(setOpts); + t.onMouseDown.add(setOpts); + } + + // Add node change handlers + t.onMouseUp.add(t.nodeChanged); + //t.onClick.add(t.nodeChanged); + t.onKeyUp.add(function(ed, e) { + var c = e.keyCode; + + if ((c >= 33 && c <= 36) || (c >= 37 && c <= 40) || c == 13 || c == 45 || c == 46 || c == 8 || (tinymce.isMac && (c == 91 || c == 93)) || e.ctrlKey) + t.nodeChanged(); + }); + + + // Add block quote deletion handler + t.onKeyDown.add(function(ed, e) { + if (e.keyCode != VK.BACKSPACE) + return; + + var rng = ed.selection.getRng(); + if (!rng.collapsed) + return; + + var n = rng.startContainer; + var offset = rng.startOffset; + + while (n && n.nodeType && n.nodeType != 1 && n.parentNode) + n = n.parentNode; + + // Is the cursor at the beginning of a blockquote? + if (n && n.parentNode && n.parentNode.tagName === 'BLOCKQUOTE' && n.parentNode.firstChild == n && offset == 0) { + // Remove the blockquote + ed.formatter.toggle('blockquote', null, n.parentNode); + + // Move the caret to the beginning of n + rng.setStart(n, 0); + rng.setEnd(n, 0); + ed.selection.setRng(rng); + ed.selection.collapse(false); + } + }); + + + + // Add reset handler + t.onReset.add(function() { + t.setContent(t.startContent, {format : 'raw'}); + }); + + // Add shortcuts + if (s.custom_shortcuts) { + if (s.custom_undo_redo_keyboard_shortcuts) { + t.addShortcut('ctrl+z', t.getLang('undo_desc'), 'Undo'); + t.addShortcut('ctrl+y', t.getLang('redo_desc'), 'Redo'); + } + + // Add default shortcuts for gecko + t.addShortcut('ctrl+b', t.getLang('bold_desc'), 'Bold'); + t.addShortcut('ctrl+i', t.getLang('italic_desc'), 'Italic'); + t.addShortcut('ctrl+u', t.getLang('underline_desc'), 'Underline'); + + // BlockFormat shortcuts keys + for (i=1; i<=6; i++) + t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]); + + t.addShortcut('ctrl+7', '', ['FormatBlock', false, 'p']); + t.addShortcut('ctrl+8', '', ['FormatBlock', false, 'div']); + t.addShortcut('ctrl+9', '', ['FormatBlock', false, 'address']); + + function find(e) { + var v = null; + + if (!e.altKey && !e.ctrlKey && !e.metaKey) + return v; + + each(t.shortcuts, function(o) { + if (tinymce.isMac && o.ctrl != e.metaKey) + return; + else if (!tinymce.isMac && o.ctrl != e.ctrlKey) + return; + + if (o.alt != e.altKey) + return; + + if (o.shift != e.shiftKey) + return; + + if (e.keyCode == o.keyCode || (e.charCode && e.charCode == o.charCode)) { + v = o; + return false; + } + }); + + return v; + }; + + t.onKeyUp.add(function(ed, e) { + var o = find(e); + + if (o) + return Event.cancel(e); + }); + + t.onKeyPress.add(function(ed, e) { + var o = find(e); + + if (o) + return Event.cancel(e); + }); + + t.onKeyDown.add(function(ed, e) { + var o = find(e); + + if (o) { + o.func.call(o.scope); + return Event.cancel(e); + } + }); + } + + if (tinymce.isIE) { + // Fix so resize will only update the width and height attributes not the styles of an image + // It will also block mceItemNoResize items + dom.bind(t.getDoc(), 'controlselect', function(e) { + var re = t.resizeInfo, cb; + + e = e.target; + + // Don't do this action for non image elements + if (e.nodeName !== 'IMG') + return; + + if (re) + dom.unbind(re.node, re.ev, re.cb); + + if (!dom.hasClass(e, 'mceItemNoResize')) { + ev = 'resizeend'; + cb = dom.bind(e, ev, function(e) { + var v; + + e = e.target; + + if (v = dom.getStyle(e, 'width')) { + dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, '')); + dom.setStyle(e, 'width', ''); + } + + if (v = dom.getStyle(e, 'height')) { + dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, '')); + dom.setStyle(e, 'height', ''); + } + }); + } else { + ev = 'resizestart'; + cb = dom.bind(e, 'resizestart', Event.cancel, Event); + } + + re = t.resizeInfo = { + node : e, + ev : ev, + cb : cb + }; + }); + } + + if (tinymce.isOpera) { + t.onClick.add(function(ed, e) { + Event.prevent(e); + }); + } + + // Add custom undo/redo handlers + if (s.custom_undo_redo) { + function addUndo() { + t.undoManager.typing = false; + t.undoManager.add(); + }; + + var focusLostFunc = tinymce.isGecko ? 'blur' : 'focusout'; + dom.bind(t.getDoc(), focusLostFunc, function(e){ + if (!t.removed && t.undoManager.typing) + addUndo(); + }); + + // Add undo level when contents is drag/dropped within the editor + t.dom.bind(t.dom.getRoot(), 'dragend', function(e) { + addUndo(); + }); + + t.onKeyUp.add(function(ed, e) { + var keyCode = e.keyCode; + + if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45 || e.ctrlKey) + addUndo(); + }); + + t.onKeyDown.add(function(ed, e) { + var keyCode = e.keyCode, sel; + + if (keyCode == 8) { + sel = t.getDoc().selection; + + // Fix IE control + backspace browser bug + if (sel && sel.createRange && sel.createRange().item) { + t.undoManager.beforeChange(); + ed.dom.remove(sel.createRange().item(0)); + addUndo(); + + return Event.cancel(e); + } + } + + // Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter + if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45) { + // Add position before enter key is pressed, used by IE since it still uses the default browser behavior + // Todo: Remove this once we normalize enter behavior on IE + if (tinymce.isIE && keyCode == 13) + t.undoManager.beforeChange(); + + if (t.undoManager.typing) + addUndo(); + + return; + } + + // If key isn't shift,ctrl,alt,capslock,metakey + if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !t.undoManager.typing) { + t.undoManager.beforeChange(); + t.undoManager.typing = true; + t.undoManager.add(); + } + }); + + t.onMouseDown.add(function() { + if (t.undoManager.typing) + addUndo(); + }); + } + + // Bug fix for FireFox keeping styles from end of selection instead of start. + if (tinymce.isGecko) { + function getAttributeApplyFunction() { + var template = t.dom.getAttribs(t.selection.getStart().cloneNode(false)); + + return function() { + var target = t.selection.getStart(); + + if (target !== t.getBody()) { + t.dom.setAttrib(target, "style", null); + + each(template, function(attr) { + target.setAttributeNode(attr.cloneNode(true)); + }); + } + }; + } + + function isSelectionAcrossElements() { + var s = t.selection; + + return !s.isCollapsed() && s.getStart() != s.getEnd(); + } + + t.onKeyPress.add(function(ed, e) { + var applyAttributes; + + if ((e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) { + applyAttributes = getAttributeApplyFunction(); + t.getDoc().execCommand('delete', false, null); + applyAttributes(); + + return Event.cancel(e); + } + }); + + t.dom.bind(t.getDoc(), 'cut', function(e) { + var applyAttributes; + + if (isSelectionAcrossElements()) { + applyAttributes = getAttributeApplyFunction(); + t.onKeyUp.addToTop(Event.cancel, Event); + + setTimeout(function() { + applyAttributes(); + t.onKeyUp.remove(Event.cancel, Event); + }, 0); + } + }); + } + }, + + _refreshContentEditable : function() { + var self = this, body, parent; + + // Check if the editor was hidden and the re-initalize contentEditable mode by removing and adding the body again + if (self._isHidden()) { + body = self.getBody(); + parent = body.parentNode; + + parent.removeChild(body); + parent.appendChild(body); + + body.focus(); + } + }, + + _isHidden : function() { + var s; + + if (!isGecko) + return 0; + + // Weird, wheres that cursor selection? + s = this.selection.getSel(); + return (!s || !s.rangeCount || s.rangeCount == 0); + } + }); +})(tinymce); + +(function(tinymce) { + // Added for compression purposes + var each = tinymce.each, undefined, TRUE = true, FALSE = false; + + tinymce.EditorCommands = function(editor) { + var dom = editor.dom, + selection = editor.selection, + commands = {state: {}, exec : {}, value : {}}, + settings = editor.settings, + formatter = editor.formatter, + bookmark; + + function execCommand(command, ui, value) { + var func; + + command = command.toLowerCase(); + if (func = commands.exec[command]) { + func(command, ui, value); + return TRUE; + } + + return FALSE; + }; + + function queryCommandState(command) { + var func; + + command = command.toLowerCase(); + if (func = commands.state[command]) + return func(command); + + return -1; + }; + + function queryCommandValue(command) { + var func; + + command = command.toLowerCase(); + if (func = commands.value[command]) + return func(command); + + return FALSE; + }; + + function addCommands(command_list, type) { + type = type || 'exec'; + + each(command_list, function(callback, command) { + each(command.toLowerCase().split(','), function(command) { + commands[type][command] = callback; + }); + }); + }; + + // Expose public methods + tinymce.extend(this, { + execCommand : execCommand, + queryCommandState : queryCommandState, + queryCommandValue : queryCommandValue, + addCommands : addCommands + }); + + // Private methods + + function execNativeCommand(command, ui, value) { + if (ui === undefined) + ui = FALSE; + + if (value === undefined) + value = null; + + return editor.getDoc().execCommand(command, ui, value); + }; + + function isFormatMatch(name) { + return formatter.match(name); + }; + + function toggleFormat(name, value) { + formatter.toggle(name, value ? {value : value} : undefined); + }; + + function storeSelection(type) { + bookmark = selection.getBookmark(type); + }; + + function restoreSelection() { + selection.moveToBookmark(bookmark); + }; + + // Add execCommand overrides + addCommands({ + // Ignore these, added for compatibility + 'mceResetDesignMode,mceBeginUndoLevel' : function() {}, + + // Add undo manager logic + 'mceEndUndoLevel,mceAddUndoLevel' : function() { + editor.undoManager.add(); + }, + + 'Cut,Copy,Paste' : function(command) { + var doc = editor.getDoc(), failed; + + // Try executing the native command + try { + execNativeCommand(command); + } catch (ex) { + // Command failed + failed = TRUE; + } + + // Present alert message about clipboard access not being available + if (failed || !doc.queryCommandSupported(command)) { + if (tinymce.isGecko) { + editor.windowManager.confirm(editor.getLang('clipboard_msg'), function(state) { + if (state) + open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', '_blank'); + }); + } else + editor.windowManager.alert(editor.getLang('clipboard_no_support')); + } + }, + + // Override unlink command + unlink : function(command) { + if (selection.isCollapsed()) + selection.select(selection.getNode()); + + execNativeCommand(command); + selection.collapse(FALSE); + }, + + // Override justify commands to use the text formatter engine + 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) { + var align = command.substring(7); + + // Remove all other alignments first + each('left,center,right,full'.split(','), function(name) { + if (align != name) + formatter.remove('align' + name); + }); + + toggleFormat('align' + align); + execCommand('mceRepaint'); + }, + + // Override list commands to fix WebKit bug + 'InsertUnorderedList,InsertOrderedList' : function(command) { + var listElm, listParent; + + execNativeCommand(command); + + // WebKit produces lists within block elements so we need to split them + // we will replace the native list creation logic to custom logic later on + // TODO: Remove this when the list creation logic is removed + listElm = dom.getParent(selection.getNode(), 'ol,ul'); + if (listElm) { + listParent = listElm.parentNode; + + // If list is within a text block then split that block + if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) { + storeSelection(); + dom.split(listParent, listElm); + restoreSelection(); + } + } + }, + + // Override commands to use the text formatter engine + 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript' : function(command) { + toggleFormat(command); + }, + + // Override commands to use the text formatter engine + 'ForeColor,HiliteColor,FontName' : function(command, ui, value) { + toggleFormat(command, value); + }, + + FontSize : function(command, ui, value) { + var fontClasses, fontSizes; + + // Convert font size 1-7 to styles + if (value >= 1 && value <= 7) { + fontSizes = tinymce.explode(settings.font_size_style_values); + fontClasses = tinymce.explode(settings.font_size_classes); + + if (fontClasses) + value = fontClasses[value - 1] || value; + else + value = fontSizes[value - 1] || value; + } + + toggleFormat(command, value); + }, + + RemoveFormat : function(command) { + formatter.remove(command); + }, + + mceBlockQuote : function(command) { + toggleFormat('blockquote'); + }, + + FormatBlock : function(command, ui, value) { + return toggleFormat(value || 'p'); + }, + + mceCleanup : function() { + var bookmark = selection.getBookmark(); + + editor.setContent(editor.getContent({cleanup : TRUE}), {cleanup : TRUE}); + + selection.moveToBookmark(bookmark); + }, + + mceRemoveNode : function(command, ui, value) { + var node = value || selection.getNode(); + + // Make sure that the body node isn't removed + if (node != editor.getBody()) { + storeSelection(); + editor.dom.remove(node, TRUE); + restoreSelection(); + } + }, + + mceSelectNodeDepth : function(command, ui, value) { + var counter = 0; + + dom.getParent(selection.getNode(), function(node) { + if (node.nodeType == 1 && counter++ == value) { + selection.select(node); + return FALSE; + } + }, editor.getBody()); + }, + + mceSelectNode : function(command, ui, value) { + selection.select(value); + }, + + mceInsertContent : function(command, ui, value) { + var parser, serializer, parentNode, rootNode, fragment, args, + marker, nodeRect, viewPortRect, rng, node, node2, bookmarkHtml, viewportBodyElement; + + //selection.normalize(); + + // Setup parser and serializer + parser = editor.parser; + serializer = new tinymce.html.Serializer({}, editor.schema); + bookmarkHtml = '\uFEFF'; + + // Run beforeSetContent handlers on the HTML to be inserted + args = {content: value, format: 'html'}; + selection.onBeforeSetContent.dispatch(selection, args); + value = args.content; + + // Add caret at end of contents if it's missing + if (value.indexOf('{$caret}') == -1) + value += '{$caret}'; + + // Replace the caret marker with a span bookmark element + value = value.replace(/\{\$caret\}/, bookmarkHtml); + + // Insert node maker where we will insert the new HTML and get it's parent + if (!selection.isCollapsed()) + editor.getDoc().execCommand('Delete', false, null); + + parentNode = selection.getNode(); + + // Parse the fragment within the context of the parent node + args = {context : parentNode.nodeName.toLowerCase()}; + fragment = parser.parse(value, args); + + // Move the caret to a more suitable location + node = fragment.lastChild; + if (node.attr('id') == 'mce_marker') { + marker = node; + + for (node = node.prev; node; node = node.walk(true)) { + if (node.type == 3 || !dom.isBlock(node.name)) { + node.parent.insert(marker, node, node.name === 'br'); + break; + } + } + } + + // If parser says valid we can insert the contents into that parent + if (!args.invalid) { + value = serializer.serialize(fragment); + + // Check if parent is empty or only has one BR element then set the innerHTML of that parent + node = parentNode.firstChild; + node2 = parentNode.lastChild; + if (!node || (node === node2 && node.nodeName === 'BR')) + dom.setHTML(parentNode, value); + else + selection.setContent(value); + } else { + // If the fragment was invalid within that context then we need + // to parse and process the parent it's inserted into + + // Insert bookmark node and get the parent + selection.setContent(bookmarkHtml); + parentNode = editor.selection.getNode(); + rootNode = editor.getBody(); + + // Opera will return the document node when selection is in root + if (parentNode.nodeType == 9) + parentNode = node = rootNode; + else + node = parentNode; + + // Find the ancestor just before the root element + while (node !== rootNode) { + parentNode = node; + node = node.parentNode; + } + + // Get the outer/inner HTML depending on if we are in the root and parser and serialize that + value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode); + value = serializer.serialize( + parser.parse( + // Need to replace by using a function since $ in the contents would otherwise be a problem + value.replace(//i, function() { + return serializer.serialize(fragment); + }) + ) + ); + + // Set the inner/outer HTML depending on if we are in the root or not + if (parentNode == rootNode) + dom.setHTML(rootNode, value); + else + dom.setOuterHTML(parentNode, value); + } + + marker = dom.get('mce_marker'); + + // Scroll range into view scrollIntoView on element can't be used since it will scroll the main view port as well + nodeRect = dom.getRect(marker); + viewPortRect = dom.getViewPort(editor.getWin()); + + // Check if node is out side the viewport if it is then scroll to it + if ((nodeRect.y + nodeRect.h > viewPortRect.y + viewPortRect.h || nodeRect.y < viewPortRect.y) || + (nodeRect.x > viewPortRect.x + viewPortRect.w || nodeRect.x < viewPortRect.x)) { + viewportBodyElement = tinymce.isIE ? editor.getDoc().documentElement : editor.getBody(); + viewportBodyElement.scrollLeft = nodeRect.x; + viewportBodyElement.scrollTop = nodeRect.y - viewPortRect.h + 25; + } + + // Move selection before marker and remove it + rng = dom.createRng(); + + // If previous sibling is a text node set the selection to the end of that node + node = marker.previousSibling; + if (node && node.nodeType == 3) { + rng.setStart(node, node.nodeValue.length); + } else { + // If the previous sibling isn't a text node or doesn't exist set the selection before the marker node + rng.setStartBefore(marker); + rng.setEndBefore(marker); + } + + // Remove the marker node and set the new range + dom.remove(marker); + selection.setRng(rng); + + // Dispatch after event and add any visual elements needed + selection.onSetContent.dispatch(selection, args); + editor.addVisual(); + }, + + mceInsertRawHTML : function(command, ui, value) { + selection.setContent('tiny_mce_marker'); + editor.setContent(editor.getContent().replace(/tiny_mce_marker/g, function() { return value })); + }, + + mceSetContent : function(command, ui, value) { + editor.setContent(value); + }, + + 'Indent,Outdent' : function(command) { + var intentValue, indentUnit, value; + + // Setup indent level + intentValue = settings.indentation; + indentUnit = /[a-z%]+$/i.exec(intentValue); + intentValue = parseInt(intentValue); + + if (!queryCommandState('InsertUnorderedList') && !queryCommandState('InsertOrderedList')) { + each(selection.getSelectedBlocks(), function(element) { + if (command == 'outdent') { + value = Math.max(0, parseInt(element.style.paddingLeft || 0) - intentValue); + dom.setStyle(element, 'paddingLeft', value ? value + indentUnit : ''); + } else + dom.setStyle(element, 'paddingLeft', (parseInt(element.style.paddingLeft || 0) + intentValue) + indentUnit); + }); + } else + execNativeCommand(command); + }, + + mceRepaint : function() { + var bookmark; + + if (tinymce.isGecko) { + try { + storeSelection(TRUE); + + if (selection.getSel()) + selection.getSel().selectAllChildren(editor.getBody()); + + selection.collapse(TRUE); + restoreSelection(); + } catch (ex) { + // Ignore + } + } + }, + + mceToggleFormat : function(command, ui, value) { + formatter.toggle(value); + }, + + InsertHorizontalRule : function() { + editor.execCommand('mceInsertContent', false, '
    '); + }, + + mceToggleVisualAid : function() { + editor.hasVisual = !editor.hasVisual; + editor.addVisual(); + }, + + mceReplaceContent : function(command, ui, value) { + editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, selection.getContent({format : 'text'}))); + }, + + mceInsertLink : function(command, ui, value) { + var anchor; + + if (typeof(value) == 'string') + value = {href : value}; + + anchor = dom.getParent(selection.getNode(), 'a'); + + // Spaces are never valid in URLs and it's a very common mistake for people to make so we fix it here. + value.href = value.href.replace(' ', '%20'); + + // Remove existing links if there could be child links or that the href isn't specified + if (!anchor || !value.href) { + formatter.remove('link'); + } + + // Apply new link to selection + if (value.href) { + formatter.apply('link', value, anchor); + } + }, + + selectAll : function() { + var root = dom.getRoot(), rng = dom.createRng(); + + rng.setStart(root, 0); + rng.setEnd(root, root.childNodes.length); + + editor.selection.setRng(rng); + } + }); + + // Add queryCommandState overrides + addCommands({ + // Override justify commands + 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) { + var name = 'align' + command.substring(7); + // Use Formatter.matchNode instead of Formatter.match so that we don't match on parent node. This fixes bug where for both left + // and right align buttons can be active. This could occur when selected nodes have align right and the parent has align left. + var nodes = selection.isCollapsed() ? [selection.getNode()] : selection.getSelectedBlocks(); + var matches = tinymce.map(nodes, function(node) { + return !!formatter.matchNode(node, name); + }); + return tinymce.inArray(matches, TRUE) !== -1; + }, + + 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript' : function(command) { + return isFormatMatch(command); + }, + + mceBlockQuote : function() { + return isFormatMatch('blockquote'); + }, + + Outdent : function() { + var node; + + if (settings.inline_styles) { + if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0) + return TRUE; + + if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0) + return TRUE; + } + + return queryCommandState('InsertUnorderedList') || queryCommandState('InsertOrderedList') || (!settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE')); + }, + + 'InsertUnorderedList,InsertOrderedList' : function(command) { + return dom.getParent(selection.getNode(), command == 'insertunorderedlist' ? 'UL' : 'OL'); + } + }, 'state'); + + // Add queryCommandValue overrides + addCommands({ + 'FontSize,FontName' : function(command) { + var value = 0, parent; + + if (parent = dom.getParent(selection.getNode(), 'span')) { + if (command == 'fontsize') + value = parent.style.fontSize; + else + value = parent.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase(); + } + + return value; + } + }, 'value'); + + // Add undo manager logic + if (settings.custom_undo_redo) { + addCommands({ + Undo : function() { + editor.undoManager.undo(); + }, + + Redo : function() { + editor.undoManager.redo(); + } + }); + } + }; +})(tinymce); + +(function(tinymce) { + var Dispatcher = tinymce.util.Dispatcher; + + tinymce.UndoManager = function(editor) { + var self, index = 0, data = [], beforeBookmark; + + function getContent() { + return tinymce.trim(editor.getContent({format : 'raw', no_events : 1})); + }; + + return self = { + typing : false, + + onAdd : new Dispatcher(self), + + onUndo : new Dispatcher(self), + + onRedo : new Dispatcher(self), + + beforeChange : function() { + beforeBookmark = editor.selection.getBookmark(2, true); + }, + + add : function(level) { + var i, settings = editor.settings, lastLevel; + + level = level || {}; + level.content = getContent(); + + // Add undo level if needed + lastLevel = data[index]; + if (lastLevel && lastLevel.content == level.content) + return null; + + // Set before bookmark on previous level + if (data[index]) + data[index].beforeBookmark = beforeBookmark; + + // Time to compress + if (settings.custom_undo_redo_levels) { + if (data.length > settings.custom_undo_redo_levels) { + for (i = 0; i < data.length - 1; i++) + data[i] = data[i + 1]; + + data.length--; + index = data.length; + } + } + + // Get a non intrusive normalized bookmark + level.bookmark = editor.selection.getBookmark(2, true); + + // Crop array if needed + if (index < data.length - 1) + data.length = index + 1; + + data.push(level); + index = data.length - 1; + + self.onAdd.dispatch(self, level); + editor.isNotDirty = 0; + + return level; + }, + + undo : function() { + var level, i; + + if (self.typing) { + self.add(); + self.typing = false; + } + + if (index > 0) { + level = data[--index]; + + editor.setContent(level.content, {format : 'raw'}); + editor.selection.moveToBookmark(level.beforeBookmark); + + self.onUndo.dispatch(self, level); + } + + return level; + }, + + redo : function() { + var level; + + if (index < data.length - 1) { + level = data[++index]; + + editor.setContent(level.content, {format : 'raw'}); + editor.selection.moveToBookmark(level.bookmark); + + self.onRedo.dispatch(self, level); + } + + return level; + }, + + clear : function() { + data = []; + index = 0; + self.typing = false; + }, + + hasUndo : function() { + return index > 0 || this.typing; + }, + + hasRedo : function() { + return index < data.length - 1 && !this.typing; + } + }; + }; +})(tinymce); + +(function(tinymce) { + // Shorten names + var Event = tinymce.dom.Event, + isIE = tinymce.isIE, + isGecko = tinymce.isGecko, + isOpera = tinymce.isOpera, + each = tinymce.each, + extend = tinymce.extend, + TRUE = true, + FALSE = false; + + function cloneFormats(node) { + var clone, temp, inner; + + do { + if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(node.nodeName)) { + if (clone) { + temp = node.cloneNode(false); + temp.appendChild(clone); + clone = temp; + } else { + clone = inner = node.cloneNode(false); + } + + clone.removeAttribute('id'); + } + } while (node = node.parentNode); + + if (clone) + return {wrapper : clone, inner : inner}; + }; + + // Checks if the selection/caret is at the end of the specified block element + function isAtEnd(rng, par) { + var rng2 = par.ownerDocument.createRange(); + + rng2.setStart(rng.endContainer, rng.endOffset); + rng2.setEndAfter(par); + + // Get number of characters to the right of the cursor if it's zero then we are at the end and need to merge the next block element + return rng2.cloneContents().textContent.length == 0; + }; + + function splitList(selection, dom, li) { + var listBlock, block; + + if (dom.isEmpty(li)) { + listBlock = dom.getParent(li, 'ul,ol'); + + if (!dom.getParent(listBlock.parentNode, 'ul,ol')) { + dom.split(listBlock, li); + block = dom.create('p', 0, '
    '); + dom.replace(block, li); + selection.select(block, 1); + } + + return FALSE; + } + + return TRUE; + }; + + tinymce.create('tinymce.ForceBlocks', { + ForceBlocks : function(ed) { + var t = this, s = ed.settings, elm; + + t.editor = ed; + t.dom = ed.dom; + elm = (s.forced_root_block || 'p').toLowerCase(); + s.element = elm.toUpperCase(); + + ed.onPreInit.add(t.setup, t); + }, + + setup : function() { + var t = this, ed = t.editor, s = ed.settings, dom = ed.dom, selection = ed.selection, blockElements = ed.schema.getBlockElements(); + + // Force root blocks + if (s.forced_root_block) { + function addRootBlocks() { + var node = selection.getStart(), rootNode = ed.getBody(), rng, startContainer, startOffset, endContainer, endOffset, rootBlockNode, tempNode, offset = -0xFFFFFF; + + if (!node || node.nodeType !== 1) + return; + + // Check if node is wrapped in block + while (node != rootNode) { + if (blockElements[node.nodeName]) + return; + + node = node.parentNode; + } + + // Get current selection + rng = selection.getRng(); + if (rng.setStart) { + startContainer = rng.startContainer; + startOffset = rng.startOffset; + endContainer = rng.endContainer; + endOffset = rng.endOffset; + } else { + // Force control range into text range + if (rng.item) { + rng = ed.getDoc().body.createTextRange(); + rng.moveToElementText(rng.item(0)); + } + + tmpRng = rng.duplicate(); + tmpRng.collapse(true); + startOffset = tmpRng.move('character', offset) * -1; + + if (!tmpRng.collapsed) { + tmpRng = rng.duplicate(); + tmpRng.collapse(false); + endOffset = (tmpRng.move('character', offset) * -1) - startOffset; + } + } + + // Wrap non block elements and text nodes + for (node = rootNode.firstChild; node; node) { + if (node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName])) { + if (!rootBlockNode) { + rootBlockNode = dom.create(s.forced_root_block); + node.parentNode.insertBefore(rootBlockNode, node); + } + + tempNode = node; + node = node.nextSibling; + rootBlockNode.appendChild(tempNode); + } else { + rootBlockNode = null; + node = node.nextSibling; + } + } + + if (rng.setStart) { + rng.setStart(startContainer, startOffset); + rng.setEnd(endContainer, endOffset); + selection.setRng(rng); + } else { + try { + rng = ed.getDoc().body.createTextRange(); + rng.moveToElementText(rootNode); + rng.collapse(true); + rng.moveStart('character', startOffset); + + if (endOffset > 0) + rng.moveEnd('character', endOffset); + + rng.select(); + } catch (ex) { + // Ignore + } + } + + ed.nodeChanged(); + }; + + ed.onKeyUp.add(addRootBlocks); + ed.onClick.add(addRootBlocks); + } + + if (s.force_br_newlines) { + // Force IE to produce BRs on enter + if (isIE) { + ed.onKeyPress.add(function(ed, e) { + var n; + + if (e.keyCode == 13 && selection.getNode().nodeName != 'LI') { + selection.setContent('
    ', {format : 'raw'}); + n = dom.get('__'); + n.removeAttribute('id'); + selection.select(n); + selection.collapse(); + return Event.cancel(e); + } + }); + } + } + + if (s.force_p_newlines) { + if (!isIE) { + ed.onKeyPress.add(function(ed, e) { + if (e.keyCode == 13 && !e.shiftKey && !t.insertPara(e)) + Event.cancel(e); + }); + } else { + // Ungly hack to for IE to preserve the formatting when you press + // enter at the end of a block element with formatted contents + // This logic overrides the browsers default logic with + // custom logic that enables us to control the output + tinymce.addUnload(function() { + t._previousFormats = 0; // Fix IE leak + }); + + ed.onKeyPress.add(function(ed, e) { + t._previousFormats = 0; + + // Clone the current formats, this will later be applied to the new block contents + if (e.keyCode == 13 && !e.shiftKey && ed.selection.isCollapsed() && s.keep_styles) + t._previousFormats = cloneFormats(ed.selection.getStart()); + }); + + ed.onKeyUp.add(function(ed, e) { + // Let IE break the element and the wrap the new caret location in the previous formats + if (e.keyCode == 13 && !e.shiftKey) { + var parent = ed.selection.getStart(), fmt = t._previousFormats; + + // Parent is an empty block + if (!parent.hasChildNodes() && fmt) { + parent = dom.getParent(parent, dom.isBlock); + + if (parent && parent.nodeName != 'LI') { + parent.innerHTML = ''; + + if (t._previousFormats) { + parent.appendChild(fmt.wrapper); + fmt.inner.innerHTML = '\uFEFF'; + } else + parent.innerHTML = '\uFEFF'; + + selection.select(parent, 1); + selection.collapse(true); + ed.getDoc().execCommand('Delete', false, null); + t._previousFormats = 0; + } + } + } + }); + } + + if (isGecko) { + ed.onKeyDown.add(function(ed, e) { + if ((e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) + t.backspaceDelete(e, e.keyCode == 8); + }); + } + } + + // Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973 + if (tinymce.isWebKit) { + function insertBr(ed) { + var rng = selection.getRng(), br, div = dom.create('div', null, ' '), divYPos, vpHeight = dom.getViewPort(ed.getWin()).h; + + // Insert BR element + rng.insertNode(br = dom.create('br')); + + // Place caret after BR + rng.setStartAfter(br); + rng.setEndAfter(br); + selection.setRng(rng); + + // Could not place caret after BR then insert an nbsp entity and move the caret + if (selection.getSel().focusNode == br.previousSibling) { + selection.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'), br)); + selection.collapse(TRUE); + } + + // Create a temporary DIV after the BR and get the position as it + // seems like getPos() returns 0 for text nodes and BR elements. + dom.insertAfter(div, br); + divYPos = dom.getPos(div).y; + dom.remove(div); + + // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117 + if (divYPos > vpHeight) // It is not necessary to scroll if the DIV is inside the view port. + ed.getWin().scrollTo(0, divYPos); + }; + + ed.onKeyPress.add(function(ed, e) { + if (e.keyCode == 13 && (e.shiftKey || (s.force_br_newlines && !dom.getParent(selection.getNode(), 'h1,h2,h3,h4,h5,h6,ol,ul')))) { + insertBr(ed); + Event.cancel(e); + } + }); + } + + // IE specific fixes + if (isIE) { + // Replaces IE:s auto generated paragraphs with the specified element name + if (s.element != 'P') { + ed.onKeyPress.add(function(ed, e) { + t.lastElm = selection.getNode().nodeName; + }); + + ed.onKeyUp.add(function(ed, e) { + var bl, n = selection.getNode(), b = ed.getBody(); + + if (b.childNodes.length === 1 && n.nodeName == 'P') { + n = dom.rename(n, s.element); + selection.select(n); + selection.collapse(); + ed.nodeChanged(); + } else if (e.keyCode == 13 && !e.shiftKey && t.lastElm != 'P') { + bl = dom.getParent(n, 'p'); + + if (bl) { + dom.rename(bl, s.element); + ed.nodeChanged(); + } + } + }); + } + } + }, + + getParentBlock : function(n) { + var d = this.dom; + + return d.getParent(n, d.isBlock); + }, + + insertPara : function(e) { + var t = this, ed = t.editor, dom = ed.dom, d = ed.getDoc(), se = ed.settings, s = ed.selection.getSel(), r = s.getRangeAt(0), b = d.body; + var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n, vp = dom.getViewPort(ed.getWin()), y, ch, car; + + ed.undoManager.beforeChange(); + + // If root blocks are forced then use Operas default behavior since it's really good +// Removed due to bug: #1853816 +// if (se.forced_root_block && isOpera) +// return TRUE; + + // Setup before range + rb = d.createRange(); + + // If is before the first block element and in body, then move it into first block element + rb.setStart(s.anchorNode, s.anchorOffset); + rb.collapse(TRUE); + + // Setup after range + ra = d.createRange(); + + // If is before the first block element and in body, then move it into first block element + ra.setStart(s.focusNode, s.focusOffset); + ra.collapse(TRUE); + + // Setup start/end points + dir = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0; + sn = dir ? s.anchorNode : s.focusNode; + so = dir ? s.anchorOffset : s.focusOffset; + en = dir ? s.focusNode : s.anchorNode; + eo = dir ? s.focusOffset : s.anchorOffset; + + // If selection is in empty table cell + if (sn === en && /^(TD|TH)$/.test(sn.nodeName)) { + if (sn.firstChild.nodeName == 'BR') + dom.remove(sn.firstChild); // Remove BR + + // Create two new block elements + if (sn.childNodes.length == 0) { + ed.dom.add(sn, se.element, null, '
    '); + aft = ed.dom.add(sn, se.element, null, '
    '); + } else { + n = sn.innerHTML; + sn.innerHTML = ''; + ed.dom.add(sn, se.element, null, n); + aft = ed.dom.add(sn, se.element, null, '
    '); + } + + // Move caret into the last one + r = d.createRange(); + r.selectNodeContents(aft); + r.collapse(1); + ed.selection.setRng(r); + + return FALSE; + } + + // If the caret is in an invalid location in FF we need to move it into the first block + if (sn == b && en == b && b.firstChild && ed.dom.isBlock(b.firstChild)) { + sn = en = sn.firstChild; + so = eo = 0; + rb = d.createRange(); + rb.setStart(sn, 0); + ra = d.createRange(); + ra.setStart(en, 0); + } + + // If the body is totally empty add a BR element this might happen on webkit + if (!d.body.hasChildNodes()) { + d.body.appendChild(dom.create('br')); + } + + // Never use body as start or end node + sn = sn.nodeName == "HTML" ? d.body : sn; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes + sn = sn.nodeName == "BODY" ? sn.firstChild : sn; + en = en.nodeName == "HTML" ? d.body : en; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes + en = en.nodeName == "BODY" ? en.firstChild : en; + + // Get start and end blocks + sb = t.getParentBlock(sn); + eb = t.getParentBlock(en); + bn = sb ? sb.nodeName : se.element; // Get block name to create + + // Return inside list use default browser behavior + if (n = t.dom.getParent(sb, 'li,pre')) { + if (n.nodeName == 'LI') + return splitList(ed.selection, t.dom, n); + + return TRUE; + } + + // If caption or absolute layers then always generate new blocks within + if (sb && (sb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) { + bn = se.element; + sb = null; + } + + // If caption or absolute layers then always generate new blocks within + if (eb && (eb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) { + bn = se.element; + eb = null; + } + + // Use P instead + if (/(TD|TABLE|TH|CAPTION)/.test(bn) || (sb && bn == "DIV" && /left|right/gi.test(dom.getStyle(sb, 'float', 1)))) { + bn = se.element; + sb = eb = null; + } + + // Setup new before and after blocks + bef = (sb && sb.nodeName == bn) ? sb.cloneNode(0) : ed.dom.create(bn); + aft = (eb && eb.nodeName == bn) ? eb.cloneNode(0) : ed.dom.create(bn); + + // Remove id from after clone + aft.removeAttribute('id'); + + // Is header and cursor is at the end, then force paragraph under + if (/^(H[1-6])$/.test(bn) && isAtEnd(r, sb)) + aft = ed.dom.create(se.element); + + // Find start chop node + n = sc = sn; + do { + if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName)) + break; + + sc = n; + } while ((n = n.previousSibling ? n.previousSibling : n.parentNode)); + + // Find end chop node + n = ec = en; + do { + if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName)) + break; + + ec = n; + } while ((n = n.nextSibling ? n.nextSibling : n.parentNode)); + + // Place first chop part into before block element + if (sc.nodeName == bn) + rb.setStart(sc, 0); + else + rb.setStartBefore(sc); + + rb.setEnd(sn, so); + bef.appendChild(rb.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari + + // Place secnd chop part within new block element + try { + ra.setEndAfter(ec); + } catch(ex) { + //console.debug(s.focusNode, s.focusOffset); + } + + ra.setStart(en, eo); + aft.appendChild(ra.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari + + // Create range around everything + r = d.createRange(); + if (!sc.previousSibling && sc.parentNode.nodeName == bn) { + r.setStartBefore(sc.parentNode); + } else { + if (rb.startContainer.nodeName == bn && rb.startOffset == 0) + r.setStartBefore(rb.startContainer); + else + r.setStart(rb.startContainer, rb.startOffset); + } + + if (!ec.nextSibling && ec.parentNode.nodeName == bn) + r.setEndAfter(ec.parentNode); + else + r.setEnd(ra.endContainer, ra.endOffset); + + // Delete and replace it with new block elements + r.deleteContents(); + + if (isOpera) + ed.getWin().scrollTo(0, vp.y); + + // Never wrap blocks in blocks + if (bef.firstChild && bef.firstChild.nodeName == bn) + bef.innerHTML = bef.firstChild.innerHTML; + + if (aft.firstChild && aft.firstChild.nodeName == bn) + aft.innerHTML = aft.firstChild.innerHTML; + + function appendStyles(e, en) { + var nl = [], nn, n, i; + + e.innerHTML = ''; + + // Make clones of style elements + if (se.keep_styles) { + n = en; + do { + // We only want style specific elements + if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(n.nodeName)) { + nn = n.cloneNode(FALSE); + dom.setAttrib(nn, 'id', ''); // Remove ID since it needs to be unique + nl.push(nn); + } + } while (n = n.parentNode); + } + + // Append style elements to aft + if (nl.length > 0) { + for (i = nl.length - 1, nn = e; i >= 0; i--) + nn = nn.appendChild(nl[i]); + + // Padd most inner style element + nl[0].innerHTML = isOpera ? '\u00a0' : '
    '; // Extra space for Opera so that the caret can move there + return nl[0]; // Move caret to most inner element + } else + e.innerHTML = isOpera ? '\u00a0' : '
    '; // Extra space for Opera so that the caret can move there + }; + + // Padd empty blocks + if (dom.isEmpty(bef)) + appendStyles(bef, sn); + + // Fill empty afterblook with current style + if (dom.isEmpty(aft)) + car = appendStyles(aft, en); + + // Opera needs this one backwards for older versions + if (isOpera && parseFloat(opera.version()) < 9.5) { + r.insertNode(bef); + r.insertNode(aft); + } else { + r.insertNode(aft); + r.insertNode(bef); + } + + // Normalize + aft.normalize(); + bef.normalize(); + + // Move cursor and scroll into view + ed.selection.select(aft, true); + ed.selection.collapse(true); + + // scrollIntoView seems to scroll the parent window in most browsers now including FF 3.0b4 so it's time to stop using it and do it our selfs + y = ed.dom.getPos(aft).y; + //ch = aft.clientHeight; + + // Is element within viewport + if (y < vp.y || y + 25 > vp.y + vp.h) { + ed.getWin().scrollTo(0, y < vp.y ? y : y - vp.h + 25); // Needs to be hardcoded to roughly one line of text if a huge text block is broken into two blocks + + /*console.debug( + 'Element: y=' + y + ', h=' + ch + ', ' + + 'Viewport: y=' + vp.y + ", h=" + vp.h + ', bottom=' + (vp.y + vp.h) + );*/ + } + + ed.undoManager.add(); + + return FALSE; + }, + + backspaceDelete : function(e, bs) { + var t = this, ed = t.editor, b = ed.getBody(), dom = ed.dom, n, se = ed.selection, r = se.getRng(), sc = r.startContainer, n, w, tn, walker; + + // Delete when caret is behind a element doesn't work correctly on Gecko see #3011651 + if (!bs && r.collapsed && sc.nodeType == 1 && r.startOffset == sc.childNodes.length) { + walker = new tinymce.dom.TreeWalker(sc.lastChild, sc); + + // Walk the dom backwards until we find a text node + for (n = sc.lastChild; n; n = walker.prev()) { + if (n.nodeType == 3) { + r.setStart(n, n.nodeValue.length); + r.collapse(true); + se.setRng(r); + return; + } + } + } + + // The caret sometimes gets stuck in Gecko if you delete empty paragraphs + // This workaround removes the element by hand and moves the caret to the previous element + if (sc && ed.dom.isBlock(sc) && !/^(TD|TH)$/.test(sc.nodeName) && bs) { + if (sc.childNodes.length == 0 || (sc.childNodes.length == 1 && sc.firstChild.nodeName == 'BR')) { + // Find previous block element + n = sc; + while ((n = n.previousSibling) && !ed.dom.isBlock(n)) ; + + if (n) { + if (sc != b.firstChild) { + // Find last text node + w = ed.dom.doc.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, FALSE); + while (tn = w.nextNode()) + n = tn; + + // Place caret at the end of last text node + r = ed.getDoc().createRange(); + r.setStart(n, n.nodeValue ? n.nodeValue.length : 0); + r.setEnd(n, n.nodeValue ? n.nodeValue.length : 0); + se.setRng(r); + + // Remove the target container + ed.dom.remove(sc); + } + + return Event.cancel(e); + } + } + } + } + }); +})(tinymce); + +(function(tinymce) { + // Shorten names + var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend; + + tinymce.create('tinymce.ControlManager', { + ControlManager : function(ed, s) { + var t = this, i; + + s = s || {}; + t.editor = ed; + t.controls = {}; + t.onAdd = new tinymce.util.Dispatcher(t); + t.onPostRender = new tinymce.util.Dispatcher(t); + t.prefix = s.prefix || ed.id + '_'; + t._cls = {}; + + t.onPostRender.add(function() { + each(t.controls, function(c) { + c.postRender(); + }); + }); + }, + + get : function(id) { + return this.controls[this.prefix + id] || this.controls[id]; + }, + + setActive : function(id, s) { + var c = null; + + if (c = this.get(id)) + c.setActive(s); + + return c; + }, + + setDisabled : function(id, s) { + var c = null; + + if (c = this.get(id)) + c.setDisabled(s); + + return c; + }, + + add : function(c) { + var t = this; + + if (c) { + t.controls[c.id] = c; + t.onAdd.dispatch(c, t); + } + + return c; + }, + + createControl : function(n) { + var c, t = this, ed = t.editor; + + each(ed.plugins, function(p) { + if (p.createControl) { + c = p.createControl(n, t); + + if (c) + return false; + } + }); + + switch (n) { + case "|": + case "separator": + return t.createSeparator(); + } + + if (!c && ed.buttons && (c = ed.buttons[n])) + return t.createButton(n, c); + + return t.add(c); + }, + + createDropMenu : function(id, s, cc) { + var t = this, ed = t.editor, c, bm, v, cls; + + s = extend({ + 'class' : 'mceDropDown', + constrain : ed.settings.constrain_menus + }, s); + + s['class'] = s['class'] + ' ' + ed.getParam('skin') + 'Skin'; + if (v = ed.getParam('skin_variant')) + s['class'] += ' ' + ed.getParam('skin') + 'Skin' + v.substring(0, 1).toUpperCase() + v.substring(1); + + id = t.prefix + id; + cls = cc || t._cls.dropmenu || tinymce.ui.DropMenu; + c = t.controls[id] = new cls(id, s); + c.onAddItem.add(function(c, o) { + var s = o.settings; + + s.title = ed.getLang(s.title, s.title); + + if (!s.onclick) { + s.onclick = function(v) { + if (s.cmd) + ed.execCommand(s.cmd, s.ui || false, s.value); + }; + } + }); + + ed.onRemove.add(function() { + c.destroy(); + }); + + // Fix for bug #1897785, #1898007 + if (tinymce.isIE) { + c.onShowMenu.add(function() { + // IE 8 needs focus in order to store away a range with the current collapsed caret location + ed.focus(); + + bm = ed.selection.getBookmark(1); + }); + + c.onHideMenu.add(function() { + if (bm) { + ed.selection.moveToBookmark(bm); + bm = 0; + } + }); + } + + return t.add(c); + }, + + createListBox : function(id, s, cc) { + var t = this, ed = t.editor, cmd, c, cls; + + if (t.get(id)) + return null; + + s.title = ed.translate(s.title); + s.scope = s.scope || ed; + + if (!s.onselect) { + s.onselect = function(v) { + ed.execCommand(s.cmd, s.ui || false, v || s.value); + }; + } + + s = extend({ + title : s.title, + 'class' : 'mce_' + id, + scope : s.scope, + control_manager : t + }, s); + + id = t.prefix + id; + + + function useNativeListForAccessibility(ed) { + return ed.settings.use_accessible_selects && !tinymce.isGecko + } + + if (ed.settings.use_native_selects || useNativeListForAccessibility(ed)) + c = new tinymce.ui.NativeListBox(id, s); + else { + cls = cc || t._cls.listbox || tinymce.ui.ListBox; + c = new cls(id, s, ed); + } + + t.controls[id] = c; + + // Fix focus problem in Safari + if (tinymce.isWebKit) { + c.onPostRender.add(function(c, n) { + // Store bookmark on mousedown + Event.add(n, 'mousedown', function() { + ed.bookmark = ed.selection.getBookmark(1); + }); + + // Restore on focus, since it might be lost + Event.add(n, 'focus', function() { + ed.selection.moveToBookmark(ed.bookmark); + ed.bookmark = null; + }); + }); + } + + if (c.hideMenu) + ed.onMouseDown.add(c.hideMenu, c); + + return t.add(c); + }, + + createButton : function(id, s, cc) { + var t = this, ed = t.editor, o, c, cls; + + if (t.get(id)) + return null; + + s.title = ed.translate(s.title); + s.label = ed.translate(s.label); + s.scope = s.scope || ed; + + if (!s.onclick && !s.menu_button) { + s.onclick = function() { + ed.execCommand(s.cmd, s.ui || false, s.value); + }; + } + + s = extend({ + title : s.title, + 'class' : 'mce_' + id, + unavailable_prefix : ed.getLang('unavailable', ''), + scope : s.scope, + control_manager : t + }, s); + + id = t.prefix + id; + + if (s.menu_button) { + cls = cc || t._cls.menubutton || tinymce.ui.MenuButton; + c = new cls(id, s, ed); + ed.onMouseDown.add(c.hideMenu, c); + } else { + cls = t._cls.button || tinymce.ui.Button; + c = new cls(id, s, ed); + } + + return t.add(c); + }, + + createMenuButton : function(id, s, cc) { + s = s || {}; + s.menu_button = 1; + + return this.createButton(id, s, cc); + }, + + createSplitButton : function(id, s, cc) { + var t = this, ed = t.editor, cmd, c, cls; + + if (t.get(id)) + return null; + + s.title = ed.translate(s.title); + s.scope = s.scope || ed; + + if (!s.onclick) { + s.onclick = function(v) { + ed.execCommand(s.cmd, s.ui || false, v || s.value); + }; + } + + if (!s.onselect) { + s.onselect = function(v) { + ed.execCommand(s.cmd, s.ui || false, v || s.value); + }; + } + + s = extend({ + title : s.title, + 'class' : 'mce_' + id, + scope : s.scope, + control_manager : t + }, s); + + id = t.prefix + id; + cls = cc || t._cls.splitbutton || tinymce.ui.SplitButton; + c = t.add(new cls(id, s, ed)); + ed.onMouseDown.add(c.hideMenu, c); + + return c; + }, + + createColorSplitButton : function(id, s, cc) { + var t = this, ed = t.editor, cmd, c, cls, bm; + + if (t.get(id)) + return null; + + s.title = ed.translate(s.title); + s.scope = s.scope || ed; + + if (!s.onclick) { + s.onclick = function(v) { + if (tinymce.isIE) + bm = ed.selection.getBookmark(1); + + ed.execCommand(s.cmd, s.ui || false, v || s.value); + }; + } + + if (!s.onselect) { + s.onselect = function(v) { + ed.execCommand(s.cmd, s.ui || false, v || s.value); + }; + } + + s = extend({ + title : s.title, + 'class' : 'mce_' + id, + 'menu_class' : ed.getParam('skin') + 'Skin', + scope : s.scope, + more_colors_title : ed.getLang('more_colors') + }, s); + + id = t.prefix + id; + cls = cc || t._cls.colorsplitbutton || tinymce.ui.ColorSplitButton; + c = new cls(id, s, ed); + ed.onMouseDown.add(c.hideMenu, c); + + // Remove the menu element when the editor is removed + ed.onRemove.add(function() { + c.destroy(); + }); + + // Fix for bug #1897785, #1898007 + if (tinymce.isIE) { + c.onShowMenu.add(function() { + // IE 8 needs focus in order to store away a range with the current collapsed caret location + ed.focus(); + bm = ed.selection.getBookmark(1); + }); + + c.onHideMenu.add(function() { + if (bm) { + ed.selection.moveToBookmark(bm); + bm = 0; + } + }); + } + + return t.add(c); + }, + + createToolbar : function(id, s, cc) { + var c, t = this, cls; + + id = t.prefix + id; + cls = cc || t._cls.toolbar || tinymce.ui.Toolbar; + c = new cls(id, s, t.editor); + + if (t.get(id)) + return null; + + return t.add(c); + }, + + createToolbarGroup : function(id, s, cc) { + var c, t = this, cls; + id = t.prefix + id; + cls = cc || this._cls.toolbarGroup || tinymce.ui.ToolbarGroup; + c = new cls(id, s, t.editor); + + if (t.get(id)) + return null; + + return t.add(c); + }, + + createSeparator : function(cc) { + var cls = cc || this._cls.separator || tinymce.ui.Separator; + + return new cls(); + }, + + setControlType : function(n, c) { + return this._cls[n.toLowerCase()] = c; + }, + + destroy : function() { + each(this.controls, function(c) { + c.destroy(); + }); + + this.controls = null; + } + }); +})(tinymce); + +(function(tinymce) { + var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isIE = tinymce.isIE, isOpera = tinymce.isOpera; + + tinymce.create('tinymce.WindowManager', { + WindowManager : function(ed) { + var t = this; + + t.editor = ed; + t.onOpen = new Dispatcher(t); + t.onClose = new Dispatcher(t); + t.params = {}; + t.features = {}; + }, + + open : function(s, p) { + var t = this, f = '', x, y, mo = t.editor.settings.dialog_type == 'modal', w, sw, sh, vp = tinymce.DOM.getViewPort(), u; + + // Default some options + s = s || {}; + p = p || {}; + sw = isOpera ? vp.w : screen.width; // Opera uses windows inside the Opera window + sh = isOpera ? vp.h : screen.height; + s.name = s.name || 'mc_' + new Date().getTime(); + s.width = parseInt(s.width || 320); + s.height = parseInt(s.height || 240); + s.resizable = true; + s.left = s.left || parseInt(sw / 2.0) - (s.width / 2.0); + s.top = s.top || parseInt(sh / 2.0) - (s.height / 2.0); + p.inline = false; + p.mce_width = s.width; + p.mce_height = s.height; + p.mce_auto_focus = s.auto_focus; + + if (mo) { + if (isIE) { + s.center = true; + s.help = false; + s.dialogWidth = s.width + 'px'; + s.dialogHeight = s.height + 'px'; + s.scroll = s.scrollbars || false; + } + } + + // Build features string + each(s, function(v, k) { + if (tinymce.is(v, 'boolean')) + v = v ? 'yes' : 'no'; + + if (!/^(name|url)$/.test(k)) { + if (isIE && mo) + f += (f ? ';' : '') + k + ':' + v; + else + f += (f ? ',' : '') + k + '=' + v; + } + }); + + t.features = s; + t.params = p; + t.onOpen.dispatch(t, s, p); + + u = s.url || s.file; + u = tinymce._addVer(u); + + try { + if (isIE && mo) { + w = 1; + window.showModalDialog(u, window, f); + } else + w = window.open(u, s.name, f); + } catch (ex) { + // Ignore + } + + if (!w) + alert(t.editor.getLang('popup_blocked')); + }, + + close : function(w) { + w.close(); + this.onClose.dispatch(this); + }, + + createInstance : function(cl, a, b, c, d, e) { + var f = tinymce.resolve(cl); + + return new f(a, b, c, d, e); + }, + + confirm : function(t, cb, s, w) { + w = w || window; + + cb.call(s || this, w.confirm(this._decode(this.editor.getLang(t, t)))); + }, + + alert : function(tx, cb, s, w) { + var t = this; + + w = w || window; + w.alert(t._decode(t.editor.getLang(tx, tx))); + + if (cb) + cb.call(s || t); + }, + + resizeBy : function(dw, dh, win) { + win.resizeBy(dw, dh); + }, + + // Internal functions + + _decode : function(s) { + return tinymce.DOM.decode(s).replace(/\\n/g, '\n'); + } + }); +}(tinymce)); +(function(tinymce) { + tinymce.Formatter = function(ed) { + var formats = {}, + each = tinymce.each, + dom = ed.dom, + selection = ed.selection, + TreeWalker = tinymce.dom.TreeWalker, + rangeUtils = new tinymce.dom.RangeUtils(dom), + isValid = ed.schema.isValidChild, + isBlock = dom.isBlock, + forcedRootBlock = ed.settings.forced_root_block, + nodeIndex = dom.nodeIndex, + INVISIBLE_CHAR = '\uFEFF', + MCE_ATTR_RE = /^(src|href|style)$/, + FALSE = false, + TRUE = true, + undefined; + + function isArray(obj) { + return obj instanceof Array; + }; + + function getParents(node, selector) { + return dom.getParents(node, selector, dom.getRoot()); + }; + + function isCaretNode(node) { + return node.nodeType === 1 && node.id === '_mce_caret'; + }; + + // Public functions + + function get(name) { + return name ? formats[name] : formats; + }; + + function register(name, format) { + if (name) { + if (typeof(name) !== 'string') { + each(name, function(format, name) { + register(name, format); + }); + } else { + // Force format into array and add it to internal collection + format = format.length ? format : [format]; + + each(format, function(format) { + // Set deep to false by default on selector formats this to avoid removing + // alignment on images inside paragraphs when alignment is changed on paragraphs + if (format.deep === undefined) + format.deep = !format.selector; + + // Default to true + if (format.split === undefined) + format.split = !format.selector || format.inline; + + // Default to true + if (format.remove === undefined && format.selector && !format.inline) + format.remove = 'none'; + + // Mark format as a mixed format inline + block level + if (format.selector && format.inline) { + format.mixed = true; + format.block_expand = true; + } + + // Split classes if needed + if (typeof(format.classes) === 'string') + format.classes = format.classes.split(/\s+/); + }); + + formats[name] = format; + } + } + }; + + var getTextDecoration = function(node) { + var decoration; + + ed.dom.getParent(node, function(n) { + decoration = ed.dom.getStyle(n, 'text-decoration'); + return decoration && decoration !== 'none'; + }); + + return decoration; + }; + + var processUnderlineAndColor = function(node) { + var textDecoration; + if (node.nodeType === 1 && node.parentNode && node.parentNode.nodeType === 1) { + textDecoration = getTextDecoration(node.parentNode); + if (ed.dom.getStyle(node, 'color') && textDecoration) { + ed.dom.setStyle(node, 'text-decoration', textDecoration); + } else if (ed.dom.getStyle(node, 'textdecoration') === textDecoration) { + ed.dom.setStyle(node, 'text-decoration', null); + } + } + }; + + function apply(name, vars, node) { + var formatList = get(name), format = formatList[0], bookmark, rng, i, isCollapsed = selection.isCollapsed(); + + function setElementFormat(elm, fmt) { + fmt = fmt || format; + + if (elm) { + if (fmt.onformat) { + fmt.onformat(elm, fmt, vars, node); + } + + each(fmt.styles, function(value, name) { + dom.setStyle(elm, name, replaceVars(value, vars)); + }); + + each(fmt.attributes, function(value, name) { + dom.setAttrib(elm, name, replaceVars(value, vars)); + }); + + each(fmt.classes, function(value) { + value = replaceVars(value, vars); + + if (!dom.hasClass(elm, value)) + dom.addClass(elm, value); + }); + } + }; + function adjustSelectionToVisibleSelection() { + function findSelectionEnd(start, end) { + var walker = new TreeWalker(end); + for (node = walker.current(); node; node = walker.prev()) { + if (node.childNodes.length > 1 || node == start) { + return node; + } + } + }; + + // Adjust selection so that a end container with a end offset of zero is not included in the selection + // as this isn't visible to the user. + var rng = ed.selection.getRng(); + var start = rng.startContainer; + var end = rng.endContainer; + + if (start != end && rng.endOffset == 0) { + var newEnd = findSelectionEnd(start, end); + var endOffset = newEnd.nodeType == 3 ? newEnd.length : newEnd.childNodes.length; + + rng.setEnd(newEnd, endOffset); + } + + return rng; + } + + function applyStyleToList(node, bookmark, wrapElm, newWrappers, process){ + var nodes = [], listIndex = -1, list, startIndex = -1, endIndex = -1, currentWrapElm; + + // find the index of the first child list. + each(node.childNodes, function(n, index) { + if (n.nodeName === "UL" || n.nodeName === "OL") { + listIndex = index; + list = n; + return false; + } + }); + + // get the index of the bookmarks + each(node.childNodes, function(n, index) { + if (n.nodeName === "SPAN" && dom.getAttrib(n, "data-mce-type") == "bookmark") { + if (n.id == bookmark.id + "_start") { + startIndex = index; + } else if (n.id == bookmark.id + "_end") { + endIndex = index; + } + } + }); + + // if the selection spans across an embedded list, or there isn't an embedded list - handle processing normally + if (listIndex <= 0 || (startIndex < listIndex && endIndex > listIndex)) { + each(tinymce.grep(node.childNodes), process); + return 0; + } else { + currentWrapElm = wrapElm.cloneNode(FALSE); + + // create a list of the nodes on the same side of the list as the selection + each(tinymce.grep(node.childNodes), function(n, index) { + if ((startIndex < listIndex && index < listIndex) || (startIndex > listIndex && index > listIndex)) { + nodes.push(n); + n.parentNode.removeChild(n); + } + }); + + // insert the wrapping element either before or after the list. + if (startIndex < listIndex) { + node.insertBefore(currentWrapElm, list); + } else if (startIndex > listIndex) { + node.insertBefore(currentWrapElm, list.nextSibling); + } + + // add the new nodes to the list. + newWrappers.push(currentWrapElm); + + each(nodes, function(node) { + currentWrapElm.appendChild(node); + }); + + return currentWrapElm; + } + }; + + function applyRngStyle(rng, bookmark, node_specific) { + var newWrappers = [], wrapName, wrapElm; + + // Setup wrapper element + wrapName = format.inline || format.block; + wrapElm = dom.create(wrapName); + setElementFormat(wrapElm); + + rangeUtils.walk(rng, function(nodes) { + var currentWrapElm; + + function process(node) { + var nodeName = node.nodeName.toLowerCase(), parentName = node.parentNode.nodeName.toLowerCase(), found; + + // Stop wrapping on br elements + if (isEq(nodeName, 'br')) { + currentWrapElm = 0; + + // Remove any br elements when we wrap things + if (format.block) + dom.remove(node); + + return; + } + + // If node is wrapper type + if (format.wrapper && matchNode(node, name, vars)) { + currentWrapElm = 0; + return; + } + + // Can we rename the block + if (format.block && !format.wrapper && isTextBlock(nodeName)) { + node = dom.rename(node, wrapName); + setElementFormat(node); + newWrappers.push(node); + currentWrapElm = 0; + return; + } + + // Handle selector patterns + if (format.selector) { + // Look for matching formats + each(formatList, function(format) { + // Check collapsed state if it exists + if ('collapsed' in format && format.collapsed !== isCollapsed) { + return; + } + + if (dom.is(node, format.selector) && !isCaretNode(node)) { + setElementFormat(node, format); + found = true; + } + }); + + // Continue processing if a selector match wasn't found and a inline element is defined + if (!format.inline || found) { + currentWrapElm = 0; + return; + } + } + + // Is it valid to wrap this item + if (isValid(wrapName, nodeName) && isValid(parentName, wrapName) && + !(!node_specific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && !isCaretNode(node)) { + // Start wrapping + if (!currentWrapElm) { + // Wrap the node + currentWrapElm = wrapElm.cloneNode(FALSE); + node.parentNode.insertBefore(currentWrapElm, node); + newWrappers.push(currentWrapElm); + } + + currentWrapElm.appendChild(node); + } else if (nodeName == 'li' && bookmark) { + // Start wrapping - if we are in a list node and have a bookmark, then we will always begin by wrapping in a new element. + currentWrapElm = applyStyleToList(node, bookmark, wrapElm, newWrappers, process); + } else { + // Start a new wrapper for possible children + currentWrapElm = 0; + + each(tinymce.grep(node.childNodes), process); + + // End the last wrapper + currentWrapElm = 0; + } + }; + + // Process siblings from range + each(nodes, process); + }); + + // Wrap links inside as well, for example color inside a link when the wrapper is around the link + if (format.wrap_links === false) { + each(newWrappers, function(node) { + function process(node) { + var i, currentWrapElm, children; + + if (node.nodeName === 'A') { + currentWrapElm = wrapElm.cloneNode(FALSE); + newWrappers.push(currentWrapElm); + + children = tinymce.grep(node.childNodes); + for (i = 0; i < children.length; i++) + currentWrapElm.appendChild(children[i]); + + node.appendChild(currentWrapElm); + } + + each(tinymce.grep(node.childNodes), process); + }; + + process(node); + }); + } + + // Cleanup + each(newWrappers, function(node) { + var childCount; + + function getChildCount(node) { + var count = 0; + + each(node.childNodes, function(node) { + if (!isWhiteSpaceNode(node) && !isBookmarkNode(node)) + count++; + }); + + return count; + }; + + function mergeStyles(node) { + var child, clone; + + each(node.childNodes, function(node) { + if (node.nodeType == 1 && !isBookmarkNode(node) && !isCaretNode(node)) { + child = node; + return FALSE; // break loop + } + }); + + // If child was found and of the same type as the current node + if (child && matchName(child, format)) { + clone = child.cloneNode(FALSE); + setElementFormat(clone); + + dom.replace(clone, node, TRUE); + dom.remove(child, 1); + } + + return clone || node; + }; + + childCount = getChildCount(node); + + // Remove empty nodes but only if there is multiple wrappers and they are not block + // elements so never remove single

    since that would remove the currrent empty block element where the caret is at + if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) { + dom.remove(node, 1); + return; + } + + if (format.inline || format.wrapper) { + // Merges the current node with it's children of similar type to reduce the number of elements + if (!format.exact && childCount === 1) + node = mergeStyles(node); + + // Remove/merge children + each(formatList, function(format) { + // Merge all children of similar type will move styles from child to parent + // this: text + // will become: text + each(dom.select(format.inline, node), function(child) { + var parent; + + // When wrap_links is set to false we don't want + // to remove the format on children within links + if (format.wrap_links === false) { + parent = child.parentNode; + + do { + if (parent.nodeName === 'A') + return; + } while (parent = parent.parentNode); + } + + removeFormat(format, vars, child, format.exact ? child : null); + }); + }); + + // Remove child if direct parent is of same type + if (matchNode(node.parentNode, name, vars)) { + dom.remove(node, 1); + node = 0; + return TRUE; + } + + // Look for parent with similar style format + if (format.merge_with_parents) { + dom.getParent(node.parentNode, function(parent) { + if (matchNode(parent, name, vars)) { + dom.remove(node, 1); + node = 0; + return TRUE; + } + }); + } + + // Merge next and previous siblings if they are similar texttext becomes texttext + if (node && format.merge_siblings !== false) { + node = mergeSiblings(getNonWhiteSpaceSibling(node), node); + node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE)); + } + } + }); + }; + + if (format) { + if (node) { + if (node.nodeType) { + rng = dom.createRng(); + rng.setStartBefore(node); + rng.setEndAfter(node); + applyRngStyle(expandRng(rng, formatList), null, true); + } else { + applyRngStyle(node, null, true); + } + } else { + if (!isCollapsed || !format.inline || dom.select('td.mceSelected,th.mceSelected').length) { + // Obtain selection node before selection is unselected by applyRngStyle() + var curSelNode = ed.selection.getNode(); + + // Apply formatting to selection + ed.selection.setRng(adjustSelectionToVisibleSelection()); + bookmark = selection.getBookmark(); + applyRngStyle(expandRng(selection.getRng(TRUE), formatList), bookmark); + + // Colored nodes should be underlined so that the color of the underline matches the text color. + if (format.styles && (format.styles.color || format.styles.textDecoration)) { + tinymce.walk(curSelNode, processUnderlineAndColor, 'childNodes'); + processUnderlineAndColor(curSelNode); + } + + selection.moveToBookmark(bookmark); + moveStart(selection.getRng(TRUE)); + ed.nodeChanged(); + } else + performCaretAction('apply', name, vars); + } + } + }; + + function remove(name, vars, node) { + var formatList = get(name), format = formatList[0], bookmark, i, rng; + + // Merges the styles for each node + function process(node) { + var children, i, l; + + // Grab the children first since the nodelist might be changed + children = tinymce.grep(node.childNodes); + + // Process current node + for (i = 0, l = formatList.length; i < l; i++) { + if (removeFormat(formatList[i], vars, node, node)) + break; + } + + // Process the children + if (format.deep) { + for (i = 0, l = children.length; i < l; i++) + process(children[i]); + } + }; + + function findFormatRoot(container) { + var formatRoot; + + // Find format root + each(getParents(container.parentNode).reverse(), function(parent) { + var format; + + // Find format root element + if (!formatRoot && parent.id != '_start' && parent.id != '_end') { + // Is the node matching the format we are looking for + format = matchNode(parent, name, vars); + if (format && format.split !== false) + formatRoot = parent; + } + }); + + return formatRoot; + }; + + function wrapAndSplit(format_root, container, target, split) { + var parent, clone, lastClone, firstClone, i, formatRootParent; + + // Format root found then clone formats and split it + if (format_root) { + formatRootParent = format_root.parentNode; + + for (parent = container.parentNode; parent && parent != formatRootParent; parent = parent.parentNode) { + clone = parent.cloneNode(FALSE); + + for (i = 0; i < formatList.length; i++) { + if (removeFormat(formatList[i], vars, clone, clone)) { + clone = 0; + break; + } + } + + // Build wrapper node + if (clone) { + if (lastClone) + clone.appendChild(lastClone); + + if (!firstClone) + firstClone = clone; + + lastClone = clone; + } + } + + // Never split block elements if the format is mixed + if (split && (!format.mixed || !isBlock(format_root))) + container = dom.split(format_root, container); + + // Wrap container in cloned formats + if (lastClone) { + target.parentNode.insertBefore(lastClone, target); + firstClone.appendChild(target); + } + } + + return container; + }; + + function splitToFormatRoot(container) { + return wrapAndSplit(findFormatRoot(container), container, container, true); + }; + + function unwrap(start) { + var node = dom.get(start ? '_start' : '_end'), + out = node[start ? 'firstChild' : 'lastChild']; + + // If the end is placed within the start the result will be removed + // So this checks if the out node is a bookmark node if it is it + // checks for another more suitable node + if (isBookmarkNode(out)) + out = out[start ? 'firstChild' : 'lastChild']; + + dom.remove(node, true); + + return out; + }; + + function removeRngStyle(rng) { + var startContainer, endContainer; + + rng = expandRng(rng, formatList, TRUE); + + if (format.split) { + startContainer = getContainer(rng, TRUE); + endContainer = getContainer(rng); + + if (startContainer != endContainer) { + // Wrap start/end nodes in span element since these might be cloned/moved + startContainer = wrap(startContainer, 'span', {id : '_start', 'data-mce-type' : 'bookmark'}); + endContainer = wrap(endContainer, 'span', {id : '_end', 'data-mce-type' : 'bookmark'}); + + // Split start/end + splitToFormatRoot(startContainer); + splitToFormatRoot(endContainer); + + // Unwrap start/end to get real elements again + startContainer = unwrap(TRUE); + endContainer = unwrap(); + } else + startContainer = endContainer = splitToFormatRoot(startContainer); + + // Update range positions since they might have changed after the split operations + rng.startContainer = startContainer.parentNode; + rng.startOffset = nodeIndex(startContainer); + rng.endContainer = endContainer.parentNode; + rng.endOffset = nodeIndex(endContainer) + 1; + } + + // Remove items between start/end + rangeUtils.walk(rng, function(nodes) { + each(nodes, function(node) { + process(node); + + // Remove parent span if it only contains text-decoration: underline, yet a parent node is also underlined. + if (node.nodeType === 1 && ed.dom.getStyle(node, 'text-decoration') === 'underline' && node.parentNode && getTextDecoration(node.parentNode) === 'underline') { + removeFormat({'deep': false, 'exact': true, 'inline': 'span', 'styles': {'textDecoration' : 'underline'}}, null, node); + } + }); + }); + }; + + // Handle node + if (node) { + if (node.nodeType) { + rng = dom.createRng(); + rng.setStartBefore(node); + rng.setEndAfter(node); + removeRngStyle(rng); + } else { + removeRngStyle(node); + } + + return; + } + + if (!selection.isCollapsed() || !format.inline || dom.select('td.mceSelected,th.mceSelected').length) { + bookmark = selection.getBookmark(); + removeRngStyle(selection.getRng(TRUE)); + selection.moveToBookmark(bookmark); + + // Check if start element still has formatting then we are at: "text|text" and need to move the start into the next text node + if (format.inline && match(name, vars, selection.getStart())) { + moveStart(selection.getRng(true)); + } + + ed.nodeChanged(); + } else + performCaretAction('remove', name, vars); + + // When you remove formatting from a table cell in WebKit (cell, not the contents of a cell) there is a rendering issue with column width + if (tinymce.isWebKit) { + ed.execCommand('mceCleanup'); + } + }; + + function toggle(name, vars, node) { + var fmt = get(name); + + if (match(name, vars, node) && (!('toggle' in fmt[0]) || fmt[0]['toggle'])) + remove(name, vars, node); + else + apply(name, vars, node); + }; + + function matchNode(node, name, vars, similar) { + var formatList = get(name), format, i, classes; + + function matchItems(node, format, item_name) { + var key, value, items = format[item_name], i; + + // Custom match + if (format.onmatch) { + return format.onmatch(node, format, item_name); + } + + // Check all items + if (items) { + // Non indexed object + if (items.length === undefined) { + for (key in items) { + if (items.hasOwnProperty(key)) { + if (item_name === 'attributes') + value = dom.getAttrib(node, key); + else + value = getStyle(node, key); + + if (similar && !value && !format.exact) + return; + + if ((!similar || format.exact) && !isEq(value, replaceVars(items[key], vars))) + return; + } + } + } else { + // Only one match needed for indexed arrays + for (i = 0; i < items.length; i++) { + if (item_name === 'attributes' ? dom.getAttrib(node, items[i]) : getStyle(node, items[i])) + return format; + } + } + } + + return format; + }; + + if (formatList && node) { + // Check each format in list + for (i = 0; i < formatList.length; i++) { + format = formatList[i]; + + // Name name, attributes, styles and classes + if (matchName(node, format) && matchItems(node, format, 'attributes') && matchItems(node, format, 'styles')) { + // Match classes + if (classes = format.classes) { + for (i = 0; i < classes.length; i++) { + if (!dom.hasClass(node, classes[i])) + return; + } + } + + return format; + } + } + } + }; + + function match(name, vars, node) { + var startNode; + + function matchParents(node) { + // Find first node with similar format settings + node = dom.getParent(node, function(node) { + return !!matchNode(node, name, vars, true); + }); + + // Do an exact check on the similar format element + return matchNode(node, name, vars); + }; + + // Check specified node + if (node) + return matchParents(node); + + // Check selected node + node = selection.getNode(); + if (matchParents(node)) + return TRUE; + + // Check start node if it's different + startNode = selection.getStart(); + if (startNode != node) { + if (matchParents(startNode)) + return TRUE; + } + + return FALSE; + }; + + function matchAll(names, vars) { + var startElement, matchedFormatNames = [], checkedMap = {}, i, ni, name; + + // Check start of selection for formats + startElement = selection.getStart(); + dom.getParent(startElement, function(node) { + var i, name; + + for (i = 0; i < names.length; i++) { + name = names[i]; + + if (!checkedMap[name] && matchNode(node, name, vars)) { + checkedMap[name] = true; + matchedFormatNames.push(name); + } + } + }); + + return matchedFormatNames; + }; + + function canApply(name) { + var formatList = get(name), startNode, parents, i, x, selector; + + if (formatList) { + startNode = selection.getStart(); + parents = getParents(startNode); + + for (x = formatList.length - 1; x >= 0; x--) { + selector = formatList[x].selector; + + // Format is not selector based, then always return TRUE + if (!selector) + return TRUE; + + for (i = parents.length - 1; i >= 0; i--) { + if (dom.is(parents[i], selector)) + return TRUE; + } + } + } + + return FALSE; + }; + + // Expose to public + tinymce.extend(this, { + get : get, + register : register, + apply : apply, + remove : remove, + toggle : toggle, + match : match, + matchAll : matchAll, + matchNode : matchNode, + canApply : canApply + }); + + // Private functions + + function matchName(node, format) { + // Check for inline match + if (isEq(node, format.inline)) + return TRUE; + + // Check for block match + if (isEq(node, format.block)) + return TRUE; + + // Check for selector match + if (format.selector) + return dom.is(node, format.selector); + }; + + function isEq(str1, str2) { + str1 = str1 || ''; + str2 = str2 || ''; + + str1 = '' + (str1.nodeName || str1); + str2 = '' + (str2.nodeName || str2); + + return str1.toLowerCase() == str2.toLowerCase(); + }; + + function getStyle(node, name) { + var styleVal = dom.getStyle(node, name); + + // Force the format to hex + if (name == 'color' || name == 'backgroundColor') + styleVal = dom.toHex(styleVal); + + // Opera will return bold as 700 + if (name == 'fontWeight' && styleVal == 700) + styleVal = 'bold'; + + return '' + styleVal; + }; + + function replaceVars(value, vars) { + if (typeof(value) != "string") + value = value(vars); + else if (vars) { + value = value.replace(/%(\w+)/g, function(str, name) { + return vars[name] || str; + }); + } + + return value; + }; + + function isWhiteSpaceNode(node) { + return node && node.nodeType === 3 && /^([\t \r\n]+|)$/.test(node.nodeValue); + }; + + function wrap(node, name, attrs) { + var wrapper = dom.create(name, attrs); + + node.parentNode.insertBefore(wrapper, node); + wrapper.appendChild(node); + + return wrapper; + }; + + function expandRng(rng, format, remove) { + var startContainer = rng.startContainer, + startOffset = rng.startOffset, + endContainer = rng.endContainer, + endOffset = rng.endOffset, sibling, lastIdx, leaf, endPoint; + + // This function walks up the tree if there is no siblings before/after the node + function findParentContainer(start) { + var container, parent, child, sibling, siblingName; + + container = parent = start ? startContainer : endContainer; + siblingName = start ? 'previousSibling' : 'nextSibling'; + root = dom.getRoot(); + + // If it's a text node and the offset is inside the text + if (container.nodeType == 3 && !isWhiteSpaceNode(container)) { + if (start ? startOffset > 0 : endOffset < container.nodeValue.length) { + return container; + } + } + + for (;;) { + // Stop expanding on block elements + if (!format[0].block_expand && isBlock(parent)) + return parent; + + // Walk left/right + for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) { + if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling)) { + return parent; + } + } + + // Check if we can move up are we at root level or body level + if (parent.parentNode == root) { + container = parent; + break; + } + + parent = parent.parentNode; + } + + return container; + }; + + // This function walks down the tree to find the leaf at the selection. + // The offset is also returned as if node initially a leaf, the offset may be in the middle of the text node. + function findLeaf(node, offset) { + if (offset === undefined) + offset = node.nodeType === 3 ? node.length : node.childNodes.length; + while (node && node.hasChildNodes()) { + node = node.childNodes[offset]; + if (node) + offset = node.nodeType === 3 ? node.length : node.childNodes.length; + } + return { node: node, offset: offset }; + } + + // If index based start position then resolve it + if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) { + lastIdx = startContainer.childNodes.length - 1; + startContainer = startContainer.childNodes[startOffset > lastIdx ? lastIdx : startOffset]; + + if (startContainer.nodeType == 3) + startOffset = 0; + } + + // If index based end position then resolve it + if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) { + lastIdx = endContainer.childNodes.length - 1; + endContainer = endContainer.childNodes[endOffset > lastIdx ? lastIdx : endOffset - 1]; + + if (endContainer.nodeType == 3) + endOffset = endContainer.nodeValue.length; + } + + // Exclude bookmark nodes if possible + if (isBookmarkNode(startContainer.parentNode) || isBookmarkNode(startContainer)) { + startContainer = isBookmarkNode(startContainer) ? startContainer : startContainer.parentNode; + startContainer = startContainer.nextSibling || startContainer; + + if (startContainer.nodeType == 3) + startOffset = 0; + } + + if (isBookmarkNode(endContainer.parentNode) || isBookmarkNode(endContainer)) { + endContainer = isBookmarkNode(endContainer) ? endContainer : endContainer.parentNode; + endContainer = endContainer.previousSibling || endContainer; + + if (endContainer.nodeType == 3) + endOffset = endContainer.length; + } + + if (format[0].inline) { + if (rng.collapsed) { + function findWordEndPoint(container, offset, start) { + var walker, node, pos, lastTextNode; + + function findSpace(node, offset) { + var pos, pos2, str = node.nodeValue; + + if (typeof(offset) == "undefined") { + offset = start ? str.length : 0; + } + + if (start) { + pos = str.lastIndexOf(' ', offset); + pos2 = str.lastIndexOf('\u00a0', offset); + pos = pos > pos2 ? pos : pos2; + + // Include the space on remove to avoid tag soup + if (pos !== -1 && !remove) { + pos++; + } + } else { + pos = str.indexOf(' ', offset); + pos2 = str.indexOf('\u00a0', offset); + pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2; + } + + return pos; + }; + + if (container.nodeType === 3) { + pos = findSpace(container, offset); + + if (pos !== -1) { + return {container : container, offset : pos}; + } + + lastTextNode = container; + } + + // Walk the nodes inside the block + walker = new TreeWalker(container, dom.getParent(container, isBlock) || ed.getBody()); + while (node = walker[start ? 'prev' : 'next']()) { + if (node.nodeType === 3) { + lastTextNode = node; + pos = findSpace(node); + + if (pos !== -1) { + return {container : node, offset : pos}; + } + } else if (isBlock(node)) { + break; + } + } + + if (lastTextNode) { + if (start) { + offset = 0; + } else { + offset = lastTextNode.length; + } + + return {container: lastTextNode, offset: offset}; + } + } + + // Expand left to closest word boundery + endPoint = findWordEndPoint(startContainer, startOffset, true); + if (endPoint) { + startContainer = endPoint.container; + startOffset = endPoint.offset; + } + + // Expand right to closest word boundery + endPoint = findWordEndPoint(endContainer, endOffset); + if (endPoint) { + endContainer = endPoint.container; + endOffset = endPoint.offset; + } + } + + // Avoid applying formatting to a trailing space. + leaf = findLeaf(endContainer, endOffset); + if (leaf.node) { + while (leaf.node && leaf.offset === 0 && leaf.node.previousSibling) + leaf = findLeaf(leaf.node.previousSibling); + + if (leaf.node && leaf.offset > 0 && leaf.node.nodeType === 3 && + leaf.node.nodeValue.charAt(leaf.offset - 1) === ' ') { + + if (leaf.offset > 1) { + endContainer = leaf.node; + endContainer.splitText(leaf.offset - 1); + } else if (leaf.node.previousSibling) { + // TODO: Figure out why this is in here + //endContainer = leaf.node.previousSibling; + } + } + } + } + + // Move start/end point up the tree if the leaves are sharp and if we are in different containers + // Example * becomes !: !

    *texttext*

    ! + // This will reduce the number of wrapper elements that needs to be created + // Move start point up the tree + if (format[0].inline || format[0].block_expand) { + if (!format[0].inline || (startContainer.nodeType != 3 || startOffset === 0)) { + startContainer = findParentContainer(true); + } + + if (!format[0].inline || (endContainer.nodeType != 3 || endOffset === endContainer.nodeValue.length)) { + endContainer = findParentContainer(); + } + } + + // Expand start/end container to matching selector + if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) { + function findSelectorEndPoint(container, sibling_name) { + var parents, i, y, curFormat; + + if (container.nodeType == 3 && container.nodeValue.length == 0 && container[sibling_name]) + container = container[sibling_name]; + + parents = getParents(container); + for (i = 0; i < parents.length; i++) { + for (y = 0; y < format.length; y++) { + curFormat = format[y]; + + // If collapsed state is set then skip formats that doesn't match that + if ("collapsed" in curFormat && curFormat.collapsed !== rng.collapsed) + continue; + + if (dom.is(parents[i], curFormat.selector)) + return parents[i]; + } + } + + return container; + }; + + // Find new startContainer/endContainer if there is better one + startContainer = findSelectorEndPoint(startContainer, 'previousSibling'); + endContainer = findSelectorEndPoint(endContainer, 'nextSibling'); + } + + // Expand start/end container to matching block element or text node + if (format[0].block || format[0].selector) { + function findBlockEndPoint(container, sibling_name, sibling_name2) { + var node; + + // Expand to block of similar type + if (!format[0].wrapper) + node = dom.getParent(container, format[0].block); + + // Expand to first wrappable block element or any block element + if (!node) + node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isBlock); + + // Exclude inner lists from wrapping + if (node && format[0].wrapper) + node = getParents(node, 'ul,ol').reverse()[0] || node; + + // Didn't find a block element look for first/last wrappable element + if (!node) { + node = container; + + while (node[sibling_name] && !isBlock(node[sibling_name])) { + node = node[sibling_name]; + + // Break on BR but include it will be removed later on + // we can't remove it now since we need to check if it can be wrapped + if (isEq(node, 'br')) + break; + } + } + + return node || container; + }; + + // Find new startContainer/endContainer if there is better one + startContainer = findBlockEndPoint(startContainer, 'previousSibling'); + endContainer = findBlockEndPoint(endContainer, 'nextSibling'); + + // Non block element then try to expand up the leaf + if (format[0].block) { + if (!isBlock(startContainer)) + startContainer = findParentContainer(true); + + if (!isBlock(endContainer)) + endContainer = findParentContainer(); + } + } + + // Setup index for startContainer + if (startContainer.nodeType == 1) { + startOffset = nodeIndex(startContainer); + startContainer = startContainer.parentNode; + } + + // Setup index for endContainer + if (endContainer.nodeType == 1) { + endOffset = nodeIndex(endContainer) + 1; + endContainer = endContainer.parentNode; + } + + // Return new range like object + return { + startContainer : startContainer, + startOffset : startOffset, + endContainer : endContainer, + endOffset : endOffset + }; + } + + function removeFormat(format, vars, node, compare_node) { + var i, attrs, stylesModified; + + // Check if node matches format + if (!matchName(node, format)) + return FALSE; + + // Should we compare with format attribs and styles + if (format.remove != 'all') { + // Remove styles + each(format.styles, function(value, name) { + value = replaceVars(value, vars); + + // Indexed array + if (typeof(name) === 'number') { + name = value; + compare_node = 0; + } + + if (!compare_node || isEq(getStyle(compare_node, name), value)) + dom.setStyle(node, name, ''); + + stylesModified = 1; + }); + + // Remove style attribute if it's empty + if (stylesModified && dom.getAttrib(node, 'style') == '') { + node.removeAttribute('style'); + node.removeAttribute('data-mce-style'); + } + + // Remove attributes + each(format.attributes, function(value, name) { + var valueOut; + + value = replaceVars(value, vars); + + // Indexed array + if (typeof(name) === 'number') { + name = value; + compare_node = 0; + } + + if (!compare_node || isEq(dom.getAttrib(compare_node, name), value)) { + // Keep internal classes + if (name == 'class') { + value = dom.getAttrib(node, name); + if (value) { + // Build new class value where everything is removed except the internal prefixed classes + valueOut = ''; + each(value.split(/\s+/), function(cls) { + if (/mce\w+/.test(cls)) + valueOut += (valueOut ? ' ' : '') + cls; + }); + + // We got some internal classes left + if (valueOut) { + dom.setAttrib(node, name, valueOut); + return; + } + } + } + + // IE6 has a bug where the attribute doesn't get removed correctly + if (name == "class") + node.removeAttribute('className'); + + // Remove mce prefixed attributes + if (MCE_ATTR_RE.test(name)) + node.removeAttribute('data-mce-' + name); + + node.removeAttribute(name); + } + }); + + // Remove classes + each(format.classes, function(value) { + value = replaceVars(value, vars); + + if (!compare_node || dom.hasClass(compare_node, value)) + dom.removeClass(node, value); + }); + + // Check for non internal attributes + attrs = dom.getAttribs(node); + for (i = 0; i < attrs.length; i++) { + if (attrs[i].nodeName.indexOf('_') !== 0) + return FALSE; + } + } + + // Remove the inline child if it's empty for example or + if (format.remove != 'none') { + removeNode(node, format); + return TRUE; + } + }; + + function removeNode(node, format) { + var parentNode = node.parentNode, rootBlockElm; + + if (format.block) { + if (!forcedRootBlock) { + function find(node, next, inc) { + node = getNonWhiteSpaceSibling(node, next, inc); + + return !node || (node.nodeName == 'BR' || isBlock(node)); + }; + + // Append BR elements if needed before we remove the block + if (isBlock(node) && !isBlock(parentNode)) { + if (!find(node, FALSE) && !find(node.firstChild, TRUE, 1)) + node.insertBefore(dom.create('br'), node.firstChild); + + if (!find(node, TRUE) && !find(node.lastChild, FALSE, 1)) + node.appendChild(dom.create('br')); + } + } else { + // Wrap the block in a forcedRootBlock if we are at the root of document + if (parentNode == dom.getRoot()) { + if (!format.list_block || !isEq(node, format.list_block)) { + each(tinymce.grep(node.childNodes), function(node) { + if (isValid(forcedRootBlock, node.nodeName.toLowerCase())) { + if (!rootBlockElm) + rootBlockElm = wrap(node, forcedRootBlock); + else + rootBlockElm.appendChild(node); + } else + rootBlockElm = 0; + }); + } + } + } + } + + // Never remove nodes that isn't the specified inline element if a selector is specified too + if (format.selector && format.inline && !isEq(format.inline, node)) + return; + + dom.remove(node, 1); + }; + + function getNonWhiteSpaceSibling(node, next, inc) { + if (node) { + next = next ? 'nextSibling' : 'previousSibling'; + + for (node = inc ? node : node[next]; node; node = node[next]) { + if (node.nodeType == 1 || !isWhiteSpaceNode(node)) + return node; + } + } + }; + + function isBookmarkNode(node) { + return node && node.nodeType == 1 && node.getAttribute('data-mce-type') == 'bookmark'; + }; + + function mergeSiblings(prev, next) { + var marker, sibling, tmpSibling; + + function compareElements(node1, node2) { + // Not the same name + if (node1.nodeName != node2.nodeName) + return FALSE; + + function getAttribs(node) { + var attribs = {}; + + each(dom.getAttribs(node), function(attr) { + var name = attr.nodeName.toLowerCase(); + + // Don't compare internal attributes or style + if (name.indexOf('_') !== 0 && name !== 'style') + attribs[name] = dom.getAttrib(node, name); + }); + + return attribs; + }; + + function compareObjects(obj1, obj2) { + var value, name; + + for (name in obj1) { + // Obj1 has item obj2 doesn't have + if (obj1.hasOwnProperty(name)) { + value = obj2[name]; + + // Obj2 doesn't have obj1 item + if (value === undefined) + return FALSE; + + // Obj2 item has a different value + if (obj1[name] != value) + return FALSE; + + // Delete similar value + delete obj2[name]; + } + } + + // Check if obj 2 has something obj 1 doesn't have + for (name in obj2) { + // Obj2 has item obj1 doesn't have + if (obj2.hasOwnProperty(name)) + return FALSE; + } + + return TRUE; + }; + + // Attribs are not the same + if (!compareObjects(getAttribs(node1), getAttribs(node2))) + return FALSE; + + // Styles are not the same + if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) + return FALSE; + + return TRUE; + }; + + // Check if next/prev exists and that they are elements + if (prev && next) { + function findElementSibling(node, sibling_name) { + for (sibling = node; sibling; sibling = sibling[sibling_name]) { + if (sibling.nodeType == 3 && sibling.nodeValue.length !== 0) + return node; + + if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) + return sibling; + } + + return node; + }; + + // If previous sibling is empty then jump over it + prev = findElementSibling(prev, 'previousSibling'); + next = findElementSibling(next, 'nextSibling'); + + // Compare next and previous nodes + if (compareElements(prev, next)) { + // Append nodes between + for (sibling = prev.nextSibling; sibling && sibling != next;) { + tmpSibling = sibling; + sibling = sibling.nextSibling; + prev.appendChild(tmpSibling); + } + + // Remove next node + dom.remove(next); + + // Move children into prev node + each(tinymce.grep(next.childNodes), function(node) { + prev.appendChild(node); + }); + + return prev; + } + } + + return next; + }; + + function isTextBlock(name) { + return /^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(name); + }; + + function getContainer(rng, start) { + var container, offset, lastIdx, walker; + + container = rng[start ? 'startContainer' : 'endContainer']; + offset = rng[start ? 'startOffset' : 'endOffset']; + + if (container.nodeType == 1) { + lastIdx = container.childNodes.length - 1; + + if (!start && offset) + offset--; + + container = container.childNodes[offset > lastIdx ? lastIdx : offset]; + } + + // If start text node is excluded then walk to the next node + if (container.nodeType === 3 && start && offset >= container.nodeValue.length) { + container = new TreeWalker(container, ed.getBody()).next() || container; + } + + // If end text node is excluded then walk to the previous node + if (container.nodeType === 3 && !start && offset == 0) { + container = new TreeWalker(container, ed.getBody()).prev() || container; + } + + return container; + }; + + function performCaretAction(type, name, vars) { + var invisibleChar, caretContainerId = '_mce_caret', debug = ed.settings.caret_debug; + + // Setup invisible character use zero width space on Gecko since it doesn't change the heigt of the container + invisibleChar = tinymce.isGecko ? '\u200B' : INVISIBLE_CHAR; + + // Creates a caret container bogus element + function createCaretContainer(fill) { + var caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''}); + + if (fill) { + caretContainer.appendChild(ed.getDoc().createTextNode(invisibleChar)); + } + + return caretContainer; + }; + + function isCaretContainerEmpty(node, nodes) { + while (node) { + if ((node.nodeType === 3 && node.nodeValue !== invisibleChar) || node.childNodes.length > 1) { + return false; + } + + // Collect nodes + if (nodes && node.nodeType === 1) { + nodes.push(node); + } + + node = node.firstChild; + } + + return true; + }; + + // Returns any parent caret container element + function getParentCaretContainer(node) { + while (node) { + if (node.id === caretContainerId) { + return node; + } + + node = node.parentNode; + } + }; + + // Finds the first text node in the specified node + function findFirstTextNode(node) { + var walker; + + if (node) { + walker = new TreeWalker(node, node); + + for (node = walker.current(); node; node = walker.next()) { + if (node.nodeType === 3) { + return node; + } + } + } + }; + + // Removes the caret container for the specified node or all on the current document + function removeCaretContainer(node, move_caret) { + var child, rng; + + if (!node) { + node = getParentCaretContainer(selection.getStart()); + + if (!node) { + while (node = dom.get(caretContainerId)) { + removeCaretContainer(node, false); + } + } + } else { + rng = selection.getRng(true); + + if (isCaretContainerEmpty(node)) { + if (move_caret !== false) { + rng.setStartBefore(node); + rng.setEndBefore(node); + } + + dom.remove(node); + } else { + child = findFirstTextNode(node); + + if (child.nodeValue.charAt(0) === INVISIBLE_CHAR) { + child = child.deleteData(0, 1); + } + + dom.remove(node, 1); + } + + selection.setRng(rng); + } + }; + + // Applies formatting to the caret postion + function applyCaretFormat() { + var rng, caretContainer, textNode, offset, bookmark, container, text; + + rng = selection.getRng(true); + offset = rng.startOffset; + container = rng.startContainer; + text = container.nodeValue; + + caretContainer = getParentCaretContainer(selection.getStart()); + if (caretContainer) { + textNode = findFirstTextNode(caretContainer); + } + + // Expand to word is caret is in the middle of a text node and the char before/after is a alpha numeric character + if (text && offset > 0 && offset < text.length && /\w/.test(text.charAt(offset)) && /\w/.test(text.charAt(offset - 1))) { + // Get bookmark of caret position + bookmark = selection.getBookmark(); + + // Collapse bookmark range (WebKit) + rng.collapse(true); + + // Expand the range to the closest word and split it at those points + rng = expandRng(rng, get(name)); + rng = rangeUtils.split(rng); + + // Apply the format to the range + apply(name, vars, rng); + + // Move selection back to caret position + selection.moveToBookmark(bookmark); + } else { + if (!caretContainer || textNode.nodeValue !== invisibleChar) { + caretContainer = createCaretContainer(true); + textNode = caretContainer.firstChild; + + rng.insertNode(caretContainer); + offset = 1; + + apply(name, vars, caretContainer); + } else { + apply(name, vars, caretContainer); + } + + // Move selection to text node + selection.setCursorLocation(textNode, offset); + } + }; + + function removeCaretFormat() { + var rng = selection.getRng(true), container, offset, bookmark, + hasContentAfter, node, formatNode, parents = [], i, caretContainer; + + container = rng.startContainer; + offset = rng.startOffset; + node = container; + + if (container.nodeType == 3) { + if (offset != container.nodeValue.length || container.nodeValue === invisibleChar) { + hasContentAfter = true; + } + + node = node.parentNode; + } + + while (node) { + if (matchNode(node, name, vars)) { + formatNode = node; + break; + } + + if (node.nextSibling) { + hasContentAfter = true; + } + + parents.push(node); + node = node.parentNode; + } + + // Node doesn't have the specified format + if (!formatNode) { + return; + } + + // Is there contents after the caret then remove the format on the element + if (hasContentAfter) { + // Get bookmark of caret position + bookmark = selection.getBookmark(); + + // Collapse bookmark range (WebKit) + rng.collapse(true); + + // Expand the range to the closest word and split it at those points + rng = expandRng(rng, get(name), true); + rng = rangeUtils.split(rng); + + // Remove the format from the range + remove(name, vars, rng); + + // Move selection back to caret position + selection.moveToBookmark(bookmark); + } else { + caretContainer = createCaretContainer(); + + node = caretContainer; + for (i = parents.length - 1; i >= 0; i--) { + node.appendChild(parents[i].cloneNode(false)); + node = node.firstChild; + } + + // Insert invisible character into inner most format element + node.appendChild(dom.doc.createTextNode(invisibleChar)); + node = node.firstChild; + + // Insert caret container after the formated node + dom.insertAfter(caretContainer, formatNode); + + // Move selection to text node + selection.setCursorLocation(node, 1); + } + }; + + // Only bind the caret events once + if (!self._hasCaretEvents) { + // Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements + ed.onBeforeGetContent.addToTop(function() { + var nodes = [], i; + + if (isCaretContainerEmpty(getParentCaretContainer(selection.getStart()), nodes)) { + // Mark children + i = nodes.length; + while (i--) { + dom.setAttrib(nodes[i], 'data-mce-bogus', '1'); + } + } + }); + + // Remove caret container on mouse up and on key up + tinymce.each('onMouseUp onKeyUp'.split(' '), function(name) { + ed[name].addToTop(function() { + removeCaretContainer(); + }); + }); + + // Remove caret container on keydown and it's a backspace, enter or left/right arrow keys + ed.onKeyDown.addToTop(function(ed, e) { + var keyCode = e.keyCode; + + if (keyCode == 8 || keyCode == 37 || keyCode == 39) { + removeCaretContainer(getParentCaretContainer(selection.getStart())); + } + }); + + self._hasCaretEvents = true; + } + + // Do apply or remove caret format + if (type == "apply") { + applyCaretFormat(); + } else { + removeCaretFormat(); + } + }; + + function moveStart(rng) { + var container = rng.startContainer, + offset = rng.startOffset, + walker, node, nodes, tmpNode; + + // Convert text node into index if possible + if (container.nodeType == 3 && offset >= container.nodeValue.length - 1) { + container = container.parentNode; + offset = nodeIndex(container) + 1; + } + + // Move startContainer/startOffset in to a suitable node + if (container.nodeType == 1) { + nodes = container.childNodes; + container = nodes[Math.min(offset, nodes.length - 1)]; + walker = new TreeWalker(container); + + // If offset is at end of the parent node walk to the next one + if (offset > nodes.length - 1) + walker.next(); + + for (node = walker.current(); node; node = walker.next()) { + if (node.nodeType == 3 && !isWhiteSpaceNode(node)) { + // IE has a "neat" feature where it moves the start node into the closest element + // we can avoid this by inserting an element before it and then remove it after we set the selection + tmpNode = dom.create('a', null, INVISIBLE_CHAR); + node.parentNode.insertBefore(tmpNode, node); + + // Set selection and remove tmpNode + rng.setStart(node, 0); + selection.setRng(rng); + dom.remove(tmpNode); + + return; + } + } + } + }; + + }; +})(tinymce); + +tinymce.onAddEditor.add(function(tinymce, ed) { + var filters, fontSizes, dom, settings = ed.settings; + + if (settings.inline_styles) { + fontSizes = tinymce.explode(settings.font_size_legacy_values); + + function replaceWithSpan(node, styles) { + tinymce.each(styles, function(value, name) { + if (value) + dom.setStyle(node, name, value); + }); + + dom.rename(node, 'span'); + }; + + filters = { + font : function(dom, node) { + replaceWithSpan(node, { + backgroundColor : node.style.backgroundColor, + color : node.color, + fontFamily : node.face, + fontSize : fontSizes[parseInt(node.size) - 1] + }); + }, + + u : function(dom, node) { + replaceWithSpan(node, { + textDecoration : 'underline' + }); + }, + + strike : function(dom, node) { + replaceWithSpan(node, { + textDecoration : 'line-through' + }); + } + }; + + function convert(editor, params) { + dom = editor.dom; + + if (settings.convert_fonts_to_spans) { + tinymce.each(dom.select('font,u,strike', params.node), function(node) { + filters[node.nodeName.toLowerCase()](ed.dom, node); + }); + } + }; + + ed.onPreProcess.add(convert); + ed.onSetContent.add(convert); + + ed.onInit.add(function() { + ed.selection.onSetContent.add(convert); + }); + } +}); + diff --git a/engine/lib/external/tinymce-jq/utils/editable_selects.js b/templates/framework/js/vendor/tinymce-jq/utils/editable_selects.js similarity index 96% rename from engine/lib/external/tinymce-jq/utils/editable_selects.js rename to templates/framework/js/vendor/tinymce-jq/utils/editable_selects.js index 4b920f3d..4d9ffe27 100644 --- a/engine/lib/external/tinymce-jq/utils/editable_selects.js +++ b/templates/framework/js/vendor/tinymce-jq/utils/editable_selects.js @@ -1,70 +1,70 @@ -/** - * editable_selects.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -var TinyMCE_EditableSelects = { - editSelectElm : null, - - init : function() { - var nl = document.getElementsByTagName("select"), i, d = document, o; - - for (i=0; i'; - h += ' '; - - return h; -} - -function updateColor(img_id, form_element_id) { - document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; -} - -function setBrowserDisabled(id, state) { - var img = document.getElementById(id); - var lnk = document.getElementById(id + "_link"); - - if (lnk) { - if (state) { - lnk.setAttribute("realhref", lnk.getAttribute("href")); - lnk.removeAttribute("href"); - tinyMCEPopup.dom.addClass(img, 'disabled'); - } else { - if (lnk.getAttribute("realhref")) - lnk.setAttribute("href", lnk.getAttribute("realhref")); - - tinyMCEPopup.dom.removeClass(img, 'disabled'); - } - } -} - -function getBrowserHTML(id, target_form_element, type, prefix) { - var option = prefix + "_" + type + "_browser_callback", cb, html; - - cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); - - if (!cb) - return ""; - - html = ""; - html += ''; - html += ' '; - - return html; -} - -function openBrowser(img_id, target_form_element, type, option) { - var img = document.getElementById(img_id); - - if (img.className != "mceButtonDisabled") - tinyMCEPopup.openBrowser(target_form_element, type, option); -} - -function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { - if (!form_obj || !form_obj.elements[field_name]) - return; - - if (!value) - value = ""; - - var sel = form_obj.elements[field_name]; - - var found = false; - for (var i=0; i'; + h += ' '; + + return h; +} + +function updateColor(img_id, form_element_id) { + document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; +} + +function setBrowserDisabled(id, state) { + var img = document.getElementById(id); + var lnk = document.getElementById(id + "_link"); + + if (lnk) { + if (state) { + lnk.setAttribute("realhref", lnk.getAttribute("href")); + lnk.removeAttribute("href"); + tinyMCEPopup.dom.addClass(img, 'disabled'); + } else { + if (lnk.getAttribute("realhref")) + lnk.setAttribute("href", lnk.getAttribute("realhref")); + + tinyMCEPopup.dom.removeClass(img, 'disabled'); + } + } +} + +function getBrowserHTML(id, target_form_element, type, prefix) { + var option = prefix + "_" + type + "_browser_callback", cb, html; + + cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); + + if (!cb) + return ""; + + html = ""; + html += ''; + html += ' '; + + return html; +} + +function openBrowser(img_id, target_form_element, type, option) { + var img = document.getElementById(img_id); + + if (img.className != "mceButtonDisabled") + tinyMCEPopup.openBrowser(target_form_element, type, option); +} + +function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { + if (!form_obj || !form_obj.elements[field_name]) + return; + + if (!value) + value = ""; + + var sel = form_obj.elements[field_name]; + + var found = false; + for (var i=0; i parseInt(v)) - st = this.mark(f, n); - } - } - - return st; - }, - - hasClass : function(n, c, d) { - return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); - }, - - getNum : function(n, c) { - c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; - c = c.replace(/[^0-9]/g, ''); - - return c; - }, - - addClass : function(n, c, b) { - var o = this.removeClass(n, c); - n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; - }, - - removeClass : function(n, c) { - c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); - return n.className = c != ' ' ? c : ''; - }, - - tags : function(f, s) { - return f.getElementsByTagName(s); - }, - - mark : function(f, n) { - var s = this.settings; - - this.addClass(n, s.invalid_cls); - n.setAttribute('aria-invalid', 'true'); - this.markLabels(f, n, s.invalid_cls); - - return false; - }, - - markLabels : function(f, n, ic) { - var nl, i; - - nl = this.tags(f, "label"); - for (i=0; i parseInt(v)) + st = this.mark(f, n); + } + } + + return st; + }, + + hasClass : function(n, c, d) { + return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); + }, + + getNum : function(n, c) { + c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; + c = c.replace(/[^0-9]/g, ''); + + return c; + }, + + addClass : function(n, c, b) { + var o = this.removeClass(n, c); + n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; + }, + + removeClass : function(n, c) { + c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); + return n.className = c != ' ' ? c : ''; + }, + + tags : function(f, s) { + return f.getElementsByTagName(s); + }, + + mark : function(f, n) { + var s = this.settings; + + this.addClass(n, s.invalid_cls); + n.setAttribute('aria-invalid', 'true'); + this.markLabels(f, n, s.invalid_cls); + + return false; + }, + + markLabels : function(f, n, ic) { + var nl, i; + + nl = this.tags(f, "label"); + for (i=0; i '[UTC + 14] Line Island Time' ) ); -?> +?> \ No newline at end of file diff --git a/templates/skin/developer/actions/ActionAdmin/user_fields.tpl b/templates/skin/developer/actions/ActionAdmin/user_fields.tpl index 0e1a9a35..c8c77443 100644 --- a/templates/skin/developer/actions/ActionAdmin/user_fields.tpl +++ b/templates/skin/developer/actions/ActionAdmin/user_fields.tpl @@ -1,5 +1,5 @@ {include file='header.tpl'} -{include file='modals/modal_userfields.tpl'} +{include file='modals/modal.userfields.tpl'} diff --git a/templates/skin/developer/actions/ActionBlog/blog.tpl b/templates/skin/developer/actions/ActionBlog/blog.tpl index a21d3b7f..1fbdbe4e 100644 --- a/templates/skin/developer/actions/ActionBlog/blog.tpl +++ b/templates/skin/developer/actions/ActionBlog/blog.tpl @@ -11,7 +11,7 @@ {if $oUserCurrent and $oUserCurrent->isAdministrator()} - {include file='modals/modal_blog_delete.tpl'} + {include file='modals/modal.blog_delete.tpl'} {/if} @@ -40,7 +40,7 @@
  • {$aLang.blog_edit}
  • {if $oUserCurrent->isAdministrator()} -
  • {$aLang.blog_delete} +
  • {$aLang.blog_delete} {else} {$aLang.blog_delete} {/if} @@ -101,27 +101,7 @@ {hook run='blog_info' oBlog=$oBlog} - - - - +{include file='menu.blog_single.tpl'} {if $bCloseBlog} {$aLang.blog_close_show} diff --git a/templates/skin/developer/actions/ActionPhotoset/add.tpl b/templates/skin/developer/actions/ActionPhotoset/add.tpl index 4497d8fd..30bd8be1 100644 --- a/templates/skin/developer/actions/ActionPhotoset/add.tpl +++ b/templates/skin/developer/actions/ActionPhotoset/add.tpl @@ -20,7 +20,7 @@ -{include file='modals/modal_photoset_add_photo.tpl'} +{include file='modals/modal.photoset_add_photo.tpl'} {hook run='add_topic_photoset_begin'} @@ -97,7 +97,7 @@ {/if} - {$aLang.topic_photoset_upload_choose} + {$aLang.topic_photoset_upload_choose}
  • diff --git a/templates/skin/developer/actions/ActionProfile/friend_item.tpl b/templates/skin/developer/actions/ActionProfile/friend_item.tpl index 2a04839c..6bde06f0 100644 --- a/templates/skin/developer/actions/ActionProfile/friend_item.tpl +++ b/templates/skin/developer/actions/ActionProfile/friend_item.tpl @@ -9,9 +9,9 @@ {elseif $oUserFriend and $oUserFriend->getFriendStatus()==$USER_FRIEND_OFFER+$USER_FRIEND_NULL and $oUserFriend->getUserTo()==$oUserCurrent->getId()}
  • {$aLang.user_friend_add}
  • {elseif !$oUserFriend} - {include file='modals/modal_add_friend.tpl'} + {include file='modals/modal.add_friend.tpl'} -
  • {$aLang.user_friend_add}
  • +
  • {$aLang.user_friend_add}
  • {else}
  • {$aLang.user_friend_add}
  • {/if} \ No newline at end of file diff --git a/templates/skin/developer/actions/ActionProfile/sidebar.tpl b/templates/skin/developer/actions/ActionProfile/sidebar.tpl index b0054e41..95a4b102 100644 --- a/templates/skin/developer/actions/ActionProfile/sidebar.tpl +++ b/templates/skin/developer/actions/ActionProfile/sidebar.tpl @@ -1,6 +1,6 @@ {hook run='profile_sidebar_begin' oUserProfile=$oUserProfile} -{include file='modals/modal_profile_photo_upload.tpl'} +{include file='modals/modal.profile_photo_upload.tpl'}
    diff --git a/templates/skin/developer/actions/ActionProfile/whois.tpl b/templates/skin/developer/actions/ActionProfile/whois.tpl index 2032123c..878524c4 100644 --- a/templates/skin/developer/actions/ActionProfile/whois.tpl +++ b/templates/skin/developer/actions/ActionProfile/whois.tpl @@ -46,7 +46,7 @@ {if $oUserProfile->getProfileBirthday()} {$aLang.profile_birthday}: - {date_format date=$oUserProfile->getProfileBirthday() format="j F Y"} + {date_format date=$oUserProfile->getProfileBirthday() format="j F Y" notz=true} {/if} diff --git a/templates/skin/developer/actions/ActionSettings/profile.tpl b/templates/skin/developer/actions/ActionSettings/profile.tpl index 8a482ece..db95540f 100644 --- a/templates/skin/developer/actions/ActionSettings/profile.tpl +++ b/templates/skin/developer/actions/ActionSettings/profile.tpl @@ -1,7 +1,7 @@ {assign var="sidebarPosition" value='left'} {include file='header.tpl'} -{include file='modals/modal_profile_avatar_upload.tpl'} +{include file='modals/modal.profile_avatar_upload.tpl'} {include file='actions/ActionProfile/profile_top.tpl'} {include file='menu.settings.tpl'} diff --git a/templates/skin/developer/blocks/block.stream.tpl b/templates/skin/developer/blocks/block.stream.tpl index 3c151955..99876ef6 100644 --- a/templates/skin/developer/blocks/block.stream.tpl +++ b/templates/skin/developer/blocks/block.stream.tpl @@ -16,10 +16,10 @@ + data-type="dropdown-toggle" + data-option-target="js-dropdown-stream" + data-option-change-text="true" + {if !$sItemsHook}style="display: none;"{/if}>{$aLang.block_stream_comments}