﻿function showPlscLocation(ele, latitude, longitude, description, locationID, locationIndex, pushPin)
{
    if (document.getElementById('LocationID') != null)
        document.getElementById('LocationID').value = locationID;
    if (document.getElementById('LocationIndex') != null)
        document.getElementById('LocationIndex').value = locationIndex;
    if (document.getElementById('divSelected') != null)
        document.getElementById('divSelected').innerHTML = description;
        
    if (typeof(pushPin) == "undefined") 
    {
        pushPin = "/Common/Images/custom/PLSC/map_icon.png";
    }
    
    var icon = new GIcon();
    icon.image = pushPin;
    icon.iconSize = new GSize(36, 28);
    icon.iconAnchor = new GPoint(18, 14);
    icon.infoWindowAnchor = new GPoint(18, 14);

    var point = new GLatLng(latitude, longitude);
    var marker = new GMarker(point, icon);
    GEvent.addListener(marker, 'click',
        function() {
            marker.openInfoWindowHtml(description);
        }
    );
    map.addOverlay(marker);
    marker.openInfoWindowHtml(description);
    map.setCenter(new GLatLng(latitude, longitude), 13);
    
    if (ele.id != undefined) {
        $(".blue_box").each(function(item) { $(this).addClass("dark_bg"); });
        $(ele).removeClass("dark_bg");
    }
    else {
        $(".blue_box").eq(0).removeClass("dark_bg");
    }
}


function ShowMilitaryMessage() {
    alert("If you are a regular or reserve member with any branch of the U.S. Military or are a dependant of a regular or " +
    "reserve member of any branch of the U.S. Military please see an associate at one of our locations or contact " + 
    "1-888-4-PAYDAY prior to filling out this application.  Thank you.");
}


function ClearLocationCity() {
    $(".txtCity").val('');
}


function HideFlash() {
    $("#FlashBanner").css('visibility','hidden');
}
