// JavaScript Clima/Simage/Swap
function validarWeather() {
		img1 = new Image;
		img2 = new Image;
		img3 = new Image;
		img4 = new Image;
		img5 = new Image;
		img6 = new Image;
		img7 = new Image;
		img1.src= "http://www.tutiempo.net/imagenes_asociados/84x38/MMZO.png";
		img2.src= "http://www.tutiempo.net/imagenes_asociados/84x38/MMIA.png";
		img3.src= "http://www.tutiempo.net/imagenes_asociados/84x38/MMAN.png";
		img4.src= "http://www.tutiempo.net/imagenes_asociados/84x38/MMUN.png";
		img5.src= "http://www.tutiempo.net/imagenes_asociados/84x38/MMCZ.png";
		img6.src= "http://www.tutiempo.net/imagenes_asociados/84x38/MMMX.png";
		img7.src= "http://www.tutiempo.net/imagenes_asociados/84x38/MKJS.png";
		<!-- Validaciones para Manzanillo-->
		if(document.myform.ClimaSelection.value==1){
			document.imgSwap.src = img1.src;			
			window.imgHref.href="http://www.tutiempo.net/tiempo/Manzanillo_International/MMZO.htm";
			document.imgSwap.alt = "El Tiempo Manzanillo Internacional";			
			}
		<!-- Validaciones para Colima-->
		if(document.myform.ClimaSelection.value==2){
			document.imgSwap.src = img2.src;			
			window.imgHref.href="http://www.tutiempo.net/tiempo/Colima/MMIA.htm";			
			document.imgSwap.alt = "El Tiempo Colima";
		}
		<!-- Validaciones para Monterrey, Aerop.-->
		if(document.myform.ClimaSelection.value==3){
			document.imgSwap.src = img3.src;
			window.imgHref.href="http://www.tutiempo.net/tiempo/Aerop_Internacional_Monterrey_N_L/MMAN.htm";
			document.imgSwap.alt = "El Tiempo Aerop. Internacional Monterrey, N. L.";			
		}
		<!-- Validaciones para Cancun, Aerop.-->
		if(document.myform.ClimaSelection.value==4){
			document.imgSwap.src = img4.src;
			window.imgHref.href="http://www.tutiempo.net/tiempo/Cancun_International_Airport/MMUN.htm";	
			document.imgSwap.alt = "El Tiempo Cancun International Airport";
		}
		<!-- Validaciones para Cozumel-->
		if(document.myform.ClimaSelection.value==5){
			document.imgSwap.src = img5.src;
			window.imgHref.href="http://www.tutiempo.net/tiempo/Cozumel_Civ_Mil/MMCZ.htm";			
			document.imgSwap.alt = "El Tiempo Cozumel Civ / Mil";			
		}
		<!-- Validaciones para Ciudad de Mexico-->
		if(document.myform.ClimaSelection.value==6){
			document.imgSwap.src = img6.src;
			window.imgHref.href="http://www.tutiempo.net/tiempo/Mexico_City_Licenci/MMMX.htm";			
			document.imgSwap.alt = "El Tiempo Mexico City / Licenci";			
		}
		<!-- Validaciones para Montego Bay-->
		if(document.myform.ClimaSelection.value==7){
			document.imgSwap.src = img7.src;
			window.imgHref.href="http://www.tutiempo.net/tiempo/Montego_Bay_Sangster/MKJS.htm";			
			document.imgSwap.alt = "El Tiempo Montego Bay / Sangster";			
		}
}

// Swap Images

function SimpleSwap(el,which){
  el.src=el.getAttribute(which || "origsrc");
}
function SimpleSwapSetup(){
  var x = document.getElementsByTagName("img");
  for (var i=0;i<x.length;i++){
    var oversrc = x[i].getAttribute("oversrc");
    if (!oversrc) continue;
      
    // preload image
    // comment the next two lines to disable image pre-loading
    x[i].oversrc_img = new Image();
    x[i].oversrc_img.src=oversrc;
    // set event handlers
    x[i].onmouseover = new Function("SimpleSwap(this,'oversrc');");
    x[i].onmouseout = new Function("SimpleSwap(this);");
    // save original src
    x[i].setAttribute("origsrc",x[i].src);
  }
}
var PreSimpleSwapOnload =(window.onload)? window.onload : function(){};
window.onload = function(){PreSimpleSwapOnload(); SimpleSwapSetup();}

function validar(){
	if(document.myform.nombre.value == ""){
		window.alert("Favor de ingresa su nombre");
		document.myform.nombre.focus();
		return false;
	}
	if(document.myform.telefono.value == ""){
		window.alert("Ingrese su teléfono para comunicarnos con usted, Gracias");
		document.myform.telefono.focus();
		return false;
	}
	if(document.myform.email.value == ""){
		window.alert("Ingrese su e-mail para poder contactarlo, Gracias");
		document.myform.email.focus();
		return false;
	}
	if(document.myform.mensaje.value == ""){
		window.alert("Escriba su mensaje por favor");
		document.myform.mensaje.focus();
		return false;
	}
	else {
		document.myform.submit();
	}
}

//Validaciones

function validar(){
	if(document.myform.nombre.value == ""){
		window.alert("Favor de ingresa su nombre");
		document.myform.nombre.focus();
		return false;
	}
	if(document.myform.telefono.value == ""){
		window.alert("Ingrese su teléfono para comunicarnos con usted, Gracias");
		document.myform.telefono.focus();
		return false;
	}
	if(document.myform.email.value == ""){
		window.alert("Ingrese su e-mail para poder contactarlo, Gracias");
		document.myform.email.focus();
		return false;
	}
	if(document.myform.mensaje.value == ""){
		window.alert("Escriba su mensaje por favor");
		document.myform.mensaje.focus();
		return false;
	}
	else {
		document.myform.submit();
	}
}