$(document).ready(function() {
	
	//Add Styling widgets
/*
	$(".widget_sub_page_navigation").addClass("style-2");
	$("#php_widget-3, #php_widget-4, #php_widget-5, #php_widget-6, #php_widget-8").addClass("style-1");
	$("#php_widget-5, #php_widget-7").addClass("style-3").attr("id","group-directory");
*/
	
/*
	$(".slideshow-wrap").carouFredSel({ //Index slidshow slider - deprecated
		width: 950,
		height: 400,
		items: {
			visible: 1,
			width: 950,
			height: 400
		},
		scroll: {
			items : 1,
			duration: 0,
			onBefore: function() {
		      $(".slideshow-wrap").fadeOut('slow');
		    },
		    onAfter: function() {
		      $(".slideshow-wrap").fadeIn('slow');
		    }			
		},
		pagination: '.slideshow-pagination'		
	});
*/
	
	/* Index Slideshow */
	
	$(".slideshow-wrap").cycle(function(){ 
		fx : 'fade'
	});
	
	/* Hasnur Group Directory */
	
	$("#group-directory .go").click(function(){
		window.location = $(".companies option:selected").val();
	});
	
	$("#group-directory .categories").change(function(){ 
		var category = $("#group-directory .categories option:selected").val();
		$("#group-directory .companies optgroup").show();
		$("#group-directory .companies optgroup[name="+category+"]").siblings().hide();
		/* console.log(category); */
		window.location = "?cat="+$("#group-directory .categories option:selected").val();
	});
	
	$("li.en").addClass("active");

	$("li.en a").click(function(){
		if($(this).parent().hasClass("active")) {
			return false;
		} else {
			$('body').translate('id','en');		
			$(this).parent().siblings().removeClass("active");				
			$(this).parent().addClass("active");
			return false;			
		}
	});
	
	$("li.id a").click(function(){
		if($(this).parent().hasClass("active")) {
			return false;			
		} else {
			$('body').translate('en','id');		
			$(this).parent().siblings().removeClass("active");				
			$(this).parent().addClass("active");
		}
			return false;		
	});	
	
});
