/*
	 by Tomasz Muter
	 http://www.fastfill.pl
	 email: tmuter [at] gmail [dot] com
*/


$(document).ready(function(){

	$(".pop-nav").parent().append("<span></span>"); 

	$("#basic-navigation-first li a").hover(function() {
		$(this).parent().find(".pop-nav").fadeIn('slow').show();
		$(this).parent().hover(function() {

		}, function(){
			$(this).parent().find(".pop-nav").fadeOut('slow'); 
		});
		}).hover(function() {
			$(this).addClass("subhover");
		}, function(){
			$(this).removeClass("subhover");
	});

});

$(document).ready(function(){
var i = 0;
	$(".login-up").hover(function() {
		$(this).parent().find("#login-cloud").fadeIn('fast').show();
		$(this).parent().hover(function() {
				$("#login-cloud input").focus( function(){ i=1;}),	
				$("#page_container").click( function(){ i=0; $("#login-cloud").fadeOut('slow');});
		}, function(){
			if (i==1){}
			else{
			$(this).parent().find("#login-cloud").fadeOut('slow'); }
		});
		}).hover(function() {
			$(this).addClass("subhover");
		}, function(){
			$(this).removeClass("subhover");
	});
	$(".profile-up").hover(function() {
		$(this).parent().find("#profile-cloud").fadeIn('fast').show();
		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("#profile-cloud").fadeOut('slow'); 
		});
		}).hover(function() {
			$(this).addClass("subhover");
		}, function(){
			$(this).removeClass("subhover");
	});

});
