function attachFile(item, id){
	window.open("index.php?do=attach&cat=index&gid="+item+"&id="+id, "Item","width=500,height=400,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);   
}
function openHelp(){
	window.open("index.php?do=help&cat=index", "Help","width=500,height=300,scrollbars,resizable=yes,status=no,left=150,top=150");     
		void(0);   
}
function insertSettings(){
	window.open("index.php?do=insertcss&cat=css", "CSS","width=550,height=600,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editSettings(id){
	window.open("index.php?do=editcss&cat=css&id="+id, "CSS","width=550,height=600,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function insertModule(){
	window.open("index.php?do=insertmodule&cat=menu", "Module","width=300,height=250,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);  
}
function editModule(id){
	window.open("index.php?do=editmodule&cat=menu&id="+id, "Module","width=300,height=250,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function orderModule(){
	window.open("index.php?do=ordermodule&cat=menu", "OrderModule","width=400,height=300,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function listMenu(mod){
	window.open("index.php?do=listmenu&cat=menu&mod="+mod, "ListMenu","width=500,height=450,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function insertMenu(mod){
	window.open("index.php?do=insertmenu&cat=menu&mod="+mod, "Menu","width=300,height=400,scrollbars,resizable=yes,status=no,left=150,top=150");     
		void(0);  
}
function editMenu(mod, id){
	window.open("index.php?do=editmenu&cat=menu&mod="+mod+"&id="+id, "Menu","width=300,height=400,scrollbars,resizable=yes,status=no,left=150,top=150");     
		void(0);    
}
function orderMenu(mod){
	window.open("index.php?do=ordermenu&cat=menu&mod="+mod, "OrderMenu","width=400,height=300,scrollbars,resizable=yes,status=no,left=150,top=150");     
		void(0);    
}
//-----------------------------------------------------------------------------------------News-----------------------------------------------------------------------------------
function insertNews(){
	window.open("index.php?do=insert&cat=news", "News","width=550,height=550,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editNews(id){
	window.open("index.php?do=edit&cat=news&id="+id,"News","width=550,height=550,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
//-----------------------------------------------------------------------------------------Newsletter-----------------------------------------------------------------------------------
function insertNewsletter(){
	window.open("index.php?do=insert&cat=newsletter", "News","width=500,height=500,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editNewsletter(id){
	window.open("index.php?do=edit&cat=newsletter&id="+id,"News","width=500,height=500,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
//-----------------------------------------------------------------------------------------Jobs-----------------------------------------------------------------------------------
function insertJob(){
	window.open("index.php?do=insert&cat=job", "Job","width=600,height=600,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editJob(id){
	window.open("index.php?do=edit&cat=job&id="+id,"Job","width=600,height=600,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
//-----------------------------------------------------------------------------------------Scholarship-----------------------------------------------------------------------------------
function insertScholar(){
	window.open("index.php?do=insert&cat=scholar", "Scholarship","width=600,height=600,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editScholar(id){
	window.open("index.php?do=edit&cat=scholar&id="+id,"Scholarship","width=600,height=600,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
//----------------------------------------------------------------------------------------Event-----------------------------------------------------------------------------------
function insertEvent(gid){
	window.open("index.php?do=insert&cat=event&gid="+gid, "Event","width=550,height=550,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editEvent(gid, id){
	window.open("index.php?do=edit&cat=event&gid="+gid+"&id="+id,"Event","width=550,height=550,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editEventRegistration(id){
	window.open("index.php?do=editregistration&cat=event&id="+id,"Event","width=550,height=550,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function viewEventRegistration(id){
	window.open("index.php?do=viewregistration&cat=event&id="+id,"Event","width=550,height=350,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function insertEventCategory(id){
	window.open("index.php?do=insertcategory&cat=event&schedule="+id, "Category","width=500,height=250,scrollbars,resizable=yes,status=no,left=200,top=200");     
		void(0);    
}
function insertBanquetRegistrant(id){
	window.open("index.php?do=insertregistrant&cat=event&schedule="+id, "Registrant","width=550,height=600,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editBanquetRegistrant(schedule, id){
	window.open("index.php?do=editregistrant&cat=event&schedule="+schedule+"&id="+id, "Registrant","width=550,height=600,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function printRegistration(id){
	window.open("index.php?do=printregistrant&cat=event&id="+id, "Registrant","width=550,height=600,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);  
}
//---------------------------------------------------------------------------------------People---------------------------------------------------------------------------------
function insertItem(item, uid){
	window.open("index.php?do=insertitem&cat=people&item="+item+"&uid="+uid,"PeopleItem","width=550,height=350,scrollbars,resizable=yes,status=no,left=100,top=100");     
		void(0);    
}
function editItem(item, uid, id){
	window.open("index.php?do=edititem&cat=people&item="+item+"&uid="+uid+"&id="+id,"PeopleItem","width=550,height=350,scrollbars,resizable=yes,status=no,left=100,top=100");     
		void(0);    
}
function delItem(item, uid, id){
	window.open("index.php?do=delitem&cat=people&item="+item+"&uid="+uid+"&id="+id,"People","width=550,height=450,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editPeopleItem(item, id){
	window.open("index.php?do=listitem&cat=people&item="+item+"&id="+id,"People","width=550,height=450,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editPeopleCourse(id){
	window.open("index.php?do=editcourse&cat=people&id="+id,"People","width=550,height=450,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);   
}
function insertPeople(){
	window.open("index.php?do=insert&cat=people", "People","width=550,height=650,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editPeople(id){
	window.open("index.php?do=edit&cat=people&id="+id,"People","width=550,height=650,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function insertProgram(){
	window.open("index.php?do=insertprogram&cat=program", "Program","width=550,height=450,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editProgram(id){
	window.open("index.php?do=editprogram&cat=program&id="+id,"Program","width=550,height=450,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function insertResearch(){
	window.open("index.php?do=insertresearch&cat=research", "Research","width=550,height=450,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editResearch(id){
	window.open("index.php?do=editresearch&cat=research&id="+id,"Research","width=550,height=450,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function insertProject(){
	window.open("index.php?do=insertprj&cat=project", "Project","width=550,height=600,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editProject(id){
	window.open("index.php?do=editprj&cat=project&id="+id,"Project","width=550,height=600,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function insertPIGRA(id){
	window.open("index.php?do=insertpersonal&cat=project&prjid="+id,"PIGRA","width=500,height=300,scrollbars,resizable=yes,status=no,left=100,top=100");     
		void(0); 
}
//-----------------------------------------------------------------------------------------Curricula-----------------------------------------------------------------------------------
function insertCurricula(){
	window.open("index.php?do=insert&cat=curricula", "Curricula","width=600,height=600,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editCurricula(id){
	window.open("index.php?do=edit&cat=curricula&id="+id,"Curricula","width=600,height=600,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function insertCourse(){
	window.open("index.php?do=insertcourse&cat=course", "Course","width=500,height=650,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editCourse(id){
	window.open("index.php?do=editcourse&cat=course&id="+id,"Course","width=500,height=650,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
//-----------------------------------------------------------------------------------------Misc.-----------------------------------------------------------------------------------
function insertMisc(){
	window.open("index.php?do=insert&cat=misc", "Misc","width=600,height=600,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editMisc(id){
	window.open("index.php?do=edit&cat=misc&id="+id,"Misc","width=600,height=600,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
//-----------------------------------------------------------------------------------------Link-----------------------------------------------------------------------------------
function insertLink(){
	window.open("index.php?do=insert&cat=link", "Link","width=600,height=500,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editLink(id){
	window.open("index.php?do=edit&cat=link&id="+id,"Link","width=600,height=500,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
//-----------------------------------------------------------------------------------------Photo---------------------------------------------------------------------------------
function insertPhoto(){
	window.open("index.php?do=insert&cat=photo", "Photo","width=450,height=400,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function editPhoto(id){
	window.open("index.php?do=edit&cat=photo&id="+id,"Photo","width=450,height=400,scrollbars,resizable=yes,status=no,left=10,top=10");     
		void(0);    
}
function openPicture(id){
	window.open("index.php?do=open&cat=photo&id="+id, "Picture","width=800,height=600,scrollbars,resizable=yes,status=no,left=50,top=50");     
		void(0);    
}
//-----------------------------------------------------------------------------------------Other Applications-----------------------------------------------------------------------------------
function refresh(){
    window.location.reload( false );
}
function checkForm(id) {
	var f = document.forms[id];
	for (var i=0; i< f.elements.length; i++) {
		if ( (f.elements[i].type == "checkbox") && (f.elements[i].checked == true) )
			return confirm('This will delete all information related to selected items from the database!\nContinue?');
	}
	alert("No boxes have been checked!");	
	return false;
}
function checkMultipleForm(id, category) {
	var f = document.forms[id];
	for (var i=0; i< f.elements.length; i++) {
		if ( (f.elements[i].type == "checkbox") && (f.elements[i].checked == true) )
			return confirm('This will delete all information related to selected '+category+' from the database!\nContinue?');
	}
	alert("No boxes have been checked!");	
	return false;
}
function checkSelectedForm(category) {
	var f = document.forms[0];
	for (var i=0; i< f.elements.length; i++) {
		if ( (f.elements[i].type == "checkbox") && (f.elements[i].checked == true) )
			return confirm('This will delete all information related to selected '+category+' from the database!\nContinue?');
	}
	alert("No boxes have been checked!");	
	return false;
}
//------------------------------------------------------------------------------------Check Foms----------------------------------------------------------------------
function checkAttach(){
	if (document.forms[1].title.value.length <= 0){
		alert('The title of file attached is required.');
		document.forms[1].title.focus();
		return false;
	}
	if (document.forms[1].filename.value.length <= 0){
		alert('The filename is required.');
		document.forms[1].filename.focus();
		return false;
	}
	var msg = "Are you sure that you want to attach this file?";
	var yesno=confirm(msg);
	if (yesno) return true;
	else return false;
}
//----------------------------------------------------------------------------------------------List Box-------------------------------------------------------------
function addOption(selectObject,optionText,optionValue) {
	var optionObject = new Option(optionText,optionValue);
	var optionRank = selectObject.options.length;
	selectObject.options[optionRank]=optionObject;
}
function deleteOption(selectObject,optionRank) {
	if (selectObject.options.length!=0) { selectObject.options[optionRank]=null; }
}
function addList() {
    var formObject = document.orderForm;
	var oldIndex = formObject.oldOrder.selectedIndex;
    if (oldIndex !=-1) {
        addOption(formObject.newOrder,formObject.oldOrder.options[oldIndex].text, formObject.oldOrder.options[oldIndex].text);
    } else {
        alert("Please select the item on the left hand side box and click Add");
    }
}
function delList(){
	var formObject = document.orderForm;
	if (formObject.newOrder.selectedIndex!=-1) {
		deleteOption(formObject.newOrder,formObject.newOrder.selectedIndex);
	} else {
		alert("Select an option on the righ hand side box and click Delete");
	}
}
function allOptions(){
	var formObject = document.orderForm;
	var selectedArray = new Array();
	var i;
	var count = 0;
	if (formObject.newOrder.options.length != formObject.oldOrder.options.length){
			alert("Number of items in the left hand side box is not equal to the number in the right hand side box.");
			return false;
	}else{
			for (var i=0; i<formObject.newOrder.options.length; i++) {
					formObject.newOrder.options[i].selected = true;
			}
			for (i=0; i<formObject.newOrder.options.length; i++) {
					if (formObject.newOrder.options[i].selected) {
						selectedArray[count] = formObject.newOrder.options[i].value;
						count++;
					}
			}
			formObject.selectedValue.value = selectedArray;
			return true;
	}
}