function ShowBanner(swf,v,w,h,b,uid) {
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+v+',0,0,0" width="'+w+'" height="'+h+'" id="bigmap" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+swf+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#'+b+'" /><param name="flashvars" value="userid='+uid+'" /><embed src="'+swf+'" flashvars="userid='+uid+'" quality="high" wmode="transparent" bgcolor="#'+b+'" width="'+w+'" height="'+h+'" name="bigmap" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}

$(document).ready(
	function() 
	{
		
		$('.star-hotel').rating({
			split: 2,
			callback: function(){
				$.ajax(
				{
					url: $(this).parent().parent().attr('action'),
					data: $(this).parent().parent().serialize(),
					error:  function(res){
						$.fancybox(
							$('#enter_form').parent().html(),
							{
								'scrolling'		: 'no',
								'titleShow'		: false,
								'showCloseButton'	: false
							}
						);
						$('.star-hotel').rating('disable');
					}
					//,success: function(res){ alert(res);}
				});
				
			}
		});
		
		$("#add_comment").bind("submit", function() {
		
			$.fancybox.showActivity();
		
			$.ajax({
				type	: "POST",
				cache	: false,
				url		: "/",
				data		: $(this).serialize(),
				success: function(data) {
					$.fancybox.close();
				}
			});
		
			return false;
		});

		
		$("table.journeys tr.journey").hover(function (){
			$(this).addClass('over');
		},function (){
			$(this).removeClass('over');
		});
		
		$("a@[rel=enter_form]").fancybox(
		{
			'scrolling'		: 'no',
			'titleShow'		: false,
			'showCloseButton'	: false
		});
		
		$("a@[rel=hotelrate]").fancybox(
		{
			'scrolling'		: 'no',
			'titleShow'		: false,
			'showCloseButton'	: false
		});
		
		$("a@[rel=add_comment]").fancybox(
		{
			'scrolling'		: 'no',
			'titleShow'		: false,
			'showCloseButton'	: false
		});
		
		$("#add_comment").bind("submit", function() {
		
			$.fancybox.showActivity();
		
			$.ajax({
				type		: "POST",
				cache	: false,
				url		: "/",
				data		: $(this).serialize(),
				success: function(data) {
					$.fancybox.close();
					location.reload();
				}
			});
		
			return false;
		});
		
		$("#enter_form").bind("submit", function() {
		
			$.fancybox.showActivity();
		
			$.ajax({
				type		: "POST",
				cache	: false,
				url		: "/",
				data		: $(this).serialize(),
				success: function(data) {
					$.fancybox.close();
					location.reload();
				}
			});
		
			return false;
		});

		
		// Скрыть/показать форму добавления комментариев		
		$('#content .add_comment form').css({display:'none'});
		$('#content .add_comment p.add a').toggle(
			function()
			{
				$(this).parent().children('span').html('-');
				$(this).parent().parent().children('form').slideToggle('fast');
			},
			function()
			{
				$(this).parent().children('span').html('+');
				$(this).parent().parent().children('form').slideToggle('fast');
			}
		);

		// Скрыть/показать форму рейтингования отеля		
		$('#content .user-rate form').css({display:'none'});
		
		$('#content .user-rate p.add a').toggle(
			function()
			{
				$(this).children('span').html('-');
				$(this).parent().parent().children('form').slideToggle('fast');
			},
			function()
			{
				$(this).children('span').html('+');
				$(this).parent().parent().children('form').slideToggle('fast');
			}
		);
		
		$('a.journey').fancybox({
			'type' : 'iframe',
			'autoDimensions': false,
			'width' : 640,
			'height' : 530
		});
		$("a.fancybox").fancybox();
		
		$('.albums a@[rel=zoom]').css({position:'relative'});
		$('.albums a@[rel=zoom] img').css({position:'absolute'});
		$('.albums a@[rel=zoom]').hover(
			function()
			{
				$(this).children('img').animate({left:'-10px',top:'-10px',width:'80px',height:'80px'}, 'fast');
			},
			function()
			{
				$(this).children('img').animate({left:'0',top:'0',width:'60px',height:'60px'}, 'fast');
			}
		);

		$('.photos a@[rel=zoom]').css({position:'relative', width:'60px', height:'60px'});
		$('.photos a@[rel=zoom] img').css({position:'relative'});
		$('.photos a@[rel=zoom]').hover(
			function()
			{
				$(this).children('img').animate({left:'-10px',top:'-10px',width:'80px',height:'80px'}, 'fast');
			},
			function()
			{
				$(this).children('img').animate({left:'0',top:'0',width:'60px',height:'60px'}, 'fast');
			}
		);
		
	}
);
