    // JS Code for Showcase Version 2
    
    
    // setupAltShowcase() sets up the showcase alternate image map with text and links from the xml file
    function setupAltShowcase() {
        var xml = new JKL.ParseXML( _showcase_xml_path );
        var data = xml.parse();
        
        // Setup main title
        var elShowTitle = document.getElementById("showcaseTitle");
        if(data.products.title != null) {
            elShowTitle.innerHTML = data.products.title;
        }
        
        // Setup instructions
        var elShowIns = document.getElementById("showCaseInstructions");
        if(data.products.instructionsAlt != null) {
            elShowIns.innerHTML = data.products.instructionsAlt;
        }
        
        // Setup the image map
        var elShowMap = document.getElementById("ShowcaseMap");
        var productNodes = data.products.product; // Get product nodes from xml
        
        for(var i = 0; i < elShowMap.childNodes.length; i++) {
            var elChild = elShowMap.childNodes.item(i);
            if(elChild.nodeType == 1) {
                
                // Loop through all product nodes from xml 
                for(var j = 0; j < productNodes.length; j++) {
                    
                    var sLink = new String();
                    
                    //Get the appropriate data for this product
                    sTitle =  productNodes[j].title;
                    
                    var links = productNodes[j].links.link;
                    
                    // console.log("sTitle " + sTitle);
                     // console.log("links.length = " + links.length);
                    for (var k = 0; k < links.length; k++) {
                    
                    // console.log("checking link  " + k);
                        if(links[k].type == "devicedetails") {
                            sLink = links[k]["#cdata-section"]; 
                            //console.log("sLink " + sLink);
                        }
                    }
                    // Check whether the id of this element matches a string in the link of the product node
                    var sCheckId = elChild.id.substring(5, elChild.id.length);
                       
                    if (sLink != null) {
                        if(sLink.toLowerCase().indexOf(sCheckId.toLowerCase()) != -1) {
                            // if we find the <area> tag's id is inside the sLink string of the product,
                            // then we found the current product, break the loop and add the attributes
                            break;
                        } // End if(sLink...
                    }
                } // // for (var j=0...
                
                // Setup alt tags for the image map
                elChild.setAttribute('alt', sTitle);
                elChild.setAttribute('title', sTitle);
                
                // Setup links for the image map
                elChild.setAttribute('href', sLink);
            } // end if(elChild.nodeType...
        } // end for (i=0...
    } // end function 
    
    
     // This script embeds the media components 
    
   var altElem = document.getElementById("showcaseAlternate"); // Find the alternate image element 
   var spacerElem = document.getElementById("showcaseSpacer"); // Find the spacer container element 
    
   var isInstalled = Silverlight.isInstalled("2.0.31005");	 
   var isFlashEnabled = PluginDetect.isMinVersion('Flash', '9.0') >= 0;
    
   var showFlash = querySt("flash");
   var showStatic = querySt("static");
   
   // if the "flash" qs value is "true", Set isInstalled to false to disable SL embed and test Flash embed
   if(showFlash == "true") {
        isInstalled = false;  
   }
   
   if(showStatic == "true") {
        isInstalled = false; 
        isFlashEnabled = false; 
   }
   
   if(isInstalled) {
    // Silverlight is installed, so display the control
     var elemAg = document.getElementById("SilverlightControlHost");
		
        Silverlight.createObject(
            "/windowsembedded/components/showcasev2/sl/WE_Showcase_V2.xap",  // source
             elemAg,  // parent element
            "slPlugin",  // id for generated object element
            {
                width: "958", height: "250", background: "Transparent", isWindowless: "true", framerate: "15", version:"2.0.31005.0"
            },
            {  },
            "xmlPath=" + _showcase_xml_path, 
            "context"    // context helper for onLoad handler.
        );
	 
    
    // Hide the alternate image
    if(altElem) {
     altElem.style.display = "none";
    }
    
   } else if (isFlashEnabled) {
    // else if Flash is installed
 
    var so = new FlashObject("/windowsembedded/components/showcaseV2/flash/WeShowcaseV2.swf", "mainFlash", "958", "250", "9");
    so.addParam("menu", "false");
    so.addParam("wmode", "transparent");
    so.addVariable("xmlPath", _showcase_xml_path); // Path to xml config file
    so.write("SilverlightControlHost");
   
    // Hide the alternate image
    if(altElem) {
     altElem.style.display = "none";
    }
   } else {
   
        // else, hide the spacer div and configure the alternate image
        if(spacerElem) {
            spacerElem.style.display = "none";
        }
        setupAltShowcase();
   }  

   // Parse querystring
   function querySt(ji) {
	hu = window.location.search.substring(1);
	gy = hu.split("&");
	for (i=0;i<gy.length;i++) {
		ft = gy[i].split("=");
		if (ft[0] == ji) {
			return ft[1];
		}
	}
   }
   
   
   // Fire off tracking code
   function weShowcaseTracking(sTrackingJS) {
		//alert(sTrackingJS);
		eval(sTrackingJS);
   }