// search box functions
function search_clear() {
	if(document.getElementById('searchbox').value == "SEARCH BY ARTIST, EVENT") {
		document.getElementById('searchbox').value = "";
	}
}
function search_reset() {
	if(document.getElementById('searchbox').value == "") {
		document.getElementById('searchbox').value = "SEARCH BY ARTIST, EVENT";
	}
}

// launches links in new windows - workaround for strict mode that doesn't support the target attribute
function externalLinks() { 
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("a"); 
	for (var i=0; i<anchors.length; i++) { 
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank"; 
	}
}

// placeholder for all page initializations
function pgInit() {
	externalLinks();
}

var phone_field_length=0;
function TabNext(obj,event,len,next_field) {
	if (event == "down") {
		phone_field_length=obj.value.length;
	} else if (event == "up") {
		if (obj.value.length != phone_field_length) {
			phone_field_length=obj.value.length;
			if (phone_field_length == len) {
				next_field.focus();
			}
		}
	}
}
