﻿// JScript File
// Form validation script for stores
/*
Developed By	: Sharandip kaur
Date			: 27 Feb, 2008
Message			: Create an array of form elements and apply validation rules on them.
*/

var rules=new Array();
rules[0]='ctl00_ContentPlaceHolder1_txtName:Name|required';
rules[1]='ctl00_ContentPlaceHolder1_txtDLN:DLN|required';
rules[2]='ctl00_ContentPlaceHolder1_txtEmail:Email|required';
rules[3]='ctl00_ContentPlaceHolder1_txtEmail:Emial|email';


function getDirection()
{
	var sourceZipCode;
	sourceZipCode = document.getElementById("textfield").value;
	if (sourceZipCode.length != 5 || isNaN(sourceZipCode))
	{
		alert("invalid zip code");	
		return false;
	}
	else 
	{
		wnd = window.open('http://maps.google.com/maps?daddr=1431 Greenway Dr, Suite 230, Irving, TX 75038&saddr=' + sourceZipCode);
	  //wnd = window.open('http://maps.google.com/maps?daddr=1431 Greenway Dr, Suite 230, Irving, TX 75038&saddr=75070');
		wnd.focus();
		return false;
	}
}

			


