<!--
function host(u){
return u;}
if(!desp)
var desp=false;
function Login(ref){
if($("#dvlogin").html()=='')
$("#dvlogin").load('/Servicios/login.aspx');
$('#hopc').val(ref);
return slide_effect("dvlogin",desp);}
function slide_effect(i,d){
if(d){
$('#hModAd').removeClass("u").addClass("d");
$("#"+i).animate({height:'0'},1000);}else{
$('#hModAd').removeClass("d").addClass("u");
$("#"+i).animate({height:'90px'},1000);}
desp=!desp;
return false;}
function SendLogin(){
var nick=$('#txtnick').val();
var pass=$('#txtpass').val();
var sesion="0";
if($('#chksesion:checked').val()=='on')
sesion="1";
var url='/ws/motos.asmx/Login?Nick='+nick+'&Pass='+pass+'&Sesion='+sesion;
cadena=getVal(url);
if(cadena!=''){
o=$('#spinfo');
switch(cadena){
case'0':
if($('#hopc').val()=='1')
window.location='/GTA/Default.aspx';
else
window.location.reload();
break;
case'1':
o.html('Email o Nick erroneo').addClass('error');
return false;
break;
case'2':
o.html('Contraseña erronea').addClass('error');
return false;
break;
case'3':
o.html('Email o Nick erroneo').addClass('error');
return false;
break;
case'4':
o.html('Se ha producido un error').addClass('error');
return false;
break;}}}
function GetMenu(){
var indice=document.cookie.indexOf("idcnet")
if(indice>-1){
$("#recursive").fadeOut('slow',function(){
v=getVal('/ws/motos.asmx/GetMenu?seclogin='+leerCookie('seclogin'));
if(v!=''){
$('#recursive').html(v);
$('.nostyle_shown').show();
$('.nostyle_hidden').hide();
if($('#div_opina').size()>0){
usr=$(v.split('&')[0].replace('Hola ','')).find('b').text();
$('#ahModAd').hide();
$('#txtNombre').css('margin-right','116px').val(usr);
if(usr==''){
t='No dispones de nick. Escribe un nick como tu nombre de usuario público.';
$('#txtNombre').attr('rel','1').val(t).addClass('small_info').click(function(){
if($(this).val()==t)$(this).val('').removeClass('small_info');});}
else
$('#txtNombre').attr('disabled',true);}}
$("#recursive").fadeIn('slow');});}else{
$('.nostyle_shown').hide();
$('.nostyle_hidden').show();}}
function leerCookie(nombre){
var g=document.cookie;
var indice=g.indexOf(nombre)
if(indice>-1){
a=g.substring(g.indexOf(nombre+'=')+nombre.length+1,g.length);
if(a.indexOf(';')!=-1)a=a.substring(0,a.indexOf(';'))
return a;}else
return'';}
function CloseSes(){
getVal('/ws/motos.asmx/CloseSession?a=a');
window.location.reload();}
function getVal(url){
$.ajax({
url:url+"&ord="+Math.random()*10000000000000000,
async:false,
success:function(xml){
s=$(xml).find('string').text();},
error:function(){s='';}});
return s;}
function retValidate(e,btn){
var code;
if(document.all)code=event.keyCode;
else code=e.keyCode;
if(code==13){$("#"+btn).click();return false;}
else return true;}
var Pref='_ctl0_ContentPlaceHolder1_';
function ValidarPassword(Tipo){
if(Tipo=='N')
{
return validar('N');}
else
{
return validar('O');}}
function validar(Tipo)
{
var ret=true
if(Tipo=='N')
{
if(isMail(document.getElementById(Pref+'EMailVN').value))
{
document.getElementById(Pref+'lblEmailVN').className="black"}
else
{
document.getElementById(Pref+'EMailVN').value='';
document.getElementById(Pref+'EMailVN').focus();
document.getElementById(Pref+'lblEmailVN').className="notval_inline"
return false}
if(isText(document.getElementById(Pref+'EMailVN').value))
{
document.getElementById(Pref+'lblEmailVN').className="black"}
else
{
document.getElementById(Pref+'EMailVN').value='';
document.getElementById(Pref+'EMailVN').focus();
document.getElementById(Pref+'lblEmailVN').className="notval_inline"
ret=false}
if(isText(document.getElementById(Pref+'PasswordVN').value))
{
document.getElementById(Pref+'lblContrasenyaVN').className="black"}
else
{
document.getElementById(Pref+'PasswordVN').value='';
document.getElementById(Pref+'PasswordVN').focus();
document.getElementById(Pref+'lblContrasenyaVN').className="notval_inline"
ret=false}}
else
{
if(isMail(document.getElementById(Pref+'EmailVO').value))
{
document.getElementById(Pref+'lblEmailVO').className="black"}
else
{
document.getElementById(Pref+'EmailVO').value='';
document.getElementById(Pref+'EmailVO').focus();
document.getElementById(Pref+'lblEmailVO').className="notval_inline"
return false}
if(isText(document.getElementById(Pref+'EmailVO').value))
{
document.getElementById(Pref+'lblEmailVO').className="black"}
else
{
document.getElementById(Pref+'EmailVO').value='';
document.getElementById(Pref+'EmailVO').focus();
document.getElementById(Pref+'lblEmailVO').className="notval_inline"
ret=false}
if(isText(document.getElementById(Pref+'PasswordVO').value))
{
document.getElementById(Pref+'lblContrasenyaVO').className="black"}
else
{
document.getElementById(Pref+'PasswordVO').value='';
document.getElementById(Pref+'PasswordVO').focus();
document.getElementById(Pref+'lblContrasenyaVO').className="notval_inline"
ret=false}}
return ret}
function isText(strString)
{
var strInvalidChars="<>'";
var strChar;
var blnResult=true;
for(i=0;i<strString.length&&blnResult==true;i++)
{
strChar=strString.charAt(i);
if(strInvalidChars.indexOf(strChar)!=-1)
{
blnResult=false;}}
return blnResult;}
function isMail(cadena){
myRe=new RegExp("^[a-zA-Z0-9\-._]{1,50}@[a-zA-Z0-9\-_.]{1,100}.[a-zA-Z]{2,4}(|.[a-zA-Z]{2,3})$");
return myRe.test(cadena);}
//--->