/* Developed by U-Lab 2004 - www.u-lab.nl */

// preload images
preloadArray = new Array();
preloadArray[0]=new Image(); preloadArray[0].src="./images/pixel.gif";
preloadArray[1]=new Image(); preloadArray[1].src="../images/pixel.gif";

function preload(){
	for(var i=2; i < preload.arguments.length; i++){
		preloadArray[preloadArray.length]=new Image(); preloadArray[preloadArray.length-1].src="../images/"+i;
	}
}

// return todays date
function DateToday() {
	currentdate = new Date();
	return currentdate.getDate() + '-' + (currentdate.getMonth()+1) + '-' + currentdate.getYear();
}

// redirect to url
function goTo (url) {
	location.href = url;
}

// open popup window
function popup(url,w,h){
	x=(screen.width/2-(w/2));
	y=(screen.height/2-(h/2));
	window.open(url, "popup","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,height="+h+",width="+w+",left="+x+",top="+y);
}

// swap images
function swap(target,img){
	if(document.images[target]){
		document.images[target].src="../images/"+img;
	}
}

// get Cookie
var hasCookie = true;
function getCookie (NameOfCookie) {
	if (!document.cookie||document.cookie.indexOf(NameOfCookie+"=")==-1) {
		setCookie(NameOfCookie,1,365);
		hasCookie = false;
	}
}

// set Cookie
function setCookie (NameOfCookie, value, expiredays) {
	var ExpireDate = new Date ();
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 3600 * 24 * 365));
	document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}

// load htmlarea
_editor_url = "../scripts/htmlarea/"; // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
	document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
	document.write(' language="Javascript1.2"></scr' + 'ipt>');  
}else{ 
	document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>');
}

/* Developed by U-Lab 2004 - www.u-lab.nl */
