/*
// detect browser
var browser = new Object();

browser.version = parseInt(navigator.appVersion);

browser.isNetscape = false; browser.isIE = false;

if (navigator.appName.indexOf('Netscape') != -1) {
	browser.isNetscape = true;
}
else if (navigator.appName.indexOf('Microsoft') != -1) {
	browser.isIE = true;
}

// resize detect
if(!window.saveInnerWidth) {
  window.onresize = resizeMe;
  window.saveInnerWidth = window.innerWidth;
  window.saveInnerHeight = window.innerHeight;
}
// end resize detect
*/

/*
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
//		main_pubs_over = newImage("images/nav/main_pubs-over.gif");
		preloadFlag = true;
	}
}

function resetImages() {
//	document.images("main_resources").focus();
//	changeImages('min_residential', 'images/nav/min_residential.gif');
}


*/


/*
function submitSearch() {
	// insert code here
}

function resizeMe() {
    if (saveInnerWidth < window.innerWidth || saveInnerWidth > window.innerWidth || 
        saveInnerHeight > window.innerHeight || saveInnerHeight < window.innerHeight ) 
    {
        window.history.go(0);
    }
}

function isNetscape() {
	if (browser.isNetscape) {
		return true;
	} else {
		return false;
	}
}

function moveFiletoDisk(thefile, thefilename) {
	var win = window.open("", "win", "width=300,height=250"); // a window object
	with (win.document) {
		open("text/html", "replace");
	 	write("<HTML><HEAD><TITLE>Install" + thefilename + "</TITLE><META HTTP-EQUIV='Refresh' CONTENT='2;URL=" + thefile + "'></HEAD><BODY><div align=center>");
		write("<h1>" + thefilename + "</h1><br />&nbsp;<br />");
		write("<br />&nbsp;<br />&nbsp;<br /><font face='arial, helvetica, geneva' size=1 color='#333333'>Samples may take a few minutes to load <br />over slow internet connections.<br />&nbsp;<br />Requires QuickTime</font></div></body></html>");

		close();
	}	
}
*/


function adjustcolheights() {
	// assumes three columns with col1 normally determining height
	var col1obj = document.getElementById("col1");
	var col2obj = document.getElementById("col2");
	var col3obj = document.getElementById("col3");
	
	var h_col1 = col1obj.clientHeight;
	var h_col2 = col2obj.clientHeight;
	var h_col3 = col3obj.clientHeight;

	if ( (h_col1 < h_col2) || (h_col1 < h_col3) ) {
		if ( h_col2 < h_col3 ) {
			h_new = h_col3;
			col1obj.style.height = (h_new + 100) + "px";
		} else {
			h_new = h_col2;
			col1obj.style.height = (h_new + 100) + "px";
		}
	}
}

var lastFrame = "";
var lastHREF = "";

function showListenFrame(n) {
	if ( lastFrame != "" ) { // remove any existing music frames
		var t = document.getElementById("listendiv");
		lastFrame.removeChild(t);
		lastFrame.childNodes[0].href = lastHREF;
	}
	
	var newHREF = n.href; //anchor from link
	n.href = "#"; // prevent the page from moving to dedicated page, but must restore later
	
	var tparent = n.parentNode; // select parent which is a P tag
	var oNewP = document.createElement("div");
	oNewP.id = "listendiv";
	var oNewIFrame = document.createElement("iframe");
	oNewIFrame.id = "listenframe";
	oNewIFrame.src = newHREF;
	oNewIFrame.marginHeight = "20px";
	oNewP.appendChild(oNewIFrame);
	tparent.appendChild(oNewP);
	
	lastFrame = tparent;
	lastHREF = newHREF;
		
}

function doDownload(n) {
	var newTarget = n.href; //anchor from link
	
	window.location.href = newTarget;		
}