var DOCS = {
	page:{},
	pageClass:'',
	init : function() {
		this.page = $('body');
		this.pageClass = this.page.attr('class');
	},
	primeRollovers : function() {
		$('#nav td a img[src*="_off"]').each(function(i){
			jQuery("<img>").attr("src", this.src.replace('_off', '_on'));
		}).end();
	},
	setHover : function(obj) {
		var item = $(obj);
		item.addClass('hover');
		var img = item.find('img');
		img.attr('src', img.attr('src').replace('_off', '_on'));
	},
	unsetHover : function(obj){
		var item = $(obj);
		item.removeClass('hover');
		var img = item.find('img');
		img.attr('src', img.attr('src').replace('_on', '_off'));
	}
	
}



$(document).ready(function() {

DOCS.init();
DOCS.primeRollovers();


$('#new_release').html("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"180\"><tr><td><a href=\"http://store.hbo.com/detail.php?p=100615&v=hbo_shows_the-alzheimers-project&ecid=PRF-TV2-800395&PA=PRF-TV2-800395\"><img src=\"/docs/docuseries/img_09/content/store/alzheimersdvd_90.jpg\" border=\"0\" style=\"margin: 30px 5px 0px 5px;\"></a></td><td class=\"store_copy\"><a href=\"http://store.hbo.com/detail.php?p=100615&v=hbo_shows_the-alzheimers-project&ecid=PRF-TV2-800395&PA=PRF-TV2-800395\" class=\"store_copy\">The Alzheimer's Project</a><br/><a href=\"http://store.hbo.com/detail.php?p=100615&v=hbo_shows_the-alzheimers-project&ecid=PRF-TV2-800395&PA=PRF-TV2-800395\" class=\"store_copy_link\">Buy the DVD!</a></td></tr></table>") 
        .append(this.div);
	
	
switch (true){  
case $.browser.mozilla : 
$("#info").css('top','181px');
$("#info").css('left','709px');
$('.fullschedule img').css('margin-top','3px');
break; 
case $.browser.safari : 
$("#info").css('top','173px');
$("#info").css('left','707px');
$('.fullschedule img').css('margin-top','3px');
break; 
}
	
	
	
	


	

$("#showme").click(function () {
   
if ($("#info").is(":hidden")) {

$("#info").slideDown("slow");
$("#showme").children('img').attr('src','/docs/docuseries/img_09/template/subnav/otherdocs_down.gif');


}

else {

$("#info").hide();
$("#showme").children('img').attr('src','/docs/docuseries/img_09/template/subnav/otherdocs_on.gif');

   
}

});


$("#showmealso").click(function () {
   
$("#info").hide();
 $("#showme").children('img').attr('src','/docs/docuseries/img_09/template/subnav/otherdocs_on.gif');  


});


	var activeMenu = $('#nav td a img[src*="'+DOCS.pageClass+'"]');
	if (activeMenu.length>0) {
activeMenu.attr('src', activeMenu.attr('src').replace('_off', '_on'));
	}


function onAfter() { 
    $('#tally').html("(<font color=\"#98c801\">"+this.id+" of "+numberOfSlides+"</font>) ") 
        .append(this.alt);

}

function onAfter1() { 
    $('#sp_tally').html("(<font color=\"#98c801\">"+this.id+" of "+numberOfSlides+"</font>) ") 
        .append(this.alt);

}


function onAfter2() { 
    $('#ff_sp_tally').html("(<font color=\"#98c801\">"+this.id+" of "+numberOfSlides+"</font>) ") 
        .append(this.alt);

}


function onAfter3() { 
    $('#sp2_tally').html("(<font color=\"#98c801\">"+this.id+" of "+numberOfSlides+"</font>) ") 
        .append(this.alt);

}

if (location.href.indexOf('video') == -1) {

$('#slides').cycle({ 
    fx:     'fade', 
    speed:  'fast', 
    timeout: 0, 
    next:   '#next', 
    prev:   '#prev',
    after:   onAfter 
});


$('#sp_slides').cycle({ 
    fx:     'fade', 
    speed:  'fast', 
    timeout: 0, 
    next:   '#next', 
    prev:   '#prev',
    after:   onAfter1 
});


$('#ff_sp_slides').cycle({ 
    fx:     'fade', 
    speed:  'fast', 
    timeout: 0, 
    next:   '#next', 
    prev:   '#prev',
    after:   onAfter2 
});

$('#sp2_slides').cycle({ 
    fx:     'fade', 
    speed:  'fast', 
    timeout: 0, 
    next:   '#next', 
    prev:   '#prev',
    after:   onAfter3 
});


}

$('#info a[href*='+program+']').addClass('hiLite');


$("#promo2 a.home_link").mouseover(function () {
	

$('#promo2 a.home_link').addClass('home_link_hilite');

});

$("#promo2 a.home_link").mouseout(function () {
	

$('#promo2 a.home_link').removeClass('home_link_hilite');

});


$("#promo1 a.home_link").mouseover(function () {
	

$('#promo1 a.home_link').addClass('home_link_hilite');

});

$("#promo1 a.home_link").mouseout(function () {
	

$('#promo1 a.home_link').removeClass('home_link_hilite');

});

$("#community_promo a").mouseover(function () {
	

$('#community_promo a').addClass('home_link_hilite');

});

$("#community_promo a").mouseout(function () {
	

$('#community_promo a').removeClass('home_link_hilite');

});



$('#nav td[class !="'+DOCS.pageClass+'"]').hover(
function(){DOCS.setHover(this)},
function(){DOCS.unsetHover(this)}
).end();

});