/**
 * @Copyright CSSReX | http://cssrex.com/
 * @Terms of Use: http://cssrex.com/
 * If you change the contents below sky will fall on your head!
 */
DD_roundies.addRule('.round', 5, true);
$( document ).ready( function ( $ ) {
	// Add first and last menu item classes
	$('#headerbottom ul li:last-child').addClass('noborder');
});
$( document ).ready( function ( $ ) {
	// Add first and last menu item classes
	$('#headerbottom ul li ul li:last-child').removeClass('noborder');
});
$(document).ready(function() {
    $('ul.sf-menu').superfish();
});

//Toggle Tabs and Accordian Code
jQuery(document).ready(function(){
jQuery(".tabs_container").each(function(){
		var $history = jQuery(this).attr('data-history');
		if($history!=undefined && $history == 'true'){
			$history = true;
		}else {
			$history = false;
		}
		var $initialIndex = jQuery(this).attr('data-initialIndex');
		if($initialIndex==undefined){
			$initialIndex = 0;
		}
		jQuery("ul.tabs",this).tabs("div.panes > div", {tabs:'a', effect: 'fade', fadeOutSpeed: -400, history: $history, initialIndex: $initialIndex});
	});
	jQuery(".mini_tabs_container").each(function(){
		var $history = jQuery(this).attr('data-history');
		if($history!=undefined && $history == 'true'){
			$history = true;
		}else {
			$history = false;
		}
		var $initialIndex = jQuery(this).attr('data-initialIndex');
		if($initialIndex==undefined){
			$initialIndex = 0;
		}
		jQuery("ul.mini_tabs",this).tabs("div.panes > div", {tabs:'a', effect: 'fade', fadeOutSpeed: -400, history: $history, initialIndex: $initialIndex});
	});
	jQuery.tools.tabs.addEffect("slide", function(i, done) {
		this.getPanes().slideUp();
		this.getPanes().eq(i).slideDown(function()  {
			done.call();
		});
	});
	jQuery(".accordion").each(function(){
		var $initialIndex = jQuery(this).attr('data-initialIndex');
		if($initialIndex==undefined){
			$initialIndex = 0;
		}
		jQuery(this).tabs("div.pane", {tabs: '.tab', effect: 'slide',initialIndex: $initialIndex});
	});
	jQuery(".toggle_title").toggle(
		function(){
			jQuery(this).addClass('toggle_active');
			jQuery(this).siblings('.toggle_content').slideDown("fast");
		},
		function(){
			jQuery(this).removeClass('toggle_active');
			jQuery(this).siblings('.toggle_content').slideUp("fast");
		}
	);
});
