function component_nav() {
    var show = 'radionews'; //init category to show
    $(".fed_items").hide();
    $(".pager_nav").hide();
    $("."+show+"_1").show();
    $("#nav_"+show).show();
    $("#fed_nav_selector li a").hover(
      function () {
        $(this).addClass('hilite');
      }, 
      function () {
        $(this).removeClass('hilite');
      }
    );
    $("#fed_nav_selector li").hover(
      function () {
        $(this).addClass('hilite');
      }, 
      function () {
        $(this).removeClass('hilite');
      }
    );
    $("#fed_nav_selector li a").click(function () {
	$("#fed_nav_selector li").removeClass('morehilite');
	$(this).parent().addClass('morehilite');
        $(".pager_nav").hide();
	var show = $(this).attr("rel");
        //need to interact w the pager
	var currentpage = $("#nav_"+show+" .pager_hilite").attr("rel");
	if(currentpage == undefined) {
		currentpage = "1";
	}
	$(".fed_items").hide();
	$("."+show+"_"+currentpage).show();
	$("#nav_"+show).show();
    });
    //unhide the nav content area, prevents appearance of stacking up onload ie7
    $("#fed_global_nav .right_slot").show();
}

function page_hilite() {
    //the var afns_root should be set at the top level, say in the page container 'onion' or 'content'
    $(function() {
        $('.map').maphilight();
           $("#fed_image area").click(function(the_event){
                page_x = the_event.pageX;
                page_y = the_event.pageY;
		var nid = $(this).attr("rel");
		var url = $(this).attr("alt");
		var image = "/"+afns_root+"/themes/onion/custom/afns/historicalarchives/images/previews/"+nid+".jpg";
		$(".preview_image").replaceWith('<span class="preview_image"><a href="'+url+'" class="readmore">Read More >></a></span>');
                $('#status').html(the_event.pageX +', '+ the_event.pageY);

                if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){
                $("#article_preview").css({
			position:"absolute",
			left:page_x - 120,
			top:page_y - 120
			});
                var t = window.setTimeout("ie_image(\""+image+"\")",100);
		$("#article_preview").show();
	        }
	        else {
                $('#article_preview').css({
			position:"absolute",
			left:page_x - 120,
			top:page_y - 120,
			background:"url("+image+")"
			});
                $('#article_preview').toggle();
	        }
           });
        $("#article_preview .close").click(function(){
            $("#article_preview").hide();
        });
    });
}

function ie_image(image) {
    $("#article_preview").css({background:"url("+image+")"});
}

function Person( name, descrip, image ){
	this.name=name;
	this.image=image;
	this.descrip=descrip;
}
function fauxpersonals() {
    var personals = new Array();

    personals.push(
        new Person(
	'batgirl73',
	"In my bedroom, you'll find: \"My laptop, some fish, clothes, pillows, a stuffed dog named Buckley after Jeff Buckley.\"",
	'<img src="http://photos.fastcupid.com/ss/featured/internal/08/1308887_76321.jpg" border="0" />'));
    personals.push(
        new Person(
	'tarroc',
	"Most humbling moment: \"One night my roommates thought it would be fun to completely duck tape the door to my room.\"",
	'<img src="http://photos.fastcupid.com/ss/featured/internal/46/624600_22842.jpg" border="0" />'));
    personals.push(
        new Person(
	'Liberal_Lover23',
	"Last great book I read: \"Germinal by Amil Zolla.\"",
	'<img src="http://photos.fastcupid.com/ss/featured/internal/70/2070640_42357.jpg" border="0" />'));
    personals.push(
        new Person(
	'80spopwashup',
	"Last great book I read: \"The Great Gatsby, and considering 'great' is in the title, it seems appropriate.\"",
	'<img src="http://photos.fastcupid.com/ss/featured/internal/55/23555_47768.jpg" border="0" />'));

    var num = Math.round((personals.length-1)*Math.random());
    getfauxpersonal(personals[num]);
}
function getfauxpersonal(person) {
    $("#personals_content").html('<p><b>'+person.name+'</b></p><br /><p><a href="http://personals.theonion.com" target="_blank">'+person.image+'</a></p><br /><p>'+person.descrip+'</p>');
}
