﻿if(!onloads) var onloads = Array();


(function($) { 

$(document).ready(function(){

    $('.Main #ya').focus();
    
    $('#ya').bind('blur', function(){
			var y = $('#ya');
			if(y.val()==''){
	    	y.val(defaultCitySearchStr);
	    	y.css('color', '#808080');
			}
    });
    $('#ya').bind('focus', function(){
	var y = $('#ya');
	if(y.val()==defaultCitySearchStr){
	    y.val('');
	    y.css('color', '#000000');
	}
    });

   /*  скругленные углы */
          $('.container,.rounded').prepend('<dfn class="rounded1"></dfn><dfn class="rounded2"></dfn><dfn class="rounded3"></dfn><dfn class="rounded4"></dfn>');
          $('.container').addClass('isRounded');
   

   /**********************************************************************************************************

   Открываем и закрываем вкладки

   ***********************************************************************************************************/
   $('.myTabs li').click(function(){
                                                       

        b=$(this).hasClass('select');




        // !!! заглушка  на закрытие вкладки
        if ($(this).parent().hasClass('noClose'))   if (b) return false;

        /*  белый блок под синим   */
        q=$(this).parents('.L12BlueClose');
        if  (q.length)
        {

        }





        $(this).siblings().removeClass('select');
        $(this).removeClass('select');

        id=$(this).find('a').attr('href');
        $(id).siblings().removeClass('select');
        $(id).removeClass('select');
        e=false;
        if($(id).hasClass('myTabsExt')) e=$(id); else  if ($(id).parent().hasClass('myTabsExt')) e=$(id).parent();
        if (e) if (b) {e.hide();return false;} else e.show();


        $(this).addClass('select');
        $(id).addClass('select');

        return false;
   })
   /**********************************************************************************************************

   открыть-закрыть  форму поиска карт на главной страницею и показать текстовый баннер

   ***********************************************************************************************************/

  $('.atabs7 span a').click(function(){
        q= $('.maps');

        if (q.hasClass('HideForm'))
            {
                $(q).parents('.containerWrap').addClass('MB0');
                q.removeClass('HideForm');
                q.addClass('ShowMapForm');
                $('.ih94px').hide();
            }
                else
            {
                $(q).parents('.containerWrap').removeClass('MB0');
                q.removeClass('ShowMapForm');
                q.addClass('HideForm');
                $('.ih94px').show();
            }

        return false;
   })

    $('ul.maps  li').click(function(){

        location.href=$(this).find('a').attr('href');

        return false;
   })


   /**********************************************************************************************************


  /***************************************************************************************************************

  Организация всплывающих подсказок

  ****************************************************************************************************************/


        $(".jAjax").each(function(){
                $(this).jHelperTip({source: "ajax",url: $(this).attr('href')});
          });


        mTimer = null; setInterval(function(){$('.blockMenu').hide(200);clearInterval(mTimer);},800);
        $('.Lang').mouseover(function(){$('#mainMenu  dl').show(200);})
        $('#mainMenu .Lang dl').hover(function(){if (mTimer) clearInterval(mTimer);},function(){ mTimer = setInterval(function(){$('#mainMenu .Lang dl').hide(200);clearInterval(mTimer);},100);})
        $('.mainContainer4').mouseover(function (){clearInterval(mTimer);$('#mainMenu .Lang dl').hide(200);})
        $('.Lang dt').click(function(){document.cookie="mylang="+$(this).attr('class');})
        $('.Lang > a').click(function(){document.cookie="mylang="+$(this).attr('class');return true;})






})

if (screen.width<1100) document.writeln('  <style type="text/css">.RBC,.RBC * {display:none;} .extContainer {width:989px!important;padding:0;}</style>');

})(jQuery);

function _print(){
	(function($) { 
		if(!$('#print_form').first) {
			$(document.body).append("<div id=print_form></div>");
		}
		var print_form = $('#print_form');
		$.ajax({
			type: "GET",
			url: "/get_block/4368/busy",
			data: "url="+document.location.href,
			success: function(data){
				$('#print_css').attr('href', '/static/css/print.css');
				print_form.html(data);
				// window.print();
			}
		});
	})(jQuery);
	return false;
}
