
function parseQuery(queryString,targetSubstring) {
	var returnString = "";
	var indexStart = 0;
	var indexEnd = 0;
	indexStart = queryString.indexOf(targetSubstring);
	if (indexStart > 0) {
		indexStart = indexStart + targetSubstring.length + 1;
		indexEnd = queryString.indexOf('&',indexStart)
		returnString = queryString.substring(indexStart,indexEnd);
	} else {
		returnString = "no";
	}
	return returnString;
}


function selectLocation(location) {
	var locationsHTML;
	var locations = "Location,Pittsburgh,Wheeling,Philadelphia,Princeton".split(",");
	for (count = 0 ; count < (locations.length); count++) {
		if (count == 0) {
			locationsHTML += '<option value="">' + locations[count] + '</option>';
		} else {
			if (locations[count] == location) {
				locationsHTML += '<option value="' + locations[count] + '" SELECTED>' + locations[count] + '</option>';
			} else {
				locationsHTML += '<option value="' + locations[count] + '">' + locations[count] + '</option>';
			}
		}
	}
	return locationsHTML;
}



function selectPracticeArea(practiceArea) {
	practiceArea = practiceArea.replace(/\+/gi, " ");
	practiceArea = practiceArea.replace(/%2F/gi, "/");
	practiceArea = practiceArea.replace(/%27/gi, "'");
	var practiceAreasHTML;
	//update_pa_js-top
	var practiceAreas = "Practice Area,Alternative Dispute Resolution,Antitrust and Trade Regulation,Attorney-Client Privilege,Bankruptcy and Financial Restructuring,Commercial and Public Finance,Commercial and Real Estate Finance,Construction Law,Corporate and Business Law,Defamation First Amendment and Media Law,E-Discovery and Records Management,Employee Benefits and Executive Compensation,Employee Benefits Litigation,Employment Discrimination Litigation,Energy & Natural Resources Law,Environmental Law,Estate Planning,Estates and Trusts,Health Care Law,Insurance and Reinsurance,Insurance Litigation and Regulation,Intellectual Property - Biomedical Technology,Intellectual Property - Licensing,Intellectual Property - Software,Intellectual Property - Trademark/Trade Dress,Intellectual Property,International Law,Labor and Employment Law,Land Use Development and Regulatory Law,Litigation,Municipal Law and Public Private Partnerships,Non-Competition Litigation,Product Liability,Public Finance,Real Estate Law,Real Estate Litigation,Securities,Strategic Transactions,Tax,Technology Law,Technology Litigation,Technology-based Business,Title Insurance,Toxic Torts,Trade Secrets and Unfair Competition Litigation,Transportation and Logistics,White Collar Criminal Defense - Internal Investigations,Wrongful Termination and Workplace Harassment".split(",");	
	//update_pa_js-bottom
	for (count = 0 ; count < (practiceAreas.length); count++) {
		if (count == 0) {
			practiceAreasHTML += '<option value="">' + practiceAreas[count] + '</option>';
		} else {
			if (practiceAreas[count] == practiceArea) {
				practiceAreasHTML += '<option value="' + practiceAreas[count] + '" SELECTED>' + practiceAreas[count] + '</option>';
			} else {
				practiceAreasHTML += '<option value="' + practiceAreas[count] + '">' + practiceAreas[count] + '</option>' + practiceArea;
			}
		}
	}
	return practiceAreasHTML;
}




function selectLastName(lastName) {
	var lastNamesHTML;
	var lastNames = "Last Name begins with...,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z".split(",");
	for (count = 0 ; count < (lastNames.length); count++) {
		if (count == 0) {
			lastNamesHTML += '<option value="">' + lastNames[count] + '</option>';
		} else {
			if (lastNames[count] == lastName) {
				lastNamesHTML += '<option value="' + lastNames[count] + '" SELECTED>' + lastNames[count] + '</option>';
			} else {
				lastNamesHTML += '<option value="' + lastNames[count] + '">' + lastNames[count] + '</option>';
			}
		}
	}
	return lastNamesHTML;
}