﻿/*
THIS WILL COMBINE ALL JS files used on CHAUSA site b/c we are loading too many separate files..

QN: 8/13/2010

*/
 

/*

End Workarea/java/Ektron.js


*/


var dmsMenuDisplayedId = -1;
var dmsMenuType = ''; // 'community', 'taxonomy', ''
var dmsDynamicContentBox = true;
var dmsEktControlID = '';
var dmsMenuAppPath = '';

/* This function is called by menu items that need to perform server-side */
/* logic, which the content page needs to refesh to see.  For example, */
/* "Check-in" executes an ajax request to check-in the content item, then */
/* needs to refresh the page to show the state of the content has changed from "O" to "I" */
function refreshPage()
{
	setTimeout(function()
		{
			self.location.href=self.location;
		}, 1000);
}

/* This fucntion is called by the onclick event of the folder item's paragraph element */
function dmsMenuShowMenu(id, languageId, menuGuid, dmsCommunityDocumentsMenu, menuSubtype)
{
    dmsMenuType = dmsCommunityDocumentsMenu;

	if ((dmsMenuDisplayedId === id && $ektron(dmsWrapper).length > 0) || (dmsMenuDisplayedId !== -1))
	{
		dmsMenuDestroyMenu(id, languageId, menuGuid, true);
		if (dmsMenuDisplayedId !== -1)
		{
			dmsMenuFetch(id, languageId, menuGuid, menuSubtype);
		}
		dmsMenuDisplayedId = -1;
	}
	else
	{
		dmsMenuFetch(id, languageId, menuGuid, menuSubtype);
		dmsMenuDisplayedId = String(id) + String(languageId) + String(menuGuid);
	}
}

/* This function fetches the menu from the CMS via Ajax */
function dmsMenuFetch(id, languageId, menuGuid, menuSubtype)
{
    /* Show the "LOADING" div while the menu is being fetched */
    var dmsWrapperId = "#dmsWrapper" + String(id) + String(languageId) + String(menuGuid);
    var dmsWrapper = $ektron(dmsWrapperId);
    $ektron(dmsWrapperId + " p.dmsItemWrapper").addClass("dmsItemWrapperLoading");

    //OLD STUFF
    /*var dmsLoadingMessage = $ektron("#dmsMenuLoading");
    if (dmsLoadingMessage) { $ektron("#dmsLoadingMessage").css("display","block"); }
    */

	/* Get the menu wrapper */
	var dmsWrapper = $ektron("#dmsWrapper" + String(id) + String(languageId) + String(menuGuid));

	/* If the browser is IE, then we can create a menu specific to IE (opens Office assets directly in Office */
	/* See functions "editMSOfficeFile()" and viewMSOfficeFile() below */
	var ieMenu = "false";
	if ($ektron.browser.msie)
	{
		/* Only set "ieMenu" to true if office is installed */
		/* ShowMultipleUpload() tests to see if Offic is installed and exists in Workarea/java/determineoffice.js */
		if (typeof ShowMultipleUpload != 'undefined' && ShowMultipleUpload())
		{ieMenu = "true";}
	}
	var taxonomyOverrideId = 0;
	if (dmsMenuType != '')
	{
	    if ($ektron("#taxonomyselectedtree").length > 0)
	    {
	        taxonomyOverrideId = $ektron("#taxonomyselectedtree").attr("value");
	    }
	}

	/* Use JQuery to fetch the menu via Ajax */
	// fix for bug #40489
    var dmsMenuClientId = dmsWrapper.find("input[type='hidden'][class='dmsItemClientId']");
    if (dmsMenuClientId.length > 0)
    {
        // this is a control using the DMS menu, and we need that control's ClientId for AJAX responses
        dmsMenuClientId = dmsMenuClientId.val().replace(/\$/g, "_");
    }
    else
    {
        // otherwise, use the default dmsEktControlID value
        dmsMenuClientId = dmsEktControlID;

    }
    $ektron.get(dmsMenuAppPath + "DmsMenu/DmsMenu.aspx", { contentId: id, createIeSpecificMenu: ieMenu,
            communityDocuments:dmsMenuType, dynamicContentBox:dmsDynamicContentBox,
            dmsEktControlID:dmsMenuClientId, dmsLanguageId:languageId,
            taxonomyOverrideId:taxonomyOverrideId, dmsMenuGuid: menuGuid, dmsMenuSubtype: menuSubtype},
        function(data){
            try
            {
                var notLoggedInCheck = data.indexOf("-1|");
                if (notLoggedInCheck != -1)
                {
                    //user's not logged-in, alert user to log in.
                    alert(String(data).replace("-1|",""));
                }
                else
                {
                    //user's logged-in - process data
			        //set the innerHTML of the paragraph element to the AJAX response
			        /* Insert the Ajax response into the dms wrapper */
			        var dmsWrapperId = "#dmsWrapper" + String(id) + String(languageId) + String(menuGuid);
                    $ektron(data).appendTo(dmsWrapperId);

	                var dmsMenuWrapper = $ektron("#dmsMenuWrapper" + String(id) + String(languageId) + String(menuGuid));
	                dmsMenuWrapper.css("visibility", "hidden");
			        dmsMenuWrapper.css("display", "block");

			        var dmsMenuWrapperWidth = document.getElementById("dmsMenuWrapper" + String(id) + String(languageId) + String(menuGuid)).offsetWidth;
			        var dmsItemWrapper = $ektron("#dmsItemWrapper" + String(id) + String(languageId) + String(menuGuid));
			        var dmsItemWrapperWidth = document.getElementById("dmsItemWrapper" + String(id) + String(languageId) + String(menuGuid)).offsetWidth;

                    var borderWidth=0;
                    var dmsItemWrapper = $ektron("#dmsItemWrapper" + String(id) + String(languageId) + String(menuGuid));
                    if ($ektron.browser.msie)
                    {
                        switch(dmsItemWrapper.css("border-width"))
                        {
                            case "0px":
                                borderWidth = 1;
                                break;
                            case "medium":
                                borderWidth = 2;
                                break;
                            default:
                                borderWidth = 0;
                                break
                        }
                    }
                    if ($ektron.browser.mozilla)
                    {
                        if (dmsItemWrapper.css("border-right-width") !== "0px")
                        { borderWidth = 0; }
                        else
                        { borderWidth = 2;}
                    }
                    if ($ektron.browser.safari)
                    {
                        if (dmsItemWrapper.css("border-right-width") !== "0px")
                        { borderWidth = 0; }
                        else
                        { borderWidth = 2;}
                        /* eliminate the 1px top margin to ensure menu renders flush with dmsItemWrapper */
                        dmsMenuWrapper.css("margin-top", "-2px !important");
                    }

			        if (dmsMenuWrapperWidth > dmsItemWrapperWidth)
			        { leftMargin = "20px"; }
			        else
			        { leftMargin = (dmsItemWrapperWidth - dmsMenuWrapperWidth + borderWidth) + "px"; }

                    //remove loading gif
                    $ektron(dmsWrapperId).removeClass("dmsItemWrapperLoading");

                    //set <p> to active
                    $ektron(dmsItemWrapper).attr("class", "dmsItemWrapperActive");
			        $ektron(dmsItemWrapper).attr("title", "Hide Menu");

			        //show the correctly positioned menu
			        $ektron(dmsMenuWrapper).css("margin-left", leftMargin);
			        $ektron(dmsMenuWrapper).css("display", "");
			        $ektron(dmsMenuWrapper).css("visibility", "visible");
			    }
			}
			finally
			{
			    /* Hide loading message */
                $ektron("#dmsLoadingMessage").css("display","none");
            }
        });
}

/* Begin IE6-specific handling */

var dmsMenuAddIE6HoverOnRefreshCounter = 0;
var dmsMenuAddIE6HoverOnRefreshIntervalId = 0;

setTimeout(function() {
	if ($ektron.browser.msie && $ektron.browser.version < 7) {
		$ektron("div.dmsWrapper").ready(function(){
			dmsMenuAddIE6HoverOnRefreshCounter = 1;
			dmsMenuAddIE6HoverOnRefreshIntervalId = setInterval("dmsMenuAddIE6HoverOnRefresh()", 500);
		});
	}
},1000);

function dmsMenuAddIE6HoverOnRefresh()
{
    if (dmsMenuAddIE6HoverOnRefreshCounter < 10)
    {
        $ektron("div.dmsWrapper").hover(
            function() {
                $ektron(this).attr("class", "dmsWrapperIE6Hover");
            },
            function() {
                $ektron(this).attr("class", "dmsWrapper");
            }
        );
        dmsMenuAddIE6HoverOnRefreshCounter++;
    }
    else
    {
        clearInterval(dmsMenuAddIE6HoverOnRefreshIntervalId);
    }
}

function dmsMenuAddIE6Hover(id)
{
    setTimeout(function()
    {
        var dmsWrapper = $ektron("#" + id);
        $ektron(dmsWrapper).hover(
            function() {
                $ektron(dmsWrapper).attr("class", "dmsWrapperIE6Hover");
            },
            function() {
                $ektron(dmsWrapper).attr("class", "dmsWrapper");
            }
        );
    },1000);
}

/* End IE-specific handling */

/* This function destroys the menu object the previously selected menu */
function dmsMenuDestroyMenu(id, languageId, menuGuid, forceMenuClose)
{
    if (dmsMenuDisplayedId != (String(id) + String(languageId) + String(menuGuid)) || forceMenuClose === true)
    {
        /* Use Jquery to remove any Dms Menus */
        var activeDmsMenus = $ektron('.dmsMenuWrapper');
        for (i=0; i < activeDmsMenus.length; i++)
        {
            $ektron(activeDmsMenus[i]).remove();
        }
        /* Use Jquery to reset any active Item Wrappers to inactive */
        var activeDmsItemWrappers = $ektron('.dmsItemWrapperActive');
        for (i=0; i < activeDmsItemWrappers.length; i++)
        {
           activeDmsItemWrappers[i].className = 'dmsItemWrapper';
           activeDmsItemWrappers[i].title = 'View Menu';
        }

        /* Since the menu's been destroyed, set the global var dmsMenuDisplayedId to -1 */
        dmsMenuDisplayedId = -1;
    }
}

/* This funtion opens Office documents in IE only */
function editMSOfficeFile(checkOutUrl, fileName)
{
    if($ektron.browser.msie)
    {
        /* Show the "LOADING" div while the menu is being fetched */
        var dmsLoadingMessage = document.getElementById("dmsMenuLoading");
        if (dmsLoadingMessage) { dmsLoadingMessage.style.display = "block"; }

	    try
	    {
            /* Use Jquery to execute content-state action via ajax */
            $ektron.get(checkOutUrl,
                function(data, status)
                {
                    if (status === "success")
                    {
                        /* attempt to change content state */
                        try
                        {
		                    /* if ajax call was successful, open office with document */
		                    try
                            {
                                var obj = new ActiveXObject('SharePoint.OpenDocuments.2');
                                obj.EditDocument2(window,fileName, '');
                            }
                            catch(e)
                            {
                                try
                                {
                                    obj = new ActiveXObject('SharePoint.OpenDocuments.3');
                                    obj.EditDocument3(window,fileName, '');
                                }
                                catch(e)
                                {
                                    obj = new ActiveXObject('SharePoint.OpenDocuments.1');
                                    obj.EditDocument(window,fileName, '');
                                }
                            }

                            //31312 - edit in office does not work first time after install
                            refreshPage();
                            /* prevent href from firing - ajax attempt was ok */
		                }
		                catch(e)
		                {
		                    /* active X instantiation failed, attempt to peform the same action via href (non-ajax) */
		                    window.location = checkOutUrl + "&executeActiveX=true";
		                }
		                finally
		                {
		                    /* Hide loading message */
                            if (dmsLoadingMessage) { dmsLoadingMessage.style.display = "none"; }
                        }
                    }
                    else
                    {
                        /* ajax request failed, attempt to peform the same action via href (non-ajax) */
		                window.location = checkOutUrl + "&executeActiveX=true";
                    }
            });

            //refreshPage();
            return false;
        }
        catch(e)
        {
            //alert(e.description);
            return true;
        }
    }
}

/* This funtion executes a number of menu actions - mainly for actions that require content state change. */
/* Specifically, this fucntion is called by the following menu items: */
/* Approve, CheckIn, Decline, Delete, Publish, Submit */
function dmsMenuAction(href)
{
     /* Show the "LOADING" div while the menu is being fetched */
    var dmsLoadingMessage = document.getElementById("dmsMenuLoading");
    if (dmsLoadingMessage) { dmsLoadingMessage.style.display = "block"; }

    try
    {
        /* Use Jquery to execute content-state action via ajax */
        $ektron.get(href,
            function(data, status)
            {
                if (status === "success")
                {
                    /* content state change succeeded, refresh page to show change in state */
                    refreshPage();
                }
                else
                {
                    alert("failed!");
                    /* ajax request failed, attempt to peform the same action via href (non-ajax) */
	                window.location = href;
                }
				/* Hide loading message */
                if (dmsLoadingMessage) { dmsLoadingMessage.style.display = "none"; }
        });
        return false;
    }
    catch(e)
    {
        //the ajax request failed, return true so that the browser attempts to perform the action via href.
        return true;
    }
    finally
    {
        /* Hide loading message */
        if (dmsLoadingMessage) { dmsLoadingMessage.style.display = "none"; }
    }
}

/* This function does the same thing as dmsMenuAction, but it opens a success/failure */
/* window to show indicate to the user if the request was succesfully sent or not */
function dmsMenuRequestCheckIn(href)
{
     /* Show the "LOADING" div while the menu is being fetched */
    var dmsLoadingMessage = document.getElementById("dmsMenuLoading");
    if (dmsLoadingMessage) { dmsLoadingMessage.style.display = "block"; }

    try
    {
        /* Use Jquery to execute content-state action via ajax */
        $ektron.get(href,
            function(data, status)
            {
                //show response - success/failure
                alert(data);
				/* Hide loading message */
                if (dmsLoadingMessage) { dmsLoadingMessage.style.display = "none"; }
        });
        return false;
    }
    catch(e)
    {
        //the ajax request failed, return true so that the browser attempts to perform the action via href.
        return true;
    }
    finally
    {
        /* Hide loading message */
        if (dmsLoadingMessage) { dmsLoadingMessage.style.display = "none"; }
    }
}

function dmsForceCheckIn(href, message)
{
    var confirmation=confirm(message);
    if (confirmation)
    {
        dmsMenuAction(href);
    }
}

function viewMSOfficeFile(fileName)
{
    if($ektron.browser.msie)
    {
        var obj = new ActiveXObject('SharePoint.OpenDocuments.2');
        obj.ViewDocument2(window,fileName, '');
		return false;
    }
}

function dmsMenuConfirmDelete(str)
{
    var confirmation = confirm(str);
    if (confirmation === true)
    {
        return true;
    }
    else
    {
        return false;
    }
}

function dmsModifyImage(href, idThumb)
{
     /* show AJAX image busy icon */
    var imgtag = document.getElementById(idThumb);
    if (imgtag == null) {
        alert('error: missing ID for thumbnail image in ekml template');
        return false; // no thumbnail so ignore command
    }
    var oldimg = imgtag.src;
    imgtag.src = dmsMenuAppPath + '/images/application/DMSMenu/dmsMenuAjaxLoading.gif';

    try
    {
        /* Use Jquery to execute content-state action via ajax */
        $ektron.get(href,
            function(data, status)
            {
                if (status === "success")
                {
                    // anything special to do?
                }
                else
                {
                    /* ajax request failed, attempt to peform the same action via href (non-ajax) */
	                window.location = href;
                }
				/* refresh thumbnail */
                imgtag.src = oldimg + "?r=" + Math.random();
                // switch over view image as well
                var bigimgtag = document.getElementById(idThumb.replace(/GalleryThumb/,"PhotoGallery"));
		bigimgtag.href = bigimgtag.href + "?r=" + Math.random();	// replace preloaded image
        });
        return false;
    }
    catch(e)
    {
        imgtag.src = oldimg;
        //the ajax request failed, return true so that the browser attempts to perform the action via href.
        return true;
    }
}

// begin Sync modifications
if (Ektron.DMSMenu === undefined)
{
    Ektron.DMSMenu =
    {
        Sync: function(settings)
        {
            /*  possible settings parameters
                contentLanguage: indicates the content language for this content
                contentId: the id of the cotnent item
                contentAssetId: the content asset id number (if applicable)
                contentAssetVersion: the content asset version number (if applicable)
                folderId: the parent folder id  number
                dmsSyncPath: the full path to the dmsSync.aspx necessary when the modals are not present
            */
            var s = settings;
            // check for the presence of the necessary SyncConfigModal
            if ($ektron("#ShowSyncConfigModal").length > 0)
            {
                // the modal is present, so we can do the sync in this window
                Ektron.Sync.checkMultipleConfigs(s.contentLanguage, s.contentId, s.contentAssetId, s.contentAssetVersion, s.folderId, s.isMultisite);
            }
            else
            {
                // popup a new window to perform the sync
                dmsSyncWindow = window.open(s.dmsSyncPath + '?contentLanguage=' + s.contentLanguage + '&contentId=' + s.contentId + '&contentAssetId=' + s.contentAssetId + '&contentAssetVersion=' + s.contentAssetVersion + '&folderId=' + s.folderId + '&isMultiSite=' + s.isMultisite, 'dmsSync', 'resizable=no,scrollbars=no,toolbar=no,status=no,menubar=no,location=no,height=1,width=1');
                dmsSyncWindow.focus();
            }
            //return false to prevent click through
            return false;
        }
    };
}


/*

End /Workarea/DMSMenu/DMSMenu.js

*/


if (Ektron.PFWidgets === undefined) {
	Ektron.PFWidgets = {};
}

Ektron.PFWidgets.Tabbing = {

            init: function(widgetId)
            { 
            var localparent = $ektron("#"+ widgetId);						
			localparent.find("div.tabContent").hide();	
			localparent.find(".tabContent:eq(0)").show();					
			
			 localparent.find("#tabs ul > li > a").bind("click", function(e)
                { 
                    localparent.find("#tabs ul > li > a").removeClass('selected');
				    $(this).addClass("selected");
                    var parentLi = $ektron(this).parent();
                    var tabsContainer = parentLi.parents("#tabs");
                    var poundChar = $ektron(this).attr("href").indexOf("#") + 1;
                    var targetPanelSelector = $ektron(this).attr("href").substring(poundChar).replace(/[^a-zA-Z0-9 ]/g, ""); 
                    
                    
                    var targetPanel = tabsContainer.find("." + targetPanelSelector); 
                    parentLi.addClass("selected").siblings().removeClass("selected");
                    tabsContainer.find(".tabContent").hide();
                    targetPanel.show();
                    return false;
                }); 
            }
             
            
};





/*

END /widgets/em_Tabs/tabs.js

*/



/*
 * JSMin
 * Javascript Compressor
 * http://www.crockford.com/
 * http://www.smallsharptools.com/
*/
;(function($){$.extend($.fn,{swapClass:function(c1,c2){var c1Elements=this.filter('.'+c1);this.filter('.'+c2).removeClass(c2).addClass(c1);c1Elements.removeClass(c1).addClass(c2);return this;},replaceClass:function(c1,c2){return this.filter('.'+c1).removeClass(c1).addClass(c2).end();},hoverClass:function(className){className=className||"hover";return this.hover(function(){$(this).addClass(className);},function(){$(this).removeClass(className);});},heightToggle:function(animated,callback){animated?this.animate({height:"toggle"},animated,callback):this.each(function(){$(this)[$(this).is(":hidden")?"show":"hide"]();if(callback)
callback.apply(this,arguments);});},heightHide:function(animated,callback){if(animated){this.animate({height:"hide"},animated,callback);}else{this.hide();if(callback)
this.each(callback);}},prepareBranches:function(settings){if(!settings.prerendered){this.filter(":last-child:not(ul)").addClass(CLASSES.last);this.filter((settings.collapsed?"":"."+CLASSES.closed)+":not(."+CLASSES.open+")").find(">ul").hide();}
return this.filter(":has(>ul)");},applyClasses:function(settings,toggler){this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event){toggler.apply($(this).next());}).add($("a",this)).hoverClass();if(!settings.prerendered){this.filter(":has(>ul:hidden)").addClass(CLASSES.expandable).replaceClass(CLASSES.last,CLASSES.lastExpandable);this.not(":has(>ul:hidden)").addClass(CLASSES.collapsable).replaceClass(CLASSES.last,CLASSES.lastCollapsable);this.prepend("<div class=\""+CLASSES.hitarea+"\"/>").find("div."+CLASSES.hitarea).each(function(){var classes="";$.each($(this).parent().attr("class").split(" "),function(){classes+=this+"-hitarea ";});$(this).addClass(classes);});}
this.find("div."+CLASSES.hitarea).click(toggler);},treeview:function(settings){settings=$.extend({cookieId:"EktronTreeview"},settings);if(settings.add){return this.trigger("add",[settings.add]);}
if(settings.toggle){var callback=settings.toggle;settings.toggle=function(){return callback.apply($(this).parent()[0],arguments);};}
function treeController(tree,control){function handler(filter){return function(){toggler.apply($("div."+CLASSES.hitarea,tree).filter(function(){return filter?$(this).parent("."+filter).length:true;}));return false;};}
$("a:eq(0)",control).click(handler(CLASSES.collapsable));$("a:eq(1)",control).click(handler(CLASSES.expandable));$("a:eq(2)",control).click(handler());}
function toggler(){$(this).parent().find(">.hitarea").swapClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).swapClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().swapClass(CLASSES.collapsable,CLASSES.expandable).swapClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightToggle(settings.animated,settings.toggle);if(settings.unique){$(this).parent().siblings().find(">.hitarea").replaceClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).replaceClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().replaceClass(CLASSES.collapsable,CLASSES.expandable).replaceClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightHide(settings.animated,settings.toggle);}}
function serialize(){function binary(arg){return arg?1:0;}
var data=[];branches.each(function(i,e){data[i]=$(e).is(":has(>ul:visible)")?1:0;});$.cookie(settings.cookieId,data.join(""));}
function deserialize(){var stored=$.cookie(settings.cookieId);if(stored){var data=stored.split("");branches.each(function(i,e){$(e).find(">ul")[parseInt(data[i])?"show":"hide"]();});}}
this.addClass("EktronTreeview");var branches=this.find("li").prepareBranches(settings);switch(settings.persist){case"cookie":var toggleCallback=settings.toggle;settings.toggle=function(){serialize();if(toggleCallback){toggleCallback.apply(this,arguments);}};deserialize();break;case"location":var current=this.find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase();});if(current.length){current.addClass("selected").parents("ul, li").add(current.next()).show();}
break;}
branches.applyClasses(settings,toggler);if(settings.control){treeController(this,settings.control);$(settings.control).show();}
return this.bind("add",function(event,branches){$(branches).prev().removeClass(CLASSES.last).removeClass(CLASSES.lastCollapsable).removeClass(CLASSES.lastExpandable).find(">.hitarea").removeClass(CLASSES.lastCollapsableHitarea).removeClass(CLASSES.lastExpandableHitarea);$(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings,toggler);});}});var CLASSES=$.fn.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",last:"last",hitarea:"hitarea"};$.fn.Treeview=$.fn.treeview;})($ektron);

/*

End /Workarea/java/plugins/treeview/ektron.treeview.js

*/


var m_EkTbTimeout_AjaxToolBar = null;
var m_EkTbAutomaticOutsideBorder_AjaxToolBar = true;
var m_EkTbOutsideBorder_AjaxToolBar = true;
var m_EkTbMenuOffDelay_AjaxToolBar = 500;
var m_EkTbMenuBorderWidth_AjaxToolBar = 3;

var m_EkTbStopAtRoot = 0;
var m_EkTbStopAtCss = 1;
var m_EkTbStopAtOffset = 2;
var m_EkTbLastObj;
var m_bEkTbReady;

if (m_bEkTbReady !== true)
{
    m_bEkTbReady = false;
}

function GetPreviewURL() {

    var url = self.location.href;
    var arString = url.split('?');
    if (arString.length > 1) { url = url + "&cmsMode=Preview"}
    else { url = url + "?cmsMode=Preview"}
    return url;
}
function addEkTbLoadEvent()
{
    var oldonload = window.onload;
    window.onload = function()
        {
            if (typeof oldonload == 'function')
            {
                oldonload();
            }
            setTimeout("m_bEkTbReady = true;", 500);
        }
}

if (typeof $ektron !== 'undefined')
{
    $ektron().ready( function() {
	    m_bEkTbReady = true;
    });
}

addEkTbLoadEvent();

function EkTbWebMenuPopUpWindow (url, hWind, nWidth, nHeight, nScroll, nResize) {
    url = url.replace(/&amp;amp;/g,"&").replace(/&amp;/g,"&");
	if (!m_bEkTbReady) return false;
	if (nWidth > screen.width) {
		nWidth = screen.width;
	}
	if (nHeight > screen.height) {
		nHeight = screen.height;
	}
	var cToolBar = 'toolbar=0,location=0,directories=0,status=' + nResize + ',menubar=0,scrollbars=' + nScroll + ',resizable=' + nResize + ',width=' + nWidth + ',height=' + nHeight;
	var popupwin = window.open(url, hWind, cToolBar);
	return popupwin;
}

function EkTbFade(opacity, speed, change, holdTime, startDelay, fadeType, name) {
	if (!m_bEkTbReady) return false;
	var MyObj = document.getElementById(name);
	if (startDelay == 0) {
		if (!document.all) {
			MyObj.style.MozOpacity = (opacity / 100);
		}
		else {
			MyObj.filters.alpha.opacity = (opacity);
		}
		if (((opacity >= 0) && (change < 0)) || ((opacity < 99) && (change > 0))) {
			opacity += change;
			if (opacity > 99) {
				opacity = 99;
			}
			setTimeout("EkTbFade(" + opacity + "," + speed + "," + change + "," + holdTime + "," + startDelay + ",'" + fadeType + "','" + name + "')", speed);
		}
		else {
			change = (0 - change);
			opacity += change;
			if (fadeType.toLowerCase() == "cycle") {
				setTimeout("EkTbFade(" + opacity + "," + speed + "," + change + "," + holdTime + "," + startDelay + ",'" + fadeType + "','" + name + "')", holdTime);
			}
		}
	}
	else {
		var tmp = startDelay;
		startDelay = 0;
		setTimeout("EkTbFade(" + opacity + "," + speed + "," + change + "," + holdTime + "," + startDelay + ",'" + fadeType + "','" + name + "')", tmp);
	}
}

var m_isMac = false;
var m_isMacInit = false;
function IsPlatformMac() {
	if (m_isMacInit) {
		return (m_isMac);
	} else {
		var posn;
		var sUsrAgent = new String(navigator.userAgent);
		sUsrAgent = sUsrAgent.toLowerCase();
		posn = parseInt(sUsrAgent.indexOf('mac'));
		m_isMac = (0 <= posn);
		m_isMacInit = true;
		return (m_isMac);
	}
}

var m_isSafari = false;
var m_isSafariInit = false;
function IsBrowserSafari() {
	if (m_isSafariInit) {
		return (m_isSafari);
	} else {
		var posn;
		var sUsrAgent = new String(navigator.userAgent);
		sUsrAgent = sUsrAgent.toLowerCase();
		posn = parseInt(sUsrAgent.indexOf('safari'));
		m_isSafari = (0 <= posn);
		m_isSafariInit = true;
		return (m_isSafari);
	}
}

function EkTbRollOver(e, MyObj) {
	if (!m_bEkTbReady) return false;
	var top = 0;
	var tmpTop = 0;
	var left = 0;
	var tmpLeft = 0;
	var width = 0;
	var height = 0;
	var toolbarNumArray = (MyObj.id).split("_");
	var automaticBorder = true;
	var outsideBorder = true;
	var menuBorderWidth = 3;
	var localTimeout = null;
	var ekTbOuterElement = null;
	// ensure previous object is deactivated (fixes Safari ghosting problem):
	if (m_EkTbLastObj && (m_EkTbLastObj != MyObj)) {
		EkTbOffNow(m_EkTbLastObj.id)
	}
	m_EkTbLastObj = MyObj;
	eval("localTimeout = m_EkTbTimeout_" + toolbarNumArray[1] + ";");
	if (localTimeout != null) {
		localTimeout = clearTimeout(localTimeout);
		eval("m_EkTbTimeout_" + toolbarNumArray[1] + " = localTimeout;");
	}

	// Mac-Safari returns invalid offsetHeight values for DIV elements,
	// which are used for the new EkWebToolbar (to bracket the content),
	// workaround - when needed, use the outer table cell instead of the DIV:
	if (IsPlatformMac()){
	    ekTbOuterElement = xBrowserReturnObjById("EkTbOuterElmt_" + toolbarNumArray[1]);
		if (ekTbOuterElement != null) {
			height = ekTbOuterElement.offsetHeight;
		} else {
			height = MyObj.offsetHeight;
		}
	} else {
		height = MyObj.offsetHeight;
	}

	tmpLeft = EkTbFindParentPositionLeft(MyObj, (m_EkTbStopAtRoot), true);
	width = MyObj.offsetWidth;
	tmpTop = EkTbFindParentPositionTop(MyObj, (m_EkTbStopAtRoot), true);
	eval("automaticBorder = m_EkTbAutomaticOutsideBorder_" + toolbarNumArray[1] + ";");
	eval("outsideBorder = m_EkTbOutsideBorder_" + toolbarNumArray[1] + ";");
	eval("menuBorderWidth = m_EkTbMenuBorderWidth_" + toolbarNumArray[1] + ";");
	if (outsideBorder == true) {
		if (((tmpLeft - menuBorderWidth) < 0) && (automaticBorder)) {
			left = 0;
		}
		else {
			left = tmpLeft - menuBorderWidth;
		}
		if (((tmpTop - menuBorderWidth) < 0) && (automaticBorder)) {
			top = 0;
		}
		else {
			top = tmpTop - menuBorderWidth;
		}
		if ( ((((left + width) == document.body.clientWidth) && ((tmpLeft - menuBorderWidth) < 0))
			|| (((left + width + menuBorderWidth) == document.body.clientWidth) && ((tmpLeft - menuBorderWidth) >= 0)))
			&& (automaticBorder)
			) {
			width = (document.body.clientWidth - left);
		}
		else {
			width += (menuBorderWidth * 2);
		}
		if ( ((((top + height) == document.body.clientHeight) && ((tmpTop - menuBorderWidth) < 0))
			|| (((top + height + menuBorderWidth) == document.body.clientHeight) && ((tmpTop - menuBorderWidth) >= 0)))
			&& (automaticBorder)
			) {
			height = (document.body.clientHeight - top);
		}
		else {
			height += (menuBorderWidth * 2);
		}
	}
	else {
		left = tmpLeft;
		top = tmpTop;
	}

	// Mac needs positioning to be adjusted:
	if (IsPlatformMac()){
		if (IsBrowserSafari) {
			left +=4;
			top +=6;
		} else {
			left +=4;
			top +=14;
		}
	}

	if (toolbarNumArray[1]!="AjaxToolBar" && document.getElementById("EkTbLeftBar_" + toolbarNumArray[1]).parentNode != document.body) {
		var BodyObj = document.body;
		var toolObj1 = document.getElementById("EkTbLeftBar_" + toolbarNumArray[1]);
		toolObj1.parentNode.removeChild(toolObj1);
		var tmpObj1 = BodyObj.appendChild(toolObj1);
		var toolObj2 = document.getElementById("EkTbRightBar_" + toolbarNumArray[1]);
		toolObj2.parentNode.removeChild(toolObj2);
		var tmpObj2 = BodyObj.appendChild(toolObj2);
		var toolObj3 = document.getElementById("EkTbTopBar_" + toolbarNumArray[1]);
		toolObj3.parentNode.removeChild(toolObj3);
		var tmpObj3 = BodyObj.appendChild(toolObj3);
		var toolObj4 = document.getElementById("EkTbBottomBar_" + toolbarNumArray[1]);
		toolObj4.parentNode.removeChild(toolObj4);
		var tmpObj4 = BodyObj.appendChild(toolObj4);
		var toolObj5 = document.getElementById("EkTbToolbar_" + toolbarNumArray[1]);
		toolObj5.parentNode.removeChild(toolObj5);
		var tmpObj5 = BodyObj.appendChild(toolObj5);
	}
	document.getElementById("EkTbLeftBar_" + toolbarNumArray[1]).style.top = top + "px";
	document.getElementById("EkTbLeftBar_" + toolbarNumArray[1]).style.left = left + "px";
	document.getElementById("EkTbLeftBar_" + toolbarNumArray[1]).style.width = menuBorderWidth + "px";
	document.getElementById("EkTbLeftBar_" + toolbarNumArray[1]).style.height = height + "px";

	document.getElementById("EkTbRightBar_" + toolbarNumArray[1]).style.top = top + "px";
	document.getElementById("EkTbRightBar_" + toolbarNumArray[1]).style.left = ((left + width) - menuBorderWidth) + "px";
	document.getElementById("EkTbRightBar_" + toolbarNumArray[1]).style.width = menuBorderWidth + "px";
	document.getElementById("EkTbRightBar_" + toolbarNumArray[1]).style.height = height + "px";;

	document.getElementById("EkTbTopBar_" + toolbarNumArray[1]).style.top = top + "px";
	document.getElementById("EkTbTopBar_" + toolbarNumArray[1]).style.left = left + "px";
	document.getElementById("EkTbTopBar_" + toolbarNumArray[1]).style.width = width + "px";;
	document.getElementById("EkTbTopBar_" + toolbarNumArray[1]).style.height = menuBorderWidth + "px";

	document.getElementById("EkTbBottomBar_" + toolbarNumArray[1]).style.top = ((top + height) - menuBorderWidth) + "px";
	document.getElementById("EkTbBottomBar_" + toolbarNumArray[1]).style.left = left + "px";
	document.getElementById("EkTbBottomBar_" + toolbarNumArray[1]).style.width = width + "px";;
	document.getElementById("EkTbBottomBar_" + toolbarNumArray[1]).style.height = menuBorderWidth + "px";

	document.getElementById("EkTbLeftBar_" + toolbarNumArray[1]).style.display = "";
	document.getElementById("EkTbRightBar_" + toolbarNumArray[1]).style.display = "";
	document.getElementById("EkTbTopBar_" + toolbarNumArray[1]).style.display = "";
	document.getElementById("EkTbBottomBar_" + toolbarNumArray[1]).style.display = "";
}

function EkTbRollOut(e, MyObj) {
	if (!m_bEkTbReady) return false;
	var toElement = "";
	var srcElement = "";

	if (document.all) {
		toElement = e.toElement;
		srcElement = e.srcElement;
	}
	else {
		toElement = e.relatedTarget;
		srcElement = e.target;
	}
	if ((srcElement.id != MyObj.id)
		&& (!EkTbIsChild(srcElement, MyObj))) {
		//alert("No: " + srcElement.id);
		return;
	}
	if ((toElement == null) || (!((EkTbIsChild(toElement, MyObj)) || (MyObj.id == toElement.id)))) {
		var tmpArray = MyObj.id.split("_");
		eval("m_EkTbTimeout_" + tmpArray[1] + " = setTimeout(\"EkTbOff('" + MyObj.id + "')\", m_EkTbMenuOffDelay_" + tmpArray[1] + ")");
	}
}

function EkTbOff(MyObjId) {
	if (!m_bEkTbReady) return false;
	try
	{
	    var tmpArray = MyObjId.split("_");
	    if (eval("m_EkTbTimeout_" + tmpArray[1] + " != null")) {
		    eval("m_EkTbTimeout_" + tmpArray[1] + " = null");
		    document.getElementById("EkTbLeftBar_" + tmpArray[1]).style.display = "none";
		    document.getElementById("EkTbRightBar_" + tmpArray[1]).style.display = "none";
		    document.getElementById("EkTbTopBar_" + tmpArray[1]).style.display = "none";
		    document.getElementById("EkTbBottomBar_" + tmpArray[1]).style.display = "none";
		    document.getElementById("EkTbToolbar_" + tmpArray[1]).style.display = "none";
	    }
	}
	catch(e) {}
}

function EkTbOffNow(MyObjId) {
	if (!m_bEkTbReady) return false;
	try
	{
	    var tmpArray = MyObjId.split("_");
	    if (eval("m_EkTbTimeout_" + tmpArray[1] + " != null")) {
		    eval("m_EkTbTimeout_" + tmpArray[1] + " = null");
	    }
	    document.getElementById("EkTbLeftBar_" + tmpArray[1]).style.display = "none";
	    document.getElementById("EkTbRightBar_" + tmpArray[1]).style.display = "none";
	    document.getElementById("EkTbTopBar_" + tmpArray[1]).style.display = "none";
	    document.getElementById("EkTbBottomBar_" + tmpArray[1]).style.display = "none";
	    document.getElementById("EkTbToolbar_" + tmpArray[1]).style.display = "none";
	} catch (e) {}
}

function EkTbCancelOff(MyObj) {
	if (!m_bEkTbReady) return false;
	var tmpArray = MyObj.id.split("_");
	var tmpTimeout = eval("m_EkTbTimeout_" + tmpArray[1]);
	if (tmpTimeout != null) {
		clearTimeout(tmpTimeout);
		eval("m_EkTbTimeout_" + tmpArray[1] + " = null;");
	}
}

function EkTbFindParentPositionLeft(Obj, StopAt, includePositioningContainers) {
	if (!m_bEkTbReady) return false;
	var curLeft = 0;

	if (Obj.offsetParent) {
		while (Obj && (null != Obj.offsetLeft)) {
			if ((StopAt != m_EkTbStopAtRoot)
				&& (EkTbIsStopTag(Obj, StopAt)) )
			{
				break;
			}

			if (includePositioningContainers
				|| (Obj.style
				&& Obj.style.position
				&& Obj.style.position
				&& ('relative' != Obj.style.position.toLowerCase())
				&& ('absolute' != Obj.style.position.toLowerCase())))
			{
				curLeft += Obj.offsetLeft;
			}
			Obj = Obj.offsetParent;
		}
	}
	else if (Obj.x)	{
		curLeft += Obj.x;
	}
	return (curLeft);
}

function EkTbFindParentPositionTop(Obj, StopAt, includePositioningContainers) {
	if (!m_bEkTbReady) return false;
	var curTop = 0;

	if (Obj.offsetParent) {
		while (Obj && (null != Obj.offsetTop)) {
			if ((StopAt != m_EkTbStopAtRoot)
				&& (EkTbIsStopTag(Obj, StopAt)) )
			{
				break;
			}

			if (includePositioningContainers
				|| (Obj.style
				&& Obj.style.position
				&& Obj.style.position
				&& ('relative' != Obj.style.position.toLowerCase())
				&& ('absolute' != Obj.style.position.toLowerCase())))
			{
				curTop += Obj.offsetTop;
			}
			Obj = Obj.offsetParent;
		}
	}
	else if (Obj.x) {
		curleft += Obj.x;
	}
	return (curTop);
}

function EkTbGetScrollTop()
{
	if (EkTbIsInQuirksMode())
	{
		return (document.body.scrollTop);
	}
	else
	{
		return (document.documentElement.scrollTop);
	}
}

function EkTbGetScrollLeft()
{
	if (EkTbIsInQuirksMode())
	{
		return (document.body.scrollLeft);
	}
	else
	{
		return (document.documentElement.scrollLeft);
	}
}

function EkTbIsInQuirksMode()
{
	// document.compatMode "BackCompat" : No DocType
	// document.compatMode "CSS1Compat" : DocType specified
	// Also
	// document.documentElement.clientHeight == 0 : No DocType
	// document.documentElement.clientHeight != 0 : DocType specified
	return (0 == document.documentElement.clientHeight);
}

// Not currently used
function EkTbFindTopDifference(ChildObj, ParentObj) {
	if (!m_bEkTbReady) return false;
	var curTop = 0;

	if (ChildObj != ParentObj) {
		curTop += ChildObj.offsetTop;
		if (ChildObj.offsetParent) {
			while ((ChildObj.offsetParent) && (ChildObj != ParentObj)) {
				curTop += ChildObj.offsetTop;
				ChildObj = ChildObj.offsetParent;
			}
		}
	}
	return (curTop);
}

// Not currently used
function EkTbFindLeftDifference(ChildObj, ParentObj) {
	if (!m_bEkTbReady) return false;
	var curLeft = 0;

	if (ChildObj != ParentObj) {
		curLeft += ChildObj.offsetLeft;
		if (ChildObj.offsetParent) {
			while ((ChildObj.offsetParent) && (ChildObj != ParentObj)) {
				curLeft += ChildObj.offsetLeft;
				ChildObj = ChildObj.offsetParent;
			}
		}
	}
	return (curLeft);
}

function EkTbIsChild(obj, ParentObj) {
	if (!m_bEkTbReady) return false;
	var retVal = false;
	var tmpArray = "";
	if (obj) {
		if ((typeof obj.id == 'string') && (((obj.id).indexOf("EkTbToolbar_") > -1)
			|| ((obj.id).indexOf("EkTbLeftBar_") > -1)
			|| ((obj.id).indexOf("EkTbRightBar_") > -1)
			|| ((obj.id).indexOf("EkTbTopBar_") > -1)
			|| ((obj.id).indexOf("EkTbBottomBar_") > -1))) {
			retVal = true;
		}
		else {
			if (obj.parentNode) {
				while (obj.parentNode) {
					obj = obj.parentNode;
					if ((ParentObj.id).indexOf("EkTb") > -1) {
						tmpArray = (ParentObj.id).split("_");
					}
					else {
						tmpArray = new Array;
						tmpArray[0] = "";
						tmpArray[1] = "";
					}
					if ((obj == ParentObj)
						|| (obj == document.getElementById("EkTbToolbar_"+ tmpArray[1]))
						|| (obj == document.getElementById("EkTbLeftBar_"+ tmpArray[1]))
						|| (obj == document.getElementById("EkTbRightBar_"+ tmpArray[1]))
						|| (obj == document.getElementById("EkTbTopBar_"+ tmpArray[1]))
						|| (obj == document.getElementById("EkTbBottomBar_"+ tmpArray[1])) ) {
						retVal = true;
						break;
					}
				}
			}
		}
	}
	return (retVal);
}

function EkTbIsStopTag(Obj, StopAt) {
	if (!m_bEkTbReady) return false;
	var retVal = false;

	if ( (((Obj.style.position).toLowerCase() == "relative") && (StopAt & m_EkTbStopAtCss))
		 || (((Obj.style.position).toLowerCase() == "absolute") && (StopAt & m_EkTbStopAtOffset)) ) {
		if (!document.all) {
			if ((Obj.tagName).toLowerCase() != "table") {
				retVal = true;
			}
		}
		else {
			retVal = true;
		}
	}
	return (retVal);
}

function EkTbMacShowToolbar(e, MyObj) {
	if (!m_bEkTbReady) return false;
	var retVal = true;

	if (navigator.userAgent.indexOf("Mac") > -1) {
		if (e.shiftKey) {
			retVal = EkTbShowToolbar(e, MyObj);
		}
	}
	return(retVal);
}

function EkTbShowToolbar(e, MyObj) {
	if (!m_bEkTbReady) return false;
	var retVal = true;
	var toElement = "";
	var srcElement = "";
	var locationX = 0;
	var locationY = 0;
	if (document.all) {
		toElement = e.toElement;
		srcElement = e.srcElement;
		if (e.y == event.clientY)
		{
		    // operate normally
		    locationY = (e.y + (EkTbFindParentPositionTop(srcElement, m_EkTbStopAtRoot, false) - EkTbFindParentPositionTop(srcElement, m_EkTbStopAtCss, false) + EkTbGetScrollTop()) );
		    locationX = (e.x + (EkTbFindParentPositionLeft(srcElement, m_EkTbStopAtRoot, false)  - EkTbFindParentPositionLeft(srcElement, m_EkTbStopAtCss, false) + EkTbGetScrollLeft()) );
		}
		else
		{
		    //special case for a div in a div (blogs)
		    //alert('Y= ' + e.y + " - " + event.clientY + " - " + event.screenY + " - " + ((EkTbFindParentPositionTop(srcElement, m_EkTbStopAtRoot) - EkTbFindParentPositionTop(srcElement, m_EkTbStopAtCss) + EkTbGetScrollTop()) ));
		    locationY = (event.clientY + EkTbFindParentPositionTop(srcElement, m_EkTbStopAtRoot) - EkTbFindParentPositionTop(srcElement, m_EkTbStopAtCss) + EkTbGetScrollTop() );
		    if (event.screenX != e.clientX)
		    {
		        locationX = (event.clientX + (e.x + (EkTbFindParentPositionLeft(srcElement, m_EkTbStopAtRoot, false)  - EkTbFindParentPositionLeft(srcElement, m_EkTbStopAtCss, false) + EkTbGetScrollLeft()) )) - e.x;
		    }
		    else
		    {
		        locationX = (event.screenX); // e.x + (EkTbFindParentPositionLeft(srcElement, m_EkTbStopAtRoot, false)  - EkTbFindParentPositionLeft(srcElement, m_EkTbStopAtCss, false) + EkTbGetScrollLeft()) );
		    }
		}
	}
	else {
		toElement = e.relatedTarget;
		srcElement = e.target;
		locationY = e.pageY;
		locationX = e.pageX;
	}
	if (!e.ctrlKey) {
		var tmpArray = MyObj.id.split("_");
		var rightEdge = (EkTbFindParentPositionLeft(document.getElementById("EkTbBase_" + tmpArray[1]), (m_EkTbStopAtRoot), true) + document.getElementById("EkTbBase_" + tmpArray[1]).offsetWidth);
		if (locationX > rightEdge) {
			locationX = rightEdge;
		}
		document.getElementById("EkTbToolbar_" + tmpArray[1]).style.top = ((locationY)) + "px";
		document.getElementById("EkTbToolbar_" + tmpArray[1]).style.left = ((locationX)) + "px";
		document.getElementById("EkTbToolbar_" + tmpArray[1]).style.display = "";
		retVal = false;
	}
	return (retVal);
}

function EkTbStopBubble(e, MyObj) {
	e.cancelBubble = true;
}


function xBrowserReturnObjById(id)
{
    if (document.getElementById)
    {
        var returnVar = document.getElementById(id);
    }
    else if (document.all)
    {
        var returnVar = document.all[id];
    }
    else if (document.layers)
    {
        var returnVar = document.layers[id];
    }
    return returnVar;
}

/*********************************************************/
/************** Begin Ektron Editor's Menu ***************/
/*********************************************************/
if (typeof $ektron !== 'undefined')
{
    Ektron.EditorsMenu = {
        bindEvents: function(){

            //show menu when mouseover marker
            $ektron().listen("mouseover", "a.EktronEditorsMenuMarker", function(e) {
                Ektron.EditorsMenu.show(this, e, true);
            });
            $ektron().listen("keypress", "a.EktronEditorsMenuMarker", function(e) {
                if (e.keyCode === 13)  //show only if pressed key is 'enter'
                    Ektron.EditorsMenu.show(this, e, false);
            });

            //hide menu on timeout when mouseleave menu
            $ektron().listen("mouseout", "a", function(e) {
                var menu = $ektron(this).parent().parent();
                if (menu.hasClass("EktronEditorsMenu")) {
                    var timeoutId = setTimeout(function() {
                        Ektron.EditorsMenu.hide(menu);
                    }, Ektron.EditorsMenu.timeoutDuration);
                    menu.attr("timeoutId", timeoutId);
                }
            });

            //clear timeout when mouseenter menu item
            $ektron().listen("mouseover", "a", function(e) {
                var menu = $ektron(this).parent().parent();
                if (menu.hasClass("EktronEditorsMenu")) {
                    clearTimeout(menu.attr("timeoutId"));
                    menu.removeAttr("timeoutId");
                }
            });

            //hide menu on timeout when menu item link loses focus
            $ektron().listen("blur", "a", function(e) {
                var menu = $ektron(this).parent().parent();
                if (menu.hasClass("EktronEditorsMenu")) {
                    var timeoutId = setTimeout(function() {
                            Ektron.EditorsMenu.hide(menu);
                        }, Ektron.EditorsMenu.timeoutDuration);
                    menu.attr("timeoutId", timeoutId);
                }
            });

            //clear timeout when menu item link gains focus
            $ektron().listen("focus", "a", function(e) {
                var menu = $ektron(this).parent().parent();
                if (menu.hasClass("EktronEditorsMenu")) {
                    clearTimeout(menu.attr("timeoutId"));
                    menu.removeAttr("timeoutId");
                }
            });
        },

        show: function(marker, e, autoHide) {
            //get menu ul (sibling of img marker
            var menu = $ektron(marker).next();

            //skip if menu is visibile
            if (menu.css("display") === "none" && menu.hasClass("cloned") === false) {



                //don't layer if menu preceeds an iframe, object, or embed
                var layerMenu = true;
                if (menu.parent().find('iframe').length > 0)
                    layerMenu = false;
                if (menu.parent().find('object').length > 0)
                    layerMenu = false;
                if (menu.parent().find('embed').length > 0)
                    layerMenu = false;

                if (layerMenu === false) {
                    //push following content down
                    menu.attr("class", "EktronEditorsMenu EktronEditorsMenuNotLayered");
                    menu.css("display", "block");
                } else {

                    //clone menu & position at marker position
                    menu.addClass("cloned");
                    menu = menu.clone(true);
                    menu.attr("cloneid", menu.attr("id"));
                    menu.removeAttr("id");
                    menu.prependTo("body");

                    var zIndex = 99998;

                    menu.siblings("ul.EktronEditorsMenu").each(function() {
                        menu.siblings("ul.EktronEditorsMenu").length;
                        if (zIndex <= parseInt($ektron(this).css("z-index"))) {
                            zIndex = parseInt($ektron(this).css("z-index")) + 1;
                        }
                    });
                    menu.css("z-index", String(zIndex));

                    Ektron.EditorsMenu.setPosition(menu);
                    menu.slideDown(function(){
                        if (autoHide === false) {
                            //trigger: keyboard - don't autohide & set focus on first menu item link
                            menu.find("li:first a:first").focus();
                        }
                    });
                }

                //set an attribute that contains the timeout id
                menu.attr("timeoutId", timeoutId);

                if (autoHide === true) {
                    //trigger: mouseover - hide menu if no menu item mouseover
                    var timeoutId = setTimeout(function() {
                        Ektron.EditorsMenu.hide(menu);
                    }, Ektron.EditorsMenu.timeoutDuration);
                    menu.attr("timeoutId", timeoutId);
                }
            }
        },

        hide: function(menu) {
            menu.slideUp("fast", function() {
                if (menu.hasClass("cloned") === true) {
                    //menu is cloned and layered on top of content
                    var clonedMenu = $ektron("#" + menu.attr("cloneid"));
                    clonedMenu.removeClass("cloned");
                    clonedMenu.removeAttr("timeoutId");
                    menu.remove();
                } else {
                    //menu is not cloned and layered; simply hide and remove not layered class
                    menu.removeClass("EktronEditorsMenuNotLayered");
                }
            });
        },

        setPosition: function(menu) {

            //get marker
            var marker = $ektron("#" + menu.attr("cloneid")).prev();
            var markerOffset = marker.offset();

            //get marker dimensions
            var markerTop = markerOffset.top;
            var markerRight = markerOffset.left + marker.width();
            var markerBottom = markerOffset.top + marker.height();
            var markerLeft = markerOffset.left;

    	    //set menu position defaults
            var menuTop = markerTop;
            var menuLeft = markerLeft;

    	    //determine menu height
    	    var tempMenu = menu.clone().prependTo("body");
    	    tempMenu.css("left", "-1000px");
    	    tempMenu.css("display", "block");

    	    //get menu height & width
    	    var menuHeight =  tempMenu.height();
	        var menuWidth =  tempMenu.width();

	        //remove temp menu
    	    tempMenu.remove();

	        //get height & widths for body
	        var body = $ektron("body");
	        var bodyHeight =  body.height();
	        var bodyWidth =  body.width();

	        //determine menu location - above or below
	        if ((menuHeight > bodyHeight) || (menuHeight < (bodyHeight - markerBottom))) {
	            //place the menu below the marker

	            //menuHeight > bodyHeight = the height of the menu is greater than the height of the body
	            //menuHeight < (bodyHeight - markerBottom) = the height of the menu is less than the distance between
	            //the bottom of the menu marker, and the bottom of the body.  This means the menu can fit below the marker
	            //without causing scroll bars

	            menuTop = markerBottom;
	        } else {
	            if ((menuHeight > markerTop) && (menuHeight > (bodyHeight - markerBottom))) {
	                //place the menu below the marker

	                //the height of the menu cannot be placed neither above, nor below the marker without causing scroll bars

	                menuTop = markerBottom;
	            } else {
	                //place the menu above the marker

	                //the height of the menu is less than the height of the body AND the height of the menu is less than
	                //the top of the marker - this means the menu can fit above the marker

	                menuTop = markerTop - menuHeight;
	            }
	        }

	        //determine menu location - right or left
	        if ((menuWidth > bodyWidth) || (menuWidth < (bodyWidth - markerRight))) {
	            //place the menu to the right of the marker

	            //menuWidth > bodyWidth = the width of the menu is greater than the width of the body
	            //menuWidth > markerLeft = the width of the menu is greater than the distance between
	            //the right of the menu marker, and the right of the body.  This means the menu can fit to the right of the marker

		        menuLeft = markerRight; //right
	        } else {
	            if ((menuWidth < bodyWidth) && (menuWidth > markerLeft)) {
	                //place the menu to the right of the marker

	                //the width of the menu cannot be placed neither to the right, nor the left of the marker without causing scroll bars

	                menuLeft = markerRight;
	            } else {
	                //place the menu to the left of the marker

	                //the width of the menu is less than the width of the body AND the width of the menu is less than
	                //the distance between the left of the body and the left of the marker - this means the menu can fit
	                //to the left of the marker

		            menuLeft = markerLeft;
		        }
	        }

    	    //set menu location
	        menu.css("top", menuTop);
	        menu.css("left", menuLeft);

	        if ($ektron.browser.msie) {
	            if ($ektron.browser.version < 7) {
	                menu.find("li").css("position", "relative");
	            }
	            menu.find("a").css("word-wrap", "normal");  //ensures menu item text does not wrapdefault.ap
	        }
        },

        timeoutDuration: 1500
    }

    /**
     * jQuery.Listen
     * Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
     * Dual licensed under MIT and GPL.
     * Date: 3/7/2008
     *
     * @projectDescription Light and fast event handling, using event delegation.
     * Homepage: http://flesler.blogspot.com/2007/10/jquerylisten.html
     * Requires jQuery 1.2.3 or higher. Tested on FF 2|IE 6/7|Safari 3|Opera 9, Windows XP.
     *
     * @author Ariel Flesler
     * @version 1.0.3
     *
     * @id jQuery.listen
     * @param {String} name Name of the event to listen (f.e: click, mouseover, etc).
     * @param {DOM Element} listener optional: The DOM element to listen from, the document element by default.
     * @param {String|Boolean} selector A simple selector in one of this formats: "#id", "tagname", ".class", or "tagname.class".
     * @param {Function} handler The event handler to register.
     *
     * Notes:
     *	-The selectors support is low in order to mantain scalability. You can use comma-separated selectors.
     *	  I consider these 4 options, the most useful and I believe they are enough for many cases.
     *	-This plugin can't handle non-bubbling events. It handles focus & blur thanks to the focusin/focusout approach.
     */
    ;(function( $ ){

	    $.fn.indexer = function( name ){//allow public access to the indexers
		    return this[0] && indexer( this[0], name ) || null;
	    };
	    $.indexer = function( name ){
		    return indexer( document, name );
	    };

	    var $event = $.event,
		    $special = $event.special,
		    $listen = $.listen = function( name, listener, selector, handler ){
			    if( typeof listener != 'object' ){ //document is the default listener
				    handler = selector;
				    selector = listener;
				    listener = document;
			    }
			    each( name.split(/\s+/), function( ev ){
				    ev = $listen.fixes[ev] || ev;//try to use a fixed event.
				    var idxer = indexer( listener, ev ) || indexer( listener, ev, new Indexer(ev,listener) );

				    idxer.append( selector, handler );// register the handler.
				    idxer.start();
			    });
		    },
		    indexer = function( elem, name, val ){
			    return $.data( elem, name+'.indexer', val );
		    };

	    $.extend( $listen, {
		    regex: /^((?:\w*?|\*))(?:([#.])([\w-]+))?$/, //matches "#id", "tag", ".class" or "tag.class", also "tag#id" but the tag is ignored.
		    fixes: { //registry of replacement for non-bubbling events, you can add more ( please fix change for IE :) )
			    focus:'focusin',
			    blur:'focusout'
		    },
		    cache:function( on ){
			    this.caching = on;
		    }
	    });

	    //taken and adapted from http://dev.jquery.com/browser/trunk/plugins/validate/lib/jquery.delegate.js?rev=4374
	    $.each( $listen.fixes, function( original, fix ){
		    $special[fix] = {
			    setup:function() {
                    if ( $.browser.msie ) return false;
                    this.addEventListener( original, $special[fix].handler, true );
                },
                teardown:function() {
                    if ( $.browser.msie ) return false;
                    this.removeEventListener( original, $special[fix].handler, true );
                },
                handler: function(e) {
                    arguments[0] = e = $event.fix(e);
                    e.type = fix;
                    return $event.handle.apply(this, arguments);
                }
		    };
	    });

	    $.fn.listen = function( name, selector, handler ){//listen using the prototype
		    return this.each(function(){
			    $listen( name, this, selector, handler );
		    });
	    };

	    function Indexer( name, listener ){
		    $.extend( this, {
			    ids: {},
			    tags: {},
			    listener: listener,
			    event: name
		    });
		    this.id = Indexer.instances.push( this );//for cleaning up later
	    };
	    Indexer.instances = [ ];

	    Indexer.prototype = {
		    constructor: Indexer,
		    handle:function( e ){
			    var sp = e.stopPropagation;//intercept any call to stopPropagation
			    e.stopPropagation = function(){
				    e.stopped = true;
				    sp.apply(this,arguments);
			    };
			    indexer(this,e.type).parse( e );
			    e.stopPropagation = sp;//revert
			    sp = e.data = null;//cleanup
		    },
		    on:false,
		    bubbles:false,
		    start:function(){//start listening (bind)
			    if( !this.on ){ //avoid duplicates
				    $event.add( this.listener, this.event, this.handle );
				    this.on = true;
			    }
		    },
		    stop:function(){//stop listening (unbind)
			    if( this.on ){
				    $event.remove( this.listener, this.event, this.handle );
				    this.on = false;
			    }
		    },
		    cache:function( node, handlers ){
			    return $.data( node, 'listenCache_' + this.id, handlers );
		    },
		    parse:function( e ){
			    var node = e.data || e.target,
				    args = arguments, handlers;

			    if( !$listen.caching || !( handlers = this.cache(node) ) ){//try to retrieve cached handlers
				    handlers = [ ];

				    if( node.id && this.ids[node.id] )//if this node has an id and there are handlers registered to it..
					    push( handlers, this.ids[node.id] );

				    each([ node.nodeName, '*' ], function( tag ){//look for handlers registered by name.class.
					    var klasses = this.tags[tag];
					    if( klasses )
						    each( (node.className + ' *').split(' '), function( klass ){
							    if( klass && klasses[klass] )
								    push( handlers, klasses[klass] );//append the handlers to the list.
						    });
				    }, this);

				    if( $listen.caching )
					    this.cache( node, handlers );
			    }

			    if( handlers[0] ){
				    each( handlers, function( handler ){
					    if( handler.apply(node, args) === false ){
						    e.preventDefault();
						    e.stopPropagation();
					    }
				    });
			    }

			    if( !e.stopped && (node = node.parentNode) && (node.nodeName == 'A' || this.bubbles && node != this.listener) ){//go up ?
				    e.data = node;//I rather not alter e.target, it might be used.
				    this.parse( e );
			    }
			    handlers = args = node = null;//cleanup
		    },
		    append:function( selector, handler ){
			    each( selector.split(/\s*,\s*/), function(selector){//support comma separated selectors
				    var match = $listen.regex.exec( selector );
				    if( !match )
					    throw '$.listen > "' + selector + '" is not a supported selector.';
				    var
					    id = match[2] == '#' && match[3],
					    tag = match[1].toUpperCase() || '*',
					    klass =	match[3] || '*';
				    if( id )//we have an id, register the handler to it.
					    (this.ids[id] || (this.ids[id] = [ ])).push( handler );
				    else if( tag ){//we have an name and/or class
					    tag = this.tags[tag] = this.tags[tag] || { };
					    (tag[klass] || (tag[klass] = [ ])).push( handler );
				    }
			    }, this );
		    }
	    };

	    function each( arr, fn, scope ){
		    for(var i=0, l=arr.length; i < l; i++ )
			    fn.call( scope, arr[i], i );
	    };
	    function push( arr, elems ){
		    arr.push.apply( arr, elems );
		    return arr;
	    };

	    $(window).unload(function(){// cleanup
		    if( typeof Indexer == 'function' )
			    each( Indexer.instances, function(idxer){
				    idxer.stop();
				    $.removeData( idxer.listener, idxer.event + '.indexer' );
				    idxer.ids = idxer.names = idxer.listener = null;
			    });
	    });

    })($ektron);

    //Initialize Ektron Editors Menu Object
    $ektron().ready(function() {
        Ektron.EditorsMenu.bindEvents();
    });
}
/*********************************************************/
/**************** End Ektron Editor's Menu ***************/
/*********************************************************/


/*

End /WorkArea/java/webtoolbar.js

*/


/*
 * JSMin
 * Javascript Compressor
 * http://www.crockford.com/
 * http://www.smallsharptools.com/
*/

$ektron.fn.autoheight=function(settings)
{var settings=$ektron.extend({bindEvents:true,onexception:null},settings);function autoheightIFrame()
{var m_iframe=this;function m_autoheightIFrame()
{try
{if(this.body)
{var objIFrame=$ektron(m_iframe);var ht=0;if($ektron.browser.mozilla)
{ht=this.documentElement.offsetHeight;}
else
{ht=this.documentElement.scrollHeight;}
if(0==ht)return;var maxht=objIFrame.css("max-height");if("none"==maxht)maxht="";if(maxht&&-1==maxht.indexOf("px"))
{if(objIFrame.height()!=ht)
{objIFrame.height(ht);$ektron(m_iframe.ownerDocument).trigger($ektron.fn.autoheight.triggerName,[objIFrame,ht]);}}
else if(objIFrame.height()!=ht)
{if($ektron.browser.mozilla||$ektron.browser.safari)
{m_iframe.style.overflowY="hidden";}
else
{m_iframe.style.overflowY="visible";}
objIFrame.height(ht);if(maxht)
{if(parseInt("0"+maxht,10)<ht)
{m_iframe.style.overflowY="auto";}}
$ektron(m_iframe.ownerDocument).trigger($ektron.fn.autoheight.triggerName,[objIFrame,ht]);}
if($ektron.browser.msie&&$ektron.browser.version>=7)
{if((objIFrame.width()-$ektron(oDoc.body).width())<8)
{oDoc.documentElement.style.overflowX="hidden";}}}}
catch(ex)
{Ektron.OnException($ektron.fn.autoheight,settings.onexception,ex,arguments);}};try
{if(m_iframe.contentWindow&&m_iframe.contentWindow.document)
{var oDoc=m_iframe.contentWindow.document;if(oDoc.documentElement)
{oDoc.documentElement.style.height="";var maxht=$ektron(m_iframe).css("max-height");if("none"==maxht)maxht="";if(!maxht)
{if($ektron.browser.mozilla||$ektron.browser.safari)
{oDoc.documentElement.style.overflowY="hidden";}
else
{oDoc.documentElement.style.overflowY="visible";if($ektron.browser.msie)
{if($ektron.browser.version<7)
{oDoc.documentElement.style.overflowX="hidden";}}}}}
if(oDoc.body)oDoc.body.style.height="";if(settings.bindEvents)
{$ektron(oDoc).keyup(m_autoheightIFrame).click(m_autoheightIFrame).each(m_autoheightIFrame);}
else
{$ektron(oDoc).each(m_autoheightIFrame);}}}
catch(ex)
{Ektron.OnException($ektron.fn.autoheight,settings.onexception,ex,arguments);}};if(settings.bindEvents)
{this.filter("iframe").load(autoheightIFrame).each(autoheightIFrame);}
else
{this.filter("iframe").each(autoheightIFrame);}
return this;};$ektron.fn.autoheight.triggerName="EktronAutoheight";$ektron.fn.autoheight.onexception=Ektron.OnException.diagException;



/*

End /WorkArea/java/plugins/autoheight/ektron.autoheight.js

*/

/*
 * JSMin
 * Javascript Compressor
 * http://www.crockford.com/
 * http://www.smallsharptools.com/
*/

(function($){$.fn.modal=function(o){var p={overlay:50,overlayClass:'ektronModalOverlay',closeClass:'ektronModalClose',trigger:'.ektronModal',ajax:F,ajaxText:'',target:F,modal:F,toTop:F,onShow:F,onHide:F,onLoad:F};return this.each(function(){if(this._modal)return H[this._modal].c=$.extend({},H[this._modal].c,o);s++;this._modal=s;H[s]={c:$.extend(p,$.modal.params,o),a:F,w:$(this).addClass('modalID'+s),s:s};if(p.trigger)$(this).modalAddTrigger(p.trigger);});};$.fn.modalAddClose=function(e){return hs(this,e,'modalHide');};$.fn.modalAddTrigger=function(e){return hs(this,e,'modalShow');};$.fn.modalShow=function(t){return this.each(function(){$.modal.open(this._modal,t);});};$.fn.modalHide=function(t){return this.each(function(){$.modal.close(this._modal,t)});};$.modal={hash:{},open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3000,o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);if(c.modal){if(!A[0])L('bind');A.push(s);}
else if(c.overlay>0)h.w.modalAddClose(o);else o=F;h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in{Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");}}
if(c.ajax){var r=c.target||h.w,u=c.ajax,r=(typeof r=='string')?$(r,h.w):$(r),u=(u.substr(0,1)=='@')?$(t).attr(u.substring(1)):u;r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.modalAddClose($(cc,h.w));e(h);});}
else if(cc)h.w.modalAddClose($(cc,h.w));if(c.toTop&&h.o)h.w.before('<span id="ektronModalP'+h.w[0]._modal+'"></span>').insertAfter(h.o);(c.onShow)?c.onShow(h):h.w.show();e(h);return F;},close:function(s){var h=H[s];if(!h.a)return F;h.a=F;if(A[0]){A.pop();if(!A[0])L('unbind');}
if(h.c.toTop&&h.o)$('#ektronModalP'+h.w[0]._modal).after(h.w).remove();if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();}return F;},params:{}};var s=0,H=$.modal.hash,A=[],ie6=$.browser.msie&&($.browser.version=="6.0"),F=false,i=$('<iframe src="javascript:false;document.write(\'\');" class="ektronModalIframe"></iframe>').css({opacity:0}),e=function(h){if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.ektronModalIframe',h.w)[0])h.w.prepend(i);f(h);},f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.modalID'+h.s)[0]);if(r)f(h);return!r;},hs=function(w,t,c){return w.each(function(){var s=this._modal;$(t).each(function(){if(!this[c]){this[c]=[];$(this).click(function(){for(var i in{modalShow:1,modalHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};})($ektron);


/* 

End /WorkArea/java/plugins/modal/ektron.modal.js

*/



/*
 * JSMin
 * Javascript Compressor
 * http://www.crockford.com/
 * http://www.smallsharptools.com/
*/

$ektron.fn.contentDesigner=function(uniqueCallbackId,data)
{try
{if(this.length>1)throw new RangeError("Only one element may be selected to edit in context.");var me=this;var newId="EktronAjaxLoading_cloned";this.ajaxStart(function()
{var menuZIndex=0;$ektron(".EktronEditorsMenu").each(function()
{var thisZIndex=parseInt($ektron(this).css("z-index"),10);if(thisZIndex>menuZIndex)
{menuZIndex=thisZIndex;}});$ektron("#"+newId).remove();var oImg=me.children(".EktronAjaxLoading img");var sTop=($ektron(window).height()/2)-(oImg.height()/2)+$ektron(window).scrollTop()+"px";var sLeft=($ektron(window).width()/2)-(oImg.width()/2)+$ektron(window).scrollLeft()+"px";me.children(".EktronAjaxLoading").clone().attr("id",newId).css({position:"absolute",top:sTop,left:sLeft,"z-index":menuZIndex+10}).prependTo("body");$ektron("div.ektronModalOverlay").css("opacity",0);$ektron("#"+newId).modal().modalHide().modalShow();});this.ajaxStop(function()
{$ektron("#"+newId).modal().modalHide();$ektron("#"+newId).remove();});var editorId;var callbackData="object"==typeof data?data:typeof data!="undefined"?{data:data}:null;var bInit=true;this.ajaxCallback({uniqueId:uniqueCallbackId,data:$ektron.extend({command:"edit",width:this.width(),height:this.height()},callbackData),success:function(data)
{var aryMatch=data.match(/id=\"(\w+)_wrapper\"/);if(aryMatch&&aryMatch.length>1)
{editorId=aryMatch[1];}},complete:function()
{if(typeof GetRadEditor!="function")throw new Error("GetRadEditor function not found. Editor ID="+editorId);var editor=GetRadEditor(editorId);if(!editor)throw new Error("Editor not found. ID="+editorId);editor.uniqueCallbackId=uniqueCallbackId;editor.callbackData=callbackData;},onexception:Ektron.ContentDesignerInContext.onexception});}
catch(ex)
{Ektron.OnException(Ektron.ContentDesignerInContext,null,ex,arguments);}
return this;};Ektron.ContentDesignerInContext={OnClientLoad:function(editor)
{var m_old_onerror;try
{Ektron.ContentDesigner.setActionOnUnload("EDITOR_ONUNLOAD_PROMPT");m_old_onerror=window.onerror;window.onerror=function ContentDesignerInContext_onerror(event)
{try
{if(m_old_onerror)
{try
{var result=m_old_onerror.apply(this,arguments);}
catch(ex)
{Ektron.OnException(Ektron.ContentDesignerInContext,null,ex,arguments,m_old_onerror);}}
return true;}
catch(ex)
{Ektron.OnException(Ektron.ContentDesignerInContext,null,ex,arguments);}};editor.activateToolbar();editor.SetFocus();}
catch(ex)
{Ektron.OnException(Ektron.ContentDesignerInContext,null,ex,arguments);}
editor.autoheight();},onexception:Ektron.OnException.diagException};



/*

End /WorkArea/ContentDesigner/ektron.contentDesigner.js

*/

function Browseris () {

            var agt=navigator.userAgent.toLowerCase();

            this.osver=1.0;

            if (agt)

            {

                        var stOSVer=agt.substring(agt.indexOf("windows ")+11);

                        this.osver=parseFloat(stOSVer);

            }

            this.major=parseInt(navigator.appVersion);

            this.nav=((agt.indexOf('mozilla')!=-1)&&((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1)));

            this.nav6=this.nav && (this.major==5);

            this.nav6up=this.nav && (this.major >=5);

            this.nav7up=false;

            if (this.nav6up)

            {

                        var navIdx=agt.indexOf("netscape/");

                        if (navIdx >=0 )

                                    this.nav7up=parseInt(agt.substring(navIdx+9)) >=7;

            }

            this.ie=(agt.indexOf("msie")!=-1);

            this.aol=this.ie && agt.indexOf(" aol ")!=-1;

            if (this.ie)

                        {

                        var stIEVer=agt.substring(agt.indexOf("msie ")+5);

                        this.iever=parseInt(stIEVer);

                        this.verIEFull=parseFloat(stIEVer);

                        }

            else

                        this.iever=0;

            this.ie4up=this.ie && (this.major >=4);

            this.ie5up=this.ie && (this.iever >=5);

            this.ie55up=this.ie && (this.verIEFull >=5.5);

            this.ie6up=this.ie && (this.iever >=6);

            this.winnt=((agt.indexOf("winnt")!=-1)||(agt.indexOf("windows nt")!=-1));

            this.win32=((this.major >=4) && (navigator.platform=="Win32")) ||

                        (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1);

            this.mac=(agt.indexOf("mac")!=-1);

            this.w3c=this.nav6up;

            this.safari=(agt.indexOf("safari")!=-1);

            this.safari125up=false;

            if (this.safari && this.major >=5)

            {

                        var navIdx=agt.indexOf("safari/");

                        if (navIdx >=0)

                                    this.safari125up=parseInt(agt.substring(navIdx+7)) >=125;

            }

}

var browseris=new Browseris();

var bis=browseris;

 
function ShowMultipleUpload ()
{
    if (browseris.ie5up && !browseris.mac)
    {
        try
        {
            var MultipleDocumentTest1 = new ActiveXObject('SharePoint.OpenDocuments.1');
            return true;
        }
        catch(e)
        {}
        try
        {
            var MultipleDocumentTest2 = new ActiveXObject('SharePoint.OpenDocuments.2');
            return true;
        }
        catch(e)
        {}
        try
        {
            var MultipleDocumentTest3 = new ActiveXObject('SharePoint.OpenDocuments.3');
            return true;
        }
        catch(e)
        {}
        try
        {
            var UploadControl = new ActiveXObject('STSUpld.UploadCtl');
            return true;
        }
        catch(e)
        {}
    }
    return false;
}

function CheckSTSUpload()
{
    if (browseris.ie5up && !browseris.mac)
    {
        try
        {
            var UploadControl = new ActiveXObject('STSUpld.UploadCtl');
            return true;
        }
        catch(e)
        {}
    }
    return false;
}


/*

End /WorkArea/java/determineoffice.js

*/


