﻿$(document).ready(function() {
	ListToggle(".definitionList dt");	//FacRepFAQs.aspx
	ListToggle(".instrHeader"); //Application/ApplicationInstructions.aspx
	
	$("#btnShowAll").click(function() {
	    $(".instrBody").slideDown();
	});
	
	$("#btnHideAll").click(function() {
	    $(".instrBody").slideUp();
	});
	
	$("#popTransferCredits").click(function() {
	    var transferCredits = window.open('/Application/Popups/TransferCredits.aspx','transferCredits','width=600px, height=300px, resizable');
	});
	$("#popOtherTribalVerif").click(function() {
	    var otherTribalVerif = window.open('/Application/Popups/OtherTribalVerification.aspx', 'otherTribalVerif','width=600px, height=300px, resizable');
	});
	$("#popPermanentResidence").click(function() {
	    var permanentResidence = window.open('/Application/Popups/Popup.aspx?id=permanentresidence', 'permanentResidence', 'width=500px, height=200px, resizable');
	}).css("cursor", "pointer");
	$("#popPermanentResident").click(function() {
	    var permanentResident = window.open('/Application/Popups/Popup.aspx?id=permanentresident', 'permanentResident', 'width=500px, height=200px, resizable');
	}).css("cursor", "pointer");
	$("#popGradeLevel").click(function() {
	    var gradeLevel = window.open('/Application/Popups/Popup.aspx?id=gradelevel', 'gradeLevel', 'width=500px, height=200px, resizable');
	}).css("cursor", "pointer");
	$("#popHCTPP").click(function() {
	    var hcTPP = window.open('/Application/Popups/Popup.aspx?id=hctpp', 'hcTPP', 'width=500px, height=200px, resizable');
	}).css("cursor", "pointer");
	$("#archivedComments").css("display", "none");
	$("#aCommentHistory").click(function() {
	    if ($("#aCommentHistory").val() == "Show Comment History") {
	        $("#aCommentHistory").val("Hide Comment History");
	        $("#archivedComments").css("display", "block");
	    }
	    else {
	        $("#aCommentHistory").val("Show Comment History");
            $("#archivedComments").css("display", "none");
	    }
	});
});

function ListToggle(Selector) {
	$(Selector).each(function() {
		//$(this).attr("class","collapsed");
		$(this).click(function() {
			//if ($(this).attr("class") == "collapsed") {
			//	$(this).attr("class","expanded");
			//}
			//else {
			//	$(this).attr("class","collapsed");
			//}
			$(this).next().slideToggle("fast");
		});
	}).css("text-decoration", "underline").css("color", "#007CC3").css("cursor", "pointer").css("margin-bottom", "5px").next().hide();
}

function openNominationPDF(NomineePK) {
	window.open("/pdfgen/NomForms/" + NomineePK + ".pdf", "PDFWindow");
}

function openChecklistPDF(NomineePK) {
	window.open("/pdfgen/Checklists/" + NomineePK + ".pdf", "PDFWindow");
}

function ConfirmDeleteDocument() {
    return confirm("Are you sure you want to delete this document?");
}