/**
 * default.js
 * @uses MooTools version 1.2
 */

// init-functions executed after DOM is ready
window.addEvent('domready', function() {
	initExternalLinks();
	hoverInteraction($$('ul.locationlist>li'));
	hoverInteraction($$('div.f42_nieuwsoverzicht ul.newslist>li'));
//	dynamicVisualReplaceFont(); // Because of IE6 bug this function gets called in the template itself.
	pushboxFlashF2();
	actiebannerFlashF11();
	extraazVoorbeeldenSwitch();
//	trainTicketPriceCalculation(); // gaat dynamisch
	bookingFormAccordionF27();
	window.scrollTo(0,0);
});


// init-functions executed after page is loaded fully
window.addEvent('load', function() {
	setBlocksHeight($$('div.f3_labelteaser p'), 0);
	setBlocksHeight($$('div.f3_labelteaser ul'), 3);
	setBlocksHeight($$('div.f4_f45_sameheight'), 3);
	setBlocksHeight($$('div.f5_upperfooter div'), 3);
	setBlocksHeight($$('div.f30_mijnoverzicht_welkom div.application'), 0);
	setMijnExtraazHeight();
	locationlistTips();
	locationCaroussel();
	bookingLocationTips();
//	iframeHeightResizing();
	ExtraazFactuurVerwerken();
	bookingFormTips();
	
//	replaceF25Image('../siteimg/temp/dynamische_visual1.jpg');
});



/**
 * setBlocksHeight
 *
 * sets height of grouped blocks equal to heighest block in group, 
 * rounding up to multiple of grid height (in pixels) to fit the blocks in an optical grid exactly
 *
 * @author Klaas Dieleman <klaas{AT}efocus.nl>
 * @param array arBlockItems - array of DOM elements to be treated
 * @param integer intOffset - optional number of pixels to add to height for offsetting purposes
 * @return void
 */
function setBlocksHeight(arBlockItems, intOffset) {
	var intMaxHeight = 0;
	var intGridHeight = 12;

	arBlockItems.each(function(elBlockItem) {
		if(elBlockItem.getSize().y > intMaxHeight) intMaxHeight = elBlockItem.getSize().y;
	});
	
	var intNewHeight = intGridHeight * (Math.ceil(intMaxHeight / intGridHeight));
	
	arBlockItems.each(function(elBlockItem) {
		var intPadding = elBlockItem.getStyle('padding-top').toInt() + elBlockItem.getStyle('padding-bottom').toInt();
		elBlockItem.setStyle('height', intNewHeight - intPadding + intOffset);
	});
}


/**
 * hoverInteraction
 *
 * adds 'hover'-class to passed-in DOM elements on mouseover and removes 'hover'-class on mouseout
 *
 * @author Klaas Dieleman <klaas{AT}efocus.nl>
 * @param array arElements - array of DOM elements to be treated
 * @return void
 */
function hoverInteraction(arElements) {
	arElements.each(function(el) {
		el.addEvents({
			'mouseenter': function() {
				el.addClass('hover');
			},
			'mouseleave': function() {
				el.removeClass('hover');
			}
		});
	});
}


/**
 * locationlistTips
 *
 * attaches custom styled tooltip to facilities icons in location list
 *
 * @author Klaas Dieleman <klaas{AT}efocus.nl>
 * @return void
 */
function locationlistTips() {
	$$('ul.facilities li').each(function(el) {   
		var content = el.get('title').split('::');   
		el.store('tip:title', content[0]);   
		el.store('tip:text', content[1]);
		el.getElement('img').setProperty('alt', '');
	}); 
	var tips = new Tips('ul.facilities li', {
		className: 'locationlist_tip',
		offsets: {'x': -18, 'y': 31 },
		fixed: true,
		fitInWindow: false
	});
}


/**
 * locationCaroussel
 *
 * enables scrolling through and clicking on thumbnails in location detail pictures
 *
 * @author Klaas Dieleman <klaas{AT}efocus.nl>
 * @editor Ralph Meeuws <ralph-meeuws[AT]efocus.nl>
 * @return void
 */
function locationCaroussel() {
	if (!$('caroussel_thumbs')) return;

	var arCarousselItems = $$('#caroussel_thumbs li');
	var arCarousselThumbs = $$('#caroussel_thumbs li img');
	
	if ($$('#caroussel_thumbs li').length > 2) {
		$('caroussel_scrollup').addEvent('click', function() {
			var elNewItem = $$('#caroussel_thumbs li').getLast();
			$$('#caroussel_thumbs li').getLast().dispose();
			elNewItem.inject($('caroussel_thumbs'), 'top');
			$('caroussel_thumbs').setStyle('margin-top', -96);
			$('caroussel_thumbs').tween('margin-top', -96, 0);
		});
		
		$('caroussel_scrolldown').addEvent('click', function() {
			var fxScrolldown = new Fx.Tween($('caroussel_thumbs'), {
				onComplete: function() {
					var elNewItem = $$('#caroussel_thumbs li')[0];
					$$('#caroussel_thumbs li')[0].dispose();
					elNewItem.inject($('caroussel_thumbs'), 'bottom');
					$('caroussel_thumbs').setStyle('margin-top', 0);
				}
			});
			fxScrolldown.start('margin-top', 0, -96);
		});
	}
	
	arCarousselThumbs.each(function(item) {
		item.addEvent('click', function() {
			strNewImg = item.getProperty('src').replace(/_thumb/, "");
			$('carousselphoto').setProperties({
				'src': strNewImg,
				'alt': item.getProperty('alt')
			});
			
			if ($('carousselcaption')) {
				$('carousselcaption').innerHTML = item.getProperty('alt');
			}
			
		});
	});
}


/*
 * initExternalLinks
 * Used in order for certain links to open in a new window without the direct target attribute (so it validates properly).
 * 
 * @author CSD (clientsidedevelopers@efocus.nl)
 * @uses <a href="http://www.efocus.nl/" rel="external">eFocus site</a>
 */
function initExternalLinks() {
	if (!document.getElementsByTagName) return; 
	var arrAnchors = document.getElementsByTagName("a"); 
	for (var i=0; i<arrAnchors.length; i++) { 
		var elAnchor = arrAnchors[i]; 
		if (elAnchor.getAttribute("href") && elAnchor.getAttribute("rel") == "external") {
			elAnchor.target = "_blank";
		}
	}
}


/**
 * dynamicVisualReplaceFont
 *
 * Replaces HTML fonts in the Dynamic visual (F21) by sIFR variants.
 *
 * @author Ralph Meeuws <ralph-meeuws[AT]efocus.nl>
 */
function dynamicVisualReplaceFont() {
	var arrF21Class = $$('.f21_dynamische_visual');
	if (arrF21Class.length == 0) return;

	elF21Head1 = arrF21Class[0].getElement('h1');
	strF21Head1Color = elF21Head1.getStyle('color'); // '#cc0000'

	elF21Head2 = arrF21Class[0].getElement('h2');
	strF21Head2Color = elF21Head2.getStyle('color'); // '#450204'
	
	var objNeueSansNormal = {
		src: '/flash/neue_sans_normal.swf'
	};

	var objNeueSansBold = {
		src: '/flash/neue_sans_bold.swf'
	};
	
	sIFR.useStyleCheck = true;
	sIFR.activate(objNeueSansNormal, objNeueSansBold);
	
	sIFR.replace(objNeueSansNormal, {
		selector: '.f21_dynamische_visual h1'
		,css: {
			'.sIFR-root': { 'color': strF21Head1Color }
		},
		wmode: 'transparent'
	});
	
	sIFR.replace(objNeueSansBold, {
		selector: '.f21_dynamische_visual h2'
		,css: {
			'.sIFR-root': { 'color': strF21Head2Color }
		},
		wmode: 'transparent'
	});
}


/**
 * pushboxFlashF2
 *
 * Loads the Flash pushbox in the pushbox container.
 *
 * @author Ralph Meeuws <ralph-meeuws[AT]efocus.nl>
 * @editor Barend van der Hout <barend.vander.hout[AT]efocus.nl>
 * @editor Jeroen Datema <jeroen.datema[AT]efocus.nl>
 */
function pushboxFlashF2() {
	if (!$('pushbox_container') || (Browser.Plugins.Flash.version < 9)) return;

	var elPbCont = $('pushbox_container');
	var domain = window.location.hostname;
	//alert(domain);

	var objPushboxSwiff = new Swiff('/flash/pushbox.swf', { // For local testing use: '../flash/pushbox.swf'
		id: 'pushbox_swiff',
		width: 960,
		height: 350,
		container: elPbCont,
		params: {
			wmode: 'transparent',
			bgcolor: '#ffffff'
		},
		vars: {
		xmlUrl: 'http://'+domain+'/Pushbox.aspx', // For local testing use: '../flash/pushbox.xml'
		xmlMapUrl: 'http://' + domain + '/flash/regardz.xml', // For local testing use: '../flash/pushbox.xml'
		pathUrl: 'http://' + domain + '/flash/', // For local testing use: '../flash/pushbox.xml'
			promoPage: $('pushbox_promoPage').value,
			referer: $('pushbox_referer').value,
			startPage: $('pushbox_start').value
		}
	});
	
}


/**
 * actiebannerFlashF11
 *
 * Loads a Flash banner in the actionbanner block.
 *
 * @author Ralph Meeuws <ralph-meeuws[AT]efocus.nl>
 */
function actiebannerFlashF11() {
	var arrF11Class = $$('.f11_actiebanner');
	if (arrF11Class.length == 0) return;
	
	arrF11Class.each(function(elF11Class){
		var elActionbannerFlash = elF11Class.getElement('.actiebanner_flash');
		if (elActionbannerFlash) {
			var elActionbannerFlashUrl = elActionbannerFlash.getElement('.actiebanner_flash_url').innerHTML;
			var elActionbannerFlashHeight = elActionbannerFlash.getElement('.actiebanner_flash_height').innerHTML;
			
			var objActionbannerFlash = new Swiff(elActionbannerFlashUrl, {
				id: 'actionbanner',
				width: 240,
				height: elActionbannerFlashHeight,
				container: elActionbannerFlash,
				params: {
					wmode: 'opaque',
					bgcolor: '#ffffff'
				}
			});
		}
	});
};


function DoBestellen(aantal, opmerking, itemID, isIngelogd, naam,adres,postcode,plaatsnaam,telnr)
{
    var link = "/Lightbox/Bestellen.aspx?itemid="+escape(itemID)+"&aantal="+escape(aantal)+"&opmerking="+escape(opmerking)+"&n="+escape(naam)+"&a="+escape(adres)+"&po="+escape(postcode)+"&pl="+escape(plaatsnaam)+"&t="+escape(telnr);
    if(!isIngelogd) link = "/Lightbox/Inloggen.aspx?redirect="+escape(link)+"&inIframe=1";
	Shadowbox.open({
		player:		'iframe',
		title:		"Bestellen",
		content:	link,
		width:		600,
		height:		300,
		options:	{enableKeys: false}
	});
}

function OpenShadowbox(url, breedte, hoogte)
{
	Shadowbox.open({
		player:		'iframe',
		title:		"Lightbox",
		content:	url,
		width:		breedte,
		height:		hoogte,
		options:	{enableKeys: false}
	});
}


/**
 * extraazVoorbeeldenSwitch
 *
 * enables switching of images in Extraaz Voorbeelden block (F37)
 *
 * @author Klaas Dieleman <klaas{AT}efocus.nl>
 * @return void
 */
function extraazVoorbeeldenSwitch() {
	var arImages = $$('div.f37_extraazvoorbeelden .photo_holder');
	var arTitles = $$('div.f37_extraazvoorbeelden li h3');
	if (arImages.length != arTitles.length || arImages.length < 1 ) return false;

	arImages.each(function(item) {
		item.addClass('hidden');
	});
	arImages[0].removeClass('hidden');
	
	arTitles.each(function(item, index) {
		item.addEvent('click', function() {
			arImages.each(function(item2) {
				item2.addClass('hidden');
			});
			arImages[index].removeClass('hidden');
		});
	});
}


/**
 * setMijnExtraazHeight
 *
 * sets height of grouped blocks equal to heighest block in group, specifically for Mijn Extraaz lists 
 *
 * @author Klaas Dieleman <klaas{AT}efocus.nl>
 * @return void
 */
function setMijnExtraazHeight() {
	
	var arMaxHeight = new Array;
	
	var arLeftHeads = $$('div.f30_mijnoverzicht_mijnextraaz div.leftcol ul.producten div.equalheight');
	var arRightHeads = $$('div.f30_mijnoverzicht_mijnextraaz div.rightcol ul.producten div.equalheight');
	var arLeftLIs = $$('div.f30_mijnoverzicht_mijnextraaz div.leftcol ul.producten li');
	var arRightLIs = $$('div.f30_mijnoverzicht_mijnextraaz div.rightcol ul.producten li');
	
	var arLeftHeads2 = $$('div.f30_mijnoverzicht_mijnextraaz ul.overzicht li:even div');
	var arRightHeads2 = $$('div.f30_mijnoverzicht_mijnextraaz ul.overzicht li:odd div');
	var arLeftLIs2 = $$('div.f30_mijnoverzicht_mijnextraaz ul.overzicht li:even');
	var arRightLIs2 = $$('div.f30_mijnoverzicht_mijnextraaz ul.overzicht li:odd');
	
	if(arLeftHeads.length != arRightHeads.length || arLeftLIs.length != arRightLIs.length) return;
	
	arLeftHeads.each(function(item, n) {
		item.getSize().y > arRightHeads[n].getSize().y ? arRightHeads[n].setStyle('height', item.getSize().y) : item.setStyle('height', arRightHeads[n].getSize().y);
	});
	arLeftLIs.each(function(item, n) {
		item.getSize().y > arRightLIs[n].getSize().y ? arRightLIs[n].setStyle('height', item.getSize().y) : item.setStyle('height', arRightLIs[n].getSize().y);
	});
	
	for (var n=0;n<arLeftHeads2.length;n++) {
		if(!(arRightHeads2[n])) continue;
		
		if(arLeftHeads2[n].getSize().y > arRightHeads2[n].getSize().y) {
			arLeftHeads2[n].setStyle('height', arLeftHeads2[n].getSize().y);
			arRightHeads2[n].setStyle('height', arLeftHeads2[n].getSize().y);
		} else {
			arLeftHeads2[n].setStyle('height', arRightHeads2[n].getSize().y);
			arRightHeads2[n].setStyle('height', arRightHeads2[n].getSize().y);
		}
	}
	for (var n=0;n<arLeftLIs2.length;n++) {
		if(!(arRightLIs2[n])) continue;
		
		if(arLeftLIs2[n].getSize().y > arRightLIs2[n].getSize().y) {
			arLeftLIs2[n].setStyle('height', arLeftLIs2[n].getSize().y);
			arRightLIs2[n].setStyle('height', arLeftLIs2[n].getSize().y);
		} else {
			arLeftLIs2[n].setStyle('height', arRightLIs2[n].getSize().y);
			arRightLIs2[n].setStyle('height', arRightLIs2[n].getSize().y);
		}
	}
}


/**
 * trainTicketPriceCalculation
 *
 * Calculates the (sub-)total prices when ordering traintickets (F52).
 * Pas op: deze functie wordt ook na elke ajax-update uitgevoerd.
 *
 * @author Ralph Meeuws <ralph-meeuws[AT]efocus.nl>
 */
function trainTicketPriceCalculation() {
	if(!$('traintickets_ordering')) return;
	
	var arrTrainticketContainers = $$('.trainticket_container');
	
	arrTrainticketContainers.each(function(elTtCont){
		var elTtInput = elTtCont.getElement('input');
		var strTtPrice = elTtCont.getElement('.trainticket_price').innerHTML;
		var strTtPriceInCents = strTtPrice.replace(',','.') * 100;
		var elTtSubtotal = elTtCont.getElement('.trainticket_subtotal');

		elTtInput.addEvent('keyup',function(){
			var intTtNumber = elTtInput.value ? elTtInput.value.toInt() : 0;
			
			var intTtSubtotalInCents = intTtNumber * strTtPriceInCents;
			var intTtSubtotal = intTtSubtotalInCents.toFixed(0) / 100;
			var arrTtSubtotal = intTtSubtotal.toString().split('.');
			var strTtSubtotalEuros = arrTtSubtotal[0];
			if (arrTtSubtotal.length < 2) {
				var strTtSubtotalCents = '00';
			} else {
				var strTtSubtotalCents = arrTtSubtotal[1];
				if (strTtSubtotalCents.length == 1) {
					strTtSubtotalCents = strTtSubtotalCents + '0';
				}
			}
			
			var strTtSubtotal = strTtSubtotalEuros + ',' + strTtSubtotalCents;

			elTtSubtotal.innerHTML = strTtSubtotal;
			
			trainTicketTotalpriceCalculation();
		});
		// bij het laden ook direct het totaal berekenen
		elTtInput.fireEvent('keyup');
	});
}


/**
 * trainTicketPriceCalculation
 *
 * Calculates the totalprice from the combined subtotals for traintickets (F52).
 *
 * @author Ralph Meeuws <ralph-meeuws[AT]efocus.nl>
 */
function trainTicketTotalpriceCalculation() {
	if(!$('traintickets_totalprice')) return;
	
	var intTtTotalprice = intTtTotalpriceInCents = 0;
	var elTtTotalprice = $('traintickets_totalprice');
	var arrTtSubtotals = $('traintickets_ordering').getElements('.trainticket_subtotal');
	
	arrTtSubtotals.each(function(elTtSubtotal){
		var intTtSubtotalInCents = elTtSubtotal.innerHTML.replace(',','.') * 100;
		intTtTotalpriceInCents = intTtTotalpriceInCents + intTtSubtotalInCents;
	});
	
	var intTtTotalprice = intTtTotalpriceInCents.toFixed(0) / 100;
	var arrTtTotalprice = intTtTotalprice.toString().split('.');
	var strTtTotalpriceEuros = arrTtTotalprice[0];
	if (arrTtTotalprice.length < 2) {
		var strTtTotalpriceCents = '00';
	} else {
		var strTtTotalpriceCents = arrTtTotalprice[1];
		if (strTtTotalpriceCents.length == 1) {
			strTtTotalpriceCents = strTtTotalpriceCents + '0';
		}
	}

	intTtTotalprice = strTtTotalpriceEuros + ',' + strTtTotalpriceCents;
		
	elTtTotalprice.innerHTML = intTtTotalprice;
};



/**
 * bookingFormAccordionF27
 *
 * Adds an accordion to the booking form F27.
 *
 * @author Ralph Meeuws <ralph-meeuws[AT]efocus.nl>
 */
function bookingFormAccordionF27() {
	var arrF27Class = $$('.f27_booking_form');
	if (arrF27Class.length == 0) return;
	
	var arrClickables = $$('.clickable');
	var arrHideables = $$('.hideable');
	
	var objBookingAccordion = new Accordion(arrClickables, arrHideables, {
			show: 0,
			onActive: function(thisClickable){
				arrClickables.each(function(elClickable){
					elClickable.getElement('.accordion_indicator').removeClass('accordion_opened');
				});
				thisClickable.getElement('.accordion_indicator').addClass('accordion_opened');
			}
		}
	);
}



/**
 * bookingLocationTips
 *
 * Attaches custom styled tooltip to the location preview in the booking form F27.
 * (Based on locationlistTips function by Klaas Dieleman <klaas{AT}efocus.nl>)
 *
 * @author Ralph Meeuws <ralph-meeuws[AT]efocus.nl>
 * @return void
 */
function bookingLocationTips() {
	arrF27 = $$('.f27_booking_form');
	if (arrF27.length ==  0) return;
	
	$$('div.photo_holder').each(function(el) {   
		
		if (el.get('title')) {
			var content = el.get('title').split('::');   
			el.store('tip:title', content[0]);   
			el.store('tip:text', content[1]);
			el.getElements('a').each(function(this_el) {
				this_el.setProperty('title', '');
			});
		}	
		
	}); 
	var tips = new Tips('div.photo_holder', {
		className: 'booking_location_tip',
		offsets: {'x': -30, 'y': 115 },
		fixed: true,
		fitInWindow: false
	});
}



/**
 * iframeHeightResizing
 *
 * Calculates the actual height of an iframe based on its contents, including reserved space for any collapsable accordion.
 *
 * @author Ralph Meeuws <ralph-meeuws[AT]efocus.nl>
 * @return void
 */
function iframeHeightResizing(){
	if (document.getElements('iframe').length == 0) return;
		
	arrIframes = document.getElements('iframe');
	arrIframes.each(function(elIframe){
		if (elIframe.contentWindow.document.getElements('.accordion').length != 0) {
			arrAccordion = elIframe.contentWindow.document.getElements('.accordion');
			
			arrAccordion.each(function(elAccordion){
				intAccordionOpenListItemNumber = 1;
				
				arrAccordionListItems = elAccordion.getChildren('li');
				intAccordionHideableMaxHeight = 0;
				
				arrAccordionListItems.each(function(elAccordionListItem){
					elAccordionHideable = elAccordionListItem.getElement('.hideable');
					strAccordionHideableHeight = elAccordionHideable.getSize().y;
					
					if (elAccordionListItem != arrAccordionListItems[intAccordionOpenListItemNumber - 1]) {
						elAccordionHideable.setStyle('height', 'auto');
						strAccordionHideableHeight = elAccordionHideable.getSize().y;
						elAccordionHideable.setStyle('height', 0);
						if (strAccordionHideableHeight >= intAccordionHideableMaxHeight) {
							intAccordionHideableMaxHeight = strAccordionHideableHeight;
						}
					} else {
						intAccordionOpenHideableHeight = strAccordionHideableHeight;
					}
				});
			});
			
			var extraAccordionHeight = intAccordionHideableMaxHeight - intAccordionOpenHideableHeight;
		} else {
			var extraAccordionHeight = 0;
		}
		elIframe.setStyle('height', (elIframe.contentWindow.document.body.scrollHeight + extraAccordionHeight) + 'px');
	});
}


	
function submitOV9292(form)
{
    //Zet de waarden van het getoonde formulier over naar de "hidden" form en submit deze uiteindelijk
    document.forms['ov9292'].PCcijfers.value = document.forms['form1'].PCcijfers.value;
    document.forms['ov9292'].PCletters.value = document.forms['form1'].PCletters.value;
    //Datum staat in een dropdownlist (Date)
    document.forms['ov9292'].Day.value = document.forms['form1'].Date.value.substring(0, 2);
    document.forms['ov9292'].Month.value = document.forms['form1'].Date.value.substring(2, 4);
    document.forms['ov9292'].Year.value = document.forms['form1'].Date.value.substring(4, 8);
    
    document.forms['ov9292'].Hour.value = document.forms['form1'].Hour.value;
    document.forms['ov9292'].Minute.value = document.forms['form1'].Minute.value;
    
    if (document.forms['form1'].type[0].checked)
        document.forms['ov9292'].type.value = document.forms['form1'].type[0].value;
    else if (document.forms['form1'].type[1].checked)
        document.forms['ov9292'].type.value = document.forms['form1'].type[1].value;
    
    if (document.forms['form1'].mode[0].checked)
        document.forms['ov9292'].mode.value = document.forms['form1'].mode[0].value;
    if (document.forms['form1'].mode[1].checked)
        document.forms['ov9292'].mode.value = document.forms['form1'].mode[1].value;
    if (document.forms['form1'].mode[2].checked)
        document.forms['ov9292'].mode.value = document.forms['form1'].mode[2].value;    
        
    document.forms['ov9292'].submit();
}

function ExtraazFactuurVerwerken()
{
    if(location.search.indexOf("?extraazfactuurcode=")===0 && location.href.indexOf("Lightbox")===-1)
        OpenShadowbox("/Lightbox/ExtraazFactuurVerwerken.aspx"+window.location.search, 320, 250);
}

function GetEnter(e, zoekstring)
{
    var keycode;
    if (window.event) keycode = window.event.keyCode;
    else if (e) keycode = e.which;
    else return true;

    if (keycode == 13)
    {
	   window.location="/Zoeken.aspx?q=" + zoekstring;
	   return false;
    }
    else
	   return true;
}	

function ResetScrollPosition()
{
    	var winScroller = new Fx.Scroll(window);
		winScroller.toElement($('contentAnker'));
}



/**
 * bookingFormTips
 *
 * Attaches custom styled tooltip to the location preview in the booking form F27.
 * (Based on locationlistTips function by Klaas Dieleman <klaas{AT}efocus.nl>)
 *
 * @author Klaas Dieleman <klaas{AT}efocus.nl>
 * @editor Erhan Karadeniz <erhan-karadeniz[AT]efocus.nl>
 * @return void
 */
function bookingFormTips() {
	$$('a.bookingform_tips').each(function(el) {   
		var content = el.get('title').split('::');   
		el.store('tip:title', content[0]);   
		el.store('tip:text', content[1]);
	}); 
	var tips = new Tips('a.bookingform_tips', {
		className: 'locationlist_tip',
		offsets: {'x': -23, 'y': 17 },
		fixed: true,
		fitInWindow: false
	});
}



/**
 * replaceF25Image
 *
 * Replaces the image of F25 with the URL passed.
 *
 * @author Ralph Meeuws <ralph-meeuws[AT]efocus.nl>
 * @param url
 * @return void
 */
function replaceF25Image(url){
	arrF25 = $$('.f25_afbeelding');
	if (arrF25.length == 0) return;
	
	arrF25.each(function(elF25){
		elF25.getElement('img').src = url;
	});
}

/**
* baseDomainString
*
* checks base domain
*
* @author Mirjam <mirjam[AT]efocus.nl>
* @return string
*/

function baseDomainString() {
     
    d = document.domain.split(/\//);
    e = d[0].split(/\./);
    
    if (e.length > 1) {
        return (e[e.length - 2] + "." + e[e.length - 1]);
    } else {
        return ("");
    }

}

/**
 * disableButton
 *
 * disable button after click using css class
 *
 * @author André <andre.kuijer[AT]efocus.nl>
 */
function disableButton(el) {
    el.className = 'btn_disabled';
}