/*$(function() {
	//root
	try {
		if ($.browser.flash) {
			swfobject.embedSWF('/swf/banner.swf?xmlpath=' + root_xmlpath, "banner", "978", "300", "9.0.0", "/i/expressInstall.swf", {}, {wmode:"opaque"}, {wmode:"opaque"});
		} else {
			$.get(root_jsonpath, function(js) {
				try {
					eval(js)

					$.each(root_json, function(i, j) {
						var cls = j.current ? ' class="active"' : '';

						$('#banner .in').append('<a href="'+j.link+'"><img src="' + j.image + '" alt="' + j.title + '" id="imgitem' + j.id + '" ' + cls+ '/></a>');
						$('#switch').append('<a href="'+j.link+'" id="item' + j.id + '" ' + cls + ' title="'+j.title+'">' + (i + 1) + '</a>');
					});

					$('#switch a').click(function() {
						var id = $(this).attr('id');

						if(this.className !== 'active') {
							$('#banner .active').animate({top:'-300px'}, {duration:500, easing:'easeOutCubic'});
							$('#banner .active').removeClass('active');
							$('#switch .active').removeClass('active');
							$('#img'+id).css('top','300px').animate({top:'0'}, {duration:400, easing:'easeOutCubic'});
							$('#img'+id).addClass('active');
							$(this).addClass('active');

						} else {
							return false;
						}

						return false;
					});
				} catch(e) {

				}
			});
		}
	} catch(e) {
	}

	//menu
	try {
		$.each(banner_json, function(i, val) {

			if (!val.link) {
				$("#banner_" + i).closest("div.pop").addClass("no-banner");
				$("#banner_" + i).remove();
			}

			$('#banner_' + i).append('<a href="' + val.link + '" class="description" target="_top"><img src="' + val.image+ '" alt="" />' + val.text + '</a>');
		});
	} catch(e) {
	}

	//inner
	try {
		var position = new Array('left', 'center', 'right', 'right2');
		var j = 0;
		
		$.each(inner_json, function(i, val) {
			$('.b-promo .promo-' + position[j++] + ' .shadow-box').append('<a href="' + val.link + '" class="sh-in"><img src="' + val.preview + '" class="img"><img src="' + val.image + '" class="img-wide"></a>');
		});
	} catch(e) {
	
	try {
		var position = new Array('left', 'center', 'right', 'right2');
		var j = 0;

		$.each(footer_json, function(i, val) {
			$('.b-promo .promo-' + position[j++] + ' .shadow-box').append('<a href="' + val.link + '" class="sh-in"><img src="' + val.preview + '" class="img"><img src="' + val.image + '" class="img-wide"></a>');
		});

	} catch(e) {
	}}
});
*/

$(function(){
	$('#zoom1').hover(function(){
			$(this).stop().animate({width:"230px",height:"120px",left:"-0px",top:"-0px"}, 50);
			$(this).attr("src","/photo/krutilka/2_10.jpg");
			$(this).css("margin-left","-5px");
			$(this).css("margin-top","-5px");
		},
		function(){
			$(this).stop().animate({width:"210px",height:"100px",left:"0",top:"0"}, 50);
			$(this).attr("src","/photo/krutilka/10.jpg");
			$(this).css("margin-left","5px");
			$(this).css("margin-top","5px");
		});	
	$('#zoom2').hover(function(){
			$(this).stop().animate({width:"230px",height:"120px",left:"-0px",top:"-0px"}, 300);
			$(this).attr("src","/photo/krutilka/2_11.jpg");
			$(this).css("margin-left","-5px");
			$(this).css("margin-top","-5px");
		},
		function(){
			$(this).stop().animate({width:"210px",height:"100px",left:"0",top:"0"}, 300);
			$(this).attr("src","/photo/krutilka/11.jpg");
			$(this).css("margin-left","5px");
			$(this).css("margin-top","5px");
		});	
	$('#zoom3').hover(function(){
			$(this).stop().animate({width:"230px",height:"120px",left:"-0px",top:"-0px"}, 300);
			$(this).attr("src","/photo/krutilka/2_12.jpg");
			$(this).css("margin-left","-5px");
			$(this).css("margin-top","-5px");
		},
		function(){
			$(this).stop().animate({width:"210px",height:"100px",left:"0",top:"0"}, 300);
			$(this).attr("src","/photo/krutilka/12.jpg");
			$(this).css("margin-left","5px");
			$(this).css("margin-top","5px");
		});	
	$('#zoom4').hover(function(){
			$(this).stop().animate({width:"230px",height:"120px",left:"-0px",top:"-0px"}, 300);
			$(this).attr("src","/photo/krutilka/2_13.jpg");
			$(this).css("margin-left","-5px");
			$(this).css("margin-top","-5px");
		},
		function(){
			$(this).stop().animate({width:"210px",height:"100px",left:"0",top:"0"}, 300);
			$(this).attr("src","/photo/krutilka/13.jpg");
			$(this).css("margin-left","5px");
			$(this).css("margin-top","5px");
		});	
});


function _timer_()
{

}

$('#print').click(function() {
	window.print();
	return false;
});

$("i.region").click( function(e) {
	var rId = $(this).attr('id');

	var form = $('form#regions');
	form.append('<input type="hidden" name="rid" value="'+rId+'" />');
	form.submit();
});

/*$(function() {
	$("#mainbgin").each(function() {
		swfobject.embedSWF("/swf/video-2.swf", "mainbgin", "100%", "100%", "9.0.0", "expressInstall.swf", {}, {wmode:"opaque"}, {wmode:"opaque"});
	})
});*/

$(function(){
	$("#topmenu-in .pop").each(function() {
		$(this).removeClass("hidden-pop");
	})

	$('#servicemenu .block').hover(function() {
		$(this).addClass('active');
		$(this).find('UL').show(150);
	}, function() {
		$(this).removeClass('active');
		$('UL', this).hide(150);
	});
});

$(function() {
	$('#topmenu-in>li').each(function() {
		var pop = $(this).children("div.pop");
		if (pop.find("a.description").length > 0) {
			pop.css('width', '347px');
		}
		var menu_width = $('#topmenu').width();
		var pop_width  = pop.width();
		var li_width   = $(this).width();
		var li_pos     = $(this).position();
		var pop_pos    = Math.ceil(li_pos.left + li_width/2 - pop_width/2);

		if (pop_pos < 0) {
			pop.css({'left':'-5px', 'right': 'auto'});

		} else if (pop_width + li_pos.left > menu_width) {
			pop.css({'right':'-10px', 'left':'auto'});
		} else {

			pop.css({'left': pop_pos, 'right':'auto'});
		}

		if ($(this).find("iframe").size()) {
			var bannerframe = $(this).find("iframe");
			var ih = bannerframe.contents().find('body').height();
			
			if (ih > $(this).find(".in").height()) {
				bannerframe.attr("height", ih + "px");
			} else {
				bannerframe.attr("height", $(this).find(".in").height() + "px");
			}
		}
		
		pop.hide().css("visibility", "visible");
	})
	
	$('#topmenu-in>li').hover(function() {
		$("#topmenu-in div.pop").hide();   	
		var pop = $(this).children("div.pop");
		pop.show();
		
		pop.find("div.ctc").css("width", pop.width());
		pop.find("div.cbc").css("width", pop.width());
	})
})

$(function(){
	$('#topmenu').hover(
		function () {},
		function() {
			$("div.pop").hide();
		}
	)
})
/*
$(function(){
	$('.b-promo .sh-in').hover(
		function () {
		$(this).find('.img').fadeOut(300);
		$(this).find('.img-wide').fadeIn(300);
		$(this).animate({width: '230px', height: '134px'}, 200);
		$(this).parent().animate({top: '-16px', left: '-17px'}, 200);
		$(this).parent().css('z-index','100');
	}, 

		function () {
		$(this).find('.img').fadeIn(300);
		$(this).find('.img-wide').fadeOut(200);
		$(this).animate({width: '210px', height: '100px'}, 200);
		$(this).parent().animate({top: '0', left: '0'}, 200);
		$(this).parent().css('z-index','');
	});
});
*/

