//event listeners:
function addListener(element, event, theFunction){
	var theElement = document.getElementById(element);
	
	//check to see if we're using a browser which isn't IE:
	if(theElement.addEventListener){
		theElement.addEventListener(event, theFunction, false);
	}
	//if we're using IE:
	else if(theElement.attachEvent){
		theElement.attachEvent('on' + event, theFunction, false);
	}
	//we're using something else...
	else{
		//gotta figure out a way to make this dynamicish....
		theElement.onclick = leaderboardAd;
	}
	
}

function player(){
	window.open("stream.html", "stream_win", "width=495, height=320, scrollbars=no, titlebar=no, toolbar=no, resizable=no, menubar=no, dependant=no");
	}
	
function expand(){
	var contentHeight = document.getElementById("content").offsetHeight -2;
	var rightHeight = document.getElementById("right_rail").offsetHeight -2;
	var height = 0;
	
	if(contentHeight < rightHeight){
		document.getElementById("content").style.height = rightHeight - 4 + 'px';
		height = rightHeight;
	}
	else{
		document.getElementById("right_rail").style.height = contentHeight + 'px';
		height = contentHeight;
	}
	
	document.getElementById("left_rail").style.height = height + "px";
	
	addListener('leaderboard_top', 'click', leaderboardAd);
	addListener('right_ad', 'click', sideAd);
	addListener('leaderboard_bottom', 'click', bottomAd);
}

function popup(urlstring, height, width){
	window.open(urlstring, "imageview", "height=" + height + ", width=" + width);
	
}

function #leaderboard_top(){
	<form name="openlocation">
<input type="text" name="href" value="http:/www.livenation.com/">
<input type="button" value="Go To" onClick="location.href=document.openlocation.href.value;; ">
</form><!-- End Open Location Form -->);
}

function sideAd(){
	var urlToOpen = "http://www.mozilla.com/en-US/thunderbird/";
	window.open(urlToOpen, "thunderbird", "height=600, width=600, scrollbars=yes, titlebar=yes, toolbar=yes, resizable=yes");
}

function bottomAd(){
	var urlToOpen = "http://www.operamini.com/";
	window.open(urlToOpen, "operaMini", "height=600, width=600, scrollbars=yes, titlebar=yes, toolbar=yes, resizable=yes");
}