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/?v=hbo_shows_programming_hbo-documentaries&ecid=PRF-TV2-800363&PA=PRF-TV2-800363\"><img src=\" /docs/docuseries/img/content/store/thankyoumrpresdvd_90.jpg\" border=\"0\" style=\"margin: 30px 0px 0px 5px;\"></a></td><td class=\"store_copy\"><a href=\"http://store.hbo.com/?v=hbo_shows_programming_hbo-documentaries&ecid=PRF-TV2-800363&PA=PRF-TV2-800363\" class=\"store_copy\">Thank You, Mr President: Helen Thomas at the White House</a><br/><a href=\"http://store.hbo.com/?v=hbo_shows_programming_hbo-documentaries&ecid=PRF-TV2-800363&PA=PRF-TV2-800363\" 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','181px');
$("#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/template/subnav/otherdocs_down.gif');


}

else {

$("#info").hide();
$("#showme").children('img').attr('src','/docs/docuseries/img/template/subnav/otherdocs_on.gif');

   
}

});


$("#showmealso").click(function () {
   
$("#info").hide();
 $("#showme").children('img').attr('src','/docs/docuseries/img/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');

});


if (location.href.indexOf('baghdadhigh') != -1) {



$('#get_involved1').css("height","200px");
$('.get_involved_text').css("font-size","10px");


}


if (location.href.indexOf('wearetogether') != -1) {


if (location.href.indexOf('resources') != -1) {

$('#get_involved1').css("height","150px");

} else {
	
$('#get_involved1').css("height","190px");
	
}

$('#get_involved2').css("height","100px");
$('.get_involved_text').css("font-size","10px");


}


if (location.href.indexOf('therecruiter') != -1) {



$('#trailer0').after("<div style=\"padding: 0px 10px 20px 10px;color: #d9cdcd;font-family: georgia;font-size: 12px;line-height: 18px;\">Watch a video update on Lauren, one year later.</div>");


$('#get_involved2').css("height","230px");
$('.get_involved_text').css("font-size","10px");


}


if (location.href.indexOf('theblacklist') != -1) {

$('#get_involved').css("height","260px").css("background-image","url(/docs/docuseries/img/side/exclusive_feature_h_.gif)");
$('.get_involved_text').css("font-size","10px");

$('#get_involved1').css("height","30px").after("<div><a href=\"http://www.whosonyourblacklist.com\"><img src=\"/docs/docuseries/img/side/whoisonyourblacklist.jpg\" border=\"0\" width=\"191\" Height=\"273\"></a></div>");



}


$('#nav td[class !="'+DOCS.pageClass+'"]').hover(
function(){DOCS.setHover(this)},
function(){DOCS.unsetHover(this)}
).end();

});