// Print JS for Life Fitness Hammer Strength Clinics Microsite


// container div for Date, Cost, Location, Clinic Directory 
var mainDiv = document.getElementById('printClinicInfo');

// date div
var dateDiv = document.createElement("div");
dateDiv.setAttribute("class", "date");
dateDiv.innerHTML = "<strong>Date</strong>" + document.getElementsByClassName('clinicDate')[0].getElementsByTagName('strong')[0].innerHTML;
mainDiv.appendChild(dateDiv);

// cost div
var costDiv = document.createElement("div");
costDiv.setAttribute("class", "cost");
costDiv.innerHTML = document.getElementsByClassName('clinicCity')[0].getElementsByTagName('p')[2].innerHTML;
mainDiv.appendChild(costDiv);

// location div
var locationDiv = document.createElement("div");
locationDiv.setAttribute("class", "location");
locationDiv.innerHTML = document.getElementsByClassName('clinicCity')[0].getElementsByTagName('p')[1].innerHTML;
mainDiv.appendChild(locationDiv);	

// clinic director div
var directorDiv = document.createElement("div");
directorDiv.setAttribute("class", "director");
directorDiv.innerHTML = document.getElementsByClassName('clinicCity')[0].getElementsByTagName('p')[3].innerHTML;
mainDiv.appendChild(directorDiv);

// clinic site director div
var siteDiv = document.createElement("div");
siteDiv.setAttribute("class", "site");
siteDiv.innerHTML = document.getElementsByClassName('clinicCity')[0].getElementsByTagName('p')[4].innerHTML;
mainDiv.appendChild(siteDiv);

// clearing div (to remove floats)
var clearDiv = document.createElement("div");
clearDiv.setAttribute("class", "clear");
mainDiv.appendChild(clearDiv);


// container div for speaker bios
var bioDiv = document.getElementById('printSpeakerBios');

var bioTitle = document.createElement("span");
bioTitle.setAttribute("class", "h2");
bioTitle.innerHTML = "Speakers";
bioDiv.appendChild(bioTitle);

var bioRule = document.createElement("div");
bioRule.setAttribute("class", "day_rule");
bioDiv.appendChild(bioRule);

var bios = document.getElementsByClassName('speaker');
var biosLength = bios.length;
for (x=0; x<biosLength; x++) {
	var speakerDiv = document.createElement("div");
	if (x==1) {
		speakerDiv.setAttribute("class", "speaker page-break");
	} else {
		speakerDiv.setAttribute("class", "speaker");
	}
	speakerDiv.innerHTML = bios[x].innerHTML;
	bioDiv.appendChild(speakerDiv);
	
	var speakerRuleDiv = document.createElement("div");
	speakerRuleDiv.setAttribute("class", "speaker_rule");
	bioDiv.appendChild(speakerRuleDiv);
}

// container div for local accommodations
var localDiv = document.getElementById('printLocalAccommodations');

var localTitle = document.createElement("span");
localTitle.setAttribute("class", "h3 page-break");
localTitle.innerHTML = "Local Accommodations";
localDiv.appendChild(localTitle);

var hotels = document.getElementsByClassName('clinicLocalInfo')[0].getElementsByTagName('p');
var hotelsLength = hotels.length;
for (x=0; x<hotelsLength; x++) {
	var hotelDiv = document.createElement("div");
	hotelDiv.setAttribute("class", "hotel");
	hotelDiv.innerHTML = hotels[x].innerHTML;
	localDiv.appendChild(hotelDiv);
}
