$(document).ready(function(){
	
//Menu
$('ul#menu').superfish();
	
//PRETY PHOTO
$("a[rel^='prettyPhoto']").prettyPhoto();

//TWITTER
$(".tweet").tweet({
	  join_text: "auto",
	  username: "bingumd",
	  avatar_size: 0,
	  count: 2,
	  auto_join_text_default: "we said,",
	  auto_join_text_ed: "we",
	  auto_join_text_ing: "we were",
	  auto_join_text_reply: "we replied",
	  auto_join_text_url: "we were checking out",
	  loading_text: "loading tweets..."
});

//IMAGE HOVER
$(".latest-post li, .sidebar li").hover(function () {						 
	$(this).find("img").stop(true, true).animate({ opacity: 0.8 }, 500);
}, function() {
	$(this).find("img").stop(true, true).animate({ opacity: 1.0 }, 300);
});

//IMAGE BLOG/PORTFOLIO HOVER
$(".image, .portfolio-post li, .portfolio-home div").hover(function () {						 
	$(this).find("img").stop(true, true).animate({ opacity: 0.5 }, 500);
	$(this).find("a.img-link, a.img-view, a.view-project").stop(true, true).fadeIn(500);
}, function() {
	$(this).find("img").stop(true, true).animate({ opacity: 1.0 }, 300);
	$(this).find("a.img-link, a.img-view, a.view-project").stop(true, true).fadeOut(500);
});

//SIDEBAR TABS
$('ul.tabs').each(function() {
    $(this).find('li').each(function(i) {
      $(this).click(function(){
        $(this).addClass('active').siblings().removeClass('active')
          .parents('div.tab_block').find('div.tab').hide().end().find('div.tab:eq('+i+')').fadeIn(2000);
      });
    });
});


//Tab page
$('ul.tab-page').each(function() {
    $(this).find('li').each(function(i) {
      $(this).click(function(){
        $(this).addClass('active').siblings().removeClass('active')
          .parents('div.tabs-page').find('div.tabpage').hide().end().find('div.tabpage:eq('+i+')').fadeIn(2000);
      });
    });
});

  
  
//Toggle
$(".close").click(function(){$("#seting").toggle("fast");
$(this).toggleClass("openpanel");return false});
$(".toggle-block").hide(); 

$("p.toggle").click(function(){
		$(this).toggleClass("active").next().slideToggle(500);
		return false; 
	});
	
//Accordion
$('.acc-block').hide();
$('.acc-header:first').addClass('active').next().show();
$('.acc-header').click(function(){
	if( $(this).next().is(':hidden') ) {
		$('.acc-header').removeClass('active').next().slideUp();
		$(this).toggleClass('active').next().slideDown();
	}
	return false;
});
		
				
});


$(window).load(function() {

		$(".loading").fadeOut(1000); 
		        	
});
