// JavaScript Document

var fc = "#000"; // font color
var bc = "#FFF"; // backgrond color
var fw = "none"; // font weight
/*
var email1 = true;
var email2 = true;
var email3 = true;
var email4 = true;
var email5 = true;
var email6 = true;
var email7 = true;
var email8 = true;
var email9 = true;
var email10 = true;
*/
//
// arrays for practice areas
var bizpa = new Array();
var civilpa = new Array();;
var criminalpa = new Array();;
//
var emails;

//
// addOption: call to add an option to a list box 
// PARAMETERS: 
// 		selectbox-the list box to which elelment is being added
//		text - the text for the option being added
//		value - the value of the option
//
function addOption(selectbox,text,value ){
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.style.color = fc;
	optn.style.background = bc;	
	optn.value = value;
	selectbox.options.add(optn);
}

//
// loadindustries: call to add all industries to industries listbox 
// PARAMETERS: none
// 	
function loadIndustries() {
	fc="#000"; // font color
	addOption(document.firmprofile.industries,"Accommodations, Food Services","Accommodations, Food Services");	
	addOption(document.firmprofile.industries,"Advertising","Advertising");
	addOption(document.firmprofile.industries,"Agriculture, Forestry, Fishing and Hunting","Agriculture, Forestry, Fishing and Hunting");	
	addOption(document.firmprofile.industries,"Arts, Entertainment, and Recreation","Arts, Entertainment, and Recreation");
	addOption(document.firmprofile.industries,"Biotechnology","Biotechnology");	
	addOption(document.firmprofile.industries,"Broadcasting","Broadcasting");
	addOption(document.firmprofile.industries,"Computer & Software","Computer & Software");	
	addOption(document.firmprofile.industries,"Construction","Construction");
	addOption(document.firmprofile.industries,"Education","Education");
	addOption(document.firmprofile.industries,"Food and Beverages","Food and Beverages");
	addOption(document.firmprofile.industries,"Franchising","Franchising");	
	addOption(document.firmprofile.industries,"Health Care","Health Care");
	addOption(document.firmprofile.industries,"Manufacturing","Manufacturing");
	addOption(document.firmprofile.industries,"Mining, Quarrying, and Oil and Gas Extraction","Mining, Quarrying, and Oil and Gas Extraction");
	addOption(document.firmprofile.industries,"Professional Services","Professional Services");	
	addOption(document.firmprofile.industries,"Publishing","Publishing Industries (except Internet)");
	addOption(document.firmprofile.industries,"Retail","Retail");
	addOption(document.firmprofile.industries,"Real Estate","Real Estate");	
	addOption(document.firmprofile.industries,"Transportation and Warehousing","Transportation and Warehousing");
	addOption(document.firmprofile.industries,"Utilities","Utilities");
	addOption(document.firmprofile.industries,"Waste Management","Waste Management");
	addOption(document.firmprofile.industries,"Wholesale Trade","Wholesale Trade");
}

function loadIndustriesForDirectory() {
	fc="#000";
	addOption(document.thedirectory.industries,"Accommodations, Food Services","Accommodations, Food Services");	
	addOption(document.thedirectory.industries,"Advertising","Advertising");
	addOption(document.thedirectory.industries,"Agriculture, Forestry, Fishing and Hunting","Agriculture, Forestry, Fishing and Hunting");	
	addOption(document.thedirectory.industries,"Arts, Entertainment, and Recreation","Arts, Entertainment, and Recreation");
	addOption(document.thedirectory.industries,"Biotechnology","Biotechnology");	
	addOption(document.thedirectory.industries,"Broadcasting","Broadcasting");
	addOption(document.thedirectory.industries,"Computer & Software","Computer & Software");	
	addOption(document.thedirectory.industries,"Construction","Construction");
	addOption(document.thedirectory.industries,"Education","Education");
	addOption(document.thedirectory.industries,"Food and Beverages","Food and Beverages");
	addOption(document.thedirectory.industries,"Franchising","Franchising");	
	addOption(document.thedirectory.industries,"Health Care","Health Care");
	addOption(document.thedirectory.industries,"Manufacturing","Manufacturing");
	addOption(document.thedirectory.industries,"Mining, Quarrying, and Oil and Gas Extraction","Mining, Quarrying, and Oil and Gas Extraction");
	addOption(document.thedirectory.industries,"Professional Services","Professional Services");	
	addOption(document.thedirectory.industries,"Publishing","Publishing Industries (except Internet)");
	addOption(document.thedirectory.industries,"Retail","Retail");
	addOption(document.thedirectory.industries,"Real Estate","Real Estate");	
	addOption(document.thedirectory.industries,"Transportation and Warehousing","Transportation and Warehousing");
	addOption(document.thedirectory.industries,"Utilities","Utilities");
	addOption(document.thedirectory.industries,"Waste Management","Waste Management");
	addOption(document.thedirectory.industries,"Wholesale Trade","Wholesale Trade");
}

//
// insertseperator: inserts a gray line in the practiceareas list box.
// NOTE: The "|" is used by other functions to identify end of sub areas belonging to a major - top level - practice area.  DO NOT REMOVE.
// PARAMETERS: 
// 	
function insertseperator() {
	bc="#f0f1f5";
	fc="#f0f1f5";
	addOption(document.firmprofile.practiceareas,"|","|");
	bc="#FFF";
	fc="#000";
}

function addPAseperator() {
	bc="#f0f1f5";
	fc="#f0f1f5";
	addOption(document.thedirectory.practiceareas,"|","|");
	bc="#FFF";
	fc="#000";
}

//
// loadtoplevel: loads all practice areas, top level and sub areas, into practiceareas listbox for the directory page
// PARAMETERS: none
/* 	
function loadtoplevel() {
	addOption(document.thedirectory.practiceareas,"No Preference","No Preference");
	addOption(document.thedirectory.practiceareas,"Alternative Dispute Resolution","Alternative Dispute Resolution");
	addOption(document.thedirectory.practiceareas,"Antitrust and Competition","Antitrust and Competition");
	addOption(document.thedirectory.practiceareas,"Bankruptcy","Bankruptcy");
	addOption(document.thedirectory.practiceareas,"Business Formation","Business Formation");
	addOption(document.thedirectory.practiceareas,"Commercial Law & Business Contracts","Commercial Law & Business Contracts");
	addOption(document.thedirectory.practiceareas,"E-commerce","E-commerce");
	addOption(document.thedirectory.practiceareas,"Employment & Labor","Employment & Labor");
	addOption(document.thedirectory.practiceareas,"Energy & Natural Resources","Energy & Natural Resources");
	addOption(document.thedirectory.practiceareas,"Energy, Renewable & Alternative","Energy, Renewable & Alternative");
	addOption(document.thedirectory.practiceareas,"Environmental","Environmental");
	addOption(document.thedirectory.practiceareas,"Estate Planning","Estate Planning");
	addOption(document.thedirectory.practiceareas,"Finance, Commercial Lending","Finance, Commercial Lending");
	addOption(document.thedirectory.practiceareas,"Finance, Equity","Finance, Equity");
	addOption(document.thedirectory.practiceareas,"Finance, Public","Finance, Public");
	addOption(document.thedirectory.practiceareas,"Immigration","Immigration");
	addOption(document.thedirectory.practiceareas,"Intellectual Property","Intellectual Property");
	addOption(document.thedirectory.practiceareas,"International Trade","International Trade");
	addOption(document.thedirectory.practiceareas,"Leisure & Entertainment","Leisure & Entertainment");
	addOption(document.thedirectory.practiceareas,"Litigation, Commercial","Litigation, Commercial");
	addOption(document.thedirectory.practiceareas,"Litigation, Insurance","Litigation, Insurance");
	addOption(document.thedirectory.practiceareas,"Loan Workouts","Loan Workouts");
	addOption(document.thedirectory.practiceareas,"Mergers & Acquisitions","Mergers & Acquisitions");
	addOption(document.thedirectory.practiceareas,"Nonprofit Organizations","Nonprofit Organizations");
	addOption(document.thedirectory.practiceareas,"Real Estate, Construction","Real Estate, Construction");
	addOption(document.thedirectory.practiceareas,"Real Estate, Development","Real Estate, Development");
	addOption(document.thedirectory.practiceareas,"Real Estate, Finance","Real Estate, Finance");
	addOption(document.thedirectory.practiceareas,"Real Estate, Landlord/Tenant","Real Estate, Landlord/Tenant");
	addOption(document.thedirectory.practiceareas,"Real Estate, Leasing","Real Estate, Leasing");
	addOption(document.thedirectory.practiceareas,"Securities","Securities");
	addOption(document.thedirectory.practiceareas,"Taxation","Taxation");
	addOption(document.thedirectory.practiceareas,"Tax Controversies & Litigation","Tax Controversies & Litigation");
	addOption(document.thedirectory.practiceareas,"Telecommunications","Telecommunications");
	addOption(document.thedirectory.practiceareas,"Venture Capital","Venture Capital");
	addOption(document.thedirectory.practiceareas,"White Collar Crime","White Collar Crime");
}


function loadPracticeAreas() {
	fc="#000";
	fw = "normal";
	addOption(document.firmprofile.practiceareas,"Alternative Dispute Resolution","Alternative Dispute Resolution");
	addOption(document.firmprofile.practiceareas,"Antitrust and Competition","Antitrust and Competition");
	addOption(document.firmprofile.practiceareas,"Bankruptcy","Bankruptcy");
	addOption(document.firmprofile.practiceareas,"Business Formation","Business Formation");
	addOption(document.firmprofile.practiceareas,"Commercial Law & Business Contracts","Commercial Law & Business Contracts");
	addOption(document.firmprofile.practiceareas,"E-commerce","E-commerce");
	addOption(document.firmprofile.practiceareas,"Employment & Labor","Employment & Labor");
	addOption(document.firmprofile.practiceareas,"Energy & Natural Resources","Energy & Natural Resources");
	addOption(document.firmprofile.practiceareas,"Energy, Renewable & Alternative","Energy, Renewable & Alternative");
	addOption(document.firmprofile.practiceareas,"Environmental","Environmental");
	addOption(document.firmprofile.practiceareas,"Estate Planning","Estate Planning");
	addOption(document.firmprofile.practiceareas,"Finance, Commercial Lending","Finance, Commercial Lending");
	addOption(document.firmprofile.practiceareas,"Finance, Equity","Finance, Equity");
	addOption(document.firmprofile.practiceareas,"Finance, Public","Finance, Public");
	addOption(document.firmprofile.practiceareas,"Immigration","Immigration");
	addOption(document.firmprofile.practiceareas,"Intellectual Property","Intellectual Property");
	addOption(document.firmprofile.practiceareas,"International Trade","International Trade");
	addOption(document.firmprofile.practiceareas,"Leisure & Entertainment","Leisure & Entertainment");
	addOption(document.firmprofile.practiceareas,"Litigation, Commercial","Litigation, Commercial");
	addOption(document.firmprofile.practiceareas,"Litigation, Insurance","Litigation, Insurance");
	addOption(document.firmprofile.practiceareas,"Loan Workouts","Loan Workouts");
	addOption(document.firmprofile.practiceareas,"Mergers & Acquisitions","Mergers & Acquisitions");
	addOption(document.firmprofile.practiceareas,"Nonprofit Organizations","Nonprofit Organizations");
	addOption(document.firmprofile.practiceareas,"Real Estate, Construction","Real Estate, Construction");
	addOption(document.firmprofile.practiceareas,"Real Estate, Development","Real Estate, Development");
	addOption(document.firmprofile.practiceareas,"Real Estate, Finance","Real Estate, Finance");
	addOption(document.firmprofile.practiceareas,"Real Estate, Landlord/Tenant","Real Estate, Landlord/Tenant");
	addOption(document.firmprofile.practiceareas,"Real Estate, Leasing","Real Estate, Leasing");
	addOption(document.firmprofile.practiceareas,"Securities","Securities");
	addOption(document.firmprofile.practiceareas,"Taxation","Taxation");
	addOption(document.firmprofile.practiceareas,"Tax Controversies & Litigation","Tax Controversies & Litigation");
	addOption(document.firmprofile.practiceareas,"Telecommunications","Telecommunications");
	addOption(document.firmprofile.practiceareas,"Venture Capital","Venture Capital");
	addOption(document.firmprofile.practiceareas,"White Collar Crime","White Collar Crime");
}
*/

/* Move to Selected */
function setpa() {

	var tempStr = document.firmprofile.selectedpa.value;
	var tempArray = new Array();
	tempArray = tempStr.split(';');
	theLen = tempArray.length;
	//alert(theLen);
	for (x=0; x < theLen; x++) {
		for (i=0; i<document.firmprofile.practiceareas.length; i++) {
			if (document.firmprofile.practiceareas.options[i].text == tempArray[x]) {
				if (document.firmprofile.practiceareas.options[i].style.textDecoration !="underline") {
					document.firmprofile.practiceareas.options[i].style.textDecoration ="underline";
					document.firmprofile.practiceareas.options[i].style.color ="#F00";				
					i = theLen + 1000;
				}
			}
		}
	}

	//alert("SET PA");
}

/* 
function setindustries() {
	var tempStr = document.firmprofile.selectedindustries.value;
	var tempArray = new Array();
	tempArray = tempStr.split('%');
	theLen = tempArray.length;
	for (x=0; x < theLen; x++) {
		for (i=0; i<document.firmprofile.industries.length; i++) {
			if (document.firmprofile.industries.options[i].text == tempArray[x]) {
				if (document.firmprofile.industries.options[i].style.textDecoration != "underline") {
					document.firmprofile.industries.options[i].style.textDecoration ="underline";
					document.firmprofile.industries.options[i].style.color ="#F00";				
					i = theLen + 100;
				}
			}
		}
	}
	
}
*/

function getallselected() {
	var tmp = "";
	for (i=0; i<document.firmprofile.practiceareas.length; i++) {
		if (document.firmprofile.practiceareas.options[i].style.textDecoration =="underline") {
			if (tmp == "")
				tmp = document.firmprofile.practiceareas.options[i].text;
			else
				tmp = tmp + ";" + document.firmprofile.practiceareas.options[i].text;
		}
	}
	document.firmprofile.selectedpa.text = tmp;
	document.firmprofile.selectedpa.value = tmp;
}

/*
function getallindustriesselected() {
	var tmp = "";
	for (i=0; i<document.firmprofile.industries.length; i++)  {
		if (document.firmprofile.industries.options[i].style.textDecoration =="underline") {
			if (tmp == "")
				tmp = document.firmprofile.industries.options[i].text;
			else
				tmp = tmp + "%" + document.firmprofile.industries.options[i].text;
		}
	}
	document.firmprofile.selectedindustries.text = tmp;
	document.firmprofile.selectedindustries.value = tmp;	
}
*/

function markPracticeAreaSelected() {
	for (i=1; i<document.firmprofile.practiceareas.length; i++) {
		if (document.firmprofile.practiceareas.options[i].selected) {
			document.firmprofile.practiceareas.options[i].style.color = "#F00";
			document.firmprofile.practiceareas.options[i].style.textDecoration ="underline";
			document.firmprofile.practiceareas.options[i].selected = false;
		}		
	}
	getallselected();
}

function markIndustrySelected() {
	for (i=0; i<document.firmprofile.industries.length; i++) {
		if (document.firmprofile.industries.options[i].selected) {
			document.firmprofile.industries.options[i].style.color = "#F00";
			document.firmprofile.industries.options[i].style.textDecoration ="underline";
			document.firmprofile.industries.options[i].selected = false;
		}
	}
	getallindustriesselected();
}

function markPracticeAreaDeselected() {
	for (i=0; i<document.firmprofile.practiceareas.length; i++) {
		if (document.firmprofile.practiceareas.options[i].selected) {
			document.firmprofile.practiceareas.options[i].style.color = "#000";
			document.firmprofile.practiceareas.options[i].style.textDecoration ="none";
			document.firmprofile.practiceareas.options[i].selected = false;		
		}
	}
	getallselected();
}
 

function markIndustryDeselected() {
	for (i=0; i<document.firmprofile.industries.length; i++) {
		if (document.firmprofile.industries.options[i].selected) {
			document.firmprofile.industries.options[i].style.color = "#000";
			document.firmprofile.industries.options[i].style.textDecoration ="none";
			document.firmprofile.industries.options[i].selected = false;
		}
	}
	getallindustriesselected();
}


function loaddirectorylawschools() {
	addOption(document.thedirectory.lawschools,"Albany Law School","Albany Law School");
	addOption(document.thedirectory.lawschools,"American Univ., Washington College of Law","American Univ., Washington College of Law");
	addOption(document.thedirectory.lawschools,"Arizona State University College of Law","Arizona State University College of Law");
	addOption(document.thedirectory.lawschools,"Baylor University Law School","Baylor University Law School");
	addOption(document.thedirectory.lawschools,"Benjamin N. Cardozo School of Law (Yeshiva)","Benjamin N. Cardozo School of Law (Yeshiva)");
	addOption(document.thedirectory.lawschools,"Boston College Law School ","Boston College Law School");
	addOption(document.thedirectory.lawschools,"Boston University School of Law ","Boston University School of Law");
	addOption(document.thedirectory.lawschools,"Brooklyn Law School ","Brooklyn Law School");
	addOption(document.thedirectory.lawschools,"BYU, J. Reuben Clark Law School  ","BYU, J. Reuben Clark Law School ");
	addOption(document.thedirectory.lawschools,"Carolina Law (UNC)","Carolina Law (UNC)");
	addOption(document.thedirectory.lawschools,"Case Western Reserve U. School of Law","Case Western Reserve U. School of Law");
	addOption(document.thedirectory.lawschools,"Catholic U., Columbus School of Law","Catholic U., Columbus School of Law");
	addOption(document.thedirectory.lawschools,"Chapman University School of Law","Chapman University School of Law");
	addOption(document.thedirectory.lawschools,"Chicago-Kent College of Law, Ill. Inst. of Tech.","Chicago-Kent College of Law, Ill. Inst. of Tech.");
	addOption(document.thedirectory.lawschools,"Columbia Law School","Columbia Law School");
	addOption(document.thedirectory.lawschools,"Cornell Law School","Cornell Law School");
	addOption(document.thedirectory.lawschools,"DePaul College of Law","DePaul College of Law");
	addOption(document.thedirectory.lawschools,"Dickinson School of Law (Penn State) ","Dickinson School of Law (Penn State)");
	addOption(document.thedirectory.lawschools,"Duke University School of Law","Duke University School of Law");
	addOption(document.thedirectory.lawschools,"Emory University School of Law","Emory University School of Law");
	addOption(document.thedirectory.lawschools,"Florida State University College of Law","Florida State University College of Law");
	addOption(document.thedirectory.lawschools,"Fordham University Law School","Fordham University Law School");
	addOption(document.thedirectory.lawschools,"George Mason School of Law","George Mason School of Law");
	addOption(document.thedirectory.lawschools,"George Washington University Law School","George Washington University Law School");
	addOption(document.thedirectory.lawschools,"Georgetown University Law Center","Georgetown University Law Center");
	addOption(document.thedirectory.lawschools,"Georgia State University College of Law","Georgia State University College of Law");
	addOption(document.thedirectory.lawschools,"Gonzaga University School of Law","Gonzaga University School of Law");
	addOption(document.thedirectory.lawschools,"Harvard Law School","Harvard Law School");
	addOption(document.thedirectory.lawschools,"Hofstra University School of Law","Hofstra University School of Law");
	addOption(document.thedirectory.lawschools,"Indiana U. School of Law--Bloomington ","Indiana U. School of Law--Bloomington");
	addOption(document.thedirectory.lawschools,"Indiana Univ. School of Law--Indianapolis","Indiana Univ. School of Law--Indianapolis");
	addOption(document.thedirectory.lawschools,"Lewis & Clark Northwestern School of Law","Lewis & Clark Northwestern School of Law");
	addOption(document.thedirectory.lawschools,"Louis D. Brandeis School of Law (Louisville) ","Louis D. Brandeis School of Law (Louisville)");
	addOption(document.thedirectory.lawschools,"Loyola Law School, Los Angeles ","Loyola Law School, Los Angeles");
	addOption(document.thedirectory.lawschools,"Loyola University Chicago School of Law ","Loyola University Chicago School of Law");
	addOption(document.thedirectory.lawschools,"Marquette University Law School ","Marquette University Law School");
	addOption(document.thedirectory.lawschools,"McGeorge School of Law, University of the Pacific ","McGeorge School of Law, University of the Pacific");
	addOption(document.thedirectory.lawschools,"New York Law School","New York Law School");
	addOption(document.thedirectory.lawschools,"Northeastern University School of Law ","Northeastern University School of Law");
	addOption(document.thedirectory.lawschools,"Northwestern University School of Law","Northwestern University School of Law");
	addOption(document.thedirectory.lawschools,"Notre Dame Law School ","Notre Dame Law School");
	addOption(document.thedirectory.lawschools,"NYU School of Law","NYU School of Law");
	addOption(document.thedirectory.lawschools,"Ohio State University College of Law","Ohio State University College of Law");
	addOption(document.thedirectory.lawschools,"Pace Law School","Pace Law School");
	addOption(document.thedirectory.lawschools,"Pepperdine University School of Law  ","Pepperdine University School of Law ");
	addOption(document.thedirectory.lawschools,"Rutgers School of Law - Camden","Rutgers School of Law - Camden");
	addOption(document.thedirectory.lawschools,"Rutgers School of Law - Newark","Rutgers School of Law - Newark");
	addOption(document.thedirectory.lawschools,"Saint Louis University School of Law","Saint Louis University School of Law");
	addOption(document.thedirectory.lawschools,"Santa Clara University School of Law","Santa Clara University School of Law");
	addOption(document.thedirectory.lawschools,"Seton Hall Law School","Seton Hall Law School");
	addOption(document.thedirectory.lawschools,"SMU Dedman School of Law ","SMU Dedman School of Law");
	addOption(document.thedirectory.lawschools,"St. John's University School of Law","St. John's University School of Law");
	addOption(document.thedirectory.lawschools,"Stanford Law School","Stanford Law School");
	addOption(document.thedirectory.lawschools,"Stetson University College of Law","Stetson University College of Law");
	addOption(document.thedirectory.lawschools,"Suffolk University Law School","Suffolk University Law School");
	addOption(document.thedirectory.lawschools,"Syracuse University College of Law","Syracuse University College of Law");
	addOption(document.thedirectory.lawschools,"Temple U.--James E. Beasley School of Law","Temple U.--James E. Beasley School of Law");
	addOption(document.thedirectory.lawschools,"Tulane Law School","Tulane Law School");
	addOption(document.thedirectory.lawschools,"UC Berkeley School of Law","UC Berkeley School of Law");
	addOption(document.thedirectory.lawschools,"UC Davis School of Law","UC Davis School of Law");
	addOption(document.thedirectory.lawschools,"UC Hastings College of the Law","UC Hastings College of the Law");
	addOption(document.thedirectory.lawschools,"UCLA School of Law","UCLA School of Law");
	addOption(document.thedirectory.lawschools,"Univ. of Arkansas School of Law (Fayetteville)","Univ. of Arkansas School of Law (Fayetteville)");
	addOption(document.thedirectory.lawschools,"Univ. of Missouri-Columbia School of Law","Univ. of Missouri-Columbia School of Law");
	addOption(document.thedirectory.lawschools,"University at Buffalo Law School","University at Buffalo Law School");
	addOption(document.thedirectory.lawschools,"University of Alabama School of Law","University of Alabama School of Law");
	addOption(document.thedirectory.lawschools,"University of Arizona College of Law","University of Arizona College of Law");
	addOption(document.thedirectory.lawschools,"University of Chicago Law School","University of Chicago Law School");
	addOption(document.thedirectory.lawschools,"University of Cincinnati College of Law","University of Cincinnati College of Law");
	addOption(document.thedirectory.lawschools,"University of Colorado School of Law","University of Colorado School of Law");
	addOption(document.thedirectory.lawschools,"University of Connecticut School of Law","University of Connecticut School of Law");
	addOption(document.thedirectory.lawschools,"University of Denver College of Law","University of Denver College of Law");
	addOption(document.thedirectory.lawschools,"University of Florida Levin College of Law","University of Florida Levin College of Law");
	addOption(document.thedirectory.lawschools,"University of Georgia School of Law","University of Georgia School of Law");
	addOption(document.thedirectory.lawschools,"University of Houston Law Center","University of Houston Law Center");
	addOption(document.thedirectory.lawschools,"University of Idaho College of Law ","University of Idaho College of Law");
	addOption(document.thedirectory.lawschools,"University of Illinois College of Law","University of Illinois College of Law");
	addOption(document.thedirectory.lawschools,"University of Iowa College of Law ","University of Iowa College of Law");
	addOption(document.thedirectory.lawschools,"University of Kansas School of Law","University of Kansas School of Law");
	addOption(document.thedirectory.lawschools,"University of Kentucky College of Law ","University of Kentucky College of Law");
	addOption(document.thedirectory.lawschools,"University of Maryland School of Law","University of Maryland School of Law");
	addOption(document.thedirectory.lawschools,"University of Miami School of Law","University of Miami School of Law");
	addOption(document.thedirectory.lawschools,"University of Michigan Law School","University of Michigan Law School");
	addOption(document.thedirectory.lawschools,"University of Minnesota Law School","University of Minnesota Law School");
	addOption(document.thedirectory.lawschools,"University of Mississippi School of Law","University of Mississippi School of Law");
	addOption(document.thedirectory.lawschools,"University of Nebraska College of Law","University of Nebraska College of Law");
	addOption(document.thedirectory.lawschools,"University of New Mexico School of Law","University of New Mexico School of Law");
	addOption(document.thedirectory.lawschools,"University of Oklahoma College of Law","University of Oklahoma College of Law");
	addOption(document.thedirectory.lawschools,"University of Oregon School of Law","University of Oregon School of Law");
	addOption(document.thedirectory.lawschools,"University of Pennsylvania Law School","University of Pennsylvania Law School");
	addOption(document.thedirectory.lawschools,"University of Pittsburgh School of Law","University of Pittsburgh School of Law");
	addOption(document.thedirectory.lawschools,"University of Richmond School of Law","University of Richmond School of Law");
	addOption(document.thedirectory.lawschools,"University of San Diego School of Law","University of San Diego School of Law");
	addOption(document.thedirectory.lawschools,"University of San Francisco School of Law ","University of San Francisco School of Law");
	addOption(document.thedirectory.lawschools,"University of South Carolina School of Law","University of South Carolina School of Law");
	addOption(document.thedirectory.lawschools,"University of Southern California Law School","University of Southern California Law School");
	addOption(document.thedirectory.lawschools,"University of Tennessee College of Law  ","University of Tennessee College of Law ");
	addOption(document.thedirectory.lawschools,"University of Texas School of Law","University of Texas School of Law");
	addOption(document.thedirectory.lawschools,"University of Utah College of Law","University of Utah College of Law");
	addOption(document.thedirectory.lawschools,"University of Virginia School of Law","University of Virginia School of Law");
	addOption(document.thedirectory.lawschools,"University of Washington School of Law","University of Washington School of Law");
	addOption(document.thedirectory.lawschools,"University of Wisconsin Law School","University of Wisconsin Law School");
	addOption(document.thedirectory.lawschools,"Vanderbilt University Law School","Vanderbilt University Law School");
	addOption(document.thedirectory.lawschools,"Vermont Law School","Vermont Law School");
	addOption(document.thedirectory.lawschools,"Villanova University School of Law","Villanova University School of Law");
	addOption(document.thedirectory.lawschools,"Wake Forest University School of Law","Wake Forest University School of Law");
	addOption(document.thedirectory.lawschools,"Washington and Lee University School of Law ","Washington and Lee University School of Law");
	addOption(document.thedirectory.lawschools,"Washington University School of Law","Washington University School of Law");
	addOption(document.thedirectory.lawschools,"Wayne State University Law School","Wayne State University Law School");
	addOption(document.thedirectory.lawschools,"William and Mary School of Law","William and Mary School of Law");
	addOption(document.thedirectory.lawschools,"William S. Boyd School of Law at UNLV ","William S. Boyd School of Law at UNLV");
	addOption(document.thedirectory.lawschools,"William S. Richardson School of Law (Hawaii)","William S. Richardson School of Law (Hawaii)");
	addOption(document.thedirectory.lawschools,"Yale Law School","Yale Law School");
}



function loadlawschools() {
addOption(document.firmprofile.practiceareas,"ANTITRUST and TRADE REGULATION","ANTITRUST and TRADE REGULATION ");
}


function gotoresultspage() {
	window.location.href = "http://www.quigal.com/searchresults.php";
}

function showpreview() {
	window.open("http://www.quigal.com/attorneyprofilepage.php?id="+document.firmprofile.attorney_id.value);
	//window.location.href = "http://www.quigal.com/attorneyprofilepage.php?id="+document.firmprofile.attorney_id.value;
}

function toggleattorneys() {
	// on the results page, this routine toggles the status of all the results
	// based on the status of the "select all" checkbox.
	document.engagementRequest.select1.checked =  document.engagementRequest.sendtoall.checked;
	addemailtolist1();	
	document.engagementRequest.select2.checked  = document.engagementRequest.sendtoall.checked;
	addemailtolist2();	
	document.engagementRequest.select3.checked  = document.engagementRequest.sendtoall.checked;
	addemailtolist3();	
	document.engagementRequest.select4.checked  = document.engagementRequest.sendtoall.checked;
	addemailtolist4();	
	document.engagementRequest.select5.checked  = document.engagementRequest.sendtoall.checked;
	addemailtolist5();	
	document.engagementRequest.select6.checked  = document.engagementRequest.sendtoall.checked;
	addemailtolist6();	
	document.engagementRequest.select7.checked  = document.engagementRequest.sendtoall.checked;
	addemailtolist7();
	document.engagementRequest.select8.checked  = document.engagementRequest.sendtoall.checked;
	addemailtolist8();	
	document.engagementRequest.select9.checked  = document.engagementRequest.sendtoall.checked;
	addemailtolist9();	
	document.engagementRequest.select10.checked  = document.engagementRequest.sendtoall.checked;
	addemailtolist10();	
}

function setflags() {
	// This sets the value of the hidden variable that was set my the value in the database to determine
	// what to set the status of the free consultation checkbox to.
	if (document.firmprofile.freeconsultation.value == "T") {
		//alert("FREE CONSULT");
		document.firmprofile.freeconsultation.text = "T";
		document.firmprofile.freeconsult.checked = true;
	} else {
		//document.firmprofile.freeconsultation.text = "F";
		document.firmprofile.freeconsultation.value = "F";	
		document.firmprofile.freeconsult.checked = false;		
	}
	//
	if (document.firmprofile.fixedfee.value == "T") {
		//alert("FIXED FEE");
		document.firmprofile.fixedfee.text = "T";
		document.firmprofile.fixedfeecb.checked = true;
	} else {
		//document.firmprofile.fixedfee.text = "F";
		document.firmprofile.fixedfee.value = "F";	
		document.firmprofile.fixedfeecb.checked = false;		
	}
	//
	if (document.firmprofile.contingency.value == "T") {
		//alert("CONTINGENCY");
		document.firmprofile.contingency.text = "T";
		document.firmprofile.contingencycb.checked = true;
	} else {
		//document.firmprofile.contingency.text = "F";
		document.firmprofile.contingency.value = "F";	
		document.firmprofile.contingencycb.checked = false;		
	}
	//
	if (document.firmprofile.creditcards.value == "T") {
		//alert("CREDIT CARDS");
		document.firmprofile.creditcards.text = "T";
		document.firmprofile.creditcardscb.checked = true;
	} else {
		//document.firmprofile.creditcards.text = "F";
		document.firmprofile.creditcards.value = "F";	
		document.firmprofile.creditcardscb.checked = false;		
	}	
	//alert("SET FLAGS");
}


function newconsult() {
	// This checks the status of the free consultation checkbox when it changes so that the hidden variable 
	// passed to the database is also set.
	if (document.firmprofile.freeconsult.checked) {
		document.firmprofile.freeconsultation.text = "T";
		document.firmprofile.freeconsultation.value = "T";
	} else {
		document.firmprofile.freeconsultation.text = "F";
		document.firmprofile.freeconsultation.value = "F";		
	} 
//
	if (document.firmprofile.fixedfeecb.checked) {
		document.firmprofile.fixedfee.text = "T";
		document.firmprofile.fixedfee.value = "T";
	} else {
		document.firmprofile.fixedfee.text = "F";
		document.firmprofile.fixedfee.value = "F";		
	} 
//
	if (document.firmprofile.contingencycb.checked) {
		document.firmprofile.contingency.text = "T";
		document.firmprofile.contingency.value = "T";
	} else {
		document.firmprofile.contingency.text = "F";
		document.firmprofile.contingency.value = "F";		
	} 
//
	if (document.firmprofile.creditcardscb.checked) {
		document.firmprofile.creditcards.text = "T";
		document.firmprofile.creditcards.value = "T";
	} else {
		document.firmprofile.creditcards.text = "F";
		document.firmprofile.creditcards.value = "F";		
	} 
}

function getselectedpa() {
	newtext = document.thedirectory.practiceareas.options[document.thedirectory.practiceareas.selectedIndex].text; 
	if (newtext == "") {
		document.thedirectory.practiceareas.selectedIndex = 0;
		document.thedirectory.selectedpa.value = "No Preference";
		alert("This is an invalid selection.  Selection automatically reset to No Preference.");
	} else {
		document.thedirectory.selectedpa.value = newtext;
		//alert(document.thedirectory.selectedpa.value );
	}

}

function getselectedindustry() {
	newtext = document.thedirectory.industries.options[document.thedirectory.industries.selectedIndex].text; 
	if (newtext == "") {
		document.thedirectory.industries.selectedIndex = 0;
		document.thedirectory.selectedindustry.value = "No Preference";
		alert("This is an invalid selection.  Selection automatically reset to No Preference.");
	} else {
		document.thedirectory.selectedindustry.value = newtext;
		//alert(document.thedirectory.selectedpa.value );
	}

}

function getselectedlawschool() {
	newtext = document.thedirectory.lawschools.options[document.thedirectory.lawschools.selectedIndex].text; 
	if (newtext == "") {
		document.thedirectory.lawschools.selectedIndex = 0;
		document.thedirectory.selectedlawschool.value = "No Preference";
		alert("This is an invalid selection.  Selection automatically reset to No Preference.");
	} else {
		document.thedirectory.selectedlawschool.value = newtext;
		//alert(document.thedirectory.selectedpa.value );
	}

}

function checkclientlength() {
	tstr = "";
	tstr = document.firmprofile.clientdesc.value;
	if (tstr.length > 150) {
		tstr = tstr.slice(0, 150);
		document.firmprofile.clientdesc.value = tstr;
		alert("Client description cannot be greater than 150 characters.");
	}
}

function checklength() {
	tstr = "";
	tstr = document.firmprofile.summary.value;
	if (tstr.length > 450) {
		tstr = tstr.slice(0, 450);
		document.firmprofile.summary.value = tstr;
		alert("Summary cannot be greater than 450 characters.");
	}
}

function addemailtolist1() {	
	if (document.engagementRequest.select1.checked == true) {
		document.engagementRequest.e1.value = document.engagementRequest.select1.value;
	} else {
		document.engagementRequest.e1.value = "DNS";
	}
	//alert(document.engagementRequest.e1.value );
}

function addemailtolist2() {
	if (document.engagementRequest.select2.checked == true) {
		document.engagementRequest.e2.value = document.engagementRequest.select2.value;
	} else {
		document.engagementRequest.e2.value = "DNS";
	}
	//alert(document.engagementRequest.e2.value );
}

function addemailtolist3() {
	if (document.engagementRequest.select3.checked == true) {
		document.engagementRequest.e3.value = document.engagementRequest.select3.value;
	} else {
		document.engagementRequest.e3.value = "DNS";
	}
	//alert(document.engagementRequest.e3.value );
}

function addemailtolist4() {
	if (document.engagementRequest.select4.checked == true) {
		document.engagementRequest.e4.value = document.engagementRequest.select4.value;
	} else {
		document.engagementRequest.e4.value = "DNS";
	}
	//alert(document.engagementRequest.e4.value );
}

function addemailtolist5() {
	if (document.engagementRequest.select5.checked == true) {
		document.engagementRequest.e5.value = document.engagementRequest.select5.value;
	} else {
		document.engagementRequest.e5.value = "DNS";
	}
	//alert(document.engagementRequest.e5.value );
}

function addemailtolist6() {
	if (document.engagementRequest.select6.checked == true) {
		document.engagementRequest.e6.value = document.engagementRequest.select6.value;
	} else {
		document.engagementRequest.e6.value = "DNS";
	}
	//alert(document.engagementRequest.e6.value );
}

function addemailtolist7() {
	if (document.engagementRequest.select7.checked == true) {
		document.engagementRequest.e7.value = document.engagementRequest.select7.value;
	} else {
		document.engagementRequest.e7.value = "DNS";
	}
	//alert(document.engagementRequest.e7.value );
}

function addemailtolist8() {
	if (document.engagementRequest.select8.checked == true) {
		document.engagementRequest.e8.value = document.engagementRequest.select8.value;
	} else {
		document.engagementRequest.e8.value = "DNS";
	}
	//alert(document.engagementRequest.e8.value );
}

function addemailtolist9() {
	if (document.engagementRequest.select9.checked == true) {
		document.engagementRequest.e9.value = document.engagementRequest.select9.value;
	} else {
		document.engagementRequest.e9.value = "DNS";
	}
	//alert(document.engagementRequest.e9.value );
}

function addemailtolist10() {
	if (document.engagementRequest.select10.checked == true) {
		document.engagementRequest.e10.value = document.engagementRequest.select10.value;
	} else {
		document.engagementRequest.e10.value = "DNS";
	}
	//alert(document.engagementRequest.e10.value );
}





function setemail() {
	emails[0] = document.engagementRequest.e1.value;
	emails[1] = document.engagementRequest.e2.value;
	emails[2] = document.engagementRequest.e3.value;
	emails[3] = document.engagementRequest.e4.value;
	emails[4] = document.engagementRequest.e5.value;
	emails[5] = document.engagementRequest.e6.value;
	emails[6] = document.engagementRequest.e7.value;
	emails[7] = document.engagementRequest.e8.value;
	emails[8] = document.engagementRequest.e9.value;
	emails[9] = document.engagementRequest.e10.value;
}

function addselectedzips() {
	//alert("ZIPS: "+document.zipcodelist.selectedzips.value);	
	var tempStr = document.zipcodelist.selectedzips.value;
	var tempArray = new Array();
	tempArray = tempStr.split('%');
	theLen = tempArray.length;
	for (x=0; x < theLen; x++) {
		addOption(document.zipcodelist.selectedzipcodes, tempArray[x], tempArray[x]);		
	}
}

function addzip(r, c) {
	// called by php to add zip to avaialble zipcode select control
	addOption(document.zipcodelist.availablezipcodes, r, c);	
}

function buildziplist() {
	ziplist = ""
	for (i=1; i <document.zipcodelist.selectedzipcodes.length; i++) {
		if (ziplist == "")
			ziplist = document.zipcodelist.selectedzipcodes.options[i].text;
		else
			ziplist = ziplist + "%" + document.zipcodelist.selectedzipcodes.options[i].text
	}
	document.zipcodelist.selectedzips.value = ziplist;
	calccost();
}

function calccost() {
	document.zipcodelist.zipcodecost.value = (document.zipcodelist.selectedzipcodes.length-1) * 9.99;
	if (document.zipcodelist.livechat.checked == true) {
		document.zipcodelist.livechatcost.value = 9.99;
	} else {
		document.zipcodelist.livechatcost.value = 0;
	}
	n1 = 1.1;
	n1 = parseFloat(document.zipcodelist.zipcodecost.value);
	n2 = 1.1;
	n2 = parseFloat(document.zipcodelist.livechatcost.value);
	//alert(n1);
	//alert(n2);
	n3 = 1.1;
	n3 = n1 + n2;
	document.zipcodelist.totalcost.value = n3;
}


function deleterequest(request_id) {
	//alert("DELETE REQUEST "+request_id);
	window.location.href = "http://www.quigal.com/deleterequest.php?id="+request_id;
}

function setlivechat() {
	if (document.zipcodelist.livechatselected.value == "YES") {
		document.zipcodelist.livechat.checked = true;
	} else {
		document.zipcodelist.livechat.checked = false;		
	}
	calccost();
}

function resetlivechat() {

	if (document.zipcodelist.livechat.checked == true) {
		document.zipcodelist.livechatselected.value = "YES"
			//alert("RESET LIVE CHAT to YES");
	} else {
		document.zipcodelist.livechatselected.value = "NO"
			//alert("RESET LIVE CHAT to NO");
	}
	
}

function selectzip() {
	// called when 'Add to Selected' button is pressed in manage subscriptions
	if (document.zipcodelist.availablezipcodes.options[document.zipcodelist.availablezipcodes.options.selectedIndex].value == "ZZZZZ") {
		alert("Please Select a Zip Code");
	} else {
		tobeadded = document.zipcodelist.availablezipcodes.options[document.zipcodelist.availablezipcodes.options.selectedIndex].text;	
		//tobeadded = tobeadded + " ("+document.zipcodelist.availablezipcodes.options[document.zipcodelist.availablezipcodes.options.selectedIndex].value+")";
		addOption(document.zipcodelist.selectedzipcodes, tobeadded, tobeadded);	
		buildziplist();
	}
} 

function deselectzip() {
	// called when 'Remove' button is pressed in manage subscriptions
	tobedeleted = document.zipcodelist.selectedzipcodes.options.selectedIndex;	
	if (tobedeleted == 0) {
		alert("Please Select a Zip Code");
	} else {
		//document.zipcodelist.selectedzipcodes.options.remove(tobedeleted);
		document.zipcodelist.selectedzipcodes.options[tobedeleted] = null;
		buildziplist();
	}
} 

function showzipdetails() {
	if (document.zipcodelist.availablezipcodes.options[document.zipcodelist.availablezipcodes.options.selectedIndex].value == "ZZZZZ") {
		alert("Please Select a Zip Code");
	} else {
		tobeviewed = document.zipcodelist.availablezipcodes.options[document.zipcodelist.availablezipcodes.options.selectedIndex].text;
		window.open("http://www.quigal.com/showzipdetails.php?id="+tobeviewed, "ZipcodeDemographics", "location=0, status=0, scrollbars=0, menubar=0, resizable=0, directories=0, width=350,height=400"); 
	}
}

function showlivechat(a) {
	//alert("SHOW LIVE CHAT: "+a);
	window.open("http://www.quigal.com/showlivechat.php?id="+a, "livechatwindow", "location=0, status=0, scrollbars=0, menubar=0, resizable=0, directories=0, width=250,height=100"); 
}

function needzipcode() {
	alert("A valid 5 digit zip code is required to Search for an attorney");
	window.location.href = "http://www.quigal.com/index.html";
}

function invalidfeedbackinfo() {
	alert("We are sorry for the inconvenience but the CASE ID and Email combination you entered does not exist in our database. Please enter a valid CASE ID and Email combination.");
	window.location.href = "http://www.quigal.com/feedback.html";
}

function togglelivechat() {
	if (document.thedirectory.musthavelivechat.checked == true)
		document.thedirectory.livechatonly.value = "YES"
	else
		document.thedirectory.livechatonly.value = "NO"
}

function fbsetattorney() {
	//alert("here");	
	theIndex = document.feedbackform.attorneylist.selectedIndex;
	//alert(theIndex);
	document.feedbackform.attorneyindex.value = document.feedbackform.attorneylist.options[theIndex].value 
	//alert(document.feedbackform.attorneyindex.value );
}
//
//
// for new index
//

function getnewlawtype() {
	tol = document.easysearch.lawtype.options[document.easysearch.lawtype.selectedIndex].text; 
	//alert(tol);
	if (tol == "Business Law") {
		document.easysearch.typeoflaw.value = "BUSINESS"; 
	} else {
		if (tol == "Civil Law") {
			document.easysearch.typeoflaw.value = "CIVIL"; 
		} else {
			document.easysearch.typeoflaw.value = "CRIMINAL"; 
		}
	}
	//alert(document.easysearch.typeoflaw.value );
}

///////////////

function getbizpa() {
	newtext = document.bizsearch.bizpa.options[document.bizsearch.bizpa.selectedIndex].text; 
	if (newtext == "") {
		document.bizsearch.bizpa.selectedIndex = 0;
		document.bizsearch.selectedpa.value = "No Preference";
	} else {
		document.bizsearch.selectedpa.value = newtext;
	}

}

function getcivilpa() {
	newtext = document.civilsearch.civilpa.options[document.civilsearch.civilpa.selectedIndex].text; 
	if (newtext == "") {
		document.civilsearch.civilpa.selectedIndex = 0;
		document.civilsearch.selectedpa.value = "No Preference";
	} else {
		document.civilsearch.selectedpa.value = newtext;
	}
}

function getcriminalpa() {
	newtext = document.criminalsearch.criminalpa.options[document.criminalsearch.criminalpa.selectedIndex].text; 
	if (newtext == "") {
		document.criminalsearch.criminalpa.selectedIndex = 0;
		document.criminalsearch.selectedpa.value = "No Preference";
	} else {
		document.criminalsearch.selectedpa.value = newtext;
	}
}

function savepa(i, text, type) {
	switch(type) {
	case "CRIMINAL":
	criminalpa[i] = text;
	break;
	case "CIVIL":
	civilpa[i] = text;	
	break;
	case "BUSINESS":
	bizpa[i] = text;	
	break;	
	}
}

function loadcivilpa() {
	document.thedirectory.practiceareas.options.length = 0;
	addOption(document.thedirectory.practiceareas, "No Preference","No Preference");	
	for (i=0; i < civilpa.length; i++) {
		addOption(document.thedirectory.practiceareas, civilpa[i],civilpa[i]);
	}
}

function loadbizpa() {
	document.thedirectory.practiceareas.options.length = 0;
	addOption(document.thedirectory.practiceareas, "No Preference","No Preference");
	for (i=0; i < bizpa.length; i++) {
		addOption(document.thedirectory.practiceareas, bizpa[i],bizpa[i]);
	}
}

function loadcriminalpa() {
	document.thedirectory.practiceareas.options.length = 0;
	addOption(document.thedirectory.practiceareas, "Not Applicable for Criminal Law","No Preference");
	/*
	for (i=0; i < criminalpa.length; i++) {
		addOption(document.thedirectory.practiceareas, criminalpa[i],criminalpa[i]);
	}
	*/
}

function setactive() {
	//alert(document.firmprofile.activeflag.value );
	if (document.firmprofile.activeflag.value == "YES") {
		document.firmprofile.active[0].checked = true;
	} else {
		document.firmprofile.active[1].checked = true;
	}
}

function setactiveflag(f) {
	document.firmprofile.activeflag.value = f;
}

function calcroi() {
	n1 = document.zipcodelist.avgbilling.value * document.zipcodelist.casesfromquigal.value;
	document.zipcodelist.totalbillings.value = n1;
	document.zipcodelist.annualquigalcost.value = document.zipcodelist.totalcost.value * 12;
	document.zipcodelist.totalroi.value = n1 - document.zipcodelist.annualquigalcost.value;
}

function buildtype() {
	tstr = "";
	if (document.firmprofile.business.checked == true)
		tstr="BUSINESS ";
	if (document.firmprofile.civil.checked == true)
		tstr= tstr+"CIVIL ";
	if (document.firmprofile.criminal.checked == true)
		tstr=tstr+"CRIMINAL";
	if (tstr == "") {
		document.firmprofile.business.checked = true;
		tstr = "BUSINESS";
	}
	document.firmprofile.lawyertype.value = tstr;
	//alert(document.firmprofile.lawyertype.value);
}

function setlawyertype() {
	tstr = document.firmprofile.lawyertype.value;
	
	if (tstr.search("BUSINESS") > -1) {
		document.firmprofile.business.checked = true;
	}
	
	if (tstr.search("CIVIL") > -1) {
		document.firmprofile.civil.checked = true;
	}
	if (tstr.search("CRIMINAL") > -1) {
		document.firmprofile.criminal.checked = true;	
	}
	
	//alert("SET LAWYER TYPE");

}