jQuery.noConflict();

jQuery(document).ready(function()
{
		
		
	if (jQuery('img[usemap]').val() != undefined ){
			jQuery('img[usemap]').maphilight({
			
			 fill: true,
			 fillColor: 'ffdd0d',
			 fillOpacity: 1,
			 stroke: true,
			 strokeColor: '000000',
			 strokeOpacity: 1,
			 strokeWidth: 3,
			 fade: true,
			 alwaysOn: false

			});

		jQuery('.areamap').click(
			function () {
				return false;
			}
		);
		jQuery('.area-first').hover (
			 function () {
				jQuery(this).hide();
			 },
			 function () {
				jQuery(this).show();
			 }
		);
		jQuery('.area-image').hover (
			 function () {
				jQuery(this).hide();
			 },
			 function () {
				jQuery(this).show();
			 }
		);
		jQuery('.areamap').hover (
			 function () {
				
				//hide old divs
				jQuery('#address-list').children("div").hide();
				
				//on
				var numArray = jQuery(this).attr("class").split(' ');
				jQuery('#areamap' + numArray[1]).show();
			 },
			 function () {
				//off
			 }
		);

		//show first, Apeldoorn
		jQuery('#areamap1').show();

	}


	//rotate on/off
	var timeout_time=16000;
	if ( jQuery('#rotate').html() == '1' ){ timeout_time=0; }

	if (jQuery("#carousel").val() != undefined ){
		jQuery("#carousel").cycle({
			pager: '.carousel-nav',
			speed:    400, 
			timeout:  timeout_time, 
			prev:   '#prev', 
			next:   '#next',
			pagerAnchorBuilder: function(idx, slide) { 
				// return selector string for existing anchor 
				return '.carousel-nav li:eq(' + idx + ') a'; 
			}
		});
	}

	//redirect
	jQuery("#langselector").change(function () {
		window.open(jQuery('#langselector :selected').val(), '_blank');
	});


	//pdf
	if (jQuery('.pdf').length) {
		jQuery('.last').after('<p><br/><br/><a href="http://www.adobe.com/products/acrobat/readstep2.html"><img src="http://www.adobe.com/images/shared/download_buttons/get_adobe_reader.gif" alt="Get Adobe Reader"></a></p>');
	} 

	jQuery('a.print').click(function() {
		window.print();
		return false;
	}); 

	//search
	jQuery('.search').blur(function() {
		if (this.value == '' ) { this.value='Search'}
	})
	.focus(function() {
		if (this.value == 'Search' ) { this.value=''}
	}); 
		
		
	//hide Anchor
	if (jQuery("#main").html().length > 2000) {
		jQuery("#anchor").show();
	}
	//Anchor 
	jQuery("#anchor a").click(
		function ()
			{
				jQuery(window).scrollTop(0);
				return false;
			}
	);
	
	
	// If image used, rightbox down
	jQuery("#main .imgtext-table img").each(function() {
		imageHeight = jQuery(this).attr("height");
		if (imageHeight > 1 ){
			jQuery('#right').css('top', imageHeight + 54);
			return;
		}
	 });

	// If only an image is used in rightbox, no bg
	jQuery("#right .block-1 .imgtext-table img").each(function() {
		imageHeight = jQuery(this).attr("height");
		if (imageHeight > 1 ){
			jQuery('#right').css('top', 0);
			jQuery('#right .block-1').css('background', 'none');
			jQuery('#right .block-1').css('border', 'none');
			return;
		}
	 });

	
		
	//Cufon('h1, h2, h3, a, p, label', { fontFamily: 'ScalaSansPro-Regular', hover: true });
	jQuery('ul img').css('visibility', 'visible'); 
		
});


