$(document).ready(function(){
	//Fungsi Tab Animation
	$('#header_gallery').innerfade({ speed: 3000, timeout: 5000, type: 'sequence', containerheight: '248px' });
	$('#rgall').innerfade({ speed: 1000, timeout: 10000, type: 'random', containerheight: '80px' });
	
	//FUNGSI BUTTON LANGUAGE
	$('#langbutton').click(function(){
		window.open('index.php?lang='+$(this).attr('lang')+'&reff='+$(this).attr('rel'),'_self');
	});
	
	$('#kwordform').focus(function(){
		if($(this).val()=="Search") {
			$(this).attr('value','');
		}
	});
	
	$('#kwordform').blur(function(){
		if($(this).val()=="") {
			$(this).attr('value','Search');
		}
	});
	
	//Fungsi Tab Option
	var x=0;
	$('div[class*=tabcontent]').each(function(){$(this).css('display','none');});
	$('#tabmenu a').each(function(){
		if(x==0) {$(this).addClass('active');} else {$(this).removeClass('active');}
		if($(this).attr('class')=='active'){$('#tab'+x).css('display','block');}
		$(this).click(function(){
			var idTab = $(this).attr('href');
			$('#tabmenu a').each(function(){$(this).removeClass('active')});
			$(this).addClass('active');
			$('div[class*=tabcontent]').each(function(){
				if($(this).attr('id')==idTab){
					$(this).fadeIn('slow');
				} else {
					$(this).fadeOut('slow');
				}				
			});
			return false;
		});
		x++;
	});
});
	
//Fungsi Aktivasi FaceBox
jQuery(document).ready(function($) {
  $('a[rel*=facebox]').facebox();
})

function postjson(url,data,bS,s,e){
$.ajax({type:"POST",url:url,data:data,dataType:"json",
beforeSend:bS,success:s,error:e});}