
// Clear a form field.
function clearFormField(elt) {
	if ( elt.defaultValue == elt.value ) {
		elt.value = "";
	}
}

// Popup a new browser window (equivalent to target="_blank")
function popNew(url) {
	popup = window.open(url);
	popup.focus();
}

// Popup a reusable new browser window.
function popExt(url) {
	popup = window.open(url,"ext");
	popup.focus();
}

// Popup a temporary window with a specified width and height.
function popTmp(url,width,height) {
	paramstr = "toolbar=no,directories=no,scrollbars=yes,status=no,menubar=no";
	paramstr += ",width=" + width + ",height=" + height;
	popup = window.open(url,"temp",paramstr);
	popup.focus();
}

// Popup a window of approprite size for viewing a photo.
function popPhoto(url,width,height) {
	paramstr = "toolbar=no,directories=no,scrollbars=yes,status=no,menubar=no";
	if ( width == null ) { width = 640; }
	if ( height == null ) { height = 576; }
	paramstr += ",width=" + width + ",height=" + height;
	popup = window.open(url,"photo",paramstr);
	popup.focus();
}

// Popup a window of approprite size for viewing a photo.
function popVideo(url,width,height) {
	paramstr = "toolbar=no,directories=no,scrollbars=yes,status=no,menubar=no";
	if ( width == null ) { width = 400; }
	if ( height == null ) { height = 400; }
	paramstr += ",width=" + width + ",height=" + height;
	popup = window.open(url,"video",paramstr);
	popup.focus();
}

// Popup a window of approprite size for viewing a show date.
function popEvent(url,width,height) {
	paramstr = "toolbar=no,directories=no,scrollbars=yes,status=no,menubar=no";
	if ( width == null ) { width = 640; }
	if ( height == null ) { height = 540; }
	paramstr += ",width=" + width + ",height=" + height;
	popup = window.open(url,"event",paramstr);
	popup.focus();
}

// Popup a window for viewing info about tracks, albums, etc.
function popInfo(url) {
	paramstr = "toolbar=no,directories=no,scrollbars=yes,status=no,menubar=no";
	var width = 550;
	var height = 500;
	paramstr += ",width=" + width + ",height=" + height;
	popup = window.open(url,"info",paramstr);
	popup.focus();
}

// Popup a window suitable for mapquest.
function popMap(url) {
	paramstr = "scrollbars=yes,status=yes,toolbar=yes,menubar=yes";
	var width = 770;
	var height = 500;
	paramstr += ",width=" + width + ",height=" + height;
	popup = window.open(url,"map",paramstr);
	popup.focus();
}


// Popup a Flash Audio Player. Override the width and height functions
// in the custom javascript file to change the defaults.
function getFlashAudioPlayerWidth() { return 275; }
function getFlashAudioPlayerHeight() { return 350; }
function popFlashAudioPlayer(file) {
	paramstr = "toolbar=no,directories=no,scrollbars=no,status=no";
	paramstr += ",menubar=no,resizable=no";
	var width = getFlashAudioPlayerWidth();
	var height = getFlashAudioPlayerHeight();
	paramstr += ",width=" + width + ",height=" + height;
	url = "/sitebuilder/flash/audio_player?f=" + file;
	popup = window.open(url,"flashaudioplayer",paramstr);
	popup.focus();
}


// Popup a Flash Photo Scroller. Override the width and height functions
// in the custom javascript file to change the defaults.
function getFlashPhotoScrollerWidth() { return 700; }
function getFlashPhotoScrollerHeight() { return 550; }
function popFlashPhotoScroller(file) {
	var paramstr = "toolbar=no,directories=no,scrollbars=no,status=no";
	paramstr += ",menubar=no,resizable=no";
	var width = getFlashPhotoScrollerWidth();
	var height = getFlashPhotoScrollerHeight();
	paramstr += ",width=" + width + ",height=" + height;
	url = "/sitebuilder/flash/photo_scroller?f=" + file;
	popup = window.open(url,"flashphotoscroller",paramstr);
	popup.focus();
}


// Popup a window for PayPal track purchases.
function popTrackCart(url) {
	var paramstr = "toolbar=no,directories=no,scrollbars=yes,status=no";
	paramstr += ",menubar=no,resizable=yes";
	var width = 800;
	var height = 550;
	paramstr += ",width=" + width + ",height=" + height;
	popup = window.open(url,"paypal",paramstr);
	popup.focus();
}

