//var $j = jQuery.noConflict();
this.toggleFun = function(){
	$(".toggle-container").hide();
   	$(".trigger").toggle(function(e){
		e.preventDefault();
		$(this).addClass("active");
		}, function () {
		$(this).removeClass("active");    
         });
         $(".trigger").click(function(){
         $(this).closest("div").next(".toggle-container").slideToggle("fast");
		 return false;
          });
};
this.memberLogin = function(){
	$("#slidingTopContent").hide();
	$("#slidingTopTrigger").live("click", function(event) {
	$("#slidingTopContent").slideToggle("fast");

	});
	$("#slidingTopWrap").mouseleave(function() {
		$("#slidingTopContent").slideUp();
					  
	});
	};

this.imageHover = function(){
/* CONFIG */		
var $project_item = jQuery('.portfolioimg');
$project_item.hover (function(e) {
		$(".portfoliocontent").stop(true).fadeTo("slow", 0.75);
		$(this).css({'border-color': '#B7C633'});
		}, function () {
	$(".portfoliocontent").stop(true).fadeTo("slow", 0);
	$(this).css({'border-color': '#ccc'});
		});
		
};

this.portfolioControls = function(){
/* CONFIG */		
var $project_item = jQuery('#portfolio');
$project_item.mouseenter (function(e) {
		$(".carousel-control").stop(true).fadeTo("slow", 1);
		}).mouseleave(function() {
	$(".carousel-control").stop(true).fadeTo("slow", 0);
		});
		
};

$(document).ready(function() {
	toggleFun();
	memberLogin();
	portfolioControls();
	imageHover();
	$("#mainnav li").hover(function () {$(this).addClass("active");},function () {$(this).removeClass("active");});
	$(".servicebox a,.click-overlay a,.servicesub a").bigTarget({hoverClass: 'over',clickZone : 'div:eq(0)' });	
	if ($('#news').length != 0) {
	var options = {newsList: "#news",tickerRate: 20,startDelay: 1,loopDelay: 5000,placeHolder1: " _"};$('#news').newsTicker(options);
	};
	$("div#slideshow").carousel({autoSlide: true,effect: 'fade',loop: true,autoSlideInterval: 10000,pagination: true,nextBtn:false,prevBtn:false});
	$("div#latestwebdesigns").carousel({autoSlide: true,effect: 'fade',loop: true,autoSlideInterval: 5000,pagination: false,nextBtn:true,prevBtn:true});
	$("div#portfolio-carousel").carousel({autoSlide: true,effect: 'fade',loop: true,autoSlideInterval: 8000,pagination: true});
	 $('a.expand[href*=#]').click(function() {if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {var $target = $(this.hash);$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');if ($target.length) {var targetOffset = $target.offset().top - 50;$('html,body').animate({scrollTop: targetOffset}, 1000);return false;}}}); 

$('.tooltip').tipsy({fade:true,gravity: 's'});
	$("div#about, div#benefits, #moreservices").hide();
//$(".js #featured-slider, .js div#recent-projects, .js div#from-blog div.content").show(); 
$(".carousel-control,.portfoliocontent").hide();
});