//alert('Addon loaded');



//Time of day message script- by javascriptkit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use

var Digital=new Date()
var hours=Digital.getHours()

if (hours>=5&&hours<=11) //MESSAGE FOR MORNING
message = 'Goedemorgen';
else if (hours>=12&&hours<=17) //MESSAGE FOR AFTERNOON
message = 'Goedemiddag';
else if (hours>=18&&hours<=23) //MESSAGE FOR EVENING 
message = 'Goedenavond';
else //MESSAGE FOR NIGHT
message = 'Goedenacht';


function bye() {
	//alert('Bedadnkt voor uw bezoek en tot de volgende keer!');
}

function load() {
	if($('idleVideo')) $('idleVideo').style.display = "none";
	var load = window.open('http://berekenen.fpb.nl','','scrollbars=yes,menubar=no,height=600,width=1024,resizable=yes,toolbar=no,location=no,status=no');
}

window.addEvent('domready', function() {

	
//--animated text

if($('horizontal_slide')) defineText();

function defineText() {
	
	var y = new Chain();
	
	var first = function() {
		$('horizontal_slide').setOpacity(0);
		animatedText(message + '!<br />Welkom bij FPB!');
		};
	
	var second = function() {
		$('horizontal_slide').setOpacity(0);
		animatedText('Vragen? Bel gerust!<br />0162 - 408630');
		};
	
		y.chain(first);
		//y.chain(second);
		y.callChain();
		y.callChain.delay(16000, y);
		
}


//if($chk('horizontal_slide')) alert('The object exists or is 0.');

function animatedText(text) {

var fxSlide = new Fx.Slide('horizontal_slide', {mode: 'horizontal'});
var x = new Chain();

var one = function() {
	
	$('horizontal_slide').innerHTML = text;
	fxSlide.hide();
	$('horizontal_slide').setOpacity(1);
	
	
};

var two = function() {
	fxSlide.slideIn();
};

var three = function() { 
	fxSlide.slideOut();

};

x.chain(one);
x.chain(two);
x.chain(three);
x.callChain();
x.callChain.delay(4000, x);
x.callChain.delay(8000, x);

}

	
});
