﻿// JavaScript file for the shop which helps handling the AreaCode drop down selection

function checkCode(selCode)
{
    var rc = true;
    if(selCode == "choose")
    {
      alert("Please select a valid area code");
      rc = false;
    }
    else if(selCode == "county")
    {
      alert("Please select an area code within the county.");
      rc = false;
    }
    else if(selCode.match(/Unavailable$/) == 'Unavailable')
    {
      alert("Sorry, the area code you have selected is currently unavailable. Please select an alternate area code.");
      rc = false;
    }
    return rc
}

function getElement(obj)
{
    var tmp = null;
    if (document.getElementById)
    {
      tmp = document.getElementById(obj);
    }
    else
    {
      tmp = document.all[obj];
    }
    return tmp;
}

