function eliminarComentario(comentario_id, section){ if(confirm("¿Estás seguro de eliminar el comentario?")){ var url = "/sections/"+section+"/"+section+"DelComment.php?comment_id="+comentario_id; location.href = url; } } function match_comments(pag, partido_id, comment) { var comments = document.getElementById('comments'); var ajax=nuevoAjax(); ajax.open("GET", "/sections/partido/ajax.partidoComments.php?pag="+pag+"&partido_id="+partido_id+"&comment_id="+comment+"&ms="+new Date().getTime(), true); ajax.onreadystatechange=function() { if (ajax.readyState==1){ comments.innerHTML = "

Cargando comentarios
"; } if (ajax.readyState==4) { comments.innerHTML = ajax.responseText; } }; ajax.send(null); } function contactoOtroMotivo(valor){ if(valor=='OTRO'){ document.getElementById('otro_motivo').style.display='block'; document.getElementById('otro_motivo2').style.display='block'; }else{ document.getElementById('otro_motivo').style.display='none'; document.getElementById('otro_motivo2').style.display='none'; } } function verificaContacto() { contacto_email = document.contactar.contacto_email.value; if(document.contactar.contacto_email.value.length==0){ alert("Debés incluir tu dirección de e-mail"); document.contactar.contacto_email.focus(); return false; } if(!is_mail(contacto_email)) { alert(contacto_email+" no es una dirección de e-mail válida"); document.contactar.contacto_email.focus(); return false; } if(document.contactar.contacto_con.value==0){ alert("Por favor, seleccioná el motivo"); return false; } if(document.contactar.contacto_con.value=='OTRO'){ if(document.contactar.contacto_asunto.value.length==0){ alert("Por favor, especificá el motivo"); document.contactar.contacto_asunto.focus(); return false; }else {document.contactar.contacto_subject.value=document.contactar.contacto_asunto.value;} }else { document.contactar.contacto_subject.value=document.contactar.contacto_con.options[document.contactar.contacto_con.selectedIndex].text; } if(document.contactar.contacto_mensaje.value==""){ alert("Por favor, especificá el mensaje"); document.contactar.contacto_mensaje.focus(); return false; } return true; } function desplegar(categoria){ var menu = document.getElementById(categoria); var menu2 = document.getElementById('aniversarios2'); if(menu2.style.display == "none"){ menu.style.display = "none"; menu2.style.display = "block"; } else{ menu.style.display = "block"; menu2.style.display = "none"; } } function abrir(categoria){ var menu = document.getElementById(categoria); var check_mismo_repre = document.getElementById('check_mismo_repre'); if(menu.style.display == 'none'){ menu.style.display = 'block'; check_mismo_repre.value = "on"; } else{ menu.style.display = 'none'; check_mismo_repre.value = "off"; } } function abrircerrar(segunda, primera){ var segundas = document.getElementById(segunda); var primeras = document.getElementById(primera); if(segundas.style.display == 'none'){ segundas.style.display = 'block'; primeras.style.display='none'; } else{ segundas.style.display = 'none'; primeras.style.display='block'; } } function DenunciarComentarioPartidoCampeonato(COMMENT_ID){ var ajax=nuevoAjax(); document.getElementById('link_denuncia'+COMMENT_ID).style.display='none'; document.getElementById('denuncia'+COMMENT_ID).style.display='block'; ajax.open("GET", "/sections/campeonato/campeonatoDenunciarcommentrun.php?comment_id="+COMMENT_ID, true); ajax.send(null); } function AbonoNoDisponible(ABONO_ID){ if(confirm("¿Estás seguro de marcar como vendido/adquirido?")){ location.href="/sections/entradas/entradas-vendidorun.php?abono_id="+ABONO_ID; } } function DenunciarComentarioFoto(COMMENT_ID){ var ajax=nuevoAjax(); document.getElementById('link_denuncia'+COMMENT_ID).style.display='none'; document.getElementById('denuncia'+COMMENT_ID).style.display='block'; ajax.open("GET", "/sections/gallery/galleryDenounceCommentRun.php?comment_id="+COMMENT_ID, true); ajax.send(null); } function eliminarVideo(VIDEO_ID,VIDEO_URL){ if(confirm("¿Estás seguro de que querés eliminar este video?")) { location.href="/sections/videos/videos-delvideo.php?video_id="+VIDEO_ID+"&video_url="+VIDEO_URL; } } function denunciarComentarioVideo(COMMENT_ID){ var ajax=nuevoAjax(); document.getElementById('link_denuncia'+COMMENT_ID).style.display='none'; document.getElementById('denuncia'+COMMENT_ID).style.display='block'; ajax.open("GET", "/sections/videos/videos-denunciarcommentrun.php?comment_id="+COMMENT_ID, true); ajax.send(null); } function denunciarFoto() { document.getElementById('link_denuncia').style.visibility="hidden"; document.getElementById('denuncia').style.display='block'; } function denunciarFotoRun(FOTO_ID) { var radio_choice = false; var ajax=nuevoAjax(); for (counter = 0; counter < document.forms['FormDenuncia'].denuncia_motivo.length; counter++){ if (document.forms['FormDenuncia'].denuncia_motivo[counter].checked){ if(document.forms['FormDenuncia'].denuncia_motivo[counter].value=="OTRO"){ if(document.forms['FormDenuncia'].denuncia_motivo_texto.value==""){ alert("Por favor, indicá un motivo"); }else{ motivo = document.forms['FormDenuncia'].denuncia_motivo_texto.value; } }else{ motivo = document.forms['FormDenuncia'].denuncia_motivo[counter].value; } radio_choice = true; } } if(!radio_choice){ alert("Por favor, indicá un motivo"); }else{ ajax.open("GET", "/sections/gallery/galleryDenouncePhotoRun.php?foto_id="+FOTO_ID+"&motivo="+motivo, true); ajax.send(null); document.getElementById('denuncia').style.display="none"; document.getElementById('denuncia_recibida').style.display="block"; } return false; } function cancelarDenunciarFoto() { document.getElementById('link_denuncia').style.visibility="visible"; document.getElementById('denuncia').style.display='none'; } function eliminarFoto(FOTO_ID,FOTO_URL){ if(confirm("¿Estás seguro de que querés eliminar esta fotografía?")) { location.href="/sections/gallery/galleryDelPhoto.php?foto_id="+FOTO_ID+"&foto_url="+FOTO_URL; } } function denunciarVideo() { document.getElementById('link_denuncia').style.display="none"; document.getElementById('denuncia').style.display='block'; } function denunciarVideoRun(VIDEO_ID) { var radio_choice = false; var ajax=nuevoAjax(); for (counter = 0; counter < document.forms['FormDenuncia'].denuncia_motivo.length; counter++){ if (document.forms['FormDenuncia'].denuncia_motivo[counter].checked){ if(document.forms['FormDenuncia'].denuncia_motivo[counter].value=="OTRO"){ if(document.forms['FormDenuncia'].denuncia_motivo_texto.value==""){ alert("Por favor, indicá un motivo"); }else{ motivo = document.forms['FormDenuncia'].denuncia_motivo_texto.value; } }else{ motivo = document.forms['FormDenuncia'].denuncia_motivo[counter].value; } radio_choice = true; } } if(!radio_choice){ alert("Por favor, indicá un motivo"); }else{ ajax.open("GET", "/sections/videos/videos-denunciarvideorun.php?video_id="+VIDEO_ID+"&motivo="+motivo, true); ajax.send(null); document.getElementById('denuncia').style.display="none"; document.getElementById('denuncia_recibida').style.display="block"; } return false; } function cancelarDenunciarVideo() { document.getElementById('link_denuncia').style.display="block"; document.getElementById('denuncia').style.display='none'; } function DenunciarPost(POST_ID){ document.getElementById('link_denuncia'+POST_ID).style.visibility="hidden"; document.getElementById('denuncia'+POST_ID).style.display='block'; } function CancelarDenunciarPost(POST_ID){ document.getElementById('link_denuncia'+POST_ID).style.visibility="visible"; document.getElementById('denuncia'+POST_ID).style.display='none'; } function denunciarHilo (POST_ID) { document.getElementById('otroHilo'+POST_ID).style.display='inline'; document.getElementById('otroMotivo'+POST_ID).style.display='none'; } function denunciarMotivo (POST_ID) { document.getElementById('otroHilo'+POST_ID).style.display='none'; document.getElementById('otroMotivo'+POST_ID).style.display='inline'; } function denunciarGeneral (POST_ID) { document.getElementById('otroHilo'+POST_ID).style.display='none'; document.getElementById('otroMotivo'+POST_ID).style.display='none'; } function DenunciarPostRun(POST_ID){ var radio_choice = false; var ajax=nuevoAjax(); var fname='FormDenuncia'+POST_ID; var total=document.forms[fname].denuncia_motivo.length; for (counter = 0; counter < total; counter++){ if (document.forms[fname].denuncia_motivo[counter].checked){ if(document.forms[fname].denuncia_motivo[counter].value=="REPETIDO"){ if(document.forms[fname].denuncia_hilo_texto.value==""){ alert("Especificá el motivo"); }else{ motivo = document.forms[fname].denuncia_hilo_texto.value; } }else if(document.forms[fname].denuncia_motivo[counter].value=="OTRO"){ if(document.forms[fname].denuncia_motivo_texto.value==""){ alert("Especificá el motivo"); }else{ motivo = document.forms[fname].denuncia_motivo_texto.value; } }else{ motivo = document.forms[fname].denuncia_motivo[counter].value; } radio_choice = true; } } if(!radio_choice){ alert("Por favor, indicá un motivo"); }else{ ajax.open("GET", "/sections/foro/foro-denunciarpostrun.php?post_id="+POST_ID+"&motivo="+motivo, true); ajax.send(null); document.getElementById('denuncia'+POST_ID).style.display="none"; document.getElementById('denuncia_recibida'+POST_ID).style.display="block"; } return false; } function obre_s(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width=800,height=600');"); } function error(){ alert("El usuario o la contraseña son incorrectos"); window.location.href="/"; } function changeOptionPost(form){ if(form.u.checked){ form.u.checked=0; form.d.checked=1; } } function changeOptionUser(form){ if(form.d.checked){ form.d.checked=0; form.u.checked=1; } } /*Alta de usuario*/ function disableEnterKey(e) { var key; if(window.event){ key = window.event.keyCode; //IE }else{ key = e.which; //firefox } if(key == 13){ return false; }else{ return true; } } function unquote (my_string) { var new_string = String (my_string); nRegClose=/\[\/quote\]/g; nRegOpen =/\[quote=/g; nRegOpenDiv = /\]/g; new_string = new_string.replace (nRegClose, ""); new_string = new_string.replace (nRegOpen, "

"); new_string = new_string.replace (nRegOpenDiv, " escribió:

"); return ""+new_string+""; } function nuevoAjax() { /* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por lo que se puede copiar tal como esta aqui */ var obj; if(window.XMLHttpRequest){ obj = new XMLHttpRequest(); } else if(window.ActiveXObject) { obj = new ActiveXObject("Microsoft.XMLHTTP"); } return obj; } // Declaro los selects que componen el documento HTML. Su atributo ID debe figurar aqui. var listadoSelects=new Array(); listadoSelects[0]="paises"; listadoSelects[1]="estados"; var listadoSelectsPartidos=new Array(); listadoSelectsPartidos[0]="temporada_id"; listadoSelectsPartidos[1]="partido_id"; var listadoSelectsAlbumes=new Array(); listadoSelectsAlbumes[0]="album"; listadoSelectsAlbumes[1]="subalbum1"; listadoSelectsAlbumes[2]="subalbum2"; listadoSelectsAlbumes[3]="subalbum3"; listadoSelectsAlbumes[4]="subalbum4"; listadoSelectsAlbumes[5]="subalbum5"; function buscarEnArray(array, dato) { // Retorna el indice de la posicion donde se encuentra el elemento en el array o null si no se encuentra var x=0; while(array[x]) { if(array[x]==dato){return x;} x++; } return null; } function cargaContenido(idSelectOrigen) { // Obtengo la posicion que ocupa el select que debe ser cargado en el array declarado mas arriba var posicionSelectDestino=buscarEnArray(listadoSelects, idSelectOrigen)+1; // Obtengo el select que el usuario modifico var selectOrigen=document.getElementById(idSelectOrigen); // Obtengo la opcion que el usuario selecciono var opcionSeleccionada=selectOrigen.options[selectOrigen.selectedIndex].value; if(opcionSeleccionada==0) { var x=posicionSelectDestino, selectActual=null; // Busco todos los selects siguientes al que inicio el evento onChange y les cambio el estado y deshabilito while(listadoSelects[x]) { selectActual=document.getElementById(listadoSelects[x]); selectActual.length=0; var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="Seleccionar opción..."; selectActual.appendChild(nuevaOpcion); selectActual.disabled=true; x++; } } // Compruebo que el select modificado no sea el ultimo de la cadena else if(idSelectOrigen!=listadoSelects[listadoSelects.length-1]) { // Obtengo el elemento del select que debo cargar var idSelectDestino=listadoSelects[posicionSelectDestino]; var selectDestino=document.getElementById(idSelectDestino); // Creo el nuevo objeto AJAX y envio al servidor el ID del select a cargar y la opcion seleccionada del select origen var ajax=nuevoAjax(); ajax.open("GET", "/sections/ajax.provincias.php?select="+idSelectDestino+"&opcion="+opcionSeleccionada, true); ajax.onreadystatechange=function() { if (ajax.readyState==1) { // Mientras carga elimino la opcion "Selecciona Opcion..." y pongo una que dice "Cargando..." selectDestino.length=0; var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="Seleccionar opción..."; selectDestino.appendChild(nuevaOpcion); selectDestino.disabled=true; } if (ajax.readyState==4) { selectDestino.parentNode.innerHTML=ajax.responseText; } }; ajax.send(null); } } function cargaPartidos(idSelectOrigen) { // Obtengo la posicion que ocupa el select que debe ser cargado en el array declarado mas arriba var posicionSelectDestino=buscarEnArray(listadoSelectsPartidos, idSelectOrigen)+1; // Obtengo el select que el usuario modifico var selectOrigen=document.getElementById(idSelectOrigen); // Obtengo la opcion que el usuario selecciono var opcionSeleccionada=selectOrigen.options[selectOrigen.selectedIndex].value; // Si el usuario eligio la opcion "Elige", no voy al servidor y pongo los selects siguientes en estado "Selecciona opcion..." if(opcionSeleccionada==0) { var x=posicionSelectDestino, selectActual=null; // Busco todos los selects siguientes al que inicio el evento onChange y les cambio el estado y deshabilito while(listadoSelectsPartidos[x]) { selectActual=document.getElementById(listadoSelectsPartidos[x]); selectActual.length=0; var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="Seleccionar opción..."; selectActual.appendChild(nuevaOpcion); selectActual.disabled=true; x++; } } // Compruebo que el select modificado no sea el ultimo de la cadena else if(idSelectOrigen!=listadoSelectsPartidos[listadoSelectsPartidos.length-1]) { // Obtengo el elemento del select que debo cargar var idSelectDestino=listadoSelectsPartidos[posicionSelectDestino]; var selectDestino=document.getElementById(idSelectDestino); // Creo el nuevo objeto AJAX y envio al servidor el ID del select a cargar y la opcion seleccionada del select origen var ajax=nuevoAjax(); ajax.open("GET", "/sections/ajax.partidos.php?select="+idSelectDestino+"&opcion="+opcionSeleccionada, true); ajax.onreadystatechange=function() { if (ajax.readyState==1) { // Mientras carga elimino la opcion "Selecciona Opcion..." y pongo una que dice "Cargando..." selectDestino.length=0; var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="Seleccionar opción..."; selectDestino.appendChild(nuevaOpcion); selectDestino.disabled=true; } if (ajax.readyState==4) { selectDestino.parentNode.innerHTML=ajax.responseText; } }; ajax.send(null); } } function cargaPartidosTemporada() { var myPartidos = document.getElementById('hola'); idTemporada = document.getElementById('temporada_id').value; var ajax=nuevoAjax(); ajax.open("GET", "/sections/ajax.partidos.php?id_temp="+idTemporada, true); ajax.onreadystatechange=function() { if (ajax.readyState==1) { myPartidos.innerHTML = "Seleccionar opción..."; } if (ajax.readyState==4) { myPartidos.innerHTML=ajax.responseText; } }; ajax.send(null); } function cargaJornadasTemporada(COMP_ID) { var myJornadas = document.getElementById('jornada'); idTemporada = document.getElementById('temporada_id').value; var ajax=nuevoAjax(); ajax.open("GET", "/sections/resultados/ajax.cargaJornadas.php?id_temp="+idTemporada+"&id_comp="+COMP_ID, true); ajax.onreadystatechange=function() { if (ajax.readyState==1) { myJornadas.innerHTML = "Seleccionar opción..."; } if (ajax.readyState==4) { myJornadas.innerHTML=ajax.responseText; } }; ajax.send(null); } function cargaJornadasTemporadaAgendaTV() { var myJornadas = document.getElementById('jornada'); idCompeticion = document.getElementById('competicion_id').value; var ajax=nuevoAjax(); ajax.open("GET", "/sections/agendagtv/ajax.cargaJornadas.php?id_comp="+idCompeticion, true); ajax.onreadystatechange=function() { if (ajax.readyState==1) { myJornadas.innerHTML = "Seleccionar opción..."; } if (ajax.readyState==4) { myJornadas.innerHTML=ajax.responseText; } }; ajax.send(null); } function cargaSubalbumes(idSelectOrigen) { // Obtengo la posicion que ocupa el select que debe ser cargado en el array declarado mas arriba var posicionSelectDestino=buscarEnArray(listadoSelectsAlbumes, idSelectOrigen)+1; // Obtengo el select que el usuario modifico var selectOrigen=document.getElementById(idSelectOrigen); // Obtengo la opcion que el usuario selecciono var opcionSeleccionada=selectOrigen.options[selectOrigen.selectedIndex].value; document.upload.album_id.value = opcionSeleccionada; // Si el usuario eligio la opcion "Elige", no voy al servidor y pongo los selects siguientes en estado "Selecciona opcion..." if(opcionSeleccionada==0) { var x=posicionSelectDestino, selectActual=null; trActual=null; // Busco todos los selects siguientes al que inicio el evento onChange y les cambio el estado y deshabilito while(listadoSelectsAlbumes[x]) { selectActual=document.getElementById(listadoSelectsAlbums[x]); selectActual.length=0; var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="Seleccionar opción..."; selectActual.appendChild(nuevaOpcion); selectActual.disabled=true; trActual=document.getElementById('tr_'+listadoSelectsAlbums[x]); trActual.style.display='none'; x++; } } // Compruebo que el select modificado no sea el ultimo de la cadena else if(idSelectOrigen!=listadoSelectsAlbumes[listadoSelectsAlbumes.length-1]) { // Obtengo el elemento del select que debo cargar var idSelectDestino=listadoSelectsAlbumes[posicionSelectDestino]; var selectDestino=document.getElementById(idSelectDestino); var trDestino=document.getElementById('tr_'+idSelectDestino); // Creo el nuevo objeto AJAX y envio al servidor el ID del select a cargar y la opcion seleccionada del select origen var ajax=nuevoAjax(); ajax.open("GET", "/sections/ajax.subalbumes.php?select="+idSelectDestino+"&opcion="+opcionSeleccionada+"&ms="+new Date().getTime(), true); ajax.onreadystatechange=function() { if (ajax.readyState==1) { selectDestino.length=0; var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="Seleccionar opción..."; selectDestino.appendChild(nuevaOpcion); selectDestino.disabled=true; } if (ajax.readyState==4) { if(ajax.responseText!="none") { trDestino.style.display=''; x=posicionSelectDestino+1; while(listadoSelectsAlbumes[x]) { trDestino=document.getElementById('tr_'+listadoSelectsAlbumes[x]); trDestino.style.display='none'; x++; } selectDestino.parentNode.innerHTML=ajax.responseText; } else { trDestino.style.display='none'; x=posicionSelectDestino+1; while(listadoSelectsAlbumes[x]) { trDestino=document.getElementById('tr_'+listadoSelectsAlbumes[x]); trDestino.style.display='none'; x++; } } } }; ajax.send(null); } } function cargaTagsAlbum(albumId){ var tagsAlbum = document.getElementById('tagsAlbum'); var ajax = nuevoAjax(); var labelTags = document.getElementById('labelRecomendadas'); ajax.open("GET", "/sections/ajax.getAlbumTags.php?album_id="+albumId, true); ajax.onreadystatechange=function() { if (ajax.readyState==1) { tagsAlbum.innerHTML="Seleccionar opción..."; } if (ajax.readyState==4) { tagsAlbum.innerHTML=ajax.responseText; if(ajax.responseText==""){ labelTags.style.display="none"; }else{ labelTags.style.display="block"; } } }; ajax.send(null); } function addTag2Foto(tagId,tagValue){ var inputTags = document.upload.keywords; var tagLink = document.getElementById('tag'+tagId); inputTags.value = inputTags.value+" "+tagValue; tagLink.className="bgc10"; tagLink.innerHTML = tagValue; } function cargaSubalbumesVideo(idSelectOrigen) { var posicionSelectDestino=buscarEnArray(listadoSelectsAlbumes, idSelectOrigen)+1; var selectOrigen=document.getElementById(idSelectOrigen); var opcionSeleccionada=selectOrigen.options[selectOrigen.selectedIndex].value; document.upload.album_id.value = opcionSeleccionada; if(opcionSeleccionada==0) { var x=posicionSelectDestino, selectActual=null; trActual=null; while(listadoSelectsAlbumes[x]) { selectActual=document.getElementById(listadoSelectsAlbums[x]); selectActual.length=0; var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="Seleccionar opción..."; selectActual.appendChild(nuevaOpcion); selectActual.disabled=true; trActual=document.getElementById('tr_'+listadoSelectsAlbums[x]); trActual.style.display='none'; x++; } } // Compruebo que el select modificado no sea el ultimo de la cadena else if(idSelectOrigen!=listadoSelectsAlbumes[listadoSelectsAlbumes.length-1]) { // Obtengo el elemento del select que debo cargar var idSelectDestino=listadoSelectsAlbumes[posicionSelectDestino]; var selectDestino=document.getElementById(idSelectDestino); var trDestino=document.getElementById('tr_'+idSelectDestino); // Creo el nuevo objeto AJAX y envio al servidor el ID del select a cargar y la opcion seleccionada del select origen var ajax=nuevoAjax(); ajax.open("GET", "/sections/ajax.subalbumesVideos.php?select="+idSelectDestino+"&opcion="+opcionSeleccionada+"&ms="+new Date().getTime(), true); ajax.onreadystatechange=function() { if (ajax.readyState==1) { selectDestino.length=0; var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="Seleccionar opción..."; selectDestino.appendChild(nuevaOpcion); selectDestino.disabled=true; } if (ajax.readyState==4) { if(ajax.responseText!="none") { trDestino.style.display=''; x=posicionSelectDestino+1; while(listadoSelectsAlbumes[x]) { trDestino=document.getElementById('tr_'+listadoSelectsAlbumes[x]); trDestino.style.display='none'; x++; } selectDestino.parentNode.innerHTML=ajax.responseText; } else { trDestino.style.display='none'; x=posicionSelectDestino+1; while(listadoSelectsAlbumes[x]) { trDestino=document.getElementById('tr_'+listadoSelectsAlbumes[x]); trDestino.style.display='none'; x++; } } } }; ajax.send(null); } } function foro_over(src){ src.style.background = '#FFF5E6'; } function foro_out1(src){ src.style.background = '#EFEFEF'; } function foro_out2(src){ src.style.background = '#F9F9F9'; } function is_mail(texto){ var mailres = true; var cadena = "abcdefghijklmn?opqrstuvwxyzABCDEFGHIJKLMN?OPQRSTUVWXYZ1234567890@._-"; var arroba = texto.indexOf("@",0); if ((texto.lastIndexOf("@")) != arroba){ arroba = -1;} var punto = texto.lastIndexOf("."); for (var contador = 0 ; contador < texto.length ; contador++){ if (cadena.indexOf(texto.substr(contador, 1),0) == -1){ mailres = false; break; } } if ((arroba > 1) && (arroba + 1 < punto) && (punto + 1 < (texto.length)) && (mailres == true) && (texto.indexOf("..",0) == -1)){ mailres = true; } else { mailres = false; } return mailres; } function IsNumeric(sText) { var ValidChars = "0123456789."; var IsNumber=true; var Char; for (i = 0; i < sText.length && IsNumber == true; i++) { Char = sText.charAt(i); if (ValidChars.indexOf(Char) == -1) { IsNumber = false; } } return IsNumber; } /*****************************************/ /*****************ABONOS******************/ /*****************************************/ function verifica_abonos(form){ if(form.partido_id.value==0){ alert("¿De qué partido hablamos?");form.partido_id.focus(); return false;} if(form.abono_precio.disabled==false) { if(form.abono_precio.value=="") { alert("¿Cuánto cuesta tu abono?"); form.abono_precio.focus(); return false; } if(!IsNumeric(form.abono_precio.value)) { alert(form.abono_precio.value+" no es un precio"); form.abono_precio.focus(); return false; } } if(form.abono_mail.value=="" && form.abono_telefono.value==""){ alert("Tenés que incluir alguna de las dos formas de contacto"); form.abono_mail.focus(); return false; } if(form.abono_mail.value!="") { if(!is_mail(form.abono_mail.value)) { alert(form.abono_mail.value+" no es una dirección de e-mail válida"); form.abono_mail.focus(); return false; } } return true; } function oculta_abonos() { document.abonos.ubicacion_id.disabled=true; document.abonos.abono_precio.disabled=true; document.abonos.abono_title.disabled=false; } function muestra_abonos() { document.abonos.ubicacion_id.disabled=false; document.abonos.abono_precio.disabled=false; document.abonos.abono_title.disabled=true; } /*****************************************/ /*****************PORQUE******************/ /*****************************************/ function verifica_porque(form) { if(form.porque_body.value==""){alert("Debés incluir como mínimo 100 caracteres");form.porque_body.focus();return false;} return true; } function DenunciarPorque(PORQUE_ID){ var ajax=nuevoAjax(); document.getElementById('link_denuncia'+PORQUE_ID).style.display='none'; document.getElementById('denuncia'+PORQUE_ID).style.display='block'; ajax.open("GET", "/sections/porque/porque-denunciarporquerun.php?porque_id="+PORQUE_ID, true); ajax.send(null); } /*****************************************/ /*****************PORRIELA****************/ /*****************************************/ function porriela_edit_nueva() { document.getElementById('nueva').style.display='none'; document.getElementById('mandar').style.display='block'; document.mi_apuesta.apuesta_casa.disabled=false; document.mi_apuesta.apuesta_fuera.disabled=false; document.mi_apuesta.apuesta_casa.className='borde_input'; document.mi_apuesta.apuesta_fuera.className='borde_input'; document.mi_apuesta.apuesta_casa.focus(); } function porriela_edit_cambiar() { document.getElementById('cambiar').style.display='none'; document.getElementById('mandar').style.display='block'; document.mi_apuesta.apuesta_casa.disabled=false; document.mi_apuesta.apuesta_fuera.disabled=false; document.mi_apuesta.apuesta_casa.className='borde_input'; document.mi_apuesta.apuesta_fuera.className='borde_input'; document.mi_apuesta.apuesta_casa.focus(); } /*****************************************/ /*****************GALERIA*****************/ /*****************************************/ function verifica_upload(form){ document.getElementById('bot_upload').disabled="disabled"; if(form.album_id.value==0){ alert("Debés especificar el álbum"); document.getElementById('bot_caption').innerHTML="Publicar foto"; document.getElementById('bot_upload').disabled=""; return false;} if(form.imagen.value.length==0){alert("Debés especificar la imagen"); document.getElementById('bot_caption').innerHTML="Publicar foto"; document.getElementById('bot_upload').disabled=""; return false;} if(form.titulo.value.length==0){alert("Debés introducir un título para la imagen"); document.getElementById('bot_caption').innerHTML="Publicar foto"; document.getElementById('bot_upload').disabled=""; return false;} if(!validate_text(form.titulo.value)){alert("El asunto debe contener letras o números"); document.getElementById('bot_caption').innerHTML="Publicar foto"; document.getElementById('bot_upload').disabled=""; return false;} if(form.keywords.value.length==0){alert("Debés incluir las etiquetas"); document.getElementById('bot_caption').innerHTML="Publicar foto"; document.getElementById('bot_upload').disabled=""; return false;} return true; } function verifica_delete(form) { if(form.motivo_texto.value==""){alert("Debés indicar el motivo por el que deseás eliminar la foto");form.motivo_texto.focus();return false;} return true; } function verificaBuscador(form) { if(form.vb.value==""){alert("Debés introducir lo que querés buscar");form.vb.focus();return false;} return true; } /*****************************************/ /*****************VIDEO*******************/ /*****************************************/ function verifica_video(){ document.getElementById('bot_upload').disabled="disabled"; if(document.upload.album_id.value==0){ alert("Debés especificar el álbum");document.getElementById('bot_caption').innerHTML="Publicar video"; document.getElementById('bot_upload').disabled="";return false;} if(document.upload.titulo.value.length==0){alert("Debés introducir un título para el video");document.getElementById('bot_caption').innerHTML="Publicar video"; document.getElementById('bot_upload').disabled="";return false;} if(!validate_text(document.upload.titulo.value)){alert("El asunto debe contener letras o números");document.getElementById('bot_caption').innerHTML="Publicar video"; document.getElementById('bot_upload').disabled="";return false;} if(document.upload.keywords.value.length==0){alert("Debés introducir las etiquetas"); document.getElementById('bot_caption').innerHTML="Subir foto"; document.getElementById('bot_upload').disabled=""; return false;} return true; } /*****************************************/ /*****************IDOLO*******************/ /*****************************************/ function verifica_idolo(form) { form.idolo_name.value = trim(form.idolo_name.value,''); if(form.idolo_name.value==""){alert("Elegí a tu ídolo");return false;} if(form.idolo_name.value.length>80){alert("El título debe ser inferior a 80 carácteres");form.idolo_name.focus();return false;} form.idolo_body.value = trim(form.idolo_body.value,''); if(form.idolo_body.value.length<100){alert("Debés incluir como mínimo 100 caracteres");form.idolo_body.focus();return false;} return true; } function DenunciarIdolo(IDOLO_ID){ var ajax=nuevoAjax(); document.getElementById('link_denuncia'+IDOLO_ID).style.display='none'; document.getElementById('denuncia'+IDOLO_ID).style.display='block'; ajax.open("GET", "/sections/idolo/idolo-denunciaridolorun.php?idolo_id="+IDOLO_ID, true); ajax.send(null); } /*****************************************/ /*****************MEMORABLE***************/ /*****************************************/ function verifica_memorable(form) { if((form.rival1.value=="" || form.rival1.value==0) && form.rival2.value==""){alert("¿Cuál fue el rival?");return false;} form.memorable_titulo.value = trim(form.memorable_titulo.value); if(form.memorable_titulo.value==""){alert("Ponéle un título a tu partido memorable");return false;} if(form.memorable_titulo.value.length>80){alert("El título debe ser inferior a 80 carácteres");form.memorable_titulo.focus();return false;} form.memorable_body.value = trim(form.memorable_body.value); if(form.memorable_body.value.length<100){alert("Debés incluir como mínimo 100 caracteres");form.memorable_body.focus();return false;} return true; } function DenunciarMemorable(MEMORABLE_ID){ var ajax=nuevoAjax(); document.getElementById('link_denuncia'+MEMORABLE_ID).style.display='none'; document.getElementById('denuncia'+MEMORABLE_ID).style.display='block'; ajax.open("GET", "/sections/memorable/memorable-denunciarmemorablerun.php?memorable_id="+MEMORABLE_ID, true); ajax.send(null); } /*****************************************/ /*****************FORO********************/ /*****************************************/ function verifica_foro(form) { document.getElementById('bot_boton').disabled='disabled'; if(form.action.value==1){ if(form.post_title.value.length == 0){alert("Rellená el asunto");document.getElementById('bot_boton').disabled='';document.getElementById('bot_caption').innerHTML="Enviar";return false;} else{ post_title = trim(form.post_title.value, ''); if(!validate_text(form.post_title.value)){alert("El asunto debe contener letras o números");document.getElementById('bot_boton').disabled='';document.getElementById('bot_caption').innerHTML="Enviar";return false;} if(post_title==""){ alert("El asunto debé tener caracteres"); document.getElementById('bot_boton').disabled=''; document.getElementById('bot_caption').innerHTML="Enviar"; return false; } } if(form.foro_id.value ==-1){alert("Seleccioná un foro");document.getElementById('bot_boton').disabled='';document.getElementById('bot_caption').innerHTML="Enviar";return false;} if(form.post_body.value.length == 0){alert("Introducí el mensaje");document.getElementById('bot_boton').disabled='';document.getElementById('bot_caption').innerHTML="Enviar";return false;} }else{ if(form.post_body.value.length == 0){alert("Introducí el mensaje");document.getElementById('bot_boton').disabled='';document.getElementById('bot_caption').innerHTML="Enviar";return false;} } return true; } function verificaBuscadorKey(form) { if(form.keyword.value==""){alert("Debés introducir lo que querés buscar");form.keyword.focus();return false;} return true; } function verifica_respuesta_rapida(form) { document.getElementById('bot_boton').disabled='disabled'; if(form.post_body.value.length == 0){alert("Introducí el mensaje");document.getElementById('bot_boton').disabled='';document.getElementById('bot_caption').innerHTML="Enviar";return false;} return true; } function valid_form_search(pagi){ document.form_search.pag.value=pagi; document.form_search.submit(); } function Verifica(form) { if(form.user_name.value.length<3){alert("Tu nick debé tener como mínimo 3 caracteres.");form.user_name.focus();return false;} if(form.user_pass.value.length<4){alert("Tu contraseña debé tener como mínimo 4 caracteres.");form.user_pass.focus();return false;} if(form.conformidad.checked==false){alert("Debés aceptar las condiciones de uso para poder registrarte.");return false;} if(form.user_pass_conf.value!=form.user_pass.value){alert("Las contraseñas no coinciden.");form.user_pass_conf.focus();return false;} if(form.paises.value==-1){alert("Debés indicar un país.");form.paises.focus();return false;} if(form.estados.value==-1 || form.estados.value.length==0){alert("Debés indicar una provincia");form.estados.focus();return false;} if(!is_mail(form.user_email.value)){alert("'"+form.user_email.value+"' no es válido, por favor revisalo.");form.user_email.focus();return false;} return true; } function verifica_recomendar(form) { if(form.nombre.value==""){ alert("Debés poner tu nombre"); form.nombre.focus(); return false; } if(!is_mail(form.email.value)) { alert(form.email.value+" La dirección de E-mail no es válida"); form.email.focus(); return false; } if(form.recomendados.value==""){ alert("Introducí los e-mails de tus amigos"); form.recomendados.focus(); return false; } return true; } function trim(str, chars) { return ltrim(rtrim(str, chars), chars); } function ltrim(str, chars) { chars = chars || "\\s"; return str.replace(new RegExp("^[" + chars + "]+", "g"), ""); } function rtrim(str, chars) { chars = chars || "\\s"; return str.replace(new RegExp("[" + chars + "]+$", "g"), ""); } function trim1 (string) { string = string.replace(/^s+/, ''); for (var i = string.length; i > 0; i--) { if (/S/.test(string.charAt(i))) { string = string.substring(0, i); break; } } return string; } function baseDomainString(){ e = document.domain.split(/\./); if(e.length > 3){ return("domain=." + e[e.length-3] + "." + e[e.length-2] + "." + e[e.length-1]) + ";" ; }else{ if(e.length > 2) { return("domain=." + e[e.length-2] + "." + e[e.length-1]) + ";" ; }else{ return(""); } } } function VideosActionCookie(site,action,pos){ var cookie_date = new Date(); cookie_date.setTime ( cookie_date.getTime() + 360000000 ); document.cookie=site+"_a_ivi = " + action + ";" + baseDomainString() + " expires = "+ cookie_date.toGMTString() +"; path=/"; document.cookie=site+"_p_ivi = " + pos + ";" + baseDomainString() + " expires = "+ cookie_date.toGMTString() +"; path=/"; } function VideosAlbumCookie(site,album_id,pos){ var cookie_date = new Date(); cookie_date.setTime ( cookie_date.getTime() + 360000000 ); document.cookie=site+"_a_id_ivi = " + album_id + ";" + baseDomainString() + " expires = "+ cookie_date.toGMTString() +"; path=/"; document.cookie=site+"_p_ivi = " + pos + ";" + baseDomainString() + " expires = "+ cookie_date.toGMTString() +"; path=/"; } function VideosSearchCookie(site,vb,pos){ var cookie_date = new Date(); cookie_date.setTime ( cookie_date.getTime() + 360000000 ); document.cookie=site+"_vb_id_ivi = " + vb + ";" + baseDomainString() + " expires = "+ cookie_date.toGMTString() +"; path=/"; document.cookie=site+"_p_ivi = " + pos + ";" + baseDomainString() + " expires = "+ cookie_date.toGMTString() +"; path=/"; } function FotosActionCookie(site,action,pos){ var cookie_date = new Date(); cookie_date.setTime ( cookie_date.getTime() + 360000000 ); document.cookie=site+"_a_igf = " + action + ";" + baseDomainString() + " expires = "+ cookie_date.toGMTString() +"; path=/"; document.cookie=site+"_p_igf = " + pos + ";" + baseDomainString() + " expires = "+ cookie_date.toGMTString() +"; path=/"; if(action!=0){ FotosAlbumCookie(site,'',pos); } } function FotosAlbumCookie(site,album_id,pos){ var cookie_date = new Date(); cookie_date.setTime ( cookie_date.getTime() + 360000000 ); document.cookie=site+"_a_id_igf = " + album_id + ";" + baseDomainString() + " expires = "+ cookie_date.toGMTString() +"; path=/"; document.cookie=site+"_p_igf = " + pos + ";" + baseDomainString() + " expires = "+ cookie_date.toGMTString() +"; path=/"; } function FotosSearchCookie(site,vb,pos){ var cookie_date = new Date(); cookie_date.setTime ( cookie_date.getTime() + 360000000 ); document.cookie=site+"_vb_id_igf = " + vb + ";" + baseDomainString() + " expires = "+ cookie_date.toGMTString() +"; path=/"; document.cookie=site+"_p_igf = " + pos + ";" + baseDomainString() + " expires = "+ cookie_date.toGMTString() +"; path=/"; } function selectsmile(n){ document.getElementById('smileselector1').className=''; document.getElementById('smileselector2').className=''; document.getElementById('smileselector3').className=''; document.getElementById('smileselector4').className=''; document.getElementById('smileselector' + n).className='selected'; document.getElementById('commentsmile').value=n; } function messageError(text) { document.getElementById('mensajes').style.display='block'; document.getElementById('mensajes').className='alerta'; document.getElementById('mensajes').innerHTML=text; document.location = "#errores"; } function comprobar(texto,valor,minLong,maxLong){ var variable = texto; if(variable.lengthmaxLong){ return false; } if(valor=='txt'){ var comp = /^([a-zA-Z0-9]{2,14})$/; } if(valor=='mail'){ var comp = /[\w-\.]{3,}@([\w-]{2,}\.)*([\w-]{2,}\.)[\w-]{2,4}/; } if (comp.test(texto)) {return true;} else {return false;} } function DescargarFotoOriginal(linkFoto){ var link_descarga = document.getElementById('descargar'); var link_altaDownload = document.getElementById('altaDownload'); var link_altaShow = document.getElementById('altaShow'); link_descarga.style.display="none"; if (linkFoto=='Download') { link_altaDownload.style.display="block"; } else { link_altaShow.style.display="block"; } } function editoresSearch() { var usr_keyw = document.getElementById("usr_keyw").value; var divResults = document.getElementById("editoresResults"); var ajax=nuevoAjax(); ajax.open("GET", "/sections/wiki/wiki-editoresSearch.php?usr_keyw="+usr_keyw, true); ajax.onreadystatechange=function() { if (ajax.readyState==1){ // Mientras carga elimino la opcion "Selecciona Opcion..." y pongo una que dice "Cargando..." divResults.innerHTML = ""; } if (ajax.readyState==4){ divResults.innerHTML = ajax.responseText; } }; ajax.send(null); } function ocultarTabla(){ var divTabla = document.getElementById('idContent'); var linkTabla = document.getElementById('linkOcultar'); if(divTabla.style.display=='none'){ divTabla.style.display='block'; linkTabla.innerHTML = "ocultar"; } else { linkTabla.innerHTML = "mostrar"; divTabla.style.display='none'; } } function denunciarWikiArticulo(){ var divDenuncia = document.getElementById('formDenunciar'); var linkDenunciar = document.getElementById('linkDenunciar'); if(divDenuncia.style.display=='none'){ divDenuncia.style.display='block'; linkDenunciar.innerHTML = "Cerrar"; } else { divDenuncia.style.display='none'; linkDenunciar.innerHTML = "Denunciar artículo"; } } function denunciarWikiArticuloRun(){ if(document.denunciarArticulo.denunciaTexto.value.length == 0){ alert("Por favor, copiá la parte del texto que querés denunciar"); document.denunciarArticulo.denunciaTexto.focus(); }else{ document.denunciarArticulo.submit(); } } function reportarAbusoAdmin(divAbuso,linkAbuso){ var divAbuso = document.getElementById(divAbuso); var linkAbuso = document.getElementById(linkAbuso); if(divAbuso.style.display=='none'){ divAbuso.style.display='block'; linkAbuso.innerHTML = 'Cerrar'; } else { divAbuso.style.display='none'; linkAbuso.innerHTML = 'Reportar al administrador'; } } function reportarAbusoAdminRun(divAbuso,linkAbuso,divReportado,formAbuso){ var divAbuso = document.getElementById(divAbuso); var linkAbuso = document.getElementById(linkAbuso); var divReportado = document.getElementById(divReportado); var abusoInfo = formAbuso.abusoInfo.value; var abusoTexto = formAbuso.abusoTexto.value; if(abusoTexto.length==0){ alert("Por favor, indicá el abuso realizado en la wiki"); }else{ var ajax=nuevoAjax(); ajax.open("GET", "/sections/wiki/wiki-reportarAbusoRun.php?abusoInfo="+abusoInfo+"&abusoTexto="+abusoTexto, true); ajax.onreadystatechange=function() { if (ajax.readyState==1){ // Mientras carga elimino la opcion "Selecciona Opcion..." y pongo una que dice "Cargando..." divAbuso.innerHTML = ""; } if (ajax.readyState==4){ divAbuso.style.display='none'; linkAbuso.style.display='none'; divReportado.style.display='block'; } }; ajax.send(null); } } function cambiarStatusArticulo(page_id,currentStatus){ var divOpen = document.getElementById('statusOpen'); var divClosed = document.getElementById('statusClosed'); if(currentStatus == 'closed'){ divOpen.style.display = 'block'; divClosed.style.display = 'none'; }else{ divOpen.style.display = 'none'; divClosed.style.display = 'block'; } var ajax=nuevoAjax(); ajax.open("GET", "/sections/wiki/wiki-changePageStatus.php?page_id="+page_id+"¤t="+currentStatus+"&ms="+new Date().getTime(), false); ajax.send(null); } function cambiarArticuloDestacado(page_id,current){ var spanDestacado = document.getElementById('articuloDestacado'); var ajax=nuevoAjax(); ajax.open("GET", "/sections/wiki/wiki-changePageDestacado.php?page_id="+page_id+"¤t="+current+"&ms="+new Date().getTime(), true); ajax.onreadystatechange=function() { if (ajax.readyState==1){ // Mientras carga elimino la opcion "Selecciona Opcion..." y pongo una que dice "Cargando..." spanDestacado.innerHTML = ""; } if (ajax.readyState==4){ spanDestacado.innerHTML=ajax.responseText; } }; ajax.send(null); } function showMenu(menuVal){ var my_menu = document.getElementById('menu'+menuVal); var my_submenu = document.getElementById('iSubMenu'+menuVal); var my_arrow = document.getElementById('iArrowInd'+menuVal); var Items = document.getElementsByName('subWal'); for (counter = 0; counter < Items.length; counter++){ Items[counter].style.display='none'; } var Items = document.getElementsByName('Wal'); for (counter = 0; counter < Items.length; counter++){ Items[counter].className="linkMenu t3 neg"; } if (my_menu){my_menu.className="linkMenuSelected t3 neg";} if (my_arrow){my_arrow.className="issetSubHo";} if (my_submenu){my_submenu.style.display="block";} } function hideMenu(menuVal){ var my_submenu = document.getElementById('iSubMenu'+menuVal); var my_arrow = document.getElementById('iArrowInd'+menuVal); var Items = document.getElementsByName('Wal'); for (counter = 0; counter < Items.length; counter++){ Items[counter].className="linkMenu t3 neg"; } if (my_arrow){my_arrow.className="issetSub";} if (my_submenu){my_submenu.style.display="none";} } /*****************************************/ /***************TRIVIAL*******************/ /*****************************************/ function verificaRespuestaTrivial(IDRespuesta) { var myAlert= document.getElementById('faltaRespuesta'); document.FormPreguntasTrivial.jsenabled.value="Y"; radio = document.FormPreguntasTrivial.answer; for(i=0; i< radio.length;i++){ if (radio[i].checked){ n=radio[i].value; return true; } } myAlert.style.display="block"; return false; } function verifica_add_trivial(form) { form.jsenabled.value="Y"; if(form.preg.value==""){alert("Debés incluir una pregunta");return false;} if(form.resp1.value==""){alert("Debés incluir las 3 respuestas");form.resp1.focus();return false;} if(form.resp2.value==""){alert("Debés incluir las 3 respuestas");return false;} if(form.resp3.value==""){alert("Debés incluir las 3 respuestas");return false;} return true; } function verifyJs(formName) { formName.jsenabled.value="Y"; } function verifyJsAdd(formName) { formName.jsenabled.value="Y"; if(confirm("¿Seguro que querés plantarte?")) { formName.action="/sections/trivial/trivialPlantarse.php"; }else{ formName.action="/sections/trivial/trivialGame.php"; } } function denunciarPregunta() { document.getElementById('link_denuncia').style.display="none"; document.getElementById('denuncia').style.display='block'; } function denunciarPreguntaRun(PREGUNTA_ID) { pregunta = document.forms['FormDenuncia'].denuncia_title.value; var ajax=nuevoAjax(); params="pregunta="+pregunta+"&pregunta_id="+PREGUNTA_ID; ajax.open("POST", "/sections/trivial/ajax.trivialDenunciarPregunta.php", true); ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); ajax.setRequestHeader("Content-length", params.length); document.getElementById('denuncia').style.display="none"; document.getElementById('denuncia_recibida').style.display="block"; ajax.send(params); } function muestraRegistro() { document.getElementById("registrate").style.display="none"; document.getElementById("registrarme").style.display="block"; } function muestraReglas() { document.getElementById("reglas").style.display="block"; document.getElementById("link_muestra_reglas").style.display="none"; document.getElementById("link_oculta_reglas").style.display="block"; } function ocultaReglas() { document.getElementById("reglas").style.display="none"; document.getElementById("link_muestra_reglas").style.display="block"; document.getElementById("link_oculta_reglas").style.display="none"; } function muestraRespuesta() { document.getElementById("resp3").style.display="block"; document.getElementById("link_otra_resp").style.display="none"; } function ocultaRespuesta() { document.getElementById("resp3").style.display="none"; document.getElementById("link_otra_resp").style.display="block"; } function Tiempoentrepreguntas() { var num = 30; var inter = setInterval(function Tiempoentrepreguntas(){ var dTimer = document.getElementById("timeout"); if (!dTimer) return; dTimer.innerHTML = num--; if (num == -1) { clearInterval(inter); verifyJs(document.FormRespuestaVerificada); document.FormRespuestaVerificada.submit(); } }, 1000); } function cancelarDenunciarPregunta() { document.getElementById('link_denuncia').style.display="block"; document.getElementById('denuncia').style.display='none'; } function muestraContacto(myId){ var id2show=document.getElementById('contact-'+myId); if(id2show.style.display=='none'){ id2show.style.display='block'; }else{ id2show.style.display='none'; } } function DenunciarComentario(COMMENT_ID,URL_ORI){ var ajax=nuevoAjax(); document.getElementById('link_denuncia'+COMMENT_ID).style.display='none'; document.getElementById('denuncia'+COMMENT_ID).style.display='block'; ajax.open("POST", "/sections/campeonato/campeonatoCommentDenunciarRun.php", false); ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); ajax.send("comment_id="+COMMENT_ID+"&url_from="+URL_ORI); } function SendFriendObject(recomiendaAmigo) { if(recomiendaAmigo.nombre.value==""){ alert("Debés poner tu nombre"); recomiendaAmigo.nombre.focus(); return false; } if(recomiendaAmigo.recomendados.value==""){ alert("Introducí los e-mails de tus amigos"); recomiendaAmigo.recomendados.focus(); return false; } if(recomiendaAmigo.checkHuman.value==""){ alert("Te olvidaste del texto que sale en la imagen"); recomiendaAmigo.checkHuman.focus(); return false; } var MostrarRespuesta = document.getElementById('enviar_amigo'); var ajax=nuevoAjax(); nombre=recomiendaAmigo.nombre.value; email=recomiendaAmigo.email.value; recomendados=recomiendaAmigo.recomendados.value; texto_opcional=recomiendaAmigo.texto_opcional.value; object_name=recomiendaAmigo.object_name.value; description=recomiendaAmigo.description.value; object_envio=recomiendaAmigo.object.value; object_id=recomiendaAmigo.object_id.value; object_sec=recomiendaAmigo.object_sec.value; thumbnail_path_foto=recomiendaAmigo.thumbnail_path_foto.value; thumbnail_path_video=recomiendaAmigo.thumbnail_path_video.value; checkHuman=recomiendaAmigo.checkHuman.value; captcha=recomiendaAmigo.captcha.value; var myString = new String(recomendados); var myArray = myString.split(','); for (counter = 0; counter < myArray.length; counter++){ if(comprobar(myArray[counter],'mail',6,255)==false){alert("El e-mail " + myArray[counter] + " no es un e-mail correcto");recomiendaAmigo.email.focus();return false;} } var aleatorio=Math.random(); params="nombre="+nombre+"&email="+email+"&description="+description+"&recomendados="+recomendados+"&texto_opcional="+texto_opcional+"&object_name="+object_name+"&object_envio="+object_envio+"&object_id="+object_id+"&thumbnail_path_foto="+thumbnail_path_foto+"&thumbnail_path_video="+thumbnail_path_video+"&checkHuman="+checkHuman+"&object_sec="+object_sec+"&captcha="+captcha+"&nocache="+aleatorio; ajax.open("POST", "/sections/ajax.EnviaRecomendacionAmigo.php", true); ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); ajax.setRequestHeader("Content-length", params.length); ajax.onreadystatechange=function() { if (ajax.readyState==1){ MostrarRespuesta.innerHTML = "
"; } if (ajax.readyState==4){ MostrarRespuesta.innerHTML = ajax.responseText; } }; ajax.send(params); return false; } function restaComodin(USER_ID,GAME_ID,NUM_COMODIN) { if(NUM_COMODIN==1){ var borracomodin = document.getElementById('comodin1'); } if(NUM_COMODIN==3){ var borracomodin = document.getElementById('comodin3'); } var ajax=nuevoAjax(); ajax.open("GET", "/sections/trivial/ajax.trivialGastaComodin.php?user_id="+USER_ID+"&gid="+GAME_ID+"&comodin="+NUM_COMODIN,true); ajax.onreadystatechange=function() { if (ajax.readyState==4) { borracomodin.innerHTML = ""; } }; ajax.send(null); return true; } /*******************************************/ /***************REPORTERO*******************/ /*******************************************/ function changeHoverUpload(LeftId,IdLink,RightId){ myLeftId = document.getElementById(LeftId); myIdLink = document.getElementById(IdLink); myRightId = document.getElementById(RightId); myLeftId.className="linkUpLeftH"; myIdLink.className="linkUpH"; myRightId.className="linkUpRightH"; } function resetHoverUpload(LeftId,IdLink,RightId){ myLeftId = document.getElementById(LeftId); myIdLink = document.getElementById(IdLink); myRightId = document.getElementById(RightId); myLeftId.className="linkUpLeft"; myIdLink.className="linkUp"; myRightId.className="linkUpRight"; } function changeHoverSubNav(LeftId,IdLink,RightId){ myLeftId = document.getElementById(LeftId); myIdLink = document.getElementById(IdLink); myRightId = document.getElementById(RightId); myLeftId.className="subNavLeftH"; myIdLink.className="linkSubNavH"; myRightId.className="subNavRightH"; } function resetHoverSubNav(LeftId,IdLink,RightId){ myLeftId = document.getElementById(LeftId); myIdLink = document.getElementById(IdLink); myRightId = document.getElementById(RightId); myLeftId.className="subNavLeft"; myIdLink.className="linkSubNav"; myRightId.className="subNavRight"; } function changeHoverSendFriend(LeftId,IdLink,RightId){ myLeftId = document.getElementById(LeftId); myIdLink = document.getElementById(IdLink); myRightId = document.getElementById(RightId); myLeftId.className="sendFriendLeftH"; myIdLink.className="linkSendFriendH"; myRightId.className="sendFriendRightH"; } function resetHoverSendFriend(LeftId,IdLink,RightId){ myLeftId = document.getElementById(LeftId); myIdLink = document.getElementById(IdLink); myRightId = document.getElementById(RightId); myLeftId.className="sendFriendLeft"; myIdLink.className="linkSendFriend"; myRightId.className="sendFriendRight"; } function cambiaPestChamp(invisibleId,visibleId,pestNotSelId,pestSelId,newClassName){ myInvisibleId = document.getElementById(invisibleId); myVisibleId = document.getElementById(visibleId); myPestNotSelId = document.getElementById(pestNotSelId); myPestSelId = document.getElementById(pestSelId); var myContainerBig = document.getElementById('contChampBig'); myInvisibleId.style.display="none"; myVisibleId.style.display="block"; myPestNotSelId.className="notSelectedChamp"; myPestSelId.className="selectedChamp"; myContainerBig.className=newClassName; } function verifica_reporteroComment(form) { if(form.reportero_comment_body.value==""){alert("Debés incluir algún comentario");form.reportero_comment_body.focus();return false;} return true; } function DenunciarReportero(REPORTERO_ID) { var ajax=nuevoAjax(); document.getElementById('link_denuncia'+REPORTERO_ID).style.display='none'; document.getElementById('denuncia'+REPORTERO_ID).style.display='block'; ajax.open("GET", "/sections/reportero/reporteroDenunciarReporteroRun.php?reportero_id="+REPORTERO_ID, true); ajax.send(null); } function DenunciarReporteroComment(REPORTERO_ID,COMMENT_ID) { var ajax=nuevoAjax(); document.getElementById('link_denuncia_comment'+COMMENT_ID).style.display='none'; document.getElementById('denuncia_comment'+COMMENT_ID).style.display='block'; ajax.open("GET", "/sections/reportero/reporteroDenunciarCommentRun.php?comment_id="+COMMENT_ID, true); ajax.send(null); } function DenunciarReporteroFoto(REPORTERO_ID,FOTO_ID) { var ajax=nuevoAjax(); document.getElementById('link_denuncia_foto'+FOTO_ID).style.display='none'; document.getElementById('denuncia_foto'+FOTO_ID).style.display='block'; ajax.open("GET", "/sections/reportero/reporteroDenunciarFotoRun.php?foto_id="+FOTO_ID, true); ajax.send(null); } function VotarReportero(REPORTERO_ID,VOTO,CMP) { var manos_voto = document.getElementById('principalVotePost'); var votacion = document.getElementById('reporteroYaVotadoArriba'); var votacion_hor = document.getElementById('votacion_secundary'); var mymainResultado = document.getElementById('mainResultado'); var ajax=nuevoAjax(); params="rid="+REPORTERO_ID+"&b="+VOTO; ajax.open("POST", "/sections/reportero/reporteroVoteRun.php", true); ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); ajax.setRequestHeader("Content-length", params.length); ajax.onreadystatechange=function() { if (ajax.readyState==1){ // Mientras carga elimino la opcion "Selecciona Opcion..." y pongo una que dice "Cargando..." manos_voto.style.display='none'; votacion_hor.innerHTML = ""; } if (ajax.readyState==4){ if(CMP==2){ votacion.style.display="block"; votacion.innerHTML = ajax.responseText; votacion_hor.innerHTML = ajax.responseText; }else{ mymainResultado.innerHTML = ajax.responseText; votacion_hor.innerHTML = "

Gracias por participar

"; votacion.style.display="block"; manos_voto.style.display="none"; votacion_hor.style.display="none"; votacion.innerHTML = "

Gracias por participar

"; } } }; ajax.send(params); } function verRumores(){ document.getElementById('notiPestReport').className=""; document.getElementById('linkNotiReport').className="linkGeneral neg"; document.getElementById('rumorPestReport').className="selected"; document.getElementById('linkRumorReport').className="itemSelectedNewSubMenu"; document.getElementById('noticiasContentHome').style.display='none'; document.getElementById('rumoresContentHome').style.display='block'; document.getElementById('subeNotiHomeReport').style.display='none'; document.getElementById('subeRumorHomeReport').style.display='block'; } function verNoticias(){ document.getElementById('notiPestReport').className="selected"; document.getElementById('linkNotiReport').className="itemSelectedNewSubMenu"; document.getElementById('rumorPestReport').className=""; document.getElementById('linkRumorReport').className="linkGeneral neg"; document.getElementById('noticiasContentHome').style.display='block'; document.getElementById('rumoresContentHome').style.display='none'; document.getElementById('subeNotiHomeReport').style.display='block'; document.getElementById('subeRumorHomeReport').style.display='none'; } function mostrarSubirFoto(){ document.getElementById('cambiar_foto').style.display='none'; document.getElementById('mostrar_subir_foto').style.display='block'; } function VotarDerbi(){ var link_descarga = document.getElementById('descargar'); var link_alta = document.getElementById('alta'); link_descarga.style.display="none"; link_alta.style.display="block"; } function trivial_ranking(filter,orden) { var ranking=document.getElementById('tabla_ranking'); var ajax=nuevoAjax(); ajax.open("GET", "/sections/trivial/ajax.TrivialRanking.php?filter="+filter+"&ord="+orden,true); ajax.onreadystatechange=function() { if (ajax.readyState==4) { ranking.innerHTML = ajax.responseText; } }; ajax.send(null); } function trivial_ranking_completa(filter,orden,pag) { var ranking=document.getElementById('tabla_ranking'); var ajax=nuevoAjax(); ajax.open("GET", "/sections/trivial/ajax.TrivialRanking.php?filter="+filter+"&ord="+orden+"&pag="+pag,true); ajax.onreadystatechange=function() { if (ajax.readyState==4) { ranking.innerHTML = ajax.responseText; } }; ajax.send(null); } function verifica_juego_jugadores(form){ if(form.jugador_1.value==0){ alert("Debés elegir 3 jugadores"); form.jugador_1.focus(); return false; } if(form.jugador_2.value==0){ alert("Debés elegir 3 jugadores"); form.jugador_2.focus(); return false; } if(form.jugador_3.value==0){ alert("Debés elegir 3 jugadores"); form.jugador_3.focus(); return false; } return true; } function juego_jugadores_fuera() { var ranking = document.getElementById('tabla_jugadores'); var ajax=nuevoAjax(); ajax.open("GET", "/sections/juegos/ajax.JugadoresFuera.php",true); ajax.onreadystatechange=function() { if (ajax.readyState==4) { ranking.innerHTML = ajax.responseText; } }; ajax.send(null); } function verifica_juego_jugadores_dentro(form){ if(form.jugador_in_1.value==""){ alert("Debés elegir 3 jugadores"); form.jugador_in_1.focus(); return false; } if(form.jugador_in_2.value==""){ alert("Debés elegir 3 jugadores"); form.jugador_in_2.focus(); return false; } if(form.jugador_in_3.value==""){ alert("Debés elegir 3 jugadores"); form.jugador_in_3.focus(); return false; } return true; } function juego_jugadores_dentro() { var ranking = document.getElementById('tabla_jugadores_dentro'); var ajax=nuevoAjax(); ajax.open("GET", "/sections/juegos/ajax.JugadoresDentro.php",true); ajax.onreadystatechange=function() { if (ajax.readyState==4) { ranking.innerHTML = ajax.responseText; } }; ajax.send(null); } function showFeeds(){ document.getElementById('showMoreFeeds').style.display="none"; document.getElementById('allFeeds').style.display="block"; document.getElementById('showLessFeeds').style.display="block"; } function hideFeeds(){ document.getElementById('showMoreFeeds').style.display="block"; document.getElementById('allFeeds').style.display="none"; document.getElementById('showLessFeeds').style.display="none"; } function showPosts(){ document.getElementById('showMorePosts').style.display="none"; document.getElementById('allPosts').style.display="block"; document.getElementById('showLessPosts').style.display="block"; } function hidePosts(){ document.getElementById('showMorePosts').style.display="block"; document.getElementById('allPosts').style.display="none"; document.getElementById('showLessPosts').style.display="none"; } function ponerAvatar(form) { var avatar = document.getElementById('ponerAvatar'); var ajax=nuevoAjax(); foto_avatar = form.foto.value; params ="av="+foto_avatar; ajax.open("POST", "/sections/gallery/ajax.ponerAvatar.php", true); ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); ajax.setRequestHeader("Content-length", params.length); ajax.onreadystatechange=function() { if (ajax.readyState==1){ avatar.innerHTML = "
"; } if (ajax.readyState==4){ avatar.innerHTML = ajax.responseText; } }; ajax.send(params); return false; } function cambiarEstadoAnimo(user_id,ESTADO) { var ajax = nuevoAjax(); document.getElementById('estado_novotado').style.display="none"; document.getElementById('estado_votado').style.display="block"; var estado = document.getElementById('estado_votado'); ajax.open("GET", "/sections/perfil/ajax.cambiarEstadoAnimo.php?user_id="+user_id+"&est="+ESTADO, true); ajax.onreadystatechange=function() { if (ajax.readyState==4){ estado.innerHTML = ajax.responseText; } }; ajax.send(null); } // WIKI 2.0 function cambiarArticuloFavorito(page_id,current){ var spanFavorito = document.getElementById('articuloFavorito'); var ajax=nuevoAjax(); ajax.open("GET", "/sections/wiki/wiki-changePageFavorito.php?page_id="+page_id+"¤t="+current+"&ms="+new Date().getTime(), true); ajax.onreadystatechange=function() { if (ajax.readyState==1){ // Mientras carga elimino la opcion "Selecciona Opcion..." y pongo una que dice "Cargando..." spanFavorito.innerHTML = ""; } if (ajax.readyState==4){ spanFavorito.innerHTML=ajax.responseText; } }; ajax.send(null); } function crearArticuloWiki(){ document.getElementById('crearArticulo').style.display="block"; } // VIVENCIAS CAMPEONATO function verifica_vivencias(form) { if(form.vivencia_body.value==""){alert("Debes introducir tu vivencia");form.vivencia_body.focus();return false;} var radio = false; for (counter = 0; counter < form.vivencia_hermano.length; counter++){ if(form.vivencia_hermano[counter].checked){ radio = true; } } if(!radio){ alert("¿Puedes seleccionar uno de los equipos?"); return false; } if(form.vivencia_jugador.value==""){ alert("¿Podrías introducir un jugador?"); form.vivencia_jugador.focus(); return false; } if(form.vivencia_sugerencias.value==""){ alert("¿Podrías introducir alguna sugerencia?"); form.vivencia_sugerencias.focus(); return false; } return true; } function DenunciarVivencia(VIVENCIA_ID){ var ajax=nuevoAjax(); document.getElementById('link_denuncia'+VIVENCIA_ID).style.display='none'; document.getElementById('denuncia'+VIVENCIA_ID).style.display='block'; ajax.open("GET", "/sections/vivencias/vivencias-denunciarVivenciasRun.php?vivencia_id="+VIVENCIA_ID, true); ajax.send(null); } function changeTabMatch(tabSel){ var pestDivCur = document.getElementById('currentMatch'); var pestDivNex = document.getElementById('nextMatch'); var pestDivClas = document.getElementById('clasHome'); var linkDivCur = document.getElementById('tabsMatch1'); var linkDivNex = document.getElementById('tabsMatch2'); var linkDivClas = document.getElementById('tabsMatch3'); var divCur = document.getElementById('cur'); var divNex = document.getElementById('nex'); var divClas = document.getElementById('clas'); if(tabSel=='currentMatch'){ if(pestDivCur){ pestDivCur.className="matchesBlockSel"; linkDivCur.className="selectedTabsMatch"; divCur.className="dBlock"; } if(pestDivNex){ pestDivNex.className=""; linkDivNex.className="linkGeneralU"; divNex.className="dNone"; } if(pestDivClas){ linkDivClas.className="linkGeneralU"; pestDivClas.className=""; divClas.className="dNone"; } }else if(tabSel=='nextMatch'){ if(pestDivCur){ pestDivCur.className=""; linkDivCur.className="linkGeneralU"; divCur.className="dNone"; } if(pestDivNex){ pestDivNex.className="matchesBlockSel"; linkDivNex.className="selectedTabsMatch"; divNex.className="dBlock"; } if(pestDivClas){ linkDivClas.className="linkGeneralU"; pestDivClas.className=""; divClas.className="dNone"; } }else{ if(pestDivCur){ pestDivCur.className=""; linkDivCur.className="linkGeneralU"; divCur.className="dNone"; } if(pestDivNex){ pestDivNex.className=""; linkDivNex.className="linkGeneralU"; divNex.className="dNone"; } if(pestDivClas){ linkDivClas.className="selectedTabsMatch"; pestDivClas.className="matchesBlockSel"; divClas.className="dBlock"; } } } function validate_text(text){ text = trim(text,''); var msg =$.ajax({ type: 'GET', url: '/sections/ajax.validateText.php', data:"txt="+text+"&ms="+new Date().getTime(), async: false }).responseText; if(msg==1){ return false; }else{ return true; } } function valida_textarea(text){ temp = stripTags(text); temp = trim(temp); lentgh=temp.length; if(lentgh>=100){ return true; } return false; } function stripTags(srcString){ if (srcString === "") {return "";} srcString = srcString.replace("\ ",""); return srcString.replace(new RegExp("(<[\\s\\S]+?>)", "g"), ""); } function showArea(areaID,log){ if(log==0){birthdaysNeedReg(areaID);die;} var myAn = document.getElementById('birdth'+areaID); myAn.innerHTML='
* El mensaje se enviará directamente a su ficha
'; } function closeArea(areaID){ var myAn = document.getElementById('birdth'+areaID); myAn.innerHTML='Felicitalo'; } function changeTabUsers(whichOne){ var showUsers = document.getElementById('lastUsers'); var showBirdthdays = document.getElementById('birdthUsers'); var tab_1 = document.getElementById('tab1'); var tab_2 = document.getElementById('tab2'); if(whichOne==2){ tab_1.innerHTML='Los nuevos'; tab_2.innerHTML='Los cumpleañeros'; showUsers.className="dNone"; showBirdthdays.className="dBlock"; }else{ tab_1.innerHTML='Los nuevos'; tab_2.innerHTML='Los cumpleañeros'; showUsers.className="dBlock"; showBirdthdays.className="dNone"; } } function moreBirthdays(pag,nbirth){ var birdthUsers = document.getElementById('birdthUsers'); var ajax=nuevoAjax(); ajax.open("GET", "/sections/ajax.MoreBirthdays.php?pag="+pag+"&nbirth="+nbirth+"&ms="+new Date().getTime(), true); ajax.onreadystatechange=function(){ if (ajax.readyState==1){birdthUsers.innerHTML = "
";} if (ajax.readyState==4){birdthUsers.innerHTML = ajax.responseText;} }; ajax.send(null); } function birthdaysNeedReg(areaID){ var showArea = document.getElementById('birdth'+areaID); var link_alta = document.getElementById('alta'); showArea.style.display="none"; link_alta.style.display="block"; } function isDate(dateStr) { var datePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/; var matchArray = dateStr.match(datePat); if (matchArray == null) {return false;} month = matchArray[1]; day = matchArray[3]; year = matchArray[5]; if (month < 1 || month > 12) {return false;} if (day < 1 || day > 31) {return false;} if ((month==4 || month==6 || month==9 || month==11) && day==31) {return false;} if (month == 2) { var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); if (day > 29 || (day==29 && !isleap)) {return false;} } return true; } function dataStaff(){ var showForm = document.getElementById('aparecer_staff'); var staff = document.getElementById('staff'); var datos = document.getElementById('datos_reales'); if(staff.checked==true){ showForm.style.display="block"; }else{ showForm.style.display="none"; datos.style.display="none"; } } function showStaffForm(){ var showFormFull = document.getElementById('datos_reales'); var nick = document.getElementById('nick'); var nombre = document.getElementById('nombre'); if(nick.checked==true){ showFormFull.style.display="none"; }else{ showFormFull.style.display="block"; } } function verificaColaborar(form){ colaborar_donde = trim(form.colaborar_donde.value); if(form.colaborar_donde.value.length==""){alert("Debés indicarnos en que sección te gustaría colaborar");form.colaborar_donde.focus();return false;} var staff = document.getElementById('staff'); if(staff.checked==true){ var radio = false; var radio_checked; for(counter = 0; counter< form.nick_name.length; counter++){ if(form.nick_name[counter].checked){ radio = true; radio_checked = form.nick_name[counter].value; } } if(!radio){alert("¿Qué querés que aparezca, tu nombre o tu nick?");return false;} if(radio_checked==1){ if(trim(form.colaborar_nombre.value).length==""){alert("Tenés que indicarnos tu nombre");form.colaborar_nombre.focus();return false;} if(trim(form.colaborar_apellidos.value).length==""){alert("Tenés que indicarnos tus apellidos");form.colaborar_apellidos.focus();return false;} if(form.tu_foto.value.length==0){alert("tenés que publicar tu foto");return false;} } } } function howParticipate(){ var participar = document.getElementById('participar'); if(participar.style.display=="block"){ participar.style.display="none"; }else{ participar.style.display="block"; } } function derbiApuesta(form){ var partido = document.getElementById('partido_id').value; var ac = form.apuesta_casa.value; var af = form.apuesta_fuera.value; if(ac==""){alert("¡Apuesta incompleta!");form.apuesta_casa.focus();return false;} if(af==""){alert("¡Apuesta incompleta!");form.apuesta_fuera.focus();return false;} var apostar = document.getElementById('apostar'); var ajax=nuevoAjax(); params="partido_id="+partido+"&apuesta_casa="+ac+"&apuesta_fuera="+af; ajax.open("POST", "/sections/eventos/eventosPorrielaRun.php", true); ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); ajax.setRequestHeader("Content-length", params.length); ajax.onreadystatechange=function() { if (ajax.readyState==4){ apostar.innerHTML = ajax.responseText; } }; ajax.send(params); return false; } function hideHour() { var allday = document.getElementById('alldaycheckbox'); var eventHourFin = document.getElementById('date_fin'); var eventHourIni = document.getElementById('date_ini'); if(allday.checked==true){ eventHourFin.style.display="none"; eventHourIni.style.display="none"; }else{ eventHourFin.style.display="block"; eventHourIni.style.display="inline"; } } function eleccionesVotar(obId,nCand){ var myDiv = document.getElementById('candidato'+obId); var ajax=nuevoAjax(); for(i=0; iVotar
'; } } ajax.open("GET", "/sections/adds/elecciones/ajax.eleccionesVoteRun.php?vote="+obId+"&ms="+new Date().getTime(), true); ajax.onreadystatechange=function(){ if (ajax.readyState==1){ myDiv.innerHTML = "
"; } if (ajax.readyState==4){ myDiv.innerHTML = ajax.responseText; } }; ajax.send(null); } function datePast(input){ var date = input.split('-'); var dia = date[2].split(' '); var hora = dia[1].split(':'); var miFecha = new Date(date[0],date[1]-1,dia[0],hora[0],hora[1]); var today = new Date(); var dia_actual = today.getDate(); var mes_actual = today.getMonth() + 1; var anno_actual = today.getFullYear(); var hora_actual = today.getHours(); var min_actual = today.getMinutes(); var fecha = new Date(anno_actual,mes_actual-1,dia_actual,hora_actual,min_actual); if(miFecha"); if(buscaInfo == -1){ asistentes.innerHTML = respuestaAjax; }else{ votacion.innerHTML = respuestaAjax; } } }; ajax.send(params); } function goEventPartido(EVENT_ID,VOY,PARTIDO_ID) { var asist1 = document.getElementById('asist1'); var asist2 = document.getElementById('asist2'); var asist0 = document.getElementById('asist0'); var asistentes = document.getElementById('asistentes'); var votacion = document.getElementById('votacion'); var ajax=nuevoAjax(); params="evid="+EVENT_ID+"&b="+VOY+"&parId="+PARTIDO_ID; ajax.open("POST", "/sections/events/ajax.eventsGoEventPartidoRun.php", true); ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); ajax.setRequestHeader("Content-length", params.length); ajax.onreadystatechange=function() { if (ajax.readyState==4){ if(VOY==1){ asist1.className="btnAsistenciaSelect"; asist2.className="btnAsistencia"; asist0.className="btnAsistencia"; } if(VOY==2){ asist1.className="btnAsistencia"; asist2.className="btnAsistenciaSelect"; asist0.className="btnAsistencia"; } if(VOY==0){ asist1.className="btnAsistencia"; asist2.className="btnAsistencia"; asist0.className="btnAsistenciaSelect"; } var respuestaAjax = ajax.responseText; var buscaInfo = respuestaAjax.indexOf("

"); if(buscaInfo == -1){ asistentes.innerHTML = respuestaAjax; tb_init('a.thickbox, area.thickbox, input.thickbox'); }else{ votacion.innerHTML = respuestaAjax; } } }; ajax.send(params); } function formGallery(){ $("#myFormC").slideToggle("slow"); } function uploadConcurso(Objform){ if(Objform.foto_nombre.value.length==0){alert("Debés introducir un título para la imagen"); return false;} if(!validate_text(Objform.foto_nombre.value)){alert("El asunto debe contener letras o números"); return false;} if(Objform.imagen.value.length==0){alert("Debés especificar la imagen"); return false;} return true; } function insertEmotion(file_name, title) { if (title == null){ title = ""; } // XML encode title = title.replace(/&/g, '&'); title = title.replace(/\"/g, '"'); title = title.replace(//g, '>'); var html = '' + title + ''; tinyMCE.execCommand('mceInsertContent', false, html); } function verificaEventComment(form) { if(form.event_comment_body.value==""){alert("Debés incluir algún comentario");form.event_comment_body.focus();return false;} return true; } function deleteCommentEvent(EVENT_ID,EVENT_COMMENT_ID){ if(confirm("¿Estás seguro de que querés eliminar este comentario?")) { location.href="/sections/events/eventsDelComment.php?event_id="+EVENT_ID+"&event_comment_id="+EVENT_COMMENT_ID; } } function adidasReportComment(COMMENT_ID,URL_ORI){ var ajax=nuevoAjax(); document.getElementById('link_denuncia'+COMMENT_ID).style.display='none'; document.getElementById('denuncia'+COMMENT_ID).style.display='block'; ajax.open("POST", "/sections/adds/adidas/adidasCommentDenunciarRun.php", false); ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); ajax.send("comment_id="+COMMENT_ID+"&url_from="+URL_ORI); } function adidasVote(CAND_ID){ //var myDiv = document.getElementById('adidasVote'); var ajax=nuevoAjax(); ajax.open("GET", "/sections/adds/adidas/ajax.adidasVoteRun.php?cand_id="+CAND_ID+"&ms="+new Date().getTime(), true); ajax.onreadystatechange=function(){ if (ajax.readyState==1){ //myDiv.innerHTML = "

"; } if (ajax.readyState==4){ if(ajax.responseText==-2){ document.getElementById('adidasUnVoto').style.display='block'; document.getElementById('adidasNoReg').style.display='none'; document.getElementById('adidasVote').style.display='none'; }else{ if(ajax.responseText==-1){ document.getElementById('adidasNoReg').style.display='block'; document.getElementById('adidasUnVoto').style.display='none'; document.getElementById('adidasVote').style.display='none'; }else{ document.getElementById('adidasNumVotes').innerHTML=ajax.responseText; } } } }; ajax.send(null); } function bbvaReportComment(COMMENT_ID){ var ajax=nuevoAjax(); document.getElementById('link_denuncia'+COMMENT_ID).style.display='none'; document.getElementById('denuncia'+COMMENT_ID).style.display='block'; ajax.open("POST", "/sections/adds/bbva/bbvaCommentDenunciarRun.php", false); ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); ajax.send("comment_id="+COMMENT_ID); } function bbva_comments(pag) { var comments=document.getElementById('bbvaComments'); var ajax=nuevoAjax(); ajax.open("GET", "/sections/adds/bbva/ajax.bbvaComments.php?pag="+pag+"&ms="+new Date().getTime(), true); ajax.onreadystatechange=function() { if (ajax.readyState==4) { comments.innerHTML = ajax.responseText; } }; ajax.send(null); } function events_comments(pag, event_id) { var comments=document.getElementById('eventsComments'); var ajax=nuevoAjax(); ajax.open("GET", "/sections/events/ajax.eventsComments.php?pag="+pag+"&event_id="+event_id+"&ms="+new Date().getTime(), true); ajax.onreadystatechange=function() { if (ajax.readyState==4) { comments.innerHTML = ajax.responseText; } }; ajax.send(null); } function DenunciarComment(COMMENT_ID){ var ajax=nuevoAjax(); document.getElementById('link_denuncia'+COMMENT_ID).style.visibility="hidden"; document.getElementById('denuncia'+COMMENT_ID).style.display='block'; ajax.open("GET", "/sections/events/eventsDenunciarCommentRun.php?comment_id="+COMMENT_ID, true); ajax.send(null); } function eventsDeleteComment(EVENT_ID,EVENT_COMMENT_ID){ location.href="/sections/events/eventsDelComment.php?event_id="+EVENT_ID+"&event_comment_id="+EVENT_COMMENT_ID; } function DenunciarEvent(EVENT_ID){ var ajax=nuevoAjax(); document.getElementById('link_denuncia'+EVENT_ID).style.visibility="hidden"; document.getElementById('denuncia'+EVENT_ID).style.display='block'; ajax.open("GET", "/sections/events/eventsDenunciarEventRun.php?event_id="+EVENT_ID, true); ajax.send(null); } function datosServidor(){};datosServidor.prototype.iniciar=function(){try{this._xh=new XMLHttpRequest();}catch(e){var _ieModelos=new Array('MSXML2.XMLHTTP.5.0','MSXML2.XMLHTTP.4.0','MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP');var success=false;for(var i=0;i<_ieModelos.length&&!success;i++){try{this._xh=new ActiveXObject(_ieModelos[i]);success=true;}catch(e){}} if(!success){return false;} return true;} return false;} datosServidor.prototype.ocupado=function(){estadoActual=this._xh.readyState;return(estadoActual&&(estadoActual<4));} datosServidor.prototype.procesa=function(){if(this._xh.readyState==4&&this._xh.status==200){this.procesado=true;}} datosServidor.prototype.enviar=function(urlget,datos){if(!this._xh){this.iniciar();} if(!this.ocupado()){this._xh.open("GET",urlget,false);this._xh.send(datos);if(this._xh.readyState==4&&this._xh.status==200){return this._xh.responseText;}} return false;} function _gr(reqseccion,divcont){remotos=new datosServidor;nt=remotos.enviar(reqseccion,"");document.getElementById(divcont).innerHTML=nt;} var urlBase="galleryValorationRun.php?";function rateImg(rating,imgId){document.getElementById('zonaEstrellada').innerHTML="
Cargando...
";remotos=new datosServidor;nt=remotos.enviar('/sections/gallery/galleryValorationRun.php?rating='+rating+'&imgId='+imgId+'&ms='+new Date().getTime());rating=rating*17;document.getElementById('zonaEstrellada').innerHTML=nt;document.getElementById('current-rating').style.width=rating+'px';} function ratePlayer(rating,PlayerId,MatchId){ var content = "
Cargando...
"; $('#'+PlayerId).html(content); remotos=new datosServidor; nt=remotos.enviar('/sections/partido/partido-valoracionrun.php?rating='+rating+'&jugador_id='+PlayerId+'&partido_id='+MatchId+'&ms='+new Date().getTime()); $('#'+PlayerId).html(nt); } function rateUser(rating,userId,rutaSite){document.getElementById('user-rating').innerHTML="
Cargando...
";remotos=new datosServidor;nt=remotos.enviar('/sections/perfil/ajax.userValoracionRun.php?rating='+rating+'&userId='+userId+'&ms='+new Date().getTime());rating=rating*25;document.getElementById('user-rating').innerHTML=nt;document.getElementById('current-rating-user').style.width=rating+'px';} function rateJugador(rating,jugadorId){remotos=new datosServidor;nt=remotos.enviar('/sections/plantilla/jugador-valoracionrun.php?rating='+rating+'&jugadorId='+jugadorId+'&ms='+new Date().getTime());rating=rating*25;document.getElementById('current-rating-user').style.width=rating+'px';document.getElementById('rating-total').innerHTML=nt;} function rateVideo(rating,videoId){document.getElementById('zonaEstrellada').innerHTML="
Cargando...
";remotos=new datosServidor;nt=remotos.enviar('/sections/videos/videosValorationRun.php?rating='+rating+'&videoId='+videoId+'&ms='+new Date().getTime());rating=rating*17;document.getElementById('zonaEstrellada').innerHTML=nt;document.getElementById('current-rating').style.width=rating+'px';} var urlBase="foroValorationRun.php?";function rateForo(rating,temaId){document.getElementById('temasValoracion').innerHTML="
Cargando...
";remotos=new datosServidor;nt=remotos.enviar('/sections/foro/foroValorationRun.php?rating='+rating+'&temaId='+temaId+'&ms='+new Date().getTime());rating=rating*17;document.getElementById('temasValoracion').innerHTML=nt;document.getElementById('current-rating').style.width=rating+'px';} //v1.7 // Flash Player Version Detection // Detect Client Browser type // Copyright 2005-2007 Adobe Systems Incorporated. All rights reserved. var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false; function ControlVersion() { var version; var axo; var e; // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry try { // version will be set for 7.X or greater players axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); version = axo.GetVariable("$version"); } catch (e) { } if (!version) { try { // version will be set for 6.X players only axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); // installed player is some revision of 6.0 // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29, // so we have to be careful. // default to the first public version version = "WIN 6,0,21,0"; // throws if AllowScripAccess does not exist (introduced in 6.0r47) axo.AllowScriptAccess = "always"; // safe to call for 6.0r47 or greater version = axo.GetVariable("$version"); } catch (e) { } } if (!version) { try { // version will be set for 4.X or 5.X player axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); version = axo.GetVariable("$version"); } catch (e) { } } if (!version) { try { // version will be set for 3.X player axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); version = "WIN 3,0,18,0"; } catch (e) { } } if (!version) { try { // version will be set for 2.X player axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); version = "WIN 2,0,0,11"; } catch (e) { version = -1; } } return version; } // JavaScript helper required to detect Flash Player PlugIn version information function GetSwfVer(){ // NS/Opera version >= 3 check for Flash plugin in plugin array var flashVer = -1; if (navigator.plugins != null && navigator.plugins.length > 0) { if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) { var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : ""; var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description; var descArray = flashDescription.split(" "); var tempArrayMajor = descArray[2].split("."); var versionMajor = tempArrayMajor[0]; var versionMinor = tempArrayMajor[1]; var versionRevision = descArray[3]; if (versionRevision == "") { versionRevision = descArray[4]; } if (versionRevision[0] == "d") { versionRevision = versionRevision.substring(1); } else if (versionRevision[0] == "r") { versionRevision = versionRevision.substring(1); if (versionRevision.indexOf("d") > 0) { versionRevision = versionRevision.substring(0, versionRevision.indexOf("d")); } } var flashVer = versionMajor + "." + versionMinor + "." + versionRevision; } } // MSN/WebTV 2.6 supports Flash 4 else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4; // WebTV 2.5 supports Flash 3 else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3; // older WebTV supports Flash 2 else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2; else if ( isIE && isWin && !isOpera ) { flashVer = ControlVersion(); } return flashVer; } // When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) { versionStr = GetSwfVer(); if (versionStr == -1 ) { return false; } else if (versionStr != 0) { if(isIE && isWin && !isOpera) { // Given "WIN 2,0,0,11" tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"] tempString = tempArray[1]; // "2,0,0,11" versionArray = tempString.split(","); // ['2', '0', '0', '11'] } else { versionArray = versionStr.split("."); } var versionMajor = versionArray[0]; var versionMinor = versionArray[1]; var versionRevision = versionArray[2]; // is the major.revision >= requested major.revision AND the minor version >= requested minor if (versionMajor > parseFloat(reqMajorVer)) { return true; } else if (versionMajor == parseFloat(reqMajorVer)) { if (versionMinor > parseFloat(reqMinorVer)) return true; else if (versionMinor == parseFloat(reqMinorVer)) { if (versionRevision >= parseFloat(reqRevision)) return true; } } return false; } } function AC_AddExtension(src, ext) { if (src.indexOf('?') != -1) return src.replace(/\?/, ext+'?'); else return src + ext; } function AC_Generateobj(objAttrs, params, embedAttrs) { var str = ''; if (isIE && isWin && !isOpera) { str += ' '; } str += ''; } else { str += '$1"); x++; } } function limpiaPalabra(palabra) { // Funcion encargada de sacarle el codigo HTML de la negrita a las palabras palabra=palabra.replace(//i, ""); palabra=palabra.replace(/<\/b>/i, ""); return palabra; } function coincideBusqueda(palabraEntera, primerasLetras) { /* Funcion para verificar que las primeras letras de busquedaActual sean iguales al contenido de busquedaAnterior. Se devuelve 1 si la verificacion es afirmativa */ if(primerasLetras==null) return 0; var verificaExpresion=new RegExp("^("+primerasLetras+")", "i"); if(verificaExpresion.test(palabraEntera)) return 1; else return 0; } function nuevaCadenaNula(valor) { /* Seteo cual fue la ultima busqueda que no arrojo resultados siempre y cuando la cadena nueva no comience con las letras de la ultima cadena que no arrojo resultados */ if(coincideBusqueda(valor, ultimaBusquedaNula)==0) ultimaBusquedaNula=valor; } function busquedaEnBD() { /* Funcion encargada de verificar si hay que buscar el nuevo valor ingresado en la base de datos en funcion de los resultados obtenidos en la ultima busqueda y en base a que la cadena bsucada anteriormente este dentro de la nueva cadena */ var valor=inputLista.value; if((coincideBusqueda(valor, busqueda)==1 && nuevaBusqueda==0) || coincideBusqueda(valor, ultimaBusquedaNula)==1) return 0; else return 1; } function filtraLista(valor) { // Funcion encargada de modificar la lista de nombres en base a la nueva busqueda var x=0; while(divLista.childNodes[x]!=null) { // Saco la negrita a los elementos del listado divLista.childNodes[x].innerHTML=limpiaPalabra(divLista.childNodes[x].innerHTML); if(coincideBusqueda(divLista.childNodes[x].innerHTML, valor)==0) { /* Si remuevo el elemento x, el elemento posterior pasa a ocupar la posicion de x, entonces quedaria sin revisar. Por eso disminuyo 1 valor a x */ divLista.removeChild(divLista.childNodes[x]); x--; } x++; } } function reiniciaSeleccion() { mouseFuera(); elementoSeleccionado=0; } function navegaTeclado(evento) { var teclaPresionada=(document.all) ? evento.keyCode : evento.which; switch(teclaPresionada) { case 40: if(elementoSeleccionado1) { mouseDentro(document.getElementById(parseInt(elementoSeleccionado)-1)); } return 0; case 13: if(divLista.style.display=="block" && elementoSeleccionado!=0) { clickLista(document.getElementById(elementoSeleccionado)) } return 0; default: return 1; } } function rellenaLista(qry_file) { var valor=inputLista.value; // Valido con una expresion regular el contenido de lo que el usuario ingresa var reg=/(^[a-zA-Z0-9.@ ]{2,40}$)/; if(!reg.test(valor)) divLista.style.display="none"; else { if(busquedaEnBD()==0) { // Si no hay que buscar el valor en la BD busqueda=valor; // Hago el filtrado de la nueva cadena ingresada filtraLista(valor); // Si no quedan elementos para mostrar en la lista if(divLista.childNodes[0]==null) { divLista.style.display="none"; nuevaCadenaNula(valor); } else { reiniciaSeleccion(); formateaLista(valor); } } else { /* Si se necesita verificar la base de datos, guardo el patron de busqueda con el que se busco y luego recibo en una variable si existen mas resultados de los que se van a mostrar */ busqueda=valor; var ajax=nuevoAjax(); ajax.open("POST", qry_file+"?", true); ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("busqueda="+valor); ajax.onreadystatechange=function() { if (ajax.readyState==4) { if(!ajax.responseText) { divLista.style.display="none"; } else { var respuesta=new Array(2); respuesta=ajax.responseText.split("&"); /* Obtengo un valor que representa si tengo que ir a BD en las proximas busquedas con cadena similar */ nuevaBusqueda=respuesta[0]; // Si se obtuvieron datos los muestro if(respuesta[1]!="vacio") { divLista.style.display="block"; divLista.innerHTML=respuesta[1]; // Coloco en negrita las palabras reiniciaSeleccion(); formateaLista(valor); } // En caso contrario seteo la busqueda actual como una busqueda sin resultados else nuevaCadenaNula(valor); } } } } } } function clickLista(elemento,jugador_id) { /* Se ejecuta cuando se hace clic en algun elemento de la lista. Se coloca en el input el valor del elemento clickeado */ v=1; valor=limpiaPalabra(elemento.innerHTML); busqueda=valor; inputLista.value=valor; divLista.style.display="none"; elemento.className="normal"; document.forms['idolo'].playerId.value=jugador_id; } function mouseFuera() { // Des-selecciono el elemento actualmente seleccionado, si es que hay alguno if(elementoSeleccionado!=0 && document.getElementById(elementoSeleccionado)) document.getElementById(elementoSeleccionado).className="normal"; } function mouseDentro(elemento) { mouseFuera(); elemento.className="resaltado"; // Establezco el nuevo elemento seleccionado elementoSeleccionado=elemento.id; } /*! * jQuery JavaScript Library v1.4.2 * http://jquery.com/ * * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2010, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Sat Feb 13 22:33:48 2010 -0500 */ (function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& (d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== "find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
a"; var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, "_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== "="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); (function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= {},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== "string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== 1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, ""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", ""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, "border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== "string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? "&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== 1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== "json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== "number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
"; a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": "pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); /*! * jQuery UI 1.8.2 * * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI */ (function($) { // prevent duplicate loading // this is only a problem because we proxy existing functions // and we don't want to double proxy them $.ui = $.ui || {}; if ($.ui.version) { return; } //Helper functions and ui object $.extend($.ui, { version: "1.8.2", // $.ui.plugin is deprecated. Use the proxy pattern instead. plugin: { add: function(module, option, set) { var proto = $.ui[module].prototype; for(var i in set) { proto.plugins[i] = proto.plugins[i] || []; proto.plugins[i].push([option, set[i]]); } }, call: function(instance, name, args) { var set = instance.plugins[name]; if(!set || !instance.element[0].parentNode) { return; } for (var i = 0; i < set.length; i++) { if (instance.options[set[i][0]]) { set[i][1].apply(instance.element, args); } } } }, contains: function(a, b) { return document.compareDocumentPosition ? a.compareDocumentPosition(b) & 16 : a !== b && a.contains(b); }, hasScroll: function(el, a) { //If overflow is hidden, the element might have extra content, but the user wants to hide it if ($(el).css('overflow') == 'hidden') { return false; } var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop', has = false; if (el[scroll] > 0) { return true; } // TODO: determine which cases actually cause this to happen // if the element doesn't have the scroll set, see if it's possible to // set the scroll el[scroll] = 1; has = (el[scroll] > 0); el[scroll] = 0; return has; }, isOverAxis: function(x, reference, size) { //Determines when x coordinate is over "b" element axis return (x > reference) && (x < (reference + size)); }, isOver: function(y, x, top, left, height, width) { //Determines when x, y coordinates is over "b" element return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width); }, keyCode: { ALT: 18, BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, COMMAND: 91, COMMAND_LEFT: 91, // COMMAND COMMAND_RIGHT: 93, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, MENU: 93, // COMMAND_RIGHT NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38, WINDOWS: 91 // COMMAND } }); //jQuery plugins $.fn.extend({ _focus: $.fn.focus, focus: function(delay, fn) { return typeof delay === 'number' ? this.each(function() { var elem = this; setTimeout(function() { $(elem).focus(); (fn && fn.call(elem)); }, delay); }) : this._focus.apply(this, arguments); }, enableSelection: function() { return this .attr('unselectable', 'off') .css('MozUserSelect', ''); }, disableSelection: function() { return this .attr('unselectable', 'on') .css('MozUserSelect', 'none'); }, scrollParent: function() { var scrollParent; if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { scrollParent = this.parents().filter(function() { return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); }).eq(0); } else { scrollParent = this.parents().filter(function() { return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); }).eq(0); } return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; }, zIndex: function(zIndex) { if (zIndex !== undefined) { return this.css('zIndex', zIndex); } if (this.length) { var elem = $(this[0]), position, value; while (elem.length && elem[0] !== document) { // Ignore z-index if position is set to a value where z-index is ignored by the browser // This makes behavior of this function consistent across browsers // WebKit always returns auto if the element is positioned position = elem.css('position'); if (position == 'absolute' || position == 'relative' || position == 'fixed') { // IE returns 0 when zIndex is not specified // other browsers return a string // we ignore the case of nested elements with an explicit value of 0 //
value = parseInt(elem.css('zIndex')); if (!isNaN(value) && value != 0) { return value; } } elem = elem.parent(); } } return 0; } }); //Additional selectors $.extend($.expr[':'], { data: function(elem, i, match) { return !!$.data(elem, match[3]); }, focusable: function(element) { var nodeName = element.nodeName.toLowerCase(), tabIndex = $.attr(element, 'tabindex'); return (/input|select|textarea|button|object/.test(nodeName) ? !element.disabled : 'a' == nodeName || 'area' == nodeName ? element.href || !isNaN(tabIndex) : !isNaN(tabIndex)) // the element and all of its ancestors must be visible // the browser may report that the area is hidden && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length; }, tabbable: function(element) { var tabIndex = $.attr(element, 'tabindex'); return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable'); } }); })(jQuery); /*! * jQuery UI Widget 1.8.2 * * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Widget */ (function( $ ) { var _remove = $.fn.remove; $.fn.remove = function( selector, keepData ) { return this.each(function() { if ( !keepData ) { if ( !selector || $.filter( selector, [ this ] ).length ) { $( "*", this ).add( this ).each(function() { $( this ).triggerHandler( "remove" ); }); } } return _remove.call( $(this), selector, keepData ); }); }; $.widget = function( name, base, prototype ) { var namespace = name.split( "." )[ 0 ], fullName; name = name.split( "." )[ 1 ]; fullName = namespace + "-" + name; if ( !prototype ) { prototype = base; base = $.Widget; } // create selector for plugin $.expr[ ":" ][ fullName ] = function( elem ) { return !!$.data( elem, name ); }; $[ namespace ] = $[ namespace ] || {}; $[ namespace ][ name ] = function( options, element ) { // allow instantiation without initializing for simple inheritance if ( arguments.length ) { this._createWidget( options, element ); } }; var basePrototype = new base(); // we need to make the options hash a property directly on the new instance // otherwise we'll modify the options hash on the prototype that we're // inheriting from // $.each( basePrototype, function( key, val ) { // if ( $.isPlainObject(val) ) { // basePrototype[ key ] = $.extend( {}, val ); // } // }); basePrototype.options = $.extend( {}, basePrototype.options ); $[ namespace ][ name ].prototype = $.extend( true, basePrototype, { namespace: namespace, widgetName: name, widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name, widgetBaseClass: fullName }, prototype ); $.widget.bridge( name, $[ namespace ][ name ] ); }; $.widget.bridge = function( name, object ) { $.fn[ name ] = function( options ) { var isMethodCall = typeof options === "string", args = Array.prototype.slice.call( arguments, 1 ), returnValue = this; // allow multiple hashes to be passed on init options = !isMethodCall && args.length ? $.extend.apply( null, [ true, options ].concat(args) ) : options; // prevent calls to internal methods if ( isMethodCall && options.substring( 0, 1 ) === "_" ) { return returnValue; } if ( isMethodCall ) { this.each(function() { var instance = $.data( this, name ), methodValue = instance && $.isFunction( instance[options] ) ? instance[ options ].apply( instance, args ) : instance; if ( methodValue !== instance && methodValue !== undefined ) { returnValue = methodValue; return false; } }); } else { this.each(function() { var instance = $.data( this, name ); if ( instance ) { if ( options ) { instance.option( options ); } instance._init(); } else { $.data( this, name, new object( options, this ) ); } }); } return returnValue; }; }; $.Widget = function( options, element ) { // allow instantiation without initializing for simple inheritance if ( arguments.length ) { this._createWidget( options, element ); } }; $.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", options: { disabled: false }, _createWidget: function( options, element ) { // $.widget.bridge stores the plugin instance, but we do it anyway // so that it's stored even before the _create function runs this.element = $( element ).data( this.widgetName, this ); this.options = $.extend( true, {}, this.options, $.metadata && $.metadata.get( element )[ this.widgetName ], options ); var self = this; this.element.bind( "remove." + this.widgetName, function() { self.destroy(); }); this._create(); this._init(); }, _create: function() {}, _init: function() {}, destroy: function() { this.element .unbind( "." + this.widgetName ) .removeData( this.widgetName ); this.widget() .unbind( "." + this.widgetName ) .removeAttr( "aria-disabled" ) .removeClass( this.widgetBaseClass + "-disabled " + "ui-state-disabled" ); }, widget: function() { return this.element; }, option: function( key, value ) { var options = key, self = this; if ( arguments.length === 0 ) { // don't return a reference to the internal hash return $.extend( {}, self.options ); } if (typeof key === "string" ) { if ( value === undefined ) { return this.options[ key ]; } options = {}; options[ key ] = value; } $.each( options, function( key, value ) { self._setOption( key, value ); }); return self; }, _setOption: function( key, value ) { this.options[ key ] = value; if ( key === "disabled" ) { this.widget() [ value ? "addClass" : "removeClass"]( this.widgetBaseClass + "-disabled" + " " + "ui-state-disabled" ) .attr( "aria-disabled", value ); } return this; }, enable: function() { return this._setOption( "disabled", false ); }, disable: function() { return this._setOption( "disabled", true ); }, _trigger: function( type, event, data ) { var callback = this.options[ type ]; event = $.Event( event ); event.type = ( type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type ).toLowerCase(); data = data || {}; // copy original event properties over to the new event // this would happen if we could call $.event.fix instead of $.Event // but we don't have a way to force an event to be fixed multiple times if ( event.originalEvent ) { for ( var i = $.event.props.length, prop; i; ) { prop = $.event.props[ --i ]; event[ prop ] = event.originalEvent[ prop ]; } } this.element.trigger( event, data ); return !( $.isFunction(callback) && callback.call( this.element[0], event, data ) === false || event.isDefaultPrevented() ); } }; })( jQuery ); /*! * jQuery UI Mouse 1.8.2 * * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Mouse * * Depends: * jquery.ui.widget.js */ (function($) { $.widget("ui.mouse", { options: { cancel: ':input,option', distance: 1, delay: 0 }, _mouseInit: function() { var self = this; this.element .bind('mousedown.'+this.widgetName, function(event) { return self._mouseDown(event); }) .bind('click.'+this.widgetName, function(event) { if(self._preventClickEvent) { self._preventClickEvent = false; event.stopImmediatePropagation(); return false; } }); this.started = false; }, // TODO: make sure destroying one instance of mouse doesn't mess with // other instances of mouse _mouseDestroy: function() { this.element.unbind('.'+this.widgetName); }, _mouseDown: function(event) { // don't let more than one widget handle mouseStart // TODO: figure out why we have to use originalEvent event.originalEvent = event.originalEvent || {}; if (event.originalEvent.mouseHandled) { return; } // we may have missed mouseup (out of window) (this._mouseStarted && this._mouseUp(event)); this._mouseDownEvent = event; var self = this, btnIsLeft = (event.which == 1), elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false); if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { return true; } this.mouseDelayMet = !this.options.delay; if (!this.mouseDelayMet) { this._mouseDelayTimer = setTimeout(function() { self.mouseDelayMet = true; }, this.options.delay); } if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { this._mouseStarted = (this._mouseStart(event) !== false); if (!this._mouseStarted) { event.preventDefault(); return true; } } // these delegates are required to keep context this._mouseMoveDelegate = function(event) { return self._mouseMove(event); }; this._mouseUpDelegate = function(event) { return self._mouseUp(event); }; $(document) .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); // preventDefault() is used to prevent the selection of text here - // however, in Safari, this causes select boxes not to be selectable // anymore, so this fix is needed ($.browser.safari || event.preventDefault()); event.originalEvent.mouseHandled = true; return true; }, _mouseMove: function(event) { // IE mouseup check - mouseup happened when mouse was out of window if ($.browser.msie && !event.button) { return this._mouseUp(event); } if (this._mouseStarted) { this._mouseDrag(event); return event.preventDefault(); } if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { this._mouseStarted = (this._mouseStart(this._mouseDownEvent, event) !== false); (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); } return !this._mouseStarted; }, _mouseUp: function(event) { $(document) .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); if (this._mouseStarted) { this._mouseStarted = false; this._preventClickEvent = (event.target == this._mouseDownEvent.target); this._mouseStop(event); } return false; }, _mouseDistanceMet: function(event) { return (Math.max( Math.abs(this._mouseDownEvent.pageX - event.pageX), Math.abs(this._mouseDownEvent.pageY - event.pageY) ) >= this.options.distance ); }, _mouseDelayMet: function(event) { return this.mouseDelayMet; }, // These are placeholder methods, to be overriden by extending plugin _mouseStart: function(event) {}, _mouseDrag: function(event) {}, _mouseStop: function(event) {}, _mouseCapture: function(event) { return true; } }); })(jQuery); /* * jQuery UI Slider 1.8.2 * * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Slider * * Depends: * jquery.ui.core.js * jquery.ui.mouse.js * jquery.ui.widget.js */ (function( $ ) { // number of pages in a slider // (how many times can you page up/down to go through the whole range) var numPages = 5; $.widget( "ui.slider", $.ui.mouse, { widgetEventPrefix: "slide", options: { animate: false, distance: 0, max: 100, min: 0, orientation: "horizontal", range: false, step: 1, value: 0, values: null }, _create: function() { var self = this, o = this.options; this._keySliding = false; this._mouseSliding = false; this._animateOff = true; this._handleIndex = null; this._detectOrientation(); this._mouseInit(); this.element .addClass( "ui-slider" + " ui-slider-" + this.orientation + " ui-widget" + " ui-widget-content" + " ui-corner-all" ); if ( o.disabled ) { this.element.addClass( "ui-slider-disabled ui-disabled" ); } this.range = $([]); if ( o.range ) { if ( o.range === true ) { this.range = $( "
" ); if ( !o.values ) { o.values = [ this._valueMin(), this._valueMin() ]; } if ( o.values.length && o.values.length !== 2 ) { o.values = [ o.values[0], o.values[0] ]; } } else { this.range = $( "
" ); } this.range .appendTo( this.element ) .addClass( "ui-slider-range" ); if ( o.range === "min" || o.range === "max" ) { this.range.addClass( "ui-slider-range-" + o.range ); } // note: this isn't the most fittingly semantic framework class for this element, // but worked best visually with a variety of themes this.range.addClass( "ui-widget-header" ); } if ( $( ".ui-slider-handle", this.element ).length === 0 ) { $( "" ) .appendTo( this.element ) .addClass( "ui-slider-handle" ); } if ( o.values && o.values.length ) { while ( $(".ui-slider-handle", this.element).length < o.values.length ) { $( "" ) .appendTo( this.element ) .addClass( "ui-slider-handle" ); } } this.handles = $( ".ui-slider-handle", this.element ) .addClass( "ui-state-default" + " ui-corner-all" ); this.handle = this.handles.eq( 0 ); this.handles.add( this.range ).filter( "a" ) .click(function( event ) { event.preventDefault(); }) .hover(function() { if ( !o.disabled ) { $( this ).addClass( "ui-state-hover" ); } }, function() { $( this ).removeClass( "ui-state-hover" ); }) .focus(function() { if ( !o.disabled ) { $( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" ); $( this ).addClass( "ui-state-focus" ); } else { $( this ).blur(); } }) .blur(function() { $( this ).removeClass( "ui-state-focus" ); }); this.handles.each(function( i ) { $( this ).data( "index.ui-slider-handle", i ); }); this.handles .keydown(function( event ) { var ret = true, index = $( this ).data( "index.ui-slider-handle" ), allowed, curVal, newVal, step; if ( self.options.disabled ) { return; } switch ( event.keyCode ) { case $.ui.keyCode.HOME: case $.ui.keyCode.END: case $.ui.keyCode.PAGE_UP: case $.ui.keyCode.PAGE_DOWN: case $.ui.keyCode.UP: case $.ui.keyCode.RIGHT: case $.ui.keyCode.DOWN: case $.ui.keyCode.LEFT: ret = false; if ( !self._keySliding ) { self._keySliding = true; $( this ).addClass( "ui-state-active" ); allowed = self._start( event, index ); if ( allowed === false ) { return; } } break; } step = self.options.step; if ( self.options.values && self.options.values.length ) { curVal = newVal = self.values( index ); } else { curVal = newVal = self.value(); } switch ( event.keyCode ) { case $.ui.keyCode.HOME: newVal = self._valueMin(); break; case $.ui.keyCode.END: newVal = self._valueMax(); break; case $.ui.keyCode.PAGE_UP: newVal = self._trimAlignValue( curVal + ( (self._valueMax() - self._valueMin()) / numPages ) ); break; case $.ui.keyCode.PAGE_DOWN: newVal = self._trimAlignValue( curVal - ( (self._valueMax() - self._valueMin()) / numPages ) ); break; case $.ui.keyCode.UP: case $.ui.keyCode.RIGHT: if ( curVal === self._valueMax() ) { return; } newVal = self._trimAlignValue( curVal + step ); break; case $.ui.keyCode.DOWN: case $.ui.keyCode.LEFT: if ( curVal === self._valueMin() ) { return; } newVal = self._trimAlignValue( curVal - step ); break; } self._slide( event, index, newVal ); return ret; }) .keyup(function( event ) { var index = $( this ).data( "index.ui-slider-handle" ); if ( self._keySliding ) { self._keySliding = false; self._stop( event, index ); self._change( event, index ); $( this ).removeClass( "ui-state-active" ); } }); this._refreshValue(); this._animateOff = false; }, destroy: function() { this.handles.remove(); this.range.remove(); this.element .removeClass( "ui-slider" + " ui-slider-horizontal" + " ui-slider-vertical" + " ui-slider-disabled" + " ui-widget" + " ui-widget-content" + " ui-corner-all" ) .removeData( "slider" ) .unbind( ".slider" ); this._mouseDestroy(); return this; }, _mouseCapture: function( event ) { var o = this.options, position, normValue, distance, closestHandle, self, index, allowed, offset, mouseOverHandle; if ( o.disabled ) { return false; } this.elementSize = { width: this.element.outerWidth(), height: this.element.outerHeight() }; this.elementOffset = this.element.offset(); position = { x: event.pageX, y: event.pageY }; normValue = this._normValueFromMouse( position ); distance = this._valueMax() - this._valueMin() + 1; self = this; this.handles.each(function( i ) { var thisDistance = Math.abs( normValue - self.values(i) ); if ( distance > thisDistance ) { distance = thisDistance; closestHandle = $( this ); index = i; } }); // workaround for bug #3736 (if both handles of a range are at 0, // the first is always used as the one with least distance, // and moving it is obviously prevented by preventing negative ranges) if( o.range === true && this.values(1) === o.min ) { index += 1; closestHandle = $( this.handles[index] ); } allowed = this._start( event, index ); if ( allowed === false ) { return false; } this._mouseSliding = true; self._handleIndex = index; closestHandle .addClass( "ui-state-active" ) .focus(); offset = closestHandle.offset(); mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" ); this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { left: event.pageX - offset.left - ( closestHandle.width() / 2 ), top: event.pageY - offset.top - ( closestHandle.height() / 2 ) - ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) - ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) + ( parseInt( closestHandle.css("marginTop"), 10 ) || 0) }; normValue = this._normValueFromMouse( position ); this._slide( event, index, normValue ); this._animateOff = true; return true; }, _mouseStart: function( event ) { return true; }, _mouseDrag: function( event ) { var position = { x: event.pageX, y: event.pageY }, normValue = this._normValueFromMouse( position ); this._slide( event, this._handleIndex, normValue ); return false; }, _mouseStop: function( event ) { this.handles.removeClass( "ui-state-active" ); this._mouseSliding = false; this._stop( event, this._handleIndex ); this._change( event, this._handleIndex ); this._handleIndex = null; this._clickOffset = null; this._animateOff = false; return false; }, _detectOrientation: function() { this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal"; }, _normValueFromMouse: function( position ) { var pixelTotal, pixelMouse, percentMouse, valueTotal, valueMouse; if ( this.orientation === "horizontal" ) { pixelTotal = this.elementSize.width; pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 ); } else { pixelTotal = this.elementSize.height; pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 ); } percentMouse = ( pixelMouse / pixelTotal ); if ( percentMouse > 1 ) { percentMouse = 1; } if ( percentMouse < 0 ) { percentMouse = 0; } if ( this.orientation === "vertical" ) { percentMouse = 1 - percentMouse; } valueTotal = this._valueMax() - this._valueMin(); valueMouse = this._valueMin() + percentMouse * valueTotal; return this._trimAlignValue( valueMouse ); }, _start: function( event, index ) { var uiHash = { handle: this.handles[ index ], value: this.value() }; if ( this.options.values && this.options.values.length ) { uiHash.value = this.values( index ); uiHash.values = this.values(); } return this._trigger( "start", event, uiHash ); }, _slide: function( event, index, newVal ) { var otherVal, newValues, allowed; if ( this.options.values && this.options.values.length ) { otherVal = this.values( index ? 0 : 1 ); if ( ( this.options.values.length === 2 && this.options.range === true ) && ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) ) ) { newVal = otherVal; } if ( newVal !== this.values( index ) ) { newValues = this.values(); newValues[ index ] = newVal; // A slide can be canceled by returning false from the slide callback allowed = this._trigger( "slide", event, { handle: this.handles[ index ], value: newVal, values: newValues } ); otherVal = this.values( index ? 0 : 1 ); if ( allowed !== false ) { this.values( index, newVal, true ); } } } else { if ( newVal !== this.value() ) { // A slide can be canceled by returning false from the slide callback allowed = this._trigger( "slide", event, { handle: this.handles[ index ], value: newVal } ); if ( allowed !== false ) { this.value( newVal ); } } } }, _stop: function( event, index ) { var uiHash = { handle: this.handles[ index ], value: this.value() }; if ( this.options.values && this.options.values.length ) { uiHash.value = this.values( index ); uiHash.values = this.values(); } this._trigger( "stop", event, uiHash ); }, _change: function( event, index ) { if ( !this._keySliding && !this._mouseSliding ) { var uiHash = { handle: this.handles[ index ], value: this.value() }; if ( this.options.values && this.options.values.length ) { uiHash.value = this.values( index ); uiHash.values = this.values(); } this._trigger( "change", event, uiHash ); } }, value: function( newValue ) { if ( arguments.length ) { this.options.value = this._trimAlignValue( newValue ); this._refreshValue(); this._change( null, 0 ); } return this._value(); }, values: function( index, newValue ) { var vals, newValues, i; if ( arguments.length > 1 ) { this.options.values[ index ] = this._trimAlignValue( newValue ); this._refreshValue(); this._change( null, index ); } if ( arguments.length ) { if ( $.isArray( arguments[ 0 ] ) ) { vals = this.options.values; newValues = arguments[ 0 ]; for ( i = 0; i < vals.length; i += 1 ) { vals[ i ] = this._trimAlignValue( newValues[ i ] ); this._change( null, i ); } this._refreshValue(); } else { if ( this.options.values && this.options.values.length ) { return this._values( index ); } else { return this.value(); } } } else { return this._values(); } }, _setOption: function( key, value ) { var i, valsLength = 0; if ( $.isArray( this.options.values ) ) { valsLength = this.options.values.length; } $.Widget.prototype._setOption.apply( this, arguments ); switch ( key ) { case "disabled": if ( value ) { this.handles.filter( ".ui-state-focus" ).blur(); this.handles.removeClass( "ui-state-hover" ); this.handles.attr( "disabled", "disabled" ); this.element.addClass( "ui-disabled" ); } else { this.handles.removeAttr( "disabled" ); this.element.removeClass( "ui-disabled" ); } break; case "orientation": this._detectOrientation(); this.element .removeClass( "ui-slider-horizontal ui-slider-vertical" ) .addClass( "ui-slider-" + this.orientation ); this._refreshValue(); break; case "value": this._animateOff = true; this._refreshValue(); this._change( null, 0 ); this._animateOff = false; break; case "values": this._animateOff = true; this._refreshValue(); for ( i = 0; i < valsLength; i += 1 ) { this._change( null, i ); } this._animateOff = false; break; } }, //internal value getter // _value() returns value trimmed by min and max, aligned by step _value: function() { var val = this.options.value; val = this._trimAlignValue( val ); return val; }, //internal values getter // _values() returns array of values trimmed by min and max, aligned by step // _values( index ) returns single value trimmed by min and max, aligned by step _values: function( index ) { var val, vals, i; if ( arguments.length ) { val = this.options.values[ index ]; val = this._trimAlignValue( val ); return val; } else { // .slice() creates a copy of the array // this copy gets trimmed by min and max and then returned vals = this.options.values.slice(); for ( i = 0; i < vals.length; i+= 1) { vals[ i ] = this._trimAlignValue( vals[ i ] ); } return vals; } }, // returns the step-aligned value that val is closest to, between (inclusive) min and max _trimAlignValue: function( val ) { if ( val < this._valueMin() ) { return this._valueMin(); } if ( val > this._valueMax() ) { return this._valueMax(); } var step = ( this.options.step > 0 ) ? this.options.step : 1, valModStep = val % step, alignValue = val - valModStep; if ( Math.abs(valModStep) * 2 >= step ) { alignValue += ( valModStep > 0 ) ? step : ( -step ); } // Since JavaScript has problems with large floats, round // the final value to 5 digits after the decimal point (see #4124) return parseFloat( alignValue.toFixed(5) ); }, _valueMin: function() { return this.options.min; }, _valueMax: function() { return this.options.max; }, _refreshValue: function() { var oRange = this.options.range, o = this.options, self = this, animate = ( !this._animateOff ) ? o.animate : false, valPercent, _set = {}, lastValPercent, value, valueMin, valueMax; if ( this.options.values && this.options.values.length ) { this.handles.each(function( i, j ) { valPercent = ( self.values(i) - self._valueMin() ) / ( self._valueMax() - self._valueMin() ) * 100; _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); if ( self.options.range === true ) { if ( self.orientation === "horizontal" ) { if ( i === 0 ) { self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate ); } if ( i === 1 ) { self.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); } } else { if ( i === 0 ) { self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate ); } if ( i === 1 ) { self.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); } } } lastValPercent = valPercent; }); } else { value = this.value(); valueMin = this._valueMin(); valueMax = this._valueMax(); valPercent = ( valueMax !== valueMin ) ? ( value - valueMin ) / ( valueMax - valueMin ) * 100 : 0; _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); if ( oRange === "min" && this.orientation === "horizontal" ) { this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate ); } if ( oRange === "max" && this.orientation === "horizontal" ) { this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); } if ( oRange === "min" && this.orientation === "vertical" ) { this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate ); } if ( oRange === "max" && this.orientation === "vertical" ) { this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); } } } }); $.extend( $.ui.slider, { version: "1.8.2" }); }(jQuery)); /* * jQuery UI Tabs 1.8.2 * * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Tabs * * Depends: * jquery.ui.core.js * jquery.ui.widget.js */ (function($) { var tabId = 0, listId = 0; function getNextTabId() { return ++tabId; } function getNextListId() { return ++listId; } $.widget("ui.tabs", { options: { add: null, ajaxOptions: null, cache: false, cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true } collapsible: false, disable: null, disabled: [], enable: null, event: 'click', fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 } idPrefix: 'ui-tabs-', load: null, panelTemplate: '
', remove: null, select: null, show: null, spinner: 'Loading…', tabTemplate: '
  • #{label}
  • ' }, _create: function() { this._tabify(true); }, _setOption: function(key, value) { if (key == 'selected') { if (this.options.collapsible && value == this.options.selected) { return; } this.select(value); } else { this.options[key] = value; this._tabify(); } }, _tabId: function(a) { return a.title && a.title.replace(/\s/g, '_').replace(/[^A-Za-z0-9\-_:\.]/g, '') || this.options.idPrefix + getNextTabId(); }, _sanitizeSelector: function(hash) { return hash.replace(/:/g, '\\:'); // we need this because an id may contain a ":" }, _cookie: function() { var cookie = this.cookie || (this.cookie = this.options.cookie.name || 'ui-tabs-' + getNextListId()); return $.cookie.apply(null, [cookie].concat($.makeArray(arguments))); }, _ui: function(tab, panel) { return { tab: tab, panel: panel, index: this.anchors.index(tab) }; }, _cleanup: function() { // restore all former loading tabs labels this.lis.filter('.ui-state-processing').removeClass('ui-state-processing') .find('span:data(label.tabs)') .each(function() { var el = $(this); el.html(el.data('label.tabs')).removeData('label.tabs'); }); }, _tabify: function(init) { this.list = this.element.find('ol,ul').eq(0); this.lis = $('li:has(a[href])', this.list); this.anchors = this.lis.map(function() { return $('a', this)[0]; }); this.panels = $([]); var self = this, o = this.options; var fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash this.anchors.each(function(i, a) { var href = $(a).attr('href'); // For dynamically created HTML that contains a hash as href IE < 8 expands // such href to the full page url with hash and then misinterprets tab as ajax. // Same consideration applies for an added tab with a fragment identifier // since a[href=#fragment-identifier] does unexpectedly not match. // Thus normalize href attribute... var hrefBase = href.split('#')[0], baseEl; if (hrefBase && (hrefBase === location.toString().split('#')[0] || (baseEl = $('base')[0]) && hrefBase === baseEl.href)) { href = a.hash; a.href = href; } // inline tab if (fragmentId.test(href)) { self.panels = self.panels.add(self._sanitizeSelector(href)); } // remote tab else if (href != '#') { // prevent loading the page itself if href is just "#" $.data(a, 'href.tabs', href); // required for restore on destroy // TODO until #3808 is fixed strip fragment identifier from url // (IE fails to load from such url) $.data(a, 'load.tabs', href.replace(/#.*$/, '')); // mutable data var id = self._tabId(a); a.href = '#' + id; var $panel = $('#' + id); if (!$panel.length) { $panel = $(o.panelTemplate).attr('id', id).addClass('ui-tabs-panel ui-widget-content ui-corner-bottom') .insertAfter(self.panels[i - 1] || self.list); $panel.data('destroy.tabs', true); } self.panels = self.panels.add($panel); } // invalid tab href else { o.disabled.push(i); } }); // initialization from scratch if (init) { // attach necessary classes for styling this.element.addClass('ui-tabs ui-widget ui-widget-content ui-corner-all'); this.list.addClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all'); this.lis.addClass('ui-state-default ui-corner-top'); this.panels.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom'); // Selected tab // use "selected" option or try to retrieve: // 1. from fragment identifier in url // 2. from cookie // 3. from selected class attribute on
  • if (o.selected === undefined) { if (location.hash) { this.anchors.each(function(i, a) { if (a.hash == location.hash) { o.selected = i; return false; // break } }); } if (typeof o.selected != 'number' && o.cookie) { o.selected = parseInt(self._cookie(), 10); } if (typeof o.selected != 'number' && this.lis.filter('.ui-tabs-selected').length) { o.selected = this.lis.index(this.lis.filter('.ui-tabs-selected')); } o.selected = o.selected || (this.lis.length ? 0 : -1); } else if (o.selected === null) { // usage of null is deprecated, TODO remove in next release o.selected = -1; } // sanity check - default to first tab... o.selected = ((o.selected >= 0 && this.anchors[o.selected]) || o.selected < 0) ? o.selected : 0; // Take disabling tabs via class attribute from HTML // into account and update option properly. // A selected tab cannot become disabled. o.disabled = $.unique(o.disabled.concat( $.map(this.lis.filter('.ui-state-disabled'), function(n, i) { return self.lis.index(n); } ) )).sort(); if ($.inArray(o.selected, o.disabled) != -1) { o.disabled.splice($.inArray(o.selected, o.disabled), 1); } // highlight selected tab this.panels.addClass('ui-tabs-hide'); this.lis.removeClass('ui-tabs-selected ui-state-active'); if (o.selected >= 0 && this.anchors.length) { // check for length avoids error when initializing empty list this.panels.eq(o.selected).removeClass('ui-tabs-hide'); this.lis.eq(o.selected).addClass('ui-tabs-selected ui-state-active'); // seems to be expected behavior that the show callback is fired self.element.queue("tabs", function() { self._trigger('show', null, self._ui(self.anchors[o.selected], self.panels[o.selected])); }); this.load(o.selected); } // clean up to avoid memory leaks in certain versions of IE 6 $(window).bind('unload', function() { self.lis.add(self.anchors).unbind('.tabs'); self.lis = self.anchors = self.panels = null; }); } // update selected after add/remove else { o.selected = this.lis.index(this.lis.filter('.ui-tabs-selected')); } // update collapsible this.element[o.collapsible ? 'addClass' : 'removeClass']('ui-tabs-collapsible'); // set or update cookie after init and add/remove respectively if (o.cookie) { this._cookie(o.selected, o.cookie); } // disable tabs for (var i = 0, li; (li = this.lis[i]); i++) { $(li)[$.inArray(i, o.disabled) != -1 && !$(li).hasClass('ui-tabs-selected') ? 'addClass' : 'removeClass']('ui-state-disabled'); } // reset cache if switching from cached to not cached if (o.cache === false) { this.anchors.removeData('cache.tabs'); } // remove all handlers before, tabify may run on existing tabs after add or option change this.lis.add(this.anchors).unbind('.tabs'); if (o.event != 'mouseover') { var addState = function(state, el) { if (el.is(':not(.ui-state-disabled)')) { el.addClass('ui-state-' + state); } }; var removeState = function(state, el) { el.removeClass('ui-state-' + state); }; this.lis.bind('mouseover.tabs', function() { addState('hover', $(this)); }); this.lis.bind('mouseout.tabs', function() { removeState('hover', $(this)); }); this.anchors.bind('focus.tabs', function() { addState('focus', $(this).closest('li')); }); this.anchors.bind('blur.tabs', function() { removeState('focus', $(this).closest('li')); }); } // set up animations var hideFx, showFx; if (o.fx) { if ($.isArray(o.fx)) { hideFx = o.fx[0]; showFx = o.fx[1]; } else { hideFx = showFx = o.fx; } } // Reset certain styles left over from animation // and prevent IE's ClearType bug... function resetStyle($el, fx) { $el.css({ display: '' }); if (!$.support.opacity && fx.opacity) { $el[0].style.removeAttribute('filter'); } } // Show a tab... var showTab = showFx ? function(clicked, $show) { $(clicked).closest('li').addClass('ui-tabs-selected ui-state-active'); $show.hide().removeClass('ui-tabs-hide') // avoid flicker that way .animate(showFx, showFx.duration || 'normal', function() { resetStyle($show, showFx); self._trigger('show', null, self._ui(clicked, $show[0])); }); } : function(clicked, $show) { $(clicked).closest('li').addClass('ui-tabs-selected ui-state-active'); $show.removeClass('ui-tabs-hide'); self._trigger('show', null, self._ui(clicked, $show[0])); }; // Hide a tab, $show is optional... var hideTab = hideFx ? function(clicked, $hide) { $hide.animate(hideFx, hideFx.duration || 'normal', function() { self.lis.removeClass('ui-tabs-selected ui-state-active'); $hide.addClass('ui-tabs-hide'); resetStyle($hide, hideFx); self.element.dequeue("tabs"); }); } : function(clicked, $hide, $show) { self.lis.removeClass('ui-tabs-selected ui-state-active'); $hide.addClass('ui-tabs-hide'); self.element.dequeue("tabs"); }; // attach tab event handler, unbind to avoid duplicates from former tabifying... this.anchors.bind(o.event + '.tabs', function() { var el = this, $li = $(this).closest('li'), $hide = self.panels.filter(':not(.ui-tabs-hide)'), $show = $(self._sanitizeSelector(this.hash)); // If tab is already selected and not collapsible or tab disabled or // or is already loading or click callback returns false stop here. // Check if click handler returns false last so that it is not executed // for a disabled or loading tab! if (($li.hasClass('ui-tabs-selected') && !o.collapsible) || $li.hasClass('ui-state-disabled') || $li.hasClass('ui-state-processing') || self._trigger('select', null, self._ui(this, $show[0])) === false) { this.blur(); return false; } o.selected = self.anchors.index(this); self.abort(); // if tab may be closed if (o.collapsible) { if ($li.hasClass('ui-tabs-selected')) { o.selected = -1; if (o.cookie) { self._cookie(o.selected, o.cookie); } self.element.queue("tabs", function() { hideTab(el, $hide); }).dequeue("tabs"); this.blur(); return false; } else if (!$hide.length) { if (o.cookie) { self._cookie(o.selected, o.cookie); } self.element.queue("tabs", function() { showTab(el, $show); }); self.load(self.anchors.index(this)); // TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171 this.blur(); return false; } } if (o.cookie) { self._cookie(o.selected, o.cookie); } // show new tab if ($show.length) { if ($hide.length) { self.element.queue("tabs", function() { hideTab(el, $hide); }); } self.element.queue("tabs", function() { showTab(el, $show); }); self.load(self.anchors.index(this)); } else { throw 'jQuery UI Tabs: Mismatching fragment identifier.'; } // Prevent IE from keeping other link focussed when using the back button // and remove dotted border from clicked link. This is controlled via CSS // in modern browsers; blur() removes focus from address bar in Firefox // which can become a usability and annoying problem with tabs('rotate'). if ($.browser.msie) { this.blur(); } }); // disable click in any case this.anchors.bind('click.tabs', function(){return false;}); }, destroy: function() { var o = this.options; this.abort(); this.element.unbind('.tabs') .removeClass('ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible') .removeData('tabs'); this.list.removeClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all'); this.anchors.each(function() { var href = $.data(this, 'href.tabs'); if (href) { this.href = href; } var $this = $(this).unbind('.tabs'); $.each(['href', 'load', 'cache'], function(i, prefix) { $this.removeData(prefix + '.tabs'); }); }); this.lis.unbind('.tabs').add(this.panels).each(function() { if ($.data(this, 'destroy.tabs')) { $(this).remove(); } else { $(this).removeClass([ 'ui-state-default', 'ui-corner-top', 'ui-tabs-selected', 'ui-state-active', 'ui-state-hover', 'ui-state-focus', 'ui-state-disabled', 'ui-tabs-panel', 'ui-widget-content', 'ui-corner-bottom', 'ui-tabs-hide' ].join(' ')); } }); if (o.cookie) { this._cookie(null, o.cookie); } return this; }, add: function(url, label, index) { if (index === undefined) { index = this.anchors.length; // append by default } var self = this, o = this.options, $li = $(o.tabTemplate.replace(/#\{href\}/g, url).replace(/#\{label\}/g, label)), id = !url.indexOf('#') ? url.replace('#', '') : this._tabId($('a', $li)[0]); $li.addClass('ui-state-default ui-corner-top').data('destroy.tabs', true); // try to find an existing element before creating a new one var $panel = $('#' + id); if (!$panel.length) { $panel = $(o.panelTemplate).attr('id', id).data('destroy.tabs', true); } $panel.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide'); if (index >= this.lis.length) { $li.appendTo(this.list); $panel.appendTo(this.list[0].parentNode); } else { $li.insertBefore(this.lis[index]); $panel.insertBefore(this.panels[index]); } o.disabled = $.map(o.disabled, function(n, i) { return n >= index ? ++n : n; }); this._tabify(); if (this.anchors.length == 1) { // after tabify o.selected = 0; $li.addClass('ui-tabs-selected ui-state-active'); $panel.removeClass('ui-tabs-hide'); this.element.queue("tabs", function() { self._trigger('show', null, self._ui(self.anchors[0], self.panels[0])); }); this.load(0); } // callback this._trigger('add', null, this._ui(this.anchors[index], this.panels[index])); return this; }, remove: function(index) { var o = this.options, $li = this.lis.eq(index).remove(), $panel = this.panels.eq(index).remove(); // If selected tab was removed focus tab to the right or // in case the last tab was removed the tab to the left. if ($li.hasClass('ui-tabs-selected') && this.anchors.length > 1) { this.select(index + (index + 1 < this.anchors.length ? 1 : -1)); } o.disabled = $.map($.grep(o.disabled, function(n, i) { return n != index; }), function(n, i) { return n >= index ? --n : n; }); this._tabify(); // callback this._trigger('remove', null, this._ui($li.find('a')[0], $panel[0])); return this; }, enable: function(index) { var o = this.options; if ($.inArray(index, o.disabled) == -1) { return; } this.lis.eq(index).removeClass('ui-state-disabled'); o.disabled = $.grep(o.disabled, function(n, i) { return n != index; }); // callback this._trigger('enable', null, this._ui(this.anchors[index], this.panels[index])); return this; }, disable: function(index) { var self = this, o = this.options; if (index != o.selected) { // cannot disable already selected tab this.lis.eq(index).addClass('ui-state-disabled'); o.disabled.push(index); o.disabled.sort(); // callback this._trigger('disable', null, this._ui(this.anchors[index], this.panels[index])); } return this; }, select: function(index) { if (typeof index == 'string') { index = this.anchors.index(this.anchors.filter('[href$=' + index + ']')); } else if (index === null) { // usage of null is deprecated, TODO remove in next release index = -1; } if (index == -1 && this.options.collapsible) { index = this.options.selected; } this.anchors.eq(index).trigger(this.options.event + '.tabs'); return this; }, load: function(index) { var self = this, o = this.options, a = this.anchors.eq(index)[0], url = $.data(a, 'load.tabs'); this.abort(); // not remote or from cache if (!url || this.element.queue("tabs").length !== 0 && $.data(a, 'cache.tabs')) { this.element.dequeue("tabs"); return; } // load remote from here on this.lis.eq(index).addClass('ui-state-processing'); if (o.spinner) { var span = $('span', a); span.data('label.tabs', span.html()).html(o.spinner); } this.xhr = $.ajax($.extend({}, o.ajaxOptions, { url: url, success: function(r, s) { $(self._sanitizeSelector(a.hash)).html(r); // take care of tab labels self._cleanup(); if (o.cache) { $.data(a, 'cache.tabs', true); // if loaded once do not load them again } // callbacks self._trigger('load', null, self._ui(self.anchors[index], self.panels[index])); try { o.ajaxOptions.success(r, s); } catch (e) {} }, error: function(xhr, s, e) { // take care of tab labels self._cleanup(); // callbacks self._trigger('load', null, self._ui(self.anchors[index], self.panels[index])); try { // Passing index avoid a race condition when this method is // called after the user has selected another tab. // Pass the anchor that initiated this request allows // loadError to manipulate the tab content panel via $(a.hash) o.ajaxOptions.error(xhr, s, index, a); } catch (e) {} } })); // last, so that load event is fired before show... self.element.dequeue("tabs"); return this; }, abort: function() { // stop possibly running animations this.element.queue([]); this.panels.stop(false, true); // "tabs" queue must not contain more than two elements, // which are the callbacks for the latest clicked tab... this.element.queue("tabs", this.element.queue("tabs").splice(-2, 2)); // terminate pending requests from other tabs if (this.xhr) { this.xhr.abort(); delete this.xhr; } // take care of tab labels this._cleanup(); return this; }, url: function(index, url) { this.anchors.eq(index).removeData('cache.tabs').data('load.tabs', url); return this; }, length: function() { return this.anchors.length; } }); $.extend($.ui.tabs, { version: '1.8.2' }); /* * Tabs Extensions */ /* * Rotate */ $.extend($.ui.tabs.prototype, { rotation: null, rotate: function(ms, continuing) { var self = this, o = this.options; var rotate = self._rotate || (self._rotate = function(e) { clearTimeout(self.rotation); self.rotation = setTimeout(function() { var t = o.selected; self.select( ++t < self.anchors.length ? t : 0 ); }, ms); if (e) { e.stopPropagation(); } }); var stop = self._unrotate || (self._unrotate = !continuing ? function(e) { if (e.clientX) { // in case of a true click self.rotate(null); } } : function(e) { t = o.selected; rotate(); }); // start rotation if (ms) { this.element.bind('tabsshow', rotate); this.anchors.bind(o.event + '.tabs', stop); rotate(); } // stop rotation else { clearTimeout(self.rotation); this.element.unbind('tabsshow', rotate); this.anchors.unbind(o.event + '.tabs', stop); delete this._rotate; delete this._unrotate; } return this; } }); })(jQuery); /* * jQuery validation plug-in 1.7 * * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ * http://docs.jquery.com/Plugins/Validation * * Copyright (c) 2006 - 2008 Jörn Zaefferer * * $Id: jquery.validate.js 6403 2009-06-17 14:27:16Z joern.zaefferer $ * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ (function($) { $.extend($.fn, { // http://docs.jquery.com/Plugins/Validation/validate validate: function( options ) { // if nothing is selected, return nothing; can't chain anyway if (!this.length) { options && options.debug && window.console && console.warn( "nothing selected, can't validate, returning nothing" ); return; } // check if a validator for this form was already created var validator = $.data(this[0], 'validator'); if ( validator ) { return validator; } validator = new $.validator( options, this[0] ); $.data(this[0], 'validator', validator); if ( validator.settings.onsubmit ) { // allow suppresing validation by adding a cancel class to the submit button this.find("input, button").filter(".cancel").click(function() { validator.cancelSubmit = true; }); // when a submitHandler is used, capture the submitting button if (validator.settings.submitHandler) { this.find("input, button").filter(":submit").click(function() { validator.submitButton = this; }); } // validate the form on submit this.submit( function( event ) { if ( validator.settings.debug ) // prevent form submit to be able to see console output event.preventDefault(); function handle() { if ( validator.settings.submitHandler ) { if (validator.submitButton) { // insert a hidden input as a replacement for the missing submit button var hidden = $("").attr("name", validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm); } validator.settings.submitHandler.call( validator, validator.currentForm ); if (validator.submitButton) { // and clean up afterwards; thanks to no-block-scope, hidden can be referenced hidden.remove(); } return false; } return true; } // prevent submit for invalid forms or custom submit handlers if ( validator.cancelSubmit ) { validator.cancelSubmit = false; return handle(); } if ( validator.form() ) { if ( validator.pendingRequest ) { validator.formSubmitted = true; return false; } return handle(); } else { validator.focusInvalid(); return false; } }); } return validator; }, // http://docs.jquery.com/Plugins/Validation/valid valid: function() { if ( $(this[0]).is('form')) { return this.validate().form(); } else { var valid = true; var validator = $(this[0].form).validate(); this.each(function() { valid &= validator.element(this); }); return valid; } }, // attributes: space seperated list of attributes to retrieve and remove removeAttrs: function(attributes) { var result = {}, $element = this; $.each(attributes.split(/\s/), function(index, value) { result[value] = $element.attr(value); $element.removeAttr(value); }); return result; }, // http://docs.jquery.com/Plugins/Validation/rules rules: function(command, argument) { var element = this[0]; if (command) { var settings = $.data(element.form, 'validator').settings; var staticRules = settings.rules; var existingRules = $.validator.staticRules(element); switch(command) { case "add": $.extend(existingRules, $.validator.normalizeRule(argument)); staticRules[element.name] = existingRules; if (argument.messages) settings.messages[element.name] = $.extend( settings.messages[element.name], argument.messages ); break; case "remove": if (!argument) { delete staticRules[element.name]; return existingRules; } var filtered = {}; $.each(argument.split(/\s/), function(index, method) { filtered[method] = existingRules[method]; delete existingRules[method]; }); return filtered; } } var data = $.validator.normalizeRules( $.extend( {}, $.validator.metadataRules(element), $.validator.classRules(element), $.validator.attributeRules(element), $.validator.staticRules(element) ), element); // make sure required is at front if (data.required) { var param = data.required; delete data.required; data = $.extend({required: param}, data); } return data; } }); // Custom selectors $.extend($.expr[":"], { // http://docs.jquery.com/Plugins/Validation/blank blank: function(a) {return !$.trim("" + a.value);}, // http://docs.jquery.com/Plugins/Validation/filled filled: function(a) {return !!$.trim("" + a.value);}, // http://docs.jquery.com/Plugins/Validation/unchecked unchecked: function(a) {return !a.checked;} }); // constructor for validator $.validator = function( options, form ) { this.settings = $.extend( true, {}, $.validator.defaults, options ); this.currentForm = form; this.init(); }; $.validator.format = function(source, params) { if ( arguments.length == 1 ) return function() { var args = $.makeArray(arguments); args.unshift(source); return $.validator.format.apply( this, args ); }; if ( arguments.length > 2 && params.constructor != Array ) { params = $.makeArray(arguments).slice(1); } if ( params.constructor != Array ) { params = [ params ]; } $.each(params, function(i, n) { source = source.replace(new RegExp("\\{" + i + "\\}", "g"), n); }); return source; }; $.extend($.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorClass: "error", validClass: "valid", errorElement: "label", focusInvalid: true, errorContainer: $( [] ), errorLabelContainer: $( [] ), onsubmit: true, ignore: [], ignoreTitle: false, onfocusin: function(element) { this.lastActive = element; // hide error label and remove error class on focus if enabled if ( this.settings.focusCleanup && !this.blockFocusCleanup ) { this.settings.unhighlight && this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass ); this.errorsFor(element).hide(); } }, onfocusout: function(element) { if ( !this.checkable(element) && (element.name in this.submitted || !this.optional(element)) ) { this.element(element); } }, onkeyup: function(element) { if ( element.name in this.submitted || element == this.lastElement ) { this.element(element); } }, onclick: function(element) { // click on selects, radiobuttons and checkboxes if ( element.name in this.submitted ) this.element(element); // or option elements, check parent select in that case else if (element.parentNode.name in this.submitted) this.element(element.parentNode); }, highlight: function( element, errorClass, validClass ) { $(element).addClass(errorClass).removeClass(validClass); }, unhighlight: function( element, errorClass, validClass ) { $(element).removeClass(errorClass).addClass(validClass); } }, // http://docs.jquery.com/Plugins/Validation/Validator/setDefaults setDefaults: function(settings) { $.extend( $.validator.defaults, settings ); }, messages: { required: "This field is required.", remote: "Please fix this field.", email: "Please enter a valid email address.", url: "Please enter a valid URL.", date: "Please enter a valid date.", dateISO: "Please enter a valid date (ISO).", number: "Please enter a valid number.", digits: "Please enter only digits.", creditcard: "Please enter a valid credit card number.", equalTo: "Please enter the same value again.", accept: "Please enter a value with a valid extension.", maxlength: $.validator.format("Please enter no more than {0} characters."), minlength: $.validator.format("Please enter at least {0} characters."), rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."), range: $.validator.format("Please enter a value between {0} and {1}."), max: $.validator.format("Please enter a value less than or equal to {0}."), min: $.validator.format("Please enter a value greater than or equal to {0}.") }, autoCreateRanges: false, prototype: { init: function() { this.labelContainer = $(this.settings.errorLabelContainer); this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm); this.containers = $(this.settings.errorContainer).add( this.settings.errorLabelContainer ); this.submitted = {}; this.valueCache = {}; this.pendingRequest = 0; this.pending = {}; this.invalid = {}; this.reset(); var groups = (this.groups = {}); $.each(this.settings.groups, function(key, value) { $.each(value.split(/\s/), function(index, name) { groups[name] = key; }); }); var rules = this.settings.rules; $.each(rules, function(key, value) { rules[key] = $.validator.normalizeRule(value); }); function delegate(event) { var validator = $.data(this[0].form, "validator"), eventType = "on" + event.type.replace(/^validate/, ""); validator.settings[eventType] && validator.settings[eventType].call(validator, this[0] ); } $(this.currentForm) .validateDelegate(":text, :password, :file, select, textarea", "focusin focusout keyup", delegate) .validateDelegate(":radio, :checkbox, select, option", "click", delegate); if (this.settings.invalidHandler) $(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler); }, // http://docs.jquery.com/Plugins/Validation/Validator/form form: function() { this.checkForm(); $.extend(this.submitted, this.errorMap); this.invalid = $.extend({}, this.errorMap); if (!this.valid()) $(this.currentForm).triggerHandler("invalid-form", [this]); this.showErrors(); return this.valid(); }, checkForm: function() { this.prepareForm(); for ( var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++ ) { this.check( elements[i] ); } return this.valid(); }, // http://docs.jquery.com/Plugins/Validation/Validator/element element: function( element ) { element = this.clean( element ); this.lastElement = element; this.prepareElement( element ); this.currentElements = $(element); var result = this.check( element ); if ( result ) { delete this.invalid[element.name]; } else { this.invalid[element.name] = true; } if ( !this.numberOfInvalids() ) { // Hide error containers on last error this.toHide = this.toHide.add( this.containers ); } this.showErrors(); return result; }, // http://docs.jquery.com/Plugins/Validation/Validator/showErrors showErrors: function(errors) { if(errors) { // add items to error list and map $.extend( this.errorMap, errors ); this.errorList = []; for ( var name in errors ) { this.errorList.push({ message: errors[name], element: this.findByName(name)[0] }); } // remove items from success list this.successList = $.grep( this.successList, function(element) { return !(element.name in errors); }); } this.settings.showErrors ? this.settings.showErrors.call( this, this.errorMap, this.errorList ) : this.defaultShowErrors(); }, // http://docs.jquery.com/Plugins/Validation/Validator/resetForm resetForm: function() { if ( $.fn.resetForm ) $( this.currentForm ).resetForm(); this.submitted = {}; this.prepareForm(); this.hideErrors(); this.elements().removeClass( this.settings.errorClass ); }, numberOfInvalids: function() { return this.objectLength(this.invalid); }, objectLength: function( obj ) { var count = 0; for ( var i in obj ) count++; return count; }, hideErrors: function() { this.addWrapper( this.toHide ).hide(); }, valid: function() { return this.size() == 0; }, size: function() { return this.errorList.length; }, focusInvalid: function() { if( this.settings.focusInvalid ) { try { $(this.findLastActive() || this.errorList.length && this.errorList[0].element || []) .filter(":visible") .focus() // manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find .trigger("focusin"); } catch(e) { // ignore IE throwing errors when focusing hidden elements } } }, findLastActive: function() { var lastActive = this.lastActive; return lastActive && $.grep(this.errorList, function(n) { return n.element.name == lastActive.name; }).length == 1 && lastActive; }, elements: function() { var validator = this, rulesCache = {}; // select all valid inputs inside the form (no submit or reset buttons) // workaround $Query([]).add until http://dev.jquery.com/ticket/2114 is solved return $([]).add(this.currentForm.elements) .filter(":input") .not(":submit, :reset, :image, [disabled]") .not( this.settings.ignore ) .filter(function() { !this.name && validator.settings.debug && window.console && console.error( "%o has no name assigned", this); // select only the first element for each name, and only those with rules specified if ( this.name in rulesCache || !validator.objectLength($(this).rules()) ) return false; rulesCache[this.name] = true; return true; }); }, clean: function( selector ) { return $( selector )[0]; }, errors: function() { return $( this.settings.errorElement + "." + this.settings.errorClass, this.errorContext ); }, reset: function() { this.successList = []; this.errorList = []; this.errorMap = {}; this.toShow = $([]); this.toHide = $([]); this.currentElements = $([]); }, prepareForm: function() { this.reset(); this.toHide = this.errors().add( this.containers ); }, prepareElement: function( element ) { this.reset(); this.toHide = this.errorsFor(element); }, check: function( element ) { element = this.clean( element ); // if radio/checkbox, validate first element in group instead if (this.checkable(element)) { element = this.findByName( element.name )[0]; } var rules = $(element).rules(); var dependencyMismatch = false; for( method in rules ) { var rule = { method: method, parameters: rules[method] }; try { var result = $.validator.methods[method].call( this, element.value.replace(/\r/g, ""), element, rule.parameters ); // if a method indicates that the field is optional and therefore valid, // don't mark it as valid when there are no other rules if ( result == "dependency-mismatch" ) { dependencyMismatch = true; continue; } dependencyMismatch = false; if ( result == "pending" ) { this.toHide = this.toHide.not( this.errorsFor(element) ); return; } if( !result ) { this.formatAndAdd( element, rule ); return false; } } catch(e) { this.settings.debug && window.console && console.log("exception occured when checking element " + element.id + ", check the '" + rule.method + "' method", e); throw e; } } if (dependencyMismatch) return; if ( this.objectLength(rules) ) this.successList.push(element); return true; }, // return the custom message for the given element and validation method // specified in the element's "messages" metadata customMetaMessage: function(element, method) { if (!$.metadata) return; var meta = this.settings.meta ? $(element).metadata()[this.settings.meta] : $(element).metadata(); return meta && meta.messages && meta.messages[method]; }, // return the custom message for the given element name and validation method customMessage: function( name, method ) { var m = this.settings.messages[name]; return m && (m.constructor == String ? m : m[method]); }, // return the first defined argument, allowing empty strings findDefined: function() { for(var i = 0; i < arguments.length; i++) { if (arguments[i] !== undefined) return arguments[i]; } return undefined; }, defaultMessage: function( element, method) { return this.findDefined( this.customMessage( element.name, method ), this.customMetaMessage( element, method ), // title is never undefined, so handle empty string as undefined !this.settings.ignoreTitle && element.title || undefined, $.validator.messages[method], "Warning: No message defined for " + element.name + "" ); }, formatAndAdd: function( element, rule ) { var message = this.defaultMessage( element, rule.method ), theregex = /\$?\{(\d+)\}/g; if ( typeof message == "function" ) { message = message.call(this, rule.parameters, element); } else if (theregex.test(message)) { message = jQuery.format(message.replace(theregex, '{$1}'), rule.parameters); } this.errorList.push({ message: message, element: element }); this.errorMap[element.name] = message; this.submitted[element.name] = message; }, addWrapper: function(toToggle) { if ( this.settings.wrapper ) toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) ); return toToggle; }, defaultShowErrors: function() { for ( var i = 0; this.errorList[i]; i++ ) { var error = this.errorList[i]; this.settings.highlight && this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass ); this.showLabel( error.element, error.message ); } if( this.errorList.length ) { this.toShow = this.toShow.add( this.containers ); } if (this.settings.success) { for ( var i = 0; this.successList[i]; i++ ) { this.showLabel( this.successList[i] ); } } if (this.settings.unhighlight) { for ( var i = 0, elements = this.validElements(); elements[i]; i++ ) { this.settings.unhighlight.call( this, elements[i], this.settings.errorClass, this.settings.validClass ); } } this.toHide = this.toHide.not( this.toShow ); this.hideErrors(); this.addWrapper( this.toShow ).show(); }, validElements: function() { return this.currentElements.not(this.invalidElements()); }, invalidElements: function() { return $(this.errorList).map(function() { return this.element; }); }, showLabel: function(element, message) { var label = this.errorsFor( element ); if ( label.length ) { // refresh error/success class label.removeClass().addClass( this.settings.errorClass ); // check if we have a generated label, replace the message then label.attr("generated") && label.html(message); } else { // create label label = $("<" + this.settings.errorElement + "/>") .attr({"for": this.idOrName(element), generated: true}) .addClass(this.settings.errorClass) .html(message || ""); if ( this.settings.wrapper ) { // make sure the element is visible, even in IE // actually showing the wrapped element is handled elsewhere label = label.hide().show().wrap("<" + this.settings.wrapper + "/>").parent(); } if ( !this.labelContainer.append(label).length ) this.settings.errorPlacement ? this.settings.errorPlacement(label, $(element) ) : label.insertAfter(element); } if ( !message && this.settings.success ) { label.text(""); typeof this.settings.success == "string" ? label.addClass( this.settings.success ) : this.settings.success( label ); } this.toShow = this.toShow.add(label); }, errorsFor: function(element) { var name = this.idOrName(element); return this.errors().filter(function() { return $(this).attr('for') == name; }); }, idOrName: function(element) { return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name); }, checkable: function( element ) { return /radio|checkbox/i.test(element.type); }, findByName: function( name ) { // select by name and filter by form for performance over form.find("[name=...]") var form = this.currentForm; return $(document.getElementsByName(name)).map(function(index, element) { return element.form == form && element.name == name && element || null; }); }, getLength: function(value, element) { switch( element.nodeName.toLowerCase() ) { case 'select': return $("option:selected", element).length; case 'input': if( this.checkable( element) ) return this.findByName(element.name).filter(':checked').length; } return value.length; }, depend: function(param, element) { return this.dependTypes[typeof param] ? this.dependTypes[typeof param](param, element) : true; }, dependTypes: { "boolean": function(param, element) { return param; }, "string": function(param, element) { return !!$(param, element.form).length; }, "function": function(param, element) { return param(element); } }, optional: function(element) { return !$.validator.methods.required.call(this, $.trim(element.value), element) && "dependency-mismatch"; }, startRequest: function(element) { if (!this.pending[element.name]) { this.pendingRequest++; this.pending[element.name] = true; } }, stopRequest: function(element, valid) { this.pendingRequest--; // sometimes synchronization fails, make sure pendingRequest is never < 0 if (this.pendingRequest < 0) this.pendingRequest = 0; delete this.pending[element.name]; if ( valid && this.pendingRequest == 0 && this.formSubmitted && this.form() ) { $(this.currentForm).submit(); this.formSubmitted = false; } else if (!valid && this.pendingRequest == 0 && this.formSubmitted) { $(this.currentForm).triggerHandler("invalid-form", [this]); this.formSubmitted = false; } }, previousValue: function(element) { return $.data(element, "previousValue") || $.data(element, "previousValue", { old: null, valid: true, message: this.defaultMessage( element, "remote" ) }); } }, classRuleSettings: { required: {required: true}, email: {email: true}, url: {url: true}, date: {date: true}, dateISO: {dateISO: true}, dateDE: {dateDE: true}, number: {number: true}, numberDE: {numberDE: true}, digits: {digits: true}, creditcard: {creditcard: true} }, addClassRules: function(className, rules) { className.constructor == String ? this.classRuleSettings[className] = rules : $.extend(this.classRuleSettings, className); }, classRules: function(element) { var rules = {}; var classes = $(element).attr('class'); classes && $.each(classes.split(' '), function() { if (this in $.validator.classRuleSettings) { $.extend(rules, $.validator.classRuleSettings[this]); } }); return rules; }, attributeRules: function(element) { var rules = {}; var $element = $(element); for (method in $.validator.methods) { var value = $element.attr(method); if (value) { rules[method] = value; } } // maxlength may be returned as -1, 2147483647 (IE) and 524288 (safari) for text inputs if (rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength)) { delete rules.maxlength; } return rules; }, metadataRules: function(element) { if (!$.metadata) return {}; var meta = $.data(element.form, 'validator').settings.meta; return meta ? $(element).metadata()[meta] : $(element).metadata(); }, staticRules: function(element) { var rules = {}; var validator = $.data(element.form, 'validator'); if (validator.settings.rules) { rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {}; } return rules; }, normalizeRules: function(rules, element) { // handle dependency check $.each(rules, function(prop, val) { // ignore rule when param is explicitly false, eg. required:false if (val === false) { delete rules[prop]; return; } if (val.param || val.depends) { var keepRule = true; switch (typeof val.depends) { case "string": keepRule = !!$(val.depends, element.form).length; break; case "function": keepRule = val.depends.call(element, element); break; } if (keepRule) { rules[prop] = val.param !== undefined ? val.param : true; } else { delete rules[prop]; } } }); // evaluate parameters $.each(rules, function(rule, parameter) { rules[rule] = $.isFunction(parameter) ? parameter(element) : parameter; }); // clean number parameters $.each(['minlength', 'maxlength', 'min', 'max'], function() { if (rules[this]) { rules[this] = Number(rules[this]); } }); $.each(['rangelength', 'range'], function() { if (rules[this]) { rules[this] = [Number(rules[this][0]), Number(rules[this][1])]; } }); if ($.validator.autoCreateRanges) { // auto-create ranges if (rules.min && rules.max) { rules.range = [rules.min, rules.max]; delete rules.min; delete rules.max; } if (rules.minlength && rules.maxlength) { rules.rangelength = [rules.minlength, rules.maxlength]; delete rules.minlength; delete rules.maxlength; } } // To support custom messages in metadata ignore rule methods titled "messages" if (rules.messages) { delete rules.messages; } return rules; }, // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} normalizeRule: function(data) { if( typeof data == "string" ) { var transformed = {}; $.each(data.split(/\s/), function() { transformed[this] = true; }); data = transformed; } return data; }, // http://docs.jquery.com/Plugins/Validation/Validator/addMethod addMethod: function(name, method, message) { $.validator.methods[name] = method; $.validator.messages[name] = message != undefined ? message : $.validator.messages[name]; if (method.length < 3) { $.validator.addClassRules(name, $.validator.normalizeRule(name)); } }, methods: { // http://docs.jquery.com/Plugins/Validation/Methods/required required: function(value, element, param) { // check if dependency is met if ( !this.depend(param, element) ) return "dependency-mismatch"; switch( element.nodeName.toLowerCase() ) { case 'select': // could be an array for select-multiple or a string, both are fine this way var val = $(element).val(); return val && val.length > 0; case 'input': if ( this.checkable(element) ) return this.getLength(value, element) > 0; default: return $.trim(value).length > 0; } }, // http://docs.jquery.com/Plugins/Validation/Methods/remote remote: function(value, element, param) { if ( this.optional(element) ) return "dependency-mismatch"; var previous = this.previousValue(element); if (!this.settings.messages[element.name] ) this.settings.messages[element.name] = {}; previous.originalMessage = this.settings.messages[element.name].remote; this.settings.messages[element.name].remote = previous.message; param = typeof param == "string" && {url:param} || param; if ( previous.old !== value ) { previous.old = value; var validator = this; this.startRequest(element); var data = {}; data[element.name] = value; $.ajax($.extend(true, { url: param, mode: "abort", port: "validate" + element.name, dataType: "json", data: data, success: function(response) { validator.settings.messages[element.name].remote = previous.originalMessage; var valid = response === true; if ( valid ) { var submitted = validator.formSubmitted; validator.prepareElement(element); validator.formSubmitted = submitted; validator.successList.push(element); validator.showErrors(); } else { var errors = {}; var message = (previous.message = response || validator.defaultMessage( element, "remote" )); errors[element.name] = $.isFunction(message) ? message(value) : message; validator.showErrors(errors); } previous.valid = valid; validator.stopRequest(element, valid); } }, param)); return "pending"; } else if( this.pending[element.name] ) { return "pending"; } return previous.valid; }, // http://docs.jquery.com/Plugins/Validation/Methods/minlength minlength: function(value, element, param) { return this.optional(element) || this.getLength($.trim(value), element) >= param; }, // http://docs.jquery.com/Plugins/Validation/Methods/maxlength maxlength: function(value, element, param) { return this.optional(element) || this.getLength($.trim(value), element) <= param; }, // http://docs.jquery.com/Plugins/Validation/Methods/rangelength rangelength: function(value, element, param) { var length = this.getLength($.trim(value), element); return this.optional(element) || ( length >= param[0] && length <= param[1] ); }, // http://docs.jquery.com/Plugins/Validation/Methods/min min: function( value, element, param ) { return this.optional(element) || value >= param; }, // http://docs.jquery.com/Plugins/Validation/Methods/max max: function( value, element, param ) { return this.optional(element) || value <= param; }, // http://docs.jquery.com/Plugins/Validation/Methods/range range: function( value, element, param ) { return this.optional(element) || ( value >= param[0] && value <= param[1] ); }, // http://docs.jquery.com/Plugins/Validation/Methods/email email: function(value, element) { // contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/ return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value); }, // http://docs.jquery.com/Plugins/Validation/Methods/url url: function(value, element) { // contributed by Scott Gonzalez: http://projects.scottsplayground.com/iri/ return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value); }, // http://docs.jquery.com/Plugins/Validation/Methods/date date: function(value, element) { return this.optional(element) || !/Invalid|NaN/.test(new Date(value)); }, // http://docs.jquery.com/Plugins/Validation/Methods/dateISO dateISO: function(value, element) { return this.optional(element) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value); }, // http://docs.jquery.com/Plugins/Validation/Methods/number number: function(value, element) { return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value); }, // http://docs.jquery.com/Plugins/Validation/Methods/digits digits: function(value, element) { return this.optional(element) || /^\d+$/.test(value); }, // http://docs.jquery.com/Plugins/Validation/Methods/creditcard // based on http://en.wikipedia.org/wiki/Luhn creditcard: function(value, element) { if ( this.optional(element) ) return "dependency-mismatch"; // accept only digits and dashes if (/[^0-9-]+/.test(value)) return false; var nCheck = 0, nDigit = 0, bEven = false; value = value.replace(/\D/g, ""); for (var n = value.length - 1; n >= 0; n--) { var cDigit = value.charAt(n); var nDigit = parseInt(cDigit, 10); if (bEven) { if ((nDigit *= 2) > 9) nDigit -= 9; } nCheck += nDigit; bEven = !bEven; } return (nCheck % 10) == 0; }, // http://docs.jquery.com/Plugins/Validation/Methods/accept accept: function(value, element, param) { param = typeof param == "string" ? param.replace(/,/g, '|') : "png|jpe?g|gif"; return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i")); }, // http://docs.jquery.com/Plugins/Validation/Methods/equalTo equalTo: function(value, element, param) { // bind to the blur event of the target in order to revalidate whenever the target field is updated // TODO find a way to bind the event just once, avoiding the unbind-rebind overhead var target = $(param).unbind(".validate-equalTo").bind("blur.validate-equalTo", function() { $(element).valid(); }); return value == target.val(); } } }); // deprecated, use $.validator.format instead $.format = $.validator.format; })(jQuery); // ajax mode: abort // usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); // if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() ;(function($) { var ajax = $.ajax; var pendingRequests = {}; $.ajax = function(settings) { // create settings for compatibility with ajaxSetup settings = $.extend(settings, $.extend({}, $.ajaxSettings, settings)); var port = settings.port; if (settings.mode == "abort") { if ( pendingRequests[port] ) { pendingRequests[port].abort(); } return (pendingRequests[port] = ajax.apply(this, arguments)); } return ajax.apply(this, arguments); }; })(jQuery); // provides cross-browser focusin and focusout events // IE has native support, in other browsers, use event caputuring (neither bubbles) // provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation // handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target ;(function($) { // only implement if not provided by jQuery core (since 1.4) // TODO verify if jQuery 1.4's implementation is compatible with older jQuery special-event APIs if (!jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener) { $.each({ focus: 'focusin', blur: 'focusout' }, function( original, fix ){ $.event.special[fix] = { setup:function() { this.addEventListener( original, handler, true ); }, teardown:function() { this.removeEventListener( original, handler, true ); }, handler: function(e) { arguments[0] = $.event.fix(e); arguments[0].type = fix; return $.event.handle.apply(this, arguments); } }; function handler(e) { e = $.event.fix(e); e.type = fix; return $.event.handle.call(this, e); } }); }; $.extend($.fn, { validateDelegate: function(delegate, type, handler) { return this.bind(type, function(event) { var target = $(event.target); if (target.is(delegate)) { return handler.apply(target, arguments); } }); } }); })(jQuery); /** * @author ilkinulas@gmail.com * jquery plugin that rotates div elements inside a given div element */ var hiddenDivs = []; jQuery.fn.divroller = function(options) { settings = jQuery.extend( { visible : 3, pause : 3000 }, options); start(settings, this); function start(settings, container) { var divs = container.children(); //hide unvisible divs while (settings.visible < divs.length) { var removedDiv = $(divs[divs.length - 1]).remove(); hiddenDivs.push(removedDiv); divs = container.children(); } setTimeout( function() { roll(settings, container) }, settings.pause); }; function roll(settings, container) { //Dom manipulation. container.prepend(hiddenDivs.pop()); hiddenDivs.unshift($(container.children()[settings.visible]).remove()); //Efect $(container.children()[0]).hide(); $(container.children()[0]).slideDown("slow"); //Repeat setTimeout( function() { roll(settings, container) }, settings.pause); } } /*! * jQuery Form Plugin * version: 2.43 (12-MAR-2010) * @requires jQuery v1.3.2 or later * * Examples and documentation at: http://malsup.com/jquery/form/ * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ ;(function($) { /* Usage Note: ----------- Do not use both ajaxSubmit and ajaxForm on the same form. These functions are intended to be exclusive. Use ajaxSubmit if you want to bind your own submit handler to the form. For example, $(document).ready(function() { $('#myForm').bind('submit', function() { $(this).ajaxSubmit({ target: '#output' }); return false; // <-- important! }); }); Use ajaxForm when you want the plugin to manage all the event binding for you. For example, $(document).ready(function() { $('#myForm').ajaxForm({ target: '#output' }); }); When using ajaxForm, the ajaxSubmit function will be invoked for you at the appropriate time. */ /** * ajaxSubmit() provides a mechanism for immediately submitting * an HTML form using AJAX. */ $.fn.ajaxSubmit = function(options) { // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) if (!this.length) { log('ajaxSubmit: skipping submit process - no element selected'); return this; } if (typeof options == 'function') options = { success: options }; var url = $.trim(this.attr('action')); if (url) { // clean url (don't include hash vaue) url = (url.match(/^([^#]+)/)||[])[1]; } url = url || window.location.href || ''; options = $.extend({ url: url, type: this.attr('method') || 'GET', iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' }, options || {}); // hook for manipulating the form data before it is extracted; // convenient for use with rich editors like tinyMCE or FCKEditor var veto = {}; this.trigger('form-pre-serialize', [this, options, veto]); if (veto.veto) { log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); return this; } // provide opportunity to alter form data before it is serialized if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { log('ajaxSubmit: submit aborted via beforeSerialize callback'); return this; } var a = this.formToArray(options.semantic); if (options.data) { options.extraData = options.data; for (var n in options.data) { if(options.data[n] instanceof Array) { for (var k in options.data[n]) a.push( { name: n, value: options.data[n][k] } ); } else a.push( { name: n, value: options.data[n] } ); } } // give pre-submit callback an opportunity to abort the submit if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { log('ajaxSubmit: submit aborted via beforeSubmit callback'); return this; } // fire vetoable 'validate' event this.trigger('form-submit-validate', [a, this, options, veto]); if (veto.veto) { log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); return this; } var q = $.param(a); if (options.type.toUpperCase() == 'GET') { options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; options.data = null; // data is null for 'get' } else options.data = q; // data is the query string for 'post' var $form = this, callbacks = []; if (options.resetForm) callbacks.push(function() { $form.resetForm(); }); if (options.clearForm) callbacks.push(function() { $form.clearForm(); }); // perform a load on the target only if dataType is not provided if (!options.dataType && options.target) { var oldSuccess = options.success || function(){}; callbacks.push(function(data) { var fn = options.replaceTarget ? 'replaceWith' : 'html'; $(options.target)[fn](data).each(oldSuccess, arguments); }); } else if (options.success) callbacks.push(options.success); options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg for (var i=0, max=callbacks.length; i < max; i++) callbacks[i].apply(options, [data, status, xhr || $form, $form]); }; // are there files to upload? var files = $('input:file', this).fieldValue(); var found = false; for (var j=0; j < files.length; j++) if (files[j]) found = true; var multipart = false; // var mp = 'multipart/form-data'; // multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); // options.iframe allows user to force iframe mode // 06-NOV-09: now defaulting to iframe mode if file input is detected if ((files.length && options.iframe !== false) || options.iframe || found || multipart) { // hack to fix Safari hang (thanks to Tim Molendijk for this) // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d if (options.closeKeepAlive) $.get(options.closeKeepAlive, fileUpload); else fileUpload(); } else $.ajax(options); // fire 'notify' event this.trigger('form-submit-notify', [this, options]); return this; // private function for handling file uploads (hat tip to YAHOO!) function fileUpload() { var form = $form[0]; if ($(':input[name=submit]', form).length) { alert('Error: Form elements must not be named "submit".'); return; } var opts = $.extend({}, $.ajaxSettings, options); var s = $.extend(true, {}, $.extend(true, {}, $.ajaxSettings), opts); var id = 'jqFormIO' + (new Date().getTime()); var $io = $('
    "); $("#TB_overlay").click(tb_remove); } }else{//all others if(document.getElementById("TB_overlay") === null){ $("body").append("
    "); $("#TB_overlay").click(tb_remove); } } if(tb_detectMacXFF()){ $("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash }else{ $("#TB_overlay").addClass("TB_overlayBG");//use background and opacity } if(caption===null){caption="";} $("body").append("
    ");//add loader to the page $('#TB_load').show();//show loader var baseURL; if(url.indexOf("?")!==-1){ //ff there is a query string involved baseURL = url.substr(0, url.indexOf("?")); }else{ baseURL = url; } var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/; var urlType = baseURL.toLowerCase().match(urlString); if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images TB_PrevCaption = ""; TB_PrevURL = ""; TB_PrevHTML = ""; TB_NextCaption = ""; TB_NextURL = ""; TB_NextHTML = ""; TB_imageCount = ""; TB_FoundURL = false; if(imageGroup){ TB_TempArray = $("a[@rel="+imageGroup+"]").get(); for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) { var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString); if (!(TB_TempArray[TB_Counter].href == url)) { if (TB_FoundURL) { TB_NextCaption = TB_TempArray[TB_Counter].title; TB_NextURL = TB_TempArray[TB_Counter].href; TB_NextHTML = "  Next >"; } else { TB_PrevCaption = TB_TempArray[TB_Counter].title; TB_PrevURL = TB_TempArray[TB_Counter].href; TB_PrevHTML = "  < Prev"; } } else { TB_FoundURL = true; TB_imageCount = "Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length); } } } imgPreloader = new Image(); imgPreloader.onload = function(){ imgPreloader.onload = null; // Resizing large images - orginal by Christian Montoya edited by me. var pagesize = tb_getPageSize(); var x = pagesize[0] - 150; var y = pagesize[1] - 150; var imageWidth = imgPreloader.width; var imageHeight = imgPreloader.height; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; } } else if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; } } // End Resizing TB_WIDTH = imageWidth + 30; TB_HEIGHT = imageHeight + 60; $("#TB_window").append(""+caption+"" + "
    "+caption+"
    " + TB_imageCount + TB_PrevHTML + TB_NextHTML + "
    "); $("#TB_closeWindowButton").click(tb_remove); if (!(TB_PrevHTML === "")) { function goPrev(){ if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);} $("#TB_window").remove(); $("iframe").css({height: "1000px"}); $("body").append("
    "); tb_show(TB_PrevCaption, TB_PrevURL, imageGroup); return false; } $("#TB_prev").click(goPrev); } if (!(TB_NextHTML === "")) { function goNext(){ $("#TB_window").remove(); $("body").append("
    "); tb_show(TB_NextCaption, TB_NextURL, imageGroup); return false; } $("#TB_next").click(goNext); } document.onkeydown = function(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if(keycode == 27){ // close tb_remove(); } else if(keycode == 190){ // display previous image if(!(TB_NextHTML == "")){ document.onkeydown = ""; goNext(); } } else if(keycode == 188){ // display next image if(!(TB_PrevHTML == "")){ document.onkeydown = ""; goPrev(); } } }; tb_position(); $("#TB_load").remove(); $("#TB_ImageOff").click(tb_remove); $("#TB_window").css({display:"block"}); //for safari using css instead of show }; imgPreloader.src = url; }else{//code to show html var queryString = url.replace(/^[^\?]+\??/,''); var params = tb_parseQuery( queryString ); TB_WIDTH = (params['width']*1) || 630; //defaults to 630 if no paramaters were added to URL TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL ajaxContentW = TB_WIDTH; ajaxContentH = TB_HEIGHT - 45; if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window urlNoQuery = url.split('TB_'); $("#TB_iframeContent").remove(); if(params['modal'] != "true"){//iframe no modal $("#TB_window").append("
    "+caption+"
    "); }else{//iframe modal $("#TB_overlay").unbind(); $("#TB_window").append(""); } }else{// not an iframe, ajax if($("#TB_window").css("display") != "block"){ if(params['modal'] != "true"){//ajax no modal $("#TB_window").append("
    "+caption+"
    "); }else{//ajax modal $("#TB_overlay").unbind(); $("#TB_window").append("
    "); } }else{//this means the window is already up, we are just loading new content via ajax $("#TB_ajaxContent")[0].style.width = ajaxContentW +"px"; $("#TB_ajaxContent")[0].style.height = ajaxContentH +"px"; $("#TB_ajaxContent")[0].scrollTop = 0; $("#TB_ajaxWindowTitle").html(caption); } } $("#TB_closeWindowButton").click(tb_remove); if(url.indexOf('TB_inline') != -1){ $("#TB_ajaxContent").append($('#' + params['inlineId']).children()); $("#TB_window").unload(function () { $('#' + params['inlineId']).append( $("#TB_ajaxContent").children() ); // move elements back when you're finished }); tb_position(); $("#TB_load").remove(); $("#TB_window").css({display:"block"}); }else if(url.indexOf('TB_iframe') != -1){ tb_position(); if($.browser.safari){//safari needs help because it will not fire iframe onload $("#TB_load").remove(); $("#TB_window").css({display:"block"}); } }else{ $("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method tb_position(); $("#TB_load").remove(); tb_init("#TB_ajaxContent a.thickbox"); $("#TB_window").css({display:"block"}); }); } } if(!params['modal']){ document.onkeyup = function(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if(keycode == 27){ // close tb_remove(); } }; } } catch(e) { //nothing here } } //helper functions below function tb_showIframe(){ $("#TB_load").remove(); $("#TB_window").css({display:"block"}); } function tb_remove() { $("#TB_imageOff").unbind("click"); $("#TB_closeWindowButton").unbind("click"); $("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();}); $("#TB_load").remove(); if (typeof document.body.style.maxHeight == "undefined") {//if IE 6 $("body","html").css({height: "auto", width: "auto"}); $("html").css("overflow",""); } document.onkeydown = ""; document.onkeyup = ""; return false; } function tb_position() { $("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'}); if ( !(jQuery.browser.msie && jQuery.browser.version < 7)) { // take away IE6 $("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'}); } } function tb_parseQuery ( query ) { var Params = {}; if ( ! query ) {return Params;}// return empty object var Pairs = query.split(/[;&]/); for ( var i = 0; i < Pairs.length; i++ ) { var KeyVal = Pairs[i].split('='); if ( ! KeyVal || KeyVal.length != 2 ) {continue;} var key = unescape( KeyVal[0] ); var val = unescape( KeyVal[1] ); val = val.replace(/\+/g, ' '); Params[key] = val; } return Params; } function tb_getPageSize(){ var de = document.documentElement; var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight; arrayPageSize = [w,h]; return arrayPageSize; } function tb_detectMacXFF() { var userAgent = navigator.userAgent.toLowerCase(); if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) { return true; } }jQuery.validator.addMethod("hardDate", isDate, 'Fecha de nacimiento incorrecta'); jQuery.validator.addMethod("validate_text", valida_textarea, 'Debés incluir como mínimo 100 caracteres'); jQuery.validator.addMethod("validate_date_ini_post", valida_fecha_ini_posterior, 'La fecha de inicio no puede ser anterior a la actual'); jQuery.validator.addMethod("validate_date_fin_post", valida_fecha_fin_posterior, 'La fecha de fin no puede ser anterior a la actual'); jQuery.validator.addMethod("validate_date_fin_post_date_ini", valida_fecha_ini_fin_posterior, 'La fecha de fin no podé ser anterior a la de inicio'); var altaUsuarioMensajes = { user_real_name: {required: 'Debés introducir tu nombre'}, user_surname: {required: 'Debés introducir tus apellidos'}, user_name: {required: 'Nombre de usuario incorrecto.
    El nombre de usuario debe tener entre 3 y 14 caracteres. Sólo debe contener letras y números.', remote: 'Nombre de usuario incorrecto.
    El nombre de usuario debe tener entre 3 y 14 caracteres. Sólo debe contener letras y números.'}, user_email: {required: 'E-mail no válido.
    El e-mail introducido está repetido o no es correcto. Probá de nuevo con otra cuenta de e-mail en la que recibirás el e-mail de validación.', email: 'E-mail no válido.
    El e-mail introducido está repetido o no es correcto. Probá de nuevo con otra cuenta de e-mail en la que recibirás el e-mail de validación.', remote: 'E-mail no válido.
    El e-mail introducido está repetido o no es correcto. Probá de nuevo con otra cuenta de e-mail en la que recibirás el e-mail de validación.'}, user_password: {required: 'Contraseña incorrecta.
    La contraseña debe tener entre 3 y 14 caracteres. Sólo debe contener letras y números.'}, user_pass_conf: {required: 'Contraseña de confirmación incorrecta.
    Debe ser igual a la contraseña anterior.', equalTo: 'Las contraseñas no coinciden.'}, paises: {required: 'Seleccioná país', min: 'Seleccioná país'}, prov: {required: 'Debés indicar una provincia', min: 'Debés indicar una provincia'}, dateBirth2: {required: 'Completá la fecha de nacimiento.', hardDate: 'Fecha de nacimiento incorrecta'}, conformidad: {required: 'Debés aceptar las condiciones de uso'} }; var altaUsuarioReglas = { user_real_name: {required: true}, user_surname: {required: true}, user_name: {required: true, remote: '/sections/perfil/ajax.comprobacionUserName.php', minlength: 3, maxlength: 14}, user_email: {required: true, email: true, remote: '/sections/perfil/ajax.comprobarEmail.php', minlength: 6, maxlength: 255}, user_password: {required: true, minlength: 3, maxlength: 14}, user_pass_conf: {required: true, equalTo: '#user_password'}, paises: {required: true, min: 1}, prov: {required: true, min: 0}, dateBirth2: {required: true, hardDate: true}, conformidad: {required: true} }; var actualizarDatosUsuarioMensajes = { user_real_name: {required: 'Debés introducir tu nombre'}, user_surname: {required: 'Debés introducir tus apellidos'}, paises: {required: 'Seleccioná país', min: 'Seleccioná país'}, prov: {required: 'Debés indicar una provincia', min: 'Debés indicar una provincia'}, dateBirth2: {required: 'Completá la fecha de nacimiento.', hardDate: 'Fecha de nacimiento incorrecta'} }; var actualizarDatosUsuarioReglas = { user_real_name: {required: true}, user_surname: {required: true}, paises: {required: true, min: 1}, prov: {required: true, min: 0}, dateBirth2: {required: true, hardDate: true} }; var formAnuncioMensajes = { anuncio_titulo: {required: 'Debés introducir un título'}, anuncio_descripcion: {required: 'Debés introducir una descripción'}, user_email: {required: 'E-mail no válido.
    El e-mail introducido está repetido o no es correcto. Probá de nuevo con otra cuenta de e-mail en la que recibirás el e-mail de validación.', email: 'E-mail no válido.
    El e-mail introducido está repetido o no es correcto. Probá de nuevo con otra cuenta de e-mail en la que recibirás el e-mail de validación.'}, anuncio_telefono: {required: 'Debés introducir un teléfono de contacto válido', number: 'Debés introducir un teléfono de contacto válido'}, banner: {required: 'Debés publicar un banner'}, anuncio_url: {url: 'Por favor, escribí una URL válida. (Ej. http://www.incondicionales.com)'} }; var formAnuncioReglas = { anuncio_titulo: {required: true, minlength: 3, maxlength: 60}, anuncio_descripcion: {required: true}, anuncio_email: {required: true, email: true, minlength: 6, maxlength: 255}, anuncio_telefono: {required: true, number: true}, banner: {required: true}, anuncio_url: {required: true, url: true} }; var invitadorWizardReglas = { email_box: {required: true}, password_box: {required: true} }; var adidasFormReglas = { nombre: {required: true}, movil: {required: true}, dia: {required: true, min: 1}, mes: {required: true, min: 1}, ano: {required: true, min: 1}, acompanante: {required: true}, motivo: {required: true}, conformidad: {required: true} }; var adidasFormMensajes = { nombre: {required: 'Debés introducir tu nombre'}, movil: {required: 'Debés introducir un teléfono de contacto válido'}, dia: {required: 'Completá la fecha de nacimiento.', min: 'Completá la fecha de nacimiento.'}, mes: {required: 'Completá la fecha de nacimiento.', min: 'Completá la fecha de nacimiento.'}, ano: {required: 'Completá la fecha de nacimiento.', min: 'Completá la fecha de nacimiento.'} }; var hyundaiFormReglas = { username: {required: true, remote: '/sections/home/ajax.comprobacionUserNameSeleccion.php', minlength: 3, maxlength: 14}, iagree: {required: true} }; var hyundaiFormMensajes = { username: {required: 'Nombre de usuario incorrecto.
    El nombre de usuario debe tener entre 3 y 14 caracteres. Sólo debe contener letras y números.', remote: 'Nombre de usuario incorrecto.
    El nombre de usuario debe tener entre 3 y 14 caracteres. Sólo debe contener letras y números.'}, conformidad: {required: 'Debés aceptar las condiciones de uso'} }; var MsgPancartaFormReglas = { msg: {required: true, maxlength: 200} }; var MsgPancartaFormMensajes = { msg: {required: 'Debes escribir un mensaje', maxlength: 'Debe ser inferior a 200 carácteres'} }; var cepsaFormReglas = { cp_user_id: {required: true, number: true}, cp_nombre: {required: true}, cp_movil: {required: true}, cp_estrofa: {required: true}, cp_condiciones: {required: true} }; var cepsaFormMensajes = { cp_user_id: {required: 'No estás logueado'}, cp_nombre: {required: 'Debes indicar tu nombre y apellidos'}, cp_movil: {required: 'Debes introducir un teléfono de contacto válido'}, cp_estrofa: {required: 'Debes poner tu estrofa para el himno'}, cp_condiciones: {required: 'Debes acceptar las condiciones legales'} }; var cepsaEditFormReglas = { cp_estrofa: {required: true} }; var cepsaEditFormMensajes = { cp_estrofa: {required: 'Debes poner tu estrofa para el himno'} }; var cepsaCommentFormReglas = { comment_body: {required: true} }; var cepsaCommentFormMensajes = { comment_body: {required: 'No puedes introducir comentarios vacíos'} }; var partidoPorrielaFormReglas = { apuesta_casa: {required: true, number: true}, apuesta_fuera: {required: true, number: true} }; var partidoPorrielaFormMensajes = { apuesta_casa: {required: '¡Apuesta incompleta!'}, apuesta_fuera: {required: '¡Apuesta incompleta!'} }; var reporteroNoticiaFormReglas = { reportero_title: {required: true, maxlength: 100}, reportero_body: {validate_text: true, minlength: 100}, titulo_imagen: {required: {depends: function(element){ return $('#imagen').val()!= ""}}} }; var reporteroNoticiaFormMensajes = { reportero_title: {required: 'Tu noticia no tiene titular', maxlength: 'El título es demasiado largo'}, reportero_body: {required: 'Debés incluir como mínimo 100 caracteres', minlength: 'Debés incluir como mínimo 100 caracteres'}, titulo_imagen: {required: 'Debés incluir un pie de foto'} }; var reporteroRumorFormMensajes = { reportero_title: {required: 'Tu rumor no tiene titular', maxlength: 'El título es demasiado largo'}, reportero_body: {required: 'Debés incluir como mínimo 100 caracteres', minlength: 'Debés incluir como mínimo 100 caracteres'}, titulo_imagen: {required: 'Debés incluir un pie de foto'} }; var reporteroEditFormMensajes = { reportero_title: {required: 'Tu noticia o rumor no tiene titular', maxlength: 'El título es demasiado largo'}, reportero_body: {required: 'Debés incluir como mínimo 100 caracteres', minlength: 'Debés incluir como mínimo 100 caracteres'}, titulo_imagen: {required: 'Debés incluir un pie de foto'} }; var partidoCommentFormReglas = { pc_comment_body: {required: true} }; var partidoCommentFormMensajes = { pc_comment_body: {required: 'No podés incluir comentarios vacíos'} }; var adidasadizeroFormReglas = { answer: {required: true} }; var adidasadizeroFormMensajes = { answer: {required: 'Elige una respuesta'} }; var adidasadizeroCpFormReglas = { codigop: {required: true, number: true, minlength: 5, maxlength: 5} }; var adidasadizeroCpFormMensajes = { codigop: {required: 'Escribe tu código postal'} }; var subCommentFormReglas = { comment_body: {required: true} }; var subCommentFormMensajes = { comment_body: {required: 'No podés incluir comentarios vacíos'} }; var nuevacandidaturaFormDosReglas = { ambito: { required: false}, provincia: { required: false}, localidad: { required: false}, link_galeria: {required: false, url: true}, link_video: {required: false, url: true}, para_que: { required: false} }; var nuevacandidaturaFormDosMensajes = { ambito: { required: ''}, provincia: { required: ''}, localidad: { required: ''}, link_galeria: { required: '', url:'Por favor, escribí una URL válida. (Ej. http://www.incondicionales.com)' }, link_video: { required: '', url:'Por favor, escribí una URL válida. (Ej. http://www.incondicionales.com)' }, para_que: { required: '' } }; var nuevacandidaturaFormReglas = { nombre: { required: true }, apellidos: { required: true }, nif_nie_cif: { required: true }, telefono: { required: true, number: true, minlength: 9}, email: { required: true, email: true}, check_mismo_repre: { required: true }, nombre_repre: { required: false }, apellidos_repre: { required: false }, titulo: { required: true}, descripcion: { required: true}, acepta: { required: true} }; var nuevacandidaturaFormMensajes = { nombre: { required: '' }, apellidos: { required: '' }, nif_nie_cif: { required: '' }, telefono: { required: '', number: '', minlength: ''}, email: { required: '', email: ''}, check_mismo_repre:{ required: ''}, titulo: { required: ''}, descripcion: { required: ''}, acepta: {required: ''}, }; var eventsFormMensajes = { event_titulo: {required: 'Debés introducir un título', maxlength: 'El título es demasiado largo'}, event_date_ini: {required: 'Debés indicar una fecha de inicio', validate_date_ini_post: 'La fecha de inicio no puede ser anterior a la actual'}, event_date_fin: {required: 'Debés indicar una fecha de fin', validate_date_fin_post: 'La fecha de fin no puede ser anterior a la actual', validate_date_fin_post_date_ini: 'La fecha de fin no podé ser anterior a la de inicio'}, event_descripcion: {required: '¿Podés describir de qué trata el evento?'}, imagen: {required: 'Debés especificar la imagen', accept: ''} }; var eventsFormReglas = { event_titulo: {required: true, maxlength: 60}, event_date_ini: {required: true, validate_date_ini_post: true}, event_date_fin: {required: true, validate_date_fin_post: true, validate_date_fin_post_date_ini: true}, event_descripcion: {required: true}, imagen: {required: true, accept: "jpg|jpeg"} };/* * Translated default messages for the jQuery validation plugin. * Locale: ES */ jQuery.extend(jQuery.validator.messages, { required: "Este campo es obligatorio.", remote: "Por favor, rellena este campo.", email: "Por favor, escribe una dirección de correo válida", url: "Por favor, escribe una URL válida.", date: "Por favor, escribe una fecha válida.", dateISO: "Por favor, escribe una fecha (ISO) válida.", number: "Por favor, escribe un número entero válido.", digits: "Por favor, escribe sólo dígitos.", creditcard: "Por favor, escribe un número de tarjeta válido.", equalTo: "Por favor, escribe el mismo valor de nuevo.", accept: "Por favor, escribe un valor con una extensión aceptada.", maxlength: jQuery.validator.format("Por favor, no escribas más de {0} caracteres."), minlength: jQuery.validator.format("Por favor, no escribas menos de {0} caracteres."), rangelength: jQuery.validator.format("Por favor, escribe un valor entre {0} y {1} caracteres."), range: jQuery.validator.format("Por favor, escribe un valor entre {0} y {1}."), max: jQuery.validator.format("Por favor, escribe un valor menor o igual a {0}."), min: jQuery.validator.format("Por favor, escribe un valor mayor o igual a {0}.") }); $(document).ready(function(){ //Foro $('textarea.tinyForo').tinymce({ script_url : '/js/tiny_mce/tiny_mce.js', theme : "advanced", mode : "none", language : "es", force_p_newlines : true, force_br_newlines : false, forced_root_block : 'p', convert_fonts_to_spans : true, cleanup : true, entity_encoding : "raw", theme_advanced_buttons1 : "fontselect,fontsizeselect,forecolor,separator,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull", theme_advanced_buttons2 : "bullist,numlist,separator,undo,redo,separator,link,unlink", theme_advanced_buttons3 : "", plugins : "emotions", theme_advanced_buttons2_add : "separator,test", theme_advanced_more_colors : "false", theme_advanced_toolbar_location : "top", setup : function(ed) { // Add a custom button ed.addButton('test', { title : 'Nueva seccion. Forma de uso: [section]Titulo de la seccion[/section]', image : '/js/tiny_mce/plugins/emotions/img/smiley-smile.gif', onclick : function() { $('#add_plugins_emoticonos').show(); } }); } }); //Reportero $('textarea.tinyReportero').tinymce({ script_url : '/js/tiny_mce/tiny_mce.js', theme : "advanced", mode : "none", language : "es", force_p_newlines : true, force_br_newlines : false, forced_root_block : 'p', convert_fonts_to_spans : true, cleanup : true, entity_encoding : "raw", theme_advanced_buttons1 : "bold,italic,underline,separator,bullist,numlist,separator,undo,redo,separator,link,unlink", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", theme_advanced_more_colors : "false", theme_advanced_toolbar_location : "top", onchange_callback: function(editor) { tinyMCE.triggerSave(); $("#" + editor.id).valid(); } }); //Wiki $('textarea.tinyWiki').tinymce({ script_url : '/js/tiny_mce/tiny_mce.js', theme : "advanced", mode : "none", language : "es", convert_fonts_to_spans : true, table_inline_editing : true, cleanup : true, entity_encoding : "raw", theme_advanced_buttons1 : "redirect,separator,seccion,subseccion,linkWiki,externalLinkWiki,separator,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,undo,redo", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", theme_advanced_more_colors : "false", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", setup : function(ed) { // Add a custom button ed.addButton('seccion', { title : 'Nueva seccion. Forma de uso: [section]Titulo de la seccion[/section]', image : '/media/img/wiki/seccion.gif', onclick : function() { // Add you own code to execute something on click tinyMCE.get('wiki_body').focus(); ed.selection.setContent('[section]'+ed.selection.getContent()+'[/section]'); } }); ed.addButton('subseccion', { title : 'Nueva subseccion. Forma de uso: [subsection]Titulo de la subseccion[/subsection]', image : '/media/img/wiki/subseccion.gif', onclick : function() { // Add you own code to execute something on click tinyMCE.get('wiki_body').focus(); ed.selection.setContent('[subsection]'+ed.selection.getContent()+'[/subsection]'); } }); ed.addButton('linkWiki', { title : 'Link. Forma de uso: [link]Titulo Articulo[/link]', image : '/media/img/wiki/enlace.gif', onclick : function() { // Add you own code to execute something on click tinyMCE.get('wiki_body').focus(); ed.selection.setContent('[link]'+ed.selection.getContent()+'[/link]'); } }); ed.addButton('externalLinkWiki', { title : 'Link externo. Forma de uso: [url]http://www.tu_enlace.com[/url]', image : '/media/img/wiki/external.gif', onclick : function() { // Add you own code to execute something on click tinyMCE.get('wiki_body').focus(); ed.selection.setContent('[url]'+ed.selection.getContent()+'[/url]'); } }); ed.addButton('redirect', { title : 'Redireccionar. Forma de uso: [redirect]Titulo Articulo[/redirect]', image : '/media/img/wiki/redirect.gif', onclick : function() { // Add you own code to execute something on click tinyMCE.get('wiki_body').focus(); ed.selection.setContent('[redirect]'+ed.selection.getContent()+'[/redirect]'); } }); } }); });