/*  ==============================================================================  */
/*  ==============================================================================  */
/*  ==============================================================================  */
function Nueva_Imagen(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
/*  ==============================================================================  */
function Cam_Img() {
	if (document.images && (Imagenes_Cargadas == true)) {
		for (var i=0; i<Cam_Img.arguments.length; i+=2) {
			document[Cam_Img.arguments[i]].src = Cam_Img.arguments[i+1];
		}
	}
}
/*  ==============================================================================  */
var Imagenes_Cargadas = false;
function Cargar_Imagenes() {
	if (document.images) {
		menu_num1 = Nueva_Imagen("images/menu1.gif");
		menu_num2 = Nueva_Imagen("images/menu2.gif");
		menu_num3 = Nueva_Imagen("images/menu3.gif");
		menu_num4 = Nueva_Imagen("images/menu4.gif");				
		menu_num5 = Nueva_Imagen("images/menu5.gif");
		menu_num6 = Nueva_Imagen("images/menu6.gif");
		menu_num7 = Nueva_Imagen("images/menu7.gif");
		menu_num8 = Nueva_Imagen("images/menu8.gif");
		Imagenes_Cargadas = true;
	}
}
/*  ==============================================================================  */
var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")

function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
if (hours>12){
hours=hours-12
}

if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate=""+dayarray[day]+", "+daym+ " de "+ montharray[month]+" del "+year 
//+" "+hours+":"+minutes+":"+seconds+" "+dn
+""
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}

if (!document.all&&!document.getElementById)
getthedate()

function goforit(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}

/*  ==============================================================================  */
function getthedatehome(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
if (hours>12){
hours=hours-12
}

if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdatehome=""+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" &nbsp&nbsp"+hours+":"+minutes+":"+seconds+" "+dn
+""
if (document.all)
document.all.clock.innerHTML=cdatehome
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdatehome
else
document.write(cdatehome)
}

if (!document.all&&!document.getElementById)
getthedatehome()

function goforithome(){
if (document.all||document.getElementById)
setInterval("getthedatehome()",1000)
}

/*  ==============================================================================  */
function VerificarMailContacto() 
{
// buscamos si tiene la ARROBA
  if (formOne.emailForm.value.indexOf('@') == -1)
     { return false; }

// buscamos si tiene el punto
  if (formOne.emailForm.value.indexOf('.') == -1)
 {  return false; }    

// buscamos si tiene ESPACIO EN BLANCO
  if (formOne.emailForm.value.indexOf(' ') > -1)
   {   return false; }    
        
  return true;
}
/*  ==============================================================================  */
function VerificarFormularioContacto() {

 if(formOne.nombreForm.value=="") 
    { alert("Debes ingresar tu Nombre") 
     formOne.nombreForm.focus();
	 formOne.nombreForm.select();
	return false;  }

 if(formOne.emailForm.value=="") 
    { alert("Debes ingresar tu E-mail") 
     formOne.emailForm.focus();
	 formOne.emailForm.select();
	return false;  }

if (!VerificarMailContacto())
         { alert("Tu E-mail, debe tener la forma usuario@dominio.com"); 
             formOne.emailForm.focus();         
             formOne.emailForm.select();         
         return false; }

 if(formOne.telefonoForm.value=="") 
    { alert("Debes ingresar tu Teléfono") 
      formOne.telefonoForm.focus();
      formOne.telefonoForm.select();
      return false;  }

return true;
}

/*  ==============================================================================  */
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
// Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = 'images/foto_1.jpg'
Pic[1] = 'images/foto_2.jpg'
Pic[2] = 'images/foto_3.jpg'
Pic[3] = 'images/foto_4.jpg'
Pic[4] = 'images/teflones.jpg'
Pic[5] = 'images/servicio.jpg'

// do not edit anything below this line
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
function runSlideShow() {
if (document.all) {
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();
}
document.images.SlideShow.src = preLoad[j].src;
if (document.all) {
document.images.SlideShow.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}
//  End -->
/*
Thomas Brattli 
*/
// Courtesy of SimplytheBest.net (http://simplythebest.net/info/dhtml_scripts.html)
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()

lstart=240
loop=true
// Velocidad
speed=40
pr_step=1

function makeObj(obj,nest){
    nest=(!nest) ? '':'document.'+nest+'.'
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
  	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
	this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
	this.newsScroll=newsScroll;
	this.moveIt=b_moveIt; this.x; this.y;
    this.obj = obj + "Object"
    eval(this.obj + "=this")
    return this
}
function b_moveIt(x,y){
	this.x=x;this.y=y
	this.css.left=this.x
	this.css.top=this.y
}
function newsScroll(speed){
	if(this.y>-this.scrollHeight){
		this.moveIt(0,this.y-pr_step)
		setTimeout(this.obj+".newsScroll("+speed+")",speed)
	}else if(loop) {
		this.moveIt(0,lstart)
		eval(this.obj+".newsScroll("+speed+")")
	  }
}
function newsScrollInit(){
	oNewsCont=new makeObj('divNewsCont')
	oNewsScroll=new makeObj('divNewsText','divNewsCont')
	oNewsScroll.moveIt(0,lstart)
	oNewsCont.css.visibility='visible'
	oNewsScroll.newsScroll(speed)
}
//onload=newsScrollInit;
/*  ==============================================================================  */