/**
* Javascipt // JQuery
* External functions
* Khoroshilov Evgeniy [RUff]
* 2009 - Webway company
*
*/

//map gallery
function gallLoad() {

	$("#map .scheme").click(function(){
		$(".showmap").fadeIn(200);
	});

	var path = window.location.hash;
	if(path.length != 0 && path == '#schemepopup')
		$("#map .scheme").trigger('click');
	
	$(".showmap .b a").click(function(){
		var pict1 = $(".showmap div.a img");
		var pict2 = $(this).children("img");
		
		pict2.hide().attr({
			"src": pict1.attr("src")
		});
		
		pict1.hide().attr({
			"src": $(this).attr("href")
		});

		$(this).attr({
			"href": pict2.attr("src")
		});
		return false;
	});
	
	
	$(".showmap div.a>img").load(function(){
		$(".showmap div.a>img:hidden").fadeIn("slow");
	});
	
	$(".showmap div.b img").load(function(){
		$(this).fadeIn("slow");
	});
	
	$(".map span.back").click(function(){
		$(".showmap").fadeOut(400);
	});
};

//carousel min on

//vertical
function car_vertLoad() {
	if ($(".gall_vert li").length > 3){
		
		$(".gall_vert span").css('visibility', 'visible');
		
		$(".gall_vert .carouselm").jCarouselLiteM({
			btnNext: "span.next_p",
			btnPrev: "span.prev_p",
			circular: true,
			vertical: true,
			visible: 3
			
		});
	};
};

//horizontal
function car_horLoad() {
	if ($(".gall_hor li").length > 3){
		
		$(".gall_hor span").css('visibility', 'visible');
		
		$(".gall_hor .carouselm").css({
			'padding-top': '16px',	
            'margin-left': '53px',
			'height': '150px'
                        
		});
		
		$(".gall_hor .carouselm").jCarouselLiteM({
			btnNext: "span.next_n",
			btnPrev: "span.prev_n",
			visible: 3,
			circular: false
		});
		

	};
};
