// install overlay with default settings jQuery(document).ready(function() { if (jQuery('#player').length > 0) { setupFlowPlayerOnOverlay(); //alert ("Setting UP Flowplayer"); } else { //alert(jQuery('#player')); } }); function setupFlowPlayerOnOverlay() { jQuery(function() { // install flowplayer into flowplayer container var myLoc = location.href.split('?')[0]; if (typeof($f) != 'undefined') { var player = $f("player", "/videogallery/flowplayer/flowplayer-3.1.0.swf", { clip: { // track start event for this clip onStart: function(clip) { pageTracker._trackEvent("Videos", "Play", myLoc + "/" + clip.url); logEvent('Video Play', clip.url); }, // track pause event for this clip. time (in seconds) is also tracked onPause: function(clip) { pageTracker._trackEvent("Videos", "Pause", myLoc + "/" + clip.url, parseInt(this.getTime())); logEvent('Video Pause', clip.url); }, // track stop event for this clip. time is also tracked onStop: function(clip) { pageTracker._trackEvent("Videos", "Stop", myLoc + "/" + clip.url, parseInt(this.getTime())); logEvent('Video Stop', clip.url); }, // track finish event for this clip onFinish: function(clip) { pageTracker._trackEvent("Videos", "Finish", myLoc + "/" + clip.url); logEvent('Video Finish', clip.url); var VideoRequested = getCookieValue('VideoRequested'); if(clip.url.indexOf('Swimspa08big') != -1 && VideoRequested != 'Y') { doSwimSpaPopup = true; jQuery('.close').click(); displayVideoRequest(); } log_video_played(clip.url); if(typeof showFinishMessage == 'function') { showFinishMessage(); } } }, plugins: { myContent: { url: '/videogallery/flowplayer/flowplayer.content-3.1.0.swf', top: 0, left: 0, width: 640, height:385, html:'', display:'none', borderRadius: 0, backgroundColor:'#000000', backgroundGradient:[0.0,0.0], border:'0px solid #000000;', style: { '.discountImage': { textAlign:'center' } }, onClick: function() { this.hide(); $f("player").play(); } } } }); } // setup button action. it will fire our overlay jQuery("#overlay").overlay({ // when overlay is opened, load our player onLoad: function() { player.load(); }, // when overlay is closed, unload our player onClose: function() { player.stop(); player.unload(); } }); }); } // define function that opens the overlay function openOverlay() { // get access to the overlay API var api = jQuery("#overlay").overlay(); // call it's open() method api.load(); /* //var DialogString = '
'; Dialog.info(DialogString, { windowParameters: {resizable: false, width: 656, height:526, className:"alphacube"}}); setTimeout('playVideoInOverlay()', 1000); */ } function playVideoInOverlay() { flowplayer("player", "/videogallery/flowplayer/flowplayer-3.1.0.swf",{ clip: { baseUrl: 'http://test.endlesspools.com/videogallery/flashvideo', autoPlay: false, autoBuffering: true } } ); $f().play('intro.flv'); } function log_video_played(theVid) { var finished_videos = getCookieValue('finished_videos'); if (finished_videos) { if (finished_videos.indexOf(theVid) == -1) { finished_videos += ':' + theVid; createCookie('finished_videos', finished_videos, 365); } else { } } else { createCookie('finished_videos', theVid, 365); } }