function doReportingPageView(pageName) {
		var s=s_gi(s_account);
			s.pageName = pageName;
			void(s.t());
		}
		
		function doReportingEvent(eventName) {
			var s=s_gi(s_account);
			s.linkTrackVars= eventName;
			s.events = eventName;
			void(s.tl());
		}
		
var array_items_dvd = new Array(
							new Array("Blue Crush 2",//title
									  "http://www.nbcuniversalstore.com/detail.php?p=294590&v=universal-studios&ecid=PRF-TV2-101131&pa=PRF-TV2-101131",//dvdlink
									  "http://www.nbcuniversalstore.com/detail.php?p=294591&v=universal-studios&ecid=PRF-TV2-101131&pa=PRF-TV2-101131",//blulink
									  "http://bluecrush2.alloy.com/",//sitelink
									  true//has a dvd?
									  ),
							new Array("Blue Crush",//title
									  "http://www.nbcuniversalstore.com/detail.php?p=5976&v=universal-studios&ecid=PRF-TV2-101131&pa=PRF-TV2-101131",//dvdlink
									  "http://www.nbcuniversalstore.com/detail.php?p=294779&v=universal-studios&ecid=PRF-TV2-101131&pa=PRF-TV2-101131",//blulink
									  "http://bluecrush2.alloy.com/",//sitelink
									  true//has a dvd?
									  )
										
							);	
	
	$(document).ready(function(){
	
		var number_gallery = ($('#gallery_container > div').length) - 1;
		var current_image=0;
		
		$('#gallery_container > div').css('background-color','#005888');
		$('#gallery_container > div > img').css('opacity','0.6');
		$('#gallery_container > div:eq(0)> img').css('opacity','1');
		$('#video_scroll_container .video_content:eq(0)').addClass('selected');
		$('#scroll_container .scroll_item a > img ').reflect({'height':'0.8'});
		// $('#scroll_container').width($('#scroll_container> *').length*225);
		$('#gallery_container').width($('#gallery_container > div').length*104);
		
		if($('#video_scroll_container .video_content').length < 5 )
		{
			 $('#video_next').hide();
			  $('#video_prev').hide();
		}
		$('#video_scroll_container').css("text-align","center");
		 $('#video_prev').click(function () { 
		
			  $('#video_scroll_container').scrollTo('-=217px', 1000,{axis:'x'} );
			
			});
	    $('.video_content').click(
	   
	    function () { 
	    	$('#video_scroll_container .video_content').removeClass('selected');
	    	$(this).addClass('selected');
	    	var video_id = $(this).attr("id").substr(6);
			var image_name =  $(this).attr("tittle");

			//alert(image_name);
	    	//embeddedPlayerManager.getPlayer().playVideo(video_id);
	    	Outlet.getOutletExtension('embeddedPlayer').playVideo(video_id)
	    	
			var url = 'http://www.bluecrushmovie.com/fb'+video_id+'v.php';
var title = 'Title';
var desc = 'Desc';
var addthisparams = 'url='+url+'&title='+title+'&description='+desc+'&username=ankur79';

sharehtml = '<div class="addthis_toolbox addthis_default_style" style="padding-top:20px" > SHARE:<div style="display:inline"><a class="addthis_button_email" href ="http://api.addthis.com/oexchange/0.8/forward/email/offer?'+addthisparams+'"><img src="http://widgets.nbcuni.com/addthis/icons/email21.png"/></a></div><div style="display:inline"><a class="addthis_button_twitter" href ="http://api.addthis.com/oexchange/0.8/forward/twitter/offer?'+addthisparams+'"><img src="http://widgets.nbcuni.com/addthis/icons/twitter21.png"/></a></div> <div style="display:inline"><a class="addthis_button_facebook" href ="http://www.addthis.com/bookmark.php?v=250&amp;winname=addthis&amp;pub=ankur79&amp;source=tbx-250&amp;lng=en-US&amp;s=facebook&amp;'+addthisparams+'"><img src="http://widgets.nbcuni.com/addthis/icons/facebook21.png"/></a></div> <div style="display:inline"><a class="addthis_button_myspace" href ="http://api.addthis.com/oexchange/0.8/forward/myspace/offer?'+addthisparams+'"><img src="http://widgets.nbcuni.com/addthis/icons/myspace21.png"/></a></div> <div style="display:inline"><a class="addthis_button_digg" href ="http://api.addthis.com/oexchange/0.8/forward/digg/offer?'+addthisparams+'"><img src="http://widgets.nbcuni.com/addthis/icons/digg21.png"/></a></div> <div style="display:inline"><a class="addthis_button_expanded" href ="//api.addthis.com/oexchange/0.8/offer?'+addthisparams+'"><img src="http://widgets.nbcuni.com/addthis/icons/more21.png"/>More...</a></div> </div>';

$('#shareIcons').html(sharehtml);

				switch(image_name)
				{
					case "Blue Crush 2":
						image_name = "bluecrush2";
						break;
	
					case "Blue Crush":
						image_name = "bluecrush";
						break;
						
							
				}
				
				var dvd_title = $('.vid_title').html();						
			
				//set up images			
				$('#imgblu').attr({src:"splash/images/bluecrush/"+image_name+"_blu.png",alt:dvd_title});
				$('#imgcopy').attr({src:"splash/images/bluecrush/"+image_name+"_ownit_post.png",alt:dvd_title});			
				
				var tmpFound = false;
				for(var i in array_items_dvd)
				{								
					if($(this).attr("tittle") == array_items_dvd[i][0])
					{
						if(array_items_dvd[i][4])
						{
							$('#imgdvd').attr({src:"splash/images/bluecrush/"+image_name+"_dvd.png",alt:dvd_title});
							$('.dvd').css("visibility","visible");
							//$('.visit').css("visibility","visible");
							tmpFound = true;					
						}
						//set up links
						$('.dvdimg').attr({href:array_items_dvd[i][1]});
						$('a.buythedvd').attr({href:array_items_dvd[i][1]});
						$('.bluimg').attr({href:array_items_dvd[i][2]});
						$('a.buytheblu').attr({href:array_items_dvd[i][2]});
						//$('.buythedvd').attr({href:array_items_dvd[i][1]});
						//$('.bluimg').attr({href:array_items_dvd[i][1]});	
						//$('#linksite').attr({href:array_items_dvd[i][3]});					
					}								
				}
				if(!tmpFound)
				{
					
					/*
					$('.blu').hide();
					$('.visit').hide();				
					*/
					$('.dvd').css("visibility","hidden");
					
					//$('.visit').css("visibility","hidden");
				}									
				$(document).pngFix(); 


	    	}
	    );
		
		$('#video_next').click(function () { 
			$('#video_scroll_container').scrollTo('+=217px', 1000,{axis:'x'} );
	    });
		
	    $('#gallery_right').click(function () { 
	      $('#gallery_shim').scrollTo('+=104px', 1000,{axis:'x'} );
		  doReportingPageView("Photo Gallery : Photo");
	    });
		
		$('#gallery_left').click(function () { 
	      $('#gallery_shim').scrollTo('-=104px', 1000,{axis:'x'} );
		  doReportingPageView("Photo Gallery : Photo");
	    });
		
		$('#prev_pic').click(function () { 
			if(current_image != 0)
			{
				current_image--;
			}
			//$('#gallery_shim').scrollTo('-=104px', 1000,{axis:'x'} );
			$('#gallery_shim').scrollTo(current_image*104+"px",0, {duration:1000});
			$('#gallery_container > div > img').css('opacity','0.6');
			$('#gallery_container > div:eq('+current_image+') > img').css('opacity','1');
			$('#gallery_image').html($('#gallery_container > div:eq('+current_image+')').html())
			$('#gallery_image > img').width(527);
			$('#gallery_image> img').height(273);
			
		});
		
		$('.backtotop').click(function(){
			$.scrollTo('#nav',1000);
		});

		$('#next_pic').click(function () { 
	 	if(current_image != number_gallery)
	 	{
	 		current_image++;
	 	}
		
			//$('#gallery_shim').scrollTo('+=104px', 1000,{axis:'x'} );
			$('#gallery_shim').scrollTo(current_image*104+"px",0, {duration:1000});
			$('#gallery_container > div > img').css('opacity','0.6');
			$('#gallery_container > div:eq('+current_image+') > img').css('opacity','1');
			$('#gallery_image').html($('#gallery_container > div:eq('+current_image+')').html())
			$('#gallery_image > img').width(527);
			$('#gallery_image> img').height(273);
	    });

	
		$('#gallery_container > div').click(function(){
			current_image = $('#gallery_container > div').index(this);
			$('#gallery_shim').scrollTo(current_image*104+"px",0, {duration:1000});
			$('#gallery_container > div > img').css('opacity','0.6');
			$('#gallery_container > div:eq('+current_image+') > img').css('opacity','1');
			$('#gallery_image').html($(this).html());
			$('#gallery_image > img').width(527);
			$('#gallery_image> img').height(273);
		});
	    
	  
	 
		$('#gallery_image').html($('#gallery_container > div:eq(0)').html())
	    $('#gallery_image > img').width(527);
	    $('#gallery_image> img').height(273);

		// $('#productfeatures .mod-body-content .scroll-area').jScrollPane({scrollbarWidth: 5});
		
		//$('#synopsis .mod-body-content .textcol').jScrollPane({scrollbarWidth: 5});

	 });
	
