errColor='#DFDFDF'
function completo(obj,nombre,tipo){if (tipo=='int'){ if ((obj.value=='')||(isNaN(obj.value))){obj.style.backgroundColor=errColor;return "\n* "+nombre+" debe ser completado con números."}else{return ""}}else{ if (obj.value==''){obj.style.backgroundColor=errColor;return "\n* "+nombre+" debe ser completado."}else{return ""}}}
function emailvalido(obj,nombre) {msg=""; if(obj.value!=""){var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;if (reg1.test(obj.value) || !reg2.test(obj.value)){obj.style.backgroundColor=errColor;msg= "\n* "+nombre+" es inválido."}} return msg}
function telefonovalido(obj,nombre){var reg=/\d{3,}(.?\d{3,})+/; if((obj.value!="")&&!reg.test(obj.value)){obj.style.backgroundColor=errColor;return "\n* "+nombre+" es inválido."}else{return ""}}
function chequeado(obj, nombre){ ok = false; for(i=0; i<obj.length; i++){obj[i].style.backgroundColor=''; if(obj[i].checked){ok = true}}; if(ok){return ""}else{for(i=0; i<obj.length; i++)obj[i].style.backgroundColor=errColor; return "\n* "+nombre+" debe ser seleccionado."}}
function fechavalida(dia, mes, ano, nombre){val=dia.value+'-'+mes.value+'-'+ano.value; dr=/^[ ]*[0]?(\d{1,2})[-\/](\d{1,2})[-\/](\d{4,})[ ]*$/; mc=val.match(dr);if (mc){ var td=new Date(mc[3],parseInt(mc[2])-1,mc[1]);	if (td.getDate()==parseInt(mc[1]) && td.getFullYear()==parseInt(mc[3]) && (td.getMonth()+1)==parseInt(mc[2])) return"";} dia.style.backgroundColor=errColor; mes.style.backgroundColor=errColor; ano.style.backgroundColor=errColor; return "\n* "+nombre+" es inválido."}


function validarContactenos(){
	d=document.formContactenos
	for(i=0;i<d.length;i++) d.elements[i].style.backgroundColor='';
	error=""
	error += completo(d.Nombre,"Nombre")
	error += completo(d.Apellido,"Apellido")
	error += completo(d.Email,"Email")
	error += completo(d.Direccion,"Dirección")
	error += completo(d.Apellido,"Apellido")
	error += completo(d.Ciudad,"Ciudad")
	error += completo(d.Pais,"Pais")
	error += completo(d.Mensaje,"Mensaje")
	error += emailvalido(d.Email,"Email")
	if(error!=""){alert("FORMULARIO INCOMPLETO:\t\n"+error)}else{d.submit()}
}
function validarLoginClientes(){
	d=document.formularioClientes
	for(i=0;i<d.length;i++) d.elements[i].style.backgroundColor='';
	error=""
	error += completo(d.usuario,"USUARIO")
	error += completo(d.contrasenia,"CONTRASEÑA")
	if(error!=""){alert("FORMULARIO INCOMPLETO:\t\n"+error)}else{d.submit()}
}



//PARA EL LAYER FLOTANTE//////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////




window.onerror = null;
var topMargin = 0;
var slideTime = 500;

var ns6 = (!document.all && document.getElementById);
var ie4 = (document.all);
var ns4 = (document.layers);
function layerObject(id,left) {
if (ns6) {
this.obj = document.getElementById(id).style;
return this.obj;
}
else if(ie4) {
this.obj = document.all[id].style;
return this.obj;
}
else if(ns4) {
this.obj = document.layers[id];
return this.obj;
   }
}
function layerSetup() {
floatLyr = new layerObject('floatLayer', pageWidth * .5);
window.setInterval("main()", 10)
}
function floatObject() {
if (ns4 || ns6) {
findHt = window.innerHeight;
} else if(ie4) {
findHt = document.body.clientHeight;
   }
} 
function main() {
if (ns4) {
this.currentY = document.layers["floatLayer"].top;
this.scrollTop = window.pageYOffset;
mainTrigger();
}
else if(ns6) {
this.currentY = parseInt(document.getElementById('floatLayer').style.top);
this.scrollTop = scrollY;
mainTrigger();
} else if(ie4) {
this.currentY = floatLayer.style.pixelTop;
this.scrollTop = document.body.scrollTop;
mainTrigger();
   }
}
function mainTrigger() {
var newTargetY = this.scrollTop + this.topMargin;
if ( this.currentY != newTargetY ) {
if ( newTargetY != this.targetY ) {
this.targetY = newTargetY;
floatStart();
}
animator();
   }
}
function floatStart() {
}
function animator() {
var now = new Date();
var newY = this.A * Math.sin( this.B * ( now.getTime() - this.C ) ) + this.D;
newY = Math.round(newY);


//alert ("this.currentY="+this.currentY+" findHt="+findHt);
//if (( this.A > 0 && newY > this.currentY && newY +396 < findHt) || ( this.A < 0 && newY < this.currentY )) {
if (( this.A > 0 && newY > this.currentY ) || ( this.A < 0 && newY < this.currentY )) {
		//alert(newY+"-"+ this.currentY);
		if ( ie4 )document.all.floatLayer.style.pixelTop = newY;
		if ( ns4 )document.layers["floatLayer"].top = newY;
		if ( ns6 )document.getElementById('floatLayer').style.top = newY + "px";
		
		
   }
}
function start() {
}




//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
