var oas = 'http://ads.mgnetwork.com/RealMedia/ads/';
var RN = new String (Math.random());
var RNS = RN.substring (2,11);

function DisplayOasAd (position) {
	var oaspage = sitepage + '/1' + RNS + '@' + position;
	if (_version < 11) {
		document.write ('<a href="' + oas + 'click_nx.ads/' + oaspage + '" target="_top"><img src="' + oas + 'adstream_nx.ads/' + oaspage + '" border="0"></a>');
	}
	else {
		document.write ('<script language="JavaScript1.1" src="' + oas + 'adstream_jx.ads/' + oaspage + '"><\/script>');
	}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function addIEFavorite() {
	if (window.external) {
		external.AddFavorite(location.href, 'WJBF.com')
	}
	else {
		alert("Oops, your browser doesn't support this feature.\n" +
		"If you are using Netscape Navigator, click Bookmarks\n" +
		"and then Add Bookmark to add this site to your favorites.");
	}
}

function Vote() {
	isChecked = false;
	targetWin = "pollpage";
	for( i = 0; i < document.voteform.ITEM1.length; i++ ) {
		if (document.voteform.ITEM1[i].checked) {
			isChecked = true;
		}
	}
	if(isChecked) {
		window.open("", targetWin,"toolbar=no,scrollbars=yes,directories=no, status=no,menubar=no,resizable=no,width=400,height=400")
		document.voteform.target = targetWin;
		document.voteform.submit();
	}
	else {
		alert("Sorry, but you forgot to vote\nPlease try again");
	}
}

function VoteWindow() {
	window.open("","pollpage","toolbar=no,scrollbars=yes,directories=no,status=no,menubar=no,resizable=no,width=400,height=400");
}

function createWindow(pageURL,wWidth,hHeight) {
	window.open(pageURL, "secondWindow", "toolbar=no,scrollbars=yes,directories=no, status=no,menubar=no,resizable=no,width=" + wWidth + ",height=" + hHeight)
}

function setHeaderImage() {
	var imgs = new Array (
		"monticello.jpg",
		"rotunda.jpg",
		"history.jpg",
		"skyline.jpg",
		"ruins.jpg",
		"downtown.jpg",
		"courthouse.jpg"
	);
	var imageNumber=Math.floor((Math.random() * imgs.length)%imgs.length);
	document.header.src = "http://media.gatewayva.com/cdp/siteimages/topimages/" + imgs[imageNumber];
}

function writeDate() {
	var todaysDate = new Date();
	var today = todaysDate.getDay();
		if (today == 0) {day = "Sun"};
		if (today == 1) {day = "Mon"};
		if (today == 2) {day = "Tue"};
		if (today == 3) {day = "Wed"};
		if (today == 4) {day = "Thu"};
		if (today == 5) {day = "Fri"};
		if (today == 6) {day = "Sat"};
	var thisMonth = todaysDate.getMonth();
		if (thisMonth == 0) {month = "Jan"};
		if (thisMonth == 1) {month = "Feb"};
		if (thisMonth == 2) {month = "Mar"};
		if (thisMonth == 3) {month = "Apr"};
		if (thisMonth == 4) {month = "May"};
		if (thisMonth == 5) {month = "Jun"};
		if (thisMonth == 6) {month = "Jul"};
		if (thisMonth == 7) {month = "Aug"};
		if (thisMonth == 8) {month = "Sep"};
		if (thisMonth == 9) {month = "Oct"};
		if (thisMonth == 10) {month = "Nov"};
		if (thisMonth == 11) {month = "Dec"};
	document.write(day + ', ' + month + ' ' + todaysDate.getDate() + ', ' + todaysDate.getFullYear());
}

function showDate() {
	var todaysDate = new Date();
	var today = todaysDate.getDay();
		if (today == 0) {day = "SUN."};
		if (today == 1) {day = "MON."};
		if (today == 2) {day = "TUE."};
		if (today == 3) {day = "WED."};
		if (today == 4) {day = "THU."};
		if (today == 5) {day = "FRI."};
		if (today == 6) {day = "SAT."};
	var thisMonth = todaysDate.getMonth();
		if (thisMonth == 0) {month = "JANUARY"};
		if (thisMonth == 1) {month = "FEBRUARY"};
		if (thisMonth == 2) {month = "MARCH"};
		if (thisMonth == 3) {month = "APRIL"};
		if (thisMonth == 4) {month = "MAY"};
		if (thisMonth == 5) {month = "JUNE"};
		if (thisMonth == 6) {month = "JULY"};
		if (thisMonth == 7) {month = "AUGUST"};
		if (thisMonth == 8) {month = "SEPTEMBER"};
		if (thisMonth == 9) {month = "OCTOBER"};
		if (thisMonth == 10) {month = "NOVEMBER"};
		if (thisMonth == 11) {month = "DECEMBER"};
	document.write('<span class="date">' + month + ' ' + todaysDate.getDate() + ', ' + todaysDate.getFullYear() + '</span>');
}


