window.addEvent('domready', function() {
	switch(document.body.id) {
		case 'listings':
			break;
		case 'request':
			$('OtherCheck1').addEvent('click', updateOther);
			var afx = new Fx.Slide('RequestOtherId', {duration: 500});
			if ($('OtherCheck1').checked) { afx.show(); afx.wrapper.setStyle('height','auto'); } else { afx.hide(); }
			$('OtherCheck2').addEvent('click', updateOther2);
			var afx = new Fx.Slide('RequestOther2Id', {duration: 500});
			if ($('OtherCheck2').checked) { afx.show(); afx.wrapper.setStyle('height','auto'); } else { afx.hide(); }
			break;
		default:
//			$('AffiliatedOfficesID').addEvent('mouseover', updateAffiliatedOfficesSelect_Width);
//			$('AffiliatedOfficesID').addEvent('mousedown', updateAffiliatedOfficesSelect_Width);
//			$('AffiliatedOfficesID').addEvent('blur', updateAffiliatedOfficesSelect_Revert);
			break;
	}
});

function updateOther() {
	var afx = new Fx.Slide('RequestOtherId', {duration: 500});
	if ($('OtherCheck1').checked) { afx.show(); afx.wrapper.setStyle('height','auto'); } else { afx.hide(); }
}

function updateOther2() {
	var afx = new Fx.Slide('RequestOther2Id', {duration: 500});
	if ($('OtherCheck2').checked) { afx.show(); afx.wrapper.setStyle('height','auto'); } else { afx.hide(); }
}

function updateAffiliatedOfficesSelect_Width() {
	$('AffiliatedOfficesID').setStyle("width", "500px");
}

function updateAffiliatedOfficesSelect_Revert() {
	$('AffiliatedOfficesID').setStyle("width", "170px");
}

function print(url) {
	if (url.indexOf('?') > 0) {
		window.open(url+'&print=true','print');
	} else {
		window.open(url+'?print=true','print');
	}
	return false;
}

