function TrimString(sInString) {
  sInString = sInString.replace( /^\s+/g, "" );// strip leading
  return sInString.replace( /\s+$/g, "" );// strip trailing
}
//Efectos de Prototype...
Effect.OpenUp = function(element) {
  element = $(element);
  new Effect.BlindDown(element, arguments[1] || {});
};

Effect.CloseDown = function(element) {
  element = $(element);
  new Effect.BlindUp(element, arguments[1] || {});
};
Effect.Combo = function(element) {
 element = $(element);
 if(element.style.display == 'none') {
 //MOSTRAR ELEMENTO : EL BOTON ES CERRAR AHORA
 //$('_imagen_cuenta').src = 'images/es/btn_cerrar.gif';

 //Effect.OpenUp(element, arguments[1] || {});
 }
 else {
 //$('_imagen_cuenta').src = 'images/es/btn_cuenta.gif';
 //Effect.CloseDown(element, arguments[1] || {});
 }
}
function hacerLogin() {
  Dialog.confirm($('login').innerHTML, {windowParameters: {className:"alphacube", width:400}, 
  okLabel: "Send", cancelLabel: "Close",
  ok:function(win){
  	var url = 'ajax/login.php';
	var opt = {
     method: 'post',
     postBody: 'usuario='+escape($('usuario').value)+'&password='+escape($('password').value),
     onSuccess: function(t) {     	     	
     	respuesta = t.responseText.split('|');
     	
     	if (TrimString(respuesta[0])=='OK') {
     		$(Windows.focusedWindow.getId()).innerHTML = 'Login OK,<a href="profesionales.php">continuing to proffessional zone</a>';
     		window.location = 'profesionales.php';
     		
     		return false;
     	} else {
     		$('login_error_msg').innerHTML='Login or password not valid...'+respuesta[1];
    		$('login_error_msg').show(); 
    		Dialog.win.updateHeight();
    		new Effect.Shake(Windows.focusedWindow.getId());
    		return false;
     	}
    },
    onFailure: function(t) {
        $('login_error_msg').innerHTML='Login error...contact administrator!';
    	$('login_error_msg').show(); 
    	Dialog.win.updateHeight();
    	new Effect.Shake(Windows.focusedWindow.getId());
    	return false;
     }
	};
	
	new Ajax.Request(url, opt);
  }
 });
    
}