var playerAee = null;var playerBee = null;var homevidnum = random_number(0,2);// fades site in after loading$(document).ready(function(){	// animate opacity to full			$("#wrapper").animate({opacity:1}, 1500);		});// when the DOM is ready...$(document).ready(function () {	var $panels = $('#slider .scrollContainer > div');    var $container = $('#slider .scrollContainer');    // if false, we'll float all the panels left and fix the width     // of the container    var horizontal = true;    // float the panels left if we're going horizontal    if (horizontal) {        $panels.css({            'float' : 'left',            'position' : 'relative' // IE fix to ensure overflow is hidden        });        // calculate a new width for the container (so it holds all panels)        $container.css('width', $panels[0].offsetWidth * $panels.length);    }    // collect the scroll object, at the same time apply the hidden overflow    // to remove the default scrollbars that will appear    var $scroll = $('#slider .scroll').css('overflow', 'hidden');    // apply our left + right buttons  /*  $scroll        .before('<img class="scrollButtons left" src="images/scroll_left.png" />')        .after('<img class="scrollButtons right" src="images/scroll_right.png" />'); */    // handle nav selection    function selectNav() {        $(this)            .parents('ul:first')                .find('a')                    .removeClass('selected')					//.animate({opacity: .5}, 300)                .end()            .end()            .addClass('selected');			//.animate({opacity: 1}, 300);    }    $('#slider .navigation').find('a').click(selectNav);    // go find the navigation link that has this target and select the nav    function trigger(data) {        var el = $('#slider .navigation').find('a[href$="' + data.id + '"]').get(0);        selectNav.call(el);    }    if (window.location.hash) {        trigger({ id : window.location.hash.substr(1) });    } else {        // $('ul.navigation a:last').click();		    }    // offset is used to move to *exactly* the right place, since I'm using    // padding on my example, I need to subtract the amount of padding to    // the offset.  Try removing this to get a good idea of the effect    var offset = parseInt((horizontal ?         $container.css('paddingTop') :         $container.css('paddingLeft'))         || 0) * -1;    var scrollOptions = {        target: $scroll, // the element that has the overflow        // can be a selector which will be relative to the target        items: $panels,        navigation: '.navigation a',        // selectors are NOT relative to document, i.e. make sure they're unique    //    prev: 'img.left',     //    next: 'img.right',        // allow the scroll effect to run both directions        axis: 'x',        onAfter: trigger, // our final callback        offset: offset,        // duration of the sliding effect        duration: 1100,        // easing - can be used with the easing plugin:         // http://gsgd.co.uk/sandbox/jquery/easing/        easing: 'jswing'    };    // apply serialScroll to the slider - we chose this plugin because it     // supports// the indexed next and previous scroll along with hooking     // in to our navigation.    $('#slider').serialScroll(scrollOptions);    // now apply localScroll to hook any other arbitrary links to trigger     // the effect    $.localScroll(scrollOptions);    // finally, if the URL has a hash, move the slider in to position,     // setting the duration to 1 because I don't want it to scroll in the    // very first page load.  We don't always need this, but it ensures    // the positioning is absolutely spot on when the pages loads.    scrollOptions.duration = 1;    $.localScroll.hash(scrollOptions);});// About Team/map fading$(function(){					$(".teamphoto").hover(function(){				$(this).animate({color:"#29ABE2"},{queue:false,duration:500});				$hovered = $(this);							var idToFade = $hovered.attr("id").split('-');								$("#" + idToFade).animate({opacity: 1},{queue:false,duration:500});								/*	//we search trough the content for the visible div and we fade it out					$("#teamtext").find("div:visible").fadeOut("fast", function(){						//once the fade out is completed, we start to fade in the right div						$(this).parent().find("#" + idToLoad[0]).fadeIn();						});					*/	}, function(){				$(this).animate({color:"#cccccc"},{queue:false,duration:500});				$(".textabout").animate({opacity: 0},{queue:false,duration:500});			});  						$("#infoabout2").hover(function(){				$("#map").animate({opacity: 1},{queue:false,duration:500});				}, function(){					$("#map").animate({opacity: 0.8},{queue:false,duration:500});				});						$("#infoabout3").hover(function(){				$(this).animate({top: 244,height: 250},{queue:false,duration:500});				$("#infoabout1").animate({height: 174},{queue:false,duration:500});				$(".textFade").animate({opacity: .6},{queue:false,duration:500});				}, function(){					$(this).animate({top: 305,height: 180},{queue:false,duration:500});					$("#infoabout1").animate({height: 235},{queue:false,duration:500});					$(".textFade").animate({opacity: 1},{queue:false,duration:500});				});});// end About Team/map fading// Blog/Stick to us fading$(function(){					$(".stickicon").hover(function(){				$hovered = $(this);				var idToFade = $hovered.attr("id").split('-');				$("#" + idToFade).animate({opacity: 1},{queue:false,duration:500});			}, function(){				$(".textstick").animate({opacity: 0},{queue:false,duration:500});			});  						$("#infoblog1").hover(function(){				$("#blogcontent").animate({opacity: 1},{queue:false,duration:500});				}, function(){					$("#blogcontent").animate({opacity: 0.8},{queue:false,duration:500});				});});// end Blog/Stick to us fading// JWplayer Script -->// the idea is... window load run demo reel on home page... when tab over, pause the homepage video and prep the projects video, vice-versa -->// initialize the video players script-->/*$(document).ready(function(){		createPlayer('playerAholder','playerA','http://www.stuckonon.com/playlist/playlist_home.xml',false,'640','380','bottom');		createPlayer('playerBholder','playerB','http://www.stuckonon.com/playlist/playlist_reel.xml',false,'640','380','bottom');		//homepagecaption();		projectpagecaption();		});	function createPlayer(thecontainer, theplayid, thefile, theauto, thewidth, theheight, thecontrol) {            var flashvars = {                    file:thefile,                     autostart:theauto, 					image:"http://www.stuckonon.com/videostill/Soo-jamboxlogo2.jpg",					controlbar:thecontrol,					skin:"http://www.stuckonon.com/JWplayer/modieus2.swf",					bufferlength:"10",					playlist:"none"					// abouttext:"Stuck On On"            }            var params = {                    allowfullscreen:"true",                     allowscriptaccess:"always"            }            var attributes = {                    id:theplayid,                      name:theplayid            }            swfobject.embedSWF("http://www.stuckonon.com/JWplayer/player47.swf", thecontainer, thewidth, theheight, "9.0.115", false, flashvars, params, attributes);};// used to be "player2.swf" function playerReady(obj){        switch(obj.id){          case 'playerA':            playerAee = gid(obj.id);          break;          case 'playerB':            playerBee = gid(obj.id);          break;		}		playhome(playerAee,homevidnum);		homepagecaption(homevidnum);      };function gid(name)      {        return document.getElementById(name);      };*/// **** Vimeo Player functions ****// RETURNS PSEUDO-RANDOM NUMBER IN RANGE min...maxfunction random_number(min,max) {    return (Math.round((max-min) * Math.random() + min));};// this scripts control the appropriate player from onclicks-->function pausevideo(whichplayer){			whichplayer.sendEvent("PLAY","false");		};		function pausevimeo(v_id){			$f('vimeoPlayerA').api('pause');			$f('vimeoPlayerB').api('pause');			$f('vimeoPlayerC').api('pause');			$f('vimeoPlayerD').api('pause');			$f('vimeoPlayerE').api('pause');		};		function testalert(){			alert('This is an alert');};function growWindow(howmuch,howmuch2){			$("#bottomTag").animate({top: howmuch},{queue:false,duration:500});			$("#grey").animate({height: howmuch2},{queue:false,duration:500});};function badgeOpacity(howmuchOp){			$("#vimeobadgecontent").animate({opacity: howmuchOp},{queue:false,duration:500});}// to controll Viemo 'badge' in Trailers and Projects$(function() {    // Add an event listener to the click event for each of your thumbnails    $('.clip a').click(function(e) {		// stops default browser behaviour of loading a new page        e.preventDefault();         // changes src of the iframe to the one we stored in the clicked thumbnail        var newsrc = this.getAttribute('href');        var newsrcNum = newsrc.split('/');        $('#vimeoPlayerE').get(0).src = ('http://player.vimeo.com/video/' + newsrcNum[3] + '?title=0&byline=0&portrait=0&color=ff9933&api=1&player_id=vimeoPlayerE');    });});function stopvideo(whichplayer){			whichplayer.sendEvent('STOP');		};		function playfromlist(whichplayer2,vidnum,holderID){			printItemData(whichplayer2,vidnum,holderID);			whichplayer2.sendEvent('STOP');			whichplayer2.sendEvent('ITEM',vidnum);			//whichplayer2.sendEvent('STOP');		};		function playfromlist2(whichplayer2,vidnum,holderID){			whichplayer2.sendEvent('STOP');			whichplayer2.sendEvent('ITEM',vidnum);			var title = whichplayer2.getPlaylist()[vidnum].title;			printMusicData(holderID,title);		};		function playhome(whichplayer,vidnum){			whichplayer.sendEvent('ITEM',vidnum);			whichplayer.sendEvent('PLAY','false');			whichplayer.sendEvent('STOP');		};function playfromfile(whichplayer2,vidfile,holderID,holdertext){			printMusicData(holderID,holdertext);			whichplayer2.sendEvent('STOP');			whichplayer2.sendEvent('LOAD', {				file: 'http://www.stuckonon.com/videos/' + vidfile,				image: 'http://www.stuckonon.com/videostill/Soo-jamboxlogo2.jpg'			});			whichplayer2.sendEvent('PLAY','true');			//whichplayer2.sendEvent('ITEM',vidnum);			//whichplayer2.sendEvent('STOP');		};		function skipvideoto(whichplayer2,seconds){			whichplayer2.sendEvent("PLAY","false");			whichplayer2.sendEvent("SEEK",seconds);			whichplayer2.sendEvent("PLAY","true");		};function loadplaylist(whichplayerx,whichlist,holderID){			printReset(holderID);			var dalist = ("http://www.stuckonon.com/playlist/playlist_" + whichlist + ".xml");			whichplayerx.sendEvent('STOP');			whichplayerx.sendEvent('LOAD',dalist);			whichplayerx.sendEvent('REDRAW');			playfromlist(whichplayerx,'0',holderID);			//whichplayerx.sendEvent('STOP');			//whichplayerx.sendEvent('ITEM','0');			//playfromlist(whichplayerx,'0',holderID);			//alert('1 - '+whichplayerx+'  2 - '+dalist)		};	// listeners and writers for info from playlist for video descriptions		function printItemData(playerID, VideoID, HolderID) {	var descript = playerID.getPlaylist()[VideoID].description;	var title = playerID.getPlaylist()[VideoID].title;	var auth = playerID.getPlaylist()[VideoID].author;	var lnk = playerID.getPlaylist()[VideoID].link;	var serv = playerID.getPlaylist()[VideoID].tags;	if (title) {	var txt = '';		txt += '<li><span class="bold"><i>' + title + '</i></span>';		if (lnk) {txt += '   ' + lnk + ' '};		txt += '</li>';		if (descript) {			txt += '<li>' + descript + '</li>'		};		if (auth) {			txt += '<li><span class="bold">Credits:: </span>' + auth + '</li>'		};		if (serv) {			txt += '<li><span class="bold">Services: </span>' + serv + '</li>'		};		var tmp = document.getElementById(HolderID);			if (tmp) { tmp.innerHTML = txt; };			}};function printMusicData(HolderID,title) {	var txt = '';		txt += '<li><span class="bold"><i>' + title + '</i></span></li>';		txt += '<li>&nbsp;</li>';		txt += '<li>These songs are available to be licensed as is, or can be modified to fit your specific needs.</li>';		var tmp = document.getElementById(HolderID);			if (tmp) { tmp.innerHTML = txt; };			};function printReset(HolderID) {	var txt = '';		txt += '<li><span class="bold"><i>Stuck On On</i></span></li>';		txt += '<li>&nbsp;</li>';		var tmp = document.getElementById(HolderID);			if (tmp) { tmp.innerHTML = txt; };		};function homepagecaption(vidnum) {	var descrTmp = playerAee.getPlaylist()[vidnum].description;	var titleTmp = playerAee.getPlaylist()[vidnum].title;	var txt = '';		txt += '<li><span class="bold">Recent project... <i>' + titleTmp + '</i></span></li>'		txt += '<li>' + descrTmp + '</li>';			var tmp = document.getElementById("playerAdat");		if (tmp) { tmp.innerHTML = txt; }};function projectpagecaption() {	var titleTmp = "Stuck On On";	var descrTmp = "Do you remember that time we did that thing that made everybody feel weird about all that stuff we did before we did that other thing that she thought was funny?";	var authTmp = "SOO's Finest"	var txt = '';		txt += '<li><span class="bold"><i>' + titleTmp + '</i></span></li>';		//txt += '<li>' + descrTmp + '</li>';		//txt += '<li>Credits: ' + authTmp + '</li>';		var tmp = document.getElementById("playerBdat");		if (tmp) { tmp.innerHTML = txt; }};/*//animate multiple videos on one project (buttons)$(function(){   				$(".subbutton").hover(function(){ alert('hey yo'+(this));				$(this).animate({color:"#4B5D67"},{queue:false,duration:500});				}, function(){					$(this).animate({color:"#CCCCCC"},{queue:false,duration:500});				}); });  */// Reel menu script for JWplayer$(function(){					$("#menu-wrap-home div.button, div.button2").hover(function(){				$(this).animate({opacity: 1},{queue:false,duration:500});							}, function(){				$(this).animate({opacity: 0.5},{queue:false,duration:500});			});											$("#menu-wrap div.button, div.button2").click(function(){								$clicked = $(this);									// each button div MUST have a "xx-button" and the target div must have an id "xx" 				var idToLoad = $clicked.attr("id").split('-');				var boxsize = (idToLoad[2]*20)+34;								$('#menulist').animate({ height : boxsize+'px' }, { duration: 500, easing: 'jswing' });				$('#nav_move').fadeOut();				/*				// if the button is not already "transformed" AND is not animated				if ($clicked.css("opacity") != "1" && $clicked.is(":not(animated)")) {									$clicked.animate({						opacity: 1					}, 300);					*/									//we search trough the content for the visible div and we fade it out				$("#menulist").find("div:visible").fadeOut("fast", function(){						//once the fade out is completed, we start to fade in the right div						$(this).parent().find("#" + idToLoad[0]).fadeIn();}, function callback() {  						$(".promenu-title").css({'opacity':'1'}); // dom element						});								//load proper playlist				setTimeout(function(){loadplaylist(playerBee,idToLoad[0],'playerBdat');},500);											/*	}; */												//we reset the other buttons to default style				/* $clicked.siblings(".button,.button2").animate({					opacity: 0.5}, 300 ); */							});						});// menu script$(function(){					$("#menu-wrap div.button, div.button2").hover(function(){				$(this).animate({opacity: 1},{queue:false,duration:500});							}, function(){				$(this).animate({opacity: 0.5},{queue:false,duration:500});			});											$("#menu-wrap div.button, div.button2").click(function(){								$clicked = $(this);									// each button div MUST have a "xx-button" and the target div must have an id "xx" 				var idToLoad = $clicked.attr("id").split('-');				var boxsize = (idToLoad[2]*20)+34;								$('#menulist').animate({ height : boxsize+'px' }, { duration: 500, easing: 'jswing' });				$('#nav_move').fadeOut();				/*				// if the button is not already "transformed" AND is not animated				if ($clicked.css("opacity") != "1" && $clicked.is(":not(animated)")) {									$clicked.animate({						opacity: 1					}, 300);					*/									//we search trough the content for the visible div and we fade it out				$("#menulist").find("div:visible").fadeOut("fast", function(){						//once the fade out is completed, we start to fade in the right div						$(this).parent().find("#" + idToLoad[0]).fadeIn();}, function callback() {  						$(".promenu-title").css({'opacity':'1'}); // dom element						});								//load proper playlist				setTimeout(function(){loadplaylist(playerBee,idToLoad[0],'playerBdat');},500);											/*	}; */												//we reset the other buttons to default style				/* $clicked.siblings(".button,.button2").animate({					opacity: 0.5}, 300 ); */							});						});//animated selection for project list$(function(){			      	$('#menulist .promenu a').click(function() {        	$clicked = $(this);			var offset = $clicked.position().top;       		//var offsetBody = $('#menu-wrap').position().top; //find the offset of the wrapping div           		//alert(offset);			/*			if (jQuery.browser.mozilla) {				offset = offset + 10			};						*/			//alert($clicked+'  '+offset+'  '+offsetBody);					//$('.cur').removeClass('cur');        //$clicked.addClass('cur');		        $('#nav_move').animate(          { 			top: (offset)          },           { duration: 500, easing: 'jswing' }        );        						/*		//we search trough the content for the colored text and fade it back		$(".promenu a").animate({color:"#cccccc"},{queue:true,duration:500}, function(){			$(this).animate({				color: "#FFFFFF"			}, {				queue: false,				duration: 500			});		});								//$(this).animate({color:"#29ABE2"},{queue:false,duration:500});						*/						if ($('#nav_move').css("display") == "none") {			$('#nav_move').fadeIn();		};      });	});// end menu script/*var player = null;function itemTracker(obj) { alert('the new Item state is: '+obj.title); };function playerReady(obj){	player = obj.id;	addListener();};	function theplaylist(playerID) {	alert('player ready ready: '+playerID+'');	playlisttrigger = "";	playlisttrigger = playerID.getPlaylist()[0].title;	alert('title ready: '+playlisttrigger+'');};function printItemData(playerID, VideoID) {	var playerAA=null;	var playerBB=null;	var title = playerID.getPlaylist()[VideoID].title;	var descript = playerID.getPlaylist()[VideoID].description;	var playerJoe = playerID;	if (title) {		var txt = '';		txt += '<li>title: ' + title + '</li>';		txt += '<li>description: ' + descript + '</li>';		txt += '<li>player: ' + playerJoe + '</li>';		txt += '<li>playerID: ' + playerID + '</li>';		if (playerJoe == "playerA") {			var tmp = document.getElementById("playerAdat");			if (tmp) {				tmp.innerHTML = txt;			};		}		else {			if (playerJoe == "playerB") {				var tmp = document.getElementById("playerBdat");				if (tmp) {					tmp.innerHTML = txt;				}			};		};	};};function addListeners() {	playerA.addControllerListener("ITEM","itemTracker");	};function addListenersOther() {	if (player) { 		player.addControllerListener("ITEM","itemTracker");	} else {		setTimeout("addListeners()",100);	}};/*function itemListener(obj) { 	if (obj.index != currentItem) { 		previousItem = currentItem;		currentItem = obj.index;		getPlaylistData(currentItem);	}};function getPlaylistData(theIndex) {	var plst = null;	plst = player.getPlaylist();	if (plst) {		if (player = "playerA") {		var txt = '';		txt += '<li><b>item number: </b>'+theIndex+':';		txt += '<li><b>title: </b>'+plst[theIndex].title+'</li>';		txt += '<li><b>author: </b>'+plst[theIndex].author+'</li>';		txt += '<li><b>info: </b>'+plst[theIndex].info+'</li>';		txt += '<li><b>description: </b>'+plst[theIndex].description+'</li>';		txt += '<li><b>player: </b>'+player+'</li>';				var tmp1 = document.getElementById("playerAdat");		if (tmp1) { tmp1.innerHTML = txt; }		}		else {			var txt = '';			txt += '<li><b>item number: </b>'+theIndex+':';			txt += '<li><b>title: </b>'+plst[theIndex].title+'</li>';			txt += '<li><b>author: </b>'+plst[theIndex].author+'</li>';			txt += '<li><b>file: </b>'+plst[theIndex].file+'</li>';			txt += '<li><b>image: </b>'+plst[theIndex].image+'</li>';			txt += '<li><b>link: </b>'+plst[theIndex].link+'</li>';			txt += '<li><b>description: </b>'+plst[theIndex].description+'</li>';			var tmp2 = document.getElementById("playerBdat");			if (tmp2) { tmp2.innerHTML = txt; }		}	} 	};*/	
