function compBusqueda()
{
if(document.form_busqueda.br.value == 'Type')
{
document.form_busqueda.br.value = '';
}
document.form_busqueda.submit();
}
function comproba(texto,campo,tipo)
{
var form = document.getElementById(campo);
if(tipo == 1 && form.value == texto)
{
form.value = '';
}else{
if(form.value == "undefined" || form.value == "")
{
form.value = texto;
}
}
}
function limpiar()
{
var inputs = new Array("nombre","mensaje","pcontacto","email","email2","telefono","pais");
var formu = document.consulta;
for(i=0;i<=inputs.length;i++)
{ alert(formu.inputs[i].value); }
}
function cambiaStyle(id)
{
if(document.getElementById('lnk'+id).className == 'selected')
{
document.getElementById('lnk'+id).className = 'noselect';
document.getElementById('chk'+id).checked = false;
}else{
document.getElementById('lnk'+id).className = 'selected';
document.getElementById('chk'+id).checked = true;
}
}
function objetus(file) {
xmlhttp=false;
this.AjaxFailedAlert = "Su navegador no soporta las funciónalidades de este sitio y podria experimentarlo de forma diferente a la que fue pensada. Por favor habilite javascript en su navegador para verlo normalmente.\n";
this.requestFile = file;
this.encodeURIString = true;
this.execute = false;
if (window.XMLHttpRequest) {
this.xmlhttp = new XMLHttpRequest();
if (this.xmlhttp.overrideMimeType) {
this.xmlhttp.overrideMimeType('text/xml');
}
}
else if (window.ActiveXObject) { // IE
try {
this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch (e) {
try {
this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
this.xmlhttp = null;
}
}
if (!this.xmlhttp && typeof XMLHttpRequest!='undefined') {
this.xmlhttp = new XMLHttpRequest();
if (!this.xmlhttp){
this.failed = true;
}
}
}
return this.xmlhttp ;
}
function recibeid(_pagina,valorget,valorpost,capa){
ajax=objetus(_pagina);
if(valorpost!=""){
ajax.open("POST", _pagina+"?"+valorget+"&tiempo="+new Date().getTime(),true);
} else {
ajax.open("GET", _pagina+"?"+valorget+"&tiempo="+new Date().getTime(),true);
}
ajax.onreadystatechange=function() {
if (ajax.readyState==1){
document.getElementById(capa).innerHTML =
"

";
}
if (ajax.readyState==4) {
if(ajax.status==200)
{
document.getElementById(capa).innerHTML = ajax.responseText;
if (valorget=='tip=0' && valorpost=='marca=0' && _pagina=='busqueda_datos.php' && capa=='tipos') recibeid('busqueda_datos.php','tip=0','tipo=0','marcass');
}
else if(ajax.status==404)
{
capa.innerHTML = "La direccion no existe";
}
else
{
capa.innerHTML = "Error: ".ajax.status;
}
}
}
if(valorpost!=""){
ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
ajax.send(valorpost);
} else {
ajax.send(null);
}
}
function EnvioInfo(iSitio, sPagina){
var sUrlDestino="";
switch(iSitio){
case 1: // Meneame ID:1
sUrlDestino = "http://meneame.net/login.php?return=/submit.php?url=" + sPagina;
break;
case 2: // Digg ID:2
sUrlDestino = "http://digg.com/submit?phase=2&url=" + sPagina;
break;
case 3: // Delicious ID:3
sUrlDestino = "https://secure.del.icio.us/login?url=" + sPagina;
break;
case 4: // Technorati ID:4
sUrlDestino = "http://www.technorati.com/search/" + sPagina;
break;
case 5: // Google ID:5
sUrlDestino = "http://www.google.com/ig/add?feedurl=" + sPagina;
break;
case 6: // Yahoo ID:6
sUrlDestino = "http://myweb2.search.yahoo.com/myresults/bookmarklet?u=" + sPagina + "&d=&ei=UTF-8";
break;
case 7: // Fresqui ID:7
sUrlDestino = "http://tec.fresqui.com/post?url=" + sPagina;
break;
}
window.open(sUrlDestino);
}
function validarEmail(valor) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
return true;
} else {
return false;
}
}
function compRecomend()
{
var mal = false;
if(document.recomendar.tunombre.value.length==0)
{
document.getElementById('tunombre').style.borderColor='#aa0000';
mal = true;
}else{
document.getElementById('tunombre').style.borderColor='';
}
if(validarEmail(document.recomendar.tuemail.value) == false)
{
document.getElementById('tuemail').style.borderColor='#aa0000';
mal = true;
}else{
document.getElementById('tuemail').style.borderColor='';
}
if(validarEmail(document.recomendar.email_2.value) == false)
{
document.getElementById('email_2').style.borderColor='#aa0000';
mal = true;
}else{
document.getElementById('email_2').style.borderColor='';
}
if(document.recomendar.nombre_2.value.length==0)
{
document.getElementById('nombre_2').style.borderColor='#aa0000';
mal = true;
}else{
document.getElementById('nombre_2').style.borderColor='';
}
if(!mal)
{
document.recomendar.submit();
}
}
function recomendar(ide)
{
window.open('http://en.minutemachine.com/recomendar.php?m='+ide,'','height=470,width=590');
}
function ocultarEncuesta(){
document.getElementById('contenido_encuesta').style.display='none';
document.cookie="encuesta = vista; expires = 2 Dec 2009 23:59:59 GMT";
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
function avisoAlerts(option)
{
if (option == 1) {
document.getElementById('alert_1').style.display='none';
document.getElementById('alert_avisos').style.display='block';
}
else {
document.getElementById('alert_avisos').style.display='none';
document.getElementById('alert_1').style.display='block';
}
}
function showAllCat(divid, dispstyle)
{
if (document.getElementById(divid).style.display==dispstyle) {
document.getElementById(divid).style.display='none';
}
else document.getElementById(divid).style.display=dispstyle;
}
function submitSearch (regiones, paises) {
// document.getElementById('input_regiones').value = regiones.replace(",", "-");
// document.getElementById('input_paises').value=paises.replace(",","-");
document.getElementById('input_regiones').value = regiones;
document.getElementById('input_paises').value=paises;
document.formsearch.submit();
}
function onlyNumbers(e)
{
var keynum;
var keychar;
var numcheck;
if(window.event) keynum = e.keyCode; // IE
else if(e.which) keynum = e.which; // FIREFOX/NETSCAPE/OPERA
keychar = String.fromCharCode(keynum);
numcheck = /\d/;
return numcheck.test(keychar);
}
function updAndSndForm(idform, idinput, valor, actionval)
{
thisForm = document.getElementById(idform);
if (idinput != '') document.getElementById(idinput).value=valor;
if (actionval != '') {
thisForm.method = "GET";
thisForm.action = actionval;
}
else thisForm.action = '';
thisForm.submit();
}
function sndFormTarget(idform, targett, actionval, divid)
{
thisForm = document.getElementById(idform);
thisForm.target = targett;
thisForm.action = actionval;
thisForm.submit();
document.getElementById(divid).style.display='block';
thisForm.target = "";
}
function ocultaDivIframe(divid, iframeid)
{
document.getElementById(divid).style.display='none';
document.getElementById(iframeid).src='';
}
function actualizaDatosMail(tagNam, clasNam, valor)
{
var inputss = document.getElementsByTagName(tagNam);
for (ti=0;tidateForm.fechaFin.value) alert('La fecha de inicio debe ser anterior a la fecha fin');
else if(dateForm.fechaFin.value>fechaMax) alert('Por favor escoja una fecha anterior al dia '+fechaMax);
else
{
dateForm.action=''; dateForm.submit();
}
}
function refreshImages()
{
var search="?"+(new Date()).getTime();
for(var i=0;i';
linkFotoPpal.href = "javascript:amplImg('"+imgName+"', "+ancho+", "+alto+");";
}
function tagVisibility(tag, inout)
{
if (!document.getElementsByTagName) return;
elements = document.getElementsByTagName(tag);
for (ti=0;ti 0) {
selNewsOk++;
}
if (thisForm.marca.selectedIndex != '' && thisForm.marca.selectedIndex > 0) {
selNewsOk++;
}
if (thisForm.tipo.selectedIndex != '' && thisForm.tipo.selectedIndex > 0) {
selNewsOk++;
}
if (thisForm.modelo.value != '') {
selNewsOk++;
}
if (selNewsOk == 0 && formOk==1) {
formOk = 0;
avisoFaltan = "Select at least 1-2 characteristics of the equipment you are looking for";
}
if (thisForm.acepto_news.checked==false && formOk==1) {
formOk = 0;
avisoFaltan = "You must read and except the terms and conditions in order to activate the search";
}
if (formOk == 1) {
document.getElementById('alert_1').style.display="none";
document.getElementById('alert_2').style.display="block";
document.getElementById('emailnews_nombre').innerHTML = thisForm.personacont.value;
thisForm.submit();
}
else {
if (avisoFaltan != '') {
alert(avisoFaltan);
}
}
}
function closeAlerts() {
Effect.toggle('alertnews','appear');
}
function checkCheck(idCheckBox) {
if (document.getElementById(idCheckBox).checked==true) document.getElementById(idCheckBox).checked=false;
else document.getElementById(idCheckBox).checked=true
}
function a_external() {
var a,l,i,d=document;
if (!d.getElementsByTagName) return;
a = d.getElementsByTagName("a");
for (i=0;i (b.text+"")) { return 1; }
return 0;
}
);
for (var i=0; i=1 ) {
sinfin=true;
}else{
sinfin=false;
}
}
if(sinfin){
document.formulario.submit(); // if de elseif
}else{
alert('Introduce bien las fechas de inicio y fin');
} // if sinfin
}
}
/// FIN MODIFICAR
function enviar()
{
if(document.getElementById('titulo').value.length==0 || document.getElementById('mensaje').value.length==0 || document.getElementById('mensaje').value=='' || document.getElementById('titulo').value==''){
alert('Rellene el titulo y/o mensaje');
}else{
var sinfin;
if(document.getElementById('sinfin').checked==true){
sinfin=true;
}else{
var campo=document.getElementById('ini');
var campo2=document.getElementById('fin');
var RegExPattern = /^\d{4}\-\d{2}\-\d{2}$/;
// Comprobamos campo calendario
if ((campo.value.match(RegExPattern)) && (campo.value!='') && campo2.value.match(RegExPattern) && (campo2.value!='') && comprobarFecha('ini','fin')>=1 ) {
sinfin=true;
}else{
sinfin=false;
}
}
if(sinfin){
if(document.getElementById('varios').checked==true){
if(document.getElementById('Clientes').value.length==0){
alert('Rellena el campo ICLIs');
}else{
document.formulario.submit();
}
}else if(document.getElementById('1Pais').checked==true){
if(document.getElementById('pais').value=="nada"){
alert('Escoja algún país');
}else{
document.formulario.submit();
}
}else if(document.getElementById('variosPais').checked==true){
selMail = document.getElementById('paises2-1');
if (selMail.options.length>0) {
for (i=0;i