var em_user_value = "Nom d'utilisateur";
var em_pass_value = "Mot de passe";

$('#em_user').val(em_user_value);
$('#em_user').css("color", "#bbbbbb");
$('#em_pass').val(em_pass_value);
$('#em_pass').css("color", "#bbbbbb");
$('#em_user').focus(function () {
	if ($(this).val() == em_user_value) {
		$(this).val("");
		$(this).css("color", "#ffffff")
	}
});
$('#em_user').blur(function () {
	if ($(this).val() == "") {
		$(this).val(em_user_value);
		$(this).css("color", "#bbbbbb")
	}
});
$('#em_pass').focus(function () {
	if ($(this).val() == em_pass_value) {
		$(this).val("");
		$(this).css("color", "#ffffff")
	}
});
$('#em_pass').blur(function () {
	if ($(this).val() == "") {
		$(this).val(em_pass_value);
		$(this).css("color", "#bbbbbb")
	}
});
function pageLoaded() {}
function emConnect() {
	$('#emForm').submit()
}
function showSmileys() {
	$('#smiley').show(500);
	$('#colors').hide(200);
}
function showColors() {
	$('#colors').show(500);
	$('#smiley').hide(200);
}
function objectVote(objectId, objectType, showVoted) {
	if(typeof(showVoted) == 'undefined') {
    showVoted = true;
  }
  $.post("ajax.php", {
		id: objectId,
		type: objectType
	}, function(data) {
		$("#vbtn_" + objectId).html(data);
    if(showVoted) {
      $("#tbtn_" + objectId).html("a vot&eacute;")
    }
	})
}
function changePage(a, b, c) {
	page = $(a).val();
	if (!page) page = '1';
	window.location.href = b + c + page
}

var menuTimer;

function menuHide() {
  $('#jeux_cadre').hide();
  clearTimeout(menuTimer);
}

$(document).ready(function() {
  $('.menu .jeux a').bind('mouseover', function() {
    $('#jeux_cadre').show();
    clearTimeout(menuTimer);
  });
  $('#jeux_cadre').bind('mouseover', function() {
    $('#jeux_cadre').show();
    clearTimeout(menuTimer);
  });
  $('.menu .jeux a').bind('mouseout', function() {
    clearTimeout(menuTimer);
    menuTimer = setTimeout(menuHide, 1000);
  });
  $('#jeux_cadre').bind('mouseout', function() {
    clearTimeout(menuTimer);
    menuTimer = setTimeout(menuHide, 1000);
  });
});
