// JavaScript Document
//**** Fill out the strings below for your site information
//**** Edit below only if you have a good understanding of javascript
// Functions
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function playVideo(URL){
	if (DetectAndroid()){
		location.href = URL+"_andriod.mp4";
	} else if (DetectIphoneOrIpod()){
		location.href = URL+"_iphone.mp4";
	} else {
		location.href = URL+"_andriod.mp4";
	}
}

function wFv(img,vid,tit,des,div){
	
var flashvars = {};
			
			//////////////////////////////////////////////////////////////////////////////////////////////////////
			// CUSTUMIZABLE PARAMETERS ///////////////////////////////////////////////////////////////////////
			//////////////////////////////////////////////////////////////////////////////////////////////////////
			
			// video width
			var stageW = 637;
			var stageH = 385;
			flashvars.imagePath			= img;
			flashvars.videoPath 		= vid;
			flashvars.title 			= tit;
			flashvars.description 		= des;
			flashvars.viewInfoButton 		=	"false";
			flashvars.viewFullscreenButton 	=	"true";
			flashvars.viewScaleButton 		=	"false";
			flashvars.viewVolumeControls 	=	"true";
			flashvars.viewTime				=	"true";
			flashvars.viewBigPlayButton 	=	"false";
			flashvars.viewRightClickMenu 	=	"true";
			flashvars.mouseHide				=	"true";
			flashvars.mouseHideTime			=	"3";
			flashvars.doubleClick			=	"false";
			flashvars.oneClick				=	"true";
			flashvars.spaceKey				=	"true";
			flashvars.videoLoop			=	"false";
			flashvars.videoAutoPlay		=	"true";
			flashvars.videoBufferTime	=	"0.1";
			flashvars.tlInterval		=	"100000";
			flashvars.soundVolume		=	"0.8";
			flashvars.fullSizeView		=	"2";
			flashvars.spacing 			=	"10";
			flashvars.controlHeight		=	"25";
			flashvars.volumeLengthW		= 	"50";
			flashvars.color1 			= 	"0x101010";
			flashvars.color2 			= 	"0x101010";
			flashvars.alpha1 			= 	"1";
			flashvars.alpha2 			= 	"1";
			flashvars.borderColor 		= 	"0x101010";
			flashvars.borderAlpha		= 	"1";
			flashvars.timeColor1		= 	"0x101010";
			flashvars.timeColor2		= 	"0x111111";
			flashvars.timeAlpha1		= 	"1";
			flashvars.timeAlpha2		= 	"1";
			flashvars.timeTextColor1	= 	"0xffffff";
			flashvars.timeTextColor2	= 	"0x888888";
			flashvars.scrubberHeight 	=	"3";
			flashvars.scrubberColor1	= 	"0x333333";
			flashvars.scrubberAlpha1	= 	"1";
			flashvars.scrubberColor2	= 	"0x0066CC";
			flashvars.scrubberAlpha2	= 	"1";
			flashvars.filterColor		= 	"0x0066CC";
			flashvars.filterAlpha		= 	"0";
			flashvars.titleColor			=	"0x47d2ff";
			flashvars.descriptionColor		=	"0xD3D3D3";
			flashvars.infoBackgroundColor	=	"0x000000";
			flashvars.infoBackgroundAlpha	=	"0.5";
			
			var params = {};
			params.scale = "noscale";
			params.allowfullscreen = "true";
			params.salign = "tl";
			params.bgcolor = "000000";
			
			var attributes = {};
			swfobject.embedSWF("../../videos/video-player.swf", div, stageW, stageH, "9.0.0", false, flashvars, params, attributes);
}

(function($){
  $.fn.shuffle = function() {
    return this.each(function(){
      var items = $(this).children();
      return (items.length)
        ? $(this).html($.shuffle(items))
        : this;
    });
  }
 
  $.shuffle = function(arr) {
    for(
      var j, x, i = arr.length; i;
      j = parseInt(Math.random() * i),
      x = arr[--i], arr[i] = arr[j], arr[j] = x
    );
    return arr;
  }
})(jQuery);
/*
                         ''~``
                        ( o o )
+------------------.oooO--(_)--Oooo.------------------+
|                   + Developed By +                  |
|                    ExxonMobil VCS                   |
|                                                     |
|                   + Contact Info +                  |
|                       Ben Moody                     |
|              ben.w.moody@exxonMobil.com             |
|         http://emgs.na.xom.com/gref/creative        |
|                    .oooO                            |
|                    (   )   Oooo.                    |
+---------------------\ (----(   )--------------------+
                       \_)    ) /
                             (_/
*/
