
// START ANTI-FRAMER

if (top != self) top.location.href = self.location.href;

// END ANTI-FRAMER



// START POP-UP AND CENTRE

function open_popup(url, winName, winWidth, winHeight, status, scrollbars, resizable) {
	window.open(url,winName,'toolbar=0,location=0,directories=0,status='+status+',menubar=0,scrollbars='+scrollbars+',resizable='+resizable+',left='+centre(winWidth,screen.availWidth)+',top='+centre(winHeight,screen.availHeight)+',width='+winWidth+',height='+winHeight);
}

function centre(size,area) {
	return (area/2)-(size/2);
}

// END POP-UP AND CENTRE



// START COOKIE FUNCTIONS
var exp = new Date();
exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 365 * 5));


function setCookie(name, value, expires) {
	document.cookie = name + "=" + escape(value) + "; path=/" + ((expires == null) ? "" : "; expires=" + expires.toGMTString());
}


function getCookie(Name) {
	search = Name + "=";
	noCook = "no cookie";
			
	if (document.cookie.length > 0) {
		offset = document.cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = document.cookie.indexOf(";", offset);
			if (end == -1) end = document.cookie.length;
			return unescape(document.cookie.substring(offset, end));
		} else {
			return noCook;
		}
	} else {
		return noCook;
	}
}
// END COOKIE FUNCTIONS



// START HOMEPAGE WINDOW RETURNER
function windowReturner() {
	cookiedata = getCookie('limbo-window');
	
	if (cookiedata != 'no cookie') {
		cookiearray = cookiedata.split(', ');
		oldx = cookiearray[0];
		oldy = cookiearray[1];
		
		if (navigator.appName.indexOf('Microsoft Internet Explorer') != -1) {
		
			winwidth = document.body.clientWidth;
			winheight = document.body.clientHeight;
		
		} else {
			
			winwidth = window.innerWidth;
			winheight = window.innerHeight;
		}
		
		if (winwidth != 'undefined') {
			self.resizeBy((oldx - winwidth), (oldy - winheight));
			
			var exp = new Date();
			exp.setTime(exp.getTime() - 1000);
			setCookie('limbo-window', cookiedata, exp);
		}
	}
}
// END HOMEPAGE WINDOW RETURNER




//function open_vrml(url, winName, winWidth, winHeight) {
//	window.open(url,winName,'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,left='+centre(winWidth,screen.availWidth)+',top='+centre(winHeight,screen.availHeight)+',width='+winWidth+',height='+winHeight);
//}