jQuery.noConflict();

(function($){

	$("div.hero").click(function() {
		$(".hero_text").hide();						 
		$(".hero").width(40);
		$(".hero").removeClass("hero_selected");		
		$(this).addClass("hero_selected");
		$(this).width(760).show("slide", { direction: "right" }, 1000);
		$(this).children("div").fadeIn(1000, 'swing');
	});
		
		$('div.hero_text a').click(function(event) { event.stopPropagation(); });

        $(".tweet").tweet({
            username: "inteconcept",
            //join_text: "auto",
            avatar_size: 39,
            count: 3,
            auto_join_text_default: "we said,",
            auto_join_text_ed: "we",
            auto_join_text_ing: "we were",
            auto_join_text_reply: "we replied to",
            auto_join_text_url: "we were checking out",
            loading_text: "loading tweets..."
        });
		
$(window).load(function() {
    $('#slider').nivoSlider({
        effect:'fold', // Specify sets like: 'fold,fade,sliceDown'
        slices:20, // For slice animations
        boxCols: 8, // For box animations
        boxRows: 4, // For box animations
        animSpeed:500, // Slide transition speed
        pauseTime:7000, // How long each slide will show
        startSlide:0, // Set starting Slide (0 index)
        directionNav:true, // Next & Prev navigation
        directionNavHide:true, // Only show on hover
        controlNav:true, // 1,2,3... navigation
        controlNavThumbs:false, // Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, // Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', // Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
        keyboardNav:true, // Use left & right arrows
        pauseOnHover:true, // Stop animation while hovering
        manualAdvance:false, // Force manual transitions
        captionOpacity:0.8, // Universal caption opacity
        prevText: 'Prev', // Prev directionNav text
        nextText: 'Next', // Next directionNav text
        beforeChange: function(){}, // Triggers before a slide transition
        afterChange: function(){}, // Triggers after a slide transition
        slideshowEnd: function(){}, // Triggers after all slides have been shown
        lastSlide: function(){}, // Triggers when last slide is shown
        afterLoad: function(){} // Triggers when slider has loaded
    });
});

$("a.colorbox").colorbox({iframe:true, innerWidth:640, innerHeight:385});

$('div.cube').mouseover(function() {
	$(this).addClass('cube_hover');
	$(this).find(".cube_title").addClass('visible');
});

$('div.cube').mouseout(function() {
	$(this).removeClass('cube_hover');
	$(this).find(".cube_title").removeClass('visible');

});


$("div.cube").click(function() {
	$('#middle').find(".profile").fadeOut(1000, 'swing');
	
	var $link= $(this).find('a').attr("href");
	if ($link != "#") {
		window.location = $link;
	}
							 
	
	var $profile = $(this).attr("profile");
   $('#middle').find("."+$profile).fadeIn(1000, 'swing');
	return false;
});

$("li.close").click(function() {
	$('#middle').find(".profile").fadeOut(1000, 'swing');						 
});

$("li.next").click(function() {
	$(this).parents(".profile").next().next().fadeIn(1000, 'swing');
	$(this).parents(".profile").fadeOut(1000, 'swing');
});

$("li.pre").click(function() {
	$(this).parents(".profile").prev().prev().fadeIn(1000, 'swing');
	$(this).parents(".profile").fadeOut(1000, 'swing');
});

$(window).load(function() {
	var url=window.location;  
    var $anchor=url.hash.substring(1); 
	if ($anchor != "") {
	$('#middle').find(".cube").fadeOut(1000, 'swing');			 
	$('#middle').find("."+$anchor).fadeIn(1000, 'swing');
	}
});

$("#sub_menu ul li a").click(function() {
	var $anchor = this.hash.substring(1);
	$('#middle').find(".cube").fadeOut(1000, 'swing');			 
	$('#middle').find("."+$anchor).fadeIn(1000, 'swing');
});

$(".grid").click(function() {
	$('#middle').find(".cube").show();
});

			





})(jQuery);

