var path_login = base_url+"login";

$(document).ready(function () {
	$.sifr({ path: base_url+'js/fuentes/', save: true });
	$('h1').sifr({font: 'antennacond-medium', roY: 6.5}); 
	$('h2').sifr({font: 'antennacond-medium', roY: 6.5}); 
	$('h3').sifr({font: 'antennacond-mediumitalic', roY: 6.5});
	$('h4').sifr({font: 'antennacond-medium', roY: 6.5});
	showmenu();
	$(document).pngFix();
	$("#loginCliente").dialog({
		bgiframe: true,
		height: 250,
		width: 400,
		autoOpen: false,
		modal: true,
		buttons: {
			'Entrar': function() {
					getCliente();
			},
			'Cancelar': function() {
				$(this).dialog('close');
			}
		}
	});
	$("#help_banner img").attr("width","205");
	$("#help_banner img").attr("height","150");
});

function showmenu(){
	$("#nav li").hover(function(){
		$(this).find('ul:first').css({visibility:"visible", display:"none"}).show();
		}, function(){
		$(this).find('ul:first').css({visibility:"hidden"});
	});
};

function login_cliente(){
	$("#loginCliente").dialog('open');
}

function getCliente(){
	$("#validateTips").html("Espera un momento...");
	$.post(base_url+"login", { usuario: $("#c_user").val(), password: $("#c_password").val() },
	function(data){
		if(data!="1"){
			$("#validateTips").html("<b style='color: red;'>Usuario y/o password incorrectos</b>");
		}else{
			$("#loginCliente").dialog('close');
			window.location.reload();
		}
	});
}