// JavaScript Document

var $j = jQuery.noConflict();
var count = 0;
var site = "http://localhost/photoonet/html/";

(function($){
// +++++++++++++++++++++++++++ //
	

	$('#menu li a').hover(function(){
		$(this).addClass("hov");
		}, function(){
		$(this).removeClass("hov")
	});
	
	$(window).load(function() {
        $('#slider').nivoSlider();
		$('.testt div:first-child').show();
    });
	
	$('.abt li').click(function(){
		var ii = $(this).index();	
			ii++;
		$('.testt div').slideUp('slow');
		$('.testt div:nth-child('+ii+')').slideDown('slow');
	});
	
	$('.img-display img, #latest img, .bor3 img').mouseover(function () {
		//alert('hi hi');
    	$(this).css("border-color","#666");
  	}).mouseout(function(){
		$(this).css("border-color","#444");
	});

	$('#about p').hide();
	$('#about h3').css('cursor','pointer');
	$('#about h3').click(function(){
		$('#about p').slideUp().fadeOut();
		$(this).next('p').slideDown();
	});
	
	// When a link is clicked
		$("a.tab").click(function () {
			// switch all tabs off
			$(".active").removeClass("active");
			// switch this tab on
			$(this).addClass("active");
			// slide all content up
			$(".content").slideUp();
			// slide this content up
			var content_show = $(this).attr("title");
			$("#"+content_show).slideDown();
		});
		
		// +++++++++++++++++++++++++++ //
		var hoz = 0;
		var vrt;
		var num;
		$('#social').find('li').each(function(){
			$(this).css({'margin':'0 1px 0 0', 'backgroundPosition': '-'+hoz+'px bottom'});
			hoz+=27;
		});
		$('#social li').hover(function(){
			num = $('#social li').index(this);
			vrt=27*num * -1;
			num+=1;
			$('#social li:nth-child('+num+')').css({'backgroundPosition':''+vrt+'px top', 'height':'44'})
		},function(){
			$('#social li:nth-child('+num+')').css({'backgroundPosition':''+vrt+'px bottom', 'height':'26'})
		});
	
})(jQuery);

	// +++++++++++++++++++++++++++ //
	$j(".lightbox-image").append("<span></span>");
	
	$j(".lightbox-image").hover(function(){
		$j(this).find("img").stop().animate({opacity:0.5}, "normal")
	}, function(){
		$j(this).find("img").stop().animate({opacity:1}, "normal")
	});
	
	

	
	// +++++++++++++++++++++++++++ //
	var mh = 0;
	var sh;
	$j('#gallery img').each(function(){
		sh = $j(this).height();
		var sw = $j(this).width();
		$j('#gallery li').width(sw);
		if(sh>mh){
			mh = sh;
		}
	});
	$j('#gallery li').height(mh+20);
	$j('#gallery a').lightBox();


function goto(indx){
	var url = indx.options[indx.selectedIndex].value;
	if(url.length==0 || url==0){
		if(url!=0){
			window.location = site;
		}
	}
	else{
		window.location = url;
	}
}
