// JavaScript Document

<!--

function MM_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); 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_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 abre(url,ventana,propiedades) {
    window.open(url,ventana,propiedades); 
 }
function abre2(url) {
    window.open(url,"1","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizeable=1,width=844,height=720");
 }
function popupwindow(index){
if(index==2)
{
site="presupuesto.asp" 
window.open(site,"newwindow10","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizeable=0,width=616,height=578")
}

if(index==1)
{
site="utilidades/solicitar_info.htm" 
window.open(site,"newwindow10","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizeable=1,width=444,height=293")
}

}


function agregar(){
if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
var url=window.location
var titulo=window.document.title

window.external.AddFavorite(url,titulo);
}
else {
if(navigator.appName == "Netscape") 
alert ("Presione Crtl+D para agregar este sitio en sus Bookmarks");
}
}
function pagina_inicio() 
{ 
obj_pagina_inicio.style.behavior='url(#default#homepage)';
obj_pagina_inicio.setHomePage("http://www.hogarcasa.com"); // colocando aquí vuestra dirección
}


var testresults
function checkemail(){

var nombre=document.formula.Nombre.value
var email=document.formula.Email.value
var tel=document.formula.Telefono.value
var ciudad=document.formula.Ciudad.value

var nombre_str=""
var email_str=/^.+@.+\..{2,3}$/
var tel_str=/(^\d+$)|(^\d+\.\d+$)/
var ciudad_str=""

if (nombre==nombre_str || '') {
	alert ("Tiene que introducir la Persona de Contacto.");
	testresults=false
	}
else{	
	if (ciudad==ciudad_str || '') {
		alert ("Tiene que introducir la ciudad");
		testresults=false
		}
	else{
		if (tel_str.test(tel) && tel.length > 8 ){
			if (email_str.test(email)) 
				testresults=true
			else{
				alert("Tiene que introducir una dirección de correo electrónico válida, ej: correo@dominio.com")
				testresults=false
				}
			}
		else{
			alert("Tiene que introducir su número de teléfono")
			testresults=false
			}

		}
	}

return (testresults)
}

function checkbae(){
if (document.layers||document.all)
return checkemail()
else

return true
}




//-->

