

function ToggleMenu(sender)
{
    if(sender.className=="on")
            {
                sender.className="off";
                $(sender.parentNode).getElementsBySelector('input[type=hidden][id$=IsCollapsed]').each(function(e){e.value='true'});
                $(sender.parentNode.parentNode).getElementsBySelector('div[class=gearRight]').invoke('hide');
            }
            else
            {
                sender.className="on";
                $(sender.parentNode).getElementsBySelector('input[type=hidden][id$=IsCollapsed]').each(function(e){e.value=''});
                $(sender.parentNode.parentNode).getElementsBySelector('div[class=gearRight]').invoke('show');
            }
}

function ClearStateCity(ddlstate2,ddcity2)
{
    document.getElementById(ddlstate2).selectedIndex=0;
    document.getElementById(ddcity2).selectedIndex=0;
}


    
function CFPValidateUpdate(tbzip2,ddlcity2,errordiv)
{
    var retval=true;
    var zip=document.getElementById(tbzip2).value;
    
    var city=$F(ddlcity2);  
    if(zip.length==0)
    {
        if(city == "Select a city" || city.length==0)
        {
            document.getElementById(errordiv).style.display="inline";
            retval=false;
        }            
    }
    else
    {
        var isvalidzip=zip.isZip5();
        if(!isvalidzip)
        {
            document.getElementById(errordiv).style.display="inline";
            retval=false;
        }
    }
        if(retval)
        {
            document.getElementById(errordiv).style.display="none"
        }
    return retval;
}
    

        
    