function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function changeSearchTarget() {
	if (document.search_form.choose_search.value == "waller") {
		document.search_form.action = "/search";
	}
	if (document.search_form.choose_search.value == "alumni") {
		document.search_form.action = "/alumni/search";
	}
}

/* alumni search */
function searchAlumniByLocation(location) {
	var office = document.locationselect.location.options[document.locationselect.location.selectedIndex].value;
	var url = '/alumni/directory?custom_field_1=' + office;
	window.location = url;
}

function searchAlumniByTitle(location) {
	var service = document.titleselect.title.options[document.titleselect.title.selectedIndex].value;
	var url = '/alumni/directory?custom_field_2=' + service;
	window.location = url;
}



sfHover = function() {
	var sfEls = document.getElementById("navbar").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+="_hover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp("_hover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function checkForArticles() {

	//alert ("got here!");
	var x = document.getElementsByTagName('div');
	for (var i=0;i<x.length;i++) {
		if (x[i].className == 'attorney_articles') {
			if (x[i].innerHTML.match("sitemason_article")) {
				// un-hide sidebar_news if the attorney has articles
				var y = document.getElementsByTagName('div');
				for (var j=0;j<y.length;j++) {
					if (y[j].className == 'sidebar_news') {
						y[j].style.display = 'block';
					}
				}
			}
		}
	}
}


function checkForAttorneyArticles() {
	//alert ("got here!");
	var x = document.sidebar_news.style.display = 'block';
}


function checkForSeminars() {
	//alert ("got here!");
	var x = document.getElementsByTagName('div');
	for (var i=0;i<x.length;i++) {
		if (x[i].className == 'seminars') {
			if (x[i].innerHTML.match("sitemason_article")) {
				// un-hide articles header if the attorney has articles
				x[i].style.display = 'block';
			}
		}
	}
}


function emailAttorney(email_address) {
	var test = confirm ("CAUTION - Before you proceed, please note: By clicking \"accept\" you agree that our review of the information contained in e-mail and any attachments will not create an attorney-client relationship and will not preclude any lawyer in our firm from representing a party in any matter where that information is relevant, even if you submitted the information in a good faith effort to retain us, and, further, even if that information is highly confidential and could be used against you, unless that lawyer has actual knowledge of the content of the e-mail. We will otherwise maintain the confidentiality of your information.");
	if (test) {
		var link = 'mailto:' + email_address;
		window.location = link;
	} else {
		return false;
	}
}

function selectAllianceLaw2(menuObj) {
	var i = menuObj.selectedIndex;
	var value = menuObj.options[i].value;
	var label = menuObj.options[i].innerHTML;
	var title = 'Waller Alliance: Law Firms in '+ label;
	window.location = 'http://www.wallerlaw.com/waller_alliance/firms?page_title='+ title +'&xatags=Law&xatags=' + value;
}

function selectAllianceCPA2(menuObj) {
	var i = menuObj.selectedIndex;
	var value = menuObj.options[i].value;
	var label = menuObj.options[i].innerHTML;
	var title = 'Waller Alliance: CPA Firms in '+ label;
	window.location = 'http://www.wallerlaw.com/waller_alliance/firms?page_title='+ title +'&xatags=CPA&xatags=' + value;
}

function selectAllianceLawSpecialty(menuObj) {
	var i = menuObj.selectedIndex;
	var value = menuObj.options[i].value;
	var label = menuObj.options[i].innerHTML;
	var title = 'Waller Alliance: Law firms specializing in '+ label;
	window.location = 'http://www.wallerlaw.com/waller_alliance/firms?page_title='+ title +'&xatags=LAW&xatags=' + value;
}


/* DELETE: */
function selectAllianceLaw(menuObj) {
	var i = menuObj.selectedIndex;
	var value = menuObj.options[i].value;
	window.location = 'http://www.wallerlaw.com/waller_alliance/alliance_law?custom_field_1=' + value;
}

function selectAllianceCPA(menuObj) {
	var i = menuObj.selectedIndex;
	var value = menuObj.options[i].value;
	window.location = 'http://www.wallerlaw.com/waller_alliance/alliance_cpa?custom_field_1=' + value;
}