// JavaScript Document
//Validate the form fields on new submissions
function download_validate(){

var name = $('name');
var des = $('description');
var t = $('type');

if(t.value ==''){
	alert('Please select a type for this download');
	return false;
}

if(!reStrAlpha.test(name.value)){
	alert('Please enter a valid name for this download');
	name.focus();
	name.select();
	return false;
}

if(des.value ==''){
	alert('Please enter a description for this file');
	des.focus();
	des.select();
	return false;
}
										  
	
}

//switch download list Ajax
function download_switch(t){
	
$('working3').appear();
var query = '?type='+t;
var file = '/aj/downloadlist';

//ajaxCall(file, query, 'files');
	new Ajax.Updater('files',file,{method:'get',
					parameters:{type:t}
					});
}

