// JavaScript Document
var searchString = document.location.search;
var iFrameUrl ='' ;
var street = '' ;
var city = '' ;
var state = '' ;
var zipcode = '' ;
var addressline= '' ;

// strip off the leading '?'
searchString = searchString.substring(1);

var nvPairs = searchString.split("&");

for (i = 0; i < nvPairs.length; i++)
{
     var nvPair = nvPairs[i].split("=");
     var name = nvPair[0];
     var value = nvPair[1];
	 
	 if (nvPair[0] == "street")
	 {
		street = nvPair[1] ;	 
	 }
	 if (nvPair[0] == "city")
	 {
		city = nvPair[1] ;	 
	 }
	 if (nvPair[0] == "state")
	 {
		state = nvPair[1] ;	 
	 }
	 if (nvPair[0] == "zipcode")
	 {
		if (nvPair[1] != "Zip+Code...")
		{
			zipcode = nvPair[1] ;	 
		}
		else
		{
			zipcode = '' ;
		}
	 }
}
if (street.length > 0)
 {
    addressline = street ;
 }	 
 if (city.length > 0)
 {
    if (addressline.length > 0)
    {
        addressline = addressline + "," + city ;
    }
    else
    {
        addressline = city ;
    }
 }
 if (state.length > 0)
 {
    if (addressline.length > 0)
    {
        addressline = addressline + "," + state ;
    }
    else
    {
        addressline = state ;
    }
 }
 if (zipcode.length > 0)
 {
    if (addressline.length > 0)
    {
        addressline = addressline + "," + zipcode ;
    }
    else
    {
        addressline = zipcode ;
    }
 }

 if (addressline.length > 0)
 {
	 iFrameUrl = 'zipcode=' + addressline.replace(' ','+') + iFrameUrl ;
 }
 else
 {
	 iFrameUrl = '';
 }

if (iFrameUrl.length > 0)
{
	document.write('<iframe id="atmlocator" src="http://wsecu.locatorsearch.com/postsearch.aspx?' + iFrameUrl + '" height="1600" width="550" name="atmlocator" frameborder="0" allowtransparency="true" scrolling="auto">Your browser doesn\'t support iframes</iframe>');
}
else
{
	document.write('<iframe id="atmlocator" src="http://wsecu.locatorsearch.com/index.aspx" height="1600" width="550" name="atmlocator" frameborder="0" allowtransparency="true" scrolling="auto">Your browser doesn\'t support iframes</iframe>');
}



