Cufon.replace('.nvg a', {fontSize: '16px'});
Cufon.replace('.c h3', {fontSize: '18px'});
Cufon.replace('.hdp h1', {fontSize: '24px'});
Cufon.replace('.nvl a', {fontSize: '15px'});
Cufon.replace('.nvh h4', {fontSize: '14px'});
Cufon.replace('.tsn a', {fontSize: '16px'});
Cufon.replace('.c h2', {fontSize: '20px'});









// ##################
// #  Fri Jul  2 13:50:50 BST 2010
// #  on load helper functions
// #
// ##################



function load_tabs_event(){

	$('div.tsb').bind('tabsselect', function(event, ui) {
		// first we clean the panel here
		var x =	 ui.panel;
		$(x).empty();
		// set back the ordering value to 'default'
		$("#active_ordering").val("default");
		// a slight delay is needed to let the tab index update before checking for the selected tab!
		setTimeout("reload_results()",100);

	});
}



// test it using: el = $("h4.to_collapse:eq(0)").next().find(".ui-state-active");
function load_facetgroups_action() {
	"makes the facet groups collapsable, making sure the inside facets gets closed first..otherwise the accordion doesn't work"

	var myCollapsableItems=new Array( "h4.to_collapse"); 
	for (i in myCollapsableItems) {
		$(myCollapsableItems[i]).toggle(
			  function () {
				el_to_find = $(this).next().find(".ui-state-active");
				if (el_to_find.length > 0) {
					// alert(el_to_find);
					// hack: gets you the index of open accordion [0.....n]
					n = $("#accordion h5").index($("#accordion h5.ui-state-active"));
					$('#accordion').accordion('activate', n); // closes the accordion...
						}
				$(this).next().slideUp("slow");				
					}, 
			  function () {
				$(this).next().slideDown("slow");
			  }
			);
		}			
		// if we want to close all facetgroups by default...
	if (true) {
		for (i in myCollapsableItems) {
			$(myCollapsableItems[i]).click();
		}
	}		
}




$(document).ready(function() {
	$('html').addClass('j');
	$('a[rel]').click(function () {
		var linkTarget = $(this).attr('rel');
		if (linkTarget == 'external') {
			linkTarget = '_blank'
		};
		$(this).attr({'target':linkTarget});
	});

	$(".nvh h5 label").overlabel();

	$(".tsb").tabs({ selected: 2 });

	// added by mikele
	// gives a behaviour to the empty_control button
	$("#empty_controls").click(function () {
		empty_control_bar();
	 });

	// load my own tab-change events
	load_tabs_event();

	// 2010-08-12: I added a sortable, just to test...
	// try to sort manually like this:
	// $("#accordion li.ui-accordion-li-fix:eq(1)").insertAfter($("#accordion li.ui-accordion-li-fix:eq(2)"));
	//   use .simple_blink() or add some effects....
	$("#accordion").accordion({ header: 'h5', collapsible: true , active: false});
	$( "#accordion" ).bind( "accordionchange", function(event, ui) {
		delayUpdateFacetValues(50);
	});

	// make the facets sections collapsable
	load_facetgroups_action();

});






