// Make sure file is not hosted in a different frameset
if(top.location.href != window.location.href){
	top.location.href = window.location.href
}

var http = httpGetObject();

function openWindow(url, w, h) {
	var windowprops = "width=" + w + ",height=" + h +",,left=10,top=10,scrollbars=no,status=yes,toolbar=no,location=no,directories=no,resizable=yes";
	popup = window.open(url,'newWin',windowprops);
	popup.focus();
}

function switchClass(obj,strClassName){
	obj.className = strClassName;
}

function gotoURL(strUrl){
	location = strUrl;
}

function copyrightYear(startYear){
	d = new Date();
	if(startYear != d.getFullYear()){
		return startYear + " - " + d.getFullYear();
	} else {
		return startYear;
	}
}
	
function validState(str){
	re = /^[a-zA-Z]{2}$/;
	if(str == ''){
		return false;
	} else if(re.test(str)){
		return true;
	} else {
		return false;
	}
}

function validZIP(val){
	re = new RegExp(/^\d{5,5}$/);
	if(val.match(re)){
		return true;
	} else {
		return false;
	}
}

function existingZIP(val){
	if(http){
		xmlUrl = '/existingzip.php?zipcode=' + val;
		http.open('GET', xmlUrl, false);
		http.send(null);
		return !!parseInt(http.responseText);
	} else {
		alert('httpGetObject does not exist');
		return false;
	}
}