/*
 Profile `de Fietsspecialist`
 CMS Utils Javascript
 23-02-2007 i-Aspect B.V.

 from: quirksmode.org
*/

	function addEventSimple(obj,evt,fn) {
		if (obj.addEventListener)
			obj.addEventListener(evt,fn,false);
		else if (obj.attachEvent)
			obj.attachEvent('on'+evt,fn);
	}

	function removeEventSimple(obj,evt,fn) {
		if (obj.removeEventListener)
			obj.removeEventListener(evt,fn,false);
		else if (obj.detachEvent)
			obj.detachEvent('on'+evt,fn);
	}

	function createCookie(name,value,days) {
		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) {
		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;
	}

	function eraseCookie(name) {
		createCookie(name,"",-1);
	}


	/* popup window functions */

   function popitup(url) {
   	newwindow=window.open(url,'name','height=500,width=730');
   	if (window.focus) {newwindow.focus()}
   	return false;
   }

   function popitupsmall(url) {
   	newwindow2=window.open(url,'name2','height=400,width=550,scrollbars=yes,resizable=yes');
   	if (window.focus) {newwindow2.focus()}
   	return false;
   }


