// JavaScript Document


function hideHelp(){
	document.getElementById("show-button").className = "shown";
	document.getElementById("hide-button").className = "hidden";
	document.getElementById("flash-column").style.width = "89%";
	document.getElementById("text-column").style.width = "5%";
	document.getElementById("text-box").className = "hidden";
}
function showHelp(){
	document.getElementById("show-button").className = "hidden";
	document.getElementById("hide-button").className = "shown";
	document.getElementById("flash-column").style.width = "60%";
	document.getElementById("text-column").style.width = "33%";
	document.getElementById("text-box").className = "shown";
}

function openChat(url)
{
	newwindow=window.open('/division/library/help/chat-window.html','chat','height=420,width=470,scrollbars=yes,resizable=yes');
	if (window.focus) {newwindow.focus()}
}






function copyText(message) {
	if(document.getElementById(message).innerHTML.split("(insert name)")[1] != undefined){
		alert("Please enter your name.")
	} else {
		document.getElementById(message).select();
		if(navigator.appName == "Microsoft Internet Explorer"){
			therange=document.getElementById(message).createTextRange();
			therange.execCommand("Copy");
		}
	}
}

function highlightText(message){
	document.getElementById(message).select();
}

function loadMessages(){

	var userName = location.search.split("=")[1];
	if(userName == undefined){
		var name = "(insert name)";
		document.getElementById("username").value = "";
	} else {
		var name = userName;
		document.getElementById("username").value = name;
	}
	document.getElementById("welcomeMessage").innerHTML = "Hi, my name's " + name + ". How may I help you?";
	document.getElementById("busyMessage").innerHTML = "Hi, my name's " + name + ". I am currently busy helping someone else. You are welcome to wait, but if you'd  prefer, try us again in a few minutes.";
	document.getElementById("endMessage").innerHTML = "Does this answer your question? Is there anything else I can help with?";
	document.getElementById("phoneMessage").innerHTML = "If you'd like, we can do a step-by-step over the phone";
	document.getElementById("URLMessage").innerHTML = "Copy and paste the following URL into your browser and then hit ENTER:\n\nIf the messenger window is in the way you can move it by clicking on the title bar, holding down the left mouse button and dragging the messenger window to reposition it.";
}

function verify(){
	if(document.getElementById("username").value == ""){
		alert("Please enter your name.")
		return false;
	} else {
		return true;
	}
}

