// PickList Class

var ClientFolder = Class.create();

ClientFolder.prototype = {

	initialize: function()
	{
	},
	
	saveCheckedToFolder: function()
	{
		this.showClientFolderWindow('picklist');
	},
	
	showClientFolderWindow: function(arg)
	{
		if (!popup) popup = new PopUp('300px');
		popup.showPopUp('/agent/client_folders/add/'+arg);
	},
	
	edit: function(arg)
	{
		if (!popup) popup = new PopUp('300px');
		popup.showPopUp('/agent/client_folders/edit/'+arg);
	},
	
	submitEditForm: function() {
		new Ajax.Request('/agent/client_folders/edit/', {
			parameters:  $('edit_client_folder').serialize(),
			evalScripts: true
		});
	
	},
	
	submitForm: function()
	{
		new Ajax.Request('/agent/client_folders/save/', {
			parameters:  $('add_client_folder').serialize(),
			evalScripts: true
		});
		

	},

	view: function(){
		if ($F('folder_name')){
			window.location.href = '/agent/client_folders/by_name/' + $F('folder_name');
		} else {
			window.location.href = '/agent/client_folders/manage/' + $F('folder_id');
		}
	}


};

function showTab(tab) {
	var tabs = ['mapped', 'unmapped'];
	for ( var i=0; i<tabs.length; i++ ) { 
		$(tabs[i]).style.display='none';
		$(tabs[i]+'_tab').className='';
	}
	$(tab).style.display='';
	$(tab+'_tab').className='current';
}	

var selected_row;

function highlight_row(row) {
	if ( selected_row ) $(selected_row).style.backgroundColor = '';
	$(row).style.backgroundColor = '#ff776b';
	selected_row = row;
}

