/* ALL PAGE SCRIPTS */

//slides the element with class "menu_body" when mouse is over the paragraph
$(document).ready(function() {

	function equalHeight(group) {
		tallest = 0;
		group.each(function() {
			thisHeight = $(this).height();
			if(thisHeight > tallest) {
				tallest = thisHeight;
			}
		});
		group.height(tallest);
	}
		
	equalHeight( $( '#common_box .commonbox1' ) );
	   

	/* HOMEPAGE SLIDER */
	$('#roundabout .description').hide();
	$('#roundabout li').focus(function() {
		$('li.roundabout-in-focus').mouseenter(function() {
		tmpid= $(this).attr('id');
		tmpid= "desc"+tmpid.substring(3);
			$("#" + tmpid).fadeIn(200);
		}).mouseleave(function() {
			$("#" + tmpid).fadeOut(100);
		});
	}).blur(function() {
		$('li').unbind('mouseenter');
		$('.description').fadeOut(100);
	});
/*	$('#roundabout .description').hide();
	$('#roundabout li').focus(function() {
		$('li.roundabout-in-focus').mouseenter(function() {
			$(this).find('.description').fadeIn(200);
		}).mouseleave(function() {
			$(this).find('.description').fadeOut(100);
		});
	}).blur(function() {
		$('li').unbind('mouseenter');
		$('.description').fadeOut(100);
	});
*/
	$('.yp-description .yp-toggle-box').hide();
	$('.yp-info-btn').click(function() {
		$(this).toggleClass('active');
		$(this).next().slideToggle(200);
		return false;
	});


	$('#roundabout').css({visibility:'visible'});
	$('ul#roundabout').roundabout({
		//shape:'figure8',
		shape: 'square',
		duration: 300,
		startingChild: 0,
		minScale: 0.54,
		minOpacity:1,
		//easing: 'easeInOutBack',
		btnNext: '#next',
		btnPrev: '#previous'
	});
	
	
	/* LOGINBOX ON CLICK */	
	
	$("#loginbox").hide();
		$("li.login a").click(function () {
		$(this).toggleClass('active');
		$('#loginbox').slideToggle('medium').delay(600);
		return false;
	});  
	
	
	/* ACCORDION BOXES */
	
	$('.acc_contl').each(function() {
		$(this).css("height", $(this).height());
	});
	$('.acc_contl').hide(); 
	$('.acc_trig1:first').addClass('active').next().show(); 
	$('.acc_trig1').click(function(){
		if( $(this).next().is(':hidden') ) {
			$('.acc_trig1').removeClass('active').next().slideUp(); 
			$(this).toggleClass('active').next().slideDown(); 
		}
		return false; 
	});



	$('.acc_contr').each(function() {
		$(this).css("height", $(this).height());
	});
	$('.acc_contr').hide(); 
	$('.acc_trigr:first').addClass('active').next().show(); 
	$('.acc_trigr').click(function(){
		if( $(this).next().is(':hidden') ) {
			$('.acc_trigr').removeClass('active').next().slideUp(); 
			$(this).toggleClass('active').next().slideDown(); 
		}
		return false; 
	});

	$('.acc_containerb').each(function() {
		$(this).css("height", $(this).height());
	});
	 $('.acc_containerb').hide();
	 $('.acc_triggerb:first').addClass('active').next().show(); 
		   $('.acc_triggerb').click(function(){
		if( $(this).next().is(':hidden') ) {
			$('.acc_triggerb').removeClass('active').next().slideUp(); 
			$(this).toggleClass('active').next().slideDown(); 
		}
		return false; 
	});

	/* TABS */

	$(".tab_content").hide(); 
	$("ul.tabs li:first").addClass("active").show();
	$(".tab_content:first").show();

	//On Click Event
	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active"); 
		$(this).addClass("active"); 
		$(".tab_content").hide(); 

		var activeTab = $(this).find("a").attr("href"); 
		$(activeTab).fadeIn(); 
		return false;
	});
	
	$(".tab_content2").hide(); 
	$("ul.tabs2 li:first").addClass("active").show();
	$(".tab_content2:first").show();

	//On Click Event
	$("ul.tabs2 li").click(function() {

		$("ul.tabs2 li").removeClass("active"); 
		$(this).addClass("active"); 
		$(".tab_content2").hide(); 

		var activeTab = $(this).find("a").attr("href"); 
		$(activeTab).fadeIn(); 
		return false;
	});
	
/* ANYTHING SLIDER */


});
   
	
