function init() {
    //initial display
    xajax_createPage(); //draw the UI
	showBoxOnce(); //show sign in box if no cookie
    
	//xajax loading
	//xajax.loadingFunction = function(){ showBox('loading'); };
	//xajax.doneLoadingFunction = function () { hideBox('loading'); };
}

function drawPageElements() { //draw tabs and populate the filmstrip
   /* xajax_restart(); //clear information    
	setTabContentHeight(); //get dimensions
	setNumImages(); //set the number of images to show in the filmstrip
	setNumTabs();  //set the number of potential tabs
	xajax_createTabs(numTabs); //draw the tabs (most are hidden)
	showBoxOnce(); //show sign in box if no cookie
	xajax_getRandomImages(numImages, imgWidth, true); //get initial images*/
}

function showBoxOnce(){ //http://www.pjhyett.com/articles/2006/02/09/the-lightbox-effect-without-lightbox
	//+Liam
	if(readCookie('visited')) return; //returning user? show no box
	else createCookie('visited', true, 365); //new user? set a cookie
	//-Liam

    $('lightbox_overlay').show();
    center('lightbox');
    return false;
}

function showBox(box){ //http://www.pjhyett.com/articles/2006/02/09/the-lightbox-effect-without-lightbox
    $('lightbox_overlay').show();
    center(box);
    return false;
}

function hideBox(box){ //http://www.pjhyett.com/articles/2006/02/09/the-lightbox-effect-without-lightbox
    $(box).hide();
    $('lightbox_overlay').hide();
    return false;
}

function center(element){ //http://www.pjhyett.com/articles/2006/02/09/the-lightbox-effect-without-lightbox
    try{
        element = $(element);
    }catch(e){
        return;
    }

    var my_width  = 0;
    var my_height = 0;

    if ( typeof( window.innerWidth ) == 'number' ){
        my_width  = window.innerWidth;
        my_height = window.innerHeight;
    }else if ( document.documentElement && 
             ( document.documentElement.clientWidth ||
               document.documentElement.clientHeight ) ){
        my_width  = document.documentElement.clientWidth;
        my_height = document.documentElement.clientHeight;
    }
    else if ( document.body && 
            ( document.body.clientWidth || document.body.clientHeight ) ){
        my_width  = document.body.clientWidth;
        my_height = document.body.clientHeight;
    }

    element.style.position = 'absolute';
    element.style.zIndex   = 99;

    var scrollY = 0;

    if ( document.documentElement && document.documentElement.scrollTop ){
        scrollY = document.documentElement.scrollTop;
    }else if ( document.body && document.body.scrollTop ){
        scrollY = document.body.scrollTop;
    }else if ( window.pageYOffset ){
        scrollY = window.pageYOffset;
    }else if ( window.scrollY ){
        scrollY = window.scrollY;
    }

    var elementDimensions = Element.getDimensions(element);

    var setX = ( my_width  - elementDimensions.width  ) / 2;
    var setY = ( my_height - elementDimensions.height ) / 2 + scrollY;

    setX = ( setX < 0 ) ? 0 : setX;
    setY = ( setY < 0 ) ? 0 : setY;

    element.style.left = setX + "px";
    element.style.top  = setY + "px";

    element.style.display  = 'block';
}

function findPos(obj) { //http://www.quirksmode.org/js/findpos.html
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function createCookie(name,value,days) { //http://www.quirksmode.org/js/cookies.html
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) { //http://www.quirksmode.org/js/cookies.html
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}