// JavaScript Document

function RGBtoHex(R,G,B) {return toHex(R)+toHex(G)+toHex(B)}
function toHex(N) {
 if (N==null) return "00";
 N=parseInt(N); if (N==0 || isNaN(N)) return "00";
 N=Math.max(0,N); N=Math.min(N,255); N=Math.round(N);
 return "0123456789ABCDEF".charAt((N-N%16)/16)
      + "0123456789ABCDEF".charAt(N%16);
}

function meilink_start () {
	// hide onderdelenmenu if part of onderdeel
	if ($('#divisieNav .active').length > 0) {
		// remove onderdelen
		$('#divisieNav .onderdeel').remove();
		// show "onderdeel van ..."
		$('#divisieNav .onderdeelhome').show();
		// set hyperlink of "onderdeel van ..." to the hyperlink of the active language
		//$('#divisieNav .home').attr('href',$('#langNav .active').attr('href'));
	} else {
		// remove "onderdeel van ..."
		$('#divisieNav .home').remove();
	}
	
	// Use the first floatmenu (should be home) as the active menu for searchresult transaction
	$('#search_menu_top').val($('#floatNav a:first').attr('id'));	

}

// JavaScript Document
$(document).ready(function()
{
	ticker();
});

// ==============================================================================================================
function ticker () {
	try
	{
		var ticker_holder = $('.ticker-holder').get(0);
		var ticker_text = $('.ticker').get(0);
		var ticker_pos = ticker_text.parentNode.offsetWidth;
	
		var ticker_data = $(ticker_holder).html();
		$(ticker_text).parent().html('<marquee scrollamount="2" scrolldelay="40">' + ticker_data + '</marquee>');
	
		$('#tickerContainer').hover
		(
			//function() { $('marquee', this).get(0).stop();  },
			//function() { $('marquee', this).get(0).start(); }
		);
	}
	catch (o) {}
}
