        function switchVideo(id) {

            document.getElementById("wink_fm").className = "";
            document.getElementById("swarm").className = "";
            document.getElementById("intel_itpp").className = "";
            document.getElementById("rentalic").className = "";
            document.getElementById("myspace").className = "";
            document.getElementById("offerpal").className = "";
            document.getElementById("twisted").className = "";
            document.getElementById("the_process").className = "";
            document.getElementById("managemyscore").className = "";
            document.getElementById("vudu").className = "";
            document.getElementById("99ranch").className = "";
            document.getElementById("nascar_connected").className = "";            
            
            if (id == "video1") {

                var name = "wink_fm";
                var title = "96.9 WINK FM Radio Spot";
                var txtRole = "Promotional video for Florida-based radio station 96.9 WINK FM<br /><br />Role: Creative direction, design, animation, effects";

                document.getElementById("wink_fm").className = "active";             
            }
            else if (id == "video2") {

                var name = "swarm";
                var title = "The Swarm Teaser Trailer";
                var txtRole = "Teaser trailer promoting arcade game The Swarm<br /><br />Role: Creative direction, animation, effects, video post-production, footage capture, sound design";

                document.getElementById("swarm").className = "active";            
            }
            else if (id == "video3") {

                var name = "intel_itpp";
                var title = "Intel Technology Provider Program Overview Video";
                var txtRole = "Marketing video to explain features of Intel's Technology Provider Program<br /><br />Role: Creative direction, design, animation, effects, video post-production";

                document.getElementById("intel_itpp").className = "active";                
            }
            else if (id == "video4") {

                var name = "rentalic";
                var title = "Rentalic.com Overview Video";
                var txtRole = "Rentalic.com's company overview explaining their online community rental service<br /><br />Role: Animation, design, illustration (sub-contracted), effects, sound design";

                document.getElementById("rentalic").className = "active";               
            }
            else if (id == "video5") {

                var name = "myspace";
                var title = "MySpace IAB Video";
                var txtRole = "HD video presentation for MySpace to complement executive speeches at advertising conference<br /><br />Role: Creative direction, design, animation, effects, video post-production";

                document.getElementById("myspace").className = "active";
            }
            else if (id == "video6") {

                var name = "offerpal";
                var title = "Offerpal Media Overview Video";
                var txtRole = "Offerpal's overview video that explains platform features and incentives to game developers<br /><br />Role: Animation, design, illustration (sub-contracted), effects, sound design";

                document.getElementById("offerpal").className = "active";
            }
            else if (id == "video7") {

                var name = "twisted";
                var title = "Twisted Attract Video";
                var txtRole = "Attraction video displayed on Global VR's Twisted arcade game cabinets<br /><br />Role: Creative direction, animation, effects, video post-production, footage capture ";

                document.getElementById("twisted").className = "active";
            }
            else if (id == "video8") {

                var name = "the_process";
                var title = "The Process";
                var txtRole = "Short film about the art of beatmaking<br /><br />Role: Creative direction, cinematography, motion graphics design, sound design, video post-production";

                document.getElementById("the_process").className = "active";
            }
            else if (id == "video9") {

                var name = "managemyscore";
                var title = "Managemyscore.com Video";
                var txtRole = "Managemyscore.com company overview and demo video of their credit score service website<br /><br />Role: Creative direction, animation, design, illustration (sub-contracted), effects";

                document.getElementById("managemyscore").className = "active";
            }
            else if (id == "video10") {

                var name = "vudu";
                var title = "VUDU Best Buy Promo Video";
                var txtRole = "Product video to promote VUDU's HD video set top box at Best Buy<br /><br />Role: Creative direction, design, animation, effects, video post-production";

                document.getElementById("vudu").className = "active";
            } 
            else if (id == "video11") {

                var name = "99ranch";
                var title = "99 Ranch Weekly Specials Video";
                var txtRole = "Television commercial for 99 Ranch Market's Weekly Specials<br /><br />Role: Creative direction, animation, effects, video post-production, sound design";

                document.getElementById("99ranch").className = "active";
            } 
            else if (id == "video12") {

                var name = "nascar_connected";
                var title = "NASCAR Connected Video";
                var txtRole = "Sneak peek trailer for NASCAR's arcade racing game that details network and connectivity features<br /><br />Role: Creative direction, animation, effects, video post-production";

                document.getElementById("nascar_connected").className = "active";
			}			

            var playerHTML = document.createElement("script");
            playerHTML.text = "jwplayer('preview').setup({ flashplayer: 'player/player.swf', file: '../videos/sd/" + name + ".mov', image: '../videos/sd/" + name + ".jpg', skin: 'player/skins/glow/glow.zip', height: 236, width: 420 });";
            
            var videoHTML = "<div id='preview'>The player will show in this paragraph</div><br />";
            videoHTML += "<a href='videos/hd/" + name + ".mov' class='qt-link p2' target='_blank'>View in HD</a>";
            videoHTML += "<br /><br /><h4>" + title + "</h4>";
            videoHTML += "<p>" + txtRole + "</p>";

            var c = document.getElementById("work-detail");
            c.innerHTML = videoHTML;
            c.appendChild(playerHTML);
        }
        
        function init() {
        
            var url = location.href;
            var parts = url.split("#");
            
            if (parts[1] == "wink_fm")
                switchVideo("video1");
            else if (parts[1] == "swarm")
                switchVideo("video2");
            else if (parts[1] == "rentalic")
                switchVideo("video4");
        }
        
        window.onload = init;


