<!-- jquery script for tabs -->
$(document).ready(function(){
	var hash = window.location.hash;
	//alert(hash);
	if (hash == "#tab-2") {
		$('#user_tags').addClass('active');
		$('#tab-1').hide();
	}
	else {
		$('#concepts').addClass('active');
		$('#tab-2').hide();
	}
	$('#user_tags').click(function(){
		$('#concepts').removeClass('active');
		$('#user_tags').addClass('active');
		$('#tab-1').hide();
		$('#tab-2').show();
	});
	$('#concepts').click(function(){
		$('#user_tags').removeClass('active');
		$('#concepts').addClass('active');
		$('#tab-2').hide();
		$('#tab-1').show();
	});
});

// construct a query with the entered keyword and the current hashtag
function simpleSearch() {
    var terms = {};
    // copy the keyword query
    var keyword = $.trim(document.simple_search_form.searchstring.value);
    if (keyword != '') {
        terms['all']=keyword;
    }
    terms['anim']='1';
    // turn it into a query, add the hash portion, and go
    window.location = 'results.php?'+$.param(terms)+window.location.hash;
}

// for tooltip
$(function() {
    $('.tipsy').tipsy({gravity: 's'});
});

