
function open_lightbox (url, width, height) {
	var lbox = $('lightbox');
	var dbox = $('darkbox');

	lbox.style.display = 'block';
	dbox.style.display = 'block';

	if (width == null) {
		width = 400;
	}
	if (height == null) {
		height = 300;
	}
	$('lightbox_html').style.width = width + 'px';
	$('lightbox_html').style.minHeight = height + 'px';
	$('lightbox_html').style.left = ((800 - width)/2) + 'px';

	new Ajax.Updater('lightbox_html', url, { evalScripts: true });
}

function shut_lightbox () {
	var lbox = $('lightbox');
	var dbox = $('darkbox');

	lbox.style.display = 'none';
	dbox.style.display = 'none';
}

function submit_campaign() {

	var frm = document.campaignFundForm;
	if (frm == null) {
		alert('Error - unable to process request.');
		return false;
	}

	var arAmt = frm.amount;
	if (arAmt == null || arAmt.length < 2) {
		alert('Error - unable to process request.');
		return false;
	}

	var amt = 0;
	for (var loop = 0; loop < arAmt.length; loop++) {
		if (arAmt[loop].checked) {
			amt = arAmt[loop].value;
		}
	}
	if (amt == 0) {
		amt = frm.amt_other.value;
	}
	if (amt < 0) {
		alert('Please enter a proper amount.');
		return false;
	}

	var dsc = '2008 Campaign';
	if (amt >= 20 && document.getElementById('obama_sign_Y').checked) {
		dsc += ' + Obama Sign';
	}

	var arSign = frm.sign;
	if (arSign == null) {
		alert('Error - unable to process request.');
		return false;
	}

	for (loop = 0; loop < arSign.length; loop++) {
		if (arSign[loop].checked) {
			dsc += ' + ' + arSign[loop].value;
		}
	}

	frm.item_name.value = dsc;

	window.setTimeout('shut_lightbox();', 1000);

	return true;
}