<!-- HIDE FROM OTHERS

$(document).ready(function() {
   $("p.edit-announce-title").click(function(){ 
   		$(this).next("p").toggle(500);
   		$(".announce-form").slideUp();
   		});
   $("span.announce-status").click(function(){
   		$("p.edit-announce-title").stop();
   		});
   
   	$("p.edit-announce-title, .edit-button").hover(function(){
   		$(this).addClass("over");
   		$(this).removeClass("out");
 		},function(){
   		$(this).addClass("out");
   		$(this).removeClass("over");
 		});

   
   $(".edit-button").click(function(){
   		var curId = $(this).attr("id");
   		var idAry = new Array();
   		idAry = curId.split("-");
   		
   		if(idAry[1]){
   			$(".announce-form").slideUp();
   			$("#announce-form" + idAry[1]).slideDown(500);
   			$(this).parent().slideUp();
   			}
   		});
   	
   	
   	$("p.go a.addAnn").click(function(){
   		$("#new-announcement").toggle();
   		});
   
    
    $("#subSearch").click(function(){
   		
   		var searchValue = $("#searchVal").val();
   		searchValue = jQuery.trim(searchValue);
   		
   		$("div.dgYesListing").slideUp();
   		$("div.dgYesListing > div.hidebox").slideUp();
   		$("td.dispVal table tr td.yellow2 a strong.uName").parent("a").css("color","#330066");
   		$("td.dispVal table tr td.yellow2 a strong").css("background","none");
   		
   		$("div.dgYesListing").slideDown();
   		$("div.dgYesListing > div.hidebox:contains('" + searchValue + "')").slideDown();
   		
   		$("strong.uName:contains('" + searchValue + "')").css("background-color","#000").parent("a").css("color","#fff");

   		});
   		
   	$("td.dgItem > a").click(function(){
   		$(this).next("table.moreinfo").slideDown();
   		});
   
	});


function viewTableBox(curItem){	
	
	var sItem = document.getElementById(curItem);
	
	if(sItem.style.display == "none"){
		sItem.style.display = "block";
		}
	else{
		sItem.style.display = "none";
		}
   }

function sendDGupdate(userLectID,prevDG){
	alert('dgChange' + userLectID)
	var selectForm = document.getElementById('dgChange' + userLectID);
	var newDG = selectForm.new_dg.options[selectForm.new_dg.selectedIndex].value;
	
	$.post("dgUpdate.php", { ulID: userLectID, newVal: newDG, oldVal: prevDG } );
	
	var msgDiv = "#msg" + userLectID;
	$(msgDiv).show().html("Trainee has been moved. Reload browser to see changes...");
	
	}

function updatePage(retData){

	var dataAry = new Array();
	dataAry = retData.split(":");

	var updItem = "#attd" + dataAry[3] + dataAry[2];
	if(dataAry[0] == "UPDATED"){
		
		if((dataAry[1] == "yes") && (dataAry[2])) { 
			$(updItem + " > a.attd" + dataAry[3] + "_no").attr("href", "javascript:attd('" + dataAry[2] + "','no','" + dataAry[3] + "');"); 
			$(updItem + " > a.attd" + dataAry[3] + "_no").text("Y").addClass("attd" + dataAry[3] + "_yes").removeClass("attd" + dataAry[3] + "_no");
			}
		else if(dataAry[1] == "no") {
			$(updItem + " > a.attd" + dataAry[3] + "_yes").attr("href", "javascript:attd('" + dataAry[2] + "','yes','" + dataAry[3] + "');");
			$(updItem + " > a.attd" + dataAry[3] + "_yes").text("N").addClass("attd" + dataAry[3] + "_no").removeClass("attd" + dataAry[3] + "_yes");
			}
		}
	
	else if(dataAry[0] == "NOT-UPDATED"){
		$(updItem).append(" <strong>>> NO CHANGE MADE!</strong>"); 
		}
	
	}


function attd(userLectID,setVal,tType){
	
	if((userLectID != "") && (setVal != "")){
		$.get("attd.php", { lID: userLectID, set: setVal, tType: tType },function(data){ updatePage(data); });
		}
	else{
		alert("No user lecture values available: Cannot Update this record!");
		}
	
	}
	


// -->
