// COMIENZO DE CODIGO AJAXfunction nuevoAjax(){	var xmlhttp=false;	try	{		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");  		// Creación del objeto ajax para navegadores diferentes a Explorer	}	catch (e)	{		try		{								// o bien			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");		// Creación del objet ajax para Explorer		}		catch (E)		{			xmlhttp = false;		}	}	if (!xmlhttp && typeof XMLHttpRequest!='undefined')	{		xmlhttp = new XMLHttpRequest();	}	return xmlhttp;};// FIN DE CODIGO AJAX// COMIENZO DE MENSAJE DE PROTECCIÓN DE FOTOS Y ANULACIÓN DE BOTÓN DERECHO Y BOTÓN CENTRALvar clickmessage="Esta imagen está protegida por copyright. Por favor, no la copie o distribuya."; // Message for the alert boxfunction disableclick(e){	if (document.all)	{		if (event.button==2||event.button==3)		{			if (event.srcElement.tagName=="IMG")			{				alert(clickmessage);				return false;			}		}	}	else if (document.layers)	{		if (e.which == 3)		{			alert(clickmessage);			return false;		}	}	else if (document.getElementById)	{		if (e.which==3&&e.target.tagName=="IMG")		{			alert(clickmessage)			return false		}	}}function associateimages(){	for(i=0;i<document.images.length;i++)	document.images[i].onmousedown=disableclick;}if (document.all)	document.onmousedown=disableclickelse if (document.getElementById)	document.onmouseup=disableclickelse if (document.layers)associateimages()// FIN DE MENSAJE DE PROTECCIÓN DE FOTOS Y ANULACIÓN DE BOTÓN DERECHO Y BOTÓN CENTRALvar IE = document.all?true:false;if (!IE) document.captureEvents(Event.MOUSEMOVE)document.onmousemove = getMouseXY;var tempX = 0;var tempY = 0;function getMouseXY(e) {if (IE) { //para IE/*tempX = event.clientX + document.body.scrollLeft;tempY = event.clientY + document.body.scrollTop;tempX = event.clientX + window.scrollX;tempY = event.clientY + window.scrollY;*/tempX = event.clientX + document.documentElement.scrollLeft;tempY = event.clientY + document.documentElement.scrollTop;}else { //para netscapetempX = e.pageX;tempY = e.pageY;}if (tempX < 0){tempX = 0;}if (tempY < 0){tempY = 0;}return true;}var cual;function calendario(varcual){	cual = varcual;   		poshorzcalen = window.document.body.clientWidth / 2 + 120;	if(cual == 3 || cual == 5)	{		document.getElementById("calendar_data").style.top = '960px';		poshorzcalen = poshorzcalen - 160;		document.getElementById("calendar_data").style.left = poshorzcalen + 'px';	}	else if(cual == 6)	{		//document.formulario.articulostienda.style.visibility = 'hidden';		tempX = tempX - 155;		tempX = tempX + 'px';		tempY = tempY + 50;		tempY = tempY + 'px';		//document.getElementById("calendar_data").style.top = '1550px';		document.getElementById("calendar_data").style.top = tempY;		//poshorzcalen = poshorzcalen - 400;		//document.getElementById("calendar_data").style.left = poshorzcalen + 'px';		document.getElementById("calendar_data").style.left = tempX;	}	else if(cual == 4)	{		document.getElementById("calendar_data").style.top = '750px';		poshorzcalen = poshorzcalen + 50;		document.getElementById("calendar_data").style.left = poshorzcalen + 'px';	}	else	if( cual == 7 )	{	   document.getElementById("calendar_data").style.top = '1100px';				document.getElementById("calendar_data").style.left = '650px';	}	else	if( cual == 8 )	{	   document.getElementById("calendar_data").style.top = '850px';				document.getElementById("calendar_data").style.left = '640px';	}		else	{		document.getElementById("calendar_data").style.top = '350px';		poshorzcalen = poshorzcalen + 50;		document.getElementById("calendar_data").style.left = poshorzcalen + 'px';	};	initCalendar();	document.getElementById("calendar_data").style.visibility = '';}var day;var month;var year;var hour;var minute;var second;var clock_set = 0;var formatofecha = 'date';function devolverfecha(fecha,fechaformato){	if(cual == 2)	{		document.formulario.fecha2.value = fecha;		document.formulario.fechaformato2.value = fechaformato + ' 00:00:00';	}	else if(cual == 3)	{		document.formulario.fecha3.value = fecha;		document.formulario.fechaformato3.value = fechaformato + ' 00:00:00';	}	else if(cual == 5)	{		document.formulario.fecha5.value = fecha;		document.formulario.fechaformato5.value = fechaformato + ' 00:00:00';	}	else if(cual == 6)	{		document.formulario.fecha6.value = fecha;		document.formulario.fechaformato6.value = fechaformato + ' 00:00:00';		//document.formulario.articulostienda.style.visibility = 'visible';	}	else	{		document.formulario.fecha.value = fecha;		document.formulario.fechaformato.value = fechaformato + ' 00:00:00';	};		document.getElementById("calendar_data").style.visibility = 'hidden';	day = '';	month = '';	year = '';}function formatNum2(i, valtype){    f = (i < 10 ? '0' : '') + i;    if (valtype && valtype != '')	{        switch(valtype) {            case 'month':                f = (f > 12 ? 12 : f);                break;            case 'day':                f = (f > 31 ? 31 : f);                break;            case 'hour':                f = (f > 24 ? 24 : f);                break;            default:            case 'second':            case 'minute':                f = (f > 59 ? 59 : f);                break;        }    }    return f;}function formatNum2d(i, default_v, valtype){    i = parseInt(i, 10);    if (isNaN(i)) return default_v;    return formatNum2(i, valtype)}function formatNum4(i){    i = parseInt(i, 10)    return (i < 1000 ? i < 100 ? i < 10 ? '000' : '00' : '0' : '') + i;}function initCalendar(){    if (!year && !month && !day)	{	        /* Called for first time */       /* if (document.formulario.fecha.value)		{            value = document.formulario.fecha.value;            if (formatofecha == 'datetime' || formatofecha == 'date')			{                if (formatofecha == 'datetime')				{                    parts   = value.split(' ');                    value   = parts[0];                    if (parts[1])					{                        time    = parts[1].split(':');                        hour    = parseInt(time[0],10);                        minute  = parseInt(time[1],10);                        second  = parseInt(time[2],10);                    }                }                date        = value.split("-");                day         = parseInt(date[0],10);                month       = parseInt(date[1],10) - 1;                year        = parseInt(date[2],10);            }			else			{                year        = parseInt(value.substr(0,4),10);                month       = parseInt(value.substr(4,2),10) - 1;                day         = parseInt(value.substr(6,2),10);                hour        = parseInt(value.substr(8,2),10);                minute      = parseInt(value.substr(10,2),10);                second      = parseInt(value.substr(12,2),10);            }        }*/        if (isNaN(year) || isNaN(month) || isNaN(day) || day == 0)		{            dt      = new Date();            year    = dt.getFullYear();            month   = dt.getMonth();            day     = dt.getDate();        }        if (isNaN(hour) || isNaN(minute) || isNaN(second))		{            dt      = new Date();            hour    = dt.getHours();            minute  = dt.getMinutes();            second  = dt.getSeconds();        }    }	else	{        /* Moving in calendar */        if (month > 11)		{            month = 0;            year++;        }        if (month < 0)		{            month = 11;            year--;        }    }    if (document.getElementById)	{        cnt = document.getElementById("calendar_data");    }	else if (document.all)	{        cnt = document.all["calendar_data"];    }    cnt.innerHTML = "";    str = ""    //heading table    str += '<table class="calendar"><tr><th width="50%">';    str += '<form method="NONE" onsubmit="return 0">';    str += '<a href="javascript:month--; initCalendar();">&laquo;</a> ';    str += '<select id="select_month" name="monthsel" onchange="month = parseInt(document.getElementById(\'select_month\').value); initCalendar();">';    for (i =0; i < 12; i++)	{        if (i == month) selected = ' selected="selected"';        else selected = '';        str += '<option value="' + i + '" ' + selected + '>' + month_names[i] + '</option>';    }    str += '</select>';    str += ' <a href="javascript:month++; initCalendar();">&raquo;</a>';    str += '</form>';    str += '</th><th width="50%">';    str += '<form method="NONE" onsubmit="return 0">';    str += '<a href="javascript:year--; initCalendar();">&laquo;</a> ';    str += '<select id="select_year" name="yearsel" onchange="year = parseInt(document.getElementById(\'select_year\').value); initCalendar();">';    for (i = year - 25; i < year + 25; i++)	{        if (i == year) selected = ' selected="selected"';        else selected = '';        str += '<option value="' + i + '" ' + selected + '>' + i + '</option>';    }    str += '</select>';    str += ' <a href="javascript:year++; initCalendar();">&raquo;</a>';    str += '</form>';    str += '</th></tr></table>';    str += '<table class="calendar"><tr>';    for (i = 0; i < 7; i++)	{        str += "<th>" + day_names[i] + "</th>";    }    str += "</tr>";    var firstDay = new Date(year, month, 0).getDay();    var lastDay = new Date(year, month + 1, 0).getDate();    str += "<tr>";    dayInWeek = 0;    for (i = 0; i < firstDay; i++)	{        str += "<td>&nbsp;</td>";        dayInWeek++;    }    for (i = 1; i <= lastDay; i++)	{        if (dayInWeek == 7) {            str += "</tr><tr>";            dayInWeek = 0;        }        dispmonth = 1 + month;        if (formatofecha == 'datetime' || formatofecha == 'date')		{            actVal = "" + formatNum2(i, 'day') + "-" + formatNum2(dispmonth, 'month') + "-" + formatNum4(year);            actValFormato = "" + formatNum4(year) + "-" + formatNum2(dispmonth, 'month') + "-" + formatNum2(i, 'day');        }		else		{            actVal = "" + formatNum2(i, 'day') + formatNum2(dispmonth, 'month') + formatNum4(year);            actValFormato = "" + formatNum4(year) + "-" + formatNum2(dispmonth, 'month') + "-" + formatNum2(i, 'day');        }        if (i == day)		{            style = ' class="selected"';            current_date = actVal;        } else {            style = '';        }        str += "<td" + style + "><a href=\"javascript:devolverfecha('" + actVal + "','" + actValFormato + "');\">" + i + "</a></td>"        dayInWeek++;    }    for (i = dayInWeek; i < 7; i++)	{        str += "<td>&nbsp;</td>";    }    str += "</tr></table>";    cnt.innerHTML = str;    // Should we handle time also?    if (formatofecha != 'date' && !clock_set)	{        if (document.getElementById)		{            cnt = document.getElementById("clock_data");        }		else if (document.all)		{            cnt = document.all["clock_data"];        }        str = '';        init_hour = hour;        init_minute = minute;        init_second = second;        str += '<form method="NONE" class="clock" onsubmit="devolverfecha(\'' + current_date + '\')">';        str += '<input id="hour"    type="text" size="2" maxlength="2" onblur="this.value=formatNum2d(this.value, init_hour, \'hour\'); init_hour = this.value;" value="' + formatNum2(hour, 'hour') + '" />:';        str += '<input id="minute"  type="text" size="2" maxlength="2" onblur="this.value=formatNum2d(this.value, init_minute, \'minute\'); init_minute = this.value;" value="' + formatNum2(minute, 'minute') + '" />:';        str += '<input id="second"  type="text" size="2" maxlength="2" onblur="this.value=formatNum2d(this.value, init_second, \'second\'); init_second = this.value;" value="' + formatNum2(second, 'second') + '" />';        str += '<br />';        str += '<input type="submit" value="' + submit_text + '"/>';        str += '</form>';        cnt.innerHTML = str;        clock_set = 1;		    }}var month_names = new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");var day_names = new Array("Lun","Mar","Mie","Jue","Vie","Sab","Dom");var submit_text = "Vamonos";// Esto lo ha metido Dreamweaver al crear una capa. Supongo k será para colocarlas bién en Netscapefunction MM_reloadPage(init){  //reloads the window if Nav4 resized  if (init==true) with (navigator)  {  	if ((appName=="Netscape")&&(parseInt(appVersion)==4))		{    		document.MM_pgW=innerWidth;			document.MM_pgH=innerHeight;			onresize=MM_reloadPage;		}  }  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();}MM_reloadPage(true);function subscribir(){	if(document.formularioboletin.nombresuscripcion.value == '' || document.formularioboletin.nombresuscripcion.value == 'Introduzca su Nombre')	{		document.getElementById("avisovalidacion").innerHTML = '<br /><span style="color: #FFFFFF;">Por favor, introduzca su Nombre</span>';		document.formularioboletin.nombresuscripcion.focus();		return;	}	if(document.formularioboletin.apellido1suscripcion.value == '' || document.formularioboletin.apellido1suscripcion.value == 'Introduzca su Primer Apellido')	{		document.getElementById("avisovalidacion").innerHTML = '<br /><span style="color: #FFFFFF;">Por favor, introduzca su Primer Apellido</span>';		document.formularioboletin.apellido1suscripcion.focus();		return;	}	if(document.formularioboletin.apellido2suscripcion.value == '' || document.formularioboletin.apellido2suscripcion.value == 'Introduzca su Segundo Apellido')	{		document.getElementById("avisovalidacion").innerHTML = '<br /><span style="color: #FFFFFF;">Por favor, introduzca su Segundo Apellido</span>';		document.formularioboletin.apellido2suscripcion.focus();		return;	}	if(document.formularioboletin.emailsuscripcion.value == '' || document.formularioboletin.emailsuscripcion.value == 'Introduzca su E-Mail')	{		document.getElementById("avisovalidacion").innerHTML = '<br /><span style="color: #FFFFFF;">Por favor, introduzca su E-Mail</span>';		document.formularioboletin.emailsuscripcion.focus();		return;	}	var Email = document.formularioboletin.emailsuscripcion.value;    var Formato = /^([\w-\.])+@([\w-]+\.)+([a-z]){2,4}$/;	var Comparacion = Formato.test(Email);    if(Comparacion == false)	{		document.getElementById("avisovalidacion").innerHTML = '<br /><span style="color: #FFFFFF;">El E-Mail ingresado no es válido, ejemplo: sunombre@dominio.ext</span>';		document.formularioboletin.emailsuscripcion.focus();        return;    }		//alert(document.formularioboletin.action);	document.formularioboletin.submit();}