$(document).ready(function(){
		
		
		//window.resizeTo(screen.availWidth,screen.availHeight-100) ;
		//window.moveTo(0,100);
		
		 $('.no-glow').each(function(){
		 	var bTxt = $(this).html();
			$(this).after('<div class="glow" style="display:none;">' + bTxt + '</div>');
		 });
		
			
		$('.no-glow').mouseover( function () {
			
			$(this).next().fadeIn(1500);
			if ($(".nav li:first").css("opacity") > 0.5){
				$(this).animate({opacity: 1.0}, {duration: 200});
			}
			 
		});
		$('.no-glow').mouseout( function () {
		
		 	$(this).next().fadeOut(1500);
			if ($(".nav li:first").css("opacity")> 0.5){
				$(this).animate({opacity: 0.7}, {duration: 200});
			}
				
		});
		
		$('.slide a').preload({
      		onFinish: function(){anime();}
		    });

		$(".slide").css({opacity: 0.0});
		$(".nav li").each(function(){
			$(this).css({opacity: 0.0, position: "absolute", top: "10px"}).hide();
			//$(this).css({position: "absolute", top: "10px"});
			
		});

		
		
		ToggleNav(35, 0.7, 400, 75);
		
	
 });
function anime(){

//easing; swing easeInOutCubic easeInOutQuint easeOutCubic 
	$("#1").animate({opacity: 1.0, top: "145px", left: "230px"}, {duration: 1800, queue: "slides", scope:"ss1", preDelay: 0, easing: 'easeInOutCubic'});
	$("#2").animate({opacity: 1.0, top: "145px", left: "395px"}, {duration: 1800, queue: "slides", scope:"ss1", preDelay: 75, easing: 'easeInOutCubic'});
	$("#3").animate({opacity: 1.0, top: "145px", left: "560px"}, {duration: 1800, queue: "slides", scope:"ss1", preDelay: 150, easing: 'easeInOutCubic'});
	$("#4").animate({opacity: 1.0, top: "145px", left: "725px"}, {duration: 1800, queue: "slides", scope:"ss1", preDelay: 225, easing: 'easeInOutCubic'});
	$("#5").animate({opacity: 1.0, top: "247px", left: "230px"}, {duration: 1800, queue: "slides", scope:"ss1", preDelay: 300, easing: 'easeInOutCubic'});
	$("#6").animate({opacity: 1.0, top: "247px", left: "395px"}, {duration: 1800, queue: "slides", scope:"ss1", preDelay: 375, easing: 'easeInOutCubic'});
	$("#7").animate({opacity: 1.0, top: "247px", left: "560px"}, {duration: 1800, queue: "slides", scope:"ss1", preDelay: 375, easing: 'easeInOutCubic'});
	$("#8").animate({opacity: 1.0, top: "247px", left: "725px"}, {duration: 1800, queue: "slides", scope:"ss1", preDelay: 375, easing: 'easeInOutCubic'});
		//

}

function hideNav(){
	$(this).hide();
}

function ToggleNav(ht, op, tm, dy){
	var hgt = ht;
	var dly = dy;
	if ($(".nav li:first").css("opacity") > 0){
	
		$(".nav li").each(function(){
			$(this).animate({opacity: 0.0, top: "20px"}, {duration: 500, queue: "navup", scope: "up", preDelay: 75, complete: hideNav})
			dly += 75;
		});

	}else{
	
		$(".nav li").each(function(){
			$(this).show();
			$(this).animate({top: "+=" + hgt + "px", opacity: op}, {duration: tm, queue: "navdn", scope: "dn", preDelay: dly});
			$(this).animate({opacity: 1.0}, {duration: 100, queue: "nav"});
			$(this).animate({opacity: 0.8}, {duration: 100, queue: "nav"});
			hgt += ht;
			dly += dy;
		});
	}
	
}
