function getId(id){







    return document.getElementById(id);







}























// la ficha







function ventanaFicha( fichaID ){







  window.location = './ficha5345432.php?id=' + fichaID;















}















function abrirPopup(pagina,titulo, alto, ancho)







{







window.open(pagina,titulo,'width='+ancho+',height='+alto+',menubar=no,scrollbars=no,toolbar=no,location=yes,directories=yes,resizable=no,top=0,left=0');







}















// focus y blur en formularios







function camposFocus( inputID )







{







 getId( inputID ).style.backgroundColor = "#555555";







 getId( inputID ).style.color = "#000000";







}







function camposBlur( inputID )







{







 getId( inputID ).style.backgroundColor = "#111111";







 getId( inputID ).style.color = "#ffffff";







}























function agregarFavoritos()







{







  if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4))







    window.external.AddFavorite('www.elsilencio.cl','ElSilencio.cl | escorts, agencias, anfitrionas, acompañantes, masajes, nightclubs, sexshops, y sexualidad en Chile');







  else







    window.sidebar.addPanel('ElSilencio.cl | escorts, agencias, anfitrionas, acompañantes, masajes, nightclubs, sexshops, y sexualidad en Chile','http://www.elsilencio.cl','');















}







// validar de formulario







function validarFormulario( tipo ){







 var errores = false;







 var txtError = "";















 var ficha_formulario_Nombre, ficha_formulario_Amigo, ficha_formulario_Email;















 switch( tipo )







 {







 case 'r' : // recomendar







     ficha_formulario_Nombre = getId( 'ficha_formulario_NombreRecomienda' ).value.replace( /\s/g, '' );







     ficha_formulario_Amigo = getId( 'ficha_formulario_AmigoRecomienda' ).value.replace( /\s/g, '' );







     ficha_formulario_Email = getId( 'ficha_formulario_EmailRecomienda' ).value.replace( /\s/g, '' );







     break;







 case 'e' : // email







     ficha_formulario_Nombre = getId( 'ficha_formulario_NombreEmail' ).value.replace( /\s/g, '' );







     ficha_formulario_Email = getId( 'ficha_formulario_EmailEmail' ).value.replace( /\s/g, '' );







     break;







 }















 if( !ficha_formulario_Nombre ){







 errores = true;







 txtError += "\n- Ingrese su nombre";







 }







 if( !ficha_formulario_Amigo && tipo == 'r' ){







 errores = true;







 txtError += "\n- Ingrese el nombre de su contacto";







 }







 if( !ficha_formulario_Email ){







 errores = true;







 if( tipo == 'r' ){







 txtError += "\n- Ingrese el email de tu contacto";







 } else {







 txtError += "\n- Ingrese su email";







 }







 } else {







 if( ficha_formulario_Email.indexOf('@') < 1 ||







 ficha_formulario_Email.indexOf('.') < 1 ||







 ficha_formulario_Email.indexOf('@') > ficha_formulario_Email.length - 6 ||







 ficha_formulario_Email.indexOf('@') != ficha_formulario_Email.lastIndexOf('@') ||







 ficha_formulario_Email.lastIndexOf('.') == ficha_formulario_Email.length - 1 ||







 ficha_formulario_Email.lastIndexOf('.') < ficha_formulario_Email.indexOf('@') ){







 errores = true;







 txtError += "\n- Ingrese un email válido";







 }







 }















 if( errores ){ alert( txtError ); }







 else {







 switch( tipo ){







 case 'r' : document.formularioChicaRecomienda.submit(); break;







 case 'e' : document.formularioChicaEmail.submit(); break;























 }







 }







}























function MM_preloadImages() { //v3.0







 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();







 var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)







 if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}







}















function MM_swapImgRestore() { //v3.0







 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;







}















function MM_findObj(n, d) { //v4.01







 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {







 d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}







 if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];







 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);







 if(!x && d.getElementById) x=d.getElementById(n); return x;







}















function MM_swapImage() { //v3.0







 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)







 if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}







}























function ocultarFondoFormulario(){







 getId( 'fondoNegro' ).style.display = 'none';







 getId( 'formularioChicaRecomienda' ).style.display = 'none';







 getId( 'formularioChicaEmail' ).style.display = 'none';







 getId( 'vervideo' ).style.display = 'none';















}















// mostrar fondo







function mostrarFondoFormulario(tipo){







 ocultarFondoFormulario();







 getId( 'fondoNegro' ).style.display = 'block';







 switch( tipo ){







    case 'e' : getId( 'formularioChicaEmail' ).style.display = 'block'; break;







    case 'r' : getId( 'formularioChicaRecomienda' ).style.display = 'block'; break;







    case 'v' : getId( 'vervideo' ).style.display = 'block'; break;







 }







}























function ocultarBuscador( evt ){







	var objectFrom;















	if( evt != 1 && evt.srcElement && evt.srcElement.id ){//ie







		objectFrom = evt.srcElement.id;







	}







	if( evt != 1 && evt.target && evt.target.id ){//mf







		objectFrom = evt.target.id;







	}















	if( objectFrom != 'BuscadorChicaAvanzado' && objectFrom != 'ListaChicas' ){







		getId( 'divImagenPortadaBuscador' ).style.display='none';







		getId( 'ListaChicas' ).style.display = 'none';







		getId( 'BuscadorChicaAvanzado' ).blur();







		// Volvemos a mostrar todos los nombres







		for( ChicaBuscador in arregloChicas ){







		    if(getId( 'ChicaBuscador' + arregloChicas[ ChicaBuscador ][ 1 ] )!=null)







			getId( 'ChicaBuscador' + arregloChicas[ ChicaBuscador ][ 1 ] ).style.display = 'block';







		}







	}







}















// lista chicas







function mostrarChicas(){







	getId( 'ListaChicas' ).style.display = 'block';







}















// filtrar lista







function filtrarChicas(){







	tecladoNombre = getId( 'BuscadorChicaAvanzado' ).value;







	tecladoNombre = tecladoNombre.toLowerCase();























	if( tecladoNombre.length > 0 ){







		for( ChicaBuscador in arregloChicas ){







			if( arregloChicas[ ChicaBuscador ][ 0 ].indexOf( tecladoNombre ) < 0 ){







			    //alert(arregloChicas[ ChicaBuscador ][ 0 ].indexOf( tecladoNombre ));







				getId( 'ChicaBuscador' + arregloChicas[ ChicaBuscador ][ 1 ] ).style.display = 'none';







			} else {







				getId( 'ChicaBuscador' + arregloChicas[ ChicaBuscador ][ 1 ] ).style.display = 'block';







			}







		}







	} else {







		for( ChicaBuscador in arregloChicas ){







			getId( 'ChicaBuscador' + arregloChicas[ ChicaBuscador ][ 1 ] ).style.display = 'block';







		}







	}







}















// foto chica







function mostrarPortadaChica( evt, urlImagen ){







	if( evt.pageX ){ // Mozilla







		imgX = evt.pageX + 16;







		imgY = evt.pageY;







	} else if( evt.clientX ){ // IE







		imgX = evt.clientX + 16 + document.body.parentNode.scrollLeft;







		imgY = evt.clientY + document.body.parentNode.scrollTop;







	}







	getId( 'ImagenChicaBuscador' ).src = urlImagen;







	with( getId( 'divImagenPortadaBuscador' ) ){







		style.display = 'block';







		style.left = imgX + 'px';







		style.top = imgY + 'px';







	}







}















// foto chica





function mostrarPortadaChicaInicio( evt, urlImagen ){







	if( evt.pageX ){ // Mozilla







		imgX = evt.pageX;







		imgY = evt.pageY;







	} else if( evt.clientX ){ // IE







		imgX = evt.clientX + document.body.parentNode.scrollLeft;







		imgY = evt.clientY + document.body.parentNode.scrollTop;







	}







	getId( 'ImagenChicaBuscador' ).src = urlImagen;







	with( getId( 'divImagenPortadaBuscador' ) ){







		style.display = 'block';







		style.left = imgX -107 + 'px';







		style.top = imgY - 140 + 'px';







	}







}















 function navActivacion(id, nav)







{







  $('.'+nav).removeClass("activo");







  var arrElmt = document.getElementsByName(id);







  $(arrElmt).addClass("activo");







}









function getImagenhidd(id)







{







  if(id!=null && id!='')







  {







    if(document.getElementById('hid_img'+id) != null)







        return document.getElementById('hid_img'+id).value;







  }















}























function validar_publicate()







{







    if(getId( 'req_nombre' ).value == '')







    {







       alert('Ingrese su nombre');







       return false;







    }







    if(getId( 'req_ciudad' ).value == '')







    {







       alert('Ingrese una ciudad');







       return false;







    }







    if(getId( 'req_fono' ).value == '')







    {







       alert('Ingrese su telefono de contacto');







       return false;







    }







    if(getId( 'req_mail' ).value == '')







    {







       alert('Ingrese su e-mail de contacto');







       return false;







    }















    form_conc =document.getElementById('form_publicate');







    form_conc.submit();























}















function validar_recomiendanos()







{







    if(getId( 'nombre' ).value == '')







    {







       alert('Ingrese su nombre');







       return false;







    }







    if(getId( 'nombre_amigo' ).value == '')







    {







       alert('Ingrese el nombre de su amigo');







       return false;







    }







    if(getId( 'mail' ).value == '')







    {







       alert('Ingrese el correo de su amigo');







       return false;







    }















    form_conc =document.getElementById('form_recomiendanos');







    form_conc.submit();























}















function validar_reclamos()







{







    if(getId( 'nombre' ).value == '')







    {







       alert('Ingrese su nombre');







       return false;







    }







    if( !getId( 'radio1' ).checked && !getId( 'radio2' ).checked && !getId( 'radio3' ).checked)







    {







       alert('Elija un tema');







       return false;







    }







    if(getId( 'radio3' ).checked && getId( 'otro_tema' ).value == '')







    {







       alert('Ingrese el tema del reclamo');







       return false;







    }







    if(getId( 'email' ).value == '')







    {







       alert('Ingrese su correo de contacto');







       return false;







    }















    if(getId( 'capital' ).value.toLowerCase() != "santiago" )







    {







       alert('Capital de Chile erronea ');







       return false;







    }







    if(getId('comentario').value == '' || getId('comentario').value == ' ' )







    {







       alert('Ingrese su comentario');







       return false;







    }















    form_conc =document.getElementById('form_reclamos');







    form_conc.submit();























}















function validar_contacto()







{







    if(getId( 'nombre' ).value == '')







    {







       alert('Ingrese su nombre');







       return false;







    }







    if( !getId( 'radio1' ).checked && !getId( 'radio2' ).checked && !getId( 'radio3' ).checked)







    {







       alert('Elija un tema');







       return false;







    }







    if(getId( 'radio3' ).checked && getId( 'otro_tema' ).value == '')







    {







       alert('Ingrese el tema del reclamo');







       return false;







    }







    if(getId( 'email' ).value == '')







    {







       alert('Ingrese su correo de contacto');







       return false;







    }















    if(getId( 'capital' ).value.toLowerCase() != "santiago" )







    {







       alert('Capital de Chile erronea ');







       return false;







    }







    if(getId('comentario').value == '' || getId('comentario').value == ' ' )







    {







       alert('Ingrese su comentario');







       return false;







    }















    form_conc =document.getElementById('form_contactenos');







    form_conc.submit();























}















function validarConcurso(){















    var corr=document.getElementsByName('correo[]');







    for(var i=0;i<corr.length;i++)







    {







      if(corr[i].value == '')







      {







        alert('Por favor ingresa los correos para poder participar');







        return false;







      }







    }















    var text=document.getElementsByName('texto[]');







    for(var i=0;i<text.length;i++)







    {







      if(text[i].value == '' || text[i].value == ' ')







      {







        alert('Por favor ingresa tu nombre para poder participar');







        return false;







      }







    }















    var rut=document.getElementsByName('rut[]');







    for(var i=0;i<rut.length;i++)







    {







      if(rut[i].value == '')







      {







        alert('Por favor ingresa tu Run para poder participar');







        return false;







      }







    }















    var telefono=document.getElementsByName('numero[]');







    for(var i=0;i<telefono.length;i++)







    {







      if(telefono[i].value == '')







      {







        alert('Por favor ingresa tu numero de telefono para poder participar');







        return false;







      }







    }















    var mayor = document.getElementById('checkbox');







    if(!mayor.checked)







    {







        alert('Debes ser mayor de edad para poder participar');







        return false;







      }















    form_conc =document.getElementById('form_concurso');







    form_conc.submit();







}


