
function content( name, lv ) {
	top.content.location.href = name + '.html';
	side( name, lv );
}

function side( name, invisible ) {
	name = name || location.pathname.substring(location.pathname.lastIndexOf('/')+1,location.pathname.lastIndexOf('.'));
	invisible = invisible || false;
	if (invisible) {
		top.left.document.body.background = '';
		top.mainFrameset.cols = '0,*';
	} else {
		top.left.document.body.background = 'images/' + name + '.jpg';
		top.mainFrameset.cols = '300,*';
	}
}

function statusMask( ) {
	window.status = event.srcElement.innerText;
	event.returnValue = true;
}

function openWindow( link, name, w, h, scrollable ) {
	if (!w) w = 640;
	if (!h) h = 480;
	if (!name) name = '';
	if (!scrollable) scrollable = false;
	
	var screenWidth = 640;
	var screenHeight = 480;
	var x = 0;
	var y = 0;
	var param = '';
    var scroll = 'no';
    
    if (scrollable==true) scroll = 'yes';
	
	if (window.document.all || window.document.layers) {
		screenWidth = screen.width;
		screenHeight = screen.height;
	}
	
	if (screenWidth >= w && screenHeight >= h) {
		x = (screenWidth-w)/2;
		y = (screenHeight-h)/2;
	} else {
		w = screenWidth;
		h = screenHeight;
	}
	
	param += 'width=' + w + ', height=' + h + ', ';
	param += 'screenX=' + x + ', screenY=' + y + ', top=' + y + ', left=' + x + ', ';
	param += 'scrollbars=' + scroll + ', resize=no, toolbar=no, menubar=no ';
	
	var win = window.open(link, name, param);
	win.focus();
	return win;
}

function openMap( ) {
	openWindow( 'map.html', 'map', 540, 780, false );
}

function openChristmas( ) {
    var boxingDay = new Date(2007,11,26);
    var today = new Date();
    if (today.getTime() < boxingDay.getTime()) {
	    openWindow( 'christmas.html', 'christmas', 550, 345, false );
	}
}
