$(document).ready(function(){
	
	$(".lotList :text").focus(function(){
	 	$(this).val("");
	    $(this).css({"border-color":"navy","color":"#333"});
        $(":text").not(this).attr('disabled','disabled');
        $(":text").not(this).addClass("inputDisabled");
        $(":text").not(this).val("");
       	$(":text").not(this).removeClass("active_border");
	});
	
	$(".lotList :text").blur(function(){
		if( $(this).val() == "" && $(this).attr("id") != "lotNumber" ) 
		{
		$(this).val("Search Auctions");
		}
	    $(this).css("border-color","#6082ce");
		$(":text").not(this).removeAttr('disabled');
        $(":text").not(this).removeClass('inputDisabled');
	});
	
	
	if ( $("#itemText").val() != "" && $("#itemText").val() != "Search Auctions" )
	{
 	$("#switchTo").append('<option id="keywordSearch" selected="selected">Searching By Keyword</option>');	
 	}else{
 	$("#keywordSearch").remove();
 	}
 	
 	if ( $("#itemText").val != "" )
 	{
 	$("#itemText").css("color","#333");
 	}

	
	
	$(".lotList #switchTo").focus(function(e){
        $("input:text").val("");
	});

	$(".itemTable").tablesorter({ 
        widgets: ['zebra'],
/*         sortList: [[3,1]], */
        headers: { 
            0: { 
                // disable column number by setting the property sorter to false 
                sorter: false 
            }
        } 
    });
    
/*
    $("#th3").click(function(){
    
    	$(".itemTable").tablesorter({ 
	        sortList: [[3,1], [2,0]],
 	        widgets: ['zebra']
	    });
    
    });
*/
    
    var $itemRow = $('.itemTable tr');

    $itemRow.click(function() {    
    	$itemRow.removeClass("selectedRow");
    	$(this).addClass("selectedRow");
	});
    
    
	$("a.showTerms").click(function(){
			$(this).parent().children(".termsFolder").toggle("slow");
	});
	
	
	$(".bankLienRadio")
	.livequery('click', function(){
			
		if ( $("#bankLienYes").is(":checked") )
		{
			$("#bankLienFolder").toggle("slow");
		}
		else
		{
			$("#bankLienFolder").css("display","none");
		}
		
	});
	
	
	$(":submit").attr("value"," ");
	
	
});