function ZoomPicture(nm, ptitle, img, w, h) {
  var win = window.open('' ,'picView'+nm, 'height='+h+',width='+w+',top=10,left=10,status=0,toolbar=0,menu=0,addressbar=0');

  win.document.write('<head><title>'+ptitle+'</title></head><body topmargin=0 leftmargin=0>');
  win.document.write('<img src="'+img+'" width="'+w+'" height="'+h+'" />');
  win.document.write('</body>');
  return false;
}

function clear_search_text()
{
  var elem = document.getElementById('search_text');
  if (elem.value == 'поиск по сайту') elem.value = '';
}

jQuery(document).ready(function($) {

	$("#top_images").cycle({
		speed: 3500,
		delay:	-1000,
		timeout: 2000
	});			

	$("td.wedding_link").hover(
		function(){
			$("#wedding_list").show();
			$(this).addClass('wedding_current');
		},
		function(){
			$("#wedding_list").hide();
			$(this).removeClass('wedding_current');
		}
	);

	$("td.ceremony_link").hover(
		function(){
			$("#ceremony_list").show();
			$(this).addClass('ceremony_current');
		},
		function(){
			$("#ceremony_list").hide();
			$(this).removeClass('ceremony_current');
		}
	);

	$("td.travel_link").hover(
		function(){
			$("#travel_list").show();
			$(this).addClass('travel_current');
		},
		function(){
			$("#travel_list").hide();
			$(this).removeClass('travel_current');
		}
	);

});

(function($){
	/* использование: <a class='scrollTop' href='#' style='display:none;'></a> 
	------------------------------------------------- */  
	$(function(){
		var e = $(".scrollTop");
		var speed = 500;

		e.click(function(){
			$("html:not(:animated)" +( !$.browser.opera ? ",body:not(:animated)" : "")).animate({ scrollTop: 0}, 500 );
			return false; //важно!
		});
		//появление
		function show_scrollTop() {
			( $(window).scrollTop()>300 ) ? e.fadeIn(600) : e.hide();
		}
		$(window).scroll( function(){show_scrollTop()} ); show_scrollTop();
	});
})(jQuery);
