$(function(){	$(".demoflow-button-left").mouseover(function(){
		if (!(jQuery.browser.msie && jQuery.browser.version == '5.5')){
			$(this).css('background-position', 'left bottom');
		} else {
			$(this).css('background-image', 'none');
			$(this).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='./media/demos_arrows_2.png',sizingMethod='scale')";
		}
	});
	$(".demoflow-button-right").mouseover(function(){
		if (!(jQuery.browser.msie && jQuery.browser.version == '5.5')){
			$(this).css('background-position', 'right bottom');
		} else {
			$(this).css('background-image', 'none');
			$(this).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='./media/demos_arrows_4.png',sizingMethod='scale')";
		}
	});
	$(".demoflow-button-left").mouseout(function(){        if (!(jQuery.browser.msie && jQuery.browser.version == '5.5')){
			$(this).css('background-position', 'left top');
		} else {
			$(this).css('background-image', 'none');
			$(this).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='./media/demos_arrows_1.png',sizingMethod='scale')";
		}
	});
	$(".demoflow-button-right").mouseout(function(){
		if (!(jQuery.browser.msie && jQuery.browser.version == '5.5')){
			$(this).css('background-position', 'right top');
		} else {
			$(this).css('background-image', 'none');
			$(this).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='./media/demos_arrows_3.png',sizingMethod='scale')";
		}
	});
	$(".demoflow-button-left").click(function(){
		prevLogo();
	});
	$(".demoflow-button-right").click(function(){		nextLogo();
	});
	printLinks();
	showPlus(thislogo);});

var maxlogo = 5;

var activeLogo = new Array();

activeLogo[4] = new Object();
activeLogo[4]['title'] = 'Группа "Авто-3"';
activeLogo[4]['group_id'] = 101;
activeLogo[4]['about'] = [
	{left:100, top:160, text:'Шкаф книжный', measure:{w:834, h:1565, d:450}, img:'media/min/books/a3.png', objectid:'4', coast:'0', oldcoast:'0'},
	{left:350, top:250, text:'Кровать', measure:{w:1800, h:835, d:850}, img:'media/min/beds/a3.png', objectid:'2', coast:'0', oldcoast:'0'},
	{left:350, top:90, text:'Шкаф 2-х створчатый', measure:{w:834, h:1800, d:452}, img:'media/min/boxes/a3.png', objectid:'5', coast:'0', oldcoast:'0'},
	{left:570, top:200, text:'Компьютерный стол', measure:{w:1032, h:1430, d:732}, img:'media/min/tables/a3.png', objectid:'3', coast:'0', oldcoast:'0'}
];

activeLogo[0] = new Object();
activeLogo[0]['title'] = 'Группа №10 "Космос"';
activeLogo[0]['group_id'] = 108;
activeLogo[0]['about'] = [
	{left:130, top:100, text:'Шкаф 2-х створчатый', measure:{w:800, h:1800, d:550}, img:'media/min/boxes/10.png', objectid:'34', coast:'0', oldcoast:'0'},
	{left:450, top:220, text:'Кровать', measure:{w:2050, h:980, d:950}, img:'media/min/beds/10.png', objectid:'31', coast:'0', oldcoast:'0'},
	{left:340, top:155, text:'Тумба', measure:{w:450, h:630, d:435}, img:'media/min/socles/10.png', objectid:'35', coast:'0', oldcoast:'0'},
	{left:270, top:100, text:'Компьютерный стол', measure:{w:1200, h:1465, d:740}, img:'media/min/tables/10.png', objectid:'32', coast:'0', oldcoast:'0'},
	{left:420, top:100, text:'Шкаф книжный', measure:{w:800, h:1800, d:300}, img:'media/min/books/10.png', objectid:'33', coast:'0', oldcoast:'0'}
];

activeLogo[2] = new Object();
activeLogo[2]['title'] = 'Группа №11 "Морская тема"';
activeLogo[2]['group_id'] = 109;
activeLogo[2]['about'] = [
	{left:590, top:90, text:'Шкаф 2-х створчатый', measure:{w:800, h:1800, d:550}, img:'media/min/boxes/11.png', objectid:'39', coast:'0', oldcoast:'0'},
	{left:120, top:210, text:'Кровать', measure:{w:2050, h:950, d:980}, img:'media/min/beds/11.png', objectid:'36', coast:'0', oldcoast:'0'},
	{left:280, top:210, text:'Тумба', measure:{w:450, h:630, d:435}, img:'media/min/socles/11.png', objectid:'40', coast:'0', oldcoast:'0'},
	{left:390, top:120, text:'Компьютерный стол', measure:{w:1200, h:1465, d:740}, img:'media/min/tables/11.png', objectid:'37', coast:'0', oldcoast:'0'},
	{left:480, top:100, text:'Шкаф книжный', measure:{w:800, h:1800, d:300}, img:'media/min/books/11.png', objectid:'38', coast:'0', oldcoast:'0'}
];

activeLogo[1] = new Object();
activeLogo[1]['title'] = 'Группа №9 "Принцесса"';
activeLogo[1]['group_id'] = 107;
activeLogo[1]['about'] = [
	{left:100, top:80, text:'Шкаф 2-х створчатый', measure:{w:800, h:1800, d:585}, img:'media/min/boxes/9.png', objectid:'30', coast:'0', oldcoast:'0'},
	{left:270, top:200, text:'Кровать', measure:{w:1000, h:2050, d:900}, img:'media/min/beds/9.png', objectid:'27', coast:'0', oldcoast:'0'},
	{left:520, top:140, text:'Компьютерный стол', measure:{w:1285, h:1400, d:740}, img:'media/min/tables/9.png', objectid:'28', coast:'0', oldcoast:'0'},
	{left:420, top:100, text:'Шкаф книжный', measure:{w:800, h:1800, d:385}, img:'media/min/books/9.png', objectid:'29', coast:'0', oldcoast:'0'}
];

activeLogo[3] = new Object();
activeLogo[3]['title'] = 'Группа №2 "Листопад"';
activeLogo[3]['group_id'] = 103;
activeLogo[3]['about'] = [
	{left:110, top:120, text:'Шкаф 2-х створчатый', measure:{w:800, h:1860, d:550}, img:'media/min/boxes/2l.png', objectid:'12', coast:'0', oldcoast:'0'},
	{left:390, top:160, text:'Кровать', measure:{w:980, h:2050, d:950}, img:'media/min/beds/2l.png', objectid:'10', coast:'0', oldcoast:'0'},
	{left:450, top:230, text:'Тумба', measure:{w:490, h:480, d:390}, img:'media/min/socles/2l.png', objectid:'13', coast:'0', oldcoast:'0'},
	{left:560, top:160, text:'Компьютерный стол', measure:{w:1200, h:1550, d:800}, img:'media/min/tables/2l.png', objectid:'11', coast:'0', oldcoast:'0'}
];

function prevLogo(){
	$("#active_about .about").hide();	$("#active_plus").html("");	thislogo = (maxlogo + thislogo-1) % maxlogo;
	$("#active_prev").attr('src', "media/activelogo/active_logo_"+thislogo+".jpg");
	$("#active_now").animate({width:'360px', height:'140px', left:'-460px', top:'120px', opacity:'0'}, 1000);
	$("#active_prev").animate({width:'700px', height:'350px', left:'0px', top:'0px', opacity:'1'}, 1000, function(){;
		$("#active_now").attr('src', "media/activelogo/active_logo_"+thislogo+".jpg");
		$("#active_now").css({width:'700px', height:'350px', left:'0px', top:'0px', opacity:'1'});
		$("#active_prev").css({width:'360px', height:'140px', left:'1000px', top:'120px', opacity:'0'});
		printLinks();
		showPlus(thislogo);
	})
}

function nextLogo(){
	$("#active_about .about").hide();	$("#active_plus").html("");
	thislogo = (thislogo+1) % maxlogo;
	$("#active_next").attr('src', "media/activelogo/active_logo_"+thislogo+".jpg");
	$("#active_now").animate({width:'360px', height:'140px', left:'1000px', top:'120px', opacity:'0'}, 1000);
	$("#active_next").animate({width:'700px', height:'350px', left:'0px', top:'0px', opacity:'1'}, 1000, function(){;
		$("#active_now").attr('src', "media/activelogo/active_logo_"+thislogo+".jpg");
		$("#active_now").css({width:'700px', height:'350px', left:'0px', top:'0px', opacity:'1'});
		$("#active_next").css({width:'360px', height:'140px', left:'-460px', top:'120px', opacity:'0'});
		printLinks();
		showPlus(thislogo);
	})
}

function numberLogo(i){	thislogo = i+1;
	prevLogo();
}

function printLinks(){
	var html = "";
	var step = "";
	var active = "";
	$("#active_logo .links").html("");
	for (var i=0; i<maxlogo; i++){		active = " onclick='numberLogo("+i+");'";
		if (i == thislogo) active = " class='active'";		html += step+"<a href='javascript:void(0);'"+active+">"+(i+1)+"</a>";
		step = "· ";
	}	$("#active_logo .links").html(html);
	$("#active_logo .text").html("<a href='group.php?id="+activeLogo[thislogo]['group_id']+"&activelogo' title='Посмотреть информацию о комнате'>"+activeLogo[thislogo]['title']+"</a>");}

function showPlus(n){	for (var i=0; i<activeLogo[n]['about'].length; i++){		$("#active_plus").append('<a href="furniture.php?id='+activeLogo[n]['about'][i].objectid+'&activelogo" title="Нажмите, чтобы увидеть описание" class="plus" style="left:'+activeLogo[n]['about'][i].left+'px; top:'+activeLogo[n]['about'][i].top+'px;" onmouseover="showAboutDiv(\''+n+'\', \''+i+'\', this);"></a>');
	}
}

var active_menuabout = null;

function showAboutDiv(n_group, n_plus, _this){	$(_this).css('z-index', 101);
	var obj = activeLogo[n_group]['about'][n_plus];
	var left = obj.left + 10;
	if (obj.left > 420){		left = obj.left - 260;
	}
	var html = "";
	html+= "<table style='width:100%;'><tr>";
	html+= "<td width='100'><div class='imgdiv'><img src='"+obj.img+"'></div></td>";
	html+= "<td><div class='textdiv'>";
	html+= "<div class='textabout'>"+obj.text+"</div>";
	if (obj.oldcoast>0){		html+= "<div class='oldcoast'>"+obj.oldcoast+" р.</div>";
	}
	if (obj.coast>0){
		html+= "<div class='coast'>"+obj.coast+" р.</div>";
	}
	if (obj.measure.w>0 && obj.measure.h>0 && obj.measure.d>0){
		html+= "<div class='measure'><h4>Размер, мм:</h4>"+obj.measure.w+" x "+obj.measure.h+" x "+obj.measure.d+"</div>";
	}
	html+= "</div></td>";
	html+= "</tr></table>";
	$("#active_about .about").html(html);	$("#active_about .about").css({left:left+'px', top:(obj.top-67)+'px'});
	$("#active_about .about").show();
	$("#active_about .about").mouseout(function(){		$(_this).css('z-index', 10);
		var __this = this;
		$(document).oneTime('1s', 'menuabout', function(){
			$(__this).hide();
			active_menuabout = null;
		});
	});}

$(window).load(function(){	$("#load_other").append("<img src='media/activelogo/active_logo_0.jpg' />");	$("#load_other").append("<img src='media/activelogo/active_logo_1.jpg' />");
	$("#load_other").append("<img src='media/activelogo/active_logo_2.jpg' />");
	$("#load_other").append("<img src='media/activelogo/active_logo_3.jpg' />");
	$("#load_other").append("<img src='media/activelogo/active_logo_4.jpg' />");});

function set_menu(menu_id, background, href){	$("#menu_"+menu_id).css('background', 'url('+background+')');
	$("#menu_"+menu_id+" .menu_box").html(href);
	return false;}

$(function(){	$("#ab_1").click(function(){
        set_menu(1, 'media/bottommenu/1.jpg', 'Кровать в виде гоночного автомобиля. Для мальчиков 3-12 лет. <a href="furniture.php?id=2" class="arrow">Подробнее</a>');
        set_menu(2, 'media/bottommenu/2.jpg', 'Кровать-трансформер. Ночью это уютная кровать, а днем - удобный стол для занятий. <a href="furniture.php?id=47" class="arrow">Подробнее</a>');
        set_menu(3, 'media/bottommenu/4.jpg', 'Детская комната для юной принцессы <a href="group.php?id=107" class="arrow">Подробнее</a>');
        set_menu(4, 'media/bottommenu/3.jpg', 'Яркая и удобная детская комната, всегда будет создавать отличное настроение у ребенка  <a href="group.php?id=102" class="arrow">Подробнее</a>');
        $("#ab_1, #ab_2, #ab_3, #ab_4").removeClass('active');
        $(this).addClass('active');
		return false;
	});	$("#ab_3").click(function(){        set_menu(1, 'media/bottommenu/2.jpg', 'Кровать-трансформер. Ночью это уютная кровать, а днем - удобный стол для занятий. <a href="furniture.php?id=47" class="arrow">Подробнее</a>');
        set_menu(2, 'media/bottommenu/5.jpg', 'Кровать со спальным местом на верхнем ярусе, и пустым пространством внизу.<a href="furniture.php?id=55" class="arrow">Подробнее</a>');
        set_menu(3, 'media/bottommenu/6.jpg', 'Двухъярусная кровать-комната в стиле автомобильных гонок со встроенными ящиками.<a href="furniture.php?id=68" class="arrow">Подробнее</a>');
        set_menu(4, 'media/bottommenu/7.jpg', 'Двухъярусная кровать-автобус<a href="furniture.php?id=70" class="arrow">Подробнее</a>');
        $("#ab_1, #ab_2, #ab_3, #ab_4").removeClass('active');
        $(this).addClass('active');
		return false;	});
	$("#ab_4").click(function(){
        set_menu(1, 'media/bottommenu/7.jpg', 'Двухъярусная кровать-автобус<a href="furniture.php?id=70" class="arrow">Подробнее</a>');
        set_menu(2, 'media/bottommenu/8.jpg', 'Двухъярусная кровать в виде пожарной машины<a href="furniture.php?id=71" class="arrow">Подробнее</a>');
        set_menu(3, 'media/bottommenu/9.jpg', 'Тахта-авто.<a href="furniture.php?id=72" class="arrow">Подробнее</a>');
        set_menu(4, 'media/bottommenu/10.jpg', 'Детская кровать-конструктор в виде БТРа<a href="#" class="arrow">Подробнее</a>');
        $("#ab_1, #ab_2, #ab_3, #ab_4").removeClass('active');
        $(this).addClass('active');
		return false;
	});});

$(function(){

	$("#active_bottom .menu .menu_box").css('opacity', '0.9');

	var id = "";

	$("#active_bottom .menu").mouseover(function(){
		var _id = $(this).attr("id");
		if (id!=id){
			$("menu_"+id).find(".menu_box").animate({left: '-110px'}, 300);
			id = _id;
		}
		$(document).stopTime('timer_googlemap'+id);
		$(this).find(".menu_box").animate({left: '0px'}, 300);
	});
	$("#active_bottom .menu").mouseout(function(){
		id = $(this).attr("id");
		$(document).oneTime('1s', 'timer_googlemap'+id, function(){
			$(this).find(".menu_box").animate({left: '-110px'}, 300);
		});
	});

});