$(document).ready(function(){

var bgColor;
var effect = 'animated bounceIn'; /* bounceIn, bounceInUp, bounceInDown, bounceInLeft,
										 bounceInRight, rotateIn, rotateInUpLeft, rotateInDownLeft,
										 rotateInUpRight, rotateInDownRight  */

$('.all-content').hide();

/**
*
* Click list
*
**/
$('.content li').click(function(){

	/* Hide Card Front & Card Back from all lists */
	$('.card-front, .card-back').hide();

	/* Remove Class active, Hide and Adding border: none to the lists */
	$('.content li').removeClass('active').hide().css('border','none');
	$(this).addClass('active').show();

	/* Get Background Color */
	bgColor = $('.active .card-back').css('background-color');
	$('.content').css('background-color',bgColor);

	/* Show Close Element & Content of list */
	$('.close, .all-content').show();

	/* Append close element and Add CSS effect "bounceInLeft"*/
	$('.responsive').append('<span class="close">close</span>').addClass(effect);

});


/**
*
* Close element
*
**/
$('.responsive').on('click', '.close', function(){

	/* Remove close button */
	$('.close').remove();

	/* Get Background Color */
	bgColor = $('.active .card-front').css('background-color');

	/* Remove animation effect from ul.content */
	$('.responsive').removeClass(effect);

	/* Hide Close Element & Content of list */
	$('.all-content').hide();

	/*  Remove "active" class from all lists and adding "bounceInLeft" */
	$('.content li').removeClass('active').show().css({ 'border-bottom':'1px solid #2c2c2c',
													    'border-left':'1px solid #2c2c2c' });

	$('.card-front, .card-back').show();
	$('.content').css('background-color',bgColor);

});


});


$(document).ready(function(){
	$('.pancake-holder').on('click', function(){
		$('nav').toggle(500);
		$('.pancake-holder a').toggleClass('pctoggle')
	});

$('.photogallery').on('click', function(e){
	e.preventDefault();
	$('.pglight-box').show();
});
	$('.close').on('click', function(){
		$('.pglight-box').hide();
	});
var contener=$("ul.pgbox");
var wdth=$('.over-hdn').width();
var count=0;
var li_width=contener.find("li").width();
var totel_li=contener.find("li").length; /* total li contener width*/
$("a.pgclick").click(function(e){
		e.preventDefault();
	var dir=$(this).data("dir")
	  if(dir=="right"){
	  count=count+1;
	  }
	  else{
	  count=count-1;
	  }
	  if(count <0 || count>=totel_li){
		  count=0;
		  }
	  contener.animate({marginLeft:'-'+count*wdth+'%'},500);
	  });

var slider=$(".sliderbox ul");
var slcount=0;
var slli_height=slider.find("li").height();
var sltotel_li=slider.find("li").length; /* total li contener width*/
$(".slclick").click(function(e){
		e.preventDefault();
	var drs=$(this).data("type")
	  if(drs=="up"){
	  slcount=slcount-1;
	  }
	  else{
	  slcount=slcount+1;
	  }
	  if(slcount <0 || slcount>=sltotel_li){
		  slcount=0;
		  }
	  slider.animate({marginTop:'-'+slcount*slli_height+'px'},500);
	  });

var pcontener=$("#pgbox");
var pcount=0;
var pli_width=pcontener.find("li").width();
//alert(pli_width);
var ptotel_li=pcontener.find("li").length; /* total li contener width*/
$(".pclick").click(function(e){
		e.preventDefault();
	var dir=$(this).data("type")
	//alert(dir);
	  if(dir=="right"){
	  pcount=pcount-1;
	  }
	  else{
	  pcount=pcount+1;
	  }
	  if(pcount <0 || pcount>=ptotel_li){
		  pcount=0;
		  }
	  pcontener.animate({marginLeft:'-'+pcount*pli_width+'px'},500);
	  });

var vcontener=$("#vgbox");
var vcount=0;
var vli_width=pcontener.find("li").width();
//alert(pli_width);
var vtotel_li=vcontener.find("li").length; /* total li contener width*/
$(".vclick").click(function(e){
		e.preventDefault();
	var dir=$(this).data("type")
	//alert(dir);
	  if(dir=="right"){
	  vcount=vcount-1;
	  }
	  else{
	  vcount=vcount+1;
	  }
	  if(vcount <0 || vcount>=vtotel_li){
		  vcount=0;
		  }
	  vcontener.animate({marginLeft:'-'+vcount*vli_width+'px'},500);
	  });
$('.mnav').on('click', function(){
	$('header .menue').toggle();
});

$('.shareicon').on('click', function(){
	$('header .sharebox').toggle();
});

$('.video-box').on('click', function(){
	$('.utvideo').show();
});
$('.utvideo').on('click', function(){
	$(this).hide();
});



  $(".proicon").click(function() {
$(".rprtrs-bg").toggleClass("adrptrs");
$("body").addClass("ovrdn");
});

 $(".close-rptrs").click(function() {
$(".rprtrs-bg").toggleClass("adrptrs");
$("body").removeClass("ovrdn");
});



jQuery(document).ready(function ($) {
$(window).scroll(function(){

if($(window).scrollTop() > $('.sticky-anchor1').offset().top) {
$('.authorbox').addClass('stick');
}else {
$('.authorbox').removeClass('stick');
}


});
});





jQuery(document).ready(function ($) {
    $(window).load(function () {
        setTimeout(function(){
            $('#preloader').fadeOut('slow', function () {
            });
        },2000);

    });
});
});






jQuery(document).ready(function ($) {
$('a').click(function(){
    $('html, body').animate({
        scrollTop: $( $(this).attr('href') ).offset().top
    }, 500);
    return false;
});
});