$(document).ready(function(){
	var lofo = $('#loginform');
	$('#login').click(function(){		
		if (lofo.is(':visible')){hideLoginForm();} else {showLoginForm();}
		return false;
	});
	
	$('#close_form').click(function(){hideLoginForm();});
	
	var flag = true;
	$(document).click(function(){
		lofo.hover(function(){flag = false;}, function(){flag = true;});
		flag && hideLoginForm();

	});
		
	function showLoginForm() {
		$('#loginform').show();
		$('.playnowbanner').css('zIndex', 5);
	}

	function hideLoginForm() {
		$('#loginform').hide();
		$('.playnowbanner').css('zIndex', 50);
	}	
	
	$('#flashbanner').append('<div id="flashwrap"></div>');
	$('#flashwrap').click(function(){play()});
	$('#slots').jcarousel({
		scroll: 1,
		buttonNextHTML: '<a></a>',
		buttonPrevHTML: '<a></a>'
	});
	$('#slots').find('li').hover(function(){		
		$(this).find('.slot_desc').animate({
			bottom: 0
		}, 'normal')
	}, function(){
		$(this).find('.slot_desc').animate({
			bottom: '-50px'
		}, 'normal')
	})
});

function bookmarksite(url,title) {
	if (!url) {url = window.location} if (!title) {title = document.title}
	var browser=navigator.userAgent.toLowerCase();
	if (window.sidebar) { // Mozilla, Firefox, Netscape
		window.sidebar.addPanel(title, url,"");
	} else if( window.external) { // IE or chrome
		if (browser.indexOf('chrome')==-1){ // ie
			window.external.AddFavorite( url, title); 
		} else { // chrome
			alert('Please Press CTRL+D (or Command+D for macs) to bookmark this page');}}
	else if(window.opera && window.print) { // Opera - automatically adds to sidebar if rel=sidebar in the tag
		return true;}
	else if (browser.indexOf('konqueror')!=-1) { // Konqueror
		alert('Please press CTRL+B to bookmark this page.');}
	else if (browser.indexOf('webkit')!=-1){ // safari
		alert('Please press CTRL+B (or Command+D for macs) to bookmark this page.');
	} else {
		alert('Your browser cannot add bookmarks using this link. Please add this link manually.')}}	
