<!--
// jQuery (on)change (class) trigger instead of standard onChange javaScript html triggers
// .livequery (plugin) = also works on elements added after page load
// .live = also works on elements added after page load ((on)change = unsupported)

$(document).ready(function(){
//alert ('jQuery document ready start');
//---
$("a[href='#']").livequery("click", (function(){
//alert ('jQuery a href start');
	$(this).attr('href', 'javascript:void(0)');
	//$(this).val('javascript:void(0)');
//alert ('jQuery a href end');
}));

$(".tab").livequery("click", (function(){
//alert ('jQuery tab start');
	var tab = $(this).attr("id");
	//alert ('jQuery tab: ' + tab );
	
	var nr = tab.substring(tab.length, tab.length-1);
	//alert ('jQuery nr: ' + nr );
	
	// Marc's own Script
	opencloseLeft(nr, 0, -600, 20);

//alert ('jQuery tab end');
}));

$(".lngx").livequery("click", (function(){
//alert ('jQuery lngx start');
	var lng = $(this).attr("name");
	//alert ('jQuery lngx lng: ' + lng );
	
	var lngimgsrc = $(this).children('img').attr("src"); // 
	//alert ('lngimgsrc' + lngimgsrc);
	
	// check if language is already selected by source of image
	//alert ('-5: ' + lngimgsrc.substring((lngimgsrc.length-5), lngimgsrc.length));
	if (lngimgsrc.substring((lngimgsrc.length-5), lngimgsrc.length) == 'x.gif') {

		// hide all language divs
		$('.lng').removeClass('show');
		//alert ('jQuery lng hidden: ' + lng );

		// show divs with selelected language
		$('.lng').each(function(){
		//alert ('jQuery lng each: ' + lng );
			if ($(this).attr("name") == lng) {
				$(this).addClass('show');
				//alert ('jQuery lngx show: ' + lng );
			}
		});

		$('.lngimg').each(function(){
		//alert ('jQuery lngimg each: ' + $(this).parent().attr("name") );
			var imgsrc = $(this).attr('src');
			//alert ('jQuery lngimg each: ' + imgsrc );
			if ($(this).parent().attr("name") == lng) { //active
				//$(this).attr('src', ('images/' + lng + '_20x12.gif'));
				imgsrc = imgsrc.substring(0, (imgsrc.length-5)) + '.gif';
				//alert ('jQuery lngimg show: ' + imgsrc );
			} else { // inactive
				//$(this).attr('src', ('images/' + lng + '_20x12x.gif'));
				imgsrc = imgsrc.substring(0, (imgsrc.length-4)) + 'x.gif';
				//alert ('jQuery lngimg hide: ' + imgsrc );
			}
			// set new image source (country flag)
			$(this).attr('src', imgsrc);
		});

	};

//alert ('jQuery lngx end');
}));

}); // end $(document).ready(function()

// Unobtrusive Vertical centering script
// By Kay Maatkamp : http://www.kaydies.com

var container = { 
	id   :"container", // the id of the (container) box
	top  :50,          // vertically centered (percentage)
	left :50           // horizontally centered (percentage)
	};
   
function deadCentreFeature() { 

	if (document.getElementById(container.id)) { 

		var elm = document.getElementById(container.id); 
		cWidth  = elm.offsetWidth; 
		cHeight = elm.offsetHeight; 

		if (self.innerHeight) { 
			wWidth  = self.innerWidth; 
			wHeight = self.innerHeight; 
		} else if (document.documentElement && 
				document.documentElement.clientHeight) { 
			wWidth  = document.documentElement.clientWidth; 
			wHeight = document.documentElement.clientHeight; 
		} else if (document.body) { 
			wWidth  = document.body.clientWidth; 
			wHeight = document.body.clientHeight; 
		} 

		cmLeft = wWidth  - cWidth  >= 0 ? 
		-Math.round((cWidth / (100/container.left)))  +"px" : 0; 

		cmTop  = wHeight - cHeight >= 0 ? 
		-Math.round((cHeight / (100/container.top ))) +"px" : 0; 

		elm.style.margin = cmTop + " 0 0 " + cmLeft; 
		elm.style.left   = cmLeft != 0 ? container.left + "%" : 0; 
		elm.style.top    = cmTop  != 0 ? container.top  + "%" : 0; 
	} 
}  
/*
window.onload = function() { 
	deadCentreFeature(); 
} 
window.onresize = function() { 
	deadCentreFeature(); 
}
*/
//-->