		function worldMap(){
			var t=this;
			/*************************/
			/*HTML-код городов, которые парсятся, должен быть такого типа:
			<div coord="55.75/37.583" city="Moscow" startdate="03.05.1848" population="Mega">Здесь любые теги кроме div</div>
			<div coord="40.7488/-73.9846" city="New-York" startdate="03.05.1090">Здесь любые теги кроме div</div>
			Атрибуты дожны идти в строгом порядке
			(некот. атрибуты можно не указывать, но те что есть должны идти в заданной последовательности).
			Атрибут coord обязателен, в нем сначала передается широта, а потом через слэш долгота. 
            Необязательный аттрибут population определяет размер точки города, может быть small/medium/big/great/mega
			Атрибуты сity и startdate сделаны с заделом на будущее, на текущий момент не имеют значения и указаны как иллюстрация того, что помимо нужных атрибутов в тег можно вписать другие, если в этом возникнет необходимость
			*/
			/*НАСТРОЙКИ*/
			t.mapFolder='/Jquery/worldmap/';//путь к папке с svg и vml картами, слэш на конце обязателен, если указан только один слэш, скрипт будет обращаться к корную сайта; по умолчанию скрипт берет из той же папки, где лежит вызывающая страница
			t.mapWidth='600px';//начальная видимая ширина карты, значение в пикселах
			t.mapHeight='315px';//начальная видимая высота карты, значение в пикселах
			t.mapBorder=0;//бордюр карты, рамка вокруг карты, задается как свойсвто border в css, например: 5px dotted blue
			t.mapZoomTime=80;//время анимации масштабирования(пауза перед очередным кадром)
			t.mapZoomStep=4;//кол-во кадров в анимации масштабирования
			//при данных параметрах анимация пройдет за 100*5=500(полсекунды)
			t.mapZoomRatio='100,150,200,250,300,350,400,450,500,550,600';//варианты масштабирования в процентах, должно быть от двух значений и первое всегда 100, например test.mapZoomRatio='100,200'; 
			t.mapZoom=100;//начальный масштаб карты, можно установить любое значение, которое есть в t.mapZoomRatio
			t.waterColor='white';//цвет воды(океаны, моря, озера, реки) на карте
			t.countryBackColor='silver';//цвет страны
			t.countryBackColorHover='gray';//цвет страны при наведении на нее
			t.countryBorderColor='gray';//цвет границ страны
			t.countryBorderColorHover='black';//цвет границ страны при наведении на нее
			t.countryBorderSize='hairline';//ширина границ страны, можно устанавливать любое цифровое значение
		    t.countryBorderSizeHover='hairline';//ширина границ страны при наведении на нее, можно устанавливать любое цифровое значение
			t.pointBackColor='blue';//цвет точек городов
			t.pointBackColorHover='red';////цвет точек городов при наведении на них
			t.pointBorderColor='aqua';//цвет бордюра точек городов
			t.pointBorderColorHover='green';//цвет бордюра точек городов при наведении на них
			t.pointBorderSize='0';//размер бордюра точек городов
			t.pointBorderSizeHover='1';//размер бордюра точек городов при наведении ни них
			
			t.pointSize='10';//размер точек городов с населением до 100.000
			t.pointSizeHover='12';//размер точек городов с населением до 100.000 при наведении на них
		    
			t.pointSmallSize='12';//размер точек городов с населением от 100.000 до 500.000
			t.pointSmallSizeHover='14';//размер точек городов с населением от 100.000 до 500.000 при наведении на них
		    
			t.pointMediumSize='14';//размер точек городов с населением от 500.000 до 1.000.000
			t.pointMediumSizeHover='16';//размер точек городов с населением от 500.000 до 1.000.000 при наведении на них

            t.pointBigSize='16';//размер точек городов с населением от 1.000.000 до 5.000.000
			t.pointBigSizeHover='18';//размер точек городов с населением от 1.000.000 до 5.000.000 при наведении на них

            t.pointGreatSize='18';//размер точек городов с населением от 5.000.000 до 10.000.000
			t.pointGreatSizeHover='20';//размер точек городов с населением от 5.000.000 до 10.000.000 при наведении на них

            t.pointMegaSize='20';//размер точек городов с населением более 10.000.000
			t.pointMegaSizeHover='22';//размер точек городов с населением более 10.000.000 при наведении на них
            /*****************************/
			t.helpFrame=4;//сколько кадров в раскрытии подсказки
			t.helpDelay=8;//задержка перед очередным кадром
			t.helpBorderColor='#3c3c3c';//цвет бордюра у подсказок
			t.helpBackgroundColor='white';//фоновый цвет подсказок
			t.helpShadowOffsetX='3px';//смещение тени подсказки по x-координате
			t.helpShadowOffsetY='3px';//смещение тени подсказки по y-координате
			t.helpShadowColor='#3c3c3c';//цвет тени
			t.helpShadowOpacity='40';//прозрачность тени
			/*****************************/
			t.buttonDragHelp='Перемещать карту';//текст подсказки к кнопке drag'a
			t.buttonZoomUpHelp='Увеличить масштаб';//текст подсказки к кнопке увеличения масштаба
			t.buttonZoomDownHelp='Уменьшить масштаб';//текст подсказки к кнопке уменьшения масштаба
			//расположение(смещение) кнопок от левого края карты
			t.buttonsLeft='8px';t.buttonsTop='8px';
			
			//стили для кнопок, задаются как css-правила для тега А
			t.buttonDragStyle=t.buttonZoomUpStyle=t.buttonZoomDownStyle='';
            t.buttonDragStyleHover=t.buttonZoomUpStyleHover=t.buttonZoomDownStyleHover='color:white;background:gray';
			t.buttonDragStyleActive=t.buttonZoomUpStyleActive=t.buttonZoomDownStyleActive='';//background:gray;color:silver
			
			t.zoomScroll=1;//направление скролла и расположение кнопок на вертикальной оси, по умолчанию - 1(вверху кнопка уменьшения масштаба), 0 - наоброт(вверху кнопка увеличения)
			t.zoomCrawlerColor='gray';//цвет ползунка
			t.zoomScrollColor='silver';//цвет "черточек" скролла
			t.zoomScrollWidth=20;//ширина скролла
			t.zoomScrollBackColor='silver';//цвеn фона скролла
			t.zoomScrollOpacity='30';//прозрачность фона скролла
			
			/*НАСТРОЙКИ*/
			/*****************************/
			
			//создаем карте уникальный ид
            t.id='map_';for(var i=0;i<16;i++){t.id+=parseInt(Math.random()*16).toString(16)}

            t.equator='56.5%';//y-координата экватора на карте в процентах от начала координат для вычисления Latitude(широты)
            t.greenwich='44.6%';//x-координатf нулевого меридиана на карте в процентах от начала координат для вычисления Longitude(долготы)

            var Body=document.getElementsByTagName('body')[0];

            //добавление новых стилей в документ
            t.addStyle=function(doc,style,id){
                var stl=(t.ie?doc:document).createElement('style');//важно создать style-тег именно в HTML-документе для альтернативы, а ИЕ нельзя т.к. до ИЕ7 он не переносит нормально тег style
				stl.type='text/css';stl.rel='stylesheet';
				if(stl.styleSheet){stl.styleSheet.cssText=style}
				else{try{stl.innerHTML=this.style}catch(e){stl.innerText=style}}
				stl.textContent=style;//важно для Оперы9 и ФФ, ставить именно после приравнивания innerHTML/Text
				stl=doc.getElementsByTagName(t.ie?'head':'svg')[0].appendChild(stl);
                if(id){stl.setAttribute('id',id)}
                return stl
			};
			
			t.ie=!window.stop;t.ie7=t.ie&&window.XMLHttpRequest;
			t.OP=window.opera;
			t.OP9=t.OP&&window.getSelection;
			t.FF3=window.dump&&window.postMessage;
			
			t.blockEvent=function(e){
				e=e||event;
				e.stopPropagation?e.stopPropagation():0;
				e.preventDefault?e.preventDefault():0;
				e.cancelBubble=!0;return e.returnValue=!1
			};
			
			t.addWheelEvent=function(obj,fun){
				obj.onmousewheel=fun;/*4IE,Opera,WebKit*/
				obj.addEventListener?obj.addEventListener('DOMMouseScroll',fun,!1):0;/*4FF*/
			};
			
			t.delWheelEvent=function(obj,fun){
				obj.onmousewheel=null;/*4IE,Opera,WebKit*/
				obj.addEventListener?obj.removeEventListener('DOMMouseScroll',fun,!1):0;/*4FF*/
			};
			
			//получение текущего стиля
			t.realstyle=function(x){return x.currentStyle||document.defaultView.getComputedStyle(x,null)};
			
			//получение абс. координат элемента(для подсказки)
			t.getPos=function(tt,x){
				var c={X:0,Y:0},fl=tt.nodeType==1;
				if(fl&&tt.getClientRects){
					var bb=document.body,b=document.compatMode=='CSS1Compat'?document.documentElement:bb;
					tt=tt.getBoundingClientRect();
					c.X=tt.left+b.scrollLeft-bb.clientLeft;
					c.Y=tt.top+b.scrollTop-bb.clientLeft	
				}
				else{ 
					var n=tt,b=document.body;
					if(fl&&document.getBoxObjectFor){
						var st=t.realstyle(n),tm=document.getBoxObjectFor(n);
						c.X=tm.x-(parseInt(st.borderLeftWidth)||0);
						c.Y=tm.y-(parseInt(st.borderTopWidth)||0);
					}
					else{
						var bT=0,bL=0;
						while((tt=tt.offsetParent)&&tt!=b){
							if(!t.FF3&&!t.OP9&&!(t.OP&&tt.rows)){bT=tt.clientTop||0;bL=tt.clientLeft||0}
							c.X+=tt.offsetLeft+bL-tt.scrollLeft;
							c.Y+=tt.offsetTop+bT-tt.scrollTop;
						}
						c.X+=n.offsetLeft;c.Y+=n.offsetTop
					}
					if(document.getBoxObjectFor&&!t.FF3){
						while((n=n.parentNode)&&n!=b){
							var st=t.realstyle(n),nsl=fl?n.scrollLeft:0,nst=fl?n.scrollTop:0;
							if(st.overflow!='visible'){
								c.X+=(parseInt(st.borderLeftWidth)||0)-nsl;
								c.Y+=(parseInt(st.borderTopWidth)||0)-nst
							}
						}
					}
				}
				return x?c[x]:c
			};
            
			t.mouseUp=new Date();//дата последнего отпускания кнопки мыши
			var helptime,offX;
			
			t.dup=function(str,n,zS){
				var a=[],ii=0;
				for(var i=n;i--;){
					a[i]=str.replace(/rel\=\"0\"/i,(zS?'rel="'+i+'"':'rel="'+(ii++)+'"'));
				}
				return a.join('')
			};
			
			t.lineFix=function(map,root,wN){
				if(t.countryBorderSize!=='hairline'){
                	if(!map.getElementById('zoom_'+wN)){t.addStyle(map,'.zoom_'+wN+' circle{stroke-width:'+(t.pointBorderSizeInt*(2400/wN))+'}.zoom_'+wN+' .land{stroke-width:'+(t.countryBorderSizeInt*(2400/wN))+'}.zoom_'+wN+' .over{stroke-width:'+(isNaN(t.countryBorderSizeHoverInt)?'hairline':t.countryBorderSizeHoverInt*(2400/wN))+'}.zoom_'+wN+' circle.over{stroke-width:'+(t.pointBorderSizeHoverInt*(2400/wN))+'}','zoom_'+wN)}
					root.setAttribute('class','zoom_'+wN);
			    }
			};
			
			t.create=function(){
				t.mapZoomRatio=(t.mapZoomRatio+'').split(',');
				//содаем вспомагательный массив вариантов масштабирования
            	t.zooms={};
            	for(var i=t.mapZoomRatio.length;i--;){
					t.zooms[t.mapZoomRatio[i]]=i	
				}
				
				offX=parseInt(t.helpShadowOffsetX);//отсутп для подсказки
				
				if(window.opera){t.helpDelay*=2;t.helpFrame*=2}
				helptime=parseInt(t.helpDelay);
				
				//ширина/высота в Number type
		        t.mapWidthInt=parseInt(t.mapWidth);
				t.mapHeightInt=parseInt(t.mapHeight);
				
				t.countryBorderSizeInt=parseFloat(t.countryBorderSize);
		    	t.countryBorderSizeHoverInt=parseFloat(t.countryBorderSizeHover);
				t.pointBorderSizeInt=parseFloat(t.pointBorderSize);
				t.pointBorderSizeHoverInt=parseFloat(t.pointBorderSizeHover);

				
				//центр карты по ширине/высоте
				t.widthCenter=Math.round(t.mapWidthInt/2);
				t.heightCenter=Math.round(t.mapHeightInt/2);
				
				//создаем главную ноду карты
				t.node=document.createElement('div');

		        //создаем скрытый див чтоб добавить туда ифрейм, иначе не получим window-сущность фрейма в Опере
		        var hDiv=document.createElement('div');
                hDiv.style.cssText='position:absolute;height:1px;width:1px;overflow:hidden;top:-5000px;left:-5000px;';

                /*формируем кнопки +\- и "скролл"*/
                var upbut='<a id="'+t.id+'_buttonZoomUp" title="'+t.buttonZoomUpHelp+'" href="#" rel="+" onclick="return!1">'+(t.buttonZoomUpStyle?'':'+')+'</a>';
				var downbut='<a id="'+t.id+'_buttonZoomDown" title="'+t.buttonZoomDownHelp+'" href="#" rel="-" onclick="return!1">'+(t.buttonZoomDownStyle?'':'-')+'</a>';
				var scrstr='<div id="'+t.id+'_scroll">'+t.dup('<a href="#" onclick="return!1" rel="0">&nbsp;</a>',t.mapZoomRatio.length,t.zoomScroll)+'<div id="'+t.id+'_crawler"></div><div id="'+t.id+'_scrollback"></div></div>';
                scrstr=t.zoomScroll?downbut+scrstr+upbut:upbut+scrstr+downbut;
                
				//создаем карту + кнопочки
				t.node.innerHTML='<div style="visibility:hidden;background:'+t.waterColor+';overflow:hidden;width:'+t.mapWidth+';height:'+t.mapHeight+(t.mapBorder?';border:'+t.mapBorder:'')+'"></div><div id="'+t.id+'_buttons"><a id="'+t.id+'_buttonDrag" title="'+t.buttonDragHelp+'" href="#" rel="-" onclick="return!1">'+(t.buttonDragStyle?'':'&#8251;')+'</a>'+scrstr+'<span>&nbsp;</span></div>';
				t.node.id=t.id;
				
				//t.info=t.node.lastChild.lastChild;
				var doc=t.node.ownerDocument||t.node.document;
                //нужно вставить ноду в документ, до получения по ид'у кнопок, иначе в альтернативе их не получить
				Body.insertBefore(hDiv,Body.firstChild).appendChild(t.node);

				t.node.style.width=t.node.firstChild.offsetWidth+'px';/*t.node.scrollWidth глючит в опере*/
				t.node.style.position='relative';
				
				//вешаем масштабирования на черточки "скроллбара"
				t.scrollbar=doc.getElementById(t.id+'_scroll');
				for(var i=0;t.scrollbar.childNodes[i];i++){
					t.scrollbar.childNodes[i].onmousedown=function(e){
						t.zoom(parseInt(this.rel))
					};
				}
				
				t.buttonZoomDown=doc.getElementById(t.id+'_buttonZoomDown');
				t.buttonZoomUp=doc.getElementById(t.id+'_buttonZoomUp');
				t.buttonDrag=doc.getElementById(t.id+'_buttonDrag');
				
				t.inActive=function(x){
					t.activeButton=x;
					x.className+=' button_active';
				};
				
				t.unActive=function(){
					if(t.activeButton){
						t.activeButton.className=t.activeButton.className.replace(/\s+button_active/ig,'');
						t.activeButton=!1
					}
				};
				
				t.buttonZoomDown.onmousedown=
				t.buttonZoomUp.onmousedown=
				t.buttonDrag.onmousedown=
					function(e){
						e=e||event;
						e.preventDefault&&e.preventDefault();
						
						if(this!==t.activeButton){
							t.unActive();
							t.inActive(this)	
						}
						else{t.unActive()}

                        t.userdrag=this===t.buttonDrag&&t.activeButton==this?1:0;
						t.cursorChange();
						
						e.stopPropagation&&e.stopPropagation();
						e.cancelBubble=!0;
						return e.returnValue=!1
					
					};
				
				//вешаем на кнопки ф-цию масштабирования
				t.buttonZoomDown.onmouseup=
				t.buttonZoomUp.onmouseup=
					function(e){
						t.zoom(this.rel);
					};
			

				//создаем ноду ифрейма, содержащего карту
		    	if(!t.ie){
					t.frame=document.createElement('iframe');
					t.frame.src=t.mapFolder+'world_map_svg.svg';
					t.frame.id=t.frame.name=t.id
				    t.node.firstChild.appendChild(t.frame);
				}                
			    else{
			    	//t.node.firstChild.innerHTML='<iframe src="world_map_vml.htm" name="'+t.id+'" id="'+t.id+'" allowtransparency=1 frameborder=0>';
					//t.frame=t.node.firstChild.firstChild;
					t.frame=document.createElement('<iframe src="'+t.mapFolder+'world_map_vml.htm" name="'+t.id+'" id="'+t.id+'" allowtransparency=1 frameborder=0>');
				    t.node.firstChild.appendChild(t.frame);
				    
				}
			    
				t.frame.frameBorder=0;t.frame.scrolling='no';
				t.frame.style.cssText='width:100%;height:100%;overflow:hidden';
			    
			    //стили для подсказок
				t.helpstyle=(
				'.tl_help_block *,.tl_help_shadow *{font-size:100%;margin:0;padding:0;outline:none;-moz-outline:none;-khtml-margin-start:0;-khtml-padding-start:0;-webkit-padding-start:0;-webkit-margin-start:0;-moz-box-sizing:border-box;box-sizing:border-box;border-box:border-box;-ms-box-sizing:border-box;-khtml-box-sizing:border-box;-webkit-box-sizing:border-box;background:none;background:transparent;border:0}'+
				'.tl_help .r_box{margin:5px 0 5px 0;color:#3c3c3c;background:'+t.helpBackgroundColor+';border-right:1px solid '+t.helpBorderColor+';border-left:1px solid '+t.helpBorderColor+';padding:0 8px 0 8px}'+
				'.tl_help .r_sup,.tl_help .r_sup *,.tl_help .r_sub,.tl_help .r_sub *{display:block;_font:0/0;background:'+t.helpBackgroundColor+';position:relative;border-right:1px solid '+t.helpBorderColor+';border-left:1px solid '+t.helpBorderColor+'}'+
				'.tl_help .r_sup,.tl_help .r_sub{left:-8px;margin-right:-16px}'+
				'.tl_help .r_sup{height:2px;max-height:2px;top:-2px}'+
				'.tl_help .r_sup *{height:1px;max-height:1px;top:-1px}'+
				'.tl_help .r_sup * *{border-width:2px}'+
				'.tl_help .r_sup * * *{overflow:hidden;border:0;max-height:0px;border-top:1px solid '+t.helpBorderColor+'}'+
				'.tl_help .r_sub{height:2px;max-height:2px;top:2px}'+
				'.tl_help .r_sub *{height:1px;max-height:1px;top:2px}'+
				'.tl_help .r_sub * *{top:1px;border-width:2px}'+
				'.tl_help .r_sub * * *{overflow:hidden;height:1px;max-height:0px;border:0;border-bottom:1px solid '+t.helpBorderColor+'}'+
				'.tl_help{position:absolute;visibility:visible;z-index:20000;top:-5000px;left:-5000px}'+
				'.tl_help_block,.tl_help_shadow{position:relative;width:250px;height:1%}'+
				'.tl_help_block,.tl_help_shadow{z-index:20000;border:1px solid transparent;_border:0;_margin:2px}'+
		    	'.tl_help_shadow{position:absolute;top:'+(parseInt(t.helpShadowOffsetY)+(window.stop||window.Element?1:-1))+'px;left:'+t.helpShadowOffsetX+';z-index:100}'+
		    	'.tl_help_arrow,.tl_help_arrow_in{width:12px;height:12px;color:transparent !important;background:none !important;overflow:hidden;position:relative;_filter:progid:DXImageTransform.Microsoft.Chroma(color=black)}'+
		    	'.tl_help_bottom .tl_help_arrow{border:6px solid transparent;border-top:12px solid '+t.helpBorderColor+';border-bottom:0;left:50px;}'+
            	'.tl_help_bottom .tl_help_arrow_in{border:6px solid transparent;border-top:12px solid '+t.helpBackgroundColor+';border-bottom:0;top:-2px;margin-top:-12px;left:50px;}'+
				'.tl_help_bottom,.tl_help_top{padding-top:12px;_padding-top:17px;}'+
				'.tl_help_top .tl_help_arrow{border:6px solid transparent;border-bottom:12px solid '+t.helpBorderColor+';border-top:0;position:absolute;top:0;left:50px;}'+
            	'.tl_help_top .tl_help_arrow_in{border:6px solid transparent;border-bottom:12px solid '+t.helpBackgroundColor+';border-top:0;position:absolute;top:2px;left:50px;}'+
            	'.tl_help .tl_help_shadow *{color:'+t.helpShadowColor+';background:'+t.helpShadowColor+'}'+
            	'.tl_help .tl_help_shadow .tl_help_arrow{border-top-color:'+t.helpShadowColor+';border-bottom-color:'+t.helpShadowColor+'}'+
            	'.tl_help .tl_help_shadow .r_box,.tl_help .tl_help_shadow .r_box *{border-color:'+t.helpShadowColor+'}'+
            	'.tl_help .tl_help_shadow .tl_help_arrow_in{visibility:hidden}'+
            	'.tl_help_shadow{_filter:alpha(opacity='+t.helpShadowOpacity+');opacity:'+t.helpShadowOpacity/100+';-moz-opacity:'+t.helpShadowOpacity/100+';-khtml-opacity:'+t.helpShadowOpacity/100+';-webkit-opacity:'+t.helpShadowOpacity/100+'}'+
				'.tl_help_shadow .tl_help_arrow,.tl_help_shadow .r_box,.tl_help_shadow .r_box *{-ms-filter:"alpha(opacity='+t.helpShadowOpacity+')"}'+
				'#tl_buttonZoomDown,#tl_buttonZoomUp,#tl_buttonDrag{margin:2px auto;display:block;width:20px;height:20px;background:silver;text-decoration:none;color:black;font-weight:bold;vertical-align:top}'+
				'#tl_buttonZoomDown{'+t.buttonZoomDownStyle+'}'+
				'#tl_buttonZoomUp{'+t.buttonZoomUpStyle+'}'+
				'#tl_buttonDrag{'+t.buttonDragStyle+'}'+
				'#tl_buttonZoomDown:hover{'+t.buttonZoomDownStyleHover+'}'+
				'#tl_buttonZoomUp:hover{'+t.buttonZoomUpStyleHover+'}'+
				'#tl_buttonDrag:hover{'+t.buttonDragStyleHover+'}'+
				'#tl_buttonZoomDown.button_active{'+t.buttonZoomDownStyleActive+'}'+
				'#tl_buttonZoomUp.button_active{'+t.buttonZoomUpStyleActive+'}'+
				'#tl_buttonDrag.button_active{'+t.buttonDragStyleActive+'}'+
				'#tl_buttons{*width:'+Math.max(t.zoomScrollWidth,30)+'px;position:absolute;top:'+t.buttonsTop+';left:'+t.buttonsLeft+'}'+
				'#tl_buttons *{z-index:1000}'+
				'#tl_scroll{zoom:1;_height:1px;width:'+t.zoomScrollWidth+'px;position:relative;margin:4px auto;_margin:2px auto;padding:4px 0}'+
				'#tl_crawler{position:absolute;overflow:hidden;'+(t.zoomScroll?'top:6px;_top:2px':'bottom:6px;_bottom:4px')+';background:'+t.zoomCrawlerColor+';width:60%;height:4px;_height:5px;left:20%}'+
				'#tl_scrollback{z-index:100;background:'+t.zoomScrollBackColor+';position:absolute;top:0;left:0;height:100%;width:100%;-moz-opacity:'+t.zoomScrollOpacity/100+';-webkit-opacity:'+t.zoomScrollOpacity/100+';-khtml-opacity:'+t.zoomScrollOpacity/100+';opacity:'+t.zoomScrollOpacity/100+';filter:alpha(opacity='+t.zoomScrollOpacity+');-ms-filter:alpha(opacity:'+t.zoomScrollOpacity+')}'+
				'#tl_scroll a{position:relative;display:block;width:50%;height:3px;zoom:1;overflow:hidden;background:'+t.zoomScrollColor+';margin:2px auto}'
				).replace(/(\.|\#)tl/ig,'$1'+t.id);
				//вставляем стили для подсказок
				var stl=document.createElement('style');
				document.getElementsByTagName('head')[0].appendChild(stl);
				stl.type='text/css';stl.rel='stylesheet';
				if(stl.styleSheet){stl.styleSheet.cssText=t.helpstyle}
				else{try{stl.innerHTML=t.helpstyle}catch(e){stl.innerText=t.helpstyle}}			

			
			    //ф-ция создания подсказки
			    t.help_create=function(str){
					var help=document.createElement('div');
					document.body.insertBefore(help,document.body.firstChild);//appendChild в конец документа вызвает в ФФ баг смещения карты при вызове свойств ширины-длины подсказки(как через offset/client/scrollWidth, так и через clientRects)
					help.className=t.id+'_help';
					help.style.visibility='hidden';
					help.innerHTML='<div class="'+t.id+'_help_shadow"><div class="r_box"><i class="r_sup"><i><i><i></i></i></i></i>'+str+'<i class="r_sub"><i><i><i></i></i></i></i></div><div class="'+t.id+'_help_arrow"></div><div class="'+t.id+'_help_arrow_in"></div></div><div class="'+t.id+'_help_block"><div class="r_box"><i class="r_sup"><i><i><i></i></i></i></i>'+str+'<i class="r_sub"><i><i><i></i></i></i></i></div><div class="'+t.id+'_help_arrow"></div><div class="'+t.id+'_help_arrow_in"></div></div>';
					help.onmouseover=function(e){
						if(t.helpCloseTimer){t.helpCloseTimer=clearTimeout(t.helpCloseTimer)}
						(e||event).cancelBubble=!0
					};
					help.onmouseout=function(e){e=e||event;t.fromhelp=help};
					//отключаем всплытие, чтоб при клике на тело подсказки, в кот. могут быть ссылки, сама подсказка не закрылась
					help.onmousedown=function(e){(e||event).cancelBubble=!0};
					t.selfhelp=help;
				};
				
				//ф-ция закрытия и удаления подсказки
				t.help_close=function(){
					if(t.selfhelp){
						t.selfhelp.parentNode.removeChild(t.selfhelp);
						t.selfhelp=t.fromhelp=null
					}
					t.helpCloseTimer=clearTimeout(t.helpCloseTimer);
				};
				
				t.frame.mapObject=t;
				
				//получаем окно фрейма с картой/*TODO попробовать инициализацию с задержкой*/
                t.ready=function(){
					t.win=t.frame.contentWindow;
					//document карты
					t.map=t.frame.contentDocument/*4All*/||t.win.document/*4IE*/;
					//корневой элемент
					t.root=t.map.rootElement/*4All*/||t.map.getElementById('main')/*4IE*/
                    
                    t.sp=t.map.getElementById('wrapp');
                    
                    //фикс для ИЕ бага с процентами(проблемы с рендерингом)
                    if(t.ie){
						t.sp.style.width=t.root.style.width=t.mapWidth;
                    	t.sp.style.height=t.root.style.height=t.mapHeight;
                    }
                    
                    //добавляем к карте стили
					t.addStyle(t.map,t.ie?'#main{background:'+t.waterColor+'}':'svg{background:'+t.waterColor+'}circle{fill:'+t.pointBackColor+';stroke:'+(!parseInt(t.pointBorderSize)?'none':t.pointBorderColor/*ChromeFix*/)+';stroke-width:'+t.pointBorderSize+'}.lake{fill:'+t.waterColor+'}.land{fill:'+t.countryBackColor+';stroke:'+(parseInt(t.countryBorderSize)||t.countryBorderSize=='hairline'?t.countryBorderColor:'none'/*ChromeFix*/)+';stroke-width:'+t.countryBorderSize+'}.over{fill:'+t.countryBackColorHover+';stroke:'+(parseInt(t.countryBorderSizeHover)||t.countryBorderSizeHover=='hairline'?t.countryBorderColorHover:'none'/*ChromeFix*/)+';stroke-width:'+t.countryBorderSizeHover+'}circle.over{fill:'+t.pointBackColorHover+';stroke:'+(!parseInt(t.pointBorderSizeHover)?'none':t.pointBorderColorHover/*ChromeFix*/)+';stroke-width:'+t.pointBorderSizeHover+'}');
                    //и для ИЕ в виде атрибутов
                    if(t.ie){
						for(var i=0,a=t.root.all,al=a.length;i<al;i++){
							if(a[i].className.indexOf('land')>-1||a[i].parentNode.className.indexOf('land')>-1){
								a[i].strokecolor=t.countryBorderColor;
								a[i].strokeweight=t.countryBorderSize;
								a[i].fillcolor=t.countryBackColor;
							}
							else if(a[i].parentNode.className.indexOf('lake')>-1){
								a[i].stroked=a[i].strokeok=0;
								a[i].fillcolor=t.waterColor;
							}
						}
					}
                    if(!t.ie){t.lineFix(t.map,t.root,t.mapWidthInt)}
                    
                    t.win.activeCountry=t.win.activePoint=!1;
                    
                    //добавляем города в карту 
                    if(t.parseST){eval(t.parseST)}
                    
                    if(parseInt(t.mapZoom)>100){
						t.zoom(t.mapZoom)
					}
                    
                    //показываем карту
                    t.node.firstChild.style.visibility='visible';
                    
                    t.map.onmouseover=function(e){
						e=e||t.win.event;
						if(t.fromhelp){t.help_close()}
                        var obj=e.target||e.srcElement;
						if(t.win.activeCountry){
							var old=t.win.activeCountry;
                            if(t.ie){
								old.strokecolor=t.countryBorderColor;
								old.strokeweight=t.countryBorderSize;
								old.fillcolor=t.countryBackColor;
							}
							else{
								old.setAttribute('class',(old.getAttribute('class')||'').replace(/\s+over/ig,''));
							}
								
						}
						
						
						if(t.win.activePoint){
							var old=t.win.activePoint;
                            if(t.ie){
								old.hover.style.visibility='hidden';
                            	old.style.visibility='visible';
							}
							else{
								old.setAttribute('class',(old.getAttribute('class')||'').replace(/\s+over/ig,''));
								old.setAttribute('r',old.getAttribute('realSize'));
								//old.style.setProperty('stroke',(!parseInt(t.pointBorderSize)?'none':t.pointBorderColor),null);
								//old.style.setProperty('stroke-width',t.pointBorderSize,null);
								//old.style.setProperty('fill',t.pointBackColor,null);
							}
								
						}
						if(t.drag){return}
						
						if(obj.getAttribute){
							var objClass=t.ie?obj.className:obj.getAttribute('class')||'';
							var objFather=obj.parentNode;
							var objFatherClass=objFather?(t.ie?objFather.className:(objFather.getAttribute?objFather.getAttribute('class')||'':'')):'';
							if(objClass.indexOf('land')>-1||objFatherClass.indexOf('land')>-1){
								t.win.activeCountry=obj;
								//obj.style.border='1px solid black'
								if(t.ie){
									obj.strokecolor=t.countryBorderColorHover;
									obj.strokeweight=t.countryBorderSizeHover;
									obj.fillcolor=t.countryBackColorHover;
								}
								else{
									obj.setAttribute('class',objClass+=' over');//раздуплеем Оперу 10 альфа...
								}
							}
							else if(obj.nodeName=='oval'||obj.nodeName=='circle'){
								t.win.activePoint=obj.real?obj.real:obj;
								
								obj.onmouseout=function(e){t.helpCloseTimer=setTimeout(t.help_close,500)};
								if(t.ie){
									t.win.activePoint.style.visibility='hidden';
									t.win.activePoint.hover.style.visibility='visible';
									if(obj.hover){t.help_close()}
								    else{t.helpCloseTimer=clearTimeout(t.helpCloseTimer);return}
								}
								else{
									t.help_close();
									obj.setAttribute('class',objClass+=' over');//раздуплеем Оперу 10 альфа...
									obj.setAttribute('r',obj.getAttribute('hoverSize'));
									//obj.style.setProperty('stroke',t.pointBorderColorHover,null);
									//obj.style.setProperty('stroke-width',t.pointBorderSizeHover,null);
									//obj.style.setProperty('fill',t.pointBackColorHover,null);
								}
								
								/***открытие подсказки***/
								t.help_create(obj.getAttribute('help')||'');
								var help=t.selfhelp,H=help.offsetHeight,W=help.offsetWidth,shadow=help.firstChild,block=help.lastChild,shadow_arrow=shadow.lastChild.previousSibling,block_arrow=block.lastChild,pos=t.getPos(t.frame);
							
							    var sY=document.body.scrollTop||document.documentElement.scrollTop,sX=document.body.scrollLeft||document.documentElement.scrollLeft;
								//получаем координаты курсора относительно страницы
								e.X=((e.clientX+sX)+pos.X)-sX;
								e.Y=((e.clientY+sY)+pos.Y)-sY;
                    
                    			var where=((e.Y-sY)-H)<0?'top':'bottom';
					
								shadow.className=t.id+'_help_shadow '+t.id+'_help_'+where;
								block.className=t.id+'_help_block '+t.id+'_help_'+where;
								
								var inRight=((e.X-sX)-W/2)<0;
								var inLeft=((e.X-sX)+W/2)>(pos.X+t.frame.offsetWidth)-sX;
								
								shadow_arrow.style.left=block_arrow.style.left=block_arrow.previousSibling.style.left=(inRight?10:inLeft?W-24:W/2-8)+'px';
    							//открываем подсказку внизу если вверху она будет обрезана окном браузера, иначе открываем вверху подсказку
								help.style.top=(where=='top'?e.Y+10:(e.Y-H)-10)+'px';
								//открываем подсказку слева по центру если справа она будет обрезана окном браузера, иначе открываем справа подсказку
								help.style.left=(inRight?e.X-16:inLeft?e.X-W+16:e.X-W/2)+'px';
								help.style.overflow='hidden';
								
								help.style.width=W+offX+'px';
								help.step=H/t.helpFrame;
								help.style.height=help.step+'px';
								help.style.visibility='visible';
								
                    			function help_open(){
									if(help.offsetHeight<H){
										help.style.height=help.offsetHeight+Math.min(H-help.offsetHeight,help.step)+'px';
										//help.timer=setTimeout(help_open,helptime);
									}
									else{help.style.overflow='visible';help.timer=clearInterval(help.timer)}
								}
								help_open();
								help.timer=setInterval(help_open,helptime)
							}							
					    }
					};
					
					t.map.onselectstart=function(e){return!1};//без этого IE выделяет vml-пути при драге
					
					t.cursorChange=function(){
						if(t.root&&(t.drag||t.userdrag)){t.ie?t.map.body.style.cursor='move':t.root.style.cursor=(window.dump?'-moz-grabbing':'move')}
					    else if(t.root){t.ie?t.map.body.style.cursor='hand':t.root.style.cursor='pointer'}
					};
					
					t.map.ondblclick=function(e){
					    e=e||t.win.event;
						var X=t.ie?e.clientX+this.body.scrollLeft:e.pageX;
						var Y=t.ie?e.clientY+this.body.scrollTop:e.pageY;
						t.zoomStartTimer=clearTimeout(t.zoomStartTimer);
                        t.zoom('-',[X,Y])
					};
					
					t.map.onmouseup=function(e){
						e=e||t.win.event;
						if(t.drag&&!t.drag.outFix&&(new Date()-t.drag.startTime<200)){
							var mC=[,1,3,2][e.which]||e.button||0;mC=mC>3?3:mC;
							var X=t.ie?e.clientX+this.body.scrollLeft:e.pageX;
							var Y=t.ie?e.clientY+this.body.scrollTop:e.pageY;

							if(mC!=1||(new Date()-t.mouseUp)<300){
                            	t.zoomStartTimer=clearTimeout(t.zoomStartTimer);
                            	t.zoom('-',[X,Y])
							}
							else{
								function zwrapp(){t.zoom('+',[X,Y])}
								t.zoomStartTimer=setTimeout(zwrapp,350);
							}
					    }
						t.mouseUp=new Date();
						t.drag=null;
						t.cursorTimer=clearTimeout(t.cursorTimer);
						t.cursorChange()
					};
					
					t.map.onmousedown=function(e){
						e=e||t.win.event;
						t.help_close();
						var mC=[,1,3,2][e.which]||e.button||0;
						mC=mC>3?3:mC;
						if(t.drag){t.drag.outFix=1}
						else{t.drag={};
							t.drag.oX=t.ie?t.sp.offsetLeft:parseInt(t.root.style.marginLeft)||0;
							t.drag.oY=t.ie?t.sp.offsetTop:parseInt(t.root.style.marginTop)||0;
							t.drag.X=t.ie?e.clientX+this.body.scrollLeft:e.pageX;
							t.drag.Y=t.ie?e.clientY+this.body.scrollTop:e.pageY;
                        	t.drag.startTime=new Date();
                        	t.cursorTimer=setTimeout(t.cursorChange,200);
						}
						e.preventDefault&&e.preventDefault();
						e.stopPropagation&&e.stopPropagation();
						e.cancelBubble=!0;
						return e.returnValue=!1
					};
					t.map.oncontextmenu=function(e){return!1};
					t.map.onmousemove=function(e){
						e=e||t.win.event;
						t.X=t.ie?e.clientX+this.body.scrollLeft:e.pageX;
						t.Y=t.ie?e.clientY+this.body.scrollTop:e.pageY;
						if(t.drag){
							t.drag.nX=t.drag.oX+(t.X-t.drag.X);
							t.drag.nY=t.drag.oY+(t.Y-t.drag.Y);
							if(t.ie){
								t.sp.style.left=t.drag.nX+'px';
								t.sp.style.top=t.drag.nY+'px';
							}
							else{
								t.root.style.setProperty('margin-left',t.drag.nX+'px',null);
								t.root.style.setProperty('margin-top',t.drag.nY+'px',null);
							}
						}
						//var geo=t.xy2geo(t.X,t.Y);
						//t.info.innerHTML=window.status='X:'+t.X+',Y:'+t.Y+'|geoX:'+geo.X+',geoY:'+geo.Y;
					};
					t.map.wheel=function(e){
						var e=e||t.win.event;
            			var delta=e.wheelDelta||-e.detail||0;
            			if(window.opera&&window.opera.version&&parseFloat(window.opera.version())<9.2){
							delta*=-1;
						}
            			delta=delta<0?-1:1;
						
						var X=t.ie?e.clientX+this.body.scrollLeft:e.pageX;
						var Y=t.ie?e.clientY+this.body.scrollTop:e.pageY;
						t.zoom((delta<0?'-':'+'),[X,Y]);

						t.blockEvent(e)
					};
					t.addWheelEvent(t.map,t.map.wheel);
				};

                t.frame.onload=t.ready;//а без этого в опере не сработает
                //IEfix
				if(t.ie){
					t.frame.onreadystatechange=function(){
						if(this.readyState=='complete'){
							t.ready()
						}
					};
					//top.frames[t.id].onload=t.ready;
					//t.frame.contentWindow.onload=t.ready;
				}

			};
		    
			t.numFixed=function(t,x,y){
				y=y||'.';var f='';t+=f;if(t.indexOf('.')<0){t+='.'}
				t=t.split('.');f=t[1].substr(0,x);while(f.length<x){f+='0'} 
				return t[0]+(f?y+f:'')
			};
		
		
			t.equatorInt=1260*parseFloat(t.equator)/100;//пиксельная координта экватора
			t.greenwichInt=2400*parseFloat(t.greenwich)/100;//пиксельная координта нулевого меридиана
			t.degreeYSize=8.4;//соотношение градуса к пикселам
            t.degreeXSize=7.3;
			//ф-ция вычисления координат на проекции на основе геокоординат
            //y - широта(с|ю(-)), x-долгота(в|з(-))
		    t.geo2xy=function(y,x){
				return{X:t.degreeXSize*x+t.greenwichInt,Y:t.equatorInt-t.degreeYSize*y}
			};
			
			//ф-ция вычисления геокоординат на основе проекционных координат
            t.xy2geo=function(x,y){//t.mapZoom
				x=(x-t.greenwichInt)/t.degreeXSize;
				y=(y-t.equatorInt)/t.degreeYSize;
				
				x=t.numFixed(x,2,'\'')+(x<0?'з.д.':'в.д.');
				y=t.numFixed(y,2,'\'')+(y<0?'с.ш.':'ю.ш.');
				return{X:y,Y:x}
			};

            //создаем ноду города
            t.addPoint=function(xy,city,popul,date,help){
				//alert([xy,city,popul,date,help])
				var np,size=parseInt(t['point'+(popul||'')+'Size']),hoverSize=parseInt(t['point'+(popul||'')+'SizeHover']);
				xy=xy.split('/');
				xy=t.geo2xy(xy[0],xy[1]);
				if(t.ie){
					np=t.map.createElement('<vml:oval style="height:'+size+';width:'+size+';left:'+(xy.X-size/2)+';top:'+(xy.Y-size/2)+'" fillcolor="'+t.pointBackColor+'" strokeweight="'+t.pointBorderSize+'" strokecolor="'+t.pointBorderColor+'"/>');
					if(!parseInt(t.pointBorderSize)){np.stroked=0};
					var npHover=t.map.createElement('<vml:oval style="visibility:hidden;height:'+hoverSize+';width:'+hoverSize+';left:'+(xy.X-hoverSize/2)+';top:'+(xy.Y-hoverSize/2)+'" fillcolor="'+t.pointBackColorHover+'" strokeweight="'+t.pointBorderSizeHover+'" strokecolor="'+t.pointBorderColorHover+'"/>');
				    if(!parseInt(t.pointBorderSizeHover)){npHover.stroked=0};
					t.map.getElementById('main').appendChild(npHover);
					np.hover=npHover;npHover.real=np;
				}
				else{
					np=t.map.createElementNS('http://www.w3.org/2000/svg','circle');
					np.setAttribute('r',size/2);
					np.setAttribute('cx',xy.X);np.setAttribute('cy',xy.Y);
				    np.setAttribute('realSize',size/2);
				    np.setAttribute('hoverSize',hoverSize/2);
				}
				np.setAttribute('help',help);
				t.map.getElementById('main').appendChild(np);
			};

            //парсим теги городов и переводи в строку с ф-циями, создающими города
            t.parseST=0;
            t.parse=function(str){
				var arr=str.replace(/\s+/ig,' ').match(/<div[^>]*>(.*?)<\/div>/ig);
				if(arr[0]){
					for(var i=arr.length;i--;){
						arr[i]=arr[i].replace(/<div(\s+coord\=\"([^\"]+)\"|.{0})(\s+city\=\"([^\"]+)\"|.{0})(\s+population\=\"([^\"]+)\"|.{0})(\s+startdate\=\"([^\"]+)\"|.{0})[^>]*>(.*)<\/div>/i,'t.addPoint(\'$2\',\'$4\',\'$6\',\'$8\',\'$9\');')
					}
					t.parseST=arr.join('');
				}
			};

			//ф-ция масштабирования карты
		    t.zoomer=function(xN,yN,wN,hN){
			    var tr=t.root,trs=tr.style;
				if(t.ie){
					//смещаем обертку а не корневой group, т.к. в ИЕ прибавляется приблизительное двойное значение
					t.sp.style.left=xN+'px';t.sp.style.top=yN+'px';
				    t.sp.style.width=wN+'px';t.sp.style.height=hN+'px';
                    trs.width=wN+'px';trs.height=hN+'px';//percent render fix
                }
                else{
                
                    t.lineFix(t.map,tr,wN);

					trs.setProperty('margin-left',xN+'px',null);
					trs.setProperty('margin-top',yN+'px',null);
					//t.map.getElementById('main').setAttribute('transform','translate('+xN+','+yN+')')
                    if(window.devicePixelRatio){
						tr.setAttribute('width',wN+'px');
						tr.setAttribute('height',hN+'px');
					}
					else{
                        trs.setProperty('width',wN+'px',null);
						trs.setProperty('height',hN+'px',null);
					}
				}
			};
		
		    //ф-ция анимационного масштабирования карты
		    t.zoom=function(minmax,coord){
		    	if(t.zoomTimer){return}
				//узнаем новый масштаб
				var zoomNewStep=typeof minmax=='number'?(minmax>=100?minmax/100-1:minmax):t.zooms[t.mapZoom]+(minmax=='+'?1:-1);
				var zoomNew=t.mapZoomRatio[zoomNewStep];
				//если такой масштаб разрешен
				if(zoomNew>=100){
                    if(!coord){coord=[t.widthCenter,t.heightCenter]}
					//передвигаем ползунок
					document.getElementById(t.id+'_crawler').style[(t.zoomScroll?'top':'bottom')]=(zoomNewStep*5+(t.ie&&!t.ie7?(t.zoomScroll?3:4):6))+'px';
					var w=t.mapWidthInt,h=t.mapHeightInt;//изначальные размеры карты
                    var zC=zoomNew/100;//во сколько раз увеличить изначальные размеры карты
                    var wN=w*zC,hN=h*zC;//новые размеры карты
					var wC=t.widthCenter,hC=t.heightCenter;//центры осей карты
					var xS,yS,wS,hS,xN,yN;
			
					//использовать zoom нельзя, будут глюки распознавания srcElement при наведении мышью
					if(t.ie){
                        xS=t.sp.offsetLeft;yS=t.sp.offsetTop;
                        wS=t.sp.offsetWidth;hS=t.sp.offsetHeight;
					}
					else{
		                xS=parseInt(t.root.style.marginLeft)||0;
						yS=parseInt(t.root.style.marginTop)||0;
						if(window.devicePixelRatio){
							var wSt=t.root.getAttribute('width'),hSt=t.root.getAttribute('height');
							if(wSt.indexOf('%')>0){wSt=w;hSt=h}
	   						wS=parseInt(wSt||w);
							hS=parseInt(hSt||h);
						}
						else{
							wS=parseInt(t.root.style.width||w);hS=parseInt(t.root.style.height||h);
						}
					}
					
					xN=wC-(coord[0]-xS)*(wN/wS);
					yN=hC-(coord[1]-yS)*(hN/hS);
					
					if(t.mapZoomTime){
						var step=t.step=t.mapZoomStep;
						var xn=xS,yn=yS,wn=wS,hn=hS;
						var xStep=(xS>xN?-1:1)*Math.abs((xN-xS)/step);
                        var yStep=(yS>yN?-1:1)*Math.abs((yN-yS)/step);
                        var wStep=(wS>wN?-1:1)*Math.abs((wN-wS)/step);
                        var hStep=(hS>hN?-1:1)*Math.abs((hN-hS)/step);

						t.zoomAnime=function(){
							xn+=xStep;yn+=yStep;wn+=wStep;hn+=hStep;
							t.zoomer(xn,yn,wn,hn);t.step--;
							if(!t.step){t.zoomTimer=clearInterval(t.zoomTimer)}
							//t.zoomTimer=t.step?setTimeout(t.zoomAnime,t.mapZoomTime):clearTimeout(t.zoomTimer)
						};
						t.zoomAnime();
						t.zoomTimer=setInterval(t.zoomAnime,t.mapZoomTime);
					}
					else{t.zoomer(xN,yN,wN,hN)}
					
					t.mapZoom=zoomNew;
				}	
			};
			return t
		}