var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-11701296-1']);
_gaq.push(['_setDomainName', '.viorotica.com']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

$(document).ready(function() {

	$(".toooltipme[title]").tooltip({ 
		position: 'bottom center',
		effect: 'slide'
	});
	
	$(".showmetooltip[title]").tooltip({ 
		effect: 'slide'
	}).dynamic( { 
		bottom: { 
			direction: 'down', 
			bounce: true 
		} 
	});
	
	$(".videotip[title]").tooltip({ 
		position: "bottom center",
		offset: [3, 0],
		effect: 'fade'
	});
	
	$("#inputs :input").tooltip({		
		position: "center right",
		offset: [-2, 10],
		effect: "fade",
		opacity: 1.0
	});
});

flowplayer("tourPlayer", "http://cdn.viorotica.com/swf/ohcplayer.commercial-3.2.1.swf",  { 
	key: '#@927afffa239f6332f5b', 
	
	clip: { 
		url: 'mp4:vod/viovod.trifectacreation/promo2.mp4',
		autoPlay: false,
		autoBuffering: false,
		provider: 'rtmp',
		linkUrl: 'http://viorotica.com/join/'
	},
	
	canvas: { 
		backgroundImage: 'url(http://cdn.viorotica.com/media/preview.jpg)' 
	},
			
	plugins: {
		rtmp: {
			url: 'ohcplayer.rtmp-3.2.1.swf',
			netConnectionUrl: 'rtmp://vod01.netdna.com/play'
		},
		controls: { 
			url: 'ohcplayer.controls.swf' 
		}  
	}
	
});

jQuery(document).ready(function($) {
	// We only want these styles applied when javascript is enabled
	$('div.navigation').css({'width' : '300px', 'float' : 'left'});
	$('div.content').css('display', 'block');

	// Initially set opacity on thumbs and add
	// additional styling for hover effect on thumbs
	var onMouseOutOpacity = 0.67;
	$('#thumbs ul.thumbs li').opacityrollover({
		mouseOutOpacity:   onMouseOutOpacity,
		mouseOverOpacity:  1.0,
		fadeSpeed:         'fast',
		exemptionSelector: '.selected'
	});
	
	// Initialize Advanced Galleriffic Gallery
	var gallery = $('#thumbs').galleriffic({
		delay:                     4500,
		numThumbs:                 1,
		preloadAhead:              10,
		enableTopPager:            false,
		enableBottomPager:         false,
		maxPagesToShow:            0,
		imageContainerSel:         '#slideshow',
		controlsContainerSel:      '#controls',
		captionContainerSel:       '#caption',
		loadingContainerSel:       '#loading',
		renderSSControls:          false,
		renderNavControls:         false,
		playLinkText:              'Play Slideshow',
		pauseLinkText:             'Pause Slideshow',
		prevLinkText:              '&lsaquo; Previous Photo',
		nextLinkText:              'Next Photo &rsaquo;',
		nextPageLinkText:          'Next &rsaquo;',
		prevPageLinkText:          '&lsaquo; Prev',
		enableHistory:             false,
		autoStart:                 true,
		syncTransitions:           true,
		defaultTransitionDuration: 1500,
		onSlideChange:             function(prevIndex, nextIndex) {
			// 'this' refers to the gallery, which is an extension of $('#thumbs')
			this.find('ul.thumbs').children()
				.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
				.eq(nextIndex).fadeTo('fast', 1.0);
		},
		onPageTransitionOut:       function(callback) {
			this.fadeTo('fast', 0.0, callback);
		},
		onPageTransitionIn:        function() {
			this.fadeTo('fast', 1.0);
		}
	});
});