/*******/

var IE4 = document.all;
var NS6 = document.getElementById && !document.all;
var disappearDelay = 500; // miliseconds


window.load = function() {
    var inputButton = document.getElementById('SearchBox').firstChild;

    alert(inputButton.Value);
    // Initialize event
    // Notes: Recent addition to support submitting of 
    // search string by pressing the enter key.
    //ListenToKeyPress(

}



function DynamicHide(node, e) {
    if ((IE4 && !node.contains(e.toElement)) ||
        (NS6 && e.currentTarget != e.relatedTarget && !NS6_Contains(e.currentTarget, e.relatedTarget))) {
        InitTimer(node);
    }
}

function HideObject(nodeID) {
    var node = document.getElementById(nodeID);

    if (typeof node != "undefined") {
        if (IE4 || NS6) {
            node.style.visibility = "hidden";
            node.style.display = 'none';
        }
    }
}

function ReleaseTimer(node) {
    if (typeof node != "undefined") {
        if (typeof node.HideTimer != "undefined") {
            clearTimeout(node.HideTimer);
        }
    }
}

function InitTimer(node) {
    if (typeof node != "undefined") {
        var callBack = 'HideObject( "' + node.getAttribute('id') + '" )';
        node.HideTimer = setTimeout(callBack, disappearDelay);
    }
}

function NS6_Contains(a, b) {
    while (b.parentNode) {
        if ((b = b.parentNode) == a)
            return true;
    }

    return false;
}

/*******/

function ToggleSendToFriend() {
    sendToFriendForm = document.getElementById('SendToFriendForm');
    sendToFriendButton = document.getElementById('SendToFriendButton');

    if (sendToFriendForm.style.visibility == "hidden") {
        sendToFriendForm.style.visibility = "visible";
        sendToFriendForm.style.display = 'block';
    } else {
        sendToFriendForm.style.visibility = "hidden";
        sendToFriendForm.style.display = 'none';
    }

    //sendToFriendForm.style.left = getposOffset(sendToFriendButton, "left") - sendToFriendForm.offsetWidth + sendToFriendButton.offsetWidth;
    sendToFriendForm.style.left = getposOffset(sendToFriendButton, "left") - (sendToFriendForm.offsetWidth / 2) + (sendToFriendButton.offsetWidth / 2);
    sendToFriendForm.style.top = getposOffset(sendToFriendButton, "top") + sendToFriendButton.offsetHeight;
}

function ToggleAddComment() {
    commentMenu = document.getElementById('CommentMenu');
    commentButton = document.getElementById('CommentButton');

    commentMenu.style.left = getposOffset(commentButton, "left");
    commentMenu.style.top = getposOffset(commentButton, "top") + commentButton.offsetHeight;

    if (commentMenu.style.visibility == "hidden") {
        commentMenu.style.visibility = "visible";
        commentMenu.style.display = 'block';
    } else {
        commentMenu.style.visibility = "hidden";
        commentMenu.style.display = 'none';
    }
}

function ToggleGalleryThumbnail(pictureID) {
    largeThumbDiv = document.getElementById('SecondaryThumbDiv' + pictureID);
    smallThumb = document.getElementById('SmallThumb' + pictureID);

    if (largeThumbDiv.className == "secondaryThumbnailHidden") {
        largeThumbDiv.className = "secondaryThumbnailPopup";
        largeThumbDiv.style.left = getposOffset(smallThumb, "left") - ((largeThumbDiv.offsetWidth - smallThumb.offsetWidth) / 2) + "px";
        largeThumbDiv.style.top = getposOffset(smallThumb, "top") - ((largeThumbDiv.offsetHeight - smallThumb.offsetHeight) / 2) + "px";
        setTimeout(function() { largeThumbDiv.style.visibility = "visible"; }, 5);
    } else {
        largeThumbDiv.className = "secondaryThumbnailHidden";
    }
}

function ToggleRateMenu() {
    rateMenu = document.getElementById('RateMenu');
    rateButton = document.getElementById('RateButton');

    rateMenu.style.left = getposOffset(rateButton, "left");
    rateMenu.style.top = getposOffset(rateButton, "top") + rateButton.offsetHeight;

    if (rateMenu.style.visibility == "hidden") {
        rateMenu.style.visibility = "visible";
        rateMenu.style.display = 'block';
    } else {
        rateMenu.style.visibility = "hidden";
        rateMenu.style.display = 'none';
    }

    // Init autohide
    if (window.event) {
        event.cancelBubble = true;
    }

    ReleaseTimer(rateMenu);
}

function ToggleRatePostMenu(control) {
    rateButton = control.parentNode;
    rateMenu = rateButton.nextSibling.nextSibling;

    if ((rateButton.id != "RateButton") || (rateMenu.id != "RateMenu"))
        return;

    rateMenu.style.left = getposOffset(rateButton, "left");
    rateMenu.style.top = getposOffset(rateButton, "top") + rateButton.offsetHeight;

    if (rateMenu.style.visibility == "hidden") {
        rateMenu.style.visibility = "visible";
        rateMenu.style.display = 'block';
    } else {
        rateMenu.style.visibility = "hidden";
        rateMenu.style.display = 'none';
    }

    // Init autohide
    if (window.event) {
        event.cancelBubble = true;
    }

    ReleaseTimer(rateMenu);
}

function ToggleSearchMenu() {
    searchMenu = document.getElementById('SearchMenu');
    searchButton = document.getElementById('SearchButton');

    searchMenu.style.left = getposOffset(searchButton, "left");
    searchMenu.style.top = getposOffset(searchButton, "top") + searchButton.offsetHeight;

    if (searchMenu.style.visibility == "hidden") {
        searchMenu.style.visibility = "visible";
        searchMenu.style.display = 'block';
    } else {
        searchMenu.style.visibility = "hidden";
        searchMenu.style.display = 'none';
    }
}

function getposOffset(what, offsettype) {
    var totaloffset = (offsettype == "left") ? what.offsetLeft : what.offsetTop;
    var parentEl = what.offsetParent;
    while (parentEl != null) {
        totaloffset = (offsettype == "left") ? totaloffset + parentEl.offsetLeft : totaloffset + parentEl.offsetTop;
        parentEl = parentEl.offsetParent;
    }
    return totaloffset;
}

function ToggleMenuOnOff(menuName) {
    var menu = document.getElementById(menuName);

    if (menu.style.display == 'none') {
        menu.style.display = 'block';
    } else {
        menu.style.display = 'none';
    }

}

function OpenWindow(target) {
    window.open(target, "_Child", "toolbar=no,scrollbars=yes,resizable=yes,width=400,height=400");
}

function OpenPostWindow(target) {
    window.open(target, "_Child", "resizable=yes,width=500,height=700");
}

/*
Keep the user's cookie alive
*/

function MakeKeepAliveRequest() {
	return;
}

function DetermineKeepAliveUrl() {
    var scripts = document.getElementsByTagName("SCRIPT");
    var i;
    var url;

    for (i = 0; i < scripts.length; i++) {
        url = scripts[i].src.toLowerCase();
        if (url.indexOf('utility/global.js') != -1)
            return url.replace('utility/global.js', 'utility/keepalive.aspx');
    }

    return null;
}

function ShowEditBlock(block) {
    block.className = "CommonContentPartBorderOn";
}
function HideEditBlock(block) {
    block.className = "CommonContentPartBorderOff";
}

function getCookie(sName) {
    var cookie = "" + document.cookie;
    var start = cookie.indexOf(sName);
    if (cookie == "" || start == -1)
        return "";
    var end = cookie.indexOf(';', start);
    if (end == -1)
        end = cookie.length;
    return unescape(cookie.substring(start + sName.length + 1, end));
}
function setCookie(sName, value) {
    document.cookie = sName + "=" + escape(value) + ";path=/;";
}
function setCookieForever(sName, value) {
    var expiration_date = new Date("January 1, 3000");
    expiration_date = expiration_date.toGMTString();
    document.cookie = sName + "=" + escape(value) + ";path=/;expires=" + expiration_date;
}

function inLineEditOn(control) {
    control.className = "CommonInlineEditOn";
}

function inLineEditOff(control) {
    control.className = "CommonInlineEditOff";
}

//Ajax Start

function Ajax_GetXMLHttpRequest() {
    if (window.XMLHttpRequest) {
        return new XMLHttpRequest();
    } else {
        if (window.Ajax_XMLHttpRequestProgID) {
            return new ActiveXObject(window.Ajax_XMLHttpRequestProgID);
        } else {
            var progIDs = ["Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"];
            for (var i = 0; i < progIDs.length; ++i) {
                var progID = progIDs[i];
                try {
                    var x = new ActiveXObject(progID);
                    window.Ajax_XMLHttpRequestProgID = progID;
                    return x;
                } catch (e) {
                }
            }
        }
    }
    return null;
}
function Ajax_CallBack(type, id, method, args, clientCallBack, debugRequestText, debugResponseText, debugErrors, includeControlValuesWithCallBack, url) {

    if (!url) {
        url = window.location.href;
        url = url.replace(/\#.*$/, '');
        if (url.indexOf('?') > -1)
            url += "&Ajax_CallBack=true";
        else {
            if (url.substr(url.length - 1, 1) == "/")
                url += "default.aspx";

            url += "?Ajax_CallBack=true";
        }
    }

    var x = Ajax_GetXMLHttpRequest();
    var result = null;
    if (!x) {
        result = { "value": null, "error": "NOXMLHTTP" };
        if (debugErrors) {
            alert("error: " + result.error);
        }
        if (clientCallBack) {
            clientCallBack(result);
        }
        return result;
    }

    x.open("POST", url, clientCallBack ? true : false);
    x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
    if (clientCallBack) {
        x.onreadystatechange = function() {
            var result = null;

            if (x.readyState != 4) {
                return;
            }

            if (debugResponseText) {
                alert(x.responseText);
            }

            try {
                var result = eval("(" + x.responseText + ")");
                if (debugErrors && result.error) {
                    alert("error: " + result.error);
                }
            }
            catch (err) {
                if (window.confirm('The following error occured while processing an AJAX request: ' + err.message + '\n\nWould you like to see the response?')) {
                    var w = window.open();
                    w.document.open('text/plain');
                    w.document.write(x.responseText);
                    w.document.close();
                }

                result = new Object();
                result.error = 'An AJAX error occured.  The response is invalid.';
            }

            clientCallBack(result);
        }
    }
    var encodedData = "Ajax_CallBackType=" + type;
    if (id) {
        encodedData += "&Ajax_CallBackID=" + id.split("$").join(":");
    }
    encodedData += "&Ajax_CallBackMethod=" + method;
    if (args) {
        for (var i in args) {
            encodedData += "&Ajax_CallBackArgument" + i + "=" + encodeURIComponent(args[i]);
        }
    }
    if (includeControlValuesWithCallBack && document.forms.length > 0) {
        var form = document.getElementById('aspnetForm');
        for (var i = 0; i < form.length; ++i) {
            var element = form.elements[i];
            if (element.name) {
                var elementValue = null;
                if (element.nodeName == "INPUT") {
                    var inputType = element.getAttribute("TYPE").toUpperCase();
                    if (inputType == "TEXT" || inputType == "PASSWORD" || inputType == "HIDDEN") {
                        elementValue = element.value;
                    } else if (inputType == "CHECKBOX" || inputType == "RADIO") {
                        if (element.checked) {
                            elementValue = element.value;
                        }
                    }
                } else if (element.nodeName == "SELECT") {
                    elementValue = element.value;
                } else if (element.nodeName == "TEXTAREA") {
                    elementValue = element.value;
                }
                if (elementValue) {
                    encodedData += "&" + element.name + "=" + encodeURIComponent(elementValue);
                }
            }
        }
    }
    if (debugRequestText) {
        alert(encodedData);
    }
    x.send(encodedData);
    if (!clientCallBack) {
        if (debugResponseText) {
            alert(x.responseText);
        }
        result = eval("(" + x.responseText + ")");
        if (debugErrors && result.error) {
            alert("error: " + result.error);
        }
    }
    delete x;
    return result;
}

//Ajax End

//Element Items Borrowed From Prototype

function $() {
    var elements = new Array();

    for (var i = 0; i < arguments.length; i++) {
        var element = arguments[i];
        if (typeof element == 'string')
            element = document.getElementById(element);

        if (arguments.length == 1)
            return element;

        elements.push(element);
    }

    return elements;
}


var Element = {

    toggle: function() {
        for (var i = 0; i < arguments.length; i++) {
            var element = $(arguments[i]);
            element.style.display =
        (element.style.display == 'none' ? '' : 'none');
        }
    },

    hide: function() {
        for (var i = 0; i < arguments.length; i++) {
            var element = $(arguments[i]);
            element.style.display = 'none';
        }
    },

    show: function() {
        for (var i = 0; i < arguments.length; i++) {
            var element = $(arguments[i]);
            element.style.display = '';
        }
    },

    remove: function(element) {
        element = $(element);
        element.parentNode.removeChild(element);
    },

    getHeight: function(element) {
        element = $(element);
        return element.offsetHeight;
    }
}


//End Element Items
function DellToggleClassName(anchor, seek, replacement) {
    var container, ulElement;
    
    // #Part of larger voodoo# find parentId
    ulElement = anchor.parentNode.parentNode.childNodes[0];
    
    if (seek == "CommonTag") {
        ulElement.className = "CommonSidebarListTag";
        anchor.className = "active";
    }
    else if (seek == "ListTag") {
        ulElement.className = "CommonSidebarTagCloud";
        anchor.className = "active";
    }

    for (var i = 0; i < ulElement.childNodes.length; i++) {

        if (ulElement.childNodes[i].className != null)
            if (ulElement.childNodes[i].className.indexOf(seek) > -1)
            ulElement.childNodes[i].className = ulElement.childNodes[i].className.replace(seek, replacement);
    }
}
// Topics
function DellToggleTopicsTagCloud(currentView) {
    var currentClassName;
    var newClassName;

    if (currentView == "cloud") {
        $("div.tagcloudContent ul").addClass("CommonSidebarTagCloud").removeClass("CommonSidebarListTag");
        $("#tagCloudLink").addClass("active").removeClass("inactive");
        $("#tagListLink").addClass("inactive").removeClass("active");

        $("div.tagcloudContent ul li").each(function(n) {
            currentClassName = $(this).attr("class");
            newClassName = currentClassName.replace("ListTag", "CommonTag");

            $(this).removeClass(currentClassName).addClass(newClassName);
        });
    }
    else {
        $("div.tagcloudContent ul").addClass("CommonSidebarListTag").removeClass("CommonSidebarTagCloud");
        $("#tagCloudLink").addClass("inactive").removeClass("active");
        $("#tagListLink").addClass("active").removeClass("inactive");

        $("div.tagcloudContent ul li").each(function(n) {
            currentClassName = $(this).attr("class");
            newClassName = currentClassName.replace("CommonTag", "ListTag");

            $(this).removeClass(currentClassName).addClass(newClassName);
        });
    }
    
}
// Group Tag Cloud Switch
function DellToggleGroupsTagCloud(currentView) {
    var currentClassName;
    var newClassName;
    
    if (currentView == "cloud" ) {
        $("#TagsContent ul").addClass("CommonSidebarTagCloud").removeClass("CommonSidebarListTag");
        $("#tagCloudLink").addClass("active").removeClass("inactive");
        $("#tagListLink").addClass("inactive").removeClass("active");
        
        $("#TagsContent ul li").each(function(n) {
            currentClassName = $(this).attr("class");
            newClassName = currentClassName.replace("ListTag", "CommonTag");
            
            $(this).removeClass(currentClassName).addClass(newClassName);
        });
    }
    else {
        $("#TagsContent ul").addClass("CommonSidebarListTag").removeClass("CommonSidebarTagCloud");
        $("#tagListLink").addClass("active").removeClass("inactive");
        $("#tagCloudLink").addClass("inactive").removeClass("active");
        
        $("#TagsContent ul li").each(function(n) {
            currentClassName = $(this).attr("class");
            newClassName = currentClassName.replace("CommonTag", "ListTag");

            $(this).removeClass(currentClassName).addClass(newClassName);
        });
    }
}

function DellClearTextBox(textBox) {
    if (textBox.value == document.getElementById(textBox.id + "Watermark").value)
        textBox.value = "";
    else if (textBox.value == "")
        textBox.value = document.getElementById(textBox.id + "Watermark").value;
}
function DellClearInput(inputBox, hiddenDefaultTextInputID) {
    var defTextBox = document.getElementById(hiddenDefaultTextInputID);
    var elements = document.getElementsByTagName("input");
    var realPasswordField = "";

    for (var i = 10; i < elements.length; i++) {
        if (elements[i].className == "LoginFormPassword" ||
        elements[i].className == "roundedTextBox passwordTextBox noDisplay") {
            realPasswordField = elements[i];
        }
    }

    var passwordMark = document.getElementById("passwordWatermark");

    if (defTextBox != null && hiddenDefaultTextInputID.indexOf("passwordWatermark") < 0) {
        var defText = defTextBox.value;

        if (inputBox.value == defText) {
            inputBox.value = '';
            inputBox.style.color = "black";
        }
        else if (inputBox.value == '') {
            inputBox.value = defText;
            inputBox.style.color = "gray";
        }
    }
    else {
        if (inputBox.value == "Password" && inputBox.type != "password") {
            realPasswordField.style.display = "inline";
            inputBox.style.display = "none";

            inputBox.value = "";
            realPasswordField.focus();
            realPasswordField.style.color = "black";
        }
        else if (inputBox.value == "") {
            passwordMark.style.display = "inline";
            realPasswordField.style.display = "none";

            realPasswordField.value = "";
            passwordMark.value = "Password";
            passwordMark.style.color = "gray";
        }
    }

}
 function DellCommunityToggleMenuItem(menu) {
    var content, header;
    
    content = document.getElementById(menu + "Content");
    header = document.getElementById(menu + "Header");    
    if (content.className.indexOf("close") > -1) {        
        content.className = content.className.replace("close", "");
        header.className = header.className.replace("close1", "open");
    }
    else {        
        content.className = content.className + " close";
        header.className = header.className.replace("open", "close1");
    }
    
}

function ToggleMenuItem(menu) {
    ToggleClass(document.getElementById(menu));

}


function ToggleClass(element) {

    var contents;
    contents = document.getElementById(element.id + "Contents");
    if (element.className.indexOf("Close") > -1) {
        element.className = element.className.replace("Close", "Open");
        if (contents != null) {
            contents.className = contents.className.substring(0, contents.className.length - 6);

        }
    }
    else {
        element.className = element.className.replace("Open", "Close");
        if (contents != null) {
            contents.className += " Close";
        }
    }
}

/* Adding media player enhancements to replace inner content with a player for a cleaner look */


function RenderVideo(videoContainerId, videoUrl) {
    var player = new MPCreator();
    var currentObject = document.getElementById(videoContainerId);
    if (currentObject != null)
        player.Init(document.getElementById(videoContainerId), videoUrl);
}

/* Media Player builder */
var MPCreator = function() {
    this.url = null;
    this.container = null;
    this.options = null;
    this.WMV = "WMV";
    this.SWF = "SWF";
    this.QT = "QT";
    this.RM = "RM";
    this.Init = function(container, url) {
        this.options = this.Merge(
		{
		    width: 300,
		    height: 225,
		    mediaType: "WMV",
		    autoplay: true,
		    autoloop: false
		}, arguments[2] || {});

        this.url = url;
        this.container = container;

        if (this.EndsWidth(url, ".qt") || this.EndsWidth(url, ".mov"))
            this.options.mediaType = this.QT;
        else if (this.EndsWidth(url, ".rm"))
            this.options.mediaType = this.QT;
        else if (this.EndsWidth(url, ".swf"))
            this.options.mediaType = this.SWF;
        else if (this.EndsWidth(url, ".wmv"))
            this.options.mediaType = this.WMV;
        else
            this.options.mediaType = this.WMV;

        var html = null;

        switch (this.options.mediaType) {
            case this.WMV:
                html = this.GetWindowsMediaPlayer();
                break;
            case this.SWF:
                html = this.GetFlashPlayer();
                break;
            case this.QT:
                html = this.GetQuickTimePlayer();
                break;
            case this.RM:
                html = this.GetRealMediaPlayer();
                break;
        }

        html = this.Replace(html, "{width}", this.options.width.toString());
        html = this.Replace(html, "{height}", this.options.height.toString());
        html = this.Replace(html, "{url}", this.url);
        html = this.Replace(html, "{autoplay}", this.options.autoplay ? "true" : "false");
        html = this.Replace(html, "{autoloop}", this.options.autoloop ? "true" : "false");

        this.Clear(container);

        container.innerHTML = html;
    }

    this.Clear = function(container) {
        while (container.childNodes.length != 0) { container.removeChild(container.childNodes[0]); }
    }

    this.Stop = function() {
        var c = $("mediaPlayer");
        if (c) {
            if (c.controls) c.controls.stop();
        }
        this.Clear(this.container);
    }

    this.Replace = function(orig, find, replace) {
        while (orig.indexOf(find) != -1)
            orig = orig.replace(find, replace);

        return orig;
    }

    this.EndsWidth = function(text, find) {
        var index = text.toLowerCase().lastIndexOf(find.toLowerCase());
        if (index + find.length == text.length) return true;

        return false;
    }

    this.GetQuickTimePlayer = function() {
        return "";

        var html = "<!-- begin embedded QuickTime file... -->\n";
        html += "<table border='0' cellpadding='0'>\n";
        html += "<tr><td>\n";
        html += "<OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width=\"{width}\" height=\"{height}\" codebase='http://www.apple.com/qtactivex/qtplugin.cab'>\n";
        html += "<param name='src' value=\"{url}\">\n";
        html += "<param name='autoplay' value=\"{autoplay}\">\n";
        html += "<param name='controller' value=\"true\">\n";
        html += "<param name='loop' value=\{autoloop}\">\n";
        html += "<EMBED src=\"{url}\" width=\"{width}\" height=\"{height}\" autoplay=\"{autoplay}\" controller=\"true\" loop=\"{autoloop}\" pluginspage='http://www.apple.com/quicktime/download/'>\n";
        html += "</EMBED>\n</OBJECT>\n</td></tr>\n<!-- ...end embedded QuickTime file -->\n</table>\n";

        return html;
    }

    this.GetRealMediaPlayer = function() {
        //alert( "media player not supported" );		
        return "";

        var html = "<!-- begin embedded RealMedia file... -->\n";
        html += "<table border='0' cellpadding='0' align=\"left\">\n";
        html += "<!-- begin video window... -->\n";
        html += "<tr><td>\n";
        html += "<OBJECT id='rvocx' classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'\n";
        html += "width=\"320\" height=\"240\">\n";
        html += "<param name='src' value=\"{url}\">\n";
        html += "<param name='autostart' value=\"true\">\n";
        html += "<param name='controls' value='imagewindow'>\n";
        html += "<param name='console' value='video'>\n";
        html += "<param name='loop' value=\"true\">\n";
        html += "<EMBED src=\"{url}\" width=\"320\" height=\"240\" \n";
        html += "loop=\"true\" type='audio/x-pn-realaudio-plugin' controls='imagewindow' console='video' autostart=\"true\">\n";
        html += "</EMBED>\n";
        html += "   </OBJECT>\n";
        html += "</td></tr>\n";
        html += "<!-- ...end video window -->\n";
        html += "<!-- begin control panel... -->\n";
        html += "<tr><td>\n";
        html += "<OBJECT id='rvocx' classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'\n";
        html += "width=\"320\" height='30'>\n";
        html += "<param name='src' value=\"{url}\">\n";
        html += "<param name='autostart' value=\"true\">\n";
        html += "<param name='controls' value='ControlPanel'>\n";
        html += "<param name='console' value='video'>\n";
        html += "<EMBED src=\"{url}\" width=\"320\" height='30' \n";
        html += "controls='ControlPanel' type='audio/x-pn-realaudio-plugin' console='video' autostart=\"{autoplay}\">\n";
        html += "</EMBED>\n";
        html += "</OBJECT>\n";
        html += "</td></tr>\n";
        html += "<!-- ...end control panel -->\n";
        html += "<!-- ...end embedded RealMedia file -->\n";
        html += "<!-- begin link to launch external media player... -->\n";
        html += "<tr><td align='center'>\n";
        html += "<a href=\"{url}\" style='font-size: 85%;' target='_blank'>Launch in external player</a>\n";
        html += "<!-- ...end link to launch external media player... -->\n";
        html += "</td></tr>\n";
        html += "</table>\n";

        return html;
    }

    this.GetWindowsMediaPlayer = function() {
        var html = "<!-- begin embedded WindowsMedia file... -->\n";
        html += "<OBJECT class=\"inlineVideoPlayer\" id='mediaPlayer' width=\"{width}\" height=\"{height}\" classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' \n";
        html += "codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'\n";
        html += "standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>\n";
        html += "<param name='fileName' value=\"{url}\">\n";
        html += "<param name='animationatStart' value='true'>\n";
        html += "<param name='transparentatStart' value='true'>\n";
        html += "<param name='autoStart' value=\"{autoplay}\">\n";
        html += "<param name='loop' value=\"{autoloop}\">\n";

        // changed (make optional for other players?)
        html += "<param name='scale' value='tofit'>\n";
        html += "<param name='showstatusbar' value='0'>\n";
        html += "<param name='showdisplay' value='0'>\n";
        html += "<param name='showControls' value='0'>\n";

        html += "<EMBED class=\"inlineVideoPlayer\" type='application/x-mplayer2'\n";
        html += "pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'\n";
        html += "id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' \n";
        html += "bgcolor='darkblue' showtracker='-1' \n";

        // changed 
        html += "showControls='0' scale='tofit' showStatusBar='0' showDisplay='0' \n";

        html += "showdisplay='0' showstatusbar='-1' videoborder3d='-1' width=\"{width}\" height=\"{height}\" \n"; //height=\"285\"
        html += "src=\"{url}\" autostart=\"{autoplay}\" designtimesp='5311' loop=\"{autoloop}\">\n";
        html += "</EMBED>\n";
        html += "</OBJECT>\n";
        html += "<!-- ...end embedded WindowsMedia file -->\n";

        return html;
    }

    this.GetFlashPlayer = function() {
        //alert( "media player not supported" );
        return "";

        var html = "<!-- begin embedded Flash file... -->";
        html += "<table border='0' cellpadding='0' align=\"left\">\n";
        html += "<tr><td>\n";
        html += "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'\n";
        html += "codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'\n";
        html += "width=\"320\" height=\"240\">\n";
        html += "<param name='movie' value=\"{url}\">\n";
        html += "<param name='quality' value=\"high\">\n";
        html += "<param name='bgcolor' value='#FFFFFF'>\n";
        html += "<param name='loop' value=\"true\">\n";
        html += "<EMBED src=\"{url}\" quality='high' bgcolor='#FFFFFF' width=\"320\"\n";
        html += "height=\"240\" loop=\"true\" type='application/x-shockwave-flash'\n";
        html += "pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>\n";
        html += "</EMBED>\n";
        html += "</OBJECT>\n";
        html += "</td></tr>\n";
        html += "<!-- ...end embedded Flash file -->\n";
        html += "</table>\n";

        return html;
    }

    this.Merge = function(destination, source) {
        for (var property in source) {
            destination[property] = source[property];
        }

        return destination;
    }
}

function DellToggleCloudClassName(anchor, seek, replacement) {
    var container, ulElement, anchorParent;

    // #Part of larger voodoo# find parentId
    ulElement = anchor.parentNode.parentNode.childNodes[0];
    anchorParent = anchor.parentNode;
   if (anchorParent != null)
    {
        for (var cn = 0; cn < anchorParent.childNodes.length; cn++)
        {
            if (anchorParent.childNodes[cn].className != null)
            {
                if (anchorParent.childNodes[cn].className.indexOf('active') > -1)
                {
                    anchorParent.childNodes[cn].className = anchorParent.childNodes[cn].className.replace('active','inactive');
                }
            }
        }
    }
    if (seek == "CommonTag") {
        ulElement.className = "CommonSidebarListTag";
        anchor.className = "active";
    }
    else if (seek == "ListTag") {
        ulElement.className = "CommonSidebarTagCloud";
        anchor.className = "active";
    }

    
    for (var i = 0; i < ulElement.childNodes.length; i++) {

        if (ulElement.childNodes[i].className != null)
            if (ulElement.childNodes[i].className.indexOf(seek) > -1)
            ulElement.childNodes[i].className = ulElement.childNodes[i].className.replace(seek, replacement);
    }
}
