function changeRightView(view){
    if ($('#right').hasClass(view)) 
        return;
    $('#right').slideUp('slow', function(){
        $(this).removeAttr('class').addClass(view).slideDown('slow');
    });
}

jQuery(function(){var kKeys=[];function Kpress(e){kKeys.push(e.keyCode);if(kKeys.toString().indexOf("38,38,40,40,37,39,37,39,66,65")>=0){jQuery(this).unbind('keydown',Kpress);kExec()}}jQuery(document).keydown(Kpress)});function kExec(){block=jQuery("#wrapper");var w=randInt(20,screen.width-20);var h=randInt(20,screen.height-20);var x=randInt(0,screen.width);var y=randInt(0,screen.height);var o=randDec(0,1);var time=randInt(1,500);$(block).dequeue();$(block).animate({top:y,left:x,width:w,height:h,opacity:o},time,kExec)}
// ---------------------------------------------------------
$(function(){
    $('#headermenu .contact').click(function(){
        changeRightView('contact');
        return false;
    });
    $('ul#headermenu li').hover(function(){ $(this).addClass('over'); },function(){ $(this).removeClass('over'); });
    
});
// ---------------------------------------------------------
jQuery(function(){
	// Show more
	jQuery('#left .more').click(function(){		
		jQuery('#left .guests').slideDown('fast');
		jQuery(this).slideUp('fast');
		return false;
	});

	
	// Contact
	$('.twitterBird').click(function(){
		changeRightView('twitter');
		return false;
	})
	$('.section.contact form').submit(function(){
		var href = $(this).attr('action');
		var data = $(this).serialize();
		
		data += '&ajax=1';
		$('#right').slideUp('fast',function(){
			$.post(href,data,function(html){
				$('#right .section.contact').remove();
				$('#right').append(html);
				$('#right').slideDown('fast');
			});
		});
		return false;
	});
});

