// NOTE: We utilize the getQueryParamValue() function from the swfobject script
// here -- be sure it is loaded into the page.
//
// QueryString params:
//    lnk --> return link for the back button
//    sec --> code for return section ("exh"|"art")

function drawBackButton() {
	 
	var returnLink = getQueryParamValue("lnk");
	var returnSection = getQueryParamValue("sec");
	var buttonStr;
	
	if (returnSection=="exh") {
		buttonStr = "Back to Exhibition";
	} else if (returnSection=="art") {
		buttonStr = "Back to Artist";
	} else {
		// Default values
		buttonStr = "Back";
	}
	if (returnLink=="" || returnLink==null) {
		returnLink = "index.html";
	}
	document.write("<a href='" + returnLink + "'>" + buttonStr + "</a>");

}

function setWindowSize() {
	var iHeight = getQueryParamValue("height");
	if( iHeight=="" || iHeight == null || iHeight < 1)
		iHeight= 700;
	var iWidth= getQueryParamValue("width");
	if( iWidth=="" || iWidth == null || iWidth < 1)
		iWidth= 580;
	self.resizeTo( iWidth, iHeight);

	window.width= iWidth;
	window.height=iHeight;
}

function NewWindow(mypage, myname, w, h) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
var winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes';
win = window.open(mypage, myname, winprops);
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}