function pop(URL, w, h) {
	  window.open(URL,'refrence','width=' + w + ',height=' + h + ',resizable=yes,scrollbars=yes'); 
}
function addcode(text) {
	if (document.shoutbox.shout.value == document.shoutbox.shout.defaultValue) {
		document.shoutbox.shout.value = "";
	}
		document.shoutbox.shout.value += ' ' + text + ' ';
}
function verify(form) {
	empty = 0;
	if (document.shoutbox.name.value == document.shoutbox.name.defaultValue || document.shoutbox.name.value == "") {
		empty = 1;
	}
	if (document.shoutbox.site.value == document.shoutbox.site.defaultValue) {
		document.shoutbox.site.value = "";
	}
	if (document.shoutbox.shout.value == document.shoutbox.shout.defaultValue || document.shoutbox.shout.value == "") {
		empty = 1;
	}
	if (empty) {
		alert('You left one of the fields empty. Please go back and fill in the Name and Shout fields.');
		return false;
	} else {
		return true;
	}
}
function deleteconf(id) {
	if (confirm('Are you sure you want to delete this shout?')) {
		window.location.href= './paboxadmin/shouts.php?act=delete&id=' + id;
	}
}
function dobold() {
	input = prompt('Enter the text to make bold', '');
	if(input) {
		addcode('[b]' + input + '[/b]');
	}
}
function doitalic() {
	input = prompt('Enter the text to make italicized', '');
	if(input) {
		addcode('[i]' + input + '[/i]');
	}
}
function dounderlined() {
	input = prompt('Enter the text to make underlined', '');
	if(input) {
		addcode('[u]' + input + '[/u]');
	}
}
function dourl() {
	url = prompt('Enter the URL of the link', '');
	title = prompt('Enter the text for the link', '');
	if(url) {
		if(title) {
			addcode('[url=' + url + ']' + title + '[/url]');
		} else {
			addcode('[url]' + url + '[/url]');
		}
	}
}
function doemail() {
	url = prompt('Enter the e-mail address', '');
	title = prompt('Enter the text for the link', '');
	if(url) {
		if(title) {
			addcode('[email=' + url + ']' + title + '[/email]');
		} else {
			addcode('[email]' + url + '[/email]');
		}
	}
}
function clearText(thefield){
	if (thefield.defaultValue==thefield.value) {
		thefield.value = "";
	}
}
