/**
 * This document should contain scripts that are unique for this site only
 */

var $j = jQuery.noConflict();

$j(document).ready(function() {
	
	//site-specific jQuery-scripts goes in here...
	
	$j('#image-zoom, #clip-image-medium').click(zoomClipImage)
	$j('#clip-image-zoom, .overlay').live('click',function() {
		zoomClipImage();
	});
	
	function zoomClipImage() {
		if($j("#clip-image-zoom").is(':visible')){
			$j("body > div.overlay").remove();
			$j("#clip-image-zoom").fadeOut();	
		} else {
			var imgSrc = $j('#image-zoom').attr('imgattr');
			$j('#clip-image-zoom').attr("src",imgSrc)
			$j("#clip-image-zoom").fadeIn('normal');		
			$j("body").append('<div class="overlay"></div>');
		}
	}
	
	$j('.simplemoviemodal').click(function (e) {
		e.preventDefault();
		var playerid = this.getAttribute('data-playerid');
		$j.modal('<iframe src="http://player.vimeo.com/video/'+playerid+'?title=0&byline=0&portrait=0&autoplay=1" width="800" height="450" frameborder="0"></iframe>');
	});
	
	
	if($j.browser.msie) {
		$j("#scroller").simplyScroll({
			className: 'custom',
			autoMode: 'loop',
			pauseOnHover: true,
			frameRate: 60,
			speed: 5
		});		
	} else {
		$j("#scroller").simplyScroll({
			className: 'custom',
			autoMode: 'loop',
			pauseOnHover: true,
			frameRate: 32,
			speed: 5
		});
	}

});
