<!--
//window.name = 'main';
window.onerror = null;

function close_window(popup) {
	if (top.pgname) {
		if (top.pgname.closed) {
			return false;
		} else {
    		if (popup == "nav") {
    			// hack--reset the window object
    			//top.navWin = window.open('','navWin');
    			//top.navWin.close();
    		} else if (popup == "content") {
    			// hack--reset the window object
    			top.contentWin = window.open('','contentWin');
    			top.contentWin.close();
    		} else if (popup == "slide") {
    			// hack--reset the window object
    			top.slideshowWin = window.open('','slideshowWin');
    			top.slideshowWin.close();
    		}		
    		return false;
		}
	}
}

function cleanUpWindows() { 	
	if (top.pgname) {
		if (!top.pgname.closed) {
			close_window('content');
			close_window('slide');
			top.pgname = null;
		}
	} else {
	 	top.pgname = null;
	} 
	
}

function open_navPopups(page,winname,r,w,h,t,l,s) {		
	if (s == '') {
		s = 1;
	}
	//if (getFlashVersion() >= 5) {
		//l = (screen.availWidth -w)/2;
		//t = (screen.availHeight -h)/2;
	//} else {
		//alert('Flash is needed to view this site.')
	//}
	//if (!plat.mac) {
		//cleanUpWindows();
	//}

    top.pgname = window.open(page,winname,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=' + s + ',resizable=' + r + ',personalbar=0,width=' + w + ',height=' + h + ',top=' + t + ',left=' + l + ',screenY=' + t + ',screenX=' + l );
    
    if ((plat.mac) && (winname == 'contentWin')) {
		//top.pgname.resizeTo(w,h);
    }
    
    top.pgname.focus();
    if (!top.pgname.opener) {
    	top.pgname.opener = self;
    	return false;
    }
}


// debug
function debug() {
    var output = '';

    if (top.pgname) {
        output = 'pop-up has been opened at least once by this window';
        if (top.pgname.closed) output += '\npop-up is closed';
        else {
            output += '\npop-up is currently open' +
                      '\nname: ' + top.pgname.name +
                      '\nopener: ' + top.pgname.opener.name +
                      '\nlocation: ' + top.pgname.location.href +
                      '\ntitle: ' + top.pgname.document.title;
        }
    }
    else output = 'pop-up has not yet been opened by this window';

    return output;
}

//-->

