function openActivity () {
	window.open ( '/whipple/gallerychallenge/activity/', '_blank', 'height=420,width=750,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,directories=no,fullscreen=0,resizable=yes' );
	return false;
}

/*
   Highlighting for elements related to an active anchor tag
*/
function highlight () {
	if ( oElement ) oElement.className = '';
	if ( ! window.location ) return;
	var sAnchor = window.location.hash;
	if ( ! sAnchor ) return;
	if ( ! sAnchor.slice ) return;
	var sAnchorLessHash = sAnchor.slice ( 1 );
	if ( ! window.document || ! window.document.getElementById ) return;
	oElement = document.getElementById ( 'highlight_' + sAnchorLessHash );
	if ( ! oElement ) return;
	oElement.className = 'highlighted';
}
var oElement = null;
window.onload = highlight;

/*
   Text-size switching
*/
var nMaxTextSize = 5;
var nMinTextSize = -3;
var sTextSize = getCookie ( 'textsize' );
var nTextSize = parseInt ( sTextSize );
if ( sTextSize && nTextSize ) {
	var sFileSuffix = ( nTextSize > 0 ? 'plus' : 'minus' ) + Math.abs ( nTextSize );
	document.writeln ( '<link rel="stylesheet" type="text/css" media="screen,projection,print" href="' + sRoot + '/css/textsize' + sFileSuffix + '.css"/>' );
}
function changeTextSize ( nPlusMinus ) {
	var nTextSize = parseInt ( getCookie ( 'textsize' ) );
	if ( ! nTextSize ) nTextSize = 0;
	nTextSize += nPlusMinus;
	if ( nTextSize <= nMaxTextSize && nTextSize >= nMinTextSize ) {
		setOneYearCookie ( 'textsize', nTextSize.toString () );
		location.reload ();
	}
}
function setOneYearCookie ( sName, sValue ) {
	var dDate = new Date ();
	dDate.setTime ( dDate.getTime () + 365.25 * 24 * 60 * 60 * 1000 );
	document.cookie = sName + '=' + escape ( sValue ) + '; expires=' + dDate.toGMTString () + '; path=/';
}
function getCookie ( sName ) {
	var sSearch = sName + '=';
	if ( document.cookie.length > 0 ) {
		var iOffset = document.cookie.indexOf ( sSearch );
		if ( iOffset != -1 ) {
			iOffset += sSearch.length;
			var iEnd = document.cookie.indexOf ( ';', iOffset );
			if ( iEnd == -1 ) iEnd = document.cookie.length;
			return unescape ( document.cookie.substring ( iOffset, iEnd ) );
		}
	}
	return null;
}

/* 
	Obfuscation
*/
function deobfuscate ( sIn ) {
	var sOut = '';
	for ( var i = 0; i < sIn.length; i ++ ) {
		sOut += String.fromCharCode ( sIn.charCodeAt ( i ) - 1 );
	}
	return sOut;
}



