var userName = "danpiccolo";
var hostName = "gmail";
var extension = "com";


// most spam spiders don't read javascript files, so this is a crafty way to 
// spam proof the page.
function spamProofEmail() {
	var genericEmail = userName + "&#64;" + hostName + "." + extension;
	document.write ("<a href=\"mailto:");
	for (var x=0;x<genericEmail.length;x++)
	{
		document.write(genericEmail.charAt(x));
	}
	document.write ("\">");
	//for (var y=0;y<genericEmail.length;y++)
	//{
	//	document.write(genericEmail.charAt(y));
	//}
	document.write ("contact me</a>");
}



function toggleNavigation() {
	var navigationObject = document.getElementById("navigationContent");
	var calendarObject = document.getElementById("calendarContent");
	if(navigationObject.style.display == "none" || navigationObject.style.display == "") navigationObject.style.display = "block";
	else navigationObject.style.display = "none";
	if(calendarObject != null && (calendarObject.style.display != "none" || calendarObject.style.display != "")) calendarObject.style.display = "none";
}


function setImageHeader()
{
	randomNum = Math.floor ((Math.random()*10))
	bannerImage = document.getElementById("imageHeader");
	bannerImage.src = "images/header" + randomNum + ".jpg";
}

function windowOpener(destination)
{
	window.open (destination, "external"); 
	window.location=window.location;
}

function pixWindow(pix)
{
	pixPopup = window.open(pix, "pixWindow", "width=350,height=350");
	window.location=window.location;
	pixPopup.focus();
}

function switchPool(pool) {
	if (document.switcher.poolList.value == "aim") {
		document.getElementById("dino").style.display = "none";
		document.getElementById("aim").style.display = "block";
		if(window.location.search != "") {
			var newURL = window.location.href;
			newURL = newURL.substring(0, newURL.indexOf('?'));
			
			window.location = newURL;
		}
	}
	else if(document.switcher.poolList.value == "dino"){
		document.getElementById("aim").style.display = "none";
		document.getElementById("dino").style.display = "block";
		if (window.location.search =="") {
			window.location = window.location + "?pool=dino";
		}
	}

}

function moveData() {
	var theIframe = document.getElementById("datagatherer");
	var theSource = null;
	if(theIframe) theSource = theIframe.contentWindow.document.getElementById("content");
	var theDestination = document.getElementById("content");
	
	if(theSource && theDestination) {
		theDestination.innerHTML = "";
		theDestination.innerHTML = theSource.innerHTML;
	}
}
