// JavaScript Document
jQuery(document).ready(function(){
	var network_active = 0;
	jQuery('#network').hover(function () {
	  jQuery(this).addClass("hover_network");
	}, function () {
	  jQuery(this).removeClass("hover_network");
	});
	
	jQuery('#anchor_network').click(function () {
	 								  							
	  jQuery('#list_network').slideToggle("fast");
	  if(network_active==1){
		  network_active = 0;
		  jQuery('#network').removeClass("active_network");
	  }else{
		network_active = 1;
	    jQuery('#network').addClass("active_network");
	  }
	});
	
	
	// search
	getValue = function(id){
		return jQuery("#"+id).attr('value');
	};
	
	var searchValue = getValue('s');
	
	var authorValue = getValue('author');
	var emailValue = getValue('email');
	var urlValue = getValue('url');
	
	jQuery("#s").focus(function () {
		// jQuery(this).css('display','inline').fadeOut(1000);
		 jQuery(this).attr('value','');
	});
	jQuery("#s").blur(function () {
		// jQuery(this).css('display','inline').fadeOut(1000);
		if(jQuery(this).attr('value')==''){
		jQuery(this).attr('value',searchValue);
		}
	});

	jQuery("#author").focus(function () {
		// jQuery(this).css('display','inline').fadeOut(1000);
		 jQuery(this).attr('value','');
	});
	jQuery("#author").blur(function () {
		// jQuery(this).css('display','inline').fadeOut(1000);
		if(jQuery(this).attr('value')==''){
			jQuery(this).attr('value','Nama (Wajib)');
		}
	});
	
	jQuery("#email").focus(function () {
		// jQuery(this).css('display','inline').fadeOut(1000);
		jQuery(this).attr('value','');
	});
	jQuery("#email").blur(function () {
		// jQuery(this).css('display','inline').fadeOut(1000);
		if(jQuery(this).attr('value')==''){
			jQuery(this).attr('value','Email (Wajib)');
		}
	});

	jQuery("#url").focus(function () {
		// jQuery(this).css('display','inline').fadeOut(1000);
		jQuery("#url").attr('value','');
	});
	jQuery("#url").blur(function () {
		// jQuery(this).css('display','inline').fadeOut(1000);
		if(jQuery(this).attr('value')==''){
			jQuery(this).attr('value','Website');
		}
	});

// end search
	
	// tabs
	jQuery('#tabs').tabs( { 
		fx: { opacity: 'toggle', speed : 'fast' }
		// tabTemplate: '<div class="widget_head"><a href="#{href}">#{label}</a></div>'
		} );
	
	jQuery('.widget').find('ul').find('li:first').addClass('nobg');
	jQuery('#footer_wrap').find('ul').find('li:first').addClass('nobg');
	jQuery('#list_network').find('ul').find('li:last').addClass('nobg');
	
	
	/*
	jQuery('.widget ul li:first').each(function(index) {
		jQuery(this).addClass('nobg');
	});
	*/
	/*
	jQuery('#fragment-1 ul li,#fragment-2 ul li,#fragment-3 ul li,#fragment-4 ul li').eq(0).addClass('nobg');
	jQuery('.widget ul li').eq(0).addClass('nobg');
	*/
});

