function swapImage(oldImage, newImage) { 
	var oldImage = document.getElementById(oldImage).src = 'images/'+newImage; 
}

function addBookmark(title,url) { 
 if (window.sidebar) { 
 	window.sidebar.addPanel(title, url,""); 
 } else if( document.all ) { 
 	window.external.AddFavorite(url, title); 
 } else if( window.opera && window.print ) { 
 	return true; 
	}
}

function ValidateForm(theForm) {
if(theForm.clientcode.value == '') {
	alert('Please fill in the "Proposal Code" field.');
	theForm.clientcode.focus();
	return false;
	}
return true;
}

function map_window(theMap) {
	var mapLink = 'maps/map.php?map=national'
	window.open(mapLink,null,"height=600,width=700,resizable=no,status=no,toolbar=no,titlebar=no"); 
}

// Date and Time functionality

var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")

function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym

var cdate=""+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"";
if (document.all)
document.all.date.innerHTML=cdate;
else if (document.getElementById)
document.getElementById("date").innerHTML=cdate;
else
document.write(cdate);
}
if (!document.all&&!document.getElementById)
getthedate()
function goforit(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000);
}

// Flash Presentation Popup Window

function popFlash() {
	window.open("flash.html",null,"status=no,toolbar=no, height=500, width=700");
}

$(document).ready(function(){
	/* Embed Flash via JS so we can have alternative content if Flash is not installed */
	var so = new SWFObject("flash/banner040808.swf", "banner040808", "700", "330", "8");
	so.addParam("scale", "noscale");
	so.addParam("wmode", "transparent");
	so.write("main-flash");
	
	/* If the flash fails then show the replacement image */
	if(so.write("main-flash") == false) {
		$('#main-flash img').css('display', 'block');
	}
});
