var gallery_path = '/i/pics/';

function colorAnim () {
				$(".color span").each(function(i, letter){
					setTimeout(function(){
						$(letter)
							.animate({ color: "#8B8B8B" }, 1000, "elasinout")
							.animate({ color: "#6e6e6e" }, 1000, "elasinout");
					}, i * 200);
				});
		}

$(document).ready(function() {
//png fix
$('#flower,#links,#text,#corner2,.header,.c3,#miniflower,#bigflower,#bigpic,.very-header,.big_header,.header_mini,#contacts,.map').pngFix();
//end png fix
//scroller img
$('#scroller img').click(function(){
	menu_id = $(this).attr("id");
	$('#pic img').fadeOut(500);
	setTimeout('$("#pic img").attr("src",gallery_path+menu_id+".gif")',500);
	$('#pic img').fadeIn();
});

	

$(document).ready(function(){
						   
		if ( !$(".color span").length )
			$(".color").html(jQuery.map( $(".color").html().split(""), function(letter){
				return "<span>" + letter + "</span>";
			}).join(""));
	
		colorAnim();
		setInterval("colorAnim ()", 10000);
});



//end scroller img
//page scroll
if ($.browser.msie) {
	blat = $('#ie').width();
	$('#bla').css('width',blat);
	$('.scroll div').css('display','block');

	$(window).resize(function() {
	blat = $('#ie').width();
	$('#bla').css('width',blat);
 });
}

$('.scroll').jScrollPane({scrollbarWidth:27, scrollbarMargin:0});

$('.jScrollPaneDrag').css('height','45px');
dwidthbg = $('jScrollPaneContainer').width();
$(window).resize(function() {
	$('.scroll').jScrollPane({scrollbarWidth:27});
	$(".jScrollPaneContainer").css('width','100%');
	$(".scroll").css('width','100%');
	$(".scroll p").css('padding-right','43px');
	$(".scroll div").css('padding-right','43px');
	$(".scroll div.news").css('padding-right','80px');
	$(".scroll div.date").css('padding-right','0px');
	$(".scroll div.pics").css('padding-right','0px');
	$(".scroll div.small_text").css('padding-right','0px');
	$(".jScrollPaneDrag").css('height','45px');
	$('.jScrollPaneTrack').pngFix();
 });

$('.jScrollPaneTrack').pngFix();
$('.lease_tbl tr td:first-child').css('font-weight','bold');
$('.lease_tbl tr td:first-child').css('width','40%');
$('.lease_tbl tr td:first-child').css('border-bottom','1px solid #dbdad9').css('border-right','1px solid #dbdad9');
$('.lease_tbl tr td:last-child').css('border-bottom','1px solid #dbdad9');



$('.submenu').hover(function(){
	$('ul.submenu').css('display','block');
		$('ul.submenu').hover(function(){
			$('ul.submenu').show();
			$('a.submenu').addClass('active');
		},function(){
		$('ul.submenu').hide();
		$('a.submenu').removeClass('active');
	});
	}, 
	function () {
	$('ul.submenu').hide();
	});

$('.sub').hover(function(){
	$('ul.sub').css('display','block');
		$('ul.sub').hover(function(){
			$('ul.sub').show();
			$('a.sub').addClass('active');
		},function(){
		$('ul.sub').hide();
		$('a.sub').removeClass('active');
	});
	}, 
	function () {
	$('ul.sub').hide();
	});

$('.sub_table').hover(function(){
	$('ul.sub_table').css('display','block');
		$('ul.sub_table').hover(function(){
			$('ul.sub_table').show();
			$('a.sub_table').addClass('active');
		},function(){
		$('ul.sub_table').hide();
		$('a.sub_table').removeClass('active');
	});
	}, 
	function () {
	$('ul.sub_table').hide();
	});


if ($.browser.mozilla) {
					if ($.browser.version == "1.8.1.12") {
						$('#lang').css('top','35px');
					}
}


/*
$(window).resize(function() {
blat = $('#bla').width() +283;
$('#bla').css('width',blat);
 });
//end page scroll	
//super flash mega loader

//end super flash mega loader
//popup images	

$('.block_pop').click(function(){
		//$(this).parent().addClass('active')
		$(this).addClass('active');
		$('.block_pop').addClass('active');
		$('.block_content').addClass('active');
		return false;
});
$('.block_pop .block_content').click(function(){
	if($('.block_pop .block_content').attr("class") =='active'){											  
		$(this).parent().addClass('active')
		$(this).addClass('active');
		$('.block_pop').addClass('active');
		$('.block_content').addClass('active');
	}else{
		$(this).parent().removeClass('active')
		$(this).removeClass('active');
		$('.block_content').removeClass('active');
		$('.block_content').css('display','none');
	}
		return false;
});
$('.block_pop:not(.active)').hover(function(){
		$(this).parent().addClass('active')	;
		$('.block_content:not(.active)', this).css('display','block');	
		//$('.block_content:not(.active)', this).fadeIn('slow');	
	},function(){
		$(this).parent().removeClass('active')	;
		$('.block_content:not(.active)', this).css('display','none');	
		//$('.block_content:not(.active)', this).fadeOut('slow');	
});
//anotred method
$('.block_pop .block_content').toggle(function(){
		$(this).parent().addClass('active')
		$(this).addClass('active');
		$('.block_pop').addClass('active');
		$('.block_content').addClass('active');
		return false;
	},function(){
		$(this).parent().removeClass('active')
		$(this).removeClass('active');
		$('.block_content').removeClass('active');
		$('.block_content').css('display','none');
		return false;
});*/
//end popup
//end	




});