// JavaScript Document

//For sorting the events list
function event_list(Sort, type, show)
	{
		
		//Setup the query that we will pass to our script
		//document.getElementById('working').style.display='block';
		var file = 'modules/aj/eventcal.php';
		var query = "?sort=" + Sort + "&type=" + type;
		
		ajaxCall(file, query, 'event_list');
		
	}

//For initial display of the events list
function list(Sort, type, show, hide)
	{
		
		//Setup the query that we will pass to our script
		//document.getElementById('working2').style.display='block';
		var file = 'modules/aj/eventcal.php';
		var query = "?sort=" + Sort + "&type=" + type;
		var hide= document.getElementById(hide);
		var get = document.getElementById(show);
		hide.style.display = 'none';
		get.style.display = 'block';
		//js_clock();
		ajaxCall(file, query, show);
		
	}
	
//Show details

function details(id, show)
	{
	
		//document.getElementById('working2').style.display='block';
		var file = 'modules/aj/events.php';
		var query = "?id=" + id;
		
		document.getElementById('pageload').style.display='block';
		//var mask = document.getElementById(hide);
		//get.style.display = 'block';
		//mask.style.display = 'none';
		//js_clock();
		ajaxCall(file, query, 'pageload');
		setTimeout("js_clock()",1250);
		//js_clock();

		
	}
	
	function details2(id, show)
	{
	
	//	document.getElementById('working2').style.display='block';
		var file = 'modules/aj/events.php';
		var query = "?id=" + id;
		var get = document.getElementById(show);
		var get2 = document.getElementById('event_header');
		var mask = document.getElementById(hide);
		get2.style.display = 'block';
		get.style.display = 'block';
		//mask.style.display = 'none';
	//	js_clock();
		ajaxCall(file, query, show);
		
		
	//	js_clock();
		
	}
	
	function validate_file(id)
	{
		
		var name = $('ftitle');
		var file = $('file');
		
		if(!reStrAlpha.test(name.value)){
			alert('Please specify a title for this file')
			name.focus()
			name.select()
			return false;
		}
		
		if(file.value==''){
		alert('Please choose a file to upload');
		file.focus()
		file.select()
		return false;
			
		}
	}
	
	function event_select()
	{
		var e = document.getElementById('event').value;
		return window.top.location = '?mod=adbanedit&event='+e;
	}
	
	

