﻿
function VerifyAddress(valctl, errctl)
{
    var errctl = document.getElementById(errctl);
    errctl.innerHTML = "&nbsp;"
    var val = valctl.value;
    if ("" == val ||
        "Enter Zip Code, or City, State" == val)
        return false;
    var reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);
    if(reZip.test(val) || val.indexOf(",") > 1 )
        return true;

    errctl.style.display = "block"
    errctl.innerHTML = "Please specify valid Zip Code or City, State."
    return false;
}
function SubmitAddress(addrid, errctl)
{
    var valctl = document.getElementById(addrid);
    var stat = VerifyAddress(valctl, errctl)
    
    if (stat)
        window.location.href = "/buynow.aspx?addr=" +valctl.value ;
}
function GoBuyOnline(ctlnm)
{
    var ctl = document.getElementById(ctlnm);
    if (ctl.value!='') 
         LeaveWyeth('',ctl.value, 350,320)
}
function PrintResultPage()
{
    LeaveWyeth('',"http://maps.google.com/maps?pw=2&q="+SearchString+" : "+NewAddress,350,320)
}