var questionNum = 0;

function mouseOver(id) {
	clearAllQMenu();
	document.getElementById(id + "_off").style.display = "none";	
	document.getElementById(id + "_on").style.display = "block";
}

function mouseOut(id) {
	document.getElementById(id + "_on").style.display = "none";	
	document.getElementById(id + "_off").style.display = "block";
}

function clearAllQMenu() {
	
	if (document.getElementById("ln_rhonda_on")) {
		document.getElementById("ln_rhonda_on").style.display = "none";	
		document.getElementById("ln_rhonda_off").style.display = "block";
	}
	
	if (document.getElementById("ln_brendan_on")) {
		document.getElementById("ln_brendan_on").style.display = "none";	
		document.getElementById("ln_brendan_off").style.display = "block";	
	}
	
	if (document.getElementById("ln_victor_on")) {
		document.getElementById("ln_victor_on").style.display = "none";			
		document.getElementById("ln_victor_off").style.display = "block";		
	}
}

function addQuestion() {

	questionNum++;
	var id = "Q" + questionNum;

	var questions = document.getElementById("added_questions").innerHTML;
		questions = questions + '<li id="' + id + '">' + document.getElementById("txtQuestion").value + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img class="q_delete_button" src="/isentress/consumer/images/questions/btn_delete.gif" onclick="deleteQuestion(\'' + id +'\');" /></li>';
	document.getElementById("added_questions").innerHTML = questions;
	
}

function ToPrint()
{
  var css = "<link rel=\"stylesheet\" href=\"/isentress/consumer/css/print.css\" media=\"all\" type=\"text/css\" />";
  var logo = document.getElementById("logo").innerHTML;
  var img =  document.getElementById("img_col_print").innerHTML;
  var q =  document.getElementById("print_questions").innerHTML;
  var extra = document.getElementById("footer_out_img").innerHTML;
  
  var html = css + '<div>';
  html = html + '<div style="float: left; width: 200px; text-align: center;">' + logo + '<br /><br /><br /><br />' + img + '</div>';
  html = html + '<div style="float: left; width: 300px; padding-top: 20px; padding-left: 30px;">';
  	html = html + '<img src="/isentress/consumer/images/questions/hl_important_questions.gif" />';
	html = html + '<br /><br />' + q;
  html = html + '</div>';
  html = html + '<div style="clear:both; float: none;"></div>';
  html = html + '<br /><div id="footer_out_img">' + extra + '</div>';
  html = html + '</div>';
 
  var WinPrint =  window.open('','','left=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
  WinPrint.document.write(html);  
  WinPrint.document.close();
  WinPrint.focus();
  WinPrint.print();
  WinPrint.close();
  return false;
}

function ToPrint2()
{
	
  var css = "<link rel=\"stylesheet\" href=\"/isentress/consumer/css/print.css\" media=\"all\" type=\"text/css\" />";
  var logo = document.getElementById("logo").innerHTML;
  var q = document.getElementById(currentListID + "_questions_div").innerHTML;
  var extra = document.getElementById("footer_out_img").innerHTML;
  
  var html = css + '<div>';
  html = html + '<div style="float: left; width: 200px; text-align: center;">' + logo + '</div>';
  html = html + '<div style="float: left; width: 300px; padding-top: 20px; padding-left: 30px;">';
  	html = html + '<img src="/isentress/consumer/images/questions/hl_important_questions.gif" />';
	html = html + '<br /><br />' + q;
  html = html + '</div>';
  html = html + '<div style="clear:both; float: none;"></div>';
  html = html + '<br /><div id="footer_out_img">' + extra + '</div>';
  html = html + '</div>';
 
  var WinPrint =  window.open('','','left=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
  WinPrint.document.write(html);  
  WinPrint.document.close();
  WinPrint.focus();
  WinPrint.print();
  WinPrint.close();
  return false;

}

var currentListID = "";

function showQuestions(id)
{
	resetQuestions();
	document.getElementById(id + "_off").style.display = "none";	
	document.getElementById(id + "_on").style.display = "block";	
	//document.getElementById(id + "_questions").style.display = "block";
	  $('#' + id + "_questions").slideDown('slow', function() {
		// Animation complete.
	  });
	  
	  currentListID = id;
	
}

function hideQuestions(id) 
{
	//resetQuestions();
	document.getElementById(id + "_on").style.display = "none";	
	document.getElementById(id + "_off").style.display = "block";
	  $('#' + id + "_questions").slideUp('slow', function() {
		// Animation complete.
	  });
	currentListID = "";
}

function resetQuestions() {

	document.getElementById("q_naive_off").style.display = "block";	
	document.getElementById("q_naive_on").style.display = "none";	
	
	if (document.getElementById("q_naive_questions").style.display == "block") {
	  $('#q_naive_questions').slideUp('slow', function() {
		// Animation complete.
	  });
	}
	
	document.getElementById("q_first_off").style.display = "block";	
	document.getElementById("q_first_on").style.display = "none";	
	if (document.getElementById("q_first_questions").style.display == "block") {
	  $('#q_first_questions').slideUp('slow', function() {
		// Animation complete.
	  });
	}	
	
	document.getElementById("q_exp_off").style.display = "block";	
	document.getElementById("q_exp_on").style.display = "none";		
	if (document.getElementById("q_exp_questions").style.display == "block") {
	  $('#q_exp_questions').slideUp('slow', function() {
		// Animation complete.
	  });
	}		
	
	currentListID = "";

}

function addQuestionToList() {

	questionNum++;
	var id = "Q" + questionNum;

	if (currentListID != "") {
		var questions = document.getElementById(currentListID + "_list").innerHTML;
		questions = questions + '<li id="' + id + '">' + document.getElementById("txtQuestion").value + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img class="q_delete_button" src="/isentress/consumer/images/questions/btn_delete.gif" onclick="deleteQuestion(\'' + id +'\');" /></li>';
		document.getElementById(currentListID + "_list").innerHTML = questions;
	}	
	
}

function deleteQuestion(id) {
	
	$("#" + id).remove();
}
