var top_story_ads = new Array(
    "jobs",
    "homes",
    "autos"
);

var top_nav_id = new Array(
    "home",
    "banner",
    "marketplace",
    "community",
    "extras",
    "service"
);

/*******************************************************************************
    The onload attached event handler. Anything that should run once the page is 
    loaded, place here in this anonymous function.
*******************************************************************************/
window.onload = function() {
    for (i = 0; i < top_nav_id.length; i ++) {
        classes = new Array();
        if (top_nav_id[i] == story_type) classes.push("selected");
        if (i == (top_nav_id.length - 1)) classes.push("last");

        document.getElementById(top_nav_id[i]).className = classes.join(' ');
    }
    show_sub_nav();
}

function view_ad(arg) {
    for (i = 0; i < top_story_ads.length; i ++) {
        if (document.getElementById("ad-block-"  + top_story_ads[i])) {
            document.getElementById("ad-block-"  + top_story_ads[i]).style.display = "none";
            document.getElementById("ad-button-" + top_story_ads[i]).className     = "";
            
        }
        document.getElementById("ad-block-"  + arg).style.display = "block";
        document.getElementById("ad-button-" + arg).className     = "selected";
    }
}

function show_sub_nav(arg) {
    arg = (arg) ? arg : arg = story_type;
    document.getElementById("top-sub-nav-blank").style.display  = "";
    for (i = 0; i < top_nav_id.length; i ++) {
        document.getElementById("top-sub-nav-" + top_nav_id[i]).style.display = "";
    }
    document.getElementById("top-sub-nav-" + arg).style.display = "block";
}






// clear form box <input onBlur="alterNate(this)" onFocus="alterNate(this)">
function alterNate(elm){
	if (!elm.base) elm.base = elm.value
	if (elm.value == elm.base) elm.value = "";
	else if (elm.value == "") elm.value = elm.base;
}

					Months = new Array(); Months[0]="January"; Months[1]="February"; Months[2]="March"; Months[3]="April"; Months[4]="May"; Months[5]="June"; Months[6]="July"; Months[7]="August"; Months[8]="September"; Months[9]="October"; Months[10]="November"; Months[11]="December";
					var timeVal=new Date();
					var day=timeVal.getDate();
					var mo=timeVal.getMonth();
					var year=timeVal.getYear();
					var showMonth=Months[timeVal.getMonth()];
					var thedate = (" "+showMonth+" "+day+" ");
					function showDate(){
					var timeValue = thedate+" ";
					document.write(timeValue);
					}
//-->
