function swap(action, amount){
	if(typeof amount == "undefined"){
		amount = 281;
	}
	
	
	speed = 500;
	tot_height = $('#img_roll').height();
	if(typeof nextPos == "undefined"){
		nextPos = 0;
	}
	
	if(action == "prev"){
		nextPos += amount;
		if(nextPos > 0){
			nextPos = (tot_height-(tot_height*2))+amount;
		}
	}
	else{
		nextPos -= amount;
		if(nextPos < (tot_height-(tot_height*2))+amount){
			nextPos = 0;
		}
	}

	
	$("#img_roll").fadeTo(speed,0,function() {
		$("#img_roll").css( {
			position: 'relative',
			top: nextPos
		});
	}).fadeTo(speed,1);
	
}




$.tablesorter.addParser({ 
        // set a unique id 
        id: 'square', 
        is: function(s) { 
            // return false so this parser is not auto detected 
            return false; 
        }, 
        format: function(s) { 
            // format your data for normalization 
            return s.toLowerCase().replace(/ m2/,0); 
        }, 
        // set type, either numeric or text 
        type: 'numeric' 
    });


$(document).ready(function(){ 
	$("#search-list-table").tablesorter({
		widgets: ['zebra'],
		headers: {
				3: {
					sorter:'square'
				}
		}
	});
	
	
	// Slide function for property images
	$('.property_image_thumb').click(function() {
		var id = $(this).attr('name');
		id = id - 1;
		var width = $('.property_image_viewer_large').width();
		var leftPos =  width * id - ((width * id) *2);
		
		$("#property_image_viewer_large_holder").animate({"left": leftPos+"px"}, "slow");
	});
	
	$(".colorbox_photo").colorbox({maxWidth:'80%', maxHeight:'80%', scalePhotos: true});
});