var menuOver = 0;function ge(elid){	el=document.getElementById(elid);	return el;}function menu_over(id, num) {	for (i=1; i<(num+1); i++) 	{		collps(i);	}	document.getElementById('menu_'+id).style.display = '';	menuOver = 1;	}function menu_out(id) {	menuOver = 0;	if (menuOver == 0) {	 setTimeout('collps('+id+')', 500);	}}function menu_over_empty(id, num) {	for (i=1; i<(num+1); i++) {	collps(i);	}	menuOver = 1;	}function collps(id) {	if (menuOver == 0) {	document.getElementById('menu_'+id).style.display = 'none';	}}$(document).ready(function(){    /*$("a.dealer").click(function(){             $(this).parent().find("li.dealers_salon").toggle();      return false;  });*/  //  $("a.city").live("click", function(){       //      $(this).parent().find("li.dealers_dealer").toggle();//      return false;//  });    /* -- танцы с диллерами -- */   // Москва, Питер и Тольятти наверх    var tmp = $("#dealers_list1 #city_549");  $("#msk").append(tmp.html());  tmp.remove().empty();    tmp = $("#dealers_list1 #city_619");  $("#ptb").append(tmp.html());  tmp.remove().empty();  //  tmp = $("#dealers_list1 #city_905");//  $("#tlt").append(tmp.html());//  tmp.remove().empty();     // Москва, Питер и Тольятти наверх (англ версия)    var tmp = $("#dealers_list1 #city_2469");  $("#msk").append(tmp.html());  tmp.remove().empty();    tmp = $("#dealers_list1 #city_2514");  $("#ptb").append(tmp.html());  tmp.remove().empty();  //  tmp = $("#dealers_list1 #city_2527");//  $("#tlt").append(tmp.html());//  tmp.remove().empty();     // Большие буквы      var city_list = $("#dealers_list1 > li > ul > li");    var item = '';  var first_simbol = '';   var curr_simbol = '';    city_list.each(function() {			      item = $(this).find("a:first").html()      curr_simbol = item.charAt(0);    	if (curr_simbol  != first_simbol){        $(this).prepend("<span class='liter'>" + curr_simbol  + "</span>");      }              	first_simbol = curr_simbol ;   });        // делим на 2-е колонки Россию    var ind = Math.round(city_list.length/2);  ind = city_list.filter(':gt(' + ind + ')').find("span.liter:first").parent().index() - 1;    var city_list2 = city_list.filter(':gt(' + ind + ')');  $("#dealers_list1-1").append(city_list2);    // делим на 2-е колонки СНГ    city_list = $("#dealers_list2 > li > ul > li");  ind = Math.round(city_list.length/2);  ind = city_list.eq(ind).parent().parent().index();  var city_list2 = $("#dealers_list2 > li").filter(':gt(' + ind + ')');  $("#dealers_list2-2").append(city_list2);    /* -- end танцы с диллерами -- */    /* -- gallery -- */    var tmp = $("#gallery > ul").html();  tmp = '<div class="ad-gallery" id="ad-gallery"><div class="ad-image-wrapper"></div><div class="ad-controls"></div><div class="ad-nav"><div class="ad-thumbs"><ul class="ad-thumb-list">' + tmp + '</ul></div></div></div>';    $("#ad-gallery_cont").html(tmp);    $("#ad-gallery_cont").find("div.clear").remove();    $("#gallery a").attr("href", "#ad-gallery");    var currentIndex = 0;    var adg = null;    $("div.f_gal a").fancybox({      autoScale: false,      scrolling: 'visible',      padding: 40,      onComplete: function(){        if (adg === null){          adg = $('.ad-gallery').adGallery({            start_at_index: currentIndex,            loader_image: '/js/jquery.ad-gallery/loader.gif',            effect: 'fade',            animation_speed: 0          });         } else {          //alert("ok");          adg[0].showImage(currentIndex);        }              }        }).click(function(){      currentIndex = $("div.f_gal a").index(this);       //alert(currentIndex);  });     /* -- end gallery -- */      $("a.our_dealers").click(function(){    window.location = $(this).attr("href");    return false;  });});
