Mamochki.by

var _____WB$wombat$assign$function_____ = function(name) {return (self. _wb_wombat && self. _wb_wombat. local_init && self. _wb_wombat. local_init(name)) || self[name]; };

var _____WB$wombat$assign$function_____ = function(name) {return (self. _wb_wombat && self. _wb_wombat. local_init && self. _wb_wombat. local_init(name)) || self[name]; };
if (! self. __WB_pmw) { self. __WB_pmw = function(obj) { this. __WB_source = obj; return this; } }
{
let window = _____WB$wombat$assign$function_____(“window”);
let self = _____WB$wombat$assign$function_____(“self”);
let document = _____WB$wombat$assign$function_____(“document”);
let location = _____WB$wombat$assign$function_____(“location”);
let top = _____WB$wombat$assign$function_____(“top”);
let parent = _____WB$wombat$assign$function_____(“parent”);
let frames = _____WB$wombat$assign$function_____(“frames”);
let opener = _____WB$wombat$assign$function_____(“opener”);
var Floor_FormCheck=new Class({Implements: [Options, Events], options: {tipsClass: ‘fc-tbx’, errorClass: ‘fc-error’, fieldErrorClass: ‘fc-field-error’, trimValue: false, validateDisabled: false, submitByAjax: false, ajaxResponseDiv: false, ajaxEvalScripts: false, onAjaxRequest: $empty, onAjaxSuccess: $empty, onAjaxFailure: $empty, display: {showErrors: 1, titlesInsteadNames: 0, errorsLocation: 1, indicateErrors: 1, keepFocusOnError: 0, checkValueIfEmpty: 1, addClassErrorToField: 0, fixPngForIe: 1, replaceTipsEffect: 1, flashTips: 0, closeTipsButton: 1, tipsPosition:”right”, tipsOffsetX: -45, tipsOffsetY: 0, listErrorsAtTop: false, scrollToFirst: true, fadeDuration: 300}, alerts: {required:”This field is required.”, alpha:”This field accepts alphabetic characters only.”, alphanum:”This field accepts alphanumeric characters only.”, nodigit:”No digits are accepted.”, digit:”Please enter a valid integer.”, digitltd:”The value must be between %0 and %1″, number:”Please enter a valid number.”, email:”Please enter a valid email.”, phone:”Please enter a valid phone.”, url:”Please enter a valid url.”, confirm:”This field is different from %0″, differs:”This value must be different of %0″, length_str:”The length is incorrect, it must be between %0 and %1″, length_fix:”The length is incorrect, it must be exactly %0 characters”, lengthmax:”The length is incorrect, it must be at max %0″, lengthmin:”The length is incorrect, it must be at least %0″, checkbox:”Please check the box”, radios:”Please select a radio”, select:”Please choose a value”}, regexp: {required: /[^. *]/, alpha: /^[a-z. _-]+$/i, alphanum: /^[a-z0-9. _-]+$/i, digit: /^[-+]? [0-9]+$/, nodigit: /^[^0-9]+$/, number: /^[-+]? d*.? d+$/, email: /^[a-z0-9. _%-]+@[a-z0-9. -]+. [a-z]{2, 4}$/i, phone: /^[ds (). -]+$/, url: /^(
this. listErrorsAtTop(el, method); if(this. options. display. indicateErrors==2||this. alreadyIndicated==false||el. name==this. alreadyIndicated. name)
{if(! this. firstError)this. firstError=el; this. alreadyIndicated=el; if(this. options. display. keepFocusOnError&&el. name==this. firstError. name)(function(){el. focus()}). delay(20); this. addError(el); return false; }}else if((isValid||(! el. validation. contains(‘required’)&&! el. value))&&el. element){this. removeError(el); return true; }
return true; }, addError: function(obj){if(! obj. element&&this. options. display. indicateErrors! =0){if(this. options. display. errorsLocation==1){var pos=(this. options. display. tipsPosition==’left’)? obj. getCoordinates(). left: obj. getCoordinates(). right; var options={‘opacity’: 0, ‘position’: ‘absolute’, ‘float’: ‘left’, ‘left’: pos+this. options. display. tipsOffsetX}
obj. element=new Element(‘div’, {‘class’: this. options. tipsClass, ‘styles’: options}). injectInside(document. body); this. addPositionEvent(obj); }else if(this. options. display. errorsLocation==2){obj. element=new Element(‘div’, {‘class’: this. options. errorClass, ‘styles’: {‘opacity’: 0}}). injectBefore(obj); }else if(this. options. display. errorsLocation==3){obj. element=new Element(‘div’, {‘class’: this. options. errorClass, ‘styles’: {‘opacity’: 0}}); if($type(obj. group)==’object’||$type(obj. group)==’collection’)
obj. element. injectAfter(obj. group[obj. group. length-1]); else
obj. element. injectAfter(obj); }}
if(obj. element){obj. element. empty(); if(this. options. display. errorsLocation==1){var errors=[]; obj. errors. each(function(error){errors. push(new Element(‘p’). set(‘html’, error)); }); var tips=this. makeTips(errors). injectInside(obj. element); if(this. options. display. closeTipsButton){tips. getElements(‘a. close’). addEvent(‘mouseup’, function(){this. removeError(obj); }. bind(this)); }
obj. element. setStyle(‘top’, obj. getCoordinates(). top-tips. getCoordinates(). height+this. options. display. tipsOffsetY); }else{obj. errors. each(function(error){new Element(‘p’). set(‘html’, error). injectInside(obj. element); }); }
if(! Browser. Engine. trident5&&obj. element. getStyle(‘opacity’)==0)
new Fx. Morph(obj. element, {‘duration’: this. options. display. fadeDuration}). start({‘opacity’: [1]}); else
obj. element. setStyle(‘opacity’, 1); }
if(this. options. display. addClassErrorToField&&this. isChildType(obj)==false)
{obj. addClass(this. options. fieldErrorClass); }}, addPositionEvent: function(obj){if(this. options. display. replaceTipsEffect){obj. event=function(){new Fx. Morph(obj. element, {‘duration’: this. options. display. fadeDuration}). start({‘left’: [obj. element. getStyle(‘left’), obj. getCoordinates(). right+this. options. display. tipsOffsetX], ‘top’: [obj. element. getStyle(‘top’), obj. getCoordinates(). top-obj. element. getCoordinates(). height+this. options. display. tipsOffsetY]}); }. bind(this); }else{obj. event=function(){obj. element. setStyles({‘left’: obj. getCoordinates(). right+this. options. display. tipsOffsetX, ‘top’: obj. getCoordinates(). top-obj. element. getCoordinates(). height+this. options. display. tipsOffsetY}); }. bind(this)}
window. addEvent(‘resize’, obj. event); }, removeError: function(obj){this. firstError=false; this. alreadyIndicated=false; obj. errors=[]; obj. isOK=true; window. removeEvent(‘resize’, obj. event); if(this. options. display. errorsLocation==2)
new Fx. Morph(obj. element, {‘duration’: this. options. display. fadeDuration}). start({‘height’: [0]}); if(! Browser. Engine. trident5){new Fx. Morph(obj. element, {‘duration’: this. options. display. fadeDuration, ‘onComplete’: function(){if(obj. element){obj. element. destroy(); obj. element=false; }}. bind(this)}). start({‘opacity’: [1, 0]}); }else{obj. element. destroy(); obj. element=false; }
if(this. options. display. addClassErrorToField&&! this. isChildType(obj))
{obj. removeClass(this. options. fieldErrorClass); }}, focusOnError: function(obj){if(this. options. display. scrollToFirst&&! this. alreadyFocused&&! this. isScrolling){if(this. alreadyIndicated. element){switch(this. options. display. errorsLocation){case 1: var dest=obj. element. getCoordinates(). top; break; case 2: var dest=obj. element. getCoordinates(). top-30; break; case 3: var dest=obj. getCoordinates(). top-30; break; }
this. isScrolling=true; }else if(! this. options. display. indicateErrors){var dest=obj. getCoordinates(). top-30; }
if(window. getScroll. y! =dest){new Fx. Scroll(window, {onComplete: function(){this. isScrolling=false; obj. focus(); }. bind(this)}). start(0, dest); }else{this. isScrolling=false; obj. focus(); }
this. alreadyFocused=true; }}, fixIeStuffs: function(){if(Browser. Engine. trident4){var rpng=new RegExp(‘url(([. a-zA-Z0-9_/: -]+. png))’); var search=new RegExp(‘(. +)formcheck. css’); for(var i=0; i 0){element. inject(this. form, ‘after’); this. form. addClass(‘hide’); element. set(‘html’, json. html); }else{if($(‘bottomAddCommenLink’))element. inject($(‘bottomAddCommenLink’), ‘before’); else element. inject(this. main. commentsContainer); element. set(‘html’, json. html); new Fx. Scroll(window, {duration: 1000}). toElement(element. firstChild. id); }
this. clearForm(); this. main. init(); }else if(json. status==’error’){element. inject(this. form, ‘before’); element. set(‘html’, json. html); }}, clearForm: function(){this. form. getElement(‘textarea’). value=”; }, getFormByInput: function(input){this. getParentElement(input); }, getParentElement: function(input){var parent=input. getParent()
if(parent. tagName==’FORM’){this. form=parent; }else this. getParentElement(parent); }, hideMessages: function(){$$(‘. successBlock’). each(function(item){item. destroy()}); $$(‘. errorBlock’). each(function(item){item. destroy(); }); }}); var Ria_Common_KeyListener=new Class({keysArr: [10, 13], keysCodes: {‘esc’: [27], ‘enter’: [13], ‘ctrl+enter’: [13], ‘left’: [37], ‘right’: [39]}, init: function(object, func, arr){var code; if(arr)this. keysArr=arr; if(object){this. removeEvents(object); object. addEvent(‘keydown’, function(event){if(event. event. keyCode)code=event. event. keyCode; else code=event. code; if(event. control&&this. keysArr. length&&this. keysArr. contains(code)){func(); }else if(! arr)func(); }. bind(this)); }}, initMultiple: function(objectEl){if(Object. getLength(objectEl)){var target, code; Object. each(objectEl, function(item, key){target=this. getTarget(key); if(target){this. removeEvents(target); target. addEvent(‘keydown’, function(event){if(event. keyCode)code=event. keyCode; else if(event. event. keyCode)code=event. event. keyCode; else code=event. code; if(Object. getLength(item)){Object. each(item, function(ev, keyCode){if(keyCode==’ctrl+enter’&&event. control&&this. keysCodes[keyCode]. length&&this. keysCodes[keyCode]. contains(code)){ev(); }else if(this. keysCodes[keyCode]. length&&this. keysCodes[keyCode]. contains(code)){ev(); }}. bind(this)); }}. bind(this)); }}. bind(this)); }}, getTarget: function(value){if(value==’window’)
return window; else if(value==’body’)
return $(document. body); else if(value==’document’)
return $(document); else if($(value))
return $(value); else return null; }, removeEvents: function(element){if(element)element. removeEvents(‘keydown’); }, keyListener: function(event){}}); var Ria_Common_Clone=new Class({index: 0, element: null, setIndex: function(index){this. index=index; return this; }, setOriginalDOM: function(element){if(! element||! $defined(element)){return false; }
this. element=element. clone(true, true); return this; }, setNameRelations: function(nameRelations){this. nameRelations=nameRelations; return this; }, setFieldsRelations: function(fields){this. fieldsRelations=fields; return this; }, setAttributeRelations: function(attributes){this. attributeRelations=attributes; return this; }, setRelations: function(relations){if(relations. attributes)this. setAttributeRelations(relations. attributes); if(relations. fields)this. setFieldsRelations(relations. fields); return this; }, clone: function(){if(null==this. element){return false; }
this. index++; this. elementClone=this. element. clone(true, true); this. elementClone. setAttribute(‘index’, this. index); this. _parseIds(); return this. elementClone; }, _parseIds: function(){var nameChange=new Hash(this. nameRelations). getLength(); var fieldChange=new Hash(this. fieldsRelations). getLength(); var attributeChange=new Hash(this. attributeRelations). getLength(); if(this. elementClone. getAttribute(‘id’)){if($(this. elementClone. getAttribute(‘id’)+’_’+this. index))
$(this. elementClone. getAttribute(‘id’)+’_’+this. index). destroy(); this. elementClone. setAttribute(‘id’, this. elementClone. getAttribute(‘id’)+’_’+this. index); }
this. elementClone. getElements(‘*’). each(function(item){var id=item. getAttribute(‘id’); if(id){var newId=id+’_’+this. index; item. setAttribute(‘id’, newId); }
if(item. tagName==’LABEL’&&item. getAttribute(‘for’))item. setAttribute(‘for’, item. getAttribute(‘for’)+’_’+this. index); var name=item. getAttribute(‘name’); var rename=function(item, newName){newName=newName. replace(‘{%index}’, this. index); item. setAttribute(‘name’, newName); }. bind(this)
if(nameChange&&name&&this. nameRelations[name]){var newName=this. nameRelations[name]; rename(item, newName); }else if(nameChange&&name&&new Array(this. nameRelations). length){new Hash(this. nameRelations). each(function(newName, oldName){var regexp=new RegExp(oldName); if(regexp. test(name)){rename(item, newName); }}. bind(this)); }
if(fieldChange&&name&&this. fieldsRelations[name]){var value=this. fieldsRelations[name]; item. value=(typeof(value)==’string’)? value. trim(): value; }
if(attributeChange){new Hash(this. attributeRelations). each(function(attrValue, attrName){if(item. getAttribute(attrName)){item. setAttribute(attrName, (attrValue==’index’? item. getAttribute(attrName)+’_’+this. index: attrValue)); }}. bind(this)); }}. bind(this)); }}); var Ria_NewMenu=new Class({Implements: Options, currentId: 0, freeze: 0, cookieName: ‘freeze_menu’, initialize: function(currentId){Cookie. dispose(‘freeze_menu’); currentId=parseInt(currentId); this. currentId=(currentId===0)? 2: currentId; this. mainMenu=$(‘main_menu’); this. process(); }, process: function(){var mainLi=this. mainMenu. getChildren(‘li’); var self=this; mainLi. each(function(item, i, arr){item. addEvents({mouseenter: function(){var id=this. get(‘id’); id=id. replace(/D+/g,”); var _cookie=Cookie. read(‘freeze_menu’); if(! _cookie){$$(‘. inner_active’). removeClass(‘inner_active’); if(! $(‘inner_’+id). hasClass(‘inner_active’)){$(‘inner_’+id). addClass(‘inner_active’); }}}, click: function(e){e. preventDefault(); var id=this. get(‘id’); id=id. replace(/D+/g,”); var _cookie=Cookie. read(‘freeze_menu’); if(! _cookie){Cookie. write(‘freeze_menu’, id); }else{Cookie. dispose(‘freeze_menu’); this. fireEvent(‘mouseenter’); if(_cookie! =id){Cookie. write(‘freeze_menu’, id); }}}}); }); $(‘top_menu’). addEvents({mouseleave: function(){var _cookie=Cookie. read(‘freeze_menu’); if(! _cookie){var childs=$$(‘. inner_menus’); var check=self. check(); if(! check){childs. removeClass(‘inner_active’); if(! $(‘inner_’+self. currentId). hasClass(‘inner_active’)){$(‘inner_’+self. currentId). addClass(‘inner_active’); }}}}})}, check: function(){var inner=$$(‘. inner_active’); var id=inner[0]. get(‘id’); id=id. replace(/D+/g,”); id=parseInt(id); return(id===this. currentId)? true: false; }}); var Ria_Common_Counters=new Class({id: ‘countersContainer’, counters: null, initialize: function(id){if(id)this. id=id; this. counters=$(this. id); if(this. counters){this. counters. empty(); this. addGoogleAnalytics(); this. addW3Clogo(); this. addBigMirCounters(); this. addIUaCounter(); this. addLiveInternetCounter(); this. addMailRuCounter(); }}, addGoogleAnalytics: function(){_gaq. push([‘_trackPageview’, window. location. pathname]); var pageTracker=_gat. _getTracker(“UA-12092601-42″); pageTracker. _trackPageview(); }, addW3Clogo: function(){var anchor=new Element(‘a’, {‘href’: ‘
escape(document. referrer)+((typeof(screen)==”undefined”)?”:”; s”+screen. width+”*”+screen. height+”*”+(screen. colorDepth? screen. colorDepth: screen. pixelDepth))+”; u”+escape(document. URL)+”;”+Math. random(); var anchor=new Element(‘a’, {‘href’: ‘
bm. w++; try{if(bmN. plugins&&bmN. mimeTypes. length&&(x=bmN. plugins[‘Shockwave Flash’]))
bm. m=parseInt(x. description. replace(/([a-zA-Z]|s)+/, ”)); else
for(var f=3; f0){if(typeof(Messages)! =’object’)
var Messages=new Ria_User_Messages(); var rightDiv; if(! $(‘growlContainer’)){rightDiv=new Element(‘div’, {‘class’:”right-message-container”,”id”:”growlContainer”}); rightDiv. inject(document. body); }else rightDiv=$(‘growlContainer’); Object. each(read, function(message, id){if($(‘mess’+id)){$(‘mess’+id). removeClass(‘dialogs_new_msg’); }else{if(! $(“rightMess”+id)){var rightMessDiv=new Element(‘div’, {‘id’:”rightMess”+id, ‘class’: ‘growlWrap sticky’, ‘style’: ‘opacity: 0. 95; cursor: pointer; margin-top: 0px; -moz-transform: scale(1); ‘, ‘title’: ‘Нажать, что бы пропустить’}); rightMessDiv. inject(rightDiv); rightMessDiv. innerHTML=this. getRightReadHtml(message); rightMessDiv. addEvent(‘click’, function(){this. destroy(); }); }}}. bind(this)); }}, handleMessages: function(messages){if(Object. getLength(messages)>0){if(typeof(Messages)! =’object’)
var Messages=new Ria_User_Messages(); var rightDiv; if(! $(‘growlContainer’)){rightDiv=new Element(‘div’, {‘class’:”right-message-container”,”id”:”growlContainer”}); rightDiv. inject(document. body); }else rightDiv=$(‘growlContainer’); Object. each(messages, function(message, id){if($(Messages. container_default+message. user_id)){Messages. setContainer(Messages. container_default+message. user_id); Messages. setUserObj(message); Messages. setText(message. text); Messages. injectComment(id); Messages. logMessState($(‘mess’+id), message. message_id, message. user_id); }else{if(! $(“rightMess”+id)){var rightMessDiv=new Element(‘div’, {‘id’:”rightMess”+id, ‘class’: ‘growlWrap sticky’, ‘style’: ‘opacity: 0. 95; cursor: pointer; margin-top: 0px; -moz-transform: scale(1); ‘, ‘title’: ‘Нажать, что бы пропустить’}); rightMessDiv. inject(rightDiv); rightMessDiv. innerHTML=this. getRightMessHtml(message); rightMessDiv. addEvent(‘click’, function(){this. destroy(); }); setTimeout(function(){rightMessDiv. tween(‘opacity’, [1, 0], 1500)}, 4000); }}
if($(‘countNewMessages’)){$(‘countNewMessages’). set(‘html’, ‘(+’+(parseInt($(‘countNewMessages’). getAttribute(‘count’))+1)+’)’); $(‘countNewMessages’). setAttribute(‘count’, (parseInt($(‘countNewMessages’). getAttribute(‘count’))+1)); }}. bind(this)); }}, getRightMessHtml: function(obj){return’

‘; }, getRightReadHtml: function(obj){return’

‘; }}); var Ria_TabSwitcher=new Class({Implements: Options, options: {tabClass: ‘. tab a’, tabContentClass: ‘. tabcontent’}, tabs: [], tabsContent: [], initialize: function(options){this. setOptions(options); this. tabs=$$(this. options. tabClass); this. tabsContent=$$(this. options. tabContentClass); this. process(); }, process: function(){var self=this; this. tabs. each(function(tab, index){tab. addEvent(‘click’, function(e){e. preventDefault(); self. _expand(index); }); }); }, _expand: function(index){this. tabs. removeClass(‘active’); this. tabsContent. removeClass(‘active’); this. tabsContent[index]. addClass(‘active’); this. tabs[index]. addClass(‘active’); }, expandTab: function(id){this. tabs. removeClass(‘active’); this. tabsContent. removeClass(‘active’); $(id). addClass(‘active’); $(id+’-content’). addClass(‘active’); new Fx. Scroll(window, {duration: 1000}). toElement(id); }}); var Ria_Baraholka_Menu=new Class({Implements: [Events, Options], options: {}, menu: null, initialize: function(id, options){this. menu=$$(id); this. setOptions(options); this. initEvents(); }, initEvents: function(){var self=this; this. menu. each(function(item, i){item. addEvent(‘click’, function(e){e. preventDefault(); self. _expand(item); })}); }, _expand: function(item){item. toggleClass(‘open’); var content=item. getParent(‘li’). getChildren(‘ul’); content. erase(‘style’); content. setStyle(‘display’, content. isVisible()[0]? ‘none’: ‘block’); }, expandItem: function(i){this. _expand(this. menu[i]); }, isExpanded: function(i){return this. menu[i]. getParent(). getChildren()[0]. hasClass(‘open’); }, closeAll: function(){var self=this; this. menu. removeClass(‘open’); this. menu. each(function(item, i){self. _close(item); }); }, _close: function(item){var content=item. getParent(‘li’). getChildren(‘ul’); content. erase(‘style’); content. setStyle(‘display’, ‘none’); }, closeItem: function(i){this. _close(this. menu[i]); }}); var Ria_Core_Map_Main_Common_GeoPoint=new Class({initialize: function(longitude, latitude){this. longitude=longitude; this. latitude=latitude; }, getLongitude: function(){return this. longitude; }, getLatitude: function(){return this. latitude; }, setLongitude: function(longitude){this. longitude=longitude; }, setLatitude: function(latitude){this. latitude=latitude; }, setPoint: function(lngt, lat){this. longitude=lngt; this. latitude=lat; }, convertToMapPoint: function(){return RMaps. Config. getDriver(). convertToMapPoint(this); }}); var Ria_Core_Map_AbstractEvent=new Class({setClientRectInObject: function(object, offset){var windowRect=riaMap. storage. map. getClientRectangle(); var zoom=riaMap. storage. map. getZoom(); offset=offset*(101-zoom); object. zoom=zoom; object. max_ltt=windowRect. max. getLatitude()+offset; object. max_lngt=windowRect. max. getLongitude()+offset; object. min_ltt=windowRect. min. getLatitude()-offset; object. min_lngt=windowRect. min. getLongitude()-offset; return object; }, addMarkersFromResult: function(response){$each(response, function(data, key){data. each(function(points){layerName=key+’_’+points. type_id; if(! $defined(riaMap. storage. layers)){riaMap. storage. layers=new Hash(); }
var layer=null; if(riaMap. storage. layers. has(layerName)){layer=riaMap. storage. layers. get(layerName); }else{layer=new Ria_Core_Map_Main_Adapters_Layer(); riaMap. storage. layers. set(layerName, layer); riaMap. storage. map. addLayer(layer); }
points. points. each(function(point){if(key==’local’){this. placeLocalMarker(point, points, layer); }else{this. placeGlobalMarker(point, points, layer); }}. bind(this)); riaMap. storage. map. repaintMap(); }. bind(this)); }. bind(this)); }, placeLocalMarker: function(point, points, layer){markerName=’local_’+point. point_id+”_”+points. type_id; if(! $defined(riaMap. storage. markers)){riaMap. storage. markers=new Hash(); }
if(! riaMap. storage. markers. has(markerName)){var icon=points. icon; var marker=new Ria_Core_Map_Main_Adapters_Marker(new Ria_Core_Map_Main_Common_GeoPoint(point. longitude, point. latitude)); marker. setIcon(icon. width, icon. height, icon. src, icon. offset_x, icon. offset_y); marker. setName(point. name); marker. point_id=point. point_id; marker. type_id=points. type_id; marker. layers=new Array(); marker. layers. include(points. type_id); riaMap. events. addEventListener(marker,”mouseclick”, function(){if(marker. infoWindowHtml==”){this. onMarkerClick(marker); }}. bind(this)); layer. addMarker(marker); riaMap. storage. markers. set(markerName, marker); if($defined(point. highlight)){riaMap. storage. map. setCenter(marker. getGeoPoint()); if(points. type_id==0){riaMap. manager. showInGroup(point. point_id, point. highlightPointId, false); }else{this. onMarkerClick(marker, true); }}
if($defined(riaMap. storage. backToGroup)){if(points. type_id==0){if(point. point_id==riaMap. storage. group_id){riaMap. storage. log=”Found”; riaMap. storage. map. setCenter(marker. getGeoPoint()); this. onMarkerClick(marker, false); delete riaMap. storage. backToGroup; }}}}else{var temp_marker=riaMap. storage. markers. get(markerName); if(! temp_marker. layers. contains(points. layerName)){layer. addMarker(temp_marker); temp_marker. layers. include(points. layerName); }}}, placeGlobalMarker: function(point, points, layer){markerName=’global_’+point. point_id+”_”+points. type_id; if(! $defined(riaMap. storage. markers)){riaMap. storage. markers=new Hash(); }
if(! riaMap. storage. markers. has(markerName)){var icon=points. icon; var marker=new Ria_Core_Map_Main_Adapters_Marker(new Ria_Core_Map_Main_Common_GeoPoint(point. longitude, point. latitude)); marker. setIcon(icon. width, icon. height, icon. src, icon. offset_x, icon. offset_y); marker. setName(point. name); marker. point_id=point. point_id; marker. type_id=points. type_id; marker. layers=new Array(); marker. layers. include(points. type_id); layer. addMarker(marker); riaMap. storage. markers. set(markerName, marker); }else{var temp_marker=riaMap. storage. markers. get(markerName); if(! temp_marker. layers. contains(points. layerName)){layer. addMarker(temp_marker); temp_marker. layers. include(points. layerName); }}}, onMarkerClick: function(marker, backward){if(riaMap. options. search. markerClickImpl){eval(‘riaMap. manager. ‘+riaMap. options. search. markerClickImpl+'(‘+marker. point_id+’); ‘); }else{var parametrs=riaMap. manager. makeGetParametrs(‘description’); parametrs. id=marker. point_id; parametrs. is_group=((marker. type_id==0)? ‘1’: ‘0’); if(backward)parametrs. backward=1; riaMap. ajaxManager. htmlRequest(Ria_Core_Ajax. script, function(html){if(marker. type_id==0){var name=Lang. group_map_objects; }else{var element=new Element(‘div’). set(‘html’, html); var name=element. getElement(‘div’). getElement(‘div’). get(‘html’); element. getElement(‘div’). getElement(‘div’). destroy(); html=element. get(‘html’); }
marker. addInfoWindow(name, html); marker. openInfoWindow(); }. bind(this), parametrs, true); }}, clearMarkers: function(){if($defined(riaMap. storage. layers)){riaMap. storage. layers. each(function(layer, key){layer. hide(); layer. getMarkers(). each(function(marker){layer. removeMarker(marker); marker. destruct(); }); riaMap. storage. map. removeLayer(layer); }); riaMap. storage. layers=new Hash(); }
riaMap. storage. markers=new Hash(); }}); var Ria_AjaxManager=new Class({Implements: Options, options: {spinner: ‘spinner’}, initialize: function(options){this. setOptions(options); this. ajax; }, jsonRequest: function(url, callback_func, getParametrs, is_cancel, extraOptions){if(this. ajax&&is_cancel){this. ajax. cancel(); }
this. showSpinner(this. options. spinner); this. ajax=new Request. JSON({url: url, onSuccess: function(data){this. hideSpinner(this. options. spinner); callback_func(data, extraOptions); }. bind(this)}). get(getParametrs); }, htmlRequest: function(url, callback_func, getParametrs, is_cancel, extraOptions){if(this. ajax&&is_cancel){this. ajax. cancel(); }
this. showSpinner(); this. ajax=new Request. HTML({url: url, onSuccess: function(tree, list, html, js){this. hideSpinner(); callback_func(html, extraOptions); }. bind(this)}). get(getParametrs); }, hideSpinner: function(){if($(this. options. spinner))$(this. options. spinner). setStyle(‘display’, ‘none’); }, showSpinner: function(){if($(this. options. spinner))$(this. options. spinner). setStyle(‘display’, ‘block’); }}); var Ria_Autocomplete=new Class({Implements: [Options, Events], options: {host: ‘ajax. php’, target: ‘autocomplete’, event: ‘getCitiesJson’, param: ‘search’, minlen: 0, delay: 1000, displayField: ‘name’, valueField: ‘city_id’, search_phrase: ”, aditional: {}, use_typebox: true, clone_typebox: true, typebox_offset: {x: 2, y: 0}, use_listbox: true, listbox_offset: {x: 1, y: 1}, onAfterComplete: function(){}}, onSelect: function(e){}, blocked: false, suggestions: new Array(), allSuggestions: new Array(), listboxTimeout: null, cachedInput: ”, initialize: function(field, options, onSelect){this. field=document. id(field); this. setOptions(options); this. onSelect=onSelect; this. field. setAttribute(‘autocomplete’, ‘off’); this. field. setAttribute(‘autocapitalize’, ‘off’); this. field. setAttribute(‘autocorrect’, ‘off’); this. field. setAttribute(‘role’, ‘textbox’); this. field. setAttribute(‘aria-autocomplete’, ‘both’); this. field. setAttribute(‘aria-live’, ‘polite’); this. liveregion=new Element(‘span’, {‘span’: ‘status’, ‘aria-live’: ‘assertive’, styles: {position: ‘absolute’, clip: ‘rect(1px, 1px, 1px, 1px)’}}). inject(this. field, ‘after’); if(this. options. use_typebox){this. typebox=new Element(‘div’, {‘class’: ‘goocompleter_typebox’}). inject(this. field, ‘before’); if(this. options. clone_typebox){this. typebox. setStyles(this. field. getStyles(‘font-size’, ‘font-family’, ‘font-weight’, ‘line-height’, ‘text-align’, ‘vertical-align’, ‘width’, ‘height’, ‘padding’, ‘border-top’, ‘border-left’, ‘border-right’, ‘border-bottom’, ‘letter-spacing’)); this. typebox. setStyle(‘border-color’, ‘transparent’); this. setRelPosition(this. field, this. typebox, this. options. typebox_offset. x, this. options. typebox_offset. y, true); window. addEvent(‘resize’, function(){this. setRelPosition(this. field, this. typebox, this. options. typebox_offset. x, this. options. typebox_offset. y, true); }. bind(this)); this. field. addEvent(‘focus’, function(){this. setRelPosition(this. field, this. typebox, this. options. typebox_offset. x, this. options. typebox_offset. y, true); this. getSuggestions(); }. bind(this)); var self=this; }
this. typebox. addEvent(‘click’, function(){this. field. focus(); }. bind(this)); }
if(this. options. use_listbox){this. listbox=new Element(‘div’, {‘class’: ‘goocompleter_listbox’, styles: {width: this. field. getWidth()}}). inject(document. body); this. listbox. addEvent(‘mouseleave’, function(){this. listboxTimeout=setTimeout(function(){this. listbox. setStyle(‘display’, ‘none’); }. bind(this), 700); }. bind(this)); this. listbox. addEvent(‘mouseover’, function(){if(!! this. listboxTimeout){window. clearTimeout(this. listboxTimeout); }}. bind(this)); this. setRelPosition(this. field, this. listbox, this. options. listbox_offset. x, this. options. listbox_offset. y, false); window. addEvent(‘resize’, function(){this. setRelPosition(this. field, this. listbox, this. options. listbox_offset. x, this. options. listbox_offset. y, false); }. bind(this)); this. listbox. addEvent(‘click: relay(li)’, function(event, target){event. stop(); this. field. set(‘value’, target. get(this. options. displayField)); this. field. set(this. options. valueField, target. getProperty(this. options. valueField)); if(this. options. use_typebox)
this. typebox. empty(); this. listbox. setStyle(‘display’, ‘none’); this. field. focus(); this. onSelect(); }. bind(this)); this. listbox. addEvent(‘mouseenter: relay(li)’, function(event, target){target. addClass(‘selected’); }); this. listbox. addEvent(‘mouseleave: relay(li)’, function(event, target){target. removeClass(‘selected’); }); this. field. addEvent(‘keydown’, function(event){if(event. key==’up’||event. key==’down’||(event. key==”up”&&event. altKey)||(event. key==”down”&&event. altKey)){if(this. listbox. getStyle(‘display’)! =’none’){var selected=this. navigate(event. key); if(this. options. use_typebox)
this. typebox. empty(); this. field. value=selected. get(‘name’); }
else{if(this. field. get(‘value’)==”){this. showSuggestions(this. allSuggestions); }else{this. getSuggestions(); }}
event. stop(); }
if(event. key==”enter”){var targets=this. listbox. getElements(“li”); var target=null; targets. each(function(item, index){if(item. hasClass(“selected”)){target=item; }}); event. stop(); this. field. set(‘value’, target. get(this. options. displayField)); this. field. set(this. options. valueField, target. getProperty(this. options. valueField)); if(this. options. use_typebox)
this. typebox. empty(); this. listbox. setStyle(‘display’, ‘none’); this. onSelect(); }
if(event. key==”esc”){event. stop(); if(this. listbox. getStyle(‘display’)==’block’){if(this. cachedInput! =”){this. field. set(‘value’, this. cachedInput); this. removeSelection(); }else{this. hideSuggestions(); this. writeTypebox(null); }
if(this. options. use_typebox)
this. typebox. empty(); if(this. listbox)
this. listbox. setStyle(‘display’, ‘none’); }}}. bind(this)); }
this. field. addEvent(‘keyup’, function(event){var value=this. field. get(‘value’); if(event. key==’up’||event. key==’down’||event. key==’left’||event. key==’right’||event. key==’tab’||event. key==’esc’||event. key==’enter’)
return false; this. cachedInput=value; this. typebox. empty(); if(value. trim()! =”&&value. length>this. options. minlen){if(this. blocked)
clearTimeout(this. timer); else{this. blocked=true; this. timer=this. getSuggestions; this. timer. delay(this. options. delay, this); }}else{if(this. options. use_typebox)
this. typebox. empty(); if(this. options. use_listbox)
this. listbox. setStyle(‘display’, ‘none’); }}. bind(this)); }, hideSuggestions: function(){this. listbox. setStyle(‘display’, ‘none’); }, getSuggestions: function(){if(this. field. get(‘value’). trim()! =”){if(! this. suggestions||this. suggestions[0]! =this. field. get(‘value’)){var request=new Request. JSON({url: this. options. host, onComplete: function(data){this. suggestions=data. result; this. search_phrase=data. search_phrase; this. showSuggestions(this. suggestions); }. bind(this)}); request. post({‘search’: this. field. get(‘value’), ‘target’: this. options. target, ‘event’: this. options. event, ‘aditional’: this. options. aditional}); }}
this. blocked=false; }, showSuggestions: function(suggestions){if(suggestions&&suggestions. length>0){this. liveregion. set(‘html’, suggestions. length+’autocomplete options’); var style=’even’; if(this. options. use_listbox){this. listbox. empty(); new Element(‘ul’). inject(this. listbox); this. listbox. setStyle(‘display’, ‘block’); }
var self=this; suggestions. each(function(item, i){var replacement; var field=item[this. options. displayField]; replacement=field. substr(this. search_phrase. length); var html=’ ‘+this. search_phrase+’ ‘+replacement; var li=null; if(this. options. use_listbox){li=new Element(‘li’, {html: html, ‘class’: ‘suggest-list-elem’+’ ‘+style, ‘role’: ‘option’}). setProperties(item); li. inject(this. listbox. getE

-->
-->