var s5_custom_7_original_position = 0;
function s5_custom_7_open() {
	s5_custom_7_original_position = window.pageYOffset;
	window.scrollTo(0,0);
	document.getElementById('s5_custom_7_overlay').className = "s5_custom_7_open";
	if (document.getElementById("s5_drop_down_container")) { 
		document.getElementById("s5_drop_down_container").style.display = "none"; 
	}
	if (document.getElementById("s5_quick_contact_wrap") && document.getElementById("s5_quick_contact_controller")) {
		s5_custom_7_copy_contents_open();
		s5_custom_7_remove_temp_popup_ids();
		s5_custom_7_apply_temp_controller_ids();
	}
}
function s5_custom_7_close() {
	window.scrollTo(0,s5_custom_7_original_position);
	document.getElementById('s5_custom_7_overlay').className = "s5_custom_7_close";
	if (document.getElementById("s5_drop_down_container")) { 
		document.getElementById("s5_drop_down_container").style.display = "block"; 
	}
	if (document.getElementById("s5_quick_contact_wrap") && document.getElementById("s5_quick_contact_controller")) {
		s5_custom_7_copy_contents_close();
		s5_custom_7_apply_temp_popup_ids();
		s5_custom_7_remove_temp_controller_ids();
	}
}

function s5_custom_7_apply_temp_popup_ids() {
	var s5_quick_contact_temp_popup_ids = document.getElementById("s5_quick_contact_wrap").getElementsByTagName("SPAN");
	for (var s5_quick_contact_temp_popup_ids_y=0; s5_quick_contact_temp_popup_ids_y<s5_quick_contact_temp_popup_ids.length; s5_quick_contact_temp_popup_ids_y++) {
		if (s5_quick_contact_temp_popup_ids[s5_quick_contact_temp_popup_ids_y].id.substr(s5_quick_contact_temp_popup_ids[s5_quick_contact_temp_popup_ids_y].id.length - 5) == "_span") {
			s5_quick_contact_temp_popup_ids[s5_quick_contact_temp_popup_ids_y].childNodes[1].id = s5_quick_contact_temp_popup_ids[s5_quick_contact_temp_popup_ids_y].childNodes[1].id + "_temp";
		}
	}
}
function s5_custom_7_remove_temp_popup_ids() {
	var s5_quick_contact_remove_temp_popup_ids = document.getElementById("s5_quick_contact_wrap").getElementsByTagName("SPAN");
	for (var s5_quick_contact_remove_temp_popup_ids_y=0; s5_quick_contact_remove_temp_popup_ids_y<s5_quick_contact_remove_temp_popup_ids.length; s5_quick_contact_remove_temp_popup_ids_y++) {
		if (s5_quick_contact_remove_temp_popup_ids[s5_quick_contact_remove_temp_popup_ids_y].id.substr(s5_quick_contact_remove_temp_popup_ids[s5_quick_contact_remove_temp_popup_ids_y].id.length - 5) == "_span") {
			var s5_quick_contact_remove_temp_popup_ids_remove_temp = s5_quick_contact_remove_temp_popup_ids[s5_quick_contact_remove_temp_popup_ids_y].childNodes[1].id;
			s5_quick_contact_remove_temp_popup_ids_remove_temp = s5_quick_contact_remove_temp_popup_ids_remove_temp.substring(0, s5_quick_contact_remove_temp_popup_ids_remove_temp.length - 5);
			s5_quick_contact_remove_temp_popup_ids[s5_quick_contact_remove_temp_popup_ids_y].childNodes[1].id = s5_quick_contact_remove_temp_popup_ids_remove_temp;
		}
	}
}

function s5_custom_7_apply_temp_controller_ids() {
	var s5_quick_contact_temp_controller_ids = document.getElementById("s5_quick_contact_controller").getElementsByTagName("SPAN");
	for (var s5_quick_contact_temp_controller_ids_y=0; s5_quick_contact_temp_controller_ids_y<s5_quick_contact_temp_controller_ids.length; s5_quick_contact_temp_controller_ids_y++) {
		s5_quick_contact_temp_controller_ids[s5_quick_contact_temp_controller_ids_y].childNodes[1].id = s5_quick_contact_temp_controller_ids[s5_quick_contact_temp_controller_ids_y].childNodes[1].id + "_temp";
	}
}
function s5_custom_7_remove_temp_controller_ids() {
	var s5_quick_contact_remove_temp_controller_ids = document.getElementById("s5_quick_contact_controller").getElementsByTagName("SPAN");
	for (var s5_quick_contact_remove_temp_controller_ids_y=0; s5_quick_contact_remove_temp_controller_ids_y<s5_quick_contact_remove_temp_controller_ids.length; s5_quick_contact_remove_temp_controller_ids_y++) {
		var s5_quick_contact_remove_temp_controller_ids_remove_temp = s5_quick_contact_remove_temp_controller_ids[s5_quick_contact_remove_temp_controller_ids_y].childNodes[1].id;
		s5_quick_contact_remove_temp_controller_ids_remove_temp = s5_quick_contact_remove_temp_controller_ids_remove_temp.substring(0, s5_quick_contact_remove_temp_controller_ids_remove_temp.length - 5);
		s5_quick_contact_remove_temp_controller_ids[s5_quick_contact_remove_temp_controller_ids_y].childNodes[1].id = s5_quick_contact_remove_temp_controller_ids_remove_temp;
	}
}

function s5_custom_7_copy_contents_open() {
	var s5_quick_contact_copy_controller_contents_open = document.getElementById("s5_quick_contact_controller").getElementsByTagName("SPAN");
	for (var s5_quick_contact_copy_controller_contents_open_y=0; s5_quick_contact_copy_controller_contents_open_y<s5_quick_contact_copy_controller_contents_open.length; s5_quick_contact_copy_controller_contents_open_y++) {
		var s5_quick_contact_copy_controller_contents_open_popup_id = s5_quick_contact_copy_controller_contents_open[s5_quick_contact_copy_controller_contents_open_y].childNodes[1].id + "_temp";
		document.getElementById(s5_quick_contact_copy_controller_contents_open_popup_id).value = s5_quick_contact_copy_controller_contents_open[s5_quick_contact_copy_controller_contents_open_y].childNodes[1].value;
	}
}

function s5_custom_7_copy_contents_close() {
	var s5_quick_contact_copy_controller_contents_close = document.getElementById("s5_quick_contact_controller").getElementsByTagName("SPAN");
	for (var s5_quick_contact_copy_controller_contents_close_y=0; s5_quick_contact_copy_controller_contents_close_y<s5_quick_contact_copy_controller_contents_close.length; s5_quick_contact_copy_controller_contents_close_y++) {
		var s5_quick_contact_copy_controller_contents_close_popup_id = s5_quick_contact_copy_controller_contents_close[s5_quick_contact_copy_controller_contents_close_y].childNodes[1].id;
		s5_quick_contact_copy_controller_contents_close_popup_id = s5_quick_contact_copy_controller_contents_close_popup_id.substring(0, s5_quick_contact_copy_controller_contents_close_popup_id.length - 5)
		s5_quick_contact_copy_controller_contents_close[s5_quick_contact_copy_controller_contents_close_y].childNodes[1].value = document.getElementById(s5_quick_contact_copy_controller_contents_close_popup_id).value;
	}
}

function s5_load_quick_contact_controller() {
	var s5_custom_7_pos_wrap_padding_top = 0;
	s5_custom_7_pos_wrap_padding_top = (window.innerHeight / 8);
	if (s5_custom_7_pos_wrap_padding_top < 120) {
		s5_custom_7_pos_wrap_padding_top = 120;
	}
	document.getElementById("s5_custom_7_pos_wrap").style.paddingTop = s5_custom_7_pos_wrap_padding_top + "px";
	var s5_quick_contact_fields_innerhtml = "";
	var s5_quick_contact_controller = document.getElementById("s5_quick_contact_wrap").getElementsByTagName("SPAN");
	var s5_quick_contact_controller_counter = 1;
	for (var s5_quick_contact_controller_y=0; s5_quick_contact_controller_y<s5_quick_contact_controller.length; s5_quick_contact_controller_y++) {
		if (s5_quick_contact_controller[s5_quick_contact_controller_y].id.substr(s5_quick_contact_controller[s5_quick_contact_controller_y].id.length - 5) == "_span") {
			if (s5_quick_contact_fields.indexOf("10,") >= 0 && s5_quick_contact_controller_counter == 10) {
				s5_quick_contact_fields_innerhtml = s5_quick_contact_fields_innerhtml + "<span class='" + s5_quick_contact_controller[s5_quick_contact_controller_y].className + "'>" + s5_quick_contact_controller[s5_quick_contact_controller_y].innerHTML + "</span>";
			}
			if (s5_quick_contact_fields.indexOf("9,") >= 0 && s5_quick_contact_controller_counter == 9) {
				s5_quick_contact_fields_innerhtml = s5_quick_contact_fields_innerhtml + "<span class='" + s5_quick_contact_controller[s5_quick_contact_controller_y].className + "'>" + s5_quick_contact_controller[s5_quick_contact_controller_y].innerHTML + "</span>";
			}
			if (s5_quick_contact_fields.indexOf("8,") >= 0 && s5_quick_contact_controller_counter == 8) {
				s5_quick_contact_fields_innerhtml = s5_quick_contact_fields_innerhtml + "<span class='" + s5_quick_contact_controller[s5_quick_contact_controller_y].className + "'>" + s5_quick_contact_controller[s5_quick_contact_controller_y].innerHTML + "</span>";
			}
			if (s5_quick_contact_fields.indexOf("7,") >= 0 && s5_quick_contact_controller_counter == 7) {
				s5_quick_contact_fields_innerhtml = s5_quick_contact_fields_innerhtml + "<span class='" + s5_quick_contact_controller[s5_quick_contact_controller_y].className + "'>" + s5_quick_contact_controller[s5_quick_contact_controller_y].innerHTML + "</span>";
			}
			if (s5_quick_contact_fields.indexOf("6,") >= 0 && s5_quick_contact_controller_counter == 6) {
				s5_quick_contact_fields_innerhtml = s5_quick_contact_fields_innerhtml + "<span class='" + s5_quick_contact_controller[s5_quick_contact_controller_y].className + "'>" + s5_quick_contact_controller[s5_quick_contact_controller_y].innerHTML + "</span>";
			}
			if (s5_quick_contact_fields.indexOf("5,") >= 0 && s5_quick_contact_controller_counter == 5) {
				s5_quick_contact_fields_innerhtml = s5_quick_contact_fields_innerhtml + "<span class='" + s5_quick_contact_controller[s5_quick_contact_controller_y].className + "'>" + s5_quick_contact_controller[s5_quick_contact_controller_y].innerHTML + "</span>";
			}
			if (s5_quick_contact_fields.indexOf("4,") >= 0 && s5_quick_contact_controller_counter == 4) {
				s5_quick_contact_fields_innerhtml = s5_quick_contact_fields_innerhtml + "<span class='" + s5_quick_contact_controller[s5_quick_contact_controller_y].className + "'>" + s5_quick_contact_controller[s5_quick_contact_controller_y].innerHTML + "</span>";
			}
			if (s5_quick_contact_fields.indexOf("3,") >= 0 && s5_quick_contact_controller_counter == 3) {
				s5_quick_contact_fields_innerhtml = s5_quick_contact_fields_innerhtml + "<span class='" + s5_quick_contact_controller[s5_quick_contact_controller_y].className + "'>" + s5_quick_contact_controller[s5_quick_contact_controller_y].innerHTML + "</span>";
			}
			if (s5_quick_contact_fields.indexOf("2,") >= 0 && s5_quick_contact_controller_counter == 2) {
				s5_quick_contact_fields_innerhtml = s5_quick_contact_fields_innerhtml + "<span class='" + s5_quick_contact_controller[s5_quick_contact_controller_y].className + "'>" + s5_quick_contact_controller[s5_quick_contact_controller_y].innerHTML + "</span>";
			}
			if (s5_quick_contact_fields.indexOf("1,") >= 0 && s5_quick_contact_controller_counter == 1) {
				s5_quick_contact_fields_innerhtml = s5_quick_contact_fields_innerhtml + "<span class='" + s5_quick_contact_controller[s5_quick_contact_controller_y].className + "'>" + s5_quick_contact_controller[s5_quick_contact_controller_y].innerHTML + "</span>";
			}
			s5_quick_contact_controller_counter = s5_quick_contact_controller_counter + 1;
		}
	}
	s5_custom_7_apply_temp_popup_ids();
	document.getElementById("s5_quick_contact_controller").innerHTML = s5_quick_contact_fields_innerhtml + document.getElementById("s5_quick_contact_controller").innerHTML;
	document.getElementById("s5_quick_contact_controller").style.display = "block";
	if (document.getElementById("s5_qc_field1box_temp") && document.getElementById("s5_qc_field1box_temp").parentNode.className.indexOf("qc_date") >= 0) {
		var s5_qc_picker1_temp = new Pikaday({ field: document.getElementById('s5_qc_field1box_temp') });
	}
	if (document.getElementById("s5_qc_field2box_temp") && document.getElementById("s5_qc_field2box_temp").parentNode.className.indexOf("qc_date") >= 0) {
		var s5_qc_picker2_temp = new Pikaday({ field: document.getElementById('s5_qc_field2box_temp') });
	}
	if (document.getElementById("s5_qc_field3box_temp") && document.getElementById("s5_qc_field3box_temp").parentNode.className.indexOf("qc_date") >= 0) {
		var s5_qc_picker2_temp = new Pikaday({ field: document.getElementById('s5_qc_field3box_temp') });
	}
	if (document.getElementById("s5_qc_field4box_temp") && document.getElementById("s5_qc_field4box_temp").parentNode.className.indexOf("qc_date") >= 0) {
		var s5_qc_picker2_temp = new Pikaday({ field: document.getElementById('s5_qc_field4box_temp') });
	}
	if (document.getElementById("s5_qc_field5box_temp") && document.getElementById("s5_qc_field5box_temp").parentNode.className.indexOf("qc_date") >= 0) {
		var s5_qc_picker2_temp = new Pikaday({ field: document.getElementById('s5_qc_field5box_temp') });
	}
	if (document.getElementById("s5_qc_field6box_temp") && document.getElementById("s5_qc_field6box_temp").parentNode.className.indexOf("qc_date") >= 0) {
		var s5_qc_picker2_temp = new Pikaday({ field: document.getElementById('s5_qc_field6box_temp') });
	}
	if (document.getElementById("s5_qc_field7box_temp") && document.getElementById("s5_qc_field7box_temp").parentNode.className.indexOf("qc_date") >= 0) {
		var s5_qc_picker2_temp = new Pikaday({ field: document.getElementById('s5_qc_field7box_temp') });
	}
	if (document.getElementById("s5_qc_field8box_temp") && document.getElementById("s5_qc_field8box_temp").parentNode.className.indexOf("qc_date") >= 0) {
		var s5_qc_picker2_temp = new Pikaday({ field: document.getElementById('s5_qc_field8box_temp') });
	}
	if (document.getElementById("s5_qc_field9box_temp") && document.getElementById("s5_qc_field9box_temp").parentNode.className.indexOf("qc_date") >= 0) {
		var s5_qc_picker2_temp = new Pikaday({ field: document.getElementById('s5_qc_field9box_temp') });
	}
	if (document.getElementById("s5_qc_field10box_temp") && document.getElementById("s5_qc_field10box_temp").parentNode.className.indexOf("qc_date") >= 0) {
		var s5_qc_picker2_temp = new Pikaday({ field: document.getElementById('s5_qc_field10box_temp') });
	}
}