$(function(){ 
     
        // init fancybox
         $('a.grow').fancybox({
           titlePosition:'over'
          });

      var br = (jQuery.browser.msie) ? true : false;
      var brv = parseInt(jQuery.browser.version);
	
        if (br === false || br === true && brv > '6') {
        $('#slides').nivoSlider({
		effect:'fade',
		animSpeed: 1000,
		directionNav: false,
		controlNav: false,
		pauseTime: 6000,
		pauseOnHover:false
	});
        }

/*
	if ($('a.videoplayer').index() != -1) {	
		$f("a.videoplayer", "http://releases.flowplayer.org/swf/flowplayer-3.2.4.swf", {
			clip: {
	            onBeforeBegin: function() {
					$f("*").each(function () {
						this.stop();
					});
				}
			},
			plugins:  {
				controls:  {
					backgroundColor: "transparent",
					backgroundGradient: "none",
					sliderColor: '#704D31',
					progressColor: '#E54E00',
					bufferColor: '#704D31',
					sliderBorder: '1.5px solid rgba(113, 78, 50, 0.7)',
					volumeSliderColor: '#704D31',
					volumeBorder: '1.5px solid rgba(113, 78, 50, 0.7)',
					timeColor: '#ffffff',
					durationColor: '#dfdfdf',
					tooltipColor: 'rgba(113, 78, 50, 0.8)',
					tooltipTextColor: '#ffffff'		
				}
			}
		});
	}
	
*/
	if ($('a.audioplayer').index() != -1) {
		$("a.audioplayer").flowplayer("http://releases.flowplayer.org/swf/flowplayer-3.2.4.swf", {
			onBeforeLoad: function() {
				var n = jQuery(this.getParent());
				var b = n.parent().html();
			
				if (jQuery(b).hasClass('small')) {
					d = true;
				} else {
					d = false;
				}
			},
			onLoad: function() {
				c = this.getControls();
			
				if (d === true) {
					c.css({background: 'url(/files/global_files/bg-audioplayersmall.png) no-repeat'});
					c.css({backgroundColor: 'transparent'});
					c.css({height: '24'});
					c.css({width: '160'});
				} else {
					c.css({background: 'url(/files/global_files/bg-audioplayer.png) no-repeat'});
					c.css({backgroundColor: 'transparent'});
				}
			},
			clip: {
				autoPlay: true,
		            onBeforeBegin: function() {
					 $f("*").each(function () {
		       				this.stop();
		     			});
		            }
			},
			plugins:  {
				controls:  {
					fullscreen: false,
					time: false,
					mute: false,
					volume: false,
					tooltips: null,
					backgroundGradient: "none",
					sliderColor: '#999999',
					progressColor: '#704D31',
					bufferColor: '#dfdfdf',
					sliderBorder: '0px solid #704D31',
					buttonColor: '#ffffff',
					buttonOverColor: '#704D31',
					buttonBorderColor: '#ffffff',
					autoHide: false,
					height: '24',
					width: '212'
				}
			},
			canvas: {
				backgroundColor: '#dfdfdf'
			}
		});
	}
	
});
