	var theRules = {
		'#linkbox18 h2' : function(el){
			el.onclick = function(){
				if (Element.hasClassName(this, 'invisible')) {
					new Effect.BlindDown('linkbox18-body');
					Element.removeClassName(this, 'invisible');
					setCookie(this.parentNode.id, '', 365);
				} else {
					new Effect.BlindUp('linkbox18-body');
					Element.addClassName(this, 'invisible');
					setCookie(this.parentNode.id, 'invisible', 365);
				}
			}		
		},
		'#linkbox24 h2' : function(el){
			el.onclick = function(){
				if (Element.hasClassName(this, 'invisible')) {
					new Effect.BlindDown('linkbox24-body');
					Element.removeClassName(this, 'invisible');
					setCookie(this.parentNode.id, '', 365);
				} else {
					new Effect.BlindUp('linkbox24-body');
					Element.addClassName(this, 'invisible');
					setCookie(this.parentNode.id, 'invisible', 365);
				}
			}		
		},
		'#linkbox23 h2' : function(el){
			el.onclick = function(){
				if (Element.hasClassName(this, 'invisible')) {
					new Effect.BlindDown('linkbox23-body');
					Element.removeClassName(this, 'invisible');
					setCookie(this.parentNode.id, '', 365);
				} else {
					new Effect.BlindUp('linkbox23-body');
					Element.addClassName(this, 'invisible');
					setCookie(this.parentNode.id, 'invisible', 365);
				}
			}		
		},
		'#linkbox20 h2' : function(el){
			el.onclick = function(){
				if (Element.hasClassName(this, 'invisible')) {
					new Effect.BlindDown('linkbox20-body');
					Element.removeClassName(this, 'invisible');
					setCookie(this.parentNode.id, '', 365);
				} else {
					new Effect.BlindUp('linkbox20-body');
					Element.addClassName(this, 'invisible');
					setCookie(this.parentNode.id, 'invisible', 365);
				}
			}		
		},
		'#linkbox15 h2' : function(el){
			el.onclick = function(){
				if (Element.hasClassName(this, 'invisible')) {
					new Effect.BlindDown('linkbox15-body');
					Element.removeClassName(this, 'invisible');
					setCookie(this.parentNode.id, '', 365);
				} else {
					new Effect.BlindUp('linkbox15-body');
					Element.addClassName(this, 'invisible');
					setCookie(this.parentNode.id, 'invisible', 365);
				}
			}		
		},
		'#linkbox14 h2' : function(el){
			el.onclick = function(){
				if (Element.hasClassName(this, 'invisible')) {
					new Effect.BlindDown('linkbox14-body');
					Element.removeClassName(this, 'invisible');
					setCookie(this.parentNode.id, '', 365);
				} else {
					new Effect.BlindUp('linkbox14-body');
					Element.addClassName(this, 'invisible');
					setCookie(this.parentNode.id, 'invisible', 365);
				}
			}		
		},
		'#linkbox16 h2' : function(el){
			el.onclick = function(){
				if (Element.hasClassName(this, 'invisible')) {
					new Effect.BlindDown('linkbox16-body');
					Element.removeClassName(this, 'invisible');
					setCookie(this.parentNode.id, '', 365);
				} else {
					new Effect.BlindUp('linkbox16-body');
					Element.addClassName(this, 'invisible');
					setCookie(this.parentNode.id, 'invisible', 365);
				}
			}		
		},
		'#linkbox17 h2' : function(el){
			el.onclick = function(){
				if (Element.hasClassName(this, 'invisible')) {
					new Effect.BlindDown('linkbox17-body');
					Element.removeClassName(this, 'invisible');
					setCookie(this.parentNode.id, '', 365);
				} else {
					new Effect.BlindUp('linkbox17-body');
					Element.addClassName(this, 'invisible');
					setCookie(this.parentNode.id, 'invisible', 365);
				}
			}		
		},
		'#linkbox21 h2' : function(el){
			el.onclick = function(){
				if (Element.hasClassName(this, 'invisible')) {
					new Effect.BlindDown('linkbox21-body');
					Element.removeClassName(this, 'invisible');
					setCookie(this.parentNode.id, '', 365);
				} else {
					new Effect.BlindUp('linkbox21-body');
					Element.addClassName(this, 'invisible');
					setCookie(this.parentNode.id, 'invisible', 365);
				}
			}		
		}
	};
	
	Behaviour.register(theRules);
	Behaviour.addLoadEvent(hideBoxes);
	
	function hideBoxes() {
		
		// Id names of all the "boxes"
		boxIds = $("linkbox18","linkbox24","linkbox23","linkbox20","linkbox15"
				   ,"linkbox14","linkbox16","linkbox17","linkbox21");	
		
		for (i = 0; i < boxIds.length; i++) {
			if (boxIds[i]) {
				cookieValue = readCookie(boxIds[i].id);
				if (cookieValue == 'invisible') {
					var h2 = boxIds[i].getElementsByTagName('h2');
					Element.addClassName(h2[0], 'invisible');
					var kids = boxIds[i].childNodes;
					for (j = 1; j < kids.length; j++) {
						if (kids[j].id) {
							Element.hide(kids[j]);
						}
					}
				}
			}		
		}	
	}
	
	function setCookie(name,value,days) {
	 if (days) {
		 var date = new Date();
		 date.setTime(date.getTime()+(days*24*60*60*1000));
		 var expires = ";expires="+date.toGMTString();
	 } else {
		 expires = "";
	 }
	 document.cookie = name+"="+value+expires+";path=/";
	}
		
	function readCookie(name) {
	 var needle = name + "=";
	 var cookieArray = document.cookie.split(';');
	 for(var i=0;i < cookieArray.length;i++) {
		 var pair = cookieArray[i];
		 while (pair.charAt(0)==' ') {
			 pair = pair.substring(1, pair.length);
		 }
		 if (pair.indexOf(needle) == 0) {
			 return pair.substring(needle.length, pair.length);
		 }
	 }
	 return null;
	}
	
/* From the ImageManagerPlugin */
function basename (path) { return path.replace( /.*\//, "" ); }
	
			var winimg=null;
			function ps_imagemanager_popup(imgurl,title,w,h) {
				lpos=(screen.width)?(screen.width-w)/2:100;
				tpos=(screen.height)?(screen.height-h)/2:100;
				settings='width='+w+',height='+h+',top='+tpos+',left='+lpos+',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
				winimg=window.open('about:blank','imagemanagerpopup',settings);
	
				var doc = '';
				doc += '<html><head>';
				doc += '<title>' + title + ' - ' + basename(imgurl) + '(' + w + 'x' + h +')</title>';
				doc += '<style type="text/css"><!-- body { margin:0px; padding:0px; } --></style>';
				doc += '</head>';
				doc += '<body onload="self.focus();">';
				doc += '<img style="cursor:pointer;" src="' + imgurl + '" title="' + title + '" onclick="self.close();"/>';
				doc += '</body></html>';
				
				winimg.document.writeln(doc);
				winimg.document.close();
			}	