


var showAssetForm = function(){
		$('assetPop').show();

}

var obj;
var addNewCategory = function(element, id){

		//get a list separated by commas of cats to add
		//submit that list to EntryController action
		//update target div with all tags, including new ones

		new Ajax.Updater("catlist", "http://defaultcms.joy.site/admin/entry/category?format=xml",
				{asynchronous:true, evalScripts:true, onComplete:function(request,json){}, parameters: {'id': id, 'task':'addnew','value': element.value}} );


}

var addExistingCategory = function(element, id) {
		//alert(element.value);return;
		new Ajax.Updater("catlist", "http://defaultcms.joy.site/admin/entry/category?format=xml",
				{asynchronous:true, evalScripts:true, onComplete:function(){alert('complete');}, parameters: {'id': id, 'catid': element.value, 'task':'addexisting','value': element.value}} );




}

var deleteCategory = function (id, cat_id) {
	//alert(id + ":" + cat_id);return;
		new Ajax.Updater("catlist", "http://defaultcms.joy.site/admin/entry/category?format=xml",
				{asynchronous:true, evalScripts:true, onComplete:function(request,json){}, parameters: {'id': id, 'catid': cat_id, 'task':'delete'}} );


}

var parse = function(json){
		obj = json.obj;
		//alert(json.obj);

}

var checkOrUncheckAll = function(obj) {
	frm = document.forms[0];
  for (var i=0;i<frm.elements.length;i++) {
    var e = frm.elements[i];
    if ((e.id != obj.id) && (e.type=='checkbox') && (e.name==obj.name)) e.checked = !e.checked;
  }
}