// JavaScript Document
window.onload = loadFunctions;
window.onunload = function() {};

function loadFunctions() {
	expandRightColumn();
	newWinLinks();
	rolloverInit();
}

function submit(){
	alert(this.form.value);
}

//force height of col_right and main to be equal
function expandRightColumn(){
var main = document.getElementById('main');
var rc = document.getElementById('col_right');
var mainHeight = main.clientHeight;
var rcHeight = rc.clientHeight;
if(mainHeight >= rcHeight){
rc.style.height = main.clientHeight + 'px';
}
else{
main.style.height = rc.clientHeight + 'px';
}

}



//begin new window scripts
function newWinLinks() {
	for (var i=0; i<document.links.length; i++) {
		if (document.links[i].className == "newWin") {
			document.links[i].onclick = newWindow;
		}
		else {
			document.links[i].onclick = closeWindow;
		}
	}
}

function newWindow() {

	var artWindow = window.open(this.href,"artWin"+Math.random());

	
	artWindow.focus();
	
	return false;
	
	
}

function closeWindow() {
	if (this.id == "closeWin") {
		window.close();
	}
}

//end new window scripts

//begin rollover scripts

//function rolloverSubmit() {
	//if(form.input.id == "submit") {
		//form.input.src = thisImage;
			//setupRollover(thisImage);
	//}
//}


function rolloverInit() {
	for(var i=0; i<document.images.length; i++) {
		if (document.images[i].parentNode.tagName == "A") {
			setupRollover(document.images[i]);
		}
	}
}


function setupRollover(thisImage) {
	thisImage.outImage = new Image();
	thisImage.outImage.src = thisImage.src;
	thisImage.onmouseout = rollOut;
	
	thisImage.overImage = new Image();
	thisImage.overImage.src = "images/" + thisImage.id + "_over.jpg";
	thisImage.onmouseover = rollOver;
}


function rollOver() {
	this.src = this.overImage.src;
}


function rollOut() {
	this.src = this.outImage.src;
}

function popWindow() {

	var artWindow = window.open('jukebox/band_beast_jukebox.html','welcome','width=280,height=400,left=50,top=100');
	
	artWindow.focus();
	
	return false;
	
	
}

// JavaScript Document

