
function SetInputText(who, theText) {
	who.value = theText;
}

function SetSearchOut(who) {
	who.value == '' ? who.value = "Enter Search..." : null;
}


/* Questions And Answers + Feedback */

function ShowHover(who, htitle) {
	var elemID = who.parentNode.id;
	var selectedID = elemID.substring(4,elemID.length);
	if(selectedID != CurrentQuestion) {
		var QtagElem = document.getElementById('QA_t' + selectedID);
		var XtagElem = document.getElementById('QA_x' + selectedID);
		var DateElem = document.getElementById('QA_d' + selectedID);
		
		who.style.color = '#ffa000';
		who.style.textDecoration = 'underline';
		
		if(QtagElem) {
			QtagElem.style.color = '#ffa000';
			QtagElem.style.textDecoration = 'none';
		}
		
		XtagElem.style.color = '#ffa000';
		XtagElem.style.textDecoration = 'none';
		XtagElem.style.background = "url('images/WHRP_PlusIcon2.gif') no-repeat right 2px";
		
		DateElem.style.color = '#ffa000';
		DateElem.style.textDecoration = 'none';
		
		who.style.cursor = 'pointer';
		who.title = htitle;
	} else {
		who.title = "";
		HideHover(who);
	}
}

function HideHover(who) {
	var elemID = who.parentNode.id;
	var selectedID = elemID.substring(4,elemID.length);
	var QtagElem = document.getElementById('QA_t' + selectedID);
	var XtagElem = document.getElementById('QA_x' + selectedID);
	var DateElem = document.getElementById('QA_d' + selectedID);
	
	who.style.color = '#000000';
	who.style.textDecoration = 'none';
	
	if(QtagElem) {
		QtagElem.style.color = '#798289';
		QtagElem.style.textDecoration = 'none';
	}
	
	XtagElem.style.color = '#798289';
	XtagElem.style.textDecoration = 'none';
	XtagElem.style.background = "url('images/WHRP_PlusIcon1.gif') no-repeat right 2px";
	
	DateElem.style.color = '#798289';
	DateElem.style.textDecoration = 'none';
	
	who.style.cursor = 'default';
}

function ShowAnswer(who) {
	HideHover(who);
	var elemID = who.parentNode.id;
	var selectedID = elemID.substring(4,elemID.length);
	if(selectedID != CurrentQuestion) {
		CurrentQuestion = selectedID;
		for(var i=1;i<= QuestionsLength;i++) {
			var Aelem = document.getElementById('QA_a' + i);
			var Xelem = document.getElementById('QA_x' + i);
			if(i != selectedID) {
				Aelem.style.display = 'none';
				Xelem.style.visibility = 'visible';
			} else {
				Aelem.style.display = 'block';
				Xelem.style.visibility = 'hidden';
			}
		}
	}
}
