// JavaScript Document



$(document).ready(function() {
	
/*$(function positionFooterFX(){
	positionFooter(); 
	function positionFooter(){
		if($(document.body).height() < $(window).height()){
			$(".foter").css({position: "absolute",top:($(window).scrollTop()+$(window).height()-$(".foter").height())+"px"})
		}	
	}
 
	$(window)
		.scroll(positionFooter)
		.resize(positionFooter)
});*/
	
	if ($('.slider img').length !=0) {
	$(window).load(function() {
		$('.slider').nivoSlider({
			effect:'random', //Specify sets like: 'fold,fade,sliceDown'
			slices:10,
			animSpeed:500,
			pauseTime:3000,
			startSlide:0, //Set starting Slide (0 index)
			directionNav:false, //Next & Prev
			directionNavHide:true, //Only show on hover
			controlNav:false, //1,2,3...
			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:false, //Use left & right arrows
			pauseOnHover:true, //Stop animation while hovering
			manualAdvance:false, //Force manual transitions
			captionOpacity:0.8, //Universal caption opacity
			beforeChange: function(){},
			afterChange: function(){},
			slideshowEnd: function(){} //Triggers after all slides have been shown
		});
	});
	}
	
	if ($('.bannerBox img').length !=0) {
	$(window).load(function() {
		$('.bannerBox').nivoSlider({
			effect:'random', //Specify sets like: 'fold,fade,sliceDown'
			slices:55,
			animSpeed:300,
			pauseTime:5000,
			startSlide:0, //Set starting Slide (0 index)
			directionNav:false, //Next & Prev
			directionNavHide:true, //Only show on hover
			controlNav:false, //1,2,3...
			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:false, //Use left & right arrows
			pauseOnHover:false, //Stop animation while hovering
			manualAdvance:false, //Force manual transitions
			captionOpacity:0.8, //Universal caption opacity
			beforeChange: function(){},
			afterChange: function(){},
			slideshowEnd: function(){} //Triggers after all slides have been shown
		});
	});
	}
	
	$("#topMenu li").hide().each(function(index){
		var $li = $(this);

			setTimeout(function() {
				$li.fadeTo("slow", 1);
			}, index * 200);
	});
	
	$("#topMenu li").hover(function(){
		$(this).find('a').animate({
			'height': '35px'
		}, "fast");
	}, function(){
		$(this).find('a').animate({
			'height': '25px'
		}, "fast");
	});
	
	$("#mainMenu li a").hover(function(){
		$(this).animate({
			'padding-left': '+=5px'
		}, "fast");
	}, function(){
		$(this).animate({
			'padding-left': '-=5px'
		}, "fast");
	});
	
	/*$('#buttomMenu li a').click(function() {
        var slideLink = $(this).attr('rel');
		//var title = $('#tab' + id).attr('title');
		//$('.tabHider').hide();
		//$('#infoTab').text(' - ' + title);
		//$('.linki').hide();
		$('.linki a').hide();
     	$('.linki a.pID'+slideLink).show();
        // alert(id);
     	return false;
   });*/
   
   /*$('#buttomMenu li a').click(function() {
     	return false;
   });*/
   $('.linki a').hide();
   $("#buttomMenu li a").hover(function(){
		$(this).animate({
			'height': '30px'
		}, "fast");
	}, function(){
		$(this).animate({
			'height': '22px'
		}, "fast");
	});
	
	$('.linki a.blue').click(function() {
		var siteLink = $(this).attr('id');
		$('.linki a.blue').hide();
     	$(".linki a[rel^='"+ siteLink + "']").show();
     	return false;
   });
   
   $(".linki").hover(function(){
		
	}, function(){
		$('.linki a').hide();
	});
	
	$(".referBox a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
	
	//positionFooterFX();
	
	$(".referBox a:nth-child(4n)").css('margin-right', '0px');
	
});
