/* warranty prompt */

addLoadEvent(displayEmergencyWarning);

function displayEmergencyWarning()
{// begin displayEmergencyWarning

	var message = "This form is for Non-Emergency Warranty Service only. For Emergency Warranty Service, as specified in your Homeowner\'s manual, please call the office at (513) 745-9019 and follow the necessary prompts.";
	var qmessage = "My Warranty Request is for Non-Emergency Service";

	var warranty_form = document.getElementById("warranty-form");
	warranty_form.style.visibility = "hidden";

	var popup = document.createElement("div");
	popup.setAttribute("id", "warranty-popup");
	var txt = document.createTextNode(message);
	var question = document.createElement("p");
	question.appendChild(document.createTextNode(qmessage));
	var notice = document.createElement("div");
	notice.setAttribute("class", "notice");
	notice.setAttribute("id", "notice");
	var heading = document.createElement("h1");
	heading.appendChild(document.createTextNode("Attention"));
	notice.appendChild(heading);
	notice.appendChild(txt);
	notice.appendChild(question);
	popup.appendChild(notice);
	
	
	var button_no = document.createElement("button")
	button_no.appendChild(document.createTextNode("No"));
	var button = document.createElement("button")
	button.appendChild(document.createTextNode("Yes"));
	if(!button.addEventListener)
	{// begin IE
		button.attachEvent("onclick", closePopup);
		button_no.attachEvent("onclick", emergencyPopup);
	}// end IE
	else
	{// begin standard
		button.addEventListener("click", closePopup, false);
		button_no.addEventListener("click", emergencyPopup, false);
	}// end standard
	button.setAttribute("id", "proceed");
	button.setAttribute("tabindex", "2");
	notice.appendChild(button);

	button_no.setAttribute("id", "no");
	button_no.setAttribute("tabindex", "1");
	notice.appendChild(button_no);

	var body = document.getElementsByTagName("body")[0];
	body.appendChild(popup);

	popup.style.height = body.scrollHeight+"px";
}// end displayEmergencyWarning

function closePopup(e)
{// begin closePopup
	document.getElementById("warranty-form").style.visibility = "visible";
	document.getElementById("warranty-popup").style.display = "none";
	document.getElementById("first_name").focus();
}// end closePopup

function emergencyPopup(e)
{// begin closePopup
	document.getElementById("notice").innerHTML = "<h1>Stop!</h1><p>We\'re sorry, this form is only for Non-Emergency Service. For Emergency Warranty Service, as specified in your Homeowner\'s Manual, please call (513) 745-9019 and follow the Emergency Service prompts.</p>";
}// end closePopup
