function ignoreSpaces(string) {
	var temp = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(v = 0; v < splitstring.length; v++)
	temp += splitstring[v];
	//devuelve vacio o relleno
	return temp;
}
function dolar(string) {
	var temp = "";
	string = '' + string;
	splitstring = string.split("$");
	for(v = 0; v < splitstring.length; v++)
	temp += splitstring[v]+"'";
	//devuelve vacio o relleno
	return temp;
}
//Introducción de e-mail correcto
function validarEmail(valor) {
	ema=valor
	mal=0
	if ((ema!="")&&(ema.indexOf("@")==-1)){
		mal=1
	}
	if ((ema!="")&&(ema.indexOf("@")!=ema.lastIndexOf("@"))){
		mal=1
	}
	if ((ema!="")&&(ema.charAt(0)=="@")){
		mal=1
	}
	if ((ema!="")&&(ema.charAt(ema.length-1)=="@")){
		mal=1
	}
	if ((ema!="")&&(ema.lastIndexOf(".")==-1)){
		mal=1
	}
	if ((ema!="")&&(ema.indexOf(" ")!=-1)){
		mal=1
	}
	if ((ema!="")&&(ema.charAt(0)==".")){
		mal=1
	}
	if ((ema!="")&&(ema.charAt(ema.length-1)==".")){
		mal=1
	}
	if ((ema!="")&&(ema.indexOf("@")>ema.lastIndexOf("."))){
		mal=1
	}
	if ((ema!="")&&(ema.lastIndexOf(".")-ema.indexOf("@")<2)){
		mal=1
	}
	return mal
}


//------------------------------------------------
var daysInMonth = makeArray(12);
daysInMonth[1] = 31;
daysInMonth[2] = 29;
daysInMonth[3] = 31;
daysInMonth[4] = 30;
daysInMonth[5] = 31;
daysInMonth[6] = 30;
daysInMonth[7] = 31;
daysInMonth[8] = 31;
daysInMonth[9] = 30;
daysInMonth[10] = 31;
daysInMonth[11] = 30;
daysInMonth[12] = 31;

function makeArray(n) {
   for (var i = 1; i <= n; i++) {
      this[i] = 0;
   } 
   return this;
}

function daysInFebruary(whichYear) {
    return (whichYear % 4 == 0 && (!(whichYear % 100 == 0)
 || (whichYear % 400 == 0)) ? 29 : 28);
}

function isDate(campo) {
	dd=campo.substring(0,2)*1
	mm=campo.substring(3,5)*1
	aa=campo.substring(6,10)*1
	if (mm !="" && !(mm > 0 && mm < 13)){
		alert ("¡Fecha no existente!");
		return false;
	}
	if (dd !="" && !(dd > 0 && dd < 32)){
		alert ("¡Fecha no existente!");
		return false;
	}
	if ((dd!="" && mm!="") && dd > daysInMonth[mm]){
		alert ("¡Fecha no existente!")
		return false;
	}
	if ((mm=="2" || mm=="02" && dd!="" && yyyy!="") && dd > daysInFebruary(yyyy)){
		alert ("¡Fecha no existente!")
		return false;
	}
return true;
}
function ventana(page, x, y){
	posx = (screen.availWidth-x)/2;
	posy = (screen.availHeight-y)/2;
	window.open(page, 'DETALLE','toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, width='+x+', height='+y+', top='+posy+', left='+posx);
}
function transicion(){
	if (document.all){
		document.images.visor.style.filter="blendTrans(duration=2)"
		document.images.visor.style.filter="blendTrans(duration=duracion)"
		document.images.visor.filters.blendTrans.Apply()      
	}
	document.images.visor.src = precarga[j].src
	if (document.all){
		document.images.visor.filters.blendTrans.Play()
	}
	j = j + 1
	if (j > (p-1)) j=0
	t = setTimeout('transicion()', velocidad)
}

