$(function() {
	var zIndexNumber = 1000;
	$('div').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 1;
	});
});

jQuery(function(){
	$("ul.sf-menu").supersubs({ 
		minWidth:    12,   // minimum width of sub-menus in em units 
		maxWidth:    27,   // maximum width of sub-menus in em units 
		extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
						   // due to slight rounding differences and font-family 
	}).superfish({delay: 600});  // call supersubs first, then superfish, so that subs are 
					 // not display:none when measuring. Call before initialising 
					 // containing tabs for same reason. 
});

$(document).ready(function() {
	
	var hideclass = $('div.hidden-content-wrap');
	
	hideclass.hide();
	

	$('a.button-expand').click(function() {
		var buttonid = $(this).attr("id"); // = b-N
		var theid = buttonid.replace("b-", "");

		
		var hiddenid = "hidden-"+theid;
		
        if ($(this).hasClass('togplus')) {
            $(this).removeClass('togplus').addClass('togminus');
        } else if ($(this).hasClass('togminus')) {
            $(this).removeClass('togminus').addClass('togplus');
        } else {
            $(this).addClass('togplus');
        }
		
		$('div#'+hiddenid).slideToggle('fast');
		
		return false;
	});
	
	$('a.title-expand').click(function() {
		var titleid = $(this).attr("id"); // = t-N
		var theid = titleid.replace("t-", "");
		var button = "#b-"+theid;
		
		var hiddenid = "hidden-"+theid;
		
        if ($(button).hasClass('togplus')) {
            $(button).removeClass('togplus').addClass('togminus');
        } else if ($(button).hasClass('togminus')) {
            $(button).removeClass('togminus').addClass('togplus');
        } else {
            $(button).addClass('togplus');
        }
		
		$('div#'+hiddenid).slideToggle('fast');
		
		return false;
	});	

});

function change(newVal,it,oldVal) {
	var id = document.getElementById(it);
	if(id.value==oldVal) {
		id.value = newVal;
		id.focus();
	} else {
		id.focus();
	}
}

function changeback(id,oldVal) {
	var id = document.getElementById(id);
	if(id.value=='') {
		id.value=oldVal;
	}
}
