var d = document;
var bgImgPath = 'img/intro_';
var insetImgPath = 'img/inset_';

function getPage() {
	var url = d.location.search;
	if (url) {
		var page = url.substring(1,url.length);
	} else {
		var page = 'home';
	}
	showInfo(page);
}

function showInfo(topic) {
	var leftNavLinks = d.getElementById('leftNav').getElementsByTagName('a');
	for (i = 0; i < leftNavLinks.length; i++) {
		if (leftNavLinks[i].id == topic) {
			leftNavLinks[i].className = 'current';
		} else {
			leftNavLinks[i].className = '';			
		}
	}
	
	var newInfo = d.createElement('div');
	newInfo.id = 'information';
	var h4 = d.createElement('h4');
	var p1 = d.createElement('p');
	var p2 = d.createElement('p');
	var p3 = d.createElement('p');
	var p4 = d.createElement('p');
	var p5 = d.createElement('p');
	var subhead, p1content, p2content, p3content, p4content, p5content;
	var img1 = d.createElement('img');
	var img2 = d.createElement('img');
	img1.className = 'insetImgR';
	img2.className = 'insetImgL';
	
	if (topic == 'home') {
		p1content = d.createTextNode('Byrne, Cardenas & Aris is a mid-sized litigation and business transactions law firm.  It is easy for a large firm to call itself a "full-service" firm, but it is difficult to obtain personal interaction and meaningful professional relationships within such a setting.  Our unique knowledge, insight, and personal service distinguish us from these larger firms.');
		p2content = d.createTextNode('Most of our attorneys started with or practiced at large firms and benefited from the training and expertise found in a sectionalized full-service firm.  Drawn to the opportunity to work with clients where personal relationships and first-hand knowledge of the needs and expectations of clients is the norm, the attorneys at Byrne, Cardenas & Aris work together, collectively sharing and discussing their clients concerns with the other professionals in the firm.');
		p3content = d.createTextNode('We believe that litigation and business transactions are two of the most important issues faced by individuals as well as small to mid-sized companies.  Our commitment to our clients is to individually and collectively serve the continuously changing needs and expectations of our clients with respect to litigation and business transactions.  We understand the constant demand to be competitive in quality, price, delivery and technical service.  Our goal is to provide legal solutions to our clients\' problems and help them ascertain and achieve their maximum return in the market place.  We seek partnership relationships with those individuals and firms who seek opportunities to utilize our resources to help them reach their goals.');
		img1.src = insetImgPath + topic + '1.jpg';
		img2.src = insetImgPath + topic + '2.jpg';
	} else if (topic == 'attorneys') {
		h4.appendChild(d.createTextNode('Our Attorneys'));
		var attorneys = new Array();
		attorneys = [['a1','Chuck Aris','ca'],['a4','Joe Byrne','jb'],['a6','Lana Byrne','lb'],['a2','Gregory Allen Cardenas','gc'],['a3','John Dunlap','jd'],['a7','Laurel Engelmann','le'],['a8','Scott MacLaren','sm'],['a9','Shannon Smitherman','ss'],['a5','Janice Wolff','jw']];
		p1content = d.createTextNode('The attorneys at Byrne, Cardenas & Aris, have earned the respect of their peers.  The firm has received the highest rating under the Martindale-Hubbell\'s Peer Review Rating, indicating that the firm has reached the height of professional excellence, skill and integrity.  Similarly, many of the partners and senior associates also enjoy the "AV Individual" rating from Martindale-Hubbell.');
		p2content = d.createElement('div');
		var table = d.createElement('table');
		var tr = d.createElement('tr');
		var td1 = d.createElement('td');
		td1.style.width = '210px';
		var td2 = d.createElement('td');
		td2.style.width = '210px';
		var td3 = d.createElement('td');
		var a1, a2, a3, a4, a5, a6, a7, a8, a9;
		for (var k = 0; k < attorneys.length; k++) {
			attorneys[k][0] = d.createElement('a');
			attorneys[k][0].href = 'attorneys/' + attorneys[k][2] + '/';
			var thumb = d.createElement('img');
			thumb.src = 'img/attorneys/thumb_' + attorneys[k][2] + '.jpg';
			thumb.style.marginRight = '4px';
			attorneys[k][0].appendChild(thumb);
			attorneys[k][0].appendChild(d.createTextNode(attorneys[k][1]));
			if (k > -1 && k < 3) {
				td1.appendChild(attorneys[k][0]);
				td1.appendChild(d.createElement('br'));
			} else if (k > 2 && k < 6) {
				td2.appendChild(attorneys[k][0]);
				td2.appendChild(d.createElement('br'));
			} else {
				td3.appendChild(attorneys[k][0]);
				td3.appendChild(d.createElement('br'));
			}
			tr.appendChild(td1);
			tr.appendChild(td2);
			tr.appendChild(td3);
			table.appendChild(tr);
			p2content.appendChild(table);
		}
	} else if (topic == 'practices') {
		h4.appendChild(d.createTextNode('Our Areas of Practice'));
		var practices = new Array();
		practices = [['prac1','Insurance Defense','insurance'],['prac2','Healthcare','healthcare'],['prac3','Commercial Litigation','litigation'],['prac4','Construction Law','construction'],['prac5','Employment Practice','employment'],['prac6','Excess and Umbrella Coverage','coverage']];
		p1content = d.createElement('div');
		var prac1, prac2, prac3, prac4, prac5, prac6;
		for (var l = 0; l < practices.length; l++) {
			practices[l][0] = d.createElement('a');
			practices[l][0].href = 'practices/' + practices[l][2] + '/';
			practices[l][0].appendChild(d.createTextNode(practices[l][1]));
			p1content.appendChild(practices[l][0]);
			p1content.appendChild(d.createElement('br'));
		}
		img1.src = insetImgPath + topic + '1.jpg';
		img1.style.position = 'relative';
		img1.style.top = '-20px';
	} else if (topic == 'about') {
		h4.appendChild(d.createTextNode('Byrne, Cardenas & Aris, LLP'));
		subhead = d.createTextNode('Attorneys & Counselors');
		p1content = d.createTextNode('Large firm expertise with a personal approach to provide transactional, compliance, risk management and litigation solutions for professionals and businesses.');
		img1.src = insetImgPath + topic + '1.jpg';
		p2.appendChild(img1);
		var b2 = d.createElement('b');
		b2.appendChild(d.createTextNode('Litigation'));
		p2.appendChild(b2);
		var ul2 = d.createElement('ul');
		var li21 = d.createElement('li');
		li21.appendChild(d.createTextNode('Construction law'));
		var li22 = d.createElement('li');
		li22.appendChild(d.createTextNode('Employment law and human resources practices'));
		var li23 = d.createElement('li');
		li23.appendChild(d.createTextNode('Insurance coverage'));
		var li24 = d.createElement('li');
		li24.appendChild(d.createTextNode('Business torts'));
		var li25 = d.createElement('li');
		li25.appendChild(d.createTextNode('Catastrophic injury'));
		var li26 = d.createElement('li');
		li26.appendChild(d.createTextNode('Commercial landlord/tenant disputes'));
		var li27 = d.createElement('li');
		li27.appendChild(d.createTextNode('Oil and gas'));
		var li28 = d.createElement('li');
		li28.appendChild(d.createTextNode('Professional malpractice'));
		ul2.appendChild(li21);
		ul2.appendChild(li22);
		ul2.appendChild(li23);
		ul2.appendChild(li24);
		ul2.appendChild(li25);
		ul2.appendChild(li26);
		p2.appendChild(ul2);
		
		p3.style.clear = 'both';
		img2.src = insetImgPath + topic + '2.jpg';
		p3.appendChild(img2);
		var b1 = d.createElement('b');
		b1.appendChild(d.createTextNode('Transactions'));
		p3.appendChild(b1);
		var ul1 = d.createElement('ul');
		ul1.className = 'imgL';
		var li1 = d.createElement('li');
		li1.appendChild(d.createTextNode('Structuring joint ventures between hospitals and physicians'));
		var li2 = d.createElement('li');
		li2.appendChild(d.createTextNode('Physician group practice governance, and transactions'));
		var li3 = d.createElement('li');
		li3.appendChild(d.createTextNode('Advising and consulting health care providers regarding the formation and organization of business entities'));
		var li4 = d.createElement('li');
		li4.appendChild(d.createTextNode('Mergers and acquisitions'));
		var li5 = d.createElement('li');
		li5.appendChild(d.createTextNode('Compliance program development and implementation'));
		var li6 = d.createElement('li');
		li6.appendChild(d.createTextNode('Civil and criminal fraud and abuse issues arising from federal and state anti-kickback and physical self referrals'));
		ul1.appendChild(li1);
		ul1.appendChild(li2);
		ul1.appendChild(li3);
		ul1.appendChild(li4);
		ul1.appendChild(li5);
		ul1.appendChild(li6);
		p3.appendChild(ul1);
	} else if (topic == 'firm') {
		h4.appendChild(d.createTextNode('General Firm Information'));
		p1content = d.createTextNode('Companies facing lawsuits need a legal team with experience.  Experience in the courtroom as well as real world appreciation for both the financial and opportunity cost as well as the affects of major litigation on a company.');
		p2content = d.createTextNode('One of the most important things we do is spend time getting to know our clients and the history of their businesses.  Our goal is to move fast, understand the issues and quickly formulate a litigation strategy to help get you back to doing what made you successful in the first place.  If a case needs to be settled then the client needs to know that right away instead of coming to that decision only after incurring extensive attorney\'s fees.  If a case needs to be taken to trial then it needs to be prepared thoroughly and proactively with as little distraction to the companies\' principles and employees as possible.');
		img1.src = insetImgPath + topic + '1.jpg'; 
		
		} else if (topic == 'news') {
		/* ----- NEWS & EVENTS ----- */
		h4.appendChild(d.createTextNode('News & Events'));
		p1content = d.createTextNode('Byrne, Cardenas & Smitherman, LLP is pleased to announce that Joseph S. Benbenek III has joined the Firm as Of Counsel.');
		p2content = d.createTextNode('Joe Benbenek\'s practice is dedicated almost exclusively to the healthcare industry.  He has over twenty years of experience representing hospitals, physicians and other healthcare providers on a variety of matters including: corporate compliance; joint ventures and business transactions; medical staff relationships, peer review and credentialing matters; HIPAA and EMTALA matters; not-for-profit hospital issues; and regulatory matters concerning the Texas and Federal Anti-kickback Statutes and the Federal Stark Law.  Joe also has extensive "in-house" experience advising and counseling healthcare clients.  Prior to joining Byrne, Cardenas & Smitherman, Joe served as General Counsel for Baylor Health Care System in Dallas, Texas, and Regional General Counsel for CHRISTUS Health in Houston, Texas.  Joe\'s unique in-house experience has given him the ability to offer sound legal advice that can be practically implemented in even the most structured corporate environments.');
	} else if (topic == 'mission') {
		h4.appendChild(d.createTextNode('Our Mission'));
		p1content = d.createTextNode('To establish, develop and maintain a record of excellence with each individual client and to exceed their expectations by providing exceptional service and innovative solutions to legal problems, litigation, and business transactions.');
		img1.src = insetImgPath + topic + '1.jpg';
	} else if (topic == 'recruiting') {
		h4.appendChild(d.createTextNode('Commitments to Employees and Expectations'));
		p1content = d.createTextNode('We will strive to manage the firm with a commitment to excellence and provide equity in our compensation and benefits for employees.  Together, we shall ambitiously aim to provide a productive, pleasant and secure environment where people can learn and grow to their maximum potential.  Employees will have the training, tools, information and appropriate technology to serve our clients.  Innovation, commitment, competence and continuous improvement are expected and required by each of us if we are to be competitive in the legal market place.  We will employ only the highest-skilled and most responsible employees within our field to enable our clients to maximize their BCS experience.');
		img1.src = insetImgPath + topic + '1.jpg';
	} else if (topic == 'contactus') {
		h4.appendChild(d.createTextNode('Where We Are and How To Contact Us'));
		var printLink = d.createElement('a');
		printLink.className = 'print';
		printLink.href = 'javascript:printDirections()';
		printLink.appendChild(d.createTextNode('(click here to print)'));
		h4.appendChild(printLink);
		p1content = d.createElement('div');
		var b = d.createElement('b');
		b.appendChild(d.createTextNode('Byrne, Cardenas & Aris, LLP'));
		p1content.appendChild(b);
		p1content.appendChild(d.createElement('br'));
		p1content.appendChild(d.createTextNode('One Lincoln Centre'));
		p1content.appendChild(d.createElement('br'));
		p1content.appendChild(d.createTextNode('5400 LBJ Freeway, Suite 1325'));
		p1content.appendChild(d.createElement('br'));
		p1content.appendChild(d.createTextNode('Dallas, Texas 75240'));
		var table = d.createElement('table');
		var trPhone = d.createElement('tr');
		var trFax = d.createElement('tr');
		var trEmail = d.createElement('tr');
		var tdPhone = d.createElement('td');
		var tdPhoneNum = d.createElement('td');
		var tdFax = d.createElement('td');
		var tdFaxNum = d.createElement('td');
		var tdEmail = d.createElement('td');
		var tdEmailAdd = d.createElement('td');
		tdPhone.appendChild(d.createTextNode('Phone :'));
		tdPhoneNum.appendChild(d.createTextNode('972.371.5250'));
		tdFax.appendChild(d.createTextNode('Facsimile :'));
		tdFaxNum.appendChild(d.createTextNode('972.371.5270'));
		tdEmail.appendChild(d.createTextNode('Email :'));
		var email = d.createElement('a');
		email.href = 'mailto:contact@bcallp.net';
		email.appendChild(d.createTextNode('contact@bcallp.net'));
		tdEmailAdd.appendChild(email);
		trPhone.appendChild(tdPhone);
		trPhone.appendChild(tdPhoneNum);
		trFax.appendChild(tdFax);
		trFax.appendChild(tdFaxNum);
		trEmail.appendChild(tdEmail);
		trEmail.appendChild(tdEmailAdd);
		table.appendChild(trPhone);
		table.appendChild(trFax);
		table.appendChild(trEmail);
		p1content.appendChild(table);
		p2content = d.createElement('div');
		var b1 = d.createElement('b');
		var dir1 = d.createElement('a');
		dir1.href = 'http://maps.google.com/maps?f=d&hl=en&geocode=&saddr=dallas+fort+worth+international+airport&daddr=5400+LBJ+Freeway+Dallas,+Texas+75240&sll=32.876416,-96.803284&sspn=0.137537,0.233459&ie=UTF8&ll=32.906109,-96.954002&spn=0.137491,0.233459&z=12&om=1';
		dir1.appendChild(d.createTextNode('From Dallas/Fort Worth Int\'l Airport:'));
		b1.appendChild(dir1);
		p2content.appendChild(b1);
		p2content.appendChild(d.createElement('br'));
		p2content.appendChild(d.createTextNode('1.	Head north on International Pkwy North (Partial toll road - 5.5 mi)'));
		p2content.appendChild(d.createElement('br'));
		p2content.appendChild(d.createTextNode('2.	Take the exit onto I-635 E	(13.3 mi)'));
		p2content.appendChild(d.createElement('br'));
		p2content.appendChild(d.createTextNode('3.	Take exit 22D toward Dallas Pkwy (0.5 mi)'));
		p2content.appendChild(d.createElement('br'));
		p2content.appendChild(d.createTextNode('4.	Merge onto Lyndon B Johnson Fwy	(0.4 mi)'));
		p2content.appendChild(d.createElement('br'));
		p2content.appendChild(d.createElement('br'));
		var b2 = d.createElement('b');
		var dir2 = d.createElement('a');
		dir2.href = 'http://maps.google.com/maps?f=d&hl=en&geocode=&saddr=dallas+love+field&daddr=5400+LBJ+Freeway+Dallas,+Texas+75240&sll=32.868053,-96.905594&sspn=0.275099,0.466919&ie=UTF8&ll=32.876416,-96.803284&spn=0.137537,0.233459&z=12&om=1';
		dir2.appendChild(d.createTextNode('From Dallas Love Field Airport:'));
		b2.appendChild(dir2);
		p2content.appendChild(b2);
		p2content.appendChild(d.createElement('br'));
		p2content.appendChild(d.createTextNode('1. Head west on Cedar Springs Rd toward Aviation Pl (1.1 mi)'));
		p2content.appendChild(d.createElement('br'));
		p2content.appendChild(d.createTextNode('2. Turn left at W Mockingbird Ln (0.3 mi)'));
		p2content.appendChild(d.createElement('br'));
		p2content.appendChild(d.createTextNode('3. Slight right to stay on W Mockingbird Ln (signs for Mockingbird/Lemmon S) (1.2 mi)'));
		p2content.appendChild(d.createElement('br'));
		p2content.appendChild(d.createTextNode('4. Turn left to merge onto Dallas North Tollway North (Partial toll road - 5.9 mi)'));
		p2content.appendChild(d.createElement('br'));
		p2content.appendChild(d.createTextNode('5. Take the exit toward Galleria Rd/Alpha Rd (0.2 mi)'));
		p2content.appendChild(d.createElement('br'));
		p2content.appendChild(d.createTextNode('6. Merge onto Dallas Pkwy (0.1 mi)'));
		p2content.appendChild(d.createElement('br'));
		p2content.appendChild(d.createTextNode('7. Turn right at Lyndon B Johnson Fwy (0.2 mi)'));
		p2content.appendChild(d.createElement('br'));
		p2content.appendChild(d.createElement('br'));
		p1link = d.createElement('a');
		p1link.href = 'http://maps.google.com/maps?f=q&hl=en&geocode=&q=5400+LBJ+Freeway+Dallas,+Texas+75240&sll=32.926068,-96.816094&sspn=0.008591,0.014591&ie=UTF8&ll=32.868053,-96.905594&spn=0.275099,0.466919&z=11&om=1';
		var mapImg = d.createElement('img');
		mapImg.src = insetImgPath + topic + '1.jpg';
		mapImg.style.float = 'right';
		p1link.appendChild(mapImg);
		p2content.appendChild(p1link);
		img1.src = insetImgPath + topic + '.jpg';
	}
	
	newInfo.appendChild(h4);
	if (subhead) {
		newInfo.appendChild(subhead);
	}
	if (topic == 'about') {
		p1.appendChild(p1content);
		newInfo.appendChild(p1);
		newInfo.appendChild(p2);
		newInfo.appendChild(p3);
	} else {
		if (img1.src) {
			newInfo.appendChild(img1);
		}
		if (p1content) {
			p1.appendChild(p1content);
			newInfo.appendChild(p1);
		}
		if (p2content) {
			p2.appendChild(p2content);
			newInfo.appendChild(p2);
		}
		if (img2.src) {
			newInfo.appendChild(img2);
		}
		if (p3content) {
			p3.appendChild(p3content);
			newInfo.appendChild(p3);
		}
		if (p4content) {
			p4.appendChild(p4content);
			newInfo.appendChild(p4);
		}
		if (p5content) {
			p5.appendChild(p5content);
			newInfo.appendChild(p5);
		}
	}
	
	d.getElementById('header').style.backgroundImage = 'url(' + bgImgPath + topic + '.jpg)';
	d.getElementById('content').replaceChild(newInfo, d.getElementById('information'));		
}

function printDirections() {
	window.open('print.html','directions','width=750,height=850,scrollbars=yes,resizable=yes');
}