﻿// JScript File

function showResult(result,context)
{
    var myArray = result.split("|");

    if (myArray[0] == "false")
        {
            alert("Please Enter Correct Zipcode");
             document.aspnetForm.ctl00_contentLeftColumn_txtZip.value = ""
        }
      else
        {
            document.aspnetForm.ctl00_contentLeftColumn_txtCity.value = myArray[0];
            var selected = myArray[1];
            document.aspnetForm.ctl00$contentLeftColumn$drpState.options.value = trim(selected);
        }
}

function showerror(error,context)
{
alert(error);
}

function showEmailResult(result,context)
{
     if (result == "false")
        {
            alert("Please Enter Correct Email");
            document.aspnetForm.ctl00_contentLeftColumn_txtEmailReg.value = "";
        }
}

function showEmailError(error,context)
{
alert(error);
}

function showResultNothing(result,context)

{

var myArray = result.split("|");

    if (myArray[0] == "false")
        {
            alert("Please Enter Correct Zipcode");
             document.aspnetForm.ctl00_contentLeftColumn_txtZip.value = ""
        }
   
}


function trim(value) 

{
   var temp = value;
   var obj = /^(\s*)([\W\w]*)(\b\s*$)/;
   if (obj.test(temp)) { temp = temp.replace(obj, '$2'); }
   var obj = /  /g;
   while (temp.match(obj)) { temp = temp.replace(obj, " "); }
   return temp;
}


