function submitForm(state) {
	for (var i = 0; i < document.selectform.addressline.length; i++) {
		if (document.selectform.addressline[i].text == state) {
			document.selectform.addressline.selectedIndex = i;
		}
	}

	document.selectform.submit.click();
}

function checkForAll() {
	if (document.selectform.addressline.value == 'ALL') {
		parent.location.href = 'http://www.buckle.com/stores/all.jsp';
	} 
     
}

function checkForEmpty() {
    if (document.selectform.addressline.value == '') {
	    document.location.href = 'http://direct.where2getit.com/cwc/apps/w2gi.php?template=error&client=buckle';
        return false;
	}
    else { return true };
}


function viewAll() {
	parent.location.href = 'http://www.buckle.com/stores/all.jsp';
}

function showState(state) {
	if (document.getElementById('jsstate')) {
		document.getElementById('jsstate').innerHTML = state;
	} else {
		document.getElementById('jsestate').innerHTML = state;
	}
}


function hideDiv() {
	if (document.getElementById('jsstate')) {
		document.getElementById('jsstate').innerHTML = '';
	} else {
		document.getElementById('jsestate').innerHTML = '';
	}
}

