				var linea='c';
				var linea_old='z';
				var base_linea_old='z';


				function cambiaColor(id, src, color)
				{
				document.all[id].bgColor = color;
				src.style.cursor="hand";
				}

				function cambiaColor3(color) {
				if (linea_old!='z') {
				document.all[linea_old].bgColor = color;
				document.all[base_linea_old].bgColor = '#C0C0C0';
				}
				}



				function cambiaColor2(id, t, src, color1, color2) {

				if (id==linea) {
				document.all[id].bgColor = color2;
				//document.all[t].bgColor =  '#C0C0C0';
				}
				else {
				document.all[id].bgColor = color1;
				//document.all[t].bgColor =   '#C0C0C0';
				}

				src.style.cursor="hand";
				}
				
function small_calendar(url, campo) {

		if (campo=="llegada") {
			if (document.calData.salida.value=='') {
				alert ("Seleccione primero la fecha de inicio.");
				return false;
				}
		}
			
			
var winl = (screen.width - 480) / 2;
var wint = (screen.height - 410) / 2;
popupWin = window.open(url,'datos','width=480,height=410,left='+winl+',top='+wint+',scrollbars=0')
}

function padout(number) { return (number<10) ? '0' + number : number; }

function innFecha(idp, d, m, y) {
 var fecha=new Date; 
    fecha.setMonth(m-1);
    fecha.setFullYear(y);
    fecha.setDate(d);
fecha=padout(fecha.getDate()) +'/'+ padout(fecha.getMonth()+1) +'/'+ padout(fecha.getFullYear());	

if (confirm('Se va a mover esta nota al día '+fecha)) {
window.location = "edit_nota_to_action.asp?p_id="+idp+"&fecha="+fecha;

self.opener.history.go(0);
top.opener.history.go(0);

}  

}


function meterFecha(campo, d, m, y) {

	var fechaSalida=new Date(); 
	var fechaSalida=opener.calData.salida.value;
	var fecha1=fechaSalida.split("-");
	
	var fechallegada=new Date(); 
	var fechallegada=opener.calData.llegada.value;
	var fecha2=fechallegada.split("-");
	

    
	var fecha=new Date; 
    fecha.setMonth(m-1);
    fecha.setFullYear(y);
    fecha.setDate(d);


var LaFechaSalida=2000+(fecha1[2]*1)+''+padout(fecha1[1]*1)+''+padout(fecha1[0]*1);
var LaFechaLlegada=2000+(fecha2[2]*1)+''+padout(fecha2[1]*1)+''+padout(fecha2[0]*1);
var LaFecha=(2000+fecha.getFullYear()).toString()+padout(fecha.getMonth()+1)+padout(fecha.getDate());


fecha=padout(fecha.getDate()) +'-'+ padout(fecha.getMonth()+1) +'-'+ padout(fecha.getFullYear());	

		if (campo=="llegada") {
			if (opener.calData.salida.value=='') {
				alert ("Seleccione primero la fecha de inicio de reserva.");
				return false;
				}
			else if (LaFecha<=LaFechaSalida) {
				alert ("La fecha final debe de ser mayor que la de inicio.");
				return false;
				}
			else if (LaFecha>new Date()) {
				alert ("La fecha final no debe ser mayor a la actual.");
				return false;
				}
			else {
				eval('opener.calData.llegada.value="'+fecha+'"');
			}
		}
	
		
		if (campo=="salida") {
			if (LaFecha > LaFechaLlegada) {
				alert ("La fecha de inicio debe de ser menor que la final");
				return false;
				}
			else {
				eval('opener.calData.salida.value="'+fecha+'"'); 
			}
		}
		
window.close();
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function mail(mypage, myname, scroll) {
var w=700;
var h=500;
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function mail2(mypage, myname, w, h, scroll) {

var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}




function ajuda_form(msg) {
(alert(msg))
}  

function calcular(f, max){
	ncaracteres=f.p_desc.value.length;
	if (!(ncaracteres > 0)) ncaracteres=0;
	f.caracteres.value=ncaracteres;
if (f.p_desc.value.length>max){
alert ("No puede escribir más de "+max+" caracteres en el campo «Descripción».")
return false;
}
else {
return true;
}
}



function calcular_go(f, max){
	ncaracteres=f.p_desc.value.length;
	if (!(ncaracteres > 0)) ncaracteres=0;
	f.caracteres.value=ncaracteres;
if (f.p_desc.value.length>max){
alert ("No puede escribir más de "+max+" caracteres en el campo «Descripción».")
return false;
}
else {
	if (confirm("Acepto las Condiciones Legales del portal LaInmobiliaria.com")) {
	f.submit;
	return true;
	}
	else {
	return false;
		}
	}
}


function go(f){

	if (confirm("Acepto las Condiciones Legales del portal LaInmobiliaria.com")) {
	f.submit;
	return true;
	}
	else {
	return false;
	}
}



function confirmaborrar_nota(item) {
if (confirm('Se va a borrar esta nota de la lista')) {
window.location = "edit_nota_action.asp?p_delete="+item;
}  
}  

function confirmaborrar_oferta1(msg, item, cliente, ofertas) {
if (confirm(msg)) {
window.location = "edit_ofertas_action.asp?p_delete="+item+"&p_cliente="+cliente+"&p_ofertas="+ofertas;
}  
}  


function confirmaborrar_oferta(msg, item, cliente, ofertas) {
if (confirm(msg)) {
window.location = "edit_myofertas_action.asp?p_delete="+item+"&p_cliente="+cliente+"&p_ofertas="+ofertas;
}  
}  

function confirmapago_oferta(msg, item) {
if (confirm(msg)) {
window.location = "edit_pago_action.asp?p_delete="+item;
}  
}  

function confirmanopago_oferta(msg, item) {
if (confirm(msg)) {
window.location = "edit_nopago_action.asp?p_delete="+item;
}  
}  


function confirmaborrar_mensaje(msg, item) {
if (confirm(msg)) {
window.location = "edit_myConn_action.asp?p_delete="+item;
}  
}  

function confirmaborrar_contacto(msg, item) {
if (confirm(msg)) {
window.location = "edit_myContacts_action.asp?p_delete="+item;
}  
}  

function confirmaborrar_mensaje(msg, item) {
if (confirm(msg)) {
window.location = "edit_myConn_action.asp?p_delete="+item;
}  
}  


function confirmaborrar_user(msg, item) {
if (confirm(msg)) {
window.location = "edit_usuaris_action.asp?p_delete="+item;
}  
}  

function confirmaborrar_circular(msg, item) {
if (confirm(msg)) {
window.location = "circular_action.asp?p_delete="+item;
}  
}  

function confirma_borrar(msg, item, page) {
if (confirm(msg)) {
window.location = page + "?p_delete="+item;
}  
}  





function delArtista(pNom, item, ofertas) {
if (ofertas>0) {
alert ("No se puede borrar a "+pNom+" porque tiene "+ ofertas +" ofertas publicadas")
}
else {
	if (confirm('Estas seguro de borrar a '+ pNom)) {
	window.location = "/control/edit_artista_action.asp?p_delete="+item;
	}  
}
}  








function calcular9(f, max){
	ncaracteres=f.p_desc.value.length;
	if (!(ncaracteres > 0)) ncaracteres=0;
	f.caracteres.value=max-ncaracteres;
if (f.p_desc.value.length>max){
alert ("No puede escribir más de "+max+" caracteres en el campo «Descripción».")
return false;
}
else {
return true;
}
}

function calcular2(f, max){
	ncaracteres=f.p_desc.value.length;
	if (!(ncaracteres > 0)) ncaracteres=0;
	f.caracteres.value=ncaracteres;
if (f.p_desc.value.length>max){
alert ("Por favor, acorte el texto.")
}
}



function info(info){
alert (info)
}

function check(f, vari1, vari2, vari3) {
if (f.p_nom.value.length<1){
alert ("Introduzca el Nombre del Artículo.");
return false;
}
else if (f.p_desc.value.length<1){
alert ("Introduzca la Descripción del Artículo.");
return false;
}
else if (f.p_precio.value.length<1){
alert ("Introduzca el Precio del Artículo.");
return false;
}
else {
return true;
}
}
// End -->
function currencyFormat(fld, milSep, decSep, e) {
var sep = 0;
var key = '';
var i = j = 0;
var len = len2 = 0;
var strCheck = '0123456789';
var aux = aux2 = '';
var whichCode = (window.Event) ? e.which : e.keyCode;
if (whichCode == 13) return true;  // Enter
key = String.fromCharCode(whichCode);  // Get key value from key code
if (strCheck.indexOf(key) == -1) return false;  // Not a valid key
len = fld.value.length;
for(i = 0; i < len; i++)
if ((fld.value.charAt(i) != '0') && (fld.value.charAt(i) != decSep)) break;
aux = '';
for(; i < len; i++)
if (strCheck.indexOf(fld.value.charAt(i))!=-1) aux += fld.value.charAt(i);
aux += key;
len = aux.length;
if (len == 0) fld.value = '';
if (len == 1) fld.value = '0'+ decSep + '0' + aux;
if (len == 2) fld.value = '0'+ decSep + aux;
if (len > 2) {
aux2 = '';
for (j = 0, i = len - 3; i >= 0; i--) {
if (j == 3) {
aux2 += milSep;
j = 0;
}
aux2 += aux.charAt(i);
j++;
}
fld.value = '';
len2 = aux2.length;
for (i = len2 - 1; i >= 0; i--)
fld.value += aux2.charAt(i);
fld.value += decSep + aux.substr(len - 2, len);
}
return false;
}

function smallWindow(mypage) {
var myname='WIN0';
var winl = (screen.width - 320) / 2;
var wint = (screen.height - 280) / 2;
winprops = 'height=280, width=320, top='+wint+',left='+winl+', scrollbars=no, resizable=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function circular(mypage) {
var myname='';
var winl = (screen.width - 620) / 2;
var wint = (screen.height - 300) / 2;
winprops = 'height=300, width=620, top='+wint+',left='+winl+', scrollbars=yes, resizable=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function finestra1(mypage) {
var myname='WIN1';
var winl = (screen.width - 380) / 2;
var wint = (screen.height - 280) / 2;
winprops = 'height=280, width=380, top='+wint+',left='+winl+', scrollbars=no, resizable=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function pdf(modelo) {
var w = 700
var h = 550
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
var props = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no, resizable=yes'
var newWindow;
newWindow = window.open("/pdf.asp?modelo="+modelo, "PDF", props);
newWindow.window.focus();
}


function perfiles(modelo) {
var w = 440
var h = 550
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
var props = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes, resizable=no'
var newWindow;
newWindow = window.open("/perfiles/perfiles.asp?modelo="+modelo, "perfiles", props);
newWindow.window.focus();
}

function ver_perfiles(prod) {
top.frames.pantalla.location=('/perfiles/perfiles.asp?modelo='+prod);
}

function ver_formulas(prod) {
top.frames.pantalla.location=('/perfiles/formulas.asp?modelo='+prod);
}

function ver_junquillos(prod) {
top.frames.pantalla.location=('/perfiles/junquillos.asp?modelo='+prod);
}

function ver_accesorios(prod) {
top.frames.pantalla.location=('/perfiles/accesorios.asp?modelo='+prod);
}

function ver_herrajes(prod) {
top.frames.pantalla.location=('/perfiles/herrajes.asp?modelo='+prod);
}

function ver_componentes(prod) {
top.frames.pantalla.location=('/perfiles/componentes.asp?modelo='+prod);
}

function ver_ficha(prod) {
top.frames.pantalla.location=('/perfiles/ficha.asp?modelo='+prod);
}

function ver_modulacion(prod) {
top.frames.pantalla.location=('/perfiles/modulacion.asp?modelo='+prod);
}
