﻿function pop_file(f, w, h, scroll) {
	var temp_url = f;
	if (scroll)
		var new_win = window.open(temp_url, 'pop' + h + w, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + w + ',height=' + h + ',alwaysRaised=yes');
	else
		var new_win = window.open(temp_url, 'pop' + h + w, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=' + w + ',height=' + h + ',alwaysRaised=yes');
	new_win.focus();
}

function check_fap_form() {
	form = document.fap_form;
		form.act.value = 'search';
	if (form.physician_list[form.physician_list.selectedIndex].value == '-1' || form.physician_list[form.physician_list.selectedIndex].value == 'alpha') {
		form.SearchType.value = '';
	} else if (form.physician_list[form.physician_list.selectedIndex].value == 'specialty') {
		form.SearchType.value = 'by_specialty';
	} else if (form.physician_list[form.physician_list.selectedIndex].value == 'location') {
		form.SearchType.value = 'by_location';
	}
	return true;
}

function check_fac_form() {
	form = document.fac_form;
	form.action = form.career_list[form.career_list.selectedIndex].value;
	return true;
}

function check_hl_form() {
	form = document.hl_form;
	var el = '';
	if (form.SearchTerm.value == '') {
		alert('Please enter a term to search on and then click "SEARCH" again');
		return false;
	} else {
		return true;
	}
}

function search_results(st, n) {
	form = document.hl_form;
	form.SearchTerm.value = st;
	form.SearchStart.value = n;
	form.submit();
}

function left_nav_rollover(id) {
	if (document.getElementById) document.getElementById('LN' + id).className = 'LeftNavRollover';
}

function left_nav_rolloff(id) {
	if (document.getElementById) document.getElementById('LN' + id).className = '';
}

function load_ba(pcid, baid, pid) {
	try {
		xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
	} catch (e1) {
		try {
			xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
		} catch (e2) {
			xmlhttp = null;
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	if (xmlhttp && document.getElementById('BeforeAfter' + pcid)) {
		document.getElementById('BeforeAfter' + pcid).innerHTML = '<table cellpadding="0" cellspacing="0" border="0" width="499"><tr><td><img src="/images/1x1trans.gif" width="1" height="427" border="0" alt="" /></td><td align="center"><img src="/images/page/ajax_loader.gif" width="32" height="32" border="0" alt="" /></td><td><img src="/images/1x1trans.gif" width="1" height="427" border="0" alt="" /></td></tr></table>';
		var qs = '?ID=' + baid;
		xmlhttp.open('GET', '/includes/before_after_load.aspx' + qs, true);
		xmlhttp.onreadystatechange = function() {
			if (xmlhttp.readyState == 4) {
				if (xmlhttp.statusText == 'OK') {
					document.getElementById('BeforeAfter' + pcid).innerHTML = xmlhttp.responseText;
				}
			}
		};
		xmlhttp.send(null);
	} else {
		document.location = '/default.aspx?ID=' + pid + '&BAID=' + baid + '#BA' + pcid;
	}
}

