﻿// JScript File

 function PageCode()
{
        //Style Treeview code

        var inputs = document.getElementsByTagName("input");
        
        for(var i = 0; i < inputs.length; i++)
        {
            var obj = inputs[i];
            
            if(obj.id.indexOf("RootNode_") == 0)
            {
                var tableObj = obj.parentNode.parentNode.parentNode.parentNode.parentNode;
            
                if(BrowserDetect.browser == "Explorer")
                {
                tableObj.style.border = "inset";
                tableObj.style.borderBottomWidth = "2px";
                tableObj.style.borderTopWidth = "0px";
                tableObj.style.borderLeftWidth = "0px"
                tableObj.style.borderRightWidth = "0px";
                tableObj.style.borderColor = "#666666";
                
                }
                else
                {
                tableObj.style.border = "solid";
                tableObj.style.borderBottomWidth = "1px";
                tableObj.style.borderTopWidth = "0px";
                tableObj.style.borderLeftWidth = "0px"
                tableObj.style.borderRightWidth = "0px";
                tableObj.style.borderColor = "#666666";
                }
                
                
            }
            if(obj.id.indexOf("ChildNode_") ==0)
            {
                var tableObj = obj.parentNode.parentNode.parentNode.parentNode.parentNode;
            
                if(BrowserDetect.browser == "Explorer")
                {
                tableObj.style.border = "inset";
                tableObj.style.borderBottomWidth = "2px";
                tableObj.style.borderTopWidth = "0px";
                tableObj.style.borderLeftWidth = "0px"
                tableObj.style.borderRightWidth = "0px";
                tableObj.style.borderColor = "#666666";
                
                }
                else
                {
                tableObj.style.border = "solid";
                tableObj.style.borderBottomWidth = "1px";
                tableObj.style.borderTopWidth = "0px";
                tableObj.style.borderLeftWidth = "0px"
                tableObj.style.borderRightWidth = "0px";
                tableObj.style.borderColor = "#666666";
                }
 
            }
            
        }
        
        //end style treeview
        
        //write object/embed code for swf

        var obj = document.getElementById("treeControl_hfHeaderFileName");

        var fileName = obj.value;
        
        var len = fileName.length;

        var ext = fileName.substring(len, len -3);
        
        var obj2 = document.getElementById("spanHeader");

        switch (ext)
        {
            case ("swf"):

                 obj2.innerHTML = "<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"" +
                "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\"" +
                "WIDTH=\"1004\" HEIGHT=\"50\" id=\"myMovieName\">" +
                "<PARAM NAME=movie VALUE=\"images/" + fileName + "\">" +
                "<PARAM NAME=quality VALUE=high>" +
                "<PARAM NAME=bgcolor VALUE=#FFFFFF>" +
                "<EMBED src=\"images/" + fileName + "\" quality=high bgcolor=#FFFFFF WIDTH=\"1004\" HEIGHT=\"50\"" +
                "NAME=\"myMovieName\" ALIGN=\"\" TYPE=\"application/x-shockwave-flash\"" +
                "PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\">" +
                "</EMBED>" +
                "</OBJECT>";

                break;
        }     
}
PageCode();