	var blnPlaying = false;
	
	function playAnimations(type) {
		var arrRandomAnimation = ['blaffen','krabben','zitten'];
		var arrRandomDuration = [2360, 6360, 4360];
		var intRandomFirst = Math.floor(Math.random() * (arrRandomAnimation.length));
		var intRandomLast = Math.floor(Math.random() * (arrRandomAnimation.length));
		var strAnimation
		var strDuration
			
		switch (type) {
			case 'search':
				strAnimation = 'verte';
				strDuration = 10200;
				break;
			case 'inactive':
				strAnimation = 'lopen';
				strDuration = 14200;
				break;
			default:
				strAnimation = 'opstaan';
				strDuration = 7160;
		}

		if (!blnPlaying) {
			blnPlaying = true;
			playSWF(arrRandomAnimation[intRandomFirst]);
			setTimeout(function() { playSWF(strAnimation); setTimeout(function() { playSWF(arrRandomAnimation[intRandomLast]); setTimeout(function() { blnPlaying = false; }, arrRandomDuration[intRandomLast]); }, strDuration); }, arrRandomDuration[intRandomFirst]);
		}
	}
	
	function playSWF(file) {
		swfobject.embedSWF('/ContentSuite/template/lgp/flash/puppy_' + file + '.swf', 'search_animation', '400', (file == 'blaffen') ? '105' : '112', '9.0.0', '', {}, { wmode: 'transparent', loop: 'false' }, {});
	}
