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) { //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 MenuOver(tgt){
	tgt.style.backgroundImage = "url(img/menu_on.gif)"
	}
	
function MenuOut(tgt){
	tgt.style.backgroundImage = "url(img/menu_off.gif)"
	}
	
function InnerMenuOver(tgt,color){
	
	tgt.style.backgroundColor = color	
	
	}	
	
function InnerMenuOut(tgt,color){
	
	tgt.style.backgroundColor = color	
	
	}	

function show(object) {
      if (document.getElementById && document.getElementById(object) != null)
           node = document.getElementById(object).style.visibility='visible';
      else if (document.layers && document.layers[object] != null)
          document.layers[object].visibility = 'visible';
      else if (document.all)
          document.all[object].style.visibility = 'visible';
  }

  function hide(object) {
      if (document.getElementById && document.getElementById(object) != null)
           node = document.getElementById(object).style.visibility='hidden';
      else if (document.layers && document.layers[object] != null)
          document.layers[object].visibility = 'hidden';
      else if (document.all)
           document.all[object].style.visibility = 'hidden';
}

// Image Opacity Filter Start

	var baseopacity=0

	function slowhigh(which2){
		imgobj=which2
		browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
		instantset(baseopacity)
		highlighting=setInterval("gradualfade(imgobj)",150)
	}

	function slowlow(which2){
		cleartimer()
		instantset(40)
	}
	
	function slownow(which2){
		cleartimer()
		instantset(100)
	}

	function instantset(degree){
		if (browserdetect=="mozilla")
		imgobj.style.MozOpacity=degree/100
		else if (browserdetect=="ie")
		imgobj.filters.alpha.opacity=degree
	}

	function cleartimer(){
		if (window.highlighting) clearInterval(highlighting)
	}

	function gradualfade(cur2){
		if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
		cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
		else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
		cur2.filters.alpha.opacity+=10
		else if (window.highlighting)
		clearInterval(highlighting)	}

// Image Opacity Filter End


HomePicture = new Array()
HomePicture[0]="<img src='img/random/1.jpg' width='389' height='184' style='vertical-align:middle; border-width:0px;' class='Gradual' id='TheImage'/>"
HomePicture[1]="<img src='img/random/2.jpg' width='389' height='184' style='vertical-align:middle; border-width:0px;' class='Gradual' id='TheImage'/>"
HomePicture[2]="<img src='img/random/3.jpg' width='389' height='184' style='vertical-align:middle; border-width:0px;' class='Gradual' id='TheImage'/>"
HomePicture[3]="<img src='img/random/4.jpg' width='389' height='184' style='vertical-align:middle; border-width:0px;' class='Gradual' id='TheImage'/>"
HomePicture[4]="<img src='img/random/5.jpg' width='389' height='184' style='vertical-align:middle; border-width:0px;' class='Gradual' id='TheImage'/>"
HomePicture[5]="<img src='img/random/6.jpg' width='389' height='184' style='vertical-align:middle; border-width:0px;' class='Gradual' id='TheImage'/>"
HomePicture[6]="<img src='img/random/6.jpg' width='389' height='184' style='vertical-align:middle; border-width:0px;' class='Gradual' id='TheImage'/>"
HomePicture[7]="<img src='img/random/7.jpg' width='389' height='184' style='vertical-align:middle; border-width:0px;' class='Gradual' id='TheImage'/>"
HomePicture[8]="<img src='img/random/8.jpg' width='389' height='184' style='vertical-align:middle; border-width:0px;' class='Gradual' id='TheImage'/>"
HomePicture[9]="<img src='img/random/9.jpg' width='389' height='184' style='vertical-align:middle; border-width:0px;' class='Gradual' id='TheImage'/>"
HomePicture[10]="<img src='img/random/10.jpg' width='389' height='184' style='vertical-align:middle; border-width:0px;' class='Gradual' id='TheImage'/>"
HomePicture[11]="<img src='img/random/11.jpg' width='389' height='184' style='vertical-align:middle; border-width:0px;' class='Gradual' id='TheImage'/>"

	var NumberHome = Math.round(11 * Math.random());
	var TheHomeImage = HomePicture[NumberHome]
	
InnerPicture = new Array()
InnerPicture[0]="<img src='../img/random/inner/1.jpg' width='594' height='88' style='vertical-align:middle;' class='Gradual' id='InnerImage' />"
InnerPicture[1]="<img src='../img/random/inner/2.jpg' width='594' height='88' style='vertical-align:middle;' class='Gradual' id='InnerImage' />"
InnerPicture[2]="<img src='../img/random/inner/3.jpg' width='594' height='88' style='vertical-align:middle;' class='Gradual' id='InnerImage' />"
InnerPicture[3]="<img src='../img/random/inner/4.jpg' width='594' height='88' style='vertical-align:middle;' class='Gradual' id='InnerImage' />"
InnerPicture[4]="<img src='../img/random/inner/5.jpg' width='594' height='88' style='vertical-align:middle;' class='Gradual' id='InnerImage' />"
InnerPicture[5]="<img src='../img/random/inner/6.jpg' width='594' height='88' style='vertical-align:middle;' class='Gradual' id='InnerImage' />"
InnerPicture[6]="<img src='../img/random/inner/7.jpg' width='594' height='88' style='vertical-align:middle;' class='Gradual' id='InnerImage' />"
InnerPicture[7]="<img src='../img/random/inner/8.jpg' width='594' height='88' style='vertical-align:middle;' class='Gradual' id='InnerImage' />"
InnerPicture[8]="<img src='../img/random/inner/9.jpg' width='594' height='88' style='vertical-align:middle;' class='Gradual' id='InnerImage' />"
InnerPicture[9]="<img src='../img/random/inner/10.jpg' width='594' height='88' style='vertical-align:middle;' class='Gradual' id='InnerImage' />"

	var NumberInner = Math.round(9 * Math.random());
	var TheInnerImage = InnerPicture[NumberInner]	
	
// Contact Form Validation Start

function validar(){

if (document.form1.nombre.value==""){
		alert ("Este campo es obligatorio: Nombre");
		document.form1.nombre.focus();
        return false;
		}
	
	if (document.form1.apellido.value==""){
		alert ("Este campo es obligatorio: Apellido");
		document.form1.apellido.focus();
		return false;
		}
	
arroba = document.form1.email.value.indexOf("@"); 
punto  = document.form1.email.value.lastIndexOf(".");
ultimo = document.form1.email.value.length-1;
if (document.form1.email.value == "" || document.form1.email.value == null) 			{
alert("Este campo es obligatorio: E-mail");
document.form1.email.focus();
return false;
}
	if (arroba < 1 || punto-arroba < 2 || ultimo-punto > 3 || ultimo-arroba < 2) {
		alert("El formato de su E-Mail es incorrecto. Por favor Revise");
				document.form1.email.focus();
				return false;
	}

	
	if (document.form1.telefono.value == ""){
		alert ("Este campo es obligatorio: Teléfono");
		document.form1.telefono.focus();
				return false;
	}
	
	
		if (document.form1.desarrollo.value == "seleccione"){
		alert ("Por favor especifique  ¿En qué desarrollo está interesado?");
		return false;
		}
		
		if (document.form1.Rango_de_precio.value == "seleccione"){
		alert ("Por favor especifique el rango de precio de la vivienda");
		return false;
		}
			
		if (document.form1.Recamaras.value == "seleccione"){
		alert ("Por favor especifique el número de recamaras que le interesan");
		return false;
		}
		
		if (document.form1.Fecha_de_entrega.value == "seleccione"){
		alert ("Por favor especifique la fecha de entrega que le interesa");
		return false;
		}
		
		if (document.form1.colonia_interesada.value == "seleccione"){
		alert ("Por favor especifique ¿Qué colonia le interesa?");
		return false;
		}
				
		if (document.form1.Rango_de_credito.value == "seleccione"){
		alert ("Por favor especifique el rango de crédito hipotecario a solicitar");
		return false;
		}		
		
		if (document.form1.Cajones_de_Estacionamiento.value == "seleccione"){
		alert ("Por favor especifique el número de cajones de estacionamiento que le interesan");
		return false;
		}

document.form1.submit();
return true;
}

function ValidarJIJ(){
validar();
}

// Contact Form validation End