$(document).ready(function() {

$('.top').hover(function() {
   	var myDrop = $(this).children('.drop2');
	$(myDrop).show(0);
}, function() {
	var myDrop = $(this).children('.drop2');
	$(myDrop).stop(true, true).hide(0);
});

  var newPhoto = new Image();
  newPhoto.src = 'http://www.lifetreeresearch.com/images/nav-bg.jpg';

/*HAD to get ugly to fix ie6*/
$('.top').eq(0).hover(function() {
$('.t1').css({'background-image' : 'url(/images/nav-bg.jpg)' , 'color' : '#ffffff'});
}, function() {
$('.t1').css({'background-image' : 'none' , 'color' : '#777200'});
});

$('.top').eq(1).hover(function() {
$('.t2').css({'background-image' : 'url(/images/nav-bg.jpg)' , 'color' : '#ffffff'});
}, function() {
$('.t2').css({'background-image' : 'none' , 'color' : '#777200'});
});

$('.top').eq(2).hover(function() {
$('.t3').css({'background-image' : 'url(/images/nav-bg.jpg)' , 'color' : '#ffffff'});
}, function() {
$('.t3').css({'background-image' : 'none' , 'color' : '#777200'});
});

$('.top').eq(3).hover(function() {
$('.t4').css({'background-image' : 'url(/images/nav-bg.jpg)' , 'color' : '#ffffff'});
}, function() {
$('.t4').css({'background-image' : 'none' , 'color' : '#777200'});
});

$('.top').eq(4).hover(function() {
$('.t5').css({'background-image' : 'url(/images/nav-bg.jpg)' , 'color' : '#ffffff'});
}, function() {
$('.t5').css({'background-image' : 'none' , 'color' : '#777200'});
});

$('.top').eq(5).hover(function() {
$('.t6').css({'background-image' : 'url(/images/nav-bg.jpg)' , 'color' : '#ffffff'});
}, function() {
$('.t6').css({'background-image' : 'none' , 'color' : '#777200'});
});
  

$('.intro1').oneTime(50, function(){
	$('.intro1').fadeIn(700);
});
$('.intro1').oneTime(6500, function(){
	$('.intro1').fadeOut(500);
});
$('.intro2').oneTime(6900, function(){
	$('.intro2').fadeIn(700);
});
$('.intro2').oneTime(15000, function(){
	$('.intro2').fadeOut(500);
});
$('.intro3').oneTime(15400, function(){
	$('.intro3').fadeIn(700);
});
$('.intro3').oneTime(23500, function(){
	$('.intro3').fadeOut(500);
});
$('.intro4').oneTime(23900, function(){
	$('.intro4').fadeIn(700);
});
$('.intro4').oneTime(31000, function(){
	$('.intro4').fadeOut(500);
});
$('.intro1').oneTime(31400, function(){
	$('.intro1').fadeIn(700);
});

/*Initial news load*/
$('.newsitem').eq(0).animate({'top' : '10px'},800);
$('.newsitem').eq(1).animate({'top' : '118px'},1000);
$('.newsitem').eq(2).animate({'top' : '226px'},1300);
$('.morenews2').css({'display' : 'block' , 'left' : '175px' , 'top' : '-25px' , 'background-image' : 'url(/images/morebtn1.jpg)'});
$('.morenews').css({'display' : 'block' , 'left' : '175px' , 'top' : '-10px' , 'background-image' : 'url(/images/morebtn2.jpg)'});

/*click on more news*/
$('.morenews').click(function() {
$('.newsitem').animate({'top' : '330px'},0);
$('.morenews').css({'display' : 'none'});
$('.morenews2').css({'display' : 'none'});
$('.morenews3').css({'display' : 'block' , 'left' : '175px' , 'top' : '-25px' , 'background-image' : 'url(/images/morebtn1.jpg)'});
$('.morenews1').css({'display' : 'block' , 'left' : '175px' , 'top' : '-10px' , 'background-image' : 'url(/images/morebtn2.jpg)'});
$('.newsitem').eq(3).animate({'top' : '10px'},800);
$('.newsitem').eq(4).animate({'top' : '118px'},1100);
$('.newsitem').eq(5).animate({'top' : '226px'},1400);
});/*done*/

$('.morenews1').click(function() {
$('.newsitem').animate({'top' : '330px'},0);
$('.morenews1').css({'display' : 'none'});
$('.morenews3').css({'display' : 'none'});
$('.morenews').css({'display' : 'block' , 'left' : '175px' , 'top' : '-25px' , 'background-image' : 'url(/images/morebtn1.jpg)'});
$('.morenews2').css({'display' : 'block' , 'left' : '175px' , 'top' : '-10px' , 'background-image' : 'url(/images/morebtn2.jpg)'});
$('.newsitem').eq(6).animate({'top' : '10px'},800);
$('.newsitem').eq(7).animate({'top' : '118px'},1100);
$('.newsitem').eq(8).animate({'top' : '226px'},1400);
}); /*done*/

$('.morenews2').click(function() {
$('.newsitem').animate({'top' : '330px'},0);
$('.morenews').css({'display' : 'none'});
$('.morenews2').css({'display' : 'none'});
$('.morenews1').css({'display' : 'block' , 'left' : '175px' , 'top' : '-25px' , 'background-image' : 'url(/images/morebtn1.jpg)'});
$('.morenews3').css({'display' : 'block' , 'left' : '175px' , 'top' : '-10px' , 'background-image' : 'url(/images/morebtn2.jpg)'});
$('.newsitem').eq(9).animate({'top' : '10px'},800);
$('.newsitem').eq(10).animate({'top' : '118px'},1100);
$('.newsitem').eq(11).animate({'top' : '226px'},1400);
}); /*done*/

/*returns to first 3 entries here 0,1,2*/
$('.morenews3').click(function() {
$('.newsitem').animate({'top' : '330px'},0);
$('.morenews3').css({'display' : 'none'});
$('.morenews1').css({'display' : 'none'});
$('.morenews2').css({'display' : 'block' , 'left' : '175px' , 'top' : '-25px' , 'background-image' : 'url(/images/morebtn1.jpg)'});
$('.morenews').css({'display' : 'block' , 'left' : '175px' , 'top' : '-10px' , 'background-image' : 'url(/images/morebtn2.jpg)'});
$('.newsitem').eq(0).animate({'top' : '10px'},800);
$('.newsitem').eq(1).animate({'top' : '118px'},1100);
$('.newsitem').eq(2).animate({'top' : '226px'},1400);
});

  
});


