/* FILE ARCHIVED ON 23:44:35 Dec 8, 2010 AND RETRIEVED FROM THE AN OPENWAYBACK INSTANCE ON 18:55:52 Jul 16, 2024. JAVASCRIPT APPENDED BY OPENWAYBACK, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ /* Last updated (7:00pm 10/18/2010) aundrae brown */ var fed_ipadurl = document.location.href; if( ((fed_ipadurl.indexOf("www.homedepot.com") > -1) && (fed_ipadurl.length == 25) ) || (fed_ipadurl.indexOf("HomePageView")> -1) || (fed_ipadurl == "https://webarchive.library.unt.edu/web/20101208234435/http://www.homedepot.com/webapp/wcs/stores/servlet/ContentView?pn=HomePageRegional1&langId=-1&storeId=10051&catalogId=10053")){ var fed_Apple = {}; // Apple detection object fed_Apple.UA = navigator.userAgent; fed_Apple.Device = false; fed_Apple.Types = ["iPhone", "iPod", "iPad"]; for (var fed_d = 0; fed_d < fed_Apple.Types.length; fed_d++) { var fed_t = fed_Apple.Types[fed_d]; fed_Apple[fed_t] = !!fed_Apple.UA.match(new RegExp(fed_t, "i")); fed_Apple.Device = fed_Apple.Device || fed_Apple[fed_t]; } /* checks for ipad, iphone and ipod for redirect */ if (fed_Apple.Device === true && (fed_Apple.iPad === true || fed_Apple.iPhone === true || fed_Apple.iPod === true)) { window.location = 'https://webarchive.library.unt.edu/web/20101208234435/http://ext.homedepot.com/www/iPad/'; } if (navigator.userAgent.match(/Android/i)){ window.location = 'https://webarchive.library.unt.edu/web/20101208234435/http://ext.homedepot.com/www/iPad/'; } } /* BrightCove JS Functions - updated 7/7/10 */ //detect iPad/pod/phone var $_brightCove_RightRail = {}; $_brightCove_RightRail.is_iPad = navigator.userAgent.match(/iPad/i) != null || navigator.userAgent.match(/iPod/i) != null || navigator.userAgent.match(/iPhone/i) != null; dojo.require("dojo.io.script"); dojo.require("dojox.widget.Dialog"); dojo.require("dojo.NodeList-html"); dojo.require("dojo.string"); var BCVideo = function(opts){ opts = dojo.mixin({debug:false},opts); Token = 'jUPgZ3EQYo2N9tEc_KYzTuxfDSSyVT8AG0CanYFuedvWL76Co3WLOw..'; PubId = '66036796001'; var debug = null; var SetDebug = function(enabled){ debug = (window.console && enabled) ? window.console : (function(){ var firebugFunctions = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; function noop(){} var debug = {}; for (var i = 0; i < firebugFunctions.length; ++i) debug[firebugFunctions[i]] = noop; return debug; })(); } SetDebug(opts.debug); BCVideo.prototype.SetDebug = SetDebug; var Write = function(videoId, playerId, altContent, options) { options = dojo.mixin( { imageId: "BCVideo" + Math.floor(Math.random() * 1000), thumb: "", lookupThumb: undefined == options || undefined == options.thumb, videoId: videoId, playerId: playerId } ,options); if (flash.hasVersion() || supports_h264_baseline_video()) { writeImageTag(options); } else { document.write(altContent); } //fix for iPad/pod/phone if($_brightCove_RightRail.is_iPad){ var images = document.getElementsByClassName('BCVideo_thumb'); var videoThumb = document.getElementById(images[0].id); var videoURL = ''; //get mp4 videoURL function getVideoURL(){ var url = 'https://webarchive.library.unt.edu/web/20101208234435/http://api.brightcove.com/services/library?command=find_video_by_id&video_id='+videoId+'&video_fields=FLVURL&media_delivery=http&token=jUPgZ3EQYo2N9tEc_KYzTuxfDSSyVT8AG0CanYFuedvWL76Co3WLOw..'; var jsonpArgs = { url:url, callbackParamName: "callback", content: { v: "1.0", q: "dojo toolkit" }, load: function(data) { var url = data.FLVURL; videoURL = url; }, error: function(error) { } }; dojo.io.script.get(jsonpArgs); } getVideoURL(); //alert('fixing video thumb for iPad: '+videoThumb.id); videoThumb.onclick=function(){window.location=videoURL}; } } BCVideo.prototype.Write = Write; var writeImageTag = function(options) { debug.log("Writing Image Tag", options); document.write(options.thumb); var images = document.getElementsByTagName("img"); var image = images[images.length-1]; image.id = options.imageId; image.className = 'BCVideo_thumb'; image.onclick = function(){ BC.PlayVideo(options.videoId ,options.playerId) }; if(options.lookupThumb) { setVideoThumb(options); } } var setVideoThumb = function(options) { dojo.addOnLoad( dojo.hitch(this, function(){ GetVideo(options.videoId, dojo.hitch(this,setVideoThumb_Callback, options)); } ) ); } var setVideoThumb_Callback = function(options, video) { debug.log("Got Video Metadata", video); var img = document.getElementById(options.imageId); img.src = video.thumbnailURL; img.style.visibility = 'visible'; } var GetVideo = function(videoId,cb){ debug.log("Getting Video Information for: "+ videoId); cbName = 'GetVideoCallback'+ Math.floor(Math.random() * 1000); window[cbName] = cb; dojo.io.script.get({ url: 'https://webarchive.library.unt.edu/web/20101208234435/http://api.brightcove.com/services/library', content: { command : 'find_video_by_id', video_id : videoId, token : Token, media_delivery : "http", callback: cbName } }); } var PlayVideo = function(videoId, playerId, selector){ debug.log("Handling Play Video Request for: " + videoId); dojo.addOnLoad( dojo.hitch(this, function(){GetVideo(videoId, dojo.hitch(this,PlayVideo_Callback,playerId,selector) );} ) ); } BCVideo.prototype.PlayVideo = PlayVideo; var PlayVideo_Callback = function(playerId, selector, video){ debug.log("Got Video Metadata", video); var inline = (selector !== undefined); debug.log("Video will be " + (inline?"inline":"windowed")); var experienceName = 'experience' + video.id + '_' + Math.floor(Math.random() * 1000); var useHtml5Video = !flash.hasVersion() && supports_h264_baseline_video(); var html = ( useHtml5Video ) ? generateHtml5Markup(playerId, video, experienceName, inline) : generateFlashMarkup(playerId, video, experienceName, inline); if( inline ) { dojo.query(selector).html(html); } else { var win = GetPlayerWindow(); win.attr('content', html); var coords = dojo.coords(dojo.query('.videoContainer', win.domNode)[0]); debug.log("Setting Window Dimensions", coords); win.attr('dimensions',[coords.w, coords.h ]).show(); if (!dojo.isIE) { //animate var scale = 1.15; dojo.animateProperty({ node: dojo.byId("dojox_widget_Dialog_0"), duration: 200, properties: { width: { start: coords.w*scale, end: coords.w }, height: { start: coords.h*scale, end: coords.h }, marginLeft: { start: 0-((coords.w*1.15-coords.w)/2), end: 0 }, marginTop: { start: 0-((coords.h*1.15-coords.h)/2), end: 0 } } }).play(); } } brightcove.createExperiencesPostLoad(); ScheduleAttachEventsToExperience(experienceName, video, useHtml5Video); } var videoWrapperMarkup = '
' + '
${markup}
'+ '
${video.name}
'+ '
${video.shortDescription}
'; var generateFlashMarkup = function(playerId, video, experienceName, inline){ var height = 640 * video.FLVFullLength.frameHeight / video.FLVFullLength.frameWidth; var markup; if(flash.hasVersion()) { markup = '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + ''; } else { markup = "fallback content"; } return dojo.string.substitute(videoWrapperMarkup,{markup: markup, video: video, rendition: video.FLVFullLength, height: height}); } var generateHtml5Markup = function(playerId, video, experienceName, inline){ var rendition = getBestHtml5Rendition(video); var height = 640 * rendition.frameHeight / rendition.frameWidth; var markup = "