/* WheatGrass Directory Viewer 1.0.2
 * Copyright (C) 2009 Nick Ficano
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
$(document).ready(function()
 {
	$.tablesorter.defaults.widgets = ['zebra'];
	
	$("table").tablesorter(
	{
		sortList: [[1, 0], [0, 0]],
		headers: 
		{
			4: 
			{
				sorter: false
			}
		}
	});

	$(".sharable").click(function()
	{
		var url 	= $(this).attr('id').substring(4);
		var file 	= $('#lnk_' + url).attr('href');
		var txtVal 	= $('#txtSelf').val();

		$('#clipboard > .textBox').val(txtVal + escape(file));
		tb_show('Copy to Clipboard', '#TB_inline?height=40&width=500&inlineId=clipboard');
	});

	$("input").bind("focus click",function()
	{
		this.select();
	});
	
	$("#txtSearch").keypress(function()
	{
		$('.filename').each(function(i)
		{
			console.debug($(this));
		});
	});
});