$(function() {
	$('#faq_holder').accordion({ header:'h3', autoHeight:false,clearStyle:true, active:false, collapsible:true, alwaysOpen: false, change: function(event,ui){
		window.setTimeout(function(){
			$.scrollTo(ui.newHeader);
		},800);
	}});
	$('#faq_holder').toggle();
	$('#tm_li_52 ul li a').click(function(){
		var id = $(this).attr('href').split('#').pop();
		$.each($('#faq_holder h3'),function(i){
			if (this.id==id) index = i;
		});
		window.scroll(0, 0);
		window.setTimeout(function(){
			$('#faq_holder').accordion('activate', index);
		},10);
		return false;
	});
	if(window.location.hash) {
		var id =(window.location.hash.substr(1,window.location.hash.length));		
		if ($('#'+id).length>0) {
			index = -1;
			$.each($('#faq_holder h3'),function(i){
				if (this.id==id) index = i;
			});
			$('#faq_holder').accordion('activate', index);
			window.location.hash = window.location.hash;
		}	
	}
	$('div#faq_holder h3:last').addClass('last-child');
	if ($.browser.version=='6.0' && $.browser.msie)  {
		$('div#faq_holder h3').hover(function(){
			$(this).addClass('hover');
		},function(){
			$(this).removeClass('hover');
		});
		$('div#faq_holder div.faq:last').addClass('last-child');
	}
});
