<!-- Begin
var digits="0123456789"
var temp
var dtCh= "/";
var minYear=1900;
var maxYear=2100;

var dtCh= "/";
var minYear=1900;
var maxYear=2100;

function currencyFormat(fld, milSep, decSep, e) {
var sep = 0;
var key = '';
var i = j = 0;
var len = len2 = 0;
var strCheck = '0123456789';
var aux = aux2 = '';
var whichCode = (window.Event) ? e.which : e.keyCode;
if (whichCode == 13) return true;  // Enter
key = String.fromCharCode(whichCode);  // Get key value from key code
if (strCheck.indexOf(key) == -1) return false;  // Not a valid key
len = fld.value.length;
for(i = 0; i < len; i++)
if ((fld.value.charAt(i) != '0') && (fld.value.charAt(i) != decSep)) break;
aux = '';
for(; i < len; i++)
if (strCheck.indexOf(fld.value.charAt(i))!=-1) aux += fld.value.charAt(i);
aux += key;
len = aux.length;
if (len == 0) fld.value = '';
if (len == 1) fld.value = '0'+ decSep + '0' + aux;
if (len == 2) fld.value = '0'+ decSep + aux;
if (len > 2) {
aux2 = '';
for (j = 0, i = len - 3; i >= 0; i--) {
if (j == 3) {
aux2 += milSep;
j = 0;
}
aux2 += aux.charAt(i);
j++;
}
fld.value = '';
len2 = aux2.length;
for (i = len2 - 1; i >= 0; i--)
fld.value += aux2.charAt(i);
fld.value += decSep + aux.substr(len - 2, len);
}
return false;
}

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}
function validateZIP(field) {
var valid = "0123456789-";
var hyphencount = 0;
if (field.length!=5 && field.length!=10) {
alert("Please enter your 5 digit or 5 digit+4 zip code.");
return false;
}
for (var i=0; i < field.length; i++) {
temp = "" + field.substring(i, i+1);
if (temp == "-") hyphencount++;
if (valid.indexOf(temp) == "-1") {
alert("Invalid characters in your zip code.  Please try again.");
return false;
}
if ((hyphencount > 1) || ((field.length==10) && ""+field.charAt(5)!="-")) {
alert("The hyphen character should be used with a properly formatted 5 digit+four zip code, like '12345-6789'.   Please try again.");
return false;
   }
}
return true;
}

function isValid(f)
{
//	alert("isvalid original");
	var CT_Msg = "Incomplete Information. Please enter the "
	var CT_Msg2 = "Incomplete Information. Please select a "
	var v = ""

	v = f.user_name.value
	if (v == "")
	{
		alert(CT_Msg + "Name.")

		f.user_name.focus();
		return false
	}
	v = f.user_email.value
	if (v=="")
    {
		alert(CT_Msg + "e-mail.")
		f.user_email.focus();
		return false    
	}
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(v))
	{
		v = f.user_address1.value
		if (v=="")
		{
			alert(CT_Msg + "Address.")
			f.user_address1.focus();
			return false    
		}
		v = f.user_phone.value
		if (v=="")
		{
			alert(CT_Msg + "Daytime Phone.")
			f.user_phone.focus();
			return false    
		}
		if (checkInternationalPhone(v)==false)
		{
			alert("Invalid Daytime Number. Please try again")
			f.user_phone.value=""
			f.user_phone.focus()
			return false
		}
		return true		
	}
	
	alert("Invalid e-mail format.")
	f.user_email.focus();
	return false	
	
}
function isValidLoc(f)
{
	var CT_Msg = "Incomplete Information. Please enter the "
	var CT_Msg2 = "Incomplete Information. Please select a "
	var v = ""

	v = f.name.value
	if (v == "")
	{
		alert(CT_Msg + "Name.")

		f.name.focus();
		return false
	}
	v = f.address1.value
	if (v=="")
    {
		alert(CT_Msg + "Address.")
		f.address1.focus();
		return false    
	}
	v = f.city.value
	if (v=="")
    {
		alert(CT_Msg + "City.")
		f.city.focus();
		return false    
	}
	v = f.state.value
	if (v=="")
    {
		alert(CT_Msg + "State.")
		f.state.focus();
		return false    
	}
	v = f.zip_code.value
	if (v=="")
	{
		alert(CT_Msg + "Zip Code.")
		f.zip_code.focus();
		return false    
	}
	if (validateZIP(v)==false)
	{
		f.zip_code.focus();
		return false    
	}
	
	v = f.fax.value
	if (v!="")
    {
		if (checkInternationalPhone(v)==false)
		{
			alert("Invalid fax Number.")
			f.fax.value=""
			f.fax.focus()
			return false
		} 
	}
	v = f.email.value
	if (v!="")
    {
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(v))
		{
			return true		
		}
			alert("Invalid e-mail format.")
		f.email.focus();
		return false	
	}		
}

function isValidOffer(f)
{
	var CT_Msg = "Incomplete Information. Please enter the "
	var CT_Msg2 = "Incomplete Information. Please select a "
	var v = ""

	v = f.offer_type.value
	if (v == "")
	{
		alert(CT_Msg2 + "Offer Type.")

		f.offer_type.focus();
		return false
	}
	v = f.cat_id.value
	if (v=="")
    {
		alert(CT_Msg2 + "Offer Category.")
		f.cat_id.focus();
		return false    
	}
	v = f.offer_name.value
	if (v=="")
    {
		alert(CT_Msg + "Offer Name.")
		f.offer_name.focus();
		return false    
	}
	v = f.offer_date_from.value
	if (v=="")
    {
		alert(CT_Msg + "Offer Start Date.")
		f.offer_date_from.focus();
		return false    
	}
	v = f.offer_date_to.value
	v = f.offer_status.value
	if (v=="")
    {
		alert(CT_Msg + "Offer Status.")
		f.offer_status.focus();
		return false    
	}	
	return true			
}
function isValidSection(f)
{
	var CT_Msg = "Incomplete Information. Please enter the "
	var CT_Msg2 = "Incomplete Information. Please select a "
	var v = ""
	v = f.section_name[0].value
	if (v == "")
	{
		alert(CT_Msg2 + "Section Name.")

		f.section_name[0].focus();
		return false
	}
	v = f.section_name[1].value
	if (v == "")
	{
		alert(CT_Msg2 + "Section Name.")

		f.section_name[1].focus();
		return false
	}
	v = f.section_name[2].value
	if (v == "")
	{
		alert(CT_Msg2 + "Section Name.")

		f.section_name[2].focus();
		return false
	}
	
	return true			
}
function isValidCat(f)
{
	var CT_Msg = "Incomplete Information. Please enter the "
	var CT_Msg2 = "Incomplete Information. Please select a "
	var v = ""

	v = f.cat_type.value
	if (v == "")
	{
		alert(CT_Msg2 + "Category Type.")

		f.cat_type.focus();
		return false
	}
	v = f.cat_name.value
	if (v=="")
    {
		alert(CT_Msg + "Category Name.")
		f.cat_name.focus();
		return false    
	}	
}
function isValidUser(f)
{
	var CT_Msg = "Incomplete Information. Please enter the "
	var CT_Msg2 = "Incomplete Information. Please select a "
	var v = ""

	v = f.user_id.value
	if (v == "")
	{
		alert(CT_Msg2 + "User ID.")

		f.user_id.focus();
		return false
	}
	if (v.length < 6)
    {
		alert("The User ID must have at least 6 characters.")
		f.user_id.focus();
		return false    
	}
	v = f.password.value
	if (v=="")
    {
		alert(CT_Msg + "Password.")
		f.password.focus();
		return false    
	}
	if (v.length < 6)
    {
		alert("The Password must have at least 6 characters.")
		f.password.focus();
		return false    
	}
	w = f.password2.value
	if (w!=v)
    {
		alert("Password and its confirmation must be the same.")
		f.password2.focus();
		return false    
	}	
	v = f.email.value
	if (v=="")
    {
		alert(CT_Msg + "email.")
		f.email.focus();
		return false    
	}
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(v))
	{
		v = f.user_name.value
		if (v=="")
		{
			alert(CT_Msg + "User Name.")
			f.user_name.focus();
			return false    
		}
		return true
	}
	alert("Invalid e-mail format.")
	f.email.focus();
	return false
}
function isValidUser1(f)
{
	var CT_Msg = "Incomplete Information. Please enter the "
	var CT_Msg2 = "Incomplete Information. Please select a "
	var v = ""

	v = f.prev_password.value
	if (v == "")
	{
		alert(CT_Msg2 + "Previous Password.")

		f.prev_password.focus();
		return false
	}
	v = f.password.value
	if (v!="")
    {
		if (v.length < 6)
		{
			alert("The New Password must have at least 6 characters.")
			f.password.focus();
			return false    
		}
		w = f.password2.value
		if (w!=v)
		{
			alert("New Password and its confirmation must be the same.")
			f.password2.focus();
			return false    
		}	
	}
	v = f.email.value
	if (v=="")
    {
		alert(CT_Msg + "email.")
		f.email.focus();
		return false    
	}
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(v))
	{
		v = f.user_name.value
		if (v=="")
		{
			alert(CT_Msg + "User Name.")
			f.user_name.focus();
			return false    
		}
		return true
	}
	alert("Invalid e-mail format.")
	f.email.focus();
	return false
}
function isValidLogin(f)
{
	var CT_Msg = "Incomplete Information. Please enter the "
	var CT_Msg2 = "Incomplete Information. Please select a "
	var v = ""

	v = f.user_id.value
	if (v == "")
	{
		alert(CT_Msg2 + "User ID.")
		f.user_id.focus();
		return false
	}
	if (v.length < 6)
    {
		alert("The User ID must have at least 6 characters.")
		f.user_id.focus();
		return false    
	}
	v = f.password.value
	if (v=="")
    {
		alert(CT_Msg + "Password.")
		f.password.focus();
		return false    
	}
	if (v.length < 6)
    {
		alert("The Password must have at least 6 characters.")
		f.password.focus();
		return false    
	}
}
function isValidPrice(f)
{
	var CT_Msg = "Incomplete Information. Please enter the "
	var CT_Msg2 = "Incomplete Information. Please select a "
	var v = ""
	v = f.departure_date.value
	if (isDate(v)==false){
		f.departure_date.focus();
		return false
	}
	v = f.arrival_date.value
	if (v != "")
	{
		if (isDate(v)==false){
			f.arrival_date.focus();
			return false
		}
	}
	return true			
}
var Cards = new makeArray(8);
Cards[0] = new CardType("Master Card", "51,52,53,54,55", "16");
var MasterCard = Cards[0];
Cards[1] = new CardType("Visa Card", "4", "13,16");
var VisaCard = Cards[1];
Cards[2] = new CardType("AmEx Card", "34,37", "15");
var AmExCard = Cards[2];
Cards[3] = new CardType("DinersClub Card", "30,36,38", "14");
var DinersClubCard = Cards[3];
Cards[4] = new CardType("Discover Card", "6011", "16");
var DiscoverCard = Cards[4];
Cards[5] = new CardType("enRoute Card", "2014,2149", "15");
var enRouteCard = Cards[5];
Cards[6] = new CardType("JCB Card", "3088,3096,3112,3158,3337,3528", "16");
var JCBCard = Cards[6];
var LuhnCheckSum = Cards[7] = new CardType();

/*************************************************************************\
CheckCardNumber(form)
function called when users click the "check" button.
\*************************************************************************/
function CheckCardNumber(form) {
var tmpyear;
if (form.CardNumber.value.length == 0) {
alert("Please enter a Card Number.");
form.CardNumber.focus();
return false;
}

if (form.CardType.value.length == 0) {
alert("Please select a Card Type.");
form.CardType.focus();
return false;
}

if (form.ExpYear.value.length == 0) {
alert("Please enter the Expiration Year.");
form.ExpYear.focus();
return false;
}
tmpyear = form.ExpYear.value;
tmpmonth = form.ExpMon.options[form.ExpMon.selectedIndex].value;
// The following line doesn't work in IE3, you need to change it
// to something like "(new CardType())...".
// if (!CardType().isExpiryDate(tmpyear, tmpmonth)) {
if (!(new CardType()).isExpiryDate(tmpyear, tmpmonth)) {
alert("This card has already expired.");
return false;
}
card = form.CardType.options[form.CardType.selectedIndex].value;
var retval = eval(card + ".checkCardNumber(\"" + form.CardNumber.value +
"\", " + tmpyear + ", " + tmpmonth + ");");
cardname = "";
if (retval)

// comment this out if used on an order form
return true;

else {
// The cardnumber has the valid luhn checksum, but we want to know which
// cardtype it belongs to.
for (var n = 0; n < Cards.size; n++) {
if (Cards[n].checkCardNumber(form.CardNumber.value, tmpyear, tmpmonth)) {
cardname = Cards[n].getCardType();
break;
   }
}
if (cardname.length > 0) {
alert("This looks like a " + cardname + " number, not a " + card + " number.");
form.CardNumber.focus();
return  false;
}
else {
alert("This card number is not valid.");
form.CardNumber.focus();
return  false;
      }
   }
}
/*************************************************************************\
Object CardType([String cardtype, String rules, String len, int year, 
                                        int month])
cardtype    : type of card, eg: MasterCard, Visa, etc.
rules       : rules of the cardnumber, eg: "4", "6011", "34,37".
len         : valid length of cardnumber, eg: "16,19", "13,16".
year        : year of expiry date.
month       : month of expiry date.
eg:
var VisaCard = new CardType("Visa", "4", "16");
var AmExCard = new CardType("AmEx", "34,37", "15");
\*************************************************************************/
function CardType() {
var n;
var argv = CardType.arguments;
var argc = CardType.arguments.length;

this.objname = "object CardType";

var tmpcardtype = (argc > 0) ? argv[0] : "CardObject";
var tmprules = (argc > 1) ? argv[1] : "0,1,2,3,4,5,6,7,8,9";
var tmplen = (argc > 2) ? argv[2] : "13,14,15,16,19";

this.setCardNumber = setCardNumber;  // set CardNumber method.
this.setCardType = setCardType;  // setCardType method.
this.setLen = setLen;  // setLen method.
this.setRules = setRules;  // setRules method.
this.setExpiryDate = setExpiryDate;  // setExpiryDate method.

this.setCardType(tmpcardtype);
this.setLen(tmplen);
this.setRules(tmprules);
if (argc > 4)
this.setExpiryDate(argv[3], argv[4]);

this.checkCardNumber = checkCardNumber;  // checkCardNumber method.
this.getExpiryDate = getExpiryDate;  // getExpiryDate method.
this.getCardType = getCardType;  // getCardType method.
this.isCardNumber = isCardNumber;  // isCardNumber method.
this.isExpiryDate = isExpiryDate;  // isExpiryDate method.
this.luhnCheck = luhnCheck;// luhnCheck method.
return this;
}

/*************************************************************************\
boolean checkCardNumber([String cardnumber, int year, int month])
return true if cardnumber pass the luhncheck and the expiry date is
valid, else return false.
\*************************************************************************/
function checkCardNumber() {
var argv = checkCardNumber.arguments;
var argc = checkCardNumber.arguments.length;
var cardnumber = (argc > 0) ? argv[0] : this.cardnumber;
var year = (argc > 1) ? argv[1] : this.year;
var month = (argc > 2) ? argv[2] : this.month;

this.setCardNumber(cardnumber);
this.setExpiryDate(year, month);

if (!this.isCardNumber())
return false;
if (!this.isExpiryDate())
return false;

return true;
}
/*************************************************************************\
String getCardType()
return the cardtype.
\*************************************************************************/
function getCardType() {
return this.cardtype;
}
/*************************************************************************\
String getExpiryDate()
return the expiry date.
\*************************************************************************/
function getExpiryDate() {
return this.month + "/" + this.year;
}
/*************************************************************************\
boolean isCardNumber([String cardnumber])
return true if cardnumber pass the luhncheck and the rules, else return
false.
\*************************************************************************/
function isCardNumber() {
var argv = isCardNumber.arguments;
var argc = isCardNumber.arguments.length;
var cardnumber = (argc > 0) ? argv[0] : this.cardnumber;
if (!this.luhnCheck())
return false;

for (var n = 0; n < this.len.size; n++)
if (cardnumber.toString().length == this.len[n]) {
for (var m = 0; m < this.rules.size; m++) {
var headdigit = cardnumber.substring(0, this.rules[m].toString().length);
if (headdigit == this.rules[m])
return true;
}
return false;
}
return false;
}

/*************************************************************************\
boolean isExpiryDate([int year, int month])
return true if the date is a valid expiry date,
else return false.
\*************************************************************************/
function isExpiryDate() {
var argv = isExpiryDate.arguments;
var argc = isExpiryDate.arguments.length;

year = argc > 0 ? argv[0] : this.year;
month = argc > 1 ? argv[1] : this.month;

if (!isNum(year+""))
return false;
if (!isNum(month+""))
return false;
today = new Date();
expiry = new Date(year, month);
if (today.getTime() > expiry.getTime())
return false;
else
return true;
}

/*************************************************************************\
boolean isNum(String argvalue)
return true if argvalue contains only numeric characters,
else return false.
\*************************************************************************/
function isNum(argvalue) {
argvalue = argvalue.toString();

if (argvalue.length == 0)
return false;

for (var n = 0; n < argvalue.length; n++)
if (argvalue.substring(n, n+1) < "0" || argvalue.substring(n, n+1) > "9")
return false;

return true;
}

/*************************************************************************\
boolean luhnCheck([String CardNumber])
return true if CardNumber pass the luhn check else return false.
Reference: http://www.ling.nwu.edu/~sburke/pub/luhn_lib.pl
\*************************************************************************/
function luhnCheck() {
var argv = luhnCheck.arguments;
var argc = luhnCheck.arguments.length;

var CardNumber = argc > 0 ? argv[0] : this.cardnumber;

if (! isNum(CardNumber)) {
return false;
  }

var no_digit = CardNumber.length;
var oddoeven = no_digit & 1;
var sum = 0;

for (var count = 0; count < no_digit; count++) {
var digit = parseInt(CardNumber.charAt(count));
if (!((count & 1) ^ oddoeven)) {
digit *= 2;
if (digit > 9)
digit -= 9;
}
sum += digit;
}
if (sum % 10 == 0)
return true;
else
return false;
}

/*************************************************************************\
ArrayObject makeArray(int size)
return the array object in the size specified.
\*************************************************************************/
function makeArray(size) {
this.size = size;
return this;
}

/*************************************************************************\
CardType setCardNumber(cardnumber)
return the CardType object.
\*************************************************************************/
function setCardNumber(cardnumber) {
this.cardnumber = cardnumber;
return this;
}

/*************************************************************************\
CardType setCardType(cardtype)
return the CardType object.
\*************************************************************************/
function setCardType(cardtype) {
this.cardtype = cardtype;
return this;
}

/*************************************************************************\
CardType setExpiryDate(year, month)
return the CardType object.
\*************************************************************************/
function setExpiryDate(year, month) {
this.year = year;
this.month = month;
return this;
}

/*************************************************************************\
CardType setLen(len)
return the CardType object.
\*************************************************************************/
function setLen(len) {
// Create the len array.
if (len.length == 0 || len == null)
len = "13,14,15,16,19";

var tmplen = len;
n = 1;
while (tmplen.indexOf(",") != -1) {
tmplen = tmplen.substring(tmplen.indexOf(",") + 1, tmplen.length);
n++;
}
this.len = new makeArray(n);
n = 0;
while (len.indexOf(",") != -1) {
var tmpstr = len.substring(0, len.indexOf(","));
this.len[n] = tmpstr;
len = len.substring(len.indexOf(",") + 1, len.length);
n++;
}
this.len[n] = len;
return this;
}
/**
 * DHTML phone number validation script. 
 */
 // Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;
function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}
/*************************************************************************\
CardType setRules()
return the CardType object.
\*************************************************************************/
function setRules(rules) {
// Create the rules array.
if (rules.length == 0 || rules == null)
rules = "0,1,2,3,4,5,6,7,8,9";
  
var tmprules = rules;
n = 1;
while (tmprules.indexOf(",") != -1) {
tmprules = tmprules.substring(tmprules.indexOf(",") + 1, tmprules.length);
n++;
}
this.rules = new makeArray(n);
n = 0;
while (rules.indexOf(",") != -1) {
var tmpstr = rules.substring(0, rules.indexOf(","));
this.rules[n] = tmpstr;
rules = rules.substring(rules.indexOf(",") + 1, rules.length);
n++;
}
this.rules[n] = rules;
return this;
}

function isValid_a(f)
{
	
	//alert ("AHJAHAHHAHA");
	
	var CT_Msg = "Incomplete Information. Please enter the "
	var CT_Msg2 = "Incomplete Information. Please select a "
	var v = ""

	v = f.user_name.value
	if (v == "")
	{
		alert(CT_Msg + "Name.")

		f.user_name.focus();
		return false
	}
	
	v = f.user_dep_date.value
	if (v == "")
	{
		alert(CT_Msg + "Departure Date.")
		f.user_dep_date.focus();
		return false
	}

	v = f.user_arr_date.value
	if (v == "")
	{
		alert(CT_Msg + "Arrival Date.")
		f.user_arr_date.focus();
		return false
	}
	
	
	v = f.fromairport.value
	if (v == "")
	{
		alert(CT_Msg + "Departure Airport.")
		f.fromairport.focus();
		return false
	}
	

	v = f.toairport.value
	if (v == "")
	{
		alert(CT_Msg + "Destination Airport.")
		f.toairport.focus();
		return false
	}
	

	v = f.user_email.value
	if (v=="")
    {
		alert(CT_Msg + "e-mail.")
		f.user_email.focus();
		return false    
	}
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(v))
	{
		v = f.user_address1.value
		if (v=="")
		{
			alert(CT_Msg + "Address.")
			f.user_address1.focus();
			return false    
		}
		v = f.user_phone.value
		if (v=="")
		{
			alert(CT_Msg + "Daytime Phone.")
			f.user_phone.focus();
			return false    
		}
		if (checkInternationalPhone(v)==false)
		{
			alert("Invalid Daytime Number. Please try again")
			f.user_phone.value=""
			f.user_phone.focus()
			return false
		}
		return true		
	}
	
	alert("Invalid e-mail format.")
	f.user_email.focus();
	return false	
	
}

//  End -->