window.onload=documentLoaded;
var cssFix = function(){
 var u = navigator.userAgent.toLowerCase(),
 addClass = function(el,val){
    if(!el.className) {
     el.className = val;
    } else {
     var newCl = el.className;
     newCl+=(" "+val);
     el.className = newCl;
    }
 },
 is = function(t){return (u.indexOf(t)!=-1)};
 addClass(document.getElementsByTagName('html')[0],[
    (!(/opera|webtv/i.test(u))&&/msie (\d)/.test(u))?('ie ie'+RegExp.$1)
     :is('firefox/2')?'gecko ff2'
     :is('firefox/3')?'gecko ff3'
     :is('gecko/')?'gecko'
     :is('opera/9')?'opera opera9':/opera (\d)/.test(u)?'opera opera'+RegExp.$1
     :is('konqueror')?'konqueror'
     :is('applewebkit/')?'webkit safari'
     :is('mozilla/')?'gecko':'',
    (is('x11')||is('linux'))?' linux'
     :is('mac')?' mac'
     :is('win')?' win':''
 ].join(" "));
}();


var is_chrome = false, chrome_version = false;
if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
   is_chrome = true;
   chrome_version = navigator.userAgent.replace(/^.*Chrome\/([\d\.]+).*$/i, '$1')
}


function slideBanner(){
	var newBanner = $('#newBannerBg');
	var speed = 200;
	var tabs = $('.thisTabs');
	var title = $('.title');
	var titleHover = $('.title_hover');
	
	var eq = {
		'0' : {
			width : 460,
			width2 : 560,
			width3 : 400,
			left : 0,
			left2 : 0
		},
		'1' : {
			width : 550,
			width2 : 530,
			width3 : 500,
			left : 220,
			left2 : 90
		},
		'2' : {
			width : 500,
			width2 : 500,
			width3 : 500,
			left : 220,
			left2 : 90
		}
	};
	
	tabs.eq(0).css({
		width: eq[0].width,
		marginLeft : -eq[0].left	
	})
	.end()
	.eq(1).css({
		width: eq[1].width,
		marginLeft : -eq[1].left	
	})
	.end()
	.eq(2).css({
		width: eq[2].width,
		marginLeft : -eq[2].left	
	});
	
	tabs.hover(function(){

		var index = tabs.index($(this));
		
		if($.browser.msie)
		{
			titleHover.not(":eq("+index+")").stop().show().end().eq(index).stop().hide();
			title.not(":eq("+index+")").stop().hide().end().eq(index).stop().css({opacity:''}).show();

		}else{
			titleHover.not(":eq("+index+")").stop().animate({opacity:1},speed).end().eq(index).stop().animate({opacity:0},speed);
			title.not(":eq("+index+")").stop().animate({opacity:0},speed).end().eq(index).stop().animate({opacity:1},speed);
		}
		
		tabs.find('ul').hide();
		
		
		if(index == 0)
		{
			newBanner.addClass('newBannerBgFirst').removeClass('newBannerBgLast');
			$(this).find('ul').show();
		}	
		else
		if(index == 1)
			newBanner.removeClass('newBannerBgFirst').removeClass('newBannerBgLast');
		else
		if(index == 2)
			newBanner.removeClass('newBannerBgFirst').addClass('newBannerBgLast');



if($.browser.msie && $.browser.version == '7.0')
		{
			$(this).addClass('thisTabsOpen').css({
				width: eq[index].width2,
				marginLeft : -eq[index].left2
			},{queue:false, duration:speed});
		
			tabs.not(':eq('+index+')').removeClass('thisTabsOpen').each(function(){
				var index2 = tabs.index($(this));
				$(this).css({
					width: eq[index2].width3,
					marginLeft : -eq[index2].left	
				});
			});
		} else {
			$(this).addClass('thisTabsOpen').stop().animate({
				width: eq[index].width2,
				marginLeft : -eq[index].left2
			},{queue:false, duration:speed});
		
			tabs.not(':eq('+index+')').removeClass('thisTabsOpen').each(function(){
				var index2 = tabs.index($(this));
				$(this).stop().animate({
					width: eq[index2].width3,
					marginLeft : -eq[index2].left	
				},{queue:false, duration:speed});
			});
		}

		
	});
        if($.browser.msie && $.browser.version == '6.0')
        {
            $('#newBannerBg').css('display', 'none');
            alert("Версия Вашего браузера не поддерживается нашим сайтом!\n Обновите Ваш Internet Explorer до 8 или 9 версий. Или воспользуйтесь другим браузером: Opera, Firefox, Chrome");
        }
    }



function documentLoaded(){
	$('body').height($(document).height());
}
$(document).ready(function(){

            $('#dialog_wait').ajaxStart(function(){
             //   $('.ui-dialog ').css('z-index', 50);
                $(this).show().css({height:$(document).height()});
                $('img#wait_image').show();
            }).ajaxStop(function(){
                $(this).hide();
                $('img#wait_image').hide();
             //   $('.ui-dialog ').css('z-index', 1002);
            });
        
			$('.s_but_find').click(function(){
				var idi = $('.s_poisk');
				if(idi.val() == ''||idi.val().length < 3) {
                                    alert('В поисковом запросе должно быть не менее 3-х символов');
                                    return false;
                                }
			});

			$('.autoClearInput, .autoclear').autoClear();

			$('.td_nine a').live('click',function(){
                var id = $(this).attr('rel');
                var art = $(this).parent().parent().find('.td_one a').html();
				$( "#dialog2" ).removeAttr('title');
				$.get('/shop/replace/?applied='+id, function(data) {
						$("#dialog2").html(data);
                        $( "#dialog2:ui-dialog" ).dialog( "destroy" );
                        $( "#dialog2" ).attr('title','Применяемость для артикула ' + art);
		                $( "#dialog2" ).dialog({modal: true, width:500, buttons: { "Ok": function() { $(this).dialog("close"); }}});
                });
				return false;
			});



			$('.td_eight a').live('click',function(){
                var id = $(this).attr('rel');
                var art = $('#row'+id+' .td_one a').html();
                $( "#dialog" ).removeAttr('title');
				$.get('/shop/replace/?replace='+id, function(data) {
						$("#dialog").html(data);
                        $( "#dialog:ui-dialog" ).dialog( "destroy" );
                        $( "#dialog" ).attr('title','Замены для артикула ' + art);
		                $( "#dialog" ).dialog({modal: true, width:900, buttons: { "Ok": function() { $(this).dialog("close"); }}});
                });
				return false;
			});
			
			$('.close_shop_popup').live('click',function() {
  				$('.shop_popup').hide();
				return false;
			});

			$('.td_ten input[type=text]').focus(function(){
				var value = $(this).val();
				if(value == 0 || value == '')
					$(this).val('');
			}).blur(function(){
				var value = $(this).val();
				if(value == 0 || value == '')
					$(this).val(0);
			});

			$('.td_class3 a').each(function(){
				if($(this).html() == '')
					$(this).hide();
			});

			car();
			map();
			vacancy();
			katalog_menu();
			citydrop();
			$('body.ukr_vers input.but_send').attr('src','/images/but_send_ukr.gif');
			if($('div.colors').length) {$('div.footer').css('marginTop',0)};
			if($('div.katalog').length) {$('div.footer').css('marginTop',0)};
			poisk_label();
			tr_hover();
			ie_corner_fix();

})

function ie_corner_fix() {
	if (navigator.userAgent.indexOf('MSIE 6')!=-1) {
			$('div.black_links a:eq(0)').click(function(){
											//alert($(window).width());													
										})
			$(window).resize(function(){
								
							 }
							);
		}	
}

function tr_hover(){
	$('tr.tr_one,tr.tr_two').hover(function (){
									$(this).find('td').addClass('tr_hover')
								   },
								   function(){
									$(this).find('td').removeClass('tr_hover')   
									   }
								   )	
}

function poisk_label() {
	$('div.checkboxes input').change(function(){
										var id=$(this).attr('id');
										$('label.check').removeClass('check');
										$(this).next().addClass('check');
										})	
}

function autoclearInput(){
	$(".autoclear").each(function(){
		$(this).attr("defaultvalue",$(this).attr("value")); 
	});

	$(".autoclear").click(function(){ 
		if ($(this).attr("value")==$(this).attr("defaultvalue")) { 
			$(this).attr("value", "");
		}
	})
}

function car() {
	var number=0;
	var left_1=0;
	var line_2_mas=[];
	var details=$('div.detail').size();
	$('div.detail').each(function(i){
								    $(this).css('top',i*24)
								  })
	


	$('div.point').hover(function(){
									$(this).addClass('point_on');
									number=parseInt($(this).attr('rel'));
									$('#bosal'+number).css('visibility','visible');
									line_2_mas=path($(this),number);
									$('div.line2').show().css({'left':line_2_mas[0],'top':line_2_mas[1],'height':line_2_mas[2]});
									if (line_2_mas[5]>=0)
									$('div.line3').show().css({'left':line_2_mas[3],'top':line_2_mas[4],'width':line_2_mas[5]-67 + "px"});
									//$('div.line3').show().css({'left':-194,'top':line_2_mas[4],'width':(line_2_mas[5]-67)});
									
									$('#color'+number).addClass('color0');
									
								  },
						function() {
									$('#bosal'+number).css('visibility','hidden');
									$('div.line2,div.line3').hide();
									$(this).removeClass('point_on');
									$('#color'+number).removeClass('color0');
								  }			   
						)
		
						var new_line2 = $('div.line2');
						var new_line3 = $('div.line3');
	$('div.detail').hover(function(){
								   number=parseInt($(this).attr('rel'));
									var new_point = $('div.point'+number);

									var new_top = $(this).position().top+14;
									var new_top2 = new_point.position().top;
									if(new_top > new_top2)
										var new_top_3 = new_top-new_top2-3;
									else
										var new_top_3 = new_top2-new_top+4;

								   $('#bosal'+number).css('visibility','visible');
								   line_2_mas=path(new_point,number);
								   new_line2.show().css({'left':line_2_mas[0],'top':line_2_mas[1],'height':new_top_3});
								   //if (line_2_mas[5]>=0)
								   new_line3.show().css({'left':line_2_mas[3]-2,'top':new_top,'width':line_2_mas[5]+2});
								  // $('div.line3').show().css({'left':-94,'top':line_2_mas[4],'width':(line_2_mas[5]-67 + "px")});
								   
								   new_point.addClass('point_on');
								   $(this).addClass('color0');
								   
								   },
						  function(){
							  	   $('div.line2,div.line3').hide();
								   $('#bosal'+number).css('visibility','hidden');
								   $('div.point'+number).removeClass('point_on');
								   $('#color'+number).removeClass('color0');
								   
							  	  }		   
								   )
}

function path(th,number) {
		line_2_y1=remove_px(th.css('top'))+4;
		line_2_y2=number*24-46;
		line_2_height=line_2_y2-line_2_y1;
		if(line_2_height<=0) {
			line_2_height=Math.abs(line_2_height);
			if (line_2_height>36) {
				line_2_y1=line_2_y1-line_2_height+36;
				line_2_height=line_2_height-36;
				line_3_y1=line_2_y1
			}
			else
			{
				line_2_y1=line_2_y1;
				line_2_height=1;
				line_3_y1=line_2_y1
			}
		}
		else {
			line_2_y1=remove_px(th.css('top'))+4;
			line_2_y2=number*24-70;
			line_2_height=line_2_height+12;
			line_3_y1=line_2_y1+line_2_height;
		}
		line_2_x1=remove_px(th.css('left'))-50;
		
		main_w=$('div.colors').width();
		line_3_w=main_w-202-Math.max($('#bosal'+number).find('img').width())-386+line_2_x1
		line_3_x1=line_2_x1-line_3_w;
		
		
		
		line_2_mas=[line_2_x1,line_2_y1,line_2_height,line_3_x1,line_3_y1,line_3_w]
		return line_2_mas
}
function remove_px (string) {return parseInt(string.substring(0,string.length-2))}
	
function map() {
	$('#nikolaev').hover(function(){
								   $('div.contact_man').css({'display':'block','left':315,'top':135})
								  },
						function() {
								   $('div.contact_man').css({'display':'none'})
									}		  
								  )	
	}
	
function vacancy() {
	$('div.vacancy div.arrow_closen').live('click',function() {
		$(this).removeClass('arrow_closen').addClass('arrow_open').parent('div').find('div.vac_txt').show();
	})
	$('div.vacancy div.arrow_open').live('click',function() {
		$(this).removeClass('arrow_open').addClass('arrow_closen').parent('div').find('div.vac_txt').hide();
	})
}

function katalog_menu() {
		var a_width=0;
		var a_width2=0;
		var i=0;
		$('#katalog li > a').each(function(){
										 if($(this).width()>a_width)
										 	a_width=$(this).width();
										 })
		$('#katalog li > a').width(a_width);
		$('#katalog li a+ul').css('left',a_width+19);
		$('#katalog li div.fix').css('left',a_width+19);
		
		$('#katalog li').each(function(){
											 $(this).find('ul li a').each(function(){
																				   if($(this).width()>a_width2) 
																					    a_width2=$(this).width();
																				   })
											 $(this).find('ul li a').not('div.li_icons a').css('width',a_width2+10);
											 
											 $(this).find('ul li a + div.li_icons').css('left',a_width2+40);
											 
											 a_width2=0;
											})
		$('#katalog > li').hover(
											 function(){
												 $(this).find('a:eq(0)').css('background','#e1e2e1 url(/images/arrow_menu_hov.gif) left 11px no-repeat').end().css('z-index','1').find('ul:eq(0)').css('visibility','visible').end().find('div.fix').css('visibility','visible');
												 $(this).find('ul > li').hover(
																			   function(){
																				  $(this).find('div.li_icons').css('visibility','visible')
																			   },
																			   function(){
																				  $(this).find('div.li_icons').css('visibility','hidden')
																				   }
																			   )
												 },
											 function() {
												 $(this).find('a:eq(0)').css('background','url(/images/arrow_closen.gif) left 11px no-repeat').end().find('ul:eq(0)').css('visibility','hidden').end().css('z-index','0').find('div.fix').css('visibility','hidden');
												 }	 
											 )
		
		
		
}

$(function(){
    coords = new Array(
    {
            city: 'nikolaev',
            left: 539,
            top: 425,
            width: 200,
            height: 179,
            file: '/images/map/nikolaev.png',
            title_left:610,
            title_top:520,
            filial:{
                top:485,
                left:631,
                width:65
            }
    },{
            city: 'herson',
            left: 649,
            top: 489,
            width: 236,
            height: 154,
            file: '/images/map/herson.png',
            title_left:720,
            title_top:580,
            filial:{
                top:565,
                left:725,
                width:45
            }
    },{
            city: 'simferopol',
            left: 702,
            top: 626,
            width: 297,
            height: 187,
            file: '/images/map/simferopol.png',
            title_left:800,
            title_top:720,
            filial:{
                top:700,
                left:800,
                width:35
            }
    },{
            city: 'odessa',
            left: 396,
            top: 426,
            width: 220,
            height: 305,
            file: '/images/map/odessa.png',
            title_left:510,
            title_top:530,
            filial:{
                top:560,
                left:530,
                width:65
            }
    },{
            city: 'zaporoje',
            left: 814,
            top: 425,
            width: 206,
            height: 189,
            file: '/images/map/zaporoje.png',
            title_left:860,
            title_top:500,
            filial:{
                top:470,
                left:900,
                width:65
            }
    },{
            city: 'doneck',
            left: 969,
            top: 302,
            width: 171,
            height: 243,
            file: '/images/map/doneck.png',
            title_left:1000,
            title_top:430,
            filial:{
                top:400,
                left:1030,
                width:35
            }
    },{
            city: 'lygansk',
            left: 1045,
            top: 213,
            width: 155,
            height: 218,
            file: '/images/map/lygansk.png',
            title_left:1100,
            title_top:360,
            filial:{
                top:320,
                left:1110,
                width:45
            }
    },{
            city: 'dnepropetrovsk',
            left: 728,
            top: 323,
            width: 266,
            height: 175,
            file: '/images/map/dnepropetrovsk.png',
            title_left:800,
            title_top:400
    },{
            city: 'kirovograd',
            left: 512,
            top: 335,
            width: 274,
            height: 139,
            file: '/images/map/kirovograd.png',
            title_left:600,
            title_top:400
    },{
            city: 'poltava',
            left: 663,
            top: 186,
            width: 222,
            height: 178,
            file: '/images/map/poltava.png',
            title_left:720,
            title_top:260,
            filial:{
                top:240,
                left:780,
                width:35
            }
    },{
            city: 'xarkov',
            left: 842,
            top: 182,
            width: 211,
            height: 199,
            file: '/images/map/xarkov.png',
            title_left:900,
            title_top:270,
            filial:{
                top:250,
                left:900,
                width:45
            }

    },{
            city: 'symi',
            left: 716,
            top: 0,
            width: 179,
            height: 229,
            file: '/images/map/symi.png',
            title_left:740,
            title_top:130
    },{
            city: 'cherkasi',
            left: 499,
            top: 220,
            width: 217,
            height: 185,
            file: '/images/map/cherkasi.png',
            title_left:570,
            title_top:320
    },{
            city: 'chernigov',
            left: 564,
            top: 0,
            width: 182,
            height: 211,
            file: '/images/map/chernigov.png',
            title_left:580,
            title_top:100
    },{
            city: 'kiev',
            left: 483,
            top: 91,
            width: 183,
            height: 238,
            file: '/images/map/kiev.png',
            title_left:530,
            title_top:210,
            filial:{
                top:235,
                left:530,
                width:35
            }
    },{
            city: 'jitomir',
            left: 348,
            top: 72,
            width: 162,
            height: 216,
            file: '/images/map/jitomir.png',
            title_left:370,
            title_top:180,
            filial:{
                top:170,
                left:430,
                width:35
            }
    },{
            city: 'vinnica',
            left: 351,
            top: 256,
            width: 177,
            height: 189,
            file: '/images/map/vinnica.png',
            title_left:370,
            title_top:360,
            filial:{
                top:290,
                left:420,
                width:35
            }
    },{
            city: 'xmelnicki',
            left: 273,
            top: 181,
            width: 115,
            height: 212,
            file: '/images/map/xmelnicki.png',
            title_left:280,
            title_top:270
    },{
            city: 'chernovci',
            left: 179,
            top: 367,
            width: 179,
            height: 91,
            file: '/images/map/chernovci.png',
            title_left:240,
            title_top:380,
            filial:{
                top:400,
                left:200,
                width:35
            }
    },{
            city: 'ternopol',
            left: 180,
            top: 208,
            width: 106,
            height: 177,
            file: '/images/map/ternopol.png',
            title_left:200,
            title_top:290
    },{
            city: 'rovno',
            left: 210,
            top: 36,
            width: 179,
            height: 195,
            file: '/images/map/rovno.png',
            title_left:220,
            title_top:180
    },{
            city: 'lyck',
            left: 130,
            top: 31,
            width: 150,
            height: 168,
            file: '/images/map/lyck.png',
            title_left:170,
            title_top:120
    },{
            city: 'lvov',
            left: 47,
            top: 165,
            width: 182,
            height: 184,
            file: '/images/map/lvov.png',
            title_left:70,
            title_top:240,
            filial:{
                top:200,
                left:120,
                width:35
            }
    },{
            city: 'ivano_frankovsk',
            left: 96,
            top: 274,
            width: 138,
            height: 183,
            file: '/images/map/ivano_frankovsk.png',
            title_left:110,
            title_top:340,
            filial:{
                top:330,
                left:110,
                width:35
            }
    },{
            city: 'yjgorod',
            left: 0,
            top: 302,
            width: 161,
            height: 132,
            file: '/images/map/yjgorod.png',
            title_left:20,
            title_top:350,
            filial:{
                top:340,
                left:30,
                width:35
            }
    },{
            city: 'krivoy_rog',
            left: 728,
            top: 323,
            width: 266,
            height: 175,
            file: '/images/map/dnepropetrovsk.png',
            title_left:750,
            title_top:450,
            filial:{
                top:435,
                left:765,
                width:45
            }
    })

    distin = 1;
    resize_map()
    $($(window)).resize(function() {resize_map()})

    
	function resize_map() {
        var html = '';
        distin = $('div.big_map').width()/1200;
        for(i=0;i<coords.length;i++) {
            city = coords[i];
            $('#' + city.city + '_title').css({
                'left':city.title_left*distin,
                'top':city.title_top*distin
            })
            $('#' + city.city).css({
                'left':city.left*distin,
                'top':city.top*distin,
                'width':city.width*distin,
                'height':city.height*distin
            })
            if(city.filial) {html = html + '<img src="/images/map/filial.png" style="position: absolute;width:' + city.filial.width*distin +
                                            'px; top:' + city.filial.top*distin +
                                            'px; left:' + city.filial.left*distin + 'px;" />';}
        }
        $('#icons').html(html);
        $('#filial').css('width', 65*distin);
        $('#predst').css('width', 45*distin);
        $('#dilers').css('width', 35*distin);

    }

    function getMapinfo(e)
	{
        e.next('.title_').css('color','#fff');
		var left = parseFloat(e.css('left'));
		var top = parseFloat(e.css('top'))-$('#map_info').height();
		var html = e.find('span').html().split('|');
		
		$('#map_info').show().css({left:left,top:top});

		$('#map_info .city_name').html(html[0]);
		$('#map_info .man_name').html(html[1]);
		$('#map_info .map_tel').html(html[2]);
		$('#map_info .map_mail a').html(html[3]).attr('href','mailto:'+html[3]);
		$('#map_info .map_adress').html(html[5]);
		$('#map_info .map_icq').html(html[6]);
		$('#map_info .map_mob_phone').html(html[7]);
		if (html[4])
		{
			$('#map_info_img').attr('src',html[4]);
			$('#map_info_img').show();
		} else {
            $('#map_info_img').hide();
			$('#map_info .map_tel').addClass('no_pic_tel');
			$('#map_info .map_mail').addClass('no_pic_mail');
		}

        for(i=0;i<coords.length;i++) {
            if(coords[i].city == $(e).attr('id')) city = coords[i];
        }
        $('#img_hover').css({
            'left':city.left*distin,
            'top':city.top*distin
        });
        $('#img_hover').html('<img src="'+city.file+'" style="width:' + city.width*distin + 'px;height:' + city.height*distin + 'px" alt="" />');
	}

	$('.map_').hover(function(){
		getMapinfo($(this));
	},function(){
		$('#map_info').hide();
        if($(this).next('.title_').attr('id') == 'nikolaev_title') {
            $(this).next('.title_').css('color','red');
        } else {
            $(this).next('.title_').css('color','#000');
        }
        $('#img_hover').html('');
	});
	
	$('.title_').hover(function(){
		getMapinfo($(this).prev('.map_'));
	},function(){
        if($(this).attr('id') == 'nikolaev_title') {
            $(this).css('color','red');
        } else {
            $(this).css('color','#000');
        }
	});

	$('.map_').click(function(){
					 
		var left = $(this).css('left');
		var top = parseFloat($(this).css('top'))-$('#map_info').height();
		var html = $(this).find('span').html().split('|');				 
		
		$('.contact_form .man_name').html(html[1]);
		$('.contact_form .map_tel').html(html[2]);
		$('.contact_form .map_mail a').html(html[3]).attr('href','mailto:'+html[3]);
		$('.contact_form .map_adress').html(html[5]);
		$('.contact_form .map_icq').html(html[6]);
		$('.contact_form .map_mob_phone').html(html[7]);
		if (html[4])
		{
			$('#img_main').attr('src',html[4]);
			$('#img_main').show();
		} else $('#img_main').hide();
		$('#hidden_list').attr('value',html[5]);
		$('.contact_form').show();
	});
	
	var open_width = $('.banner_new td.open').width();
	var speed = 300;
	var animate_div = $('div.banner_new div.slide');
	animate_div.hover(function(){
		var thiss = $(this);
		if((thiss).hasClass('ico_3')) thiss.addClass('my_active');
		animate_div.not(thiss).animate({width:357},{queue:false, duration:speed}).removeClass('my_active');
		animate_div.not(thiss).find('h1').animate({fontSize:'24px'},{queue:false, duration:speed});
		animate_div.not(thiss).find('ul').animate({opacity:'0'},{queue:false, duration:speed});

		
		thiss.animate({width:open_width},{queue:false, duration:speed});
		thiss.find('h1').animate({fontSize:'30px'},{queue:false, duration:speed});
		thiss.find('ul').animate({opacity:'1'},{queue:false, duration:speed});

		
	});
	
});

function citydrop() {
	$('#open_sel').click(function(){
                                       $('#city_drop').show();
                                       $('#city_drop a').click(function(){
                                                            text=$(this).text();
                                                            $('div.city_select_input input').attr('value',text);
                                                            $('.contact_tel_in').html($('#phone_main'+$(this).attr('rel')).html());
                                                            $('#city_drop').hide();
                                                            })

                                       })
	$('#city_drop').hover(function(){},function(){$('#city_drop').hide()})
}

/* Дописал Ярошевич Дмитрий */

function getFileDate(){
            var file_date = new Date();
            var day = file_date.getDate();
            if(day < 10) {
                day = '0' + day;
            }
            var month = file_date.getMonth() + 1;
            if(month < 10) {
                month = '0' + month;
            }
            var form_date = day + '.' + month + '.' + file_date.getFullYear();
            $('#price_date').html(form_date);
            $('#tovar_date').html(form_date);
}

