 
 
 
 
 

 




 
var wptheme_DebugUtils = {
    // summary: Collection of utilities for logging debug messages.
    enabled: false, 
    log: function ( /*String*/className, /*String*/message ) {
            // summary: Logs a debugging message, if debugging is enabled.
            // className: the javascript class name or function name which is logging the message
            // message: the message to log
            if ( this.enabled ) {
                message = className + " ==> " + message;
                if ( typeof( console ) == "undefined" ) {
                        console.log( message );
                }
                else {
                        //better alternative for browsers that don't support console????
                        alert( message );
                }
            }    
    } 
}
var wptheme_HTMLElementUtils = {
	// summary: Collection of utility functions useful for manipulating HTML elements in a cross-browser fashion.
	className: "wptheme_HTMLElementUtils",
	_debugUtils: wptheme_DebugUtils,
    _uniqueIdCounter: 0,
	getUniqueId: function () {
		// summary: Generates a unique identifier (to the current page) by appending a counter to a set prefix.
		//		A page refresh resets the unique identifier counter.
		// returns: a unique identifier
		var retVal = "wptheme_unique_" + this._uniqueIdCounter;
		this._uniqueIdCounter++;
		return retVal;	// String
	},
	sizeToViewableArea: function ( /*HTMLElement*/element ) {
		// summary: Sizes the given element to the viewable area of the browser in a cross-browser fashion.
		// element: the html element to size
		var browserDimensions = new BrowserDimensions();
		element.style.height = browserDimensions.getViewableAreaHeight() + "px";
		element.style.width = browserDimensions.getViewableAreaWidth() + "px";
		element.style.top = browserDimensions.getScrollFromTop() + "px";
		element.style.left = browserDimensions.getScrollFromLeft() + "px";
	},
	sizeToEntireArea: function ( /*HTMLElement*/element ) {
		// summary: Sizes the given element to the viewable area plus the scroll area.
		// element: the html element to size
		var browserDimensions = new BrowserDimensions();
		//The getHTMLElement*() functions return the exact size of the body element in IE even if the viewable area is
		//larger (i.e. no scroll bars). In Firefox, the dimensions of the viewable area plus the scrollable area is returned.
		//So in IE, we take the viewable area if that is larger and the HTMLElement* area if that is larger.
		element.style.height = Math.max( browserDimensions.getHTMLElementHeight(), browserDimensions.getViewableAreaHeight() ) + "px";
		element.style.width = Math.max( browserDimensions.getHTMLElementWidth(), browserDimensions.getViewableAreaWidth() ) + "px";
	},
	sizeRelativeToViewableArea: function ( /*HTMLElement*/element, /*float*/heightFactor, /*float*/widthFactor ) {
		// summary: Sizes the given element to a certain multiple of the viewable area. For example, if heightFactor is 0.5,
		//		the height of the given element will be set to half of the viewable area height.
		// element: the html element to size
		// heightFactor: the factor to multiply the viewable area height by
		// widthFactor: the factor to multiply the viewable area width by
		var browserDimensions = new BrowserDimensions();
		element.style.height = ( browserDimensions.getViewableAreaHeight() * heightFactor ) + "px";
		element.style.width = ( browserDimensions.getViewableAreaWidth() * widthFactor ) + "px";
	},
	positionRelativeToViewableArea: function ( /*HTMLElement*/element, /*float*/heightFactor, /*float*/widthFactor ) {
		// summary: Positions the given element relative to the viewable area. For example, if the heightFactor is 0.5, the
		// 		top of the element will be positioned (Y axis) halfway down the viewable area. Note that this means the element
		//		will be ABSOLUTELY positioned.
		// element: the html element to position
		// heightFactor: the factor to multiply the viewable area height by
		// widthFactor: the factor to multiply the viewable area width by
		var browserDimensions = new BrowserDimensions();
		element.style.position = "absolute";
		if ( this._debugUtils.enabled ) { 
			this._debugUtils.log( this.className, "Browser's viewable height: " + browserDimensions.getViewableAreaHeight() );
			this._debugUtils.log( this.className, "Browser's viewable width: " + browserDimensions.getViewableAreaWidth() );
			this._debugUtils.log( this.className, "Browser's scroll from top: " + browserDimensions.getScrollFromTop() ); 
			this._debugUtils.log( this.className, "Browser's scroll from left: " + browserDimensions.getScrollFromLeft() );
		}
		element.style.top = ( ( browserDimensions.getViewableAreaHeight() * heightFactor ) + browserDimensions.getScrollFromTop() ) + "px";
		//Scroll left behaves differently in FF & IE in RTL languages. The "correct" behavior is up for debate. In FF, it will return the "correct" value 
		//(scrollLeft switches when the page is rendered right-to-left). In IE, scroll left will basically return the scroll width for the body element.
		//There's no real "capability" to test for here so the window.attachEvent is a cheap trick to check for IE.
		//bidiSupport is defined in the theme.
		if ( bidiSupport.isRTL && window.attachEvent ) {
			if ( this._debugUtils.enabled ) {
				this._debugUtils.log( this.className, "scrollWidth = " + browserDimensions.getHTMLElementWidth() );
				this._debugUtils.log( this.className, "clientWidth = " + browserDimensions.getViewableAreaWidth() );
				this._debugUtils.log( this.className, "Scroll Offset should be: " + ( browserDimensions.getHTMLElementWidth() - browserDimensions.getViewableAreaWidth() - browserDimensions.getScrollFromLeft() ) );
			}
			element.style.left = ( ( browserDimensions.getViewableAreaWidth() * widthFactor) + ( browserDimensions.getHTMLElementWidth() - browserDimensions.getViewableAreaWidth() - browserDimensions.getScrollFromLeft() ) ) + "px";
		}
		else {
			element.style.left = ( ( browserDimensions.getViewableAreaWidth() * widthFactor ) + browserDimensions.getScrollFromLeft() ) + "px";
		}	
	},
	positionOutsideElementTopRight: function ( /*HTMLElement*/elementToPosition, /*HTMLElement*/relativeElement ) {
		// summary: Positions the given element just outside (to the top and lining up with the right edge) of the
		//		relative element.
		// description: Sets the top (Y-axis) position of the given element to the top of the relative element minus the
		//		height of element being positioned. Sets the left (X-axis) position of the given element to the left position of
		//		the relative element plus the width of the relative element (to get the right edge) minus the width of the element 
		// 		being positioned (to line the end of the element being positioned up with the right edge of the relative element). 
		elementToPosition.style.position = "absolute";
		elementToPosition.style.top = ( this.stripUnits( relativeElement.style.top ) - elementToPosition.offsetHeight ) + "px";
		if ( bidiSupport.isRTL ) {
			elementToPosition.style.left = ( this.stripUnits( relativeElement.style.left ) ) + "px";
		}
		else {
			elementToPosition.style.left = ( this.stripUnits( relativeElement.style.left ) + relativeElement.offsetWidth - elementToPosition.offsetWidth) + "px";	
		}
	},
	stripUnits: function ( /*String*/cssProp ) {
		// summary: Strips any units (i.e. "px") from a CSS style property.
		// returns: the number value minus any units
		return parseInt( cssProp.substring( 0, cssProp.length - 2 ));	//integer
	},
	addClassName: function ( /*HTMLElement*/element, /*String*/className ) {
		// summary: Adds the given className to the element's style definitions.
		// element: the HTMLElement to add the class name to
		// className: the className to add
		var clazz = element.className;
		if ( clazz.indexOf( className ) < 0 ) {
			element.className += (" " + className);
		}	
	},
	removeClassName: function ( /*HTMLElement*/element, /*String*/className ) {
		// summary: Removes the given className from the element's style definitions.
		// element: the HTMLElement to remove the class name from
		// className: the className to remove
		var clazz = element.className;
		var startIndex = clazz.indexOf( className );
		if ( startIndex >= 0 ) {
			clazz = clazz.substring(0, startIndex) + clazz.substring( startIndex + className.length + 1 );
			element.className = clazz;
		}
	},
	hideElementsByTagName: function ( /*String 1...N*/) {
		// summary: Hides every element of a given tag name. Stores the old visibility style so it can be 
		//		restored by the showElementsByTagName function.
		for ( var i = 0; i < arguments.length; i++ ) {
			var elements = document.getElementsByTagName( arguments[i] );
			for ( var j = 0; j < elements.length; j++ ) {
				if ( elements[j] && elements[j].style ) {
					elements[j]._oldVisibilityStyle = elements[j].style.visibility;
					elements[j].style.visibility = "hidden";
				}
			}
		}
	},
	showElementsByTagName: function ( /*String 1...N*/) {
		// summary: Shows every element of a given tag name. Uses the old visibility style so that elements hidden
		//		by hideElementsByTagName are properly restored.
		for ( var i = 0; i < arguments.length; i++ ) {
			var elements = document.getElementsByTagName( arguments[i] );
			for ( var j = 0; j < elements.length; j++ ) {
				if ( elements[j] && elements[j].style ) {
					if ( elements[j]._oldVisibility ) {
						elements[j].style.visibility = elements[j]._oldVisibility;
						elements[j]._oldVisibility = null;
					}
					else {
						elements[j].style.visibility = "visible";
					}
				}
			}
		}	
	},
	addOnload: function ( /*Function*/func ) {
		// summary: Adds a function to be called on page load.
		// func: the function to call 
		if ( window.addEventListener ) {
			window.addEventListener( "load", func, false );
		}
		else if ( window.attachEvent ) {
			window.attachEvent( "onload", func );
		}
	},
	getEventObject: function ( /*Event?*/event ) {
		// summary: Cross-browser function to retrieve the event object.
		// event: In W3C-compliant browsers, this object will just simply be
		//		returned
		// returns: the event object
		var result = event;
		if ( !event && window.event ) {
			result = window.event;
		}
		return result;	// Event
	}
}

var wptheme_CookieUtils = {
	// summary: Various utility functions for dealing with cookies on the client.
	_deleteDate: new Date( "1/1/2003" ),
	_undefinedOrNull: function ( /*Object*/variable ) {
            // summary: Determines if a given variable is undefined or NULL.
            // returns: true if undefined OR NULL, false otherwise.
            return ( typeof ( variable ) == "undefined" || variable == null );  // boolean
	},
	debug: wptheme_DebugUtils,
        className: "wptheme_CookieUtils",
	getCookie: function ( /*String*/cookieName ) {
		// summary: Gets the value for a given cookie name. If no value is found, returns NULL.
		cookieName = cookieName + "="
		var retVal = null;
		if ( document.cookie.indexOf( cookieName ) >= 0 )
		{
		    var cookies = document.cookie.split(";");
		
		    var c = 0;
		    while ( c < cookies.length && ( cookies[c].indexOf( cookieName ) == -1 ) )
		    {
		        c=c+1;
		    }
			//Add one to the cookie length to account for the equals we added to the cookie name at the beginning of 
			//the function.
		    var cookieValue = cookies[c].substring( (cookieName.length + 1), cookies[c].length );
		    
		    if ( cookieValue != "null" )
		    {
		        retVal = cookieValue;
		    }
		}
		
		return retVal; // String
	},
	setCookie: function ( /*String*/name, /*String*/value, /*Date?*/expiration, /*String?*/path ) {
		// summary: Creates the cookie based on the given information.
		// name: the name of the cookie
		// value: the value for the cookie
		// expiration: OPTIONAL -- when the cookie should expire
		// path: OPTIONAL -- the url path the cookie applies to
		if ( this.debug.enabled ) { this.debug.log( this.className, "set cookie (" + [ name, value, expiration, path ]  + ")"); }
		
		if ( this._undefinedOrNull( name ) ) { throw Error( "Unable to set cookie! No name given!" ); }
		if ( this._undefinedOrNull( value ) ) { throw Error( "Unable to set cookie! No value given!" ); }
		if ( this._undefinedOrNull( expiration ) ) { 
			expiration = ""; 
		}
		else {
			expiration = "expiration=" + expiration.toUTCString() + ";";
		}
		if ( this._undefinedOrNull( path ) ) { 
			path = "path=/;"; 
		}
		else {
			path = "path=" + path + ";";
		}
		
		document.cookie=name + '=' + value + ';' + expiration +  path;		
	},
	deleteCookie: function ( /*String*/cookieName ) {
		// summary: Deletes a given cookie by setting the value to "null" and setting the expiration
		//		value to expire completely.
		if ( this.debug.enabled ) { this.debug.log( this.className, "delete cookie (" + [ cookieName ] + ") "); }
		this.setCookie( cookieName, "null", this._deleteDate );
	}
}// Populates and shows a context menu asynchronously. 
//
// uniqueID             - some unique identifier describing the context of the menu (i.e. portlet window id)
// urlToMenuContents    - url target for the iFrame
// isLTR                - indicates if the page orientation is Left-to-Right
//
//
// This function creates a context menu using the WCL context menu javascript library. It populates this menu
// by creating a hidden DIV ( the ID consists of the unique identifier with "_DIV" appended ) which contains
// a hidden IFRAME ( the ID consists of the DIV identifier with "_IFRAME" appended ). The IFRAME loads the 
// specified URL and calls the buildAndDisplayMenu() function upon completion of loading the IFRAME. The document
// returned by the specified URL must contain a javascript function called "getMenuContents()" which returns 
// an array. The contents of the array must be in the following format ( array[i] = <menu-item-display-name>; 
// array[i+1] = <menu-item-action-url> ). The menu is attached to an HTML element with the id equal to the 
// unique identifier. So, in the portlet context menu case, the image associated with the context menu must have
// an ID equal to the portlet window ID. The dynamically created DIV and IFRAME are deleted after the menu 
// contents are populated and the same menu is returned for the duration of the request in which it was created.
//

//Control debugging. 
// -1 - no debugging
//  0 - minimal debugging ( adding items to menus )
//  1 - medium debugging ( function entry/exit )
//  2 - maximum debugging ( makes iframe visible )
// 999 - make iframe visible only
var asynchContextMenuDebug = -1;

var asynchContextMenuMouseOverIndicator = "";

var portletIdMap = new Object();

function asynchContextMenuOnMouseClickHandler( uniqueID, isLTR, urlToMenuContents, menuBorderStyle, menuTableStyle, menuItemStyle, menuItemSelectedStyle, emptyMenuText, loadingImage, renderBelow )
{
	var menuID = "contextMenu_" + uniqueID;
    
    var menu = getContextMenu( menuID );
    
    if (menu == null) 
    { 
    	asynchContextMenu_menuCurrentlyLoading = uniqueID;
    	
    	if ( loadingImage )
    	{
			setLoadingImage( loadingImage );
	    }

        menu = createContextMenu( menuID, isLTR, null, menuBorderStyle, menuTableStyle, emptyMenuText, null, renderBelow );
        loadAsynchContextMenu( uniqueID, urlToMenuContents, isLTR, menuItemStyle, menuItemSelectedStyle, '', true );
    }
    else
    {
    	if ( asynchContextMenu_menuCurrentlyLoading == uniqueID )
		{
			return;	
		}
    	showContextMenu( menuID, document.getElementById( uniqueID ) );
    }	
}

var asynchContextMenu_originalMenuImgElementSrc;

function setLoadingImage( img )
{
	asynchContextMenu_originalMenuImgElementSrc = document.getElementById( asynchContextMenu_menuCurrentlyLoading + "_img" ).src;
	document.getElementById( asynchContextMenu_menuCurrentlyLoading + "_img" ).src = img;
}

function clearLoadingImage()
{
	document.getElementById( asynchContextMenu_menuCurrentlyLoading + "_img" ).src = asynchContextMenu_originalMenuImgElementSrc;
}

function loadAsynchContextMenu( uniqueID, url, isLTR, menuItemStyle, menuItemSelectedStyle, emptyMenuText, showMenu, onMenuAffordanceShowHandler )
{
    asynchDebug( 'ENTRY loadAsynchContextMenu p1=' + uniqueID + '; p2=' + url + '; p3=' + isLTR + '; p4=' + isLTR);
	
	var menuID = "contextMenu_" + uniqueID;

    var dialogTag = null;
    var ID = uniqueID + '_DIV';
			
	//an iframe wasn't cleaned up properly
	if ( document.getElementById( ID ) != null )
	{
		closeMenu( ID );
        return;
	}
	
	//create the div tag and assign the styles to it		
	dialogTag = document.createElement( "DIV" );
	dialogTag.style.position="absolute";
	
	if ( asynchContextMenuDebug < 2 )
	{
		dialogTag.style.left = "0px";
		dialogTag.style.top  = "-100px";
    	dialogTag.style.visibility = "hidden";
	}
	
	if ( asynchContextMenuDebug >= 2 || asynchContextMenuDebug == 999 )
	{
		dialogTag.style.left = "100px";
		dialogTag.style.top  = "100px";
    	dialogTag.style.visibility = "visible";
	}		
	
	dialogTag.id=ID;
	
	var styleString = 'null';
	
	if ( menuItemStyle != null )
	{
		styleString = "'" + menuItemStyle + "'";
	}
	
	if ( menuItemSelectedStyle != null ) 
	{
		styleString = styleString + ", '" + menuItemSelectedStyle + "'";
	}
	else
	{
		styleString = styleString + ", null";
	}
	
	//alert( 'buildAndDisplayMenu( this.id, this.name, ' + styleString + ', ' + showMenu + ' , ' + callbackFn + ' );' );
	
    //create the iframe this way because onload handlers attached when creating dynamically don't seem to fire
    dialogTag.innerHTML='<iframe id="' + menuID + '" name="' + ID + '_IFRAME" src="' + url + '" onload="buildAndDisplayMenu( this.id, this.name, ' + styleString + ', ' + showMenu + ' , \''+ onMenuAffordanceShowHandler + '\' ); return false;" ></iframe>';
		
	//append the div tag to the document body		
	document.body.appendChild( dialogTag );

    asynchDebug( 'EXIT createDynamicElements' );

}



//Builds and displays the menu from the contents of the IFRAME.
function buildAndDisplayMenu( menuID, iframeID, menuItemStyle, menuItemSelectedStyle, showMenu, onMenuAffordanceShowHandler )
{
    asynchDebug( 'ENTRY buildAndDisplayMenu p1=' + menuID + '; p2=' + iframeID + '; p3=' + showMenu + '; p4=' + onMenuAffordanceShowHandler );
    
    //get the context menu, should have already been created.
    var menu = getContextMenu( menuID );

	//clear out our loading indicator
    clearLoadingImage();
   	asynchContextMenu_menuCurrentlyLoading = null;

    //if the menu doesn't exist, we shouldn't even be here....but just in case.
    if ( menu == null )
    {
        return false;
    }

    //strip the _IFRAME from the id to come up with the DIV id
    index = iframeID.indexOf( "_IFRAME" );
    var divID = iframeID.substring( 0, index );

    //strip the _DIV from the id to come up with the portlet id
    index2 = divID.indexOf( "_DIV" );
    var uniqueID = divID.substring( 0, index2 );
    
    asynchDebug( 'divID = ' + divID );
    asynchDebug( 'uniqueID = ' + uniqueID );

    var frame, c=-1, done=false;

    //In IE, referencing the iFrame via the name in the window.frames[] array
    //does not appear to work in this case, so we have to cycle through all the 
    //frames and compare the names to find the correct one.
    while ( ( c + 1 ) < window.frames.length && !done )
    {  
        c=c+1;

		//We have to surround this with a try/catch block because there are
		//cases where attempting to access the 'name' property of the current
		//frame in the array will generate an access denied exception. This is 
		//OK to ignore because any frame that generates this exception shouldn't
		//be the one we are looking for.
        try 
        {
            done = ( window.frames[c].name == iframeID );
        }
        catch ( e )
        {
            //do nothing.
        }
    }

    //Check for the existence of the function we are looking to call. 
    //If not, don't bother creating the menu. 
    if ( window.frames[c].getMenuContents )
    {
        contents = window.frames[c].getMenuContents();
    }
    else
    {
        //we were unable to load the context menu for whatever reason
        return false;
    }
    
    
    //Cycle through the array created by the getMenuContents()
    //function. The structure of the array should be [url, name].
    for ( i=0; i < contents.length; i=i+3 ) 
    {
        asynchDebug2( 'Adding item: ' + contents[i+1] );
        asynchDebug2( 'URL: ' + contents[i] );
        if ( contents[i] )
        {
        	asynchDebug2( 'url length: ' + contents[i].length );
        }
        asynchDebug2( 'icon: ' + contents[i+2] );

        if ( contents[i] && contents[i].length != 0 )
        {
        	var icon = null;
        	
        	if ( contents[i+2] && contents[i+2].length != 0 )
        	{
        		icon = contents[i+2];
        	}
        
            menu.add( new UilMenuItem( contents[i+1], true, '', contents[i], null, icon, null, menuItemStyle, menuItemSelectedStyle ) );
        }
    }

    //our target image should have an ID of the uniqueID
    var target = document.getElementById( uniqueID );
    //remove our iframe since we've created the menu, we don't need the iframe on this request anymore.
    // (148004) deleting the elements causes the status bar to spin forever on mozilla
    //deleteDynamicElements( divID );

    asynchDebug( 'EXIT buildAndDisplayMenu' );

	//asynchContextMenuOnLoadCheck( menuID, uniqueID, target, onMenuAffordanceShowHandler );

    //...and display!
    if ( showMenu == null || showMenu == true )
    {
    	return showContextMenu( menuID, target ); 
    }
}


//Creates and loads the IFRAME.
function createDynamicElements( uniqueID, url, menuID, menuItemStyle, menuItemSelectedStyle )
{
    asynchDebug( 'ENTRY createDynamicElements p1=' + uniqueID + '; p2=' + url + '; p3=' + menuID );

    var dialogTag = null;
    var ID = uniqueID + '_DIV';
			
	//an iframe wasn't cleaned up properly
	if ( document.getElementById( ID ) != null )
	{
		closeMenu( ID );
        return;
	}
	
	//create the div tag and assign the styles to it		
	dialogTag = document.createElement( "DIV" );
	dialogTag.style.position="absolute";
	
	if ( asynchContextMenuDebug < 2 )
	{
		dialogTag.style.left = "0px";
		dialogTag.style.top  = "-100px";
    	dialogTag.style.visibility = "hidden";
	}
	
	if ( asynchContextMenuDebug >= 2 || asynchContextMenuDebug == 999 )
	{
		dialogTag.style.left = "100px";
		dialogTag.style.top  = "100px";
    	dialogTag.style.visibility = "visible";
	}		
	
	dialogTag.id=ID;
	
	var styleString = 'null, null';
	
	if ( menuItemStyle != null )
	{
		styleString = "'" + menuItemStyle + "'";
	}
	
	if ( menuItemSelectedStyle != null ) 
	{
		styleString = styleString + ", '" + menuItemSelectedStyle + "'";
	}
	else
	{
		styleString = styleString + ", null";
	}
    
    //create the iframe this way because onload handlers attached when creating dynamically don't seem to fire
    dialogTag.innerHTML='<iframe id="' + menuID + '" name="' + ID + '_IFRAME" src="' + url + '" onload="buildAndDisplayMenu( this.id, this.name, ' + styleString + ' ); return false;" ></iframe>';
		
	//append the div tag to the document body		
	document.body.appendChild( dialogTag );

    asynchDebug( 'EXIT createDynamicElements' );
}

function asynchDebug( str ) 
{
	if ( asynchContextMenuDebug >= 1 && asynchContextMenuDebug != 999 )
	{
	    alert( str );
	}
}

function asynchDebug2( str )
{
	if ( asynchContextMenuDebug >= 0 && asynchContextMenuDebug != 999 )
	{
    	alert( str) ;
    }
}

//MMD - this function is used so that relative URLs may be used with the context menus.
function asynchDoFormSubmit( url ){

    var formElem = document.createElement("form");
    document.body.appendChild(formElem);

    formElem.setAttribute("method", "GET");

    var delimLocation = url.indexOf("?");
    
    if (delimLocation >= 0) {
        var newUrl = url.substring(0, delimLocation);
        
        var paramsEnd = url.length;
        // test to see if a # fragment identifier (the layout node id) is appended to the end of the URL
        var layoutNodeLocation = url.indexOf("#");
        if (layoutNodeLocation >= 0 && layoutNodeLocation > delimLocation) {
            paramsEnd = layoutNodeLocation;
            newUrl = newUrl + url.substring(layoutNodeLocation, url.length);
        }
        
        var params = url.substring(delimLocation + 1, paramsEnd);
        var paramArray = params.split("&");

        for (var i = 0; i < paramArray.length; i++) {
            var name = paramArray[i].substring(0, paramArray[i].indexOf("="));
            var value = paramArray[i].substring(paramArray[i].indexOf("=") + 1, paramArray[i].length);

            var inputElem = document.createElement("input");
            inputElem.setAttribute("type", "hidden");
            inputElem.setAttribute("name", name);
            inputElem.setAttribute("value", value);
            formElem.appendChild(inputElem);
        }
        
        url = newUrl;

    }

    formElem.setAttribute("action", url);
    
    formElem.submit();

}

var asynchContextMenu_menuCurrentlyLoading = null;

function menuMouseOver( id, selectedImage )
{
	if ( asynchContextMenu_menuCurrentlyLoading != null )
		return;

	portletIdMap[id] = 'menu_'+id+'_img';
	showAffordance(id, selectedImage);
}

function menuMouseOut( id, disabledImage )
{
	if ( asynchContextMenu_menuCurrentlyLoading != null )
		return;
	
   	hideAffordance(id , disabledImage);
	portletIdMap[id] = "";
}

function showAffordance( id, selectedImage )
{
	document.getElementById( 'menu_'+id ).style.cursor='pointer';
	document.getElementById( 'menu_'+id+'_img').src=selectedImage;
}

function hideAffordance( id, disabledImage )
{
	document.getElementById( 'menu_'+id ).style.cursor='default';
	document.getElementById( 'menu_'+id+'_img').src=disabledImage;	
}

function menuMouseOverThinSkin(id, selectedImage, minimized)
{
	if ( asynchContextMenu_menuCurrentlyLoading != null )
		return;

	portletIdMap[id] = 'menu_'+id+'_img';
	showAffordanceThinSkin(id, selectedImage, minimized);
}

function menuMouseOutThinSkin(id, disabledImage, minimized )
{
	if ( asynchContextMenu_menuCurrentlyLoading != null)
		return;

   	hideAffordanceThinSkin(id , disabledImage, minimized);
	portletIdMap[id] = "";
}

function showAffordanceThinSkin(id, selectedImage, minimized)
{
	document.getElementById( 'menu_'+id ).style.cursor='pointer';
	document.getElementById( 'portletTitleBar_'+id ).className='wpsThinSkinContainerBar wpsThinSkinContainerBarBorder';
	document.getElementById( 'title_'+id ).className='wpsThinSkinDragZoneContainer wpsThinSkinVisible';
	document.getElementById( 'menu_'+id+'_img' ).src=selectedImage;
}

function hideAffordanceThinSkin(id, disabledImage, minimized)
{
	document.getElementById( 'menu_'+id ).style.cursor='default';
	/* when minimized, the titlebar should always be displayed so it can be found by the user, so we don't hide it */
	if (minimized == null || minimized == false){
	document.getElementById( 'portletTitleBar_'+id ).className='wpsThinSkinContainerBar';
	}
	document.getElementById( 'title_'+id ).className='wpsThinSkinDragZoneContainer wpsThinSkinInvisible';
	document.getElementById( 'menu_'+id+'_img' ).src=disabledImage;	
}

var onmousedownold_;

function closeMenu(id, disabledImage)
{
	hideCurrentContextMenu();

	if (  portletIdMap[id] == "")
	{
		hideAffordance( id, disabledImage );
	}
	
	document.onmousedown = onmousedownold_;
}

function showPortletMenu( id, portletNoActionsText, isRTL, menuPortletURL, disabledImage, loadingImage )
{
	if ( portletIdMap[id].indexOf( id ) < 0  )
		return;
		
	asynchContextMenuOnMouseClickHandler('menu_'+id,!isRTL,menuPortletURL, null, null, null, null, portletNoActionsText, loadingImage );
   	onmousedownold_ = document.onmousedown;
	document.onmousedown = closeMenu;
}

function accessibleShowMenu( event , id , portletNoActionsText, isRTL, menuPortletURL, loadingImage )
{
	if ( event.which == 13 )
	{
	    asynchContextMenuOnMouseClickHandler( 'menu_'+id,!isRTL,menuPortletURL, null, null, null, null, portletNoActionsText, loadingImage );
	}
	else
	{
	 	return true;
	}
}

wptheme_AsyncMenuAffordance = function ( /*String*/anchorId, /*String*/imageId, /*String*/showingImgUrl, /*String*/hidingImgUrl ) {
	// summary: Representation of an asynchronous menu's affordance (UI element which triggers the menu to show). Manages the details
	//		of showing/hiding the affordance, if appropriate.
	// description: In the Portal theme, we want the menu affordance to only show during certain events (e.g. mouseover the page name). The details
	//		of the showing/hiding is a little more complicated than changing the css on an HTML element due to various rendering/accessibility concerns. This 
	//		object manages these details. 
	this.anchorId = anchorId;
	this.imageId = imageId;
	this.showingImgUrl = showingImgUrl;
	this.hidingImgUrl = hidingImgUrl;
	
	this.show = function () {
		// summary: Shows the affordance.		
		if (document.getElementById( this.anchorId ) != null) {
			document.getElementById( this.anchorId ).style.cursor = 'pointer';
			document.getElementById( this.imageId ).src=this.showingImgUrl;
		}	
	}
	this.hide = function () {
		// summary: Hides the affordance.
		if (document.getElementById( this.anchorId ) != null) {
			document.getElementById( this.anchorId ).style.cursor = 'default';
			document.getElementById( this.imageId ).src=this.hidingImgUrl;
		}
	}
}

wptheme_AsyncMenu = function ( /*String*/id, /*String*/menuBorderStyle, /*String*/menuStyle, /*String*/menuItemStyle, /*String*/selectedMenuItemStyle ) {
		// summary: Representation of an asynchronous context menu. Manages showing/hiding the menu as well as showing/hiding the menu's affordance (UI element
		//		which opens the menu). 
		// id: the menu's id
		// menuBorderStyle: the style name to be applied to the menu's border
		// menuStyle: the style name to be applied to the general menu
		// menuItemStyle: the style name to be applied to the menu item
		// selectedMenuItemStyle: the style name to be applied to a selected menu item
		
		//global utilities
		this._htmlUtils = wptheme_HTMLElementUtils;
		
		//properties passed in at construction time
		this.id = id;
		this.menuBorderStyle = menuBorderStyle; 
		this.menuStyle = menuStyle;
		this.menuItemStyle = menuItemStyle;
		this.selectedMenuItemStyle = selectedMenuItemStyle;
		
		//properties that have to be initialized in the theme
		this.url = null;
		this.isRTL = false;
		this.emptyMenuText = null;
		this.loadingImgUrl = null;
		this.affordance = null;
		this.init = function ( /*String*/ url, /*boolean*/isRTL, /*String*/ emptyMenuText, /*String*/ loadingImgUrl, /*wptheme_MenuAffordance*/affordance, /*boolean*/renderBelow ) {
			// summary: Convenience function for setting up the required variables for showing the page menu.
			// url: the url to load page menu contents (usually created with <portal-navgation:url themeTemplate="pageContextMenu" />)
			// isRTL: is the current locale a right-to-left locale
			// emptyMenuText: the text to display if the user has no valid options
			// loadingImgUrl: the url to the image to display while the menu is loading
			this.url = url;
			this.isRTL = isRTL;
			this.emptyMenuText = emptyMenuText;
			this.loadingImgUrl = loadingImgUrl;
			this.affordance = affordance;
			this.renderBelow = renderBelow;
		}
		this.show = function ( /*Event?*/evt ) {
			// summary: Shows the page menu for the selected page. 
			// description: Typically triggered by 2 types of events: click and keypress. On a click event, we just want to show the menu. On a keypress
			//		event, we want to make sure the ENTER/RETURN key was pressed before showing the menu.
			// event: Event object passed in when triggered from a key press event.
			
			evt = this._htmlUtils.getEventObject( evt );
			var show = false;
			var result;
			//On a keypress event, we want to make sure the ENTER/RETURN key was pressed before showing the menu.
			if ( evt && evt.type == "keypress" ) { 
				var keyCode = -1;
				if ( evt && evt.which ){	
					keyCode = evt.which;
				}
				else {
					keyCode = evt.keyCode
				}	
		
				//Enter/Return was the key that triggered this keypress event.
				if ( keyCode == 13 ) {
					show = true;
				}						
			}
			else {
				//Some other kind of event, just show the menu already...
				show = true;
			}
			
			//Show the menu if necessary.
			if ( show ) {
				result = asynchContextMenuOnMouseClickHandler( this.id, !this.isRTL, this.url, this.menuBorderStyle, this.menuStyle, this.menuItemStyle, this.selectedMenuItemStyle, this.emptyMenuText, this.loadingImgUrl, this.renderBelow );
			} 
			
			return result;
		}
		this.showAffordance = function () {
			// summary: Shows the affordance associated with the given asynchronous menu. 
			if ( asynchContextMenu_menuCurrentlyLoading == null ) {
				this.affordance.show();
			}	
		}
		this.hideAffordance = function () {
			// summary: Hides the affordance associated with the given asynchronous menu.
			if ( asynchContextMenu_menuCurrentlyLoading == null ) {
				this.affordance.hide();
			}
		}
	}

wptheme_ContextMenuUtils = {
	// summary: Utility object for managing the different context menus in the theme. Constructs the wptheme_AsyncMenu objects here, initialization must take place in
	//		the head section of the HTML document (usually the initialization values require the usage of JSP tags). 
	moreMenu: new wptheme_AsyncMenu( "wptheme_more_menu", "wptheme-more-menu-border", "wptheme-more-menu", "wptheme-more-menu-item", "wptheme-more-menu-item-selected", true ),
	topNavPageMenu: new wptheme_AsyncMenu( "wptheme_selected_page_menu", "wptheme-page-menu-border", "wptheme-page-menu", "wptheme-page-menu-item", "wptheme-page-menu-item-selected" ),
	sideNavPageMenu: new wptheme_AsyncMenu( "wptheme_selected_page_menu", "wptheme-page-menu-border", "wptheme-page-menu", "wptheme-page-menu-item", "wptheme-page-menu-item-selected" )
}



//////////////////////////////////////////////////////////////////
// begin BrowserDimensions object definition
BrowserDimensions.prototype				= new Object();
BrowserDimensions.prototype.constructor = BrowserDimensions;
BrowserDimensions.superclass			= null;

function BrowserDimensions(){

    this.body = document.body;
    if (this.isStrictDoctype() && !this.isSafari()) {
        this.body = document.documentElement;
    }

}

BrowserDimensions.prototype.getScrollFromLeft = function(){
    return this.body.scrollLeft ;
}

BrowserDimensions.prototype.getScrollFromTop = function(){
    return this.body.scrollTop ;
}

BrowserDimensions.prototype.getViewableAreaWidth = function(){
    return this.body.clientWidth ;
}

BrowserDimensions.prototype.getViewableAreaHeight = function(){
    return this.body.clientHeight ;
}

BrowserDimensions.prototype.getHTMLElementWidth = function(){
    return this.body.scrollWidth ;
}

BrowserDimensions.prototype.getHTMLElementHeight = function(){
    return this.body.scrollHeight ;
}

BrowserDimensions.prototype.isStrictDoctype = function(){

    return (document.compatMode && document.compatMode != "BackCompat");

}

BrowserDimensions.prototype.isSafari = function(){

    return (navigator.userAgent.toLowerCase().indexOf("safari") >= 0);

}

// end BrowserDimensions object definition
//////////////////////////////////////////////////////////////////

//Provides a controller for enabling and disabling javascript events
//on a particular HTML element. Elements must register with the controller
//in order to be enabled/disabled. The act of registering with the controller
//disables the element, unless otherwise specified. 
//
//
// **The main purpose of this controller is to disable the javascript 
//actions of certain elements that, if executed prior to the page completely 
//loading, cause problems.

//Object definition for ElementJavascriptEventController
function ElementJavascriptEventController()
{
	//Registered elements to disable and enable upon page load.
	this.elements = new Array();
	this.arrayPosition = 0;
	
	//Function mappings
	this.enableAll = enableRegisteredElementsInternal;
	this.disableAll = disableRegisteredElementsInternal;
	this.register = registerElementInternal;
	this.enable = enableRegisteredElementInternal;
	this.disable = disableRegisteredElementInternal;
	
	//Enables all registered items.
	function enableRegisteredElementsInternal()
	{
		for ( c=0; c < this.arrayPosition; c=c+1 )
		{
			this.elements[c].enable();	
		}
	}
	
	function enableRegisteredElementInternal( id )
	{
		for ( c=0; c < this.arrayPosition; c=c+1 )
		{
			if ( this.elements[c].ID == id )
			{
				this.elements[c].enable();
			}
		}
	}
	
	//Disables all registered items.
	function disableRegisteredElementsInternal()
	{
		for ( c=0; c < this.arrayPosition; c=c+1 )
		{
			this.elements[c].disable();
		}
	}
	
	function disableRegisteredElementInternal( id )
	{
		for ( c=0; c < this.arrayPosition; c=c+1 )
		{
			if ( this.elements[c].ID == id )
			{
				this.elements[c].disable();
			}
		}
	}
	
	//Registers an item with the controller.
	function registerElementInternal( HTMLElementID, doNotDisable, optionalOnEnableJavascriptAction )
	{
		this.elements[ this.arrayPosition ] = new RegisteredElement( HTMLElementID, doNotDisable, optionalOnEnableJavascriptAction );
		this.arrayPosition = this.arrayPosition + 1;
	}
}

//Object definition for an element registered with the controller.
//These objects should only be created by the controller.
function RegisteredElement( ElementID, doNotDisable, optionalOnEnableJavascriptAction )
{
	//Information about the element.
	this.ID = ElementID;
	this.oldCursor = "normal";
	this.ItemOnMouseDown = null;
	this.ItemOnMouseUp = null;
	this.ItemOnMouseOver = null;
	this.ItemOnMouseOut = null;
	this.ItemOnMouseClick = null;
	this.ItemOnBlur = null;
	this.ItemOnFocus = null;
	this.ItemOnChange = null;
	this.onEnableJS = optionalOnEnableJavascriptAction;
	
	//Function mappings
	this.enable = enableInternal;
	this.disable = disableInternal;
	
	//Enables an element. Enabling consists of changing the cursor
	//style back to the original style, and returning all the stored
	//javascript events to their original state. If the HTML element
	//is a button, the disabled property is simply set to false.
	function enableInternal()
	{
		//Return the old cursor style.
		document.getElementById( this.ID ).style.cursor = this.oldCursor;
		
		//If it's a button, re-enable it.
		if ( document.getElementById( this.ID ).tagName == "BUTTON" )
		{
			document.getElementById( this.ID ).disabled = false;
		}
		else
		{
			//Return all the events.
			document.getElementById( this.ID ).onmousedown = this.ItemOnMouseDown;
			document.getElementById( this.ID ).onmouseup = this.ItemOnMouseUp;
			document.getElementById( this.ID ).onmouseover = this.ItemOnMouseOver;
			document.getElementById( this.ID ).onmouseout = this.ItemOnMouseOut;
			document.getElementById( this.ID ).onclick = this.ItemOnMouseClick;
			document.getElementById( this.ID ).onblur = this.ItemOnBlur;
			document.getElementById( this.ID ).onfocus = this.ItemOnFocus;
			document.getElementById( this.ID ).onchange = this.ItemOnChange;	
		}
		
		//Execute the onEnable Javascript, if specified.
		if ( this.onEnableJS != null )
		{
			eval( this.onEnableJS );
		}
	}
	
	//Disables an element. Disabling consists of changing the cursor
	//style to "not-allowed", and setting all the javascript events to
	//do nothing. If the HTML element is a button, the "disabled" property
	//is simply set to true.	
	function disableInternal() 
	{
		//Set the cursor style to point out that you can't do anything yet
		this.oldCursor = document.getElementById( this.ID ).style.cursor;
		document.getElementById( this.ID ).style.cursor = "not-allowed";
	
		//If the HTML element is a BUTTON, we can easily disable it by
		//setting the disabled property to true.
		if ( document.getElementById( this.ID ).tagName == "BUTTON" )
		{
			document.getElementById( this.ID ).disabled = true;
		}
		else
		{
			//Store all the current events registered to the item.
			this.ItemOnMouseDown = document.getElementById( this.ID ).onmousedown;
			this.ItemOnMouseUp = document.getElementById( this.ID ).onmouseup;
			this.ItemOnMouseOver = document.getElementById( this.ID ).onmouseover;
			this.ItemOnMouseOut = document.getElementById( this.ID ).onmouseout;
			this.ItemOnMouseClick = document.getElementById( this.ID ).onclick;
			this.ItemOnBlur = document.getElementById( this.ID ).onblur;
			this.ItemOnFocus = document.getElementById( this.ID ).onfocus;
			this.ItemOnChange = document.getElementById( this.ID ).onchange;
			
			//Now set all the current events to do nothing.
			document.getElementById( this.ID ).onmousedown = function () { void(0); return false; };
			document.getElementById( this.ID ).onmouseup = function () { void(0); return false; };
			document.getElementById( this.ID ).onmouseover = function () { void(0); return false; };
			document.getElementById( this.ID ).onmouseout = function () { void(0); return false; };
			document.getElementById( this.ID ).onclick = function () { void(0); return false; };
			document.getElementById( this.ID ).onblur = function () { void(0); return false; };
			document.getElementById( this.ID ).onfocus = function () { void(0); return false; };
			document.getElementById( this.ID ).onchange = function () { void(0); return false; };
		}
	}		
	
	//Disable the element
	if ( !doNotDisable )
	{
		this.disable();	
	}
	
} 
// Global variables 
var wpsFLY_isIE = document.all?1:0;
var wpsFLY_isNetscape=document.layers?1:0;                             
var wpsFLY_isMoz = document.getElementById && !document.all;

// This sets how many pixels of the tab should show when collapsed was 11
var wpsFLY_minFlyout=0;

// How many pixels should it move every step? 
var wpsFLY_move=15;
if (wpsFLY_isIE)
   wpsFLY_move=12;

// Specify the scroll speed in milliseconds
var wpsFLY_scrollSpeed=1;

// Timeout ID for flyout
var wpsFLY_timeoutID=1;

// How from from top of screen for scrolling
var wpsFLY_fromTop=100;
var wpsFLY_leftResize;

//Cross browser access to required dimensions 
var wpsFLY_browserDimensions = new BrowserDimensions();

var wpsFLY_initFlyoutExpanded = wpsFLY_getInitialFlyoutState();

// Current state of the flyout for the life of the request (true=in, false=out)
var wpsFLY_state = true;

var wpsFLY_currIndex = -1;
// -----------------------------------------------------------------
// Initialize the Flyout
// -----------------------------------------------------------------
function wpsFLY_initFlyout(showHidden)
{
   wpsFLY_Flyout=new wpsFLY_makeFlyout('wpsFLYflyout');
   wpsFLY_Flyout.setWidth(wpsFLY_minFlyout);
   wpsFLY_Flyout.css.overflow = 'hidden';
   wpsFLY_Flyout.setLeft( wpsFLY_Flyout.pageWidth() - wpsFLY_minFlyout-1 );

   if (wpsFLY_isNetscape||wpsFLY_isMoz)
      scrolled="window.pageYOffset";
   else if (wpsFLY_isIE)
      scrolled="document.body.scrollTop";

   if (wpsFLY_isNetscape||wpsFLY_isMoz)
      wpsFLY_fromTop=wpsFLY_Flyout.css.top;
   else if (wpsFLY_isIE)
      wpsFLY_fromTop=wpsFLY_Flyout.css.pixelTop;

   if (wpsFLY_isIE) {
      window.onscroll=wpsFLY_internalScroll;
      window.onresize=wpsFLY_internalScroll;
   }
   else {
     window.onscroll=wpsFLY_internalScroll();
   }

   if (showHidden)
      wpsFLY_Flyout.css.visibility="hidden";
   else
      wpsFLY_Flyout.css.visibility="visible";

   //Open or close the flyout depending on the init state.
   if ( wpsFLY_initFlyoutExpanded != null )
   {
       wpsFLY_toggleFlyout( wpsFLY_initFlyoutExpanded, true );
   }

   return;
}

// -----------------------------------------------------------------
// Initialize the Flyout on left
// -----------------------------------------------------------------
function wpsFLY_initFlyoutLeft(showHidden)
{
   wpsFLY_FlyoutLeft=new wpsFLY_makeFlyoutLeft('wpsFLYflyout');

   if (wpsFLY_isIE) {
      wpsFLY_FlyoutLeft.setWidth(wpsFLY_minFlyout);
      wpsFLY_FlyoutLeft.css.overflow = 'hidden';
	   wpsFLY_FlyoutLeft.setLeft(0);
   } else {
      //  Mozilla does not move the scroll to the left for bidi languages
	   wpsFLY_FlyoutLeft.setLeft(wpsFLY_minFlyout - wpsFLY_FlyoutLeft.getWidth()- 4);
   }

   if (wpsFLY_isNetscape||wpsFLY_isMoz)
      scrolled="window.pageYOffset";
   else if (wpsFLY_isIE)
      scrolled="document.body.scrollTop";

   if (wpsFLY_isNetscape||wpsFLY_isMoz)
      wpsFLY_fromTop=wpsFLY_FlyoutLeft.css.top;
   else if (wpsFLY_isIE)
      wpsFLY_fromTop=wpsFLY_FlyoutLeft.css.pixelTop;

   if (wpsFLY_isIE) {
      window.onscroll=wpsFLY_internalScrollLeft;
      window.onresize=wpsFLY_internalResizeLeft;
   } else
      window.onscroll=wpsFLY_internalScrollLeft();

   if (showHidden)
      wpsFLY_FlyoutLeft.css.visibility="hidden";
   else
      wpsFLY_FlyoutLeft.css.visibility="visible";
      
   //Open or close the flyout depending on the init state.
   if ( wpsFLY_initFlyoutExpanded != null )
   {
       wpsFLY_toggleFlyout( wpsFLY_initFlyoutExpanded, true );
   }   
}


// -----------------------------------------------------------------
// Constructs flyout (default on right)
// -----------------------------------------------------------------
function wpsFLY_makeFlyout(obj)
{
   this.origObject=document.getElementById(obj);
   //get the css for the DIV tag, need it later
   if (wpsFLY_isNetscape)
      this.css=eval('document.'+obj);
   else if (wpsFLY_isMoz)
      this.css=document.getElementById(obj).style;
   else if (wpsFLY_isIE)
      this.css=eval(obj+'.style');

   //initialize the expand state
   wpsFLY_state=1;
   this.go=0;

   //get the width
   if (wpsFLY_isNetscape)
      this.width=this.css.document.width;
   else if (wpsFLY_isMoz)
      this.width=document.getElementById(obj).offsetWidth;
   else if (wpsFLY_isIE)
      this.width=eval(obj+'.offsetWidth');

   this.setWidth=wpsFLY_internalSetWidth;
   this.getWidth=wpsFLY_internalGetWidth;
   
   //set a left method to make it common across browsers
   this.left=wpsFLY_internalGetLeft;
   this.pageWidth=wpsFLY_internalGetPageWidth;
   this.setLeft = wpsFLY_internalSetLeft;

   this.obj = obj + "Object";   
   eval(this.obj + "=this");  
}

// -----------------------------------------------------------------
// Constructs flyout (on left)
// -----------------------------------------------------------------
function wpsFLY_makeFlyoutLeft(obj)        
{
   this.origObject=document.getElementById(obj);
	//get the css for the DIV tag, need it later
    if (wpsFLY_isNetscape) 
		this.css=eval('document.'+obj);
    else if (wpsFLY_isMoz) 
		this.css=document.getElementById(obj).style;
    else if (wpsFLY_isIE) 
		this.css=eval(obj+'.style');

	//initialize the expand state
	wpsFLY_state=1;
	this.go=0;
	
	//get the width
	if (wpsFLY_isNetscape) 
		this.width=this.css.document.width;
    else if (wpsFLY_isMoz) 
		this.width=document.getElementById(obj).offsetWidth;
    else if (wpsFLY_isIE) 
		this.width=eval(obj+'.offsetWidth');

   this.setWidth=wpsFLY_internalSetWidthLeft;
   this.getWidth=wpsFLY_internalGetWidthLeft;

	//set a left method to make it common across browsers
	this.left=wpsFLY_internalGetLeft;
   this.pageWidth=wpsFLY_internalGetPageWidth;
   this.setLeft = wpsFLY_internalSetLeft;

   this.obj = obj + "Object"; 	
   eval(this.obj + "=this");	
}


// -----------------------------------------------------------------
// The internal api to get the page width value that is cross browser
// -----------------------------------------------------------------
function wpsFLY_internalGetPageWidth()
{
   //get the width
   return wpsFLY_browserDimensions.getViewableAreaWidth();
}

function wpsFLY_internalSetLeft( value )
{
    this.css.left=value + "px";
}

// -----------------------------------------------------------------
// The internal api to set the width value that is cross browser
// -----------------------------------------------------------------
function wpsFLY_internalSetWidth(value)
{
   this.css.width = value + "px";
   if (navigator.userAgent.indexOf ("Opera") != -1) {
      var operaIframe=document.getElementById('wpsFLY_flyoutIFrame');
      operaIframe.style.width = (value-wpsFLY_minFlyout) + "px" ;
   }
}

// -----------------------------------------------------------------
// The internal api to set the width value that is cross browser
// -----------------------------------------------------------------
function wpsFLY_internalSetWidthLeft(value)
{
   this.css.width = value + "px";
   if (navigator.userAgent.indexOf ("Opera") != -1) {
      var operaIframe=document.getElementById('wpsFLY_flyoutIFrame');
      operaIframe.style.width = (value-wpsFLY_minFlyout) + "px" ;
   }
}

// -----------------------------------------------------------------
// The internal api to get the width value that is cross browser
// -----------------------------------------------------------------
function wpsFLY_internalGetWidth()
{
   //get the width
   if (wpsFLY_isNetscape)
      return eval(this.css.document.width);
   else if (wpsFLY_isMoz||wpsFLY_isIE)
      return eval(this.origObject.offsetWidth);
}

// -----------------------------------------------------------------
// The internal api to get the width value that is cross browser
// -----------------------------------------------------------------
function wpsFLY_internalGetWidthLeft()
{
   var width;
   if (wpsFLY_isNetscape)
      width = eval(this.css.document.width);
   else if (wpsFLY_isMoz||wpsFLY_isIE)
      width = eval(this.origObject.offsetWidth);
   return width;
}

// -----------------------------------------------------------------
// The internal api to get the left value that is cross browser
// -----------------------------------------------------------------
function wpsFLY_internalGetLeft()
{
   if (wpsFLY_isNetscape||wpsFLY_isMoz)
      leftfunc=parseInt(this.css.left);
   else if (wpsFLY_isIE)
      leftfunc=eval(this.css.pixelLeft);
   return leftfunc;
}

// -----------------------------------------------------------------
// The internal fly out function, called my real function, only 
// wpsFLY_moveOutFlyout should call this function.
// -----------------------------------------------------------------
function wpsFLY_internalMoveOut()
{
	document.getElementById('wpsFLYflyout').className = "portalFlyoutExpanded";

   if (wpsFLY_Flyout.left() - wpsFLY_move > wpsFLY_Flyout.pageWidth()+ wpsFLY_browserDimensions.getScrollFromLeft() - wpsFLY_Flyout.width ) {
      var newwidth= wpsFLY_Flyout.getWidth()+wpsFLY_move;
      wpsFLY_Flyout.setWidth(newwidth);
      wpsFLY_Flyout.setLeft(wpsFLY_Flyout.left() - wpsFLY_move);
      wpsFLY_timeoutID=setTimeout("wpsFLY_internalMoveOut()",wpsFLY_scrollSpeed);
      wpsFLY_Flyout.go=1;
   } else {
      wpsFLY_Flyout.setLeft(wpsFLY_Flyout.pageWidth() + wpsFLY_browserDimensions.getScrollFromLeft() - wpsFLY_Flyout.width);
      wpsFLY_Flyout.setWidth(wpsFLY_Flyout.width);
      wpsFLY_Flyout.go=0;
      wpsFLY_state=0;
   }
}

// -----------------------------------------------------------------
// The internal slide out function, called my real function, only 
// wpsFLY_moveOutFlyoutLeft should call this function. For left sided
// flyout.
// -----------------------------------------------------------------
function wpsFLY_internalMoveOutLeft()
{
	document.getElementById('wpsFLYflyout').className = "portalFlyoutExpanded";

   if (wpsFLY_isIE) {
	   if (wpsFLY_FlyoutLeft.getWidth() + wpsFLY_move < wpsFLY_FlyoutLeft.width) {
         var newwidth= wpsFLY_FlyoutLeft.getWidth()+wpsFLY_move;
         wpsFLY_FlyoutLeft.setWidth(newwidth);
		   wpsFLY_timeoutID=setTimeout("wpsFLY_internalMoveOutLeft()",wpsFLY_scrollSpeed);
		   wpsFLY_FlyoutLeft.go=1;
	   } else {
         wpsFLY_FlyoutLeft.setLeft( wpsFLY_FlyoutLeft.left());
         wpsFLY_FlyoutLeft.setWidth(wpsFLY_FlyoutLeft.width);
		   wpsFLY_FlyoutLeft.go=0;
		   wpsFLY_state=0;
	   }   
   } else {
   //  Mozilla browsers don't scroll left
      if( wpsFLY_FlyoutLeft.left()+wpsFLY_move < wpsFLY_browserDimensions.getScrollFromLeft()) {
		   wpsFLY_FlyoutLeft.go=1;
		   wpsFLY_FlyoutLeft.setLeft(wpsFLY_FlyoutLeft.left()+wpsFLY_move);
		   wpsFLY_timeoutID=setTimeout("wpsFLY_internalMoveOutLeft()",wpsFLY_scrollSpeed);
	   } else {
         wpsFLY_FlyoutLeft.setLeft( wpsFLY_browserDimensions.getScrollFromLeft());
		   wpsFLY_FlyoutLeft.go=0;
		   wpsFLY_state=0;
	   }
   }  
}

// -----------------------------------------------------------------
// The internal fly in function, called my real function, only 
// wpsFLY_moveInFlyout should call this function.
// -----------------------------------------------------------------
function wpsFLY_internalMoveIn()
{
   if ( wpsFLY_Flyout.left() + wpsFLY_move < wpsFLY_Flyout.pageWidth() + wpsFLY_browserDimensions.getScrollFromLeft() - wpsFLY_minFlyout  ) {
      wpsFLY_Flyout.go=1;
      var newwidth= wpsFLY_Flyout.getWidth()-wpsFLY_move;
      wpsFLY_Flyout.setWidth(newwidth);
      wpsFLY_Flyout.setLeft(wpsFLY_Flyout.left()+wpsFLY_move);
      wpsFLY_timeoutID=setTimeout("wpsFLY_internalMoveIn()",wpsFLY_scrollSpeed);
   } else {
      wpsFLY_Flyout.setWidth(wpsFLY_minFlyout);
      wpsFLY_Flyout.setLeft(wpsFLY_Flyout.pageWidth() + wpsFLY_browserDimensions.getScrollFromLeft() - wpsFLY_minFlyout);
      wpsFLY_Flyout.go=0;
      wpsFLY_state=1;
   }  
}

// -----------------------------------------------------------------
// The internal slide in function, called my real function, only 
// wpsFLY_moveInFlyoutLeft should call this function. For left sided
// flyout.
// -----------------------------------------------------------------
function wpsFLY_internalMoveInLeft()
{
   if (wpsFLY_isIE) {
      if (wpsFLY_FlyoutLeft.getWidth() - wpsFLY_move >  wpsFLY_minFlyout) {
         var newwidth= wpsFLY_FlyoutLeft.getWidth() - wpsFLY_move;
         wpsFLY_FlyoutLeft.setWidth(newwidth);
         wpsFLY_timeoutID=setTimeout("wpsFLY_internalMoveInLeft()",wpsFLY_scrollSpeed);
         wpsFLY_FlyoutLeft.go=1;
      } else {
         wpsFLY_FlyoutLeft.setWidth(wpsFLY_minFlyout);
         wpsFLY_FlyoutLeft.setLeft( wpsFLY_FlyoutLeft.left());
         wpsFLY_FlyoutLeft.go=0;
         wpsFLY_state=1;
      }
   } else {
      if(wpsFLY_FlyoutLeft.left()>-wpsFLY_FlyoutLeft.width+wpsFLY_minFlyout) {
		   wpsFLY_FlyoutLeft.go=1;
		   wpsFLY_FlyoutLeft.setLeft(wpsFLY_FlyoutLeft.left()-wpsFLY_move);
		   wpsFLY_timeoutID=setTimeout("wpsFLY_internalMoveInLeft()",wpsFLY_scrollSpeed);
	   } else {
         wpsFLY_FlyoutLeft.setLeft( wpsFLY_minFlyout - wpsFLY_FlyoutLeft.getWidth()- 4 );
		   wpsFLY_FlyoutLeft.go=0;
		   wpsFLY_state=1;
      }
	}
}

// -----------------------------------------------------------------
// The internal scroll function.
// -----------------------------------------------------------------
function wpsFLY_internalScroll() {
   if (!wpsFLY_Flyout.go) {

      //wpsFLY_Flyout.css.top=eval(scrolled)+parseInt(wpsFLY_fromTop);
      if (wpsFLY_state==1) {
         wpsFLY_Flyout.setLeft(wpsFLY_browserDimensions.getScrollFromLeft() + wpsFLY_browserDimensions.getViewableAreaWidth() - wpsFLY_minFlyout);
      } else {
         wpsFLY_Flyout.setLeft(wpsFLY_browserDimensions.getScrollFromLeft() + wpsFLY_browserDimensions.getViewableAreaWidth() - wpsFLY_Flyout.width);
      }
   }
   if (wpsFLY_isNetscape||wpsFLY_isMoz)
      setTimeout('wpsFLY_internalScroll()',20);
}

// -----------------------------------------------------------------
// The internal scroll left function.
// -----------------------------------------------------------------
function wpsFLY_internalScrollLeft() {
   if (!wpsFLY_FlyoutLeft.go) {
      //wpsFLY_FlyoutLeft.css.top=eval(scrolled)+parseInt(wpsFLY_fromTop);

      // scroll horizontally for flyoutin 
      if (wpsFLY_state==1) {
         if (wpsFLY_isIE) {
            if (wpsFLY_leftResize == null) {
               wpsFLY_leftResize = wpsFLY_browserDimensions.getScrollFromLeft();
            }
            wpsFLY_FlyoutLeft.setWidth(wpsFLY_minFlyout);
            wpsFLY_FlyoutLeft.css.overflow = 'hidden';
            wpsFLY_FlyoutLeft.setLeft(wpsFLY_browserDimensions.getScrollFromLeft() - wpsFLY_leftResize);
         } else {
            wpsFLY_FlyoutLeft.setLeft(wpsFLY_minFlyout + wpsFLY_browserDimensions.getScrollFromLeft() - wpsFLY_FlyoutLeft.getWidth() - 4);
         }
      }
   }

   if (wpsFLY_isNetscape||wpsFLY_isMoz)
      setTimeout('wpsFLY_internalScrollLeft()',20);

}

// -----------------------------------------------------------------
// The internal resize left function.
// -----------------------------------------------------------------
function wpsFLY_internalResizeLeft(){
      
   if (wpsFLY_isIE) {
      wpsFLY_leftResize = wpsFLY_browserDimensions.getScrollFromLeft(); - wpsFLY_browserDimensions.getViewableAreaWidth();
   }

}

// -----------------------------------------------------------------
// Expand the flyout. The parameter skipSlide indicates whether or not
// the flyout should simply be rendered without the slide-out effect.
// ----------------------------------------------------------------- 
function wpsFLY_moveOutFlyout( skipSlide )
{
   if (this.wpsFLY_Flyout != null)
   {
      if ( wpsFLY_state && !skipSlide ) {
         clearTimeout(wpsFLY_timeoutID);
         wpsFLY_internalMoveOut(); 
      }
      
      if ( wpsFLY_state && skipSlide )
      {
          wpsFLY_Flyout.setLeft(wpsFLY_Flyout.pageWidth() + document.body.scrollLeft - wpsFLY_Flyout.width);
          wpsFLY_Flyout.setWidth(wpsFLY_Flyout.width);
          wpsFLY_Flyout.go=0;
          wpsFLY_state=0;
          document.getElementById('wpsFLYflyout').className = "portalFlyoutExpanded";
      }
      
   }

   if (this.wpsFLY_FlyoutLeft != null)
   {      
      if ( wpsFLY_state && !skipSlide ) {
         clearTimeout(wpsFLY_timeoutID);
         wpsFLY_internalMoveOutLeft(); 
      }
      
      if ( wpsFLY_state && skipSlide )
      {
      	 if ( wpsFLY_isIE )
      	 {
		     wpsFLY_FlyoutLeft.setLeft( wpsFLY_FlyoutLeft.left());
    	     wpsFLY_FlyoutLeft.setWidth(wpsFLY_FlyoutLeft.width);
			 wpsFLY_FlyoutLeft.go=0;
			 wpsFLY_state=0;	
		 }
		 else
		 {
		 	 wpsFLY_FlyoutLeft.setLeft( document.body.scrollLeft);
   		     wpsFLY_FlyoutLeft.go=0;
		     wpsFLY_state=0;
		 }
		 document.getElementById('wpsFLYflyout').className = "portalFlyoutExpanded";
	  }
   }
}

// -----------------------------------------------------------------
// Called to close the flyout. This is the method that the function
// external to the flyout should call.
// ----------------------------------------------------------------- 
function wpsFLY_moveInFlyout()
{
   if (this.wpsFLY_Flyout != null)
   {
      if (!wpsFLY_state) {
         clearTimeout(wpsFLY_timeoutID);
         wpsFLY_internalMoveIn();
      }
   }

   if (this.wpsFLY_FlyoutLeft != null)
   {
      if (!wpsFLY_state) {
         clearTimeout(wpsFLY_timeoutID);
         wpsFLY_internalMoveInLeft();
      }
   }
   
   document.getElementById('wpsFLYflyout').className = "portalFlyoutCollapsed";
}

// -----------------------------------------------------------------
// Called to toggle the flyout. This is the method that the function
// external to the flyout should call.
// -----------------------------------------------------------------
function wpsFLY_toggleFlyout(index, skipSlide)
{
	if(flyOut[index] != null){
	var checkIndex = index;
	var prevIndex=wpsFLY_getCurrIndex();
	
	if(checkIndex==prevIndex){
        
		if(flyOut[index].active==true){
			flyOut[index].active=false;
            /*
			document.getElementById("toolBarIcon"+prevIndex).src = flyOut[prevIndex].icon;	
			document.getElementById("toolBarIcon"+prevIndex).alt = flyOut[prevIndex].altText;
			document.getElementById("toolBarIcon"+prevIndex).title = flyOut[prevIndex].altText;
			*/
		}
		else{
			flyOut[index].active=true;
            /*
			document.getElementById("toolBarIcon"+index).src = flyOut[index].activeIcon;
			document.getElementById("toolBarIcon"+index).alt = flyOut[index].activeAltText;
			document.getElementById("toolBarIcon"+index).title = flyOut[index].activeAltText;
			*/
		}
        //Closing flyout, clear the state cookie.
        wpsFLY_clearStateCookie();
        wpsFLY_moveInFlyout();
	}else{
		if(prevIndex > -1){
			flyOut[prevIndex].active=false;
            /*
			document.getElementById("toolBarIcon"+prevIndex).src = flyOut[prevIndex].icon;	
			document.getElementById("toolBarIcon"+prevIndex).alt = flyOut[prevIndex].altText;
			document.getElementById("toolBarIcon"+prevIndex).title = flyOut[prevIndex].altText;
			*/
		}
		
		flyOut[index].active=true;
        /*
		document.getElementById("toolBarIcon"+index).src = flyOut[index].activeIcon;
		document.getElementById("toolBarIcon"+index).alt = flyOut[index].activeAltText;
		document.getElementById("toolBarIcon"+index).title = flyOut[index].activeAltText;
		*/
		wpsFLY_setCurrIndex(index);
		document.getElementById("wpsFLY_flyoutIFrame").src = flyOut[index].url;
	}
	
	if(wpsFLY_state){
		
        //Expanding flyout, store the open flyout index in the state cookie.
        wpsFLY_setStateCookie( index );
        wpsFLY_moveOutFlyout( skipSlide );
		}
	}
}

function wpsFLY_getCurrIndex()
{
	return wpsFLY_currIndex;
}

function wpsFLY_setCurrIndex(index)
{
	wpsFLY_currIndex = index;
}

// -----------------------------------------------------------------
// Create a cookie to track the state of the flyout. The value of the 
// cookie is the index of the open flyout. The cookie is marked for 
// deletion when the browser closes and the path is set to ensure the 
// cookie is valid for the entire site.
// -----------------------------------------------------------------
function wpsFLY_setStateCookie( index )
{
    document.cookie='portalOpenFlyout=' + index + '; path=/;';
}

// -----------------------------------------------------------------
// Clear the cookie by changing the value to null. By setting the expiration date in 
// the past, the cookie is marked for deletion when the browser closes.
// -----------------------------------------------------------------
function wpsFLY_clearStateCookie()
{
    document.cookie='portalOpenFlyout=null; expires=Wed, 1 Jan 2003 11:11:11 UTC; path=/;';
}

// -----------------------------------------------------------------
// Check which side of the page the flyout should show on
// -----------------------------------------------------------------
function wpsFLY_onloadShow( isRTL )
{
  if (this.wpsFLY_minFlyout != null) {
    var bodyObj = document.getElementById("FLYParent");
    if (bodyObj != null) {
      var showHidden = false;
      if (isRTL) { 
           bodyObj.onload = wpsFLY_initFlyoutLeft(showHidden);
       } else { 
      	   bodyObj.onload = wpsFLY_initFlyout(showHidden);
       } 	 
    }
  }
 }
// -----------------------------------------------------------------
// Write markup out to document for all flyout items
// -----------------------------------------------------------------
function wpsFLY_markupLoop( flyOut)
{	
 	for(arrayIndex = 0; arrayIndex < flyOut.length; arrayIndex++){
		if(flyOut[arrayIndex].url != "" && flyOut[arrayIndex].url != null){
			document.write('<li><a id="globalActionLink'+arrayIndex+'" href="javascript:void(0);" onclick="wpsFLY_toggleFlyout('+arrayIndex+'); return false;" >');
			document.write(flyOut[arrayIndex].altText);
            //document.write('<img src="'+flyOut[arrayIndex].icon+'" id="toolBarIcon'+arrayIndex+'" title="'+flyOut[arrayIndex].altText+'" border="0" alt="'+flyOut[arrayIndex].altText+'" onmouseover="this.src=flyOut['+arrayIndex+'].hoverIcon;" onmouseout="if (flyOut['+arrayIndex+'].active) {this.src=flyOut['+arrayIndex+'].activeIcon;} else this.src=flyOut['+arrayIndex+'].icon;" />');            
			document.write('</a></li>');
		}
		
		if ( javascriptEventController )
		{
			javascriptEventController.register( "globalActionLink" + arrayIndex );
			//javascriptEventController.register( "toolBarIcon" + arrayIndex );
		}
	}
}

// -----------------------------------------------------------------
// If we have an empty expanded flyout (via the back button), load 
// the previously open flyout.
// -----------------------------------------------------------------
function wpsFLY_checkForEmptyExpandedFlyout()
{
	var index = wpsFLY_getInitialFlyoutState();
	
	if ( index != null && flyOut[index] != null)
	{
		document.getElementById("wpsFLY_flyoutIFrame").src = flyOut[index].url;
	}
}

// -----------------------------------------------------------------
// Determine if the flyout should initially open and which flyout 
// should be loaded. 
// -----------------------------------------------------------------
function wpsFLY_getInitialFlyoutState()
{
	// Determine if the flyout's initial state is open or closed.
	if ( document.cookie.indexOf( "portalOpenFlyout=" ) >= 0 )
	{
	    var cookies = document.cookie.split(";");
	
	    var c = 0;
	    while ( c < cookies.length && ( cookies[c].indexOf( "portalOpenFlyout=" ) == -1 ) )
	    {
	        c=c+1;
	    }
	
	    initCookieValue = cookies[c].substring( 18, cookies[c].length );
	    
	    if ( initCookieValue != "null" )
	    {
	        return initCookieValue;
	    }
	    else
	    {
	        return null;
	    }
	}
	else
	{
		return null;
	}
	
}
var wpsInlineShelf_initShelfExpanded = wpsInlineShelf_getInitialShelfState();

// Current state of the flyout for the life of the request (true=expanded, false=collapsed)
var wpsInlineShelf_stateExpanded = false;

var wpsInlineShelf_currIndex = -1;

var wpsInlineShelf_loadingMsg = null;

function wpsInlineShelf_markupLoop( shelves )
{	
 	for(arrayIndex = 0; arrayIndex < shelves.length; arrayIndex++){
		if(shelves[arrayIndex].url != "" && shelves[arrayIndex].url != null){
			document.write('<li><a id="globalActionLinkInlineShelf'+arrayIndex+'" href="javascript:void(0);" onclick="wpsInlineShelf_toggleShelf('+arrayIndex+'); return false;" >');
			document.write(shelves[arrayIndex].altText+" ");
            document.write('<img src="'+shelves[arrayIndex].icon+'" id="toolBarIcon'+arrayIndex+'" title="'+shelves[arrayIndex].altText+'" border="0" alt="'+shelves[arrayIndex].altText+'" onmouseover="this.src=wptheme_InlineShelves['+arrayIndex+'].hoverIcon;" onmouseout="if (wptheme_InlineShelves['+arrayIndex+'].active) {this.src=wptheme_InlineShelves['+arrayIndex+'].activeIcon;} else this.src=wptheme_InlineShelves['+arrayIndex+'].icon;" />');            
			document.write('</a></li>');
		}
		
		if ( javascriptEventController )
		{
			javascriptEventController.register( "globalActionLinkInlineShelf" + arrayIndex );
		}
	}
}

// -----------------------------------------------------------------
// Called to toggle the shelf. This is the method that the function
// external to the shelf should call.
// -----------------------------------------------------------------
function wpsInlineShelf_toggleShelf(index, skipZoom)
{
	if(wptheme_InlineShelves[index] != null) {
    	var checkIndex = index;
    	var prevIndex=wpsInlineShelf_getCurrIndex();
        var newIframeUrl = null;

    	if(checkIndex==prevIndex){
            
    		if(wptheme_InlineShelves[index].active==true){
    			wptheme_InlineShelves[index].active=false;
                /*
    			document.getElementById("globalActionLinkInlineShelf"+prevIndex).src = wptheme_InlineShelves[prevIndex].icon;	
    			document.getElementById("globalActionLinkInlineShelf"+prevIndex).alt = wptheme_InlineShelves[prevIndex].altText;
    			document.getElementById("globalActionLinkInlineShelf"+prevIndex).title = wptheme_InlineShelves[prevIndex].altText;
    			*/
                wpsInlineShelf_stateExpanded = false;
    		}else{
    			wptheme_InlineShelves[index].active=true;
                /*
    			document.getElementById("globalActionLinkInlineShelf"+index).src = wptheme_InlineShelves[index].activeIcon;
    			document.getElementById("globalActionLinkInlineShelf"+index).alt = wptheme_InlineShelves[index].activeAltText;
    			document.getElementById("globalActionLinkInlineShelf"+index).title = wptheme_InlineShelves[index].activeAltText;
    			*/
                wpsInlineShelf_stateExpanded = true;
    		}
    	}else{
    		if(prevIndex > -1){
    			wptheme_InlineShelves[prevIndex].active=false;
                /*
    			document.getElementById("globalActionLinkInlineShelf"+prevIndex).src = wptheme_InlineShelves[prevIndex].icon;	
    			document.getElementById("globalActionLinkInlineShelf"+prevIndex).alt = wptheme_InlineShelves[prevIndex].altText;
    			document.getElementById("globalActionLinkInlineShelf"+prevIndex).title = wptheme_InlineShelves[prevIndex].altText;
    			*/
    		}
    		
    		wptheme_InlineShelves[index].active=true;
            /*
    		document.getElementById("globalActionLinkInlineShelf"+index).src = wptheme_InlineShelves[index].activeIcon;
    		document.getElementById("globalActionLinkInlineShelf"+index).alt = wptheme_InlineShelves[index].activeAltText;
    		document.getElementById("globalActionLinkInlineShelf"+index).title = wptheme_InlineShelves[index].activeAltText;
    		*/
    		wpsInlineShelf_setCurrIndex(index);
            wpsInlineShelf_stateExpanded = true;

            newIframeUrl = wptheme_InlineShelves[index].url;
//    		document.getElementById("wpsInlineShelf_shelfIFrame").src = wptheme_InlineShelves[index].url;
    	}
    	
    	if(wpsInlineShelf_stateExpanded){
            //Expanding flyout, store the open shelf index in the state cookie.
            wpsInlineShelf_setStateCookie( index );
            wpsInlineShelf_expandShelf( skipZoom, newIframeUrl );
		} else {
            //Closing shelf, clear the state cookie.
            wpsInlineShelf_clearStateCookie();
            wpsInlineShelf_collapseShelf();
        }
	}
}


function wpsInlineShelf_getCurrIndex()
{
	return wpsInlineShelf_currIndex;
}

function wpsInlineShelf_setCurrIndex(index)
{
	wpsInlineShelf_currIndex = index;
}

// -----------------------------------------------------------------
// Create a cookie to track the state of the shelf. The value of the 
// cookie is the index of the open shelf. The cookie is marked for 
// deletion when the browser closes and the path is set to ensure the 
// cookie is valid for the entire site.
// -----------------------------------------------------------------
function wpsInlineShelf_setStateCookie( index )
{
    document.cookie='portalOpenInlineShelf=' + index + '; path=/;';
}

// -----------------------------------------------------------------
// Clear the cookie by changing the value to null. By setting the expiration date in 
// the past, the cookie is marked for deletion when the browser closes.
// -----------------------------------------------------------------
function wpsInlineShelf_clearStateCookie()
{
    document.cookie='portalOpenInlineShelf=null; expires=Wed, 1 Jan 2003 11:11:11 UTC; path=/;';
}

// -----------------------------------------------------------------
// Determine if the shelf should initially open and which shelf 
// should be loaded. 
// -----------------------------------------------------------------
function wpsInlineShelf_getInitialShelfState()
{
	// Determine if the shelf's initial state is expanded or collapsed.
	if ( document.cookie.indexOf( "portalOpenInlineShelf=" ) >= 0 )
	{
	    var cookies = document.cookie.split(";");
	
	    var c = 0;
	    while ( c < cookies.length && ( cookies[c].indexOf( "portalOpenInlineShelf=" ) == -1 ) )
	    {
	        c=c+1;
	    }
	
	    initCookieValue = cookies[c].substring( ("portalOpenInlineShelf=".length)+1, cookies[c].length );
	    
	    if ( initCookieValue != "null" )
	    {
	        return initCookieValue;
	    }
	    else
	    {
	        return null;
	    }
	}
	else
	{
		return null;
	}
	
}


// -----------------------------------------------------------------
// Expand the shelf. The parameter skipZoom indicates whether or not
// the shelf should simply be rendered without the zoom-out effect.
// NOTE: The zoom-out effect is not implemented yet.
// ----------------------------------------------------------------- 
function wpsInlineShelf_expandShelf( skipZoom, newIframeUrl )
{
    var shelf = document.getElementById("wpsInlineShelf");
    
    wpsInlineShelf_stateExpanded = false;

    // attach event listeners so when the URL loads or reloads, the iframe will be shown and resized.
    wpsInlineShelf_AttachIframeEventListeners("wpsInlineShelf_shelfIFrame");

    // show the shelf... but not the iframe yet...
    shelf.style.display = "block";

    // We change the URL AFTER the event listeners are hooked up.
    // If we are not changing the URL, we need to manually resize the iframe.
    if (null != newIframeUrl) {
        // when loading a new URL, display the spinning loading graphic
        wpsInlineShelf_loadingMsg.show(document.getElementById("wpsInlineShelf"));
        document.getElementById("wpsInlineShelf_shelfIFrame").src = newIframeUrl;
    } else {
        wpsInlineShelf_resizeIframe("wpsInlineShelf_shelfIFrame");
    }

}


// -----------------------------------------------------------------
// Collapse the shelf. The parameter skipZoom indicates whether or not
// the shelf should simply be rendered without the zoom-in effect.
// NOTE: The zoom-in effect is not implemented yet yet.
// ----------------------------------------------------------------- 
function wpsInlineShelf_collapseShelf( skipZoom )
{
    var shelf = document.getElementById("wpsInlineShelf");
    var iframe = document.getElementById("wpsInlineShelf_shelfIFrame");

    shelf.style.display = "none";
    iframe.style.display = "none";
    wpsInlineShelf_loadingMsg.hide();
    wpsInlineShelf_stateExpanded = true;
}

// -----------------------------------------------------------------
// Check which side of the page the shelf should show on
// -----------------------------------------------------------------
function wpsInlineShelf_onloadShow( isRTL )
{
    if ( wpsInlineShelf_initShelfExpanded != null )
    {
        wpsInlineShelf_toggleShelf( wpsInlineShelf_initShelfExpanded, true );
    }   
}


var wpsInlineShelf_getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var wpsInlineShelf_FFextraHeight=parseFloat(wpsInlineShelf_getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function wpsInlineShelf_resizeIframe(iframeID){
    var iframe=document.getElementById(iframeID)

    iframe.style.display = "block";
    wpsInlineShelf_loadingMsg.hide();

    if (iframe && !window.opera) {

/*
		// put the background color style onto the body of the document in the iframe
		if (iframe.contentDocument) {
			var iframeDocBody = iframe.contentDocument.body;
			if (iframeDocBody.className.indexOf("wpsInlineShelfIframeDocBody",0) == -1) {
				iframeDocBody.className = iframeDocBody.className + " wpsInlineShelfIframeDocBody";
			}
		}
*/
        if (iframe.contentDocument && iframe.contentDocument.body.offsetHeight) //ns6 syntax
            iframe.height = iframe.contentDocument.body.offsetHeight+wpsInlineShelf_FFextraHeight;
        else if (iframe.Document && iframe.Document.body.scrollHeight) //ie5+ syntax
            iframe.height = iframe.Document.body.scrollHeight;
    }
}

function wpsInlineShelf_AttachIframeEventListeners(iframeID) {
    var iframe=document.getElementById(iframeID)
    if (iframe && !window.opera) {

        if (iframe.addEventListener){
            iframe.addEventListener("load", wpsInlineShelf_IframeOnloadEventListener, false)
        } else if (iframe.attachEvent){
            iframe.detachEvent("onload", wpsInlineShelf_IframeOnloadEventListener) // Bug fix line
            iframe.attachEvent("onload", wpsInlineShelf_IframeOnloadEventListener)
        }
    }
}

function wpsInlineShelf_IframeOnloadEventListener(loadevt) {
    var crossevt=(window.event)? event : loadevt
    var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
    if (iframeroot) {
        wpsInlineShelf_resizeIframe(iframeroot.id);
    }
}

// -----------------------------------------------------------------
// If we have an empty expanded shelf (via the back button), load 
// the previously open shelf.
// -----------------------------------------------------------------
function wpsInlineShelf_checkForEmptyExpandedShelf() {
	var index = wpsInlineShelf_getInitialShelfState();
    
	if ( index != null && wptheme_InlineShelves[index] != null)
	{
		document.getElementById("wpsInlineShelf_shelfIFrame").src = wptheme_InlineShelves[index].url;
	}
}

wptheme_QuickLinksShelf = {
	_cookieUtils: wptheme_CookieUtils,
	cookieName: null,
	expand: function () {
		// summary: Expand the quick links shelf.
		document.getElementById("wptheme-expandedQuickLinksShelf").style.display='block';
        document.getElementById("wptheme-collapsedQuickLinksShelf").style.display='none';
        if ( this.cookieName != null ) {
        	this._cookieUtils.deleteCookie( this.cookieName );
        }	
        return false;
	},
	collapse: function () {
		// summary: Collapse the quick links shelf.
		document.getElementById("wptheme-expandedQuickLinksShelf").style.display='none';
        document.getElementById("wptheme-collapsedQuickLinksShelf").style.display='block';
        if ( this.cookieName != null ) {
        	var expires = new Date();
        	expires.setDate( expires.getDate() + 5 );
        	this._cookieUtils.setCookie( this.cookieName, "small", expires );
        }
        return false;
	}
}

var wpsInlineShelf_LoadingImage = function ( /*String*/cssClassName, /*String*/imageURL, /*String*/imageText ) {
    // summary: creates loading image for inline shelf
    // cssClassName: the class name to apply to the overlaid div
    // imageURL: the url to the image to display in the center of the overlaid div
    // imageText: the text to display next to the image    

    var elem = document.createElement( "DIV" );
    elem.className = cssClassName;
    elem.id = cssClassName;

    if ( imageURL && imageURL != "" && imageText ) {
        elem.innerHTML = "<img src='"+ imageURL + "' border=\"0\" alt=\"\" />&nbsp;" + imageText;
    }   
    
    var appended = false;
    
    this.show = function ( refNode ) { 
        if ( !appended ) {
            refNode.appendChild( elem );
            appended= true;
        }
        
        elem.style.display = 'block';
    }

    this.hide = function () {
        elem.style.display = 'none';
    }
}

/*        
        
        //Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
        var iframehide="yes"

        var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
        var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

        function resizeCaller() {
                if (document.getElementById)
                        resizeIframe("myiframe")

                //reveal iframe for lower end browsers? (see var above):
                if ((document.all || document.getElementById) && iframehide=="no"){
                        var tempobj=document.all? document.all["myiframe"] : document.getElementById("myiframe")
                        tempobj.style.display="block"
                }
        }
        function resizeIframe(frameid){
                var currentfr=document.getElementById(frameid)
                if (currentfr && !window.opera) {
                        currentfr.style.display="block"
                        if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
                                currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
                        else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
                                currentfr.height = currentfr.Document.body.scrollHeight;

                        if (currentfr.addEventListener){
                                currentfr.addEventListener("load", readjustIframe, false)
                        }
                        else if (currentfr.attachEvent){
                currentfr.detachEvent("onload", readjustIframe) // Bug fix line
                currentfr.attachEvent("onload", readjustIframe)
            }
                }
        }

        function readjustIframe(loadevt) {
                var crossevt=(window.event)? event : loadevt
                var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
                if (iframeroot)
                resizeIframe(iframeroot.id);
        }

        function wptheme_ExpandToolsShelf() {
		//loadToolsIframe('myiframe', '${inlineTCUrl}');
                document.getElementById("wptheme-expandedToolsShelf").style.display='block';
	        document.getElementById("wptheme-collapsedToolsShelf").style.display='none';
		//document.getElementById("wptheme-expandedToolsShelfLink").style.display='block';
		//document.getElementById("wptheme-collapsedToolsShelfLink").style.display='none';
		document.getElementById("toolsShelfCollapseLink").style.display='block';
		document.getElementById("toolsShelfExpandLink").style.display='none';
		loadToolsIframe('myiframe', '${inlineTCUrl}');
                //if (document.getElementById)
                //      resizeIframe("myiframe");
                resizeCaller();
                wptheme_createCookie("<%=toolsShelfCookie%>",'small',7);
        return false;
    }

        function wptheme_CollapseToolsShelf() {
                document.getElementById("wptheme-expandedToolsShelf").style.display='none';
        	document.getElementById("wptheme-collapsedToolsShelf").style.display='block';
		//document.getElementById("wptheme-expandedToolsShelfLink").style.display='none';
                //document.getElementById("wptheme-collapsedToolsShelfLink").style.display='block';
		document.getElementById("toolsShelfCollapseLink").style.display='none';
                document.getElementById("toolsShelfExpandLink").style.display='block';
                wptheme_eraseCookie("<%=toolsShelfCookie%>");
        return false;
    }
	function loadToolsIframe(iframeName, toolsUrl){
		alert('loading tools iframe');
		if (document.getElementById) {
			document.getElementById(iframeName).src = toolsUrl;
		}
		return false;
    }
    
*/    
var wptheme_InlinePalettes = {
    // summary: Manages the inline palette(s). Tracks the iframe used to display the palettes, as well as the persistent state.
    // description: Palettes managed by this object must be added using the addPalette method. The addPalette method expects a
    //      PaletteContext object which has the following structure:
    //      {
    //          url: the url to set the iframe to (for CSA, only used as the initial url)
    //          page: the unique id of the page the url will be pointing to
    //          portlet: the unique id of the portlet control the url will be pointing to
    //          newWindow: indicates whether or not the url should be rendered using the Plain theme template
    //          portletWindowState: the window state the portlet should be in
    //          selectionDependent: indicates whether or not the url changes based on the current page selection
    //      }
    //      This PaletteContext object is required to support client-side aggregation. Since, in client-side aggregation,
    //      the page does not always reload in between page changes, the palette may need to be refreshed as the selection
    //      changes in client-side aggregation. This context object gives the client-side aggregation engine all the info
    //      it needs to create the appropriate url for the palette, as needed.
    // paletteStatus: indicates whether the palette is open or closed (0 = closed, 1 = open)
    // iframeID: the ID/NAME of the iframe to use
    // loadingDecorator: the decoration to display while the iframe is loading
    // currentIndex: the index (into the paletteContextArray) of the currently displaying palette
    // cookieName: the cookie used to store the state of the palette
    // paletteContextArray: the array of PaletteContext objects
    // urlFactory: only used in client-side aggregation -- set during the CSA theme's bootstrap, this function takes the PaletteContext
    //      object described above as the only parameter and returns the url to use to display the palette
    
    // INITIALIZATION
    className: "wptheme_InlinePalettes",

    //HTML element IDs
    iframeID: "wpsFLY_flyoutIFrame",    
    
    //Persistent state of the palette
    paletteStatus: 0,  // 0 = closed, 1 = open
    currentIndex: -1,   // the index of the paletteContextArray which is currently displaying
    cookieName: "portalOpenFlyout", 
    
    //Decoration to display while the palette is loading
    loadingDecorator: null, //needs to provide 2 functions: show and hide. show will receive a single parameter -- the node which should be covered with the decoration
    
    //Instance variables
    urlFactory: null,   //expected to be set in the bootstrap of the CSA theme. takes the context as a single parameter and returns the url as the output.
    paletteContextArray: [],    // Array of palettes which can be displayed
    
    //Debug
    debug: wptheme_DebugUtils,
    
    init: function ( /*Document?*/doc) {
        // summary: Initializes the inline palettes. Usually executed on page load.
        // description: Checks to see if the persisted state indicates the palette should be open or closed. If open, the proper location
        //      should be loaded into the iframe and displayed.
        // doc: OPTIONAL -- specifies the document to use when initializing (for use when called from within an iframe, for example).
        if ( this.debug.enabled ) { this.debug.log( this.className, "init( " + [ doc ] + ")" ); }
        
        if ( !doc ) { doc = document; }
        
        //Retrieve the persisted value. This will be the index into the PaletteContextArray.
        var value = this.getPersistedValue();
        if ( this.debug.enabled ) { this.debug.log( this.className, "retrieved value: " + value ); }
        if ( value != null && this.paletteContextArray[ value ] ) {
            this.show( value, true );
        } else {
            this.hide();
        }
        
        if ( this.debug.enabled ) { this.debug.log( this.className, "return init" ); }
    },
    
    // DISPLAY CONTROL 
    
    showCurrent: function () {
        // summary: Displays the current index or auto selects an index if no current index is selected.
        var indexToShow = 0;
        if ( this.currentIndex > -1 ) {
            indexToShow = this.currentIndex;
        }
        
        this.show( indexToShow );
    },
    
    show: function (/*int*/index, /*boolean?*/skipAnimation) {
        // summary: Displays the specified url in the palette.
        // url: the url for the iframe.
        // skipAnimation: OPTIONAL -- skips the loading decorator show/hide steps (used for the case where the palette is open on an initial page load
        if ( this.debug.enabled ) { this.debug.log( this.className, "show( " + [ index, skipAnimation ] + ")" ); }
        
        var iframe = this._getIframeElement();
        if ( !iframe ) { return false; }
        
        var url = this.getURL( index );
        
        iframe.parentNode.style.display = "block";
        //If we have to load the iframe, call postShow onload. Otherwise, call it immediately since the
        //iframe is already loaded.
        if ( window.frames[this.iframeID].location.href != url ) {
            if ( !skipAnimation && this.loadingDecorator != null && this.loadingDecorator.show ) {
                this.loadingDecorator.show( iframe.parentNode.parentNode );
            }
            iframe.src = url;
        }
        else {
            //The location hasn't changed so go ahead and call the post show behavior. Normally, the post show 
            //behavior executes once the iframe is loaded. 
            this._doPostShow();
        }
        
        this.persist( index );
        this.paletteStatus = 1;
        this.currentIndex = index;
    },
    hide: function ( doc ) {
        // summary: Hides the active palette.
        if ( this.debug.enabled ) { this.debug.log( this.className, "hide( " + [ doc ] + ")" ); }
        var iframe = this._getIframeElement( doc );
        if ( !iframe ) { return false; }
        
        iframe.parentNode.style.display = "none";
        this.paletteStatus = 0;
        this.currentIndex = -1;
        
        //Execute the post hide behavior.
        this._doPostHide();
    },
    _doPostShow: function () {
        // summary: Called after the iframe is loaded and ready to display.
        // description: Performs any sizing adjustments necessary (possibly IE) and hides the loading decoration.
        if ( this.debug.enabled ) { this.debug.log( this.className, "_doPostShow()" ); }
        var iframe = this._getIframeElement();
        if ( iframe.parentNode.style.display == "none" ) { return false; }
        iframe.style.visibility = "visible";
        
        if ( typeof ( dojo ) != "undefined" ) {
            var size = dojo.contentBox( iframe );
            if ( size.h < 300) {
                //IE doesn't correctly size the iframe when height is set to 100%. So if the height
                //is still 0 (IE 6) or small (IE7)after setting the display and visibility, set it manually to the height
                //of the TD element.
                var size = dojo.contentBox( iframe.parentNode.parentNode );
                iframe.style.height = size.h + "px";
            }
        }   
        
        if ( this.loadingDecorator != null && this.loadingDecorator.hide ) {
            this.loadingDecorator.hide();
        }
    },
    _doPostHide: function () {
        // summary: Execute any actions that need to occur after the palette is hidden from view.
        if ( this.debug.enabled ) { this.debug.log( this.className, "_doPostHide()" ); }
        var iframe = this._getIframeElement();
        iframe.style.visibility = "hidden";
    },
    
    // PERSISTENT STATE CONTROL
    
    persist: function ( /*String*/value ) {
        // summary: Persist the given value in a cookie.
        if ( this.debug.enabled ) { this.debug.log( this.className, "persist(" + [ value ] + ")" ); }
        wptheme_CookieUtils.setCookie( this.cookieName, value );
    },
    getPersistedValue: function () {
        // summary: Retrieve the persisted state for the inline palettes, if one exists.
        // description: Looks for the "portalOpenFlyout" cookie and parses out it's value.
        // returns: the persisted value for the portalOpenFlyout cookie or NULL if no value exists.
        if ( this.debug.enabled ) { this.debug.log( this.className, "getPersistedValue()" ); }
        return wptheme_CookieUtils.getCookie( this.cookieName );
    },
    unpersist: function () {
        // summary: Clears out the persisted value.
        // description: Sets the cookie's value to NULL and sets it to expire in the past.
        // returns: the index of the persisted value
        if ( this.debug.enabled ) { this.debug.log( this.className, "unpersist()" ); }
        var value = this.getPersistedValue();
        wptheme_CookieUtils.deleteCookie( this.cookieName );
        return value;
    },
    
    // UTILITY
    
    _getIframeElement: function ( /*Document?*/doc ) {
        // summary: Retrieves the iframe HTML element from the HTML document specified. If no HTML document is specified,
        //      the global HTML document is used.
        // doc: OPTIONAL -- specify the HTML document in which to look up the IFRAME object.
        // returns: the iframe HTML element
        if ( this.debug.enabled ) { this.debug.log( this.className,  "_getIframeElement( " + [ doc ] + ")" ); }
        if ( !doc ) { doc = document; }
        return doc.getElementById( this.iframeID );     // the IFRAME HTML element
    },
    addPalette: function ( /*PaletteContext*/context ) {
        if ( this.debug.enabled ){ this.debug.log( this.className, "addPalette( " + [ context ] + ")" ); }
        this.paletteContextArray.push( context );
    },
    
    getURL: function ( /*int*/value ) {
        if ( this.debug.enabled ) { this.debug.log( this.className, "getURL( " + [ value ] + ")" ); }
        var url = this.paletteContextArray[ value ].url;
        if ( document.isCSA && this.urlFactory != null ) {
            url = this.urlFactory( this.paletteContextArray[ value ] );
        }
        return url;
    }
    
    
}

var wptheme_DarkTransparentLoadingDecorator = function ( /*String*/cssClassName, /*String*/imageURL, /*String*/imageText ) {
    // summary: Displays a partially opaque overlay with a centered image and text to partially obscure and prevent
    //      interaction with a loading portion of the HTML page.
    // cssClassName: the class name to apply to the overlaid div
    // imageURL: the url to the image to display in the center of the overlaid div
    // imageText: the text to display next to the image
    this.className = "wptheme_DarkTransparentLoadingDecorator";
    
    var elem = document.createElement( "DIV" );
    elem.className = cssClassName;
    elem.style.position = "absolute";
    
    if ( imageURL && imageURL != "" && imageText ) {
        var text = document.createElement( "DIV" );
        text.style.position = "relative";
        text.style.top = "50%";
        text.style.left = "40%";
        text.innerHTML = "<img src='"+ imageURL + "' />&nbsp;" + imageText;
        elem.appendChild( text );
    }   
    
    var appended = false;
    
    this.show = function ( refNode ) { 
        if ( !appended ) {
            document.body.appendChild( elem );
            appended= true;
        }
        
        elem.style.display = 'block';
        elem.style.top = (dojo.coords( refNode, true ).y + 1) + "px";
        elem.style.left = (dojo.coords( refNode, true ).x + 1)  + "px";
      
        var size = dojo.contentBox( refNode );
        elem.style.height = (size.h - 2) + "px";
        elem.style.width = (size.w - 2) + "px";
    }

    this.hide = function () {
        elem.style.display = 'none';
    }
}

var wptheme_InlinePalettesContainer = { 
    // summary: Manages the inline palettes container.
    // description: Manages the container which holds the palettes. Made up of two parts: the first is the container.
    //      The container holds the links to select a palette, as well as, the actual iframe which displays
    //      the palette once a palette is selected. The second is the toggle element. The toggle element is
    //      the html element which actually opens and closes the container element.
    // containerStatus: indicates whether the container is open or closed (0 = closed, 1 = open)
    // openCssClassName: indicates the CSS class name which should be applied when the container is open
    // closedCssClassName: indicates the CSS class name which should be applied when the container is closed
    // containerElementID: the id of the html element which actually holds the palettes
    // toggleElementID: the id of the html element which is the toggle element
    // lastIndex: the index of the last palette that was opened
    // cookieName: the name of the cookie used to store the container's last state
    // cookieUtils: the utility object used to set and unset cookies - default is wptheme_CookieUtils
    // htmlUtils: the utility object used for adding/removing css classnames - default is wptheme_HTMLElementUtils
    // paletteManager: the object which contains the information about the palettes to display inside the container
    //      default is wptheme_InlinePalettes
    className: "wptheme_InlinePalettesContainer",
    
    containerStatus: 0,     //0 = closed, 1 = open
    openCssClassName: "wptheme-flyoutExpanded",
    closedCssClassName: "wptheme-flyoutCollapsed",
    toggleElementID: "wptheme-flyoutToggle",
    containerElementID: "wptheme-flyout",
    lastIndex: null,
    cookieName: "portalFlyoutIsOpen",
    cookieUtils: wptheme_CookieUtils,
    htmlUtils: wptheme_HTMLElementUtils,
    paletteManager: wptheme_InlinePalettes,
    
    //Main functions.
    init: function ( /*HTMLDocument?*/doc ) {
        // summary: Initializes and sets the appropriate visibilites for the container and the
        //      palettes inside.
        // doc: OPTIONAL -- used when called from an iframe
        var cookie = this.cookieUtils.getCookie( this.cookieName );
        if ( cookie && cookie != "null" ) {
            this.containerStatus = parseInt( cookie );
        }
        
        if ( this.paletteManager.paletteContextArray.length == 0 ) {
            this.disable();
        }
        else {
            if ( this.containerStatus ) {
                this.paletteManager.init();
                this._show();
            }
            else {
                this._hide();
            }
            this._makeVisible();
        }
    },
    toggle: function () {
        // summary: Toggles the container between open and closed state.
        
        if ( this.containerStatus ) {
            this.containerStatus = 0;
            this._hide();           
        }   
        else {
            this.containerStatus = 1;
            this._show();
        }
    },
    persist: function () {
        // summary: Sets the cookie with the current container status.
        this.cookieUtils.setCookie( this.cookieName, this.containerStatus );
        if ( this.paletteManager.currentIndex == this.lastIndex ) {
            this.paletteManager.persist( this.lastIndex );
        }
    },
    unpersist: function () {
        // summary: Removes the cookie which holds the state of the flyout.
        this.cookieUtils.deleteCookie( this.cookieName );
        this.lastIndex = this.paletteManager.unpersist();
    },
    _makeVisible: function () {
        // summary: Shows the toggle element AND the container element.
        //Retrieve the applicable DOM elements.
        var toggleElement = document.getElementById( this.toggleElementID );
        toggleElement.style.visibility = 'visible';
    },
    disable: function () {
        // summary: Hides the toggle element AND the container element.
        //Retrieve the applicable DOM elements.
        var toggleElement = document.getElementById( this.toggleElementID );
        var containerElement = document.getElementById( this.containerElementID );
        

        if (toggleElement != null) {
            toggleElement.style.display = 'none';
        }
        if (containerElement != null) {
            containerElement.style.display = 'none';
        }
    },
    _hide: function () {
        //Retrieve the applicable DOM elements.
        var toggleElement = document.getElementById( this.toggleElementID );
        var containerElement = document.getElementById( this.containerElementID );
        
        if ( !toggleElement || !containerElement ) {
            throw Error( "Unable to retrieve the necessary markup elements! The palettes may not function correctly.");
        }
        
        //Closing the container.
        this.htmlUtils.removeClassName( toggleElement, this.openCssClassName );
        this.htmlUtils.addClassName( toggleElement, this.closedCssClassName );
        containerElement.style.display = 'none';
        
        //Persistence cleanup.
        this.unpersist();       
    },
    _show: function () {
        //Retrieve the applicable DOM elements.
        var toggleElement = document.getElementById( this.toggleElementID );
        var containerElement = document.getElementById( this.containerElementID );
        
        if ( !toggleElement || !containerElement ) {
            throw Error( "Unable to retrieve the necessary markup elements! The palettes may not function correctly.");
        }
        
        //Opening the container.
        this.htmlUtils.removeClassName( toggleElement, this.closedCssClassName );
        this.htmlUtils.addClassName( toggleElement, this.openCssClassName );
        containerElement.style.display = 'block';
        
        this.paletteManager.showCurrent();
        
        //Persistence cleanup.
        this.persist();
    }
}
//If we aren't inside an iframe, go ahead and register the init function so it's called on page load. This is where we check for 
//a palette's persistent state and handle other startup tasks.
if ( top.location == self.location ) {
    wptheme_InlinePalettesContainer.htmlUtils.addOnload( function () { wptheme_InlinePalettesContainer.init(); } );
};
//Shows an IFRAME inside a lightbox which blocks access to the page.
var wptheme_IFrameLightbox = function ( /*String*/disabledBackgroundClassname, /*String*/borderBoxClassname, /*String*/closeLinkClassname, /*String*/closeString ) {
	// summary: Creates a "lightbox" effect where a partially opaque div is set to cover the entire viewable area of the browser and the content
	//		is displayed in an iframe in approximately the middle of the viewable area.
	// description: Creates a div the size of the viewable area of the browser which is styled using the given "disabledBackgroundClassname". The iframe is
	//		displayed inside another div which is approximately centered and styled according to the given "borderBoxClassname". The content of the iframe is
	//		set using the "setURL" function. The "lightbox" is closed via a text anchor link which is positioned above the top right edge of the border box. The
	//		text displayed is controlled using the "closeString" parameter and the link is styled according to the "closeLinkClassname".
	// disabledBackgroundClassname: the CSS class name to apply to the background div displayed when the lightbox is showing
	// borderBoxClassname: the CSS class name to apply to the border box in the center of the page
	// closeString: the string which will be displayed as the link to close the lightbox
	this.className = "wptheme_IFrameLightbox";
	
	//Declare this here so that any dependency error (e.g. wptheme_HTMLElementUtils not yet being defined)
	//is clear from the beginning (throws an error at construction time instead of runtime). Also, allows
	//for easy substitution of alternate implementations (as long as function names & signatures are the same).
	this._htmlUtils = wptheme_HTMLElementUtils;
	this._debugUtils = wptheme_DebugUtils;
	
	this._initialized = false;
	this.showing = false;
	
	var uniquePrefix = this._htmlUtils.getUniqueId();
	this._backgroundDivId = uniquePrefix + "_lightboxPageBackgroundDiv";
	this._borderDivId = uniquePrefix + "_lightboxBorderDiv";
	this._closeLinkId = uniquePrefix + "_lightboxCloseLink";
	this._iframeId = uniquePrefix + "_lightboxIframe";
	
	// ****************************************************************
	// * Dynamically created DOM elements. 
	// ****************************************************************

	function createDiv(idStr, className, parent ) {
		// summary: Creates a div with the given ID, class, and appends to the given parent node. The display property is set to none by default.
		var div = document.createElement( "DIV" ); 
		div.id = idStr;
		div.className = className;
		div.style.display = "none";
		parent.appendChild( div );
		return div;
	}
	var me = this;
	function createLink(idStr, className, text, parent) {
		// summary: Creates a link with the given ID, class, textContent, and appends it to the given parent node. The display property is set to none
		//		by default. The onclick is set to hide the lightbox.
		var a = document.createElement( "A" );
		a.id = idStr;
		a.className = className;
		a.href = "javascript:void(0);";
		a.onclick = function () { me.hide() };
		a.style.display = "none";
		a.appendChild( document.createTextNode( text ) );
		parent.appendChild( a );
		return a;
	}
	
	function createIFrame( idStr, parent ) {
		// summary: Creates an iframe with the given ID (also used for the name) and appends it to the given parent node.
		var iframe = document.createElement( "IFRAME" );
		iframe.name = idStr;
		iframe.id = idStr;
		//iframe.style.display = "none";
		parent.appendChild( iframe );
		return iframe;
	}
	
	// ****************************************************************
	// * Initialization.
	// ****************************************************************
	
	this._init = function () {
		this._initialized = true;
		//Create the background div.
		createDiv( this._backgroundDivId, disabledBackgroundClassname, document.body );
		//Create the border box div
		createIFrame( this._iframeId, createDiv( this._borderDivId, borderBoxClassname, document.body ));
		//Create the close link.
		createLink( this._closeLinkId, closeLinkClassname, closeString, document.body );
	}
	
	// ****************************************************************
	// * Handling the browser scrolling and resizing dynamically.
	// ****************************************************************

	//Make sure to call any existing onscroll handler.
	var oldScrollFunc = window.onscroll;
	window.onscroll = function (e) {
		if ( me.showing ) {
			me.sizeAndPositionBorderBox();
			//me.sizeBackgroundDisablingDiv();
		}
		
		if ( oldScrollFunc ) {
			if (e) {
				oldScrollFunc(e);
			}
			else  {
				oldScrollFunc();
			}
		}
	}
	
	//Make sure to call any existing onresize handler.
	var oldResizeFunc = window.onresize;
	window.onresize = function (e) {
		if ( me.showing ) {
			me.sizeAndPositionBorderBox();
			me.sizeBackgroundDisablingDiv();
		}
		
		if ( oldResizeFunc ) {
			if (e) {
				oldResizeFunc(e);
			}
			else  {
				oldResizeFunc();
			}
		}
	}

	// ****************************************************************
	// * Main functions for use in the theme.
	// ****************************************************************
	
	this.setURL = function ( /*String*/url ) {
		// summary: Sets the URL displayed by the IFRAME in the lightbox.
		// url: the url to the resource to display
		window.frames[this._iframeId].location = url;
	}
	
	
	
	this.show = function ( /*String?*/url ) {
		// summary: Shows the lightbox above the disabled background div. 
		// url: OPTIONAL -- the url to display in the iframe in the center of the screen 
		if ( !this._initialized ) {
			this._init();
		}
		
		this.showing = true;
		
		this.disableBackground();
		this.showBorderBox();
		if ( url ) { 
			this.setURL( url );
		}		
	}
	
	this.hide = function() {
		// summary: Hides the lightbox and the disabled background div.
		if ( !this._initialized ) {
			this._init();
		}
		
		this.showing = false;
		
		this.enableBackground();
		this.hideBorderBox();
	}
	
	// ****************************************************************
	// * Content border box 
	// ****************************************************************
	this.showBorderBox = function () {
		// summary: Shows and positions the border box which contains the IFRAME.
		var div = document.getElementById( this._borderDivId );
		div.style.display = "block";
		var link = document.getElementById( this._closeLinkId );
		link.style.display = "block";
		
		this.sizeAndPositionBorderBox();
	}
	
	this.sizeAndPositionBorderBox = function () {
		// summary: Sizes and positions the border box which contains the IFRAME.
		var div = document.getElementById( this._borderDivId );
		this._htmlUtils.sizeRelativeToViewableArea( div, 0.60, 0.75 );
		this._htmlUtils.positionRelativeToViewableArea( div, 0.20, 0.12 );
		var link = document.getElementById( this._closeLinkId );
		this._htmlUtils.positionOutsideElementTopRight( link, div );
	}
	
	this.hideBorderBox = function () {
		// summary: hides the border box and IFRAME.
		document.getElementById( this._borderDivId ).style.display = "none";
		document.getElementById( this._closeLinkId ).style.display = "none";
	}
	
	// **************************************************************** 
	// * Transparent background controls
	// ****************************************************************
	this.disableBackground = function () {
		// summary: Disables the background by laying a transparent div over top of the document body.
		var div = document.getElementById( this._backgroundDivId );
		div.style.display = "block";
		this.sizeBackgroundDisablingDiv();
		this._htmlUtils.hideElementsByTagName( "select" );
	}
	
	this.sizeBackgroundDisablingDiv = function () {
		// summary: Sizes the transparent div appropriately.
		var div = document.getElementById( this._backgroundDivId );
		//dynamically size the div to the inner browser window
		this._htmlUtils.sizeToEntireArea( div );
	}
	
	this.enableBackground=function () {
		// summary: Enables the background by hiding the overlaid div.
		this._htmlUtils.showElementsByTagName( "select" );
		document.getElementById( this._backgroundDivId ).style.display = "none";
	}
};
/*
	Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/

/*
	This is a compiled version of Dojo, built for deployment and not for
	development. To get an editable version, please visit:

		http://dojotoolkit.org

	for documentation and information on getting the source.
*/

(function(){var _1=null;if((_1||(typeof djConfig!="undefined"&&djConfig.scopeMap))&&(typeof window!="undefined")){var _2="",_3="",_4="",_5={},_6={};_1=_1||djConfig.scopeMap;for(var i=0;i<_1.length;i++){var _7=_1[i];_2+="var "+_7[0]+" = {}; "+_7[1]+" = "+_7[0]+";"+_7[1]+"._scopeName = '"+_7[1]+"';";_3+=(i==0?"":",")+_7[0];_4+=(i==0?"":",")+_7[1];_5[_7[0]]=_7[1];_6[_7[1]]=_7[0];}eval(_2+"dojo._scopeArgs = ["+_4+"];");dojo._scopePrefixArgs=_3;dojo._scopePrefix="(function("+_3+"){";dojo._scopeSuffix="})("+_4+")";dojo._scopeMap=_5;dojo._scopeMapRev=_6;}(function(){if(typeof this["loadFirebugConsole"]=="function"){this["loadFirebugConsole"]();}else{this.console=this.console||{};var cn=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"];var i=0,tn;while((tn=cn[i++])){if(!console[tn]){(function(){var _8=tn+"";console[_8]=("log" in console)?function(){var a=Array.apply({},arguments);a.unshift(_8+":");console["log"](a.join(" "));}:function(){};console[_8]._fake=true;})();}}}if(typeof dojo=="undefined"){dojo={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};}var d=dojo;if(typeof dijit=="undefined"){dijit={_scopeName:"dijit"};}if(typeof dojox=="undefined"){dojox={_scopeName:"dojox"};}if(!d._scopeArgs){d._scopeArgs=[dojo,dijit,dojox];}d.global=this;d.config={isDebug:false,debugAtAllCosts:false};if(typeof djConfig!="undefined"){for(var _9 in djConfig){d.config[_9]=djConfig[_9];}}dojo.locale=d.config.locale;var _a="$Rev: 20973 $".match(/\d+/);dojo.version={major:1,minor:4,patch:0,flag:"",revision:_a?+_a[0]:NaN,toString:function(){with(d.version){return major+"."+minor+"."+patch+flag+" ("+revision+")";}}};if(typeof OpenAjax!="undefined"){OpenAjax.hub.registerLibrary(dojo._scopeName,"http://dojotoolkit.org",d.version.toString());}var _b,_c,_d={};for(var i in {toString:1}){_b=[];break;}dojo._extraNames=_b=_b||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];_c=_b.length;dojo._mixin=function(_e,_f){var _10,s,i;for(_10 in _f){s=_f[_10];if(!(_10 in _e)||(_e[_10]!==s&&(!(_10 in _d)||_d[_10]!==s))){_e[_10]=s;}}if(_c&&_f){for(i=0;i<_c;++i){_10=_b[i];s=_f[_10];if(!(_10 in _e)||(_e[_10]!==s&&(!(_10 in _d)||_d[_10]!==s))){_e[_10]=s;}}}return _e;};dojo.mixin=function(obj,_11){if(!obj){obj={};}for(var i=1,l=arguments.length;i<l;i++){d._mixin(obj,arguments[i]);}return obj;};dojo._getProp=function(_12,_13,_14){var obj=_14||d.global;for(var i=0,p;obj&&(p=_12[i]);i++){if(i==0&&d._scopeMap[p]){p=d._scopeMap[p];}obj=(p in obj?obj[p]:(_13?obj[p]={}:undefined));}return obj;};dojo.setObject=function(_15,_16,_17){var _18=_15.split("."),p=_18.pop(),obj=d._getProp(_18,true,_17);return obj&&p?(obj[p]=_16):undefined;};dojo.getObject=function(_19,_1a,_1b){return d._getProp(_19.split("."),_1a,_1b);};dojo.exists=function(_1c,obj){return !!d.getObject(_1c,false,obj);};dojo["eval"]=function(_1d){return d.global.eval?d.global.eval(_1d):eval(_1d);};d.deprecated=d.experimental=function(){};})();(function(){var d=dojo;d.mixin(d,{_loadedModules:{},_inFlightCount:0,_hasResource:{},_modulePrefixes:{dojo:{name:"dojo",value:"."},doh:{name:"doh",value:"../util/doh"},tests:{name:"tests",value:"tests"}},_moduleHasPrefix:function(_1e){var mp=d._modulePrefixes;return !!(mp[_1e]&&mp[_1e].value);},_getModulePrefix:function(_1f){var mp=d._modulePrefixes;if(d._moduleHasPrefix(_1f)){return mp[_1f].value;}return _1f;},_loadedUrls:[],_postLoad:false,_loaders:[],_unloaders:[],_loadNotifying:false});dojo._loadPath=function(_20,_21,cb){var uri=((_20.charAt(0)=="/"||_20.match(/^\w+:/))?"":d.baseUrl)+_20;try{return !_21?d._loadUri(uri,cb):d._loadUriAndCheck(uri,_21,cb);}catch(e){console.error(e);return false;}};dojo._loadUri=function(uri,cb){if(d._loadedUrls[uri]){return true;}d._inFlightCount++;var _22=d._getText(uri,true);if(_22){d._loadedUrls[uri]=true;d._loadedUrls.push(uri);if(cb){_22="("+_22+")";}else{_22=d._scopePrefix+_22+d._scopeSuffix;}if(!d.isIE){_22+="\r\n//@ sourceURL="+uri;}var _23=d["eval"](_22);if(cb){cb(_23);}}if(--d._inFlightCount==0&&d._postLoad&&d._loaders.length){setTimeout(function(){if(d._inFlightCount==0){d._callLoaded();}},0);}return !!_22;};dojo._loadUriAndCheck=function(uri,_24,cb){var ok=false;try{ok=d._loadUri(uri,cb);}catch(e){console.error("failed loading "+uri+" with error: "+e);}return !!(ok&&d._loadedModules[_24]);};dojo.loaded=function(){d._loadNotifying=true;d._postLoad=true;var mll=d._loaders;d._loaders=[];for(var x=0;x<mll.length;x++){mll[x]();}d._loadNotifying=false;if(d._postLoad&&d._inFlightCount==0&&mll.length){d._callLoaded();}};dojo.unloaded=function(){var mll=d._unloaders;while(mll.length){(mll.pop())();}};d._onto=function(arr,obj,fn){if(!fn){arr.push(obj);}else{if(fn){var _25=(typeof fn=="string")?obj[fn]:fn;arr.push(function(){_25.call(obj);});}}};dojo.ready=dojo.addOnLoad=function(obj,_26){d._onto(d._loaders,obj,_26);if(d._postLoad&&d._inFlightCount==0&&!d._loadNotifying){d._callLoaded();}};var dca=d.config.addOnLoad;if(dca){d.addOnLoad[(dca instanceof Array?"apply":"call")](d,dca);}dojo._modulesLoaded=function(){if(d._postLoad){return;}if(d._inFlightCount>0){console.warn("files still in flight!");return;}d._callLoaded();};dojo._callLoaded=function(){if(typeof setTimeout=="object"||(d.config.useXDomain&&d.isOpera)){setTimeout(d.isAIR?function(){d.loaded();}:d._scopeName+".loaded();",0);}else{d.loaded();}};dojo._getModuleSymbols=function(_27){var _28=_27.split(".");for(var i=_28.length;i>0;i--){var _29=_28.slice(0,i).join(".");if(i==1&&!d._moduleHasPrefix(_29)){_28[0]="../"+_28[0];}else{var _2a=d._getModulePrefix(_29);if(_2a!=_29){_28.splice(0,i,_2a);break;}}}return _28;};dojo._global_omit_module_check=false;dojo.loadInit=function(_2b){_2b();};dojo._loadModule=dojo.require=function(_2c,_2d){_2d=d._global_omit_module_check||_2d;var _2e=d._loadedModules[_2c];if(_2e){return _2e;}var _2f=d._getModuleSymbols(_2c).join("/")+".js";var _30=!_2d?_2c:null;var ok=d._loadPath(_2f,_30);if(!ok&&!_2d){throw new Error("Could not load '"+_2c+"'; last tried '"+_2f+"'");}if(!_2d&&!d._isXDomain){_2e=d._loadedModules[_2c];if(!_2e){throw new Error("symbol '"+_2c+"' is not defined after loading '"+_2f+"'");}}return _2e;};dojo.provide=function(_31){_31=_31+"";return (d._loadedModules[_31]=d.getObject(_31,true));};dojo.platformRequire=function(_32){var _33=_32.common||[];var _34=_33.concat(_32[d._name]||_32["default"]||[]);for(var x=0;x<_34.length;x++){var _35=_34[x];if(_35.constructor==Array){d._loadModule.apply(d,_35);}else{d._loadModule(_35);}}};dojo.requireIf=function(_36,_37){if(_36===true){var _38=[];for(var i=1;i<arguments.length;i++){_38.push(arguments[i]);}d.require.apply(d,_38);}};dojo.requireAfterIf=d.requireIf;dojo.registerModulePath=function(_39,_3a){d._modulePrefixes[_39]={name:_39,value:_3a};};dojo.requireLocalization=function(_3b,_3c,_3d,_3e){d.require("dojo.i18n");d.i18n._requireLocalization.apply(d.hostenv,arguments);};var ore=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),ire=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");dojo._Url=function(){var n=null,_3f=arguments,uri=[_3f[0]];for(var i=1;i<_3f.length;i++){if(!_3f[i]){continue;}var _40=new d._Url(_3f[i]+""),_41=new d._Url(uri[0]+"");if(_40.path==""&&!_40.scheme&&!_40.authority&&!_40.query){if(_40.fragment!=n){_41.fragment=_40.fragment;}_40=_41;}else{if(!_40.scheme){_40.scheme=_41.scheme;if(!_40.authority){_40.authority=_41.authority;if(_40.path.charAt(0)!="/"){var _42=_41.path.substring(0,_41.path.lastIndexOf("/")+1)+_40.path;var _43=_42.split("/");for(var j=0;j<_43.length;j++){if(_43[j]=="."){if(j==_43.length-1){_43[j]="";}else{_43.splice(j,1);j--;}}else{if(j>0&&!(j==1&&_43[0]=="")&&_43[j]==".."&&_43[j-1]!=".."){if(j==(_43.length-1)){_43.splice(j,1);_43[j-1]="";}else{_43.splice(j-1,2);j-=2;}}}}_40.path=_43.join("/");}}}}uri=[];if(_40.scheme){uri.push(_40.scheme,":");}if(_40.authority){uri.push("//",_40.authority);}uri.push(_40.path);if(_40.query){uri.push("?",_40.query);}if(_40.fragment){uri.push("#",_40.fragment);}}this.uri=uri.join("");var r=this.uri.match(ore);this.scheme=r[2]||(r[1]?"":n);this.authority=r[4]||(r[3]?"":n);this.path=r[5];this.query=r[7]||(r[6]?"":n);this.fragment=r[9]||(r[8]?"":n);if(this.authority!=n){r=this.authority.match(ire);this.user=r[3]||n;this.password=r[4]||n;this.host=r[6]||r[7];this.port=r[9]||n;}};dojo._Url.prototype.toString=function(){return this.uri;};dojo.moduleUrl=function(_44,url){var loc=d._getModuleSymbols(_44).join("/");if(!loc){return null;}if(loc.lastIndexOf("/")!=loc.length-1){loc+="/";}var _45=loc.indexOf(":");if(loc.charAt(0)!="/"&&(_45==-1||_45>loc.indexOf("/"))){loc=d.baseUrl+loc;}return new d._Url(loc,url);};})();if(typeof window!="undefined"){dojo.isBrowser=true;dojo._name="browser";(function(){var d=dojo;if(document&&document.getElementsByTagName){var _46=document.getElementsByTagName("script");var _47=/dojo(\.xd)?\.js(\W|$)/i;for(var i=0;i<_46.length;i++){var src=_46[i].getAttribute("src");if(!src){continue;}var m=src.match(_47);if(m){if(!d.config.baseUrl){d.config.baseUrl=src.substring(0,m.index);}var cfg=_46[i].getAttribute("djConfig");if(cfg){var _48=eval("({ "+cfg+" })");for(var x in _48){dojo.config[x]=_48[x];}}break;}}}d.baseUrl=d.config.baseUrl;var n=navigator;var dua=n.userAgent,dav=n.appVersion,tv=parseFloat(dav);if(dua.indexOf("Opera")>=0){d.isOpera=tv;}if(dua.indexOf("AdobeAIR")>=0){d.isAIR=1;}d.isKhtml=(dav.indexOf("Konqueror")>=0)?tv:0;d.isWebKit=parseFloat(dua.split("WebKit/")[1])||undefined;d.isChrome=parseFloat(dua.split("Chrome/")[1])||undefined;d.isMac=dav.indexOf("Macintosh")>=0;var _49=Math.max(dav.indexOf("WebKit"),dav.indexOf("Safari"),0);if(_49&&!dojo.isChrome){d.isSafari=parseFloat(dav.split("Version/")[1]);if(!d.isSafari||parseFloat(dav.substr(_49+7))<=419.3){d.isSafari=2;}}if(dua.indexOf("Gecko")>=0&&!d.isKhtml&&!d.isWebKit){d.isMozilla=d.isMoz=tv;}if(d.isMoz){d.isFF=parseFloat(dua.split("Firefox/")[1]||dua.split("Minefield/")[1])||undefined;}if(document.all&&!d.isOpera){d.isIE=parseFloat(dav.split("MSIE ")[1])||undefined;var _4a=document.documentMode;if(_4a&&_4a!=5&&Math.floor(d.isIE)!=_4a){d.isIE=_4a;}}if(dojo.isIE&&window.location.protocol==="file:"){dojo.config.ieForceActiveXXhr=true;}d.isQuirks=document.compatMode=="BackCompat";d.locale=dojo.config.locale||(d.isIE?n.userLanguage:n.language).toLowerCase();d._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];d._xhrObj=function(){var _4b,_4c;if(!dojo.isIE||!dojo.config.ieForceActiveXXhr){try{_4b=new XMLHttpRequest();}catch(e){}}if(!_4b){for(var i=0;i<3;++i){var _4d=d._XMLHTTP_PROGIDS[i];try{_4b=new ActiveXObject(_4d);}catch(e){_4c=e;}if(_4b){d._XMLHTTP_PROGIDS=[_4d];break;}}}if(!_4b){throw new Error("XMLHTTP not available: "+_4c);}return _4b;};d._isDocumentOk=function(_4e){var _4f=_4e.status||0,lp=location.protocol;return (_4f>=200&&_4f<300)||_4f==304||_4f==1223||(!_4f&&(lp=="file:"||lp=="chrome:"||lp=="app:"));};var _50=window.location+"";var _51=document.getElementsByTagName("base");var _52=(_51&&_51.length>0);d._getText=function(uri,_53){var _54=d._xhrObj();if(!_52&&dojo._Url){uri=(new dojo._Url(_50,uri)).toString();}if(d.config.cacheBust){uri+="";uri+=(uri.indexOf("?")==-1?"?":"&")+String(d.config.cacheBust).replace(/\W+/g,"");}_54.open("GET",uri,false);try{_54.send(null);if(!d._isDocumentOk(_54)){var err=Error("Unable to load "+uri+" status:"+_54.status);err.status=_54.status;err.responseText=_54.responseText;throw err;}}catch(e){if(_53){return null;}throw e;}return _54.responseText;};var _55=window;var _56=function(_57,fp){var _58=_55.attachEvent||_55.addEventListener;_57=_55.attachEvent?_57:_57.substring(2);_58(_57,function(){fp.apply(_55,arguments);},false);};d._windowUnloaders=[];d.windowUnloaded=function(){var mll=d._windowUnloaders;while(mll.length){(mll.pop())();}};var _59=0;d.addOnWindowUnload=function(obj,_5a){d._onto(d._windowUnloaders,obj,_5a);if(!_59){_59=1;_56("onunload",d.windowUnloaded);}};var _5b=0;d.addOnUnload=function(obj,_5c){d._onto(d._unloaders,obj,_5c);if(!_5b){_5b=1;_56("onbeforeunload",dojo.unloaded);}};})();dojo._initFired=false;dojo._loadInit=function(e){if(!dojo._initFired){dojo._initFired=true;if(!dojo.config.afterOnLoad&&window.detachEvent){window.detachEvent("onload",dojo._loadInit);}if(dojo._inFlightCount==0){dojo._modulesLoaded();}}};if(!dojo.config.afterOnLoad){if(document.addEventListener){document.addEventListener("DOMContentLoaded",dojo._loadInit,false);window.addEventListener("load",dojo._loadInit,false);}else{if(window.attachEvent){window.attachEvent("onload",dojo._loadInit);}}}if(dojo.isIE){if(!dojo.config.afterOnLoad&&!dojo.config.skipIeDomLoaded){document.write("<scr"+"ipt defer src=\"//:\" "+"onreadystatechange=\"if(this.readyState=='complete'){"+dojo._scopeName+"._loadInit();}\">"+"</scr"+"ipt>");}try{document.namespaces.add("v","urn:schemas-microsoft-com:vml");var _5d=["*","group","roundrect","oval","shape","rect","imagedata"],i=0,l=1,s=document.createStyleSheet();if(dojo.isIE>=8){i=1;l=_5d.length;}for(;i<l;++i){s.addRule("v\\:"+_5d[i],"behavior:url(#default#VML); display:inline-block");}}catch(e){}}}(function(){var mp=dojo.config["modulePaths"];if(mp){for(var _5e in mp){dojo.registerModulePath(_5e,mp[_5e]);}}})();if(dojo.config.isDebug){dojo.require("dojo._firebug.firebug");}if(dojo.config.debugAtAllCosts){dojo.config.useXDomain=true;dojo.require("dojo._base._loader.loader_xd");dojo.require("dojo._base._loader.loader_debug");dojo.require("dojo.i18n");}if(!dojo._hasResource["dojo._base.lang"]){dojo._hasResource["dojo._base.lang"]=true;dojo.provide("dojo._base.lang");(function(){var d=dojo,_5f=Object.prototype.toString;dojo.isString=function(it){return (typeof it=="string"||it instanceof String);};dojo.isArray=function(it){return it&&(it instanceof Array||typeof it=="array");};dojo.isFunction=function(it){return _5f.call(it)==="[object Function]";};dojo.isObject=function(it){return it!==undefined&&(it===null||typeof it=="object"||d.isArray(it)||d.isFunction(it));};dojo.isArrayLike=function(it){return it&&it!==undefined&&!d.isString(it)&&!d.isFunction(it)&&!(it.tagName&&it.tagName.toLowerCase()=="form")&&(d.isArray(it)||isFinite(it.length));};dojo.isAlien=function(it){return it&&!d.isFunction(it)&&/\{\s*\[native code\]\s*\}/.test(String(it));};dojo.extend=function(_60,_61){for(var i=1,l=arguments.length;i<l;i++){d._mixin(_60.prototype,arguments[i]);}return _60;};dojo._hitchArgs=function(_62,_63){var pre=d._toArray(arguments,2);var _64=d.isString(_63);return function(){var _65=d._toArray(arguments);var f=_64?(_62||d.global)[_63]:_63;return f&&f.apply(_62||this,pre.concat(_65));};};dojo.hitch=function(_66,_67){if(arguments.length>2){return d._hitchArgs.apply(d,arguments);}if(!_67){_67=_66;_66=null;}if(d.isString(_67)){_66=_66||d.global;if(!_66[_67]){throw (["dojo.hitch: scope[\"",_67,"\"] is null (scope=\"",_66,"\")"].join(""));}return function(){return _66[_67].apply(_66,arguments||[]);};}return !_66?_67:function(){return _67.apply(_66,arguments||[]);};};dojo.delegate=dojo._delegate=(function(){function TMP(){};return function(obj,_68){TMP.prototype=obj;var tmp=new TMP();TMP.prototype=null;if(_68){d._mixin(tmp,_68);}return tmp;};})();var _69=function(obj,_6a,_6b){return (_6b||[]).concat(Array.prototype.slice.call(obj,_6a||0));};var _6c=function(obj,_6d,_6e){var arr=_6e||[];for(var x=_6d||0;x<obj.length;x++){arr.push(obj[x]);}return arr;};dojo._toArray=d.isIE?function(obj){return ((obj.item)?_6c:_69).apply(this,arguments);}:_69;dojo.partial=function(_6f){var arr=[null];return d.hitch.apply(d,arr.concat(d._toArray(arguments)));};var _70=d._extraNames,_71=_70.length,_72={};dojo.clone=function(o){if(!o||typeof o!="object"||d.isFunction(o)){return o;}if(o.nodeType&&o.cloneNode){return o.cloneNode(true);}if(o instanceof Date){return new Date(o.getTime());}var r,i,l,s,_73;if(d.isArray(o)){r=[];for(i=0,l=o.length;i<l;++i){if(i in o){r.push(d.clone(o[i]));}}}else{r=o.constructor?new o.constructor():{};}for(_73 in o){s=o[_73];if(!(_73 in r)||(r[_73]!==s&&(!(_73 in _72)||_72[_73]!==s))){r[_73]=d.clone(s);}}if(_71){for(i=0;i<_71;++i){_73=_70[i];s=o[_73];if(!(_73 in r)||(r[_73]!==s&&(!(_73 in _72)||_72[_73]!==s))){r[_73]=s;}}}return r;};dojo.trim=String.prototype.trim?function(str){return str.trim();}:function(str){return str.replace(/^\s\s*/,"").replace(/\s\s*$/,"");};var _74=/\{([^\}]+)\}/g;dojo.replace=function(_75,map,_76){return _75.replace(_76||_74,d.isFunction(map)?map:function(_77,k){return d.getObject(k,false,map);});};})();}if(!dojo._hasResource["dojo._base.array"]){dojo._hasResource["dojo._base.array"]=true;dojo.provide("dojo._base.array");(function(){var _78=function(arr,obj,cb){return [(typeof arr=="string")?arr.split(""):arr,obj||dojo.global,(typeof cb=="string")?new Function("item","index","array",cb):cb];};var _79=function(_7a,arr,_7b,_7c){var _7d=_78(arr,_7c,_7b);arr=_7d[0];for(var i=0,l=arr.length;i<l;++i){var _7e=!!_7d[2].call(_7d[1],arr[i],i,arr);if(_7a^_7e){return _7e;}}return _7a;};dojo.mixin(dojo,{indexOf:function(_7f,_80,_81,_82){var _83=1,end=_7f.length||0,i=0;if(_82){i=end-1;_83=end=-1;}if(_81!=undefined){i=_81;}if((_82&&i>end)||i<end){for(;i!=end;i+=_83){if(_7f[i]==_80){return i;}}}return -1;},lastIndexOf:function(_84,_85,_86){return dojo.indexOf(_84,_85,_86,true);},forEach:function(arr,_87,_88){if(!arr||!arr.length){return;}var _89=_78(arr,_88,_87);arr=_89[0];for(var i=0,l=arr.length;i<l;++i){_89[2].call(_89[1],arr[i],i,arr);}},every:function(arr,_8a,_8b){return _79(true,arr,_8a,_8b);},some:function(arr,_8c,_8d){return _79(false,arr,_8c,_8d);},map:function(arr,_8e,_8f){var _90=_78(arr,_8f,_8e);arr=_90[0];var _91=(arguments[3]?(new arguments[3]()):[]);for(var i=0,l=arr.length;i<l;++i){_91.push(_90[2].call(_90[1],arr[i],i,arr));}return _91;},filter:function(arr,_92,_93){var _94=_78(arr,_93,_92);arr=_94[0];var _95=[];for(var i=0,l=arr.length;i<l;++i){if(_94[2].call(_94[1],arr[i],i,arr)){_95.push(arr[i]);}}return _95;}});})();}if(!dojo._hasResource["dojo._base.declare"]){dojo._hasResource["dojo._base.declare"]=true;dojo.provide("dojo._base.declare");(function(){var d=dojo,mix=d._mixin,op=Object.prototype,_96=op.toString,_97=new Function,_98=0,_99="constructor";function err(msg){throw new Error("declare: "+msg);};function _9a(_9b){var _9c=[],_9d=[{cls:0,refs:[]}],_9e={},_9f=1,l=_9b.length,i=0,j,lin,_a0,top,_a1,rec,_a2,_a3;for(;i<l;++i){_a0=_9b[i];if(!_a0){err("mixin #"+i+" is null");}lin=_a0._meta?_a0._meta.bases:[_a0];top=0;for(j=lin.length-1;j>=0;--j){_a1=lin[j].prototype;if(!_a1.hasOwnProperty("declaredClass")){_a1.declaredClass="uniqName_"+(_98++);}_a2=_a1.declaredClass;if(!_9e.hasOwnProperty(_a2)){_9e[_a2]={count:0,refs:[],cls:lin[j]};++_9f;}rec=_9e[_a2];if(top&&top!==rec){rec.refs.push(top);++top.count;}top=rec;}++top.count;_9d[0].refs.push(top);}while(_9d.length){top=_9d.pop();_9c.push(top.cls);--_9f;while(_a3=top.refs,_a3.length==1){top=_a3[0];if(!top||--top.count){top=0;break;}_9c.push(top.cls);--_9f;}if(top){for(i=0,l=_a3.length;i<l;++i){top=_a3[i];if(!--top.count){_9d.push(top);}}}}if(_9f){err("can't build consistent linearization");}_a0=_9b[0];_9c[0]=_a0?_a0._meta&&_a0===_9c[_9c.length-_a0._meta.bases.length]?_a0._meta.bases.length:1:0;return _9c;};function _a4(_a5,a,f){var _a6,_a7,_a8,_a9,_aa,_ab,_ac,opf,pos,_ad=this._inherited=this._inherited||{};if(typeof _a5=="string"){_a6=_a5;_a5=a;a=f;}f=0;_a9=_a5.callee;_a6=_a6||_a9.nom;if(!_a6){err("can't deduce a name to call inherited()");}_aa=this.constructor._meta;_a8=_aa.bases;pos=_ad.p;if(_a6!=_99){if(_ad.c!==_a9){pos=0;_ab=_a8[0];_aa=_ab._meta;if(_aa.hidden[_a6]!==_a9){_a7=_aa.chains;if(_a7&&typeof _a7[_a6]=="string"){err("calling chained method with inherited: "+_a6);}do{_aa=_ab._meta;_ac=_ab.prototype;if(_aa&&(_ac[_a6]===_a9&&_ac.hasOwnProperty(_a6)||_aa.hidden[_a6]===_a9)){break;}}while(_ab=_a8[++pos]);pos=_ab?pos:-1;}}_ab=_a8[++pos];if(_ab){_ac=_ab.prototype;if(_ab._meta&&_ac.hasOwnProperty(_a6)){f=_ac[_a6];}else{opf=op[_a6];do{_ac=_ab.prototype;f=_ac[_a6];if(f&&(_ab._meta?_ac.hasOwnProperty(_a6):f!==opf)){break;}}while(_ab=_a8[++pos]);}}f=_ab&&f||op[_a6];}else{if(_ad.c!==_a9){pos=0;_aa=_a8[0]._meta;if(_aa&&_aa.ctor!==_a9){_a7=_aa.chains;if(!_a7||_a7.constructor!=="manual"){err("calling chained constructor with inherited");}while(_ab=_a8[++pos]){_aa=_ab._meta;if(_aa&&_aa.ctor===_a9){break;}}pos=_ab?pos:-1;}}while(_ab=_a8[++pos]){_aa=_ab._meta;f=_aa?_aa.ctor:_ab;if(f){break;}}f=_ab&&f;}_ad.c=f;_ad.p=pos;if(f){return a===true?f:f.apply(this,a||_a5);}};function _ae(_af,_b0){if(typeof _af=="string"){return this.inherited(_af,_b0,true);}return this.inherited(_af,true);};function _b1(cls){var _b2=this.constructor._meta.bases;for(var i=0,l=_b2.length;i<l;++i){if(_b2[i]===cls){return true;}}return this instanceof cls;};function _b3(_b4,_b5){var _b6,t,i=0,l=d._extraNames.length;for(_b6 in _b5){t=_b5[_b6];if((t!==op[_b6]||!(_b6 in op))&&_b6!=_99){if(_96.call(t)=="[object Function]"){t.nom=_b6;}_b4[_b6]=t;}}for(;i<l;++i){_b6=d._extraNames[i];t=_b5[_b6];if((t!==op[_b6]||!(_b6 in op))&&_b6!=_99){if(_96.call(t)=="[object Function]"){t.nom=_b6;}_b4[_b6]=t;}}return _b4;};function _b7(_b8){_b3(this.prototype,_b8);return this;};function _b9(_ba,_bb){return function(){var a=arguments,_bc=a,a0=a[0],f,i,m,l=_ba.length,_bd;if(_bb&&(a0&&a0.preamble||this.preamble)){_bd=new Array(_ba.length);_bd[0]=a;for(i=0;;){a0=a[0];if(a0){f=a0.preamble;if(f){a=f.apply(this,a)||a;}}f=_ba[i].prototype;f=f.hasOwnProperty("preamble")&&f.preamble;if(f){a=f.apply(this,a)||a;}if(++i==l){break;}_bd[i]=a;}}for(i=l-1;i>=0;--i){f=_ba[i];m=f._meta;f=m?m.ctor:f;if(f){f.apply(this,_bd?_bd[i]:a);}}f=this.postscript;if(f){f.apply(this,_bc);}};};function _be(_bf,_c0){return function(){var a=arguments,t=a,a0=a[0],f;if(_c0){if(a0){f=a0.preamble;if(f){t=f.apply(this,t)||t;}}f=this.preamble;if(f){f.apply(this,t);}}if(_bf){_bf.apply(this,a);}f=this.postscript;if(f){f.apply(this,a);}};};function _c1(_c2){return function(){var a=arguments,i=0,f;for(;f=_c2[i];++i){m=f._meta;f=m?m.ctor:f;if(f){f.apply(this,a);break;}}f=this.postscript;if(f){f.apply(this,a);}};};function _c3(_c4,_c5,_c6){return function(){var b,m,f,i=0,_c7=1;if(_c6){i=_c5.length-1;_c7=-1;}for(;b=_c5[i];i+=_c7){m=b._meta;f=(m?m.hidden:b.prototype)[_c4];if(f){f.apply(this,arguments);}}};};d.declare=function(_c8,_c9,_ca){var _cb,i,t,_cc,_cd,_ce,_cf,_d0=1,_d1=_c9;if(typeof _c8!="string"){_ca=_c9;_c9=_c8;_c8="";}_ca=_ca||{};if(_96.call(_c9)=="[object Array]"){_ce=_9a(_c9);t=_ce[0];_d0=_ce.length-t;_c9=_ce[_d0];}else{_ce=[0];if(_c9){t=_c9._meta;_ce=_ce.concat(t?t.bases:_c9);}}if(_c9){for(i=_d0-1;;--i){_97.prototype=_c9.prototype;_cb=new _97;if(!i){break;}t=_ce[i];mix(_cb,t._meta?t._meta.hidden:t.prototype);_cc=new Function;_cc.superclass=_c9;_cc.prototype=_cb;_c9=_cb.constructor=_cc;}}else{_cb={};}_b3(_cb,_ca);t=_ca.constructor;if(t!==op.constructor){t.nom=_99;_cb.constructor=t;}_97.prototype=0;for(i=_d0-1;i;--i){t=_ce[i]._meta;if(t&&t.chains){_cf=mix(_cf||{},t.chains);}}if(_cb["-chains-"]){_cf=mix(_cf||{},_cb["-chains-"]);}t=!_cf||!_cf.hasOwnProperty(_99);_ce[0]=_cc=(_cf&&_cf.constructor==="manual")?_c1(_ce):(_ce.length==1?_be(_ca.constructor,t):_b9(_ce,t));_cc._meta={bases:_ce,hidden:_ca,chains:_cf,parents:_d1,ctor:_ca.constructor};_cc.superclass=_c9&&_c9.prototype;_cc.extend=_b7;_cc.prototype=_cb;_cb.constructor=_cc;_cb.getInherited=_ae;_cb.inherited=_a4;_cb.isInstanceOf=_b1;if(_c8){_cb.declaredClass=_c8;d.setObject(_c8,_cc);}if(_cf){for(_cd in _cf){if(_cb[_cd]&&typeof _cf[_cd]=="string"&&_cd!=_99){t=_cb[_cd]=_c3(_cd,_ce,_cf[_cd]==="after");t.nom=_cd;}}}return _cc;};d.safeMixin=_b3;})();}if(!dojo._hasResource["dojo._base.connect"]){dojo._hasResource["dojo._base.connect"]=true;dojo.provide("dojo._base.connect");dojo._listener={getDispatcher:function(){return function(){var ap=Array.prototype,c=arguments.callee,ls=c._listeners,t=c.target;var r=t&&t.apply(this,arguments);var lls;lls=[].concat(ls);for(var i in lls){if(!(i in ap)){lls[i].apply(this,arguments);}}return r;};},add:function(_d2,_d3,_d4){_d2=_d2||dojo.global;var f=_d2[_d3];if(!f||!f._listeners){var d=dojo._listener.getDispatcher();d.target=f;d._listeners=[];f=_d2[_d3]=d;}return f._listeners.push(_d4);},remove:function(_d5,_d6,_d7){var f=(_d5||dojo.global)[_d6];if(f&&f._listeners&&_d7--){delete f._listeners[_d7];}}};dojo.connect=function(obj,_d8,_d9,_da,_db){var a=arguments,_dc=[],i=0;_dc.push(dojo.isString(a[0])?null:a[i++],a[i++]);var a1=a[i+1];_dc.push(dojo.isString(a1)||dojo.isFunction(a1)?a[i++]:null,a[i++]);for(var l=a.length;i<l;i++){_dc.push(a[i]);}return dojo._connect.apply(this,_dc);};dojo._connect=function(obj,_dd,_de,_df){var l=dojo._listener,h=l.add(obj,_dd,dojo.hitch(_de,_df));return [obj,_dd,h,l];};dojo.disconnect=function(_e0){if(_e0&&_e0[0]!==undefined){dojo._disconnect.apply(this,_e0);delete _e0[0];}};dojo._disconnect=function(obj,_e1,_e2,_e3){_e3.remove(obj,_e1,_e2);};dojo._topics={};dojo.subscribe=function(_e4,_e5,_e6){return [_e4,dojo._listener.add(dojo._topics,_e4,dojo.hitch(_e5,_e6))];};dojo.unsubscribe=function(_e7){if(_e7){dojo._listener.remove(dojo._topics,_e7[0],_e7[1]);}};dojo.publish=function(_e8,_e9){var f=dojo._topics[_e8];if(f){f.apply(this,_e9||[]);}};dojo.connectPublisher=function(_ea,obj,_eb){var pf=function(){dojo.publish(_ea,arguments);};return (_eb)?dojo.connect(obj,_eb,pf):dojo.connect(obj,pf);};}if(!dojo._hasResource["dojo._base.Deferred"]){dojo._hasResource["dojo._base.Deferred"]=true;dojo.provide("dojo._base.Deferred");dojo.Deferred=function(_ec){this.chain=[];this.id=this._nextId();this.fired=-1;this.paused=0;this.results=[null,null];this.canceller=_ec;this.silentlyCancelled=false;this.isFiring=false;};dojo.extend(dojo.Deferred,{_nextId:(function(){var n=1;return function(){return n++;};})(),cancel:function(){var err;if(this.fired==-1){if(this.canceller){err=this.canceller(this);}else{this.silentlyCancelled=true;}if(this.fired==-1){if(!(err instanceof Error)){var res=err;var msg="Deferred Cancelled";if(err&&err.toString){msg+=": "+err.toString();}err=new Error(msg);err.dojoType="cancel";err.cancelResult=res;}this.errback(err);}}else{if((this.fired==0)&&(this.results[0] instanceof dojo.Deferred)){this.results[0].cancel();}}},_resback:function(res){this.fired=((res instanceof Error)?1:0);this.results[this.fired]=res;this._fire();},_check:function(){if(this.fired!=-1){if(!this.silentlyCancelled){throw new Error("already called!");}this.silentlyCancelled=false;return;}},callback:function(res){this._check();this._resback(res);},errback:function(res){this._check();if(!(res instanceof Error)){res=new Error(res);}this._resback(res);},addBoth:function(cb,_ed){var _ee=dojo.hitch.apply(dojo,arguments);return this.addCallbacks(_ee,_ee);},addCallback:function(cb,_ef){return this.addCallbacks(dojo.hitch.apply(dojo,arguments));},addErrback:function(cb,_f0){return this.addCallbacks(null,dojo.hitch.apply(dojo,arguments));},addCallbacks:function(cb,eb){this.chain.push([cb,eb]);if(this.fired>=0&&!this.isFiring){this._fire();}return this;},_fire:function(){this.isFiring=true;var _f1=this.chain;var _f2=this.fired;var res=this.results[_f2];var _f3=this;var cb=null;while((_f1.length>0)&&(this.paused==0)){var f=_f1.shift()[_f2];if(!f){continue;}var _f4=function(){var ret=f(res);if(typeof ret!="undefined"){res=ret;}_f2=((res instanceof Error)?1:0);if(res instanceof dojo.Deferred){cb=function(res){_f3._resback(res);_f3.paused--;if((_f3.paused==0)&&(_f3.fired>=0)){_f3._fire();}};this.paused++;}};if(dojo.config.debugAtAllCosts){_f4.call(this);}else{try{_f4.call(this);}catch(err){_f2=1;res=err;}}}this.fired=_f2;this.results[_f2]=res;this.isFiring=false;if((cb)&&(this.paused)){res.addBoth(cb);}}});}if(!dojo._hasResource["dojo._base.json"]){dojo._hasResource["dojo._base.json"]=true;dojo.provide("dojo._base.json");dojo.fromJson=function(_f5){return eval("("+_f5+")");};dojo._escapeString=function(str){return ("\""+str.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");};dojo.toJsonIndentStr="\t";dojo.toJson=function(it,_f6,_f7){if(it===undefined){return "undefined";}var _f8=typeof it;if(_f8=="number"||_f8=="boolean"){return it+"";}if(it===null){return "null";}if(dojo.isString(it)){return dojo._escapeString(it);}var _f9=arguments.callee;var _fa;_f7=_f7||"";var _fb=_f6?_f7+dojo.toJsonIndentStr:"";var tf=it.__json__||it.json;if(dojo.isFunction(tf)){_fa=tf.call(it);if(it!==_fa){return _f9(_fa,_f6,_fb);}}if(it.nodeType&&it.cloneNode){throw new Error("Can't serialize DOM nodes");}var sep=_f6?" ":"";var _fc=_f6?"\n":"";if(dojo.isArray(it)){var res=dojo.map(it,function(obj){var val=_f9(obj,_f6,_fb);if(typeof val!="string"){val="undefined";}return _fc+_fb+val;});return "["+res.join(","+sep)+_fc+_f7+"]";}if(_f8=="function"){return null;}var _fd=[],key;for(key in it){var _fe,val;if(typeof key=="number"){_fe="\""+key+"\"";}else{if(typeof key=="string"){_fe=dojo._escapeString(key);}else{continue;}}val=_f9(it[key],_f6,_fb);if(typeof val!="string"){continue;}_fd.push(_fc+_fb+_fe+":"+sep+val);}return "{"+_fd.join(","+sep)+_fc+_f7+"}";};}if(!dojo._hasResource["dojo._base.Color"]){dojo._hasResource["dojo._base.Color"]=true;dojo.provide("dojo._base.Color");(function(){var d=dojo;dojo.Color=function(_ff){if(_ff){this.setColor(_ff);}};dojo.Color.named={black:[0,0,0],silver:[192,192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255],transparent:d.config.transparentColor||[255,255,255]};dojo.extend(dojo.Color,{r:255,g:255,b:255,a:1,_set:function(r,g,b,a){var t=this;t.r=r;t.g=g;t.b=b;t.a=a;},setColor:function(_100){if(d.isString(_100)){d.colorFromString(_100,this);}else{if(d.isArray(_100)){d.colorFromArray(_100,this);}else{this._set(_100.r,_100.g,_100.b,_100.a);if(!(_100 instanceof d.Color)){this.sanitize();}}}return this;},sanitize:function(){return this;},toRgb:function(){var t=this;return [t.r,t.g,t.b];},toRgba:function(){var t=this;return [t.r,t.g,t.b,t.a];},toHex:function(){var arr=d.map(["r","g","b"],function(x){var s=this[x].toString(16);return s.length<2?"0"+s:s;},this);return "#"+arr.join("");},toCss:function(_101){var t=this,rgb=t.r+", "+t.g+", "+t.b;return (_101?"rgba("+rgb+", "+t.a:"rgb("+rgb)+")";},toString:function(){return this.toCss(true);}});dojo.blendColors=function(_102,end,_103,obj){var t=obj||new d.Color();d.forEach(["r","g","b","a"],function(x){t[x]=_102[x]+(end[x]-_102[x])*_103;if(x!="a"){t[x]=Math.round(t[x]);}});return t.sanitize();};dojo.colorFromRgb=function(_104,obj){var m=_104.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/);return m&&dojo.colorFromArray(m[1].split(/\s*,\s*/),obj);};dojo.colorFromHex=function(_105,obj){var t=obj||new d.Color(),bits=(_105.length==4)?4:8,mask=(1<<bits)-1;_105=Number("0x"+_105.substr(1));if(isNaN(_105)){return null;}d.forEach(["b","g","r"],function(x){var c=_105&mask;_105>>=bits;t[x]=bits==4?17*c:c;});t.a=1;return t;};dojo.colorFromArray=function(a,obj){var t=obj||new d.Color();t._set(Number(a[0]),Number(a[1]),Number(a[2]),Number(a[3]));if(isNaN(t.a)){t.a=1;}return t.sanitize();};dojo.colorFromString=function(str,obj){var a=d.Color.named[str];return a&&d.colorFromArray(a,obj)||d.colorFromRgb(str,obj)||d.colorFromHex(str,obj);};})();}if(!dojo._hasResource["dojo._base"]){dojo._hasResource["dojo._base"]=true;dojo.provide("dojo._base");}if(!dojo._hasResource["dojo._base.window"]){dojo._hasResource["dojo._base.window"]=true;dojo.provide("dojo._base.window");dojo.doc=window["document"]||null;dojo.body=function(){return dojo.doc.body||dojo.doc.getElementsByTagName("body")[0];};dojo.setContext=function(_106,_107){dojo.global=_106;dojo.doc=_107;};dojo.withGlobal=function(_108,_109,_10a,_10b){var _10c=dojo.global;try{dojo.global=_108;return dojo.withDoc.call(null,_108.document,_109,_10a,_10b);}finally{dojo.global=_10c;}};dojo.withDoc=function(_10d,_10e,_10f,_110){var _111=dojo.doc,_112=dojo._bodyLtr,oldQ=dojo.isQuirks;try{dojo.doc=_10d;delete dojo._bodyLtr;dojo.isQuirks=dojo.doc.compatMode=="BackCompat";if(_10f&&typeof _10e=="string"){_10e=_10f[_10e];}return _10e.apply(_10f,_110||[]);}finally{dojo.doc=_111;delete dojo._bodyLtr;if(_112!==undefined){dojo._bodyLtr=_112;}dojo.isQuirks=oldQ;}};}if(!dojo._hasResource["dojo._base.event"]){dojo._hasResource["dojo._base.event"]=true;dojo.provide("dojo._base.event");(function(){var del=(dojo._event_listener={add:function(node,name,fp){if(!node){return;}name=del._normalizeEventName(name);fp=del._fixCallback(name,fp);var _113=name;if(!dojo.isIE&&(name=="mouseenter"||name=="mouseleave")){var ofp=fp;name=(name=="mouseenter")?"mouseover":"mouseout";fp=function(e){if(!dojo.isDescendant(e.relatedTarget,node)){return ofp.call(this,e);}};}node.addEventListener(name,fp,false);return fp;},remove:function(node,_114,_115){if(node){_114=del._normalizeEventName(_114);if(!dojo.isIE&&(_114=="mouseenter"||_114=="mouseleave")){_114=(_114=="mouseenter")?"mouseover":"mouseout";}node.removeEventListener(_114,_115,false);}},_normalizeEventName:function(name){return name.slice(0,2)=="on"?name.slice(2):name;},_fixCallback:function(name,fp){return name!="keypress"?fp:function(e){return fp.call(this,del._fixEvent(e,this));};},_fixEvent:function(evt,_116){switch(evt.type){case "keypress":del._setKeyChar(evt);break;}return evt;},_setKeyChar:function(evt){evt.keyChar=evt.charCode?String.fromCharCode(evt.charCode):"";evt.charOrCode=evt.keyChar||evt.keyCode;},_punctMap:{106:42,111:47,186:59,187:43,188:44,189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39}});dojo.fixEvent=function(evt,_117){return del._fixEvent(evt,_117);};dojo.stopEvent=function(evt){evt.preventDefault();evt.stopPropagation();};var _118=dojo._listener;dojo._connect=function(obj,_119,_11a,_11b,_11c){var _11d=obj&&(obj.nodeType||obj.attachEvent||obj.addEventListener);var lid=_11d?(_11c?2:1):0,l=[dojo._listener,del,_118][lid];var h=l.add(obj,_119,dojo.hitch(_11a,_11b));return [obj,_119,h,lid];};dojo._disconnect=function(obj,_11e,_11f,_120){([dojo._listener,del,_118][_120]).remove(obj,_11e,_11f);};dojo.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:dojo.isSafari?91:224,PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145,copyKey:dojo.isMac&&!dojo.isAIR?(dojo.isSafari?91:224):17};var _121=dojo.isMac?"metaKey":"ctrlKey";dojo.isCopyKey=function(e){return e[_121];};if(dojo.isIE){dojo.mouseButtons={LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(e,_122){return e.button&_122;},isLeft:function(e){return e.button&1;},isMiddle:function(e){return e.button&4;},isRight:function(e){return e.button&2;}};}else{dojo.mouseButtons={LEFT:0,MIDDLE:1,RIGHT:2,isButton:function(e,_123){return e.button==_123;},isLeft:function(e){return e.button==0;},isMiddle:function(e){return e.button==1;},isRight:function(e){return e.button==2;}};}if(dojo.isIE){var _124=function(e,code){try{return (e.keyCode=code);}catch(e){return 0;}};var iel=dojo._listener;var _125=(dojo._ieListenersName="_"+dojo._scopeName+"_listeners");if(!dojo.config._allow_leaks){_118=iel=dojo._ie_listener={handlers:[],add:function(_126,_127,_128){_126=_126||dojo.global;var f=_126[_127];if(!f||!f[_125]){var d=dojo._getIeDispatcher();d.target=f&&(ieh.push(f)-1);d[_125]=[];f=_126[_127]=d;}return f[_125].push(ieh.push(_128)-1);},remove:function(_129,_12a,_12b){var f=(_129||dojo.global)[_12a],l=f&&f[_125];if(f&&l&&_12b--){delete ieh[l[_12b]];delete l[_12b];}}};var ieh=iel.handlers;}dojo.mixin(del,{add:function(node,_12c,fp){if(!node){return;}_12c=del._normalizeEventName(_12c);if(_12c=="onkeypress"){var kd=node.onkeydown;if(!kd||!kd[_125]||!kd._stealthKeydownHandle){var h=del.add(node,"onkeydown",del._stealthKeyDown);kd=node.onkeydown;kd._stealthKeydownHandle=h;kd._stealthKeydownRefs=1;}else{kd._stealthKeydownRefs++;}}return iel.add(node,_12c,del._fixCallback(fp));},remove:function(node,_12d,_12e){_12d=del._normalizeEventName(_12d);iel.remove(node,_12d,_12e);if(_12d=="onkeypress"){var kd=node.onkeydown;if(--kd._stealthKeydownRefs<=0){iel.remove(node,"onkeydown",kd._stealthKeydownHandle);delete kd._stealthKeydownHandle;}}},_normalizeEventName:function(_12f){return _12f.slice(0,2)!="on"?"on"+_12f:_12f;},_nop:function(){},_fixEvent:function(evt,_130){if(!evt){var w=_130&&(_130.ownerDocument||_130.document||_130).parentWindow||window;evt=w.event;}if(!evt){return (evt);}evt.target=evt.srcElement;evt.currentTarget=(_130||evt.srcElement);evt.layerX=evt.offsetX;evt.layerY=evt.offsetY;var se=evt.srcElement,doc=(se&&se.ownerDocument)||document;var _131=((dojo.isIE<6)||(doc["compatMode"]=="BackCompat"))?doc.body:doc.documentElement;var _132=dojo._getIeDocumentElementOffset();evt.pageX=evt.clientX+dojo._fixIeBiDiScrollLeft(_131.scrollLeft||0)-_132.x;evt.pageY=evt.clientY+(_131.scrollTop||0)-_132.y;if(evt.type=="mouseover"){evt.relatedTarget=evt.fromElement;}if(evt.type=="mouseout"){evt.relatedTarget=evt.toElement;}evt.stopPropagation=del._stopPropagation;evt.preventDefault=del._preventDefault;return del._fixKeys(evt);},_fixKeys:function(evt){switch(evt.type){case "keypress":var c=("charCode" in evt?evt.charCode:evt.keyCode);if(c==10){c=0;evt.keyCode=13;}else{if(c==13||c==27){c=0;}else{if(c==3){c=99;}}}evt.charCode=c;del._setKeyChar(evt);break;}return evt;},_stealthKeyDown:function(evt){var kp=evt.currentTarget.onkeypress;if(!kp||!kp[_125]){return;}var k=evt.keyCode;var _133=k!=13&&k!=32&&k!=27&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222);if(_133||evt.ctrlKey){var c=_133?0:k;if(evt.ctrlKey){if(k==3||k==13){return;}else{if(c>95&&c<106){c-=48;}else{if((!evt.shiftKey)&&(c>=65&&c<=90)){c+=32;}else{c=del._punctMap[c]||c;}}}}var faux=del._synthesizeEvent(evt,{type:"keypress",faux:true,charCode:c});kp.call(evt.currentTarget,faux);evt.cancelBubble=faux.cancelBubble;evt.returnValue=faux.returnValue;_124(evt,faux.keyCode);}},_stopPropagation:function(){this.cancelBubble=true;},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;if(this.ctrlKey){_124(this,0);}this.returnValue=false;}});dojo.stopEvent=function(evt){evt=evt||window.event;del._stopPropagation.call(evt);del._preventDefault.call(evt);};}del._synthesizeEvent=function(evt,_134){var faux=dojo.mixin({},evt,_134);del._setKeyChar(faux);faux.preventDefault=function(){evt.preventDefault();};faux.stopPropagation=function(){evt.stopPropagation();};return faux;};if(dojo.isOpera){dojo.mixin(del,{_fixEvent:function(evt,_135){switch(evt.type){case "keypress":var c=evt.which;if(c==3){c=99;}c=c<41&&!evt.shiftKey?0:c;if(evt.ctrlKey&&!evt.shiftKey&&c>=65&&c<=90){c+=32;}return del._synthesizeEvent(evt,{charCode:c});}return evt;}});}if(dojo.isWebKit){del._add=del.add;del._remove=del.remove;dojo.mixin(del,{add:function(node,_136,fp){if(!node){return;}var _137=del._add(node,_136,fp);if(del._normalizeEventName(_136)=="keypress"){_137._stealthKeyDownHandle=del._add(node,"keydown",function(evt){var k=evt.keyCode;var _138=k!=13&&k!=32&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222);if(_138||evt.ctrlKey){var c=_138?0:k;if(evt.ctrlKey){if(k==3||k==13){return;}else{if(c>95&&c<106){c-=48;}else{if(!evt.shiftKey&&c>=65&&c<=90){c+=32;}else{c=del._punctMap[c]||c;}}}}var faux=del._synthesizeEvent(evt,{type:"keypress",faux:true,charCode:c});fp.call(evt.currentTarget,faux);}});}return _137;},remove:function(node,_139,_13a){if(node){if(_13a._stealthKeyDownHandle){del._remove(node,"keydown",_13a._stealthKeyDownHandle);}del._remove(node,_139,_13a);}},_fixEvent:function(evt,_13b){switch(evt.type){case "keypress":if(evt.faux){return evt;}var c=evt.charCode;c=c>=32?c:0;return del._synthesizeEvent(evt,{charCode:c,faux:true});}return evt;}});}})();if(dojo.isIE){dojo._ieDispatcher=function(args,_13c){var ap=Array.prototype,h=dojo._ie_listener.handlers,c=args.callee,ls=c[dojo._ieListenersName],t=h[c.target];var r=t&&t.apply(_13c,args);var lls=[].concat(ls);for(var i in lls){var f=h[lls[i]];if(!(i in ap)&&f){f.apply(_13c,args);}}return r;};dojo._getIeDispatcher=function(){return new Function(dojo._scopeName+"._ieDispatcher(arguments, this)");};dojo._event_listener._fixCallback=function(fp){var f=dojo._event_listener._fixEvent;return function(e){return fp.call(this,f(e,this));};};}}if(!dojo._hasResource["dojo._base.html"]){dojo._hasResource["dojo._base.html"]=true;dojo.provide("dojo._base.html");try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}if(dojo.isIE||dojo.isOpera){dojo.byId=function(id,doc){if(typeof id!="string"){return id;}var _13d=doc||dojo.doc,te=_13d.getElementById(id);if(te&&(te.attributes.id.value==id||te.id==id)){return te;}else{var eles=_13d.all[id];if(!eles||eles.nodeName){eles=[eles];}var i=0;while((te=eles[i++])){if((te.attributes&&te.attributes.id&&te.attributes.id.value==id)||te.id==id){return te;}}}};}else{dojo.byId=function(id,doc){return (typeof id=="string")?(doc||dojo.doc).getElementById(id):id;};}(function(){var d=dojo;var byId=d.byId;var _13e=null,_13f;d.addOnWindowUnload(function(){_13e=null;});dojo._destroyElement=dojo.destroy=function(node){node=byId(node);try{var doc=node.ownerDocument;if(!_13e||_13f!=doc){_13e=doc.createElement("div");_13f=doc;}_13e.appendChild(node.parentNode?node.parentNode.removeChild(node):node);_13e.innerHTML="";}catch(e){}};dojo.isDescendant=function(node,_140){try{node=byId(node);_140=byId(_140);while(node){if(node==_140){return true;}node=node.parentNode;}}catch(e){}return false;};dojo.setSelectable=function(node,_141){node=byId(node);if(d.isMozilla){node.style.MozUserSelect=_141?"":"none";}else{if(d.isKhtml||d.isWebKit){node.style.KhtmlUserSelect=_141?"auto":"none";}else{if(d.isIE){var v=(node.unselectable=_141?"":"on");d.query("*",node).forEach("item.unselectable = '"+v+"'");}}}};var _142=function(node,ref){var _143=ref.parentNode;if(_143){_143.insertBefore(node,ref);}};var _144=function(node,ref){var _145=ref.parentNode;if(_145){if(_145.lastChild==ref){_145.appendChild(node);}else{_145.insertBefore(node,ref.nextSibling);}}};dojo.place=function(node,_146,_147){_146=byId(_146);if(typeof node=="string"){node=node.charAt(0)=="<"?d._toDom(node,_146.ownerDocument):byId(node);}if(typeof _147=="number"){var cn=_146.childNodes;if(!cn.length||cn.length<=_147){_146.appendChild(node);}else{_142(node,cn[_147<0?0:_147]);}}else{switch(_147){case "before":_142(node,_146);break;case "after":_144(node,_146);break;case "replace":_146.parentNode.replaceChild(node,_146);break;case "only":d.empty(_146);_146.appendChild(node);break;case "first":if(_146.firstChild){_142(node,_146.firstChild);break;}default:_146.appendChild(node);}}return node;};dojo.boxModel="content-box";if(d.isIE){d.boxModel=document.compatMode=="BackCompat"?"border-box":"content-box";}var gcs;if(d.isWebKit){gcs=function(node){var s;if(node.nodeType==1){var dv=node.ownerDocument.defaultView;s=dv.getComputedStyle(node,null);if(!s&&node.style){node.style.display="";s=dv.getComputedStyle(node,null);}}return s||{};};}else{if(d.isIE){gcs=function(node){return node.nodeType==1?node.currentStyle:{};};}else{gcs=function(node){return node.nodeType==1?node.ownerDocument.defaultView.getComputedStyle(node,null):{};};}}dojo.getComputedStyle=gcs;if(!d.isIE){d._toPixelValue=function(_148,_149){return parseFloat(_149)||0;};}else{d._toPixelValue=function(_14a,_14b){if(!_14b){return 0;}if(_14b=="medium"){return 4;}if(_14b.slice&&_14b.slice(-2)=="px"){return parseFloat(_14b);}with(_14a){var _14c=style.left;var _14d=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=_14b;_14b=style.pixelLeft;}catch(e){_14b=0;}style.left=_14c;runtimeStyle.left=_14d;}return _14b;};}var px=d._toPixelValue;var astr="DXImageTransform.Microsoft.Alpha";var af=function(n,f){try{return n.filters.item(astr);}catch(e){return f?{}:null;}};dojo._getOpacity=d.isIE?function(node){try{return af(node).Opacity/100;}catch(e){return 1;}}:function(node){return gcs(node).opacity;};dojo._setOpacity=d.isIE?function(node,_14e){var ov=_14e*100;node.style.zoom=1;af(node,1).Enabled=!(_14e==1);if(!af(node)){node.style.filter+=" progid:"+astr+"(Opacity="+ov+")";}else{af(node,1).Opacity=ov;}if(node.nodeName.toLowerCase()=="tr"){d.query("> td",node).forEach(function(i){d._setOpacity(i,_14e);});}return _14e;}:function(node,_14f){return node.style.opacity=_14f;};var _150={left:true,top:true};var _151=/margin|padding|width|height|max|min|offset/;var _152=function(node,type,_153){type=type.toLowerCase();if(d.isIE){if(_153=="auto"){if(type=="height"){return node.offsetHeight;}if(type=="width"){return node.offsetWidth;}}if(type=="fontweight"){switch(_153){case 700:return "bold";case 400:default:return "normal";}}}if(!(type in _150)){_150[type]=_151.test(type);}return _150[type]?px(node,_153):_153;};var _154=d.isIE?"styleFloat":"cssFloat",_155={"cssFloat":_154,"styleFloat":_154,"float":_154};dojo.style=function(node,_156,_157){var n=byId(node),args=arguments.length,op=(_156=="opacity");_156=_155[_156]||_156;if(args==3){return op?d._setOpacity(n,_157):n.style[_156]=_157;}if(args==2&&op){return d._getOpacity(n);}var s=gcs(n);if(args==2&&typeof _156!="string"){for(var x in _156){d.style(node,x,_156[x]);}return s;}return (args==1)?s:_152(n,_156,s[_156]||n.style[_156]);};dojo._getPadExtents=function(n,_158){var s=_158||gcs(n),l=px(n,s.paddingLeft),t=px(n,s.paddingTop);return {l:l,t:t,w:l+px(n,s.paddingRight),h:t+px(n,s.paddingBottom)};};dojo._getBorderExtents=function(n,_159){var ne="none",s=_159||gcs(n),bl=(s.borderLeftStyle!=ne?px(n,s.borderLeftWidth):0),bt=(s.borderTopStyle!=ne?px(n,s.borderTopWidth):0);return {l:bl,t:bt,w:bl+(s.borderRightStyle!=ne?px(n,s.borderRightWidth):0),h:bt+(s.borderBottomStyle!=ne?px(n,s.borderBottomWidth):0)};};dojo._getPadBorderExtents=function(n,_15a){var s=_15a||gcs(n),p=d._getPadExtents(n,s),b=d._getBorderExtents(n,s);return {l:p.l+b.l,t:p.t+b.t,w:p.w+b.w,h:p.h+b.h};};dojo._getMarginExtents=function(n,_15b){var s=_15b||gcs(n),l=px(n,s.marginLeft),t=px(n,s.marginTop),r=px(n,s.marginRight),b=px(n,s.marginBottom);if(d.isWebKit&&(s.position!="absolute")){r=l;}return {l:l,t:t,w:l+r,h:t+b};};dojo._getMarginBox=function(node,_15c){var s=_15c||gcs(node),me=d._getMarginExtents(node,s);var l=node.offsetLeft-me.l,t=node.offsetTop-me.t,p=node.parentNode;if(d.isMoz){var sl=parseFloat(s.left),st=parseFloat(s.top);if(!isNaN(sl)&&!isNaN(st)){l=sl,t=st;}else{if(p&&p.style){var pcs=gcs(p);if(pcs.overflow!="visible"){var be=d._getBorderExtents(p,pcs);l+=be.l,t+=be.t;}}}}else{if(d.isOpera||(d.isIE>7&&!d.isQuirks)){if(p){be=d._getBorderExtents(p);l-=be.l;t-=be.t;}}}return {l:l,t:t,w:node.offsetWidth+me.w,h:node.offsetHeight+me.h};};dojo._getContentBox=function(node,_15d){var s=_15d||gcs(node),pe=d._getPadExtents(node,s),be=d._getBorderExtents(node,s),w=node.clientWidth,h;if(!w){w=node.offsetWidth,h=node.offsetHeight;}else{h=node.clientHeight,be.w=be.h=0;}if(d.isOpera){pe.l+=be.l;pe.t+=be.t;}return {l:pe.l,t:pe.t,w:w-pe.w-be.w,h:h-pe.h-be.h};};dojo._getBorderBox=function(node,_15e){var s=_15e||gcs(node),pe=d._getPadExtents(node,s),cb=d._getContentBox(node,s);return {l:cb.l-pe.l,t:cb.t-pe.t,w:cb.w+pe.w,h:cb.h+pe.h};};dojo._setBox=function(node,l,t,w,h,u){u=u||"px";var s=node.style;if(!isNaN(l)){s.left=l+u;}if(!isNaN(t)){s.top=t+u;}if(w>=0){s.width=w+u;}if(h>=0){s.height=h+u;}};dojo._isButtonTag=function(node){return node.tagName=="BUTTON"||node.tagName=="INPUT"&&(node.getAttribute("type")||"").toUpperCase()=="BUTTON";};dojo._usesBorderBox=function(node){var n=node.tagName;return d.boxModel=="border-box"||n=="TABLE"||d._isButtonTag(node);};dojo._setContentSize=function(node,_15f,_160,_161){if(d._usesBorderBox(node)){var pb=d._getPadBorderExtents(node,_161);if(_15f>=0){_15f+=pb.w;}if(_160>=0){_160+=pb.h;}}d._setBox(node,NaN,NaN,_15f,_160);};dojo._setMarginBox=function(node,_162,_163,_164,_165,_166){var s=_166||gcs(node),bb=d._usesBorderBox(node),pb=bb?_167:d._getPadBorderExtents(node,s);if(d.isWebKit){if(d._isButtonTag(node)){var ns=node.style;if(_164>=0&&!ns.width){ns.width="4px";}if(_165>=0&&!ns.height){ns.height="4px";}}}var mb=d._getMarginExtents(node,s);if(_164>=0){_164=Math.max(_164-pb.w-mb.w,0);}if(_165>=0){_165=Math.max(_165-pb.h-mb.h,0);}d._setBox(node,_162,_163,_164,_165);};var _167={l:0,t:0,w:0,h:0};dojo.marginBox=function(node,box){var n=byId(node),s=gcs(n),b=box;return !b?d._getMarginBox(n,s):d._setMarginBox(n,b.l,b.t,b.w,b.h,s);};dojo.contentBox=function(node,box){var n=byId(node),s=gcs(n),b=box;return !b?d._getContentBox(n,s):d._setContentSize(n,b.w,b.h,s);};var _168=function(node,prop){if(!(node=(node||0).parentNode)){return 0;}var val,_169=0,_16a=d.body();while(node&&node.style){if(gcs(node).position=="fixed"){return 0;}val=node[prop];if(val){_169+=val-0;if(node==_16a){break;}}node=node.parentNode;}return _169;};dojo._docScroll=function(){var n=d.global;return "pageXOffset" in n?{x:n.pageXOffset,y:n.pageYOffset}:(n=d.doc.documentElement,n.clientHeight?{x:d._fixIeBiDiScrollLeft(n.scrollLeft),y:n.scrollTop}:(n=d.body(),{x:n.scrollLeft||0,y:n.scrollTop||0}));};dojo._isBodyLtr=function(){return "_bodyLtr" in d?d._bodyLtr:d._bodyLtr=(d.body().dir||d.doc.documentElement.dir||"ltr").toLowerCase()=="ltr";};dojo._getIeDocumentElementOffset=function(){var de=d.doc.documentElement;if(d.isIE<8){var r=de.getBoundingClientRect();var l=r.left,t=r.top;if(d.isIE<7){l+=de.clientLeft;t+=de.clientTop;}return {x:l<0?0:l,y:t<0?0:t};}else{return {x:0,y:0};}};dojo._fixIeBiDiScrollLeft=function(_16b){var dd=d.doc;if(d.isIE<8&&!d._isBodyLtr()){var de=d.isQuirks?dd.body:dd.documentElement;return _16b+de.clientWidth-de.scrollWidth;}return _16b;};dojo._abs=dojo.position=function(node,_16c){var db=d.body(),dh=db.parentNode,ret;node=byId(node);if(node["getBoundingClientRect"]){ret=node.getBoundingClientRect();ret={x:ret.left,y:ret.top,w:ret.right-ret.left,h:ret.bottom-ret.top};if(d.isIE){var _16d=d._getIeDocumentElementOffset();ret.x-=_16d.x+(d.isQuirks?db.clientLeft+db.offsetLeft:0);ret.y-=_16d.y+(d.isQuirks?db.clientTop+db.offsetTop:0);}else{if(d.isFF==3){var cs=gcs(dh);ret.x-=px(dh,cs.marginLeft)+px(dh,cs.borderLeftWidth);ret.y-=px(dh,cs.marginTop)+px(dh,cs.borderTopWidth);}}}else{ret={x:0,y:0,w:node.offsetWidth,h:node.offsetHeight};if(node["offsetParent"]){ret.x-=_168(node,"scrollLeft");ret.y-=_168(node,"scrollTop");var _16e=node;do{var n=_16e.offsetLeft,t=_16e.offsetTop;ret.x+=isNaN(n)?0:n;ret.y+=isNaN(t)?0:t;cs=gcs(_16e);if(_16e!=node){if(d.isMoz){ret.x+=2*px(_16e,cs.borderLeftWidth);ret.y+=2*px(_16e,cs.borderTopWidth);}else{ret.x+=px(_16e,cs.borderLeftWidth);ret.y+=px(_16e,cs.borderTopWidth);}}if(d.isMoz&&cs.position=="static"){var _16f=_16e.parentNode;while(_16f!=_16e.offsetParent){var pcs=gcs(_16f);if(pcs.position=="static"){ret.x+=px(_16e,pcs.borderLeftWidth);ret.y+=px(_16e,pcs.borderTopWidth);}_16f=_16f.parentNode;}}_16e=_16e.offsetParent;}while((_16e!=dh)&&_16e);}else{if(node.x&&node.y){ret.x+=isNaN(node.x)?0:node.x;ret.y+=isNaN(node.y)?0:node.y;}}}if(_16c){var _170=d._docScroll();ret.x+=_170.x;ret.y+=_170.y;}return ret;};dojo.coords=function(node,_171){var n=byId(node),s=gcs(n),mb=d._getMarginBox(n,s);var abs=d.position(n,_171);mb.x=abs.x;mb.y=abs.y;return mb;};var _172={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"},_173={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"},_174={innerHTML:1,className:1,htmlFor:d.isIE,value:1};var _175=function(name){return _173[name.toLowerCase()]||name;};var _176=function(node,name){var attr=node.getAttributeNode&&node.getAttributeNode(name);return attr&&attr.specified;};dojo.hasAttr=function(node,name){var lc=name.toLowerCase();return _174[_172[lc]||name]||_176(byId(node),_173[lc]||name);};var _177={},_178=0,_179=dojo._scopeName+"attrid",_17a={col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1};dojo.attr=function(node,name,_17b){node=byId(node);var args=arguments.length,prop;if(args==2&&typeof name!="string"){for(var x in name){d.attr(node,x,name[x]);}return node;}var lc=name.toLowerCase(),_17c=_172[lc]||name,_17d=_174[_17c],_17e=_173[lc]||name;if(args==3){do{if(_17c=="style"&&typeof _17b!="string"){d.style(node,_17b);break;}if(_17c=="innerHTML"){if(d.isIE&&node.tagName.toLowerCase() in _17a){d.empty(node);node.appendChild(d._toDom(_17b,node.ownerDocument));}else{node[_17c]=_17b;}break;}if(d.isFunction(_17b)){var _17f=d.attr(node,_179);if(!_17f){_17f=_178++;d.attr(node,_179,_17f);}if(!_177[_17f]){_177[_17f]={};}var h=_177[_17f][_17c];if(h){d.disconnect(h);}else{try{delete node[_17c];}catch(e){}}_177[_17f][_17c]=d.connect(node,_17c,_17b);break;}if(_17d||typeof _17b=="boolean"){node[_17c]=_17b;break;}node.setAttribute(_17e,_17b);}while(false);return node;}_17b=node[_17c];if(_17d&&typeof _17b!="undefined"){return _17b;}if(_17c!="href"&&(typeof _17b=="boolean"||d.isFunction(_17b))){return _17b;}return _176(node,_17e)?node.getAttribute(_17e):null;};dojo.removeAttr=function(node,name){byId(node).removeAttribute(_175(name));};dojo.getNodeProp=function(node,name){node=byId(node);var lc=name.toLowerCase(),_180=_172[lc]||name;if((_180 in node)&&_180!="href"){return node[_180];}var _181=_173[lc]||name;return _176(node,_181)?node.getAttribute(_181):null;};dojo.create=function(tag,_182,_183,pos){var doc=d.doc;if(_183){_183=byId(_183);doc=_183.ownerDocument;}if(typeof tag=="string"){tag=doc.createElement(tag);}if(_182){d.attr(tag,_182);}if(_183){d.place(tag,_183,pos);}return tag;};d.empty=d.isIE?function(node){node=byId(node);for(var c;c=node.lastChild;){d.destroy(c);}}:function(node){byId(node).innerHTML="";};var _184={option:["select"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","thead","tr"],legend:["fieldset"],caption:["table"],colgroup:["table"],col:["table","colgroup"],li:["ul"]},_185=/<\s*([\w\:]+)/,_186={},_187=0,_188="__"+d._scopeName+"ToDomId";for(var _189 in _184){var tw=_184[_189];tw.pre=_189=="option"?"<select multiple=\"multiple\">":"<"+tw.join("><")+">";tw.post="</"+tw.reverse().join("></")+">";}d._toDom=function(frag,doc){doc=doc||d.doc;var _18a=doc[_188];if(!_18a){doc[_188]=_18a=++_187+"";_186[_18a]=doc.createElement("div");}frag+="";var _18b=frag.match(_185),tag=_18b?_18b[1].toLowerCase():"",_18c=_186[_18a],wrap,i,fc,df;if(_18b&&_184[tag]){wrap=_184[tag];_18c.innerHTML=wrap.pre+frag+wrap.post;for(i=wrap.length;i;--i){_18c=_18c.firstChild;}}else{_18c.innerHTML=frag;}if(_18c.childNodes.length==1){return _18c.removeChild(_18c.firstChild);}df=doc.createDocumentFragment();while(fc=_18c.firstChild){df.appendChild(fc);}return df;};var _18d="className";dojo.hasClass=function(node,_18e){return ((" "+byId(node)[_18d]+" ").indexOf(" "+_18e+" ")>=0);};var _18f=/\s+/,a1=[""],_190=function(s){if(typeof s=="string"||s instanceof String){if(s.indexOf(" ")<0){a1[0]=s;return a1;}else{return s.split(_18f);}}return s;};dojo.addClass=function(node,_191){node=byId(node);_191=_190(_191);var cls=" "+node[_18d]+" ";for(var i=0,len=_191.length,c;i<len;++i){c=_191[i];if(c&&cls.indexOf(" "+c+" ")<0){cls+=c+" ";}}node[_18d]=d.trim(cls);};dojo.removeClass=function(node,_192){node=byId(node);var cls;if(_192!==undefined){_192=_190(_192);cls=" "+node[_18d]+" ";for(var i=0,len=_192.length;i<len;++i){cls=cls.replace(" "+_192[i]+" "," ");}cls=d.trim(cls);}else{cls="";}if(node[_18d]!=cls){node[_18d]=cls;}};dojo.toggleClass=function(node,_193,_194){if(_194===undefined){_194=!d.hasClass(node,_193);}d[_194?"addClass":"removeClass"](node,_193);};})();}if(!dojo._hasResource["dojo._base.NodeList"]){dojo._hasResource["dojo._base.NodeList"]=true;dojo.provide("dojo._base.NodeList");(function(){var d=dojo;var ap=Array.prototype,aps=ap.slice,apc=ap.concat;var tnl=function(a,_195,_196){if(!a.sort){a=aps.call(a,0);}var ctor=_196||this._NodeListCtor||d._NodeListCtor;a.constructor=ctor;dojo._mixin(a,ctor.prototype);a._NodeListCtor=ctor;return _195?a._stash(_195):a;};var _197=function(f,a,o){a=[0].concat(aps.call(a,0));o=o||d.global;return function(node){a[0]=node;return f.apply(o,a);};};var _198=function(f,o){return function(){this.forEach(_197(f,arguments,o));return this;};};var _199=function(f,o){return function(){return this.map(_197(f,arguments,o));};};var _19a=function(f,o){return function(){return this.filter(_197(f,arguments,o));};};var _19b=function(f,g,o){return function(){var a=arguments,body=_197(f,a,o);if(g.call(o||d.global,a)){return this.map(body);}this.forEach(body);return this;};};var _19c=function(a){return a.length==1&&(typeof a[0]=="string");};var _19d=function(node){var p=node.parentNode;if(p){p.removeChild(node);}};dojo.NodeList=function(){return tnl(Array.apply(null,arguments));};d._NodeListCtor=d.NodeList;var nl=d.NodeList,nlp=nl.prototype;nl._wrap=nlp._wrap=tnl;nl._adaptAsMap=_199;nl._adaptAsForEach=_198;nl._adaptAsFilter=_19a;nl._adaptWithCondition=_19b;d.forEach(["slice","splice"],function(name){var f=ap[name];nlp[name]=function(){return this._wrap(f.apply(this,arguments),name=="slice"?this:null);};});d.forEach(["indexOf","lastIndexOf","every","some"],function(name){var f=d[name];nlp[name]=function(){return f.apply(d,[this].concat(aps.call(arguments,0)));};});d.forEach(["attr","style"],function(name){nlp[name]=_19b(d[name],_19c);});d.forEach(["connect","addClass","removeClass","toggleClass","empty","removeAttr"],function(name){nlp[name]=_198(d[name]);});dojo.extend(dojo.NodeList,{_normalize:function(_19e,_19f){var _1a0=_19e.parse===true?true:false;if(typeof _19e.template=="string"){var _1a1=_19e.templateFunc||(dojo.string&&dojo.string.substitute);_19e=_1a1?_1a1(_19e.template,_19e):_19e;}var type=(typeof _19e);if(type=="string"||type=="number"){_19e=dojo._toDom(_19e,(_19f&&_19f.ownerDocument));if(_19e.nodeType==11){_19e=dojo._toArray(_19e.childNodes);}else{_19e=[_19e];}}else{if(!dojo.isArrayLike(_19e)){_19e=[_19e];}else{if(!dojo.isArray(_19e)){_19e=dojo._toArray(_19e);}}}if(_1a0){_19e._runParse=true;}return _19e;},_cloneNode:function(node){return node.cloneNode(true);},_place:function(ary,_1a2,_1a3,_1a4){if(_1a2.nodeType!=1&&_1a3=="only"){return;}var _1a5=_1a2,_1a6;var _1a7=ary.length;for(var i=_1a7-1;i>=0;i--){var node=(_1a4?this._cloneNode(ary[i]):ary[i]);if(ary._runParse&&dojo.parser&&dojo.parser.parse){if(!_1a6){_1a6=_1a5.ownerDocument.createElement("div");}_1a6.appendChild(node);dojo.parser.parse(_1a6);node=_1a6.firstChild;while(_1a6.firstChild){_1a6.removeChild(_1a6.firstChild);}}if(i==_1a7-1){dojo.place(node,_1a5,_1a3);}else{_1a5.parentNode.insertBefore(node,_1a5);}_1a5=node;}},_stash:function(_1a8){this._parent=_1a8;return this;},end:function(){if(this._parent){return this._parent;}else{return new this._NodeListCtor();}},concat:function(item){var t=d.isArray(this)?this:aps.call(this,0),m=d.map(arguments,function(a){return a&&!d.isArray(a)&&(typeof NodeList!="undefined"&&a.constructor===NodeList||a.constructor===this._NodeListCtor)?aps.call(a,0):a;});return this._wrap(apc.apply(t,m),this);},map:function(func,obj){return this._wrap(d.map(this,func,obj),this);},forEach:function(_1a9,_1aa){d.forEach(this,_1a9,_1aa);return this;},coords:_199(d.coords),position:_199(d.position),place:function(_1ab,_1ac){var item=d.query(_1ab)[0];return this.forEach(function(node){d.place(node,item,_1ac);});},orphan:function(_1ad){return (_1ad?d._filterQueryResult(this,_1ad):this).forEach(_19d);},adopt:function(_1ae,_1af){return d.query(_1ae).place(this[0],_1af)._stash(this);},query:function(_1b0){if(!_1b0){return this;}var ret=this.map(function(node){return d.query(_1b0,node).filter(function(_1b1){return _1b1!==undefined;});});return this._wrap(apc.apply([],ret),this);},filter:function(_1b2){var a=arguments,_1b3=this,_1b4=0;if(typeof _1b2=="string"){_1b3=d._filterQueryResult(this,a[0]);if(a.length==1){return _1b3._stash(this);}_1b4=1;}return this._wrap(d.filter(_1b3,a[_1b4],a[_1b4+1]),this);},addContent:function(_1b5,_1b6){_1b5=this._normalize(_1b5,this[0]);for(var i=0,node;node=this[i];i++){this._place(_1b5,node,_1b6,i>0);}return this;},instantiate:function(_1b7,_1b8){var c=d.isFunction(_1b7)?_1b7:d.getObject(_1b7);_1b8=_1b8||{};return this.forEach(function(node){new c(_1b8,node);});},at:function(){var t=new this._NodeListCtor();d.forEach(arguments,function(i){if(this[i]){t.push(this[i]);}},this);return t._stash(this);}});nl.events=["blur","focus","change","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","submit"];d.forEach(nl.events,function(evt){var _1b9="on"+evt;nlp[_1b9]=function(a,b){return this.connect(_1b9,a,b);};});})();}if(!dojo._hasResource["dojo._base.query"]){dojo._hasResource["dojo._base.query"]=true;if(typeof dojo!="undefined"){dojo.provide("dojo._base.query");}(function(d){var trim=d.trim;var each=d.forEach;var qlc=d._NodeListCtor=d.NodeList;var _1ba=function(){return d.doc;};var _1bb=((d.isWebKit||d.isMozilla)&&((_1ba().compatMode)=="BackCompat"));var _1bc=!!_1ba().firstChild["children"]?"children":"childNodes";var _1bd=">~+";var _1be=false;var _1bf=function(){return true;};var _1c0=function(_1c1){if(_1bd.indexOf(_1c1.slice(-1))>=0){_1c1+=" * ";}else{_1c1+=" ";}var ts=function(s,e){return trim(_1c1.slice(s,e));};var _1c2=[];var _1c3=-1,_1c4=-1,_1c5=-1,_1c6=-1,_1c7=-1,inId=-1,_1c8=-1,lc="",cc="",_1c9;var x=0,ql=_1c1.length,_1ca=null,_1cb=null;var _1cc=function(){if(_1c8>=0){var tv=(_1c8==x)?null:ts(_1c8,x);_1ca[(_1bd.indexOf(tv)<0)?"tag":"oper"]=tv;_1c8=-1;}};var _1cd=function(){if(inId>=0){_1ca.id=ts(inId,x).replace(/\\/g,"");inId=-1;}};var _1ce=function(){if(_1c7>=0){_1ca.classes.push(ts(_1c7+1,x).replace(/\\/g,""));_1c7=-1;}};var _1cf=function(){_1cd();_1cc();_1ce();};var _1d0=function(){_1cf();if(_1c6>=0){_1ca.pseudos.push({name:ts(_1c6+1,x)});}_1ca.loops=(_1ca.pseudos.length||_1ca.attrs.length||_1ca.classes.length);_1ca.oquery=_1ca.query=ts(_1c9,x);_1ca.otag=_1ca.tag=(_1ca["oper"])?null:(_1ca.tag||"*");if(_1ca.tag){_1ca.tag=_1ca.tag.toUpperCase();}if(_1c2.length&&(_1c2[_1c2.length-1].oper)){_1ca.infixOper=_1c2.pop();_1ca.query=_1ca.infixOper.query+" "+_1ca.query;}_1c2.push(_1ca);_1ca=null;};for(;lc=cc,cc=_1c1.charAt(x),x<ql;x++){if(lc=="\\"){continue;}if(!_1ca){_1c9=x;_1ca={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null,getTag:function(){return (_1be)?this.otag:this.tag;}};_1c8=x;}if(_1c3>=0){if(cc=="]"){if(!_1cb.attr){_1cb.attr=ts(_1c3+1,x);}else{_1cb.matchFor=ts((_1c5||_1c3+1),x);}var cmf=_1cb.matchFor;if(cmf){if((cmf.charAt(0)=="\"")||(cmf.charAt(0)=="'")){_1cb.matchFor=cmf.slice(1,-1);}}_1ca.attrs.push(_1cb);_1cb=null;_1c3=_1c5=-1;}else{if(cc=="="){var _1d1=("|~^$*".indexOf(lc)>=0)?lc:"";_1cb.type=_1d1+cc;_1cb.attr=ts(_1c3+1,x-_1d1.length);_1c5=x+1;}}}else{if(_1c4>=0){if(cc==")"){if(_1c6>=0){_1cb.value=ts(_1c4+1,x);}_1c6=_1c4=-1;}}else{if(cc=="#"){_1cf();inId=x+1;}else{if(cc=="."){_1cf();_1c7=x;}else{if(cc==":"){_1cf();_1c6=x;}else{if(cc=="["){_1cf();_1c3=x;_1cb={};}else{if(cc=="("){if(_1c6>=0){_1cb={name:ts(_1c6+1,x),value:null};_1ca.pseudos.push(_1cb);}_1c4=x;}else{if((cc==" ")&&(lc!=cc)){_1d0();}}}}}}}}}return _1c2;};var _1d2=function(_1d3,_1d4){if(!_1d3){return _1d4;}if(!_1d4){return _1d3;}return function(){return _1d3.apply(window,arguments)&&_1d4.apply(window,arguments);};};var _1d5=function(i,arr){var r=arr||[];if(i){r.push(i);}return r;};var _1d6=function(n){return (1==n.nodeType);};var _1d7="";var _1d8=function(elem,attr){if(!elem){return _1d7;}if(attr=="class"){return elem.className||_1d7;}if(attr=="for"){return elem.htmlFor||_1d7;}if(attr=="style"){return elem.style.cssText||_1d7;}return (_1be?elem.getAttribute(attr):elem.getAttribute(attr,2))||_1d7;};var _1d9={"*=":function(attr,_1da){return function(elem){return (_1d8(elem,attr).indexOf(_1da)>=0);};},"^=":function(attr,_1db){return function(elem){return (_1d8(elem,attr).indexOf(_1db)==0);};},"$=":function(attr,_1dc){var tval=" "+_1dc;return function(elem){var ea=" "+_1d8(elem,attr);return (ea.lastIndexOf(_1dc)==(ea.length-_1dc.length));};},"~=":function(attr,_1dd){var tval=" "+_1dd+" ";return function(elem){var ea=" "+_1d8(elem,attr)+" ";return (ea.indexOf(tval)>=0);};},"|=":function(attr,_1de){var _1df=" "+_1de+"-";return function(elem){var ea=" "+_1d8(elem,attr);return ((ea==_1de)||(ea.indexOf(_1df)==0));};},"=":function(attr,_1e0){return function(elem){return (_1d8(elem,attr)==_1e0);};}};var _1e1=(typeof _1ba().firstChild.nextElementSibling=="undefined");var _1e2=!_1e1?"nextElementSibling":"nextSibling";var _1e3=!_1e1?"previousElementSibling":"previousSibling";var _1e4=(_1e1?_1d6:_1bf);var _1e5=function(node){while(node=node[_1e3]){if(_1e4(node)){return false;}}return true;};var _1e6=function(node){while(node=node[_1e2]){if(_1e4(node)){return false;}}return true;};var _1e7=function(node){var root=node.parentNode;var i=0,tret=root[_1bc],ci=(node["_i"]||-1),cl=(root["_l"]||-1);if(!tret){return -1;}var l=tret.length;if(cl==l&&ci>=0&&cl>=0){return ci;}root["_l"]=l;ci=-1;for(var te=root["firstElementChild"]||root["firstChild"];te;te=te[_1e2]){if(_1e4(te)){te["_i"]=++i;if(node===te){ci=i;}}}return ci;};var _1e8=function(elem){return !((_1e7(elem))%2);};var _1e9=function(elem){return ((_1e7(elem))%2);};var _1ea={"checked":function(name,_1eb){return function(elem){return !!("checked" in elem?elem.checked:elem.selected);};},"first-child":function(){return _1e5;},"last-child":function(){return _1e6;},"only-child":function(name,_1ec){return function(node){if(!_1e5(node)){return false;}if(!_1e6(node)){return false;}return true;};},"empty":function(name,_1ed){return function(elem){var cn=elem.childNodes;var cnl=elem.childNodes.length;for(var x=cnl-1;x>=0;x--){var nt=cn[x].nodeType;if((nt===1)||(nt==3)){return false;}}return true;};},"contains":function(name,_1ee){var cz=_1ee.charAt(0);if(cz=="\""||cz=="'"){_1ee=_1ee.slice(1,-1);}return function(elem){return (elem.innerHTML.indexOf(_1ee)>=0);};},"not":function(name,_1ef){var p=_1c0(_1ef)[0];var _1f0={el:1};if(p.tag!="*"){_1f0.tag=1;}if(!p.classes.length){_1f0.classes=1;}var ntf=_1f1(p,_1f0);return function(elem){return (!ntf(elem));};},"nth-child":function(name,_1f2){var pi=parseInt;if(_1f2=="odd"){return _1e9;}else{if(_1f2=="even"){return _1e8;}}if(_1f2.indexOf("n")!=-1){var _1f3=_1f2.split("n",2);var pred=_1f3[0]?((_1f3[0]=="-")?-1:pi(_1f3[0])):1;var idx=_1f3[1]?pi(_1f3[1]):0;var lb=0,ub=-1;if(pred>0){if(idx<0){idx=(idx%pred)&&(pred+(idx%pred));}else{if(idx>0){if(idx>=pred){lb=idx-idx%pred;}idx=idx%pred;}}}else{if(pred<0){pred*=-1;if(idx>0){ub=idx;idx=idx%pred;}}}if(pred>0){return function(elem){var i=_1e7(elem);return (i>=lb)&&(ub<0||i<=ub)&&((i%pred)==idx);};}else{_1f2=idx;}}var _1f4=pi(_1f2);return function(elem){return (_1e7(elem)==_1f4);};}};var _1f5=(d.isIE)?function(cond){var clc=cond.toLowerCase();if(clc=="class"){cond="className";}return function(elem){return (_1be?elem.getAttribute(cond):elem[cond]||elem[clc]);};}:function(cond){return function(elem){return (elem&&elem.getAttribute&&elem.hasAttribute(cond));};};var _1f1=function(_1f6,_1f7){if(!_1f6){return _1bf;}_1f7=_1f7||{};var ff=null;if(!("el" in _1f7)){ff=_1d2(ff,_1d6);}if(!("tag" in _1f7)){if(_1f6.tag!="*"){ff=_1d2(ff,function(elem){return (elem&&(elem.tagName==_1f6.getTag()));});}}if(!("classes" in _1f7)){each(_1f6.classes,function(_1f8,idx,arr){var re=new RegExp("(?:^|\\s)"+_1f8+"(?:\\s|$)");ff=_1d2(ff,function(elem){return re.test(elem.className);});ff.count=idx;});}if(!("pseudos" in _1f7)){each(_1f6.pseudos,function(_1f9){var pn=_1f9.name;if(_1ea[pn]){ff=_1d2(ff,_1ea[pn](pn,_1f9.value));}});}if(!("attrs" in _1f7)){each(_1f6.attrs,function(attr){var _1fa;var a=attr.attr;if(attr.type&&_1d9[attr.type]){_1fa=_1d9[attr.type](a,attr.matchFor);}else{if(a.length){_1fa=_1f5(a);}}if(_1fa){ff=_1d2(ff,_1fa);}});}if(!("id" in _1f7)){if(_1f6.id){ff=_1d2(ff,function(elem){return (!!elem&&(elem.id==_1f6.id));});}}if(!ff){if(!("default" in _1f7)){ff=_1bf;}}return ff;};var _1fb=function(_1fc){return function(node,ret,bag){while(node=node[_1e2]){if(_1e1&&(!_1d6(node))){continue;}if((!bag||_1fd(node,bag))&&_1fc(node)){ret.push(node);}break;}return ret;};};var _1fe=function(_1ff){return function(root,ret,bag){var te=root[_1e2];while(te){if(_1e4(te)){if(bag&&!_1fd(te,bag)){break;}if(_1ff(te)){ret.push(te);}}te=te[_1e2];}return ret;};};var _200=function(_201){_201=_201||_1bf;return function(root,ret,bag){var te,x=0,tret=root[_1bc];while(te=tret[x++]){if(_1e4(te)&&(!bag||_1fd(te,bag))&&(_201(te,x))){ret.push(te);}}return ret;};};var _202=function(node,root){var pn=node.parentNode;while(pn){if(pn==root){break;}pn=pn.parentNode;}return !!pn;};var _203={};var _204=function(_205){var _206=_203[_205.query];if(_206){return _206;}var io=_205.infixOper;var oper=(io?io.oper:"");var _207=_1f1(_205,{el:1});var qt=_205.tag;var _208=("*"==qt);var ecs=_1ba()["getElementsByClassName"];if(!oper){if(_205.id){_207=(!_205.loops&&_208)?_1bf:_1f1(_205,{el:1,id:1});_206=function(root,arr){var te=d.byId(_205.id,(root.ownerDocument||root));if(!te||!_207(te)){return;}if(9==root.nodeType){return _1d5(te,arr);}else{if(_202(te,root)){return _1d5(te,arr);}}};}else{if(ecs&&/\{\s*\[native code\]\s*\}/.test(String(ecs))&&_205.classes.length&&!_1bb){_207=_1f1(_205,{el:1,classes:1,id:1});var _209=_205.classes.join(" ");_206=function(root,arr,bag){var ret=_1d5(0,arr),te,x=0;var tret=root.getElementsByClassName(_209);while((te=tret[x++])){if(_207(te,root)&&_1fd(te,bag)){ret.push(te);}}return ret;};}else{if(!_208&&!_205.loops){_206=function(root,arr,bag){var ret=_1d5(0,arr),te,x=0;var tret=root.getElementsByTagName(_205.getTag());while((te=tret[x++])){if(_1fd(te,bag)){ret.push(te);}}return ret;};}else{_207=_1f1(_205,{el:1,tag:1,id:1});_206=function(root,arr,bag){var ret=_1d5(0,arr),te,x=0;var tret=root.getElementsByTagName(_205.getTag());while((te=tret[x++])){if(_207(te,root)&&_1fd(te,bag)){ret.push(te);}}return ret;};}}}}else{var _20a={el:1};if(_208){_20a.tag=1;}_207=_1f1(_205,_20a);if("+"==oper){_206=_1fb(_207);}else{if("~"==oper){_206=_1fe(_207);}else{if(">"==oper){_206=_200(_207);}}}}return _203[_205.query]=_206;};var _20b=function(root,_20c){var _20d=_1d5(root),qp,x,te,qpl=_20c.length,bag,ret;for(var i=0;i<qpl;i++){ret=[];qp=_20c[i];x=_20d.length-1;if(x>0){bag={};ret.nozip=true;}var gef=_204(qp);for(var j=0;(te=_20d[j]);j++){gef(te,ret,bag);}if(!ret.length){break;}_20d=ret;}return ret;};var _20e={},_20f={};var _210=function(_211){var _212=_1c0(trim(_211));if(_212.length==1){var tef=_204(_212[0]);return function(root){var r=tef(root,new qlc());if(r){r.nozip=true;}return r;};}return function(root){return _20b(root,_212);};};var nua=navigator.userAgent;var wk="WebKit/";var _213=(d.isWebKit&&(nua.indexOf(wk)>0)&&(parseFloat(nua.split(wk)[1])>528));var _214=d.isIE?"commentStrip":"nozip";var qsa="querySelectorAll";var _215=(!!_1ba()[qsa]&&(!d.isSafari||(d.isSafari>3.1)||_213));var _216=/n\+\d|([^ ])?([>~+])([^ =])?/g;var _217=function(_218,pre,ch,post){return ch?(pre?pre+" ":"")+ch+(post?" "+post:""):_218;};var _219=function(_21a,_21b){_21a=_21a.replace(_216,_217);if(_215){var _21c=_20f[_21a];if(_21c&&!_21b){return _21c;}}var _21d=_20e[_21a];if(_21d){return _21d;}var qcz=_21a.charAt(0);var _21e=(-1==_21a.indexOf(" "));if((_21a.indexOf("#")>=0)&&(_21e)){_21b=true;}var _21f=(_215&&(!_21b)&&(_1bd.indexOf(qcz)==-1)&&(!d.isIE||(_21a.indexOf(":")==-1))&&(!(_1bb&&(_21a.indexOf(".")>=0)))&&(_21a.indexOf(":contains")==-1)&&(_21a.indexOf(":checked")==-1)&&(_21a.indexOf("|=")==-1));if(_21f){var tq=(_1bd.indexOf(_21a.charAt(_21a.length-1))>=0)?(_21a+" *"):_21a;return _20f[_21a]=function(root){try{if(!((9==root.nodeType)||_21e)){throw "";}var r=root[qsa](tq);r[_214]=true;return r;}catch(e){return _219(_21a,true)(root);}};}else{var _220=_21a.split(/\s*,\s*/);return _20e[_21a]=((_220.length<2)?_210(_21a):function(root){var _221=0,ret=[],tp;while((tp=_220[_221++])){ret=ret.concat(_210(tp)(root));}return ret;});}};var _222=0;var _223=d.isIE?function(node){if(_1be){return (node.getAttribute("_uid")||node.setAttribute("_uid",++_222)||_222);}else{return node.uniqueID;}}:function(node){return (node._uid||(node._uid=++_222));};var _1fd=function(node,bag){if(!bag){return 1;}var id=_223(node);if(!bag[id]){return bag[id]=1;}return 0;};var _224="_zipIdx";var _225=function(arr){if(arr&&arr.nozip){return (qlc._wrap)?qlc._wrap(arr):arr;}var ret=new qlc();if(!arr||!arr.length){return ret;}if(arr[0]){ret.push(arr[0]);}if(arr.length<2){return ret;}_222++;if(d.isIE&&_1be){var _226=_222+"";arr[0].setAttribute(_224,_226);for(var x=1,te;te=arr[x];x++){if(arr[x].getAttribute(_224)!=_226){ret.push(te);}te.setAttribute(_224,_226);}}else{if(d.isIE&&arr.commentStrip){try{for(var x=1,te;te=arr[x];x++){if(_1d6(te)){ret.push(te);}}}catch(e){}}else{if(arr[0]){arr[0][_224]=_222;}for(var x=1,te;te=arr[x];x++){if(arr[x][_224]!=_222){ret.push(te);}te[_224]=_222;}}}return ret;};d.query=function(_227,root){qlc=d._NodeListCtor;if(!_227){return new qlc();}if(_227.constructor==qlc){return _227;}if(typeof _227!="string"){return new qlc(_227);}if(typeof root=="string"){root=d.byId(root);if(!root){return new qlc();}}root=root||_1ba();var od=root.ownerDocument||root.documentElement;_1be=(root.contentType&&root.contentType=="application/xml")||(d.isOpera&&(root.doctype||od.toString()=="[object XMLDocument]"))||(!!od)&&(d.isIE?od.xml:(root.xmlVersion||od.xmlVersion));var r=_219(_227)(root);if(r&&r.nozip&&!qlc._wrap){return r;}return _225(r);};d.query.pseudos=_1ea;d._filterQueryResult=function(_228,_229){var _22a=new d._NodeListCtor();var _22b=_1f1(_1c0(_229)[0]);for(var x=0,te;te=_228[x];x++){if(_22b(te)){_22a.push(te);}}return _22a;};})(this["queryPortability"]||this["acme"]||dojo);}if(!dojo._hasResource["dojo._base.xhr"]){dojo._hasResource["dojo._base.xhr"]=true;dojo.provide("dojo._base.xhr");(function(){var _22c=dojo,cfg=_22c.config;function _22d(obj,name,_22e){if(_22e===null){return;}var val=obj[name];if(typeof val=="string"){obj[name]=[val,_22e];}else{if(_22c.isArray(val)){val.push(_22e);}else{obj[name]=_22e;}}};dojo.fieldToObject=function(_22f){var ret=null;var item=_22c.byId(_22f);if(item){var _230=item.name;var type=(item.type||"").toLowerCase();if(_230&&type&&!item.disabled){if(type=="radio"||type=="checkbox"){if(item.checked){ret=item.value;}}else{if(item.multiple){ret=[];_22c.query("option",item).forEach(function(opt){if(opt.selected){ret.push(opt.value);}});}else{ret=item.value;}}}}return ret;};dojo.formToObject=function(_231){var ret={};var _232="file|submit|image|reset|button|";_22c.forEach(dojo.byId(_231).elements,function(item){var _233=item.name;var type=(item.type||"").toLowerCase();if(_233&&type&&_232.indexOf(type)==-1&&!item.disabled){_22d(ret,_233,_22c.fieldToObject(item));if(type=="image"){ret[_233+".x"]=ret[_233+".y"]=ret[_233].x=ret[_233].y=0;}}});return ret;};dojo.objectToQuery=function(map){var enc=encodeURIComponent;var _234=[];var _235={};for(var name in map){var _236=map[name];if(_236!=_235[name]){var _237=enc(name)+"=";if(_22c.isArray(_236)){for(var i=0;i<_236.length;i++){_234.push(_237+enc(_236[i]));}}else{_234.push(_237+enc(_236));}}}return _234.join("&");};dojo.formToQuery=function(_238){return _22c.objectToQuery(_22c.formToObject(_238));};dojo.formToJson=function(_239,_23a){return _22c.toJson(_22c.formToObject(_239),_23a);};dojo.queryToObject=function(str){var ret={};var qp=str.split("&");var dec=decodeURIComponent;_22c.forEach(qp,function(item){if(item.length){var _23b=item.split("=");var name=dec(_23b.shift());var val=dec(_23b.join("="));if(typeof ret[name]=="string"){ret[name]=[ret[name]];}if(_22c.isArray(ret[name])){ret[name].push(val);}else{ret[name]=val;}}});return ret;};dojo._blockAsync=false;var _23c=_22c._contentHandlers=dojo.contentHandlers={text:function(xhr){return xhr.responseText;},json:function(xhr){return _22c.fromJson(xhr.responseText||null);},"json-comment-filtered":function(xhr){if(!dojo.config.useCommentedJson){console.warn("Consider using the standard mimetype:application/json."+" json-commenting can introduce security issues. To"+" decrease the chances of hijacking, use the standard the 'json' handler and"+" prefix your json with: {}&&\n"+"Use djConfig.useCommentedJson=true to turn off this message.");}var _23d=xhr.responseText;var _23e=_23d.indexOf("/*");var _23f=_23d.lastIndexOf("*/");if(_23e==-1||_23f==-1){throw new Error("JSON was not comment filtered");}return _22c.fromJson(_23d.substring(_23e+2,_23f));},javascript:function(xhr){return _22c.eval(xhr.responseText);},xml:function(xhr){var _240=xhr.responseXML;if(_22c.isIE&&(!_240||!_240.documentElement)){var ms=function(n){return "MSXML"+n+".DOMDocument";};var dp=["Microsoft.XMLDOM",ms(6),ms(4),ms(3),ms(2)];_22c.some(dp,function(p){try{var dom=new ActiveXObject(p);dom.async=false;dom.loadXML(xhr.responseText);_240=dom;}catch(e){return false;}return true;});}return _240;},"json-comment-optional":function(xhr){if(xhr.responseText&&/^[^{\[]*\/\*/.test(xhr.responseText)){return _23c["json-comment-filtered"](xhr);}else{return _23c["json"](xhr);}}};dojo._ioSetArgs=function(args,_241,_242,_243){var _244={args:args,url:args.url};var _245=null;if(args.form){var form=_22c.byId(args.form);var _246=form.getAttributeNode("action");_244.url=_244.url||(_246?_246.value:null);_245=_22c.formToObject(form);}var _247=[{}];if(_245){_247.push(_245);}if(args.content){_247.push(args.content);}if(args.preventCache){_247.push({"dojo.preventCache":new Date().valueOf()});}_244.query=_22c.objectToQuery(_22c.mixin.apply(null,_247));_244.handleAs=args.handleAs||"text";var d=new _22c.Deferred(_241);d.addCallbacks(_242,function(_248){return _243(_248,d);});var ld=args.load;if(ld&&_22c.isFunction(ld)){d.addCallback(function(_249){return ld.call(args,_249,_244);});}var err=args.error;if(err&&_22c.isFunction(err)){d.addErrback(function(_24a){return err.call(args,_24a,_244);});}var _24b=args.handle;if(_24b&&_22c.isFunction(_24b)){d.addBoth(function(_24c){return _24b.call(args,_24c,_244);});}if(cfg.ioPublish&&_22c.publish&&_244.args.ioPublish!==false){d.addCallbacks(function(res){_22c.publish("/dojo/io/load",[d,res]);return res;},function(res){_22c.publish("/dojo/io/error",[d,res]);return res;});d.addBoth(function(res){_22c.publish("/dojo/io/done",[d,res]);return res;});}d.ioArgs=_244;return d;};var _24d=function(dfd){dfd.canceled=true;var xhr=dfd.ioArgs.xhr;var _24e=typeof xhr.abort;if(_24e=="function"||_24e=="object"||_24e=="unknown"){xhr.abort();}var err=dfd.ioArgs.error;if(!err){err=new Error("xhr cancelled");err.dojoType="cancel";}return err;};var _24f=function(dfd){var ret=_23c[dfd.ioArgs.handleAs](dfd.ioArgs.xhr);return ret===undefined?null:ret;};var _250=function(_251,dfd){if(!dfd.ioArgs.args.failOk){console.error(_251);}return _251;};var _252=null;var _253=[];var _254=0;var _255=function(dfd){if(_254<=0){_254=0;if(cfg.ioPublish&&_22c.publish&&(!dfd||dfd&&dfd.ioArgs.args.ioPublish!==false)){_22c.publish("/dojo/io/stop");}}};var _256=function(){var now=(new Date()).getTime();if(!_22c._blockAsync){for(var i=0,tif;i<_253.length&&(tif=_253[i]);i++){var dfd=tif.dfd;var func=function(){if(!dfd||dfd.canceled||!tif.validCheck(dfd)){_253.splice(i--,1);_254-=1;}else{if(tif.ioCheck(dfd)){_253.splice(i--,1);tif.resHandle(dfd);_254-=1;}else{if(dfd.startTime){if(dfd.startTime+(dfd.ioArgs.args.timeout||0)<now){_253.splice(i--,1);var err=new Error("timeout exceeded");err.dojoType="timeout";dfd.errback(err);dfd.cancel();_254-=1;}}}}};if(dojo.config.debugAtAllCosts){func.call(this);}else{try{func.call(this);}catch(e){dfd.errback(e);}}}}_255(dfd);if(!_253.length){clearInterval(_252);_252=null;return;}};dojo._ioCancelAll=function(){try{_22c.forEach(_253,function(i){try{i.dfd.cancel();}catch(e){}});}catch(e){}};if(_22c.isIE){_22c.addOnWindowUnload(_22c._ioCancelAll);}_22c._ioNotifyStart=function(dfd){if(cfg.ioPublish&&_22c.publish&&dfd.ioArgs.args.ioPublish!==false){if(!_254){_22c.publish("/dojo/io/start");}_254+=1;_22c.publish("/dojo/io/send",[dfd]);}};_22c._ioWatch=function(dfd,_257,_258,_259){var args=dfd.ioArgs.args;if(args.timeout){dfd.startTime=(new Date()).getTime();}_253.push({dfd:dfd,validCheck:_257,ioCheck:_258,resHandle:_259});if(!_252){_252=setInterval(_256,50);}if(args.sync){_256();}};var _25a="application/x-www-form-urlencoded";var _25b=function(dfd){return dfd.ioArgs.xhr.readyState;};var _25c=function(dfd){return 4==dfd.ioArgs.xhr.readyState;};var _25d=function(dfd){var xhr=dfd.ioArgs.xhr;if(_22c._isDocumentOk(xhr)){dfd.callback(dfd);}else{var err=new Error("Unable to load "+dfd.ioArgs.url+" status:"+xhr.status);err.status=xhr.status;err.responseText=xhr.responseText;dfd.errback(err);}};dojo._ioAddQueryToUrl=function(_25e){if(_25e.query.length){_25e.url+=(_25e.url.indexOf("?")==-1?"?":"&")+_25e.query;_25e.query=null;}};dojo.xhr=function(_25f,args,_260){var dfd=_22c._ioSetArgs(args,_24d,_24f,_250);var _261=dfd.ioArgs;var xhr=_261.xhr=_22c._xhrObj(_261.args);if(!xhr){dfd.cancel();return dfd;}if("postData" in args){_261.query=args.postData;}else{if("putData" in args){_261.query=args.putData;}else{if("rawBody" in args){_261.query=args.rawBody;}else{if((arguments.length>2&&!_260)||"POST|PUT".indexOf(_25f.toUpperCase())==-1){_22c._ioAddQueryToUrl(_261);}}}}xhr.open(_25f,_261.url,args.sync!==true,args.user||undefined,args.password||undefined);if(args.headers){for(var hdr in args.headers){if(hdr.toLowerCase()==="content-type"&&!args.contentType){args.contentType=args.headers[hdr];}else{if(args.headers[hdr]){xhr.setRequestHeader(hdr,args.headers[hdr]);}}}}xhr.setRequestHeader("Content-Type",args.contentType||_25a);if(!args.headers||!("X-Requested-With" in args.headers)){xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");}_22c._ioNotifyStart(dfd);if(dojo.config.debugAtAllCosts){xhr.send(_261.query);}else{try{xhr.send(_261.query);}catch(e){_261.error=e;dfd.cancel();}}_22c._ioWatch(dfd,_25b,_25c,_25d);xhr=null;return dfd;};dojo.xhrGet=function(args){return _22c.xhr("GET",args);};dojo.rawXhrPost=dojo.xhrPost=function(args){return _22c.xhr("POST",args,true);};dojo.rawXhrPut=dojo.xhrPut=function(args){return _22c.xhr("PUT",args,true);};dojo.xhrDelete=function(args){return _22c.xhr("DELETE",args);};})();}if(!dojo._hasResource["dojo._base.fx"]){dojo._hasResource["dojo._base.fx"]=true;dojo.provide("dojo._base.fx");(function(){var d=dojo;var _262=d._mixin;dojo._Line=function(_263,end){this.start=_263;this.end=end;};dojo._Line.prototype.getValue=function(n){return ((this.end-this.start)*n)+this.start;};dojo.Animation=function(args){_262(this,args);if(d.isArray(this.curve)){this.curve=new d._Line(this.curve[0],this.curve[1]);}};d._Animation=d.Animation;d.extend(dojo.Animation,{duration:350,repeat:0,rate:20,_percent:0,_startRepeatCount:0,_getStep:function(){var _264=this._percent,_265=this.easing;return _265?_265(_264):_264;},_fire:function(evt,args){var a=args||[];if(this[evt]){if(d.config.debugAtAllCosts){this[evt].apply(this,a);}else{try{this[evt].apply(this,a);}catch(e){console.error("exception in animation handler for:",evt);console.error(e);}}}return this;},play:function(_266,_267){var _268=this;if(_268._delayTimer){_268._clearTimer();}if(_267){_268._stopTimer();_268._active=_268._paused=false;_268._percent=0;}else{if(_268._active&&!_268._paused){return _268;}}_268._fire("beforeBegin",[_268.node]);var de=_266||_268.delay,_269=dojo.hitch(_268,"_play",_267);if(de>0){_268._delayTimer=setTimeout(_269,de);return _268;}_269();return _268;},_play:function(_26a){var _26b=this;if(_26b._delayTimer){_26b._clearTimer();}_26b._startTime=new Date().valueOf();if(_26b._paused){_26b._startTime-=_26b.duration*_26b._percent;}_26b._endTime=_26b._startTime+_26b.duration;_26b._active=true;_26b._paused=false;var _26c=_26b.curve.getValue(_26b._getStep());if(!_26b._percent){if(!_26b._startRepeatCount){_26b._startRepeatCount=_26b.repeat;}_26b._fire("onBegin",[_26c]);}_26b._fire("onPlay",[_26c]);_26b._cycle();return _26b;},pause:function(){var _26d=this;if(_26d._delayTimer){_26d._clearTimer();}_26d._stopTimer();if(!_26d._active){return _26d;}_26d._paused=true;_26d._fire("onPause",[_26d.curve.getValue(_26d._getStep())]);return _26d;},gotoPercent:function(_26e,_26f){var _270=this;_270._stopTimer();_270._active=_270._paused=true;_270._percent=_26e;if(_26f){_270.play();}return _270;},stop:function(_271){var _272=this;if(_272._delayTimer){_272._clearTimer();}if(!_272._timer){return _272;}_272._stopTimer();if(_271){_272._percent=1;}_272._fire("onStop",[_272.curve.getValue(_272._getStep())]);_272._active=_272._paused=false;return _272;},status:function(){if(this._active){return this._paused?"paused":"playing";}return "stopped";},_cycle:function(){var _273=this;if(_273._active){var curr=new Date().valueOf();var step=(curr-_273._startTime)/(_273._endTime-_273._startTime);if(step>=1){step=1;}_273._percent=step;if(_273.easing){step=_273.easing(step);}_273._fire("onAnimate",[_273.curve.getValue(step)]);if(_273._percent<1){_273._startTimer();}else{_273._active=false;if(_273.repeat>0){_273.repeat--;_273.play(null,true);}else{if(_273.repeat==-1){_273.play(null,true);}else{if(_273._startRepeatCount){_273.repeat=_273._startRepeatCount;_273._startRepeatCount=0;}}}_273._percent=0;_273._fire("onEnd",[_273.node]);!_273.repeat&&_273._stopTimer();}}return _273;},_clearTimer:function(){clearTimeout(this._delayTimer);delete this._delayTimer;}});var ctr=0,_274=[],_275=null,_276={run:function(){}};d.extend(d.Animation,{_startTimer:function(){if(!this._timer){this._timer=d.connect(_276,"run",this,"_cycle");ctr++;}if(!_275){_275=setInterval(d.hitch(_276,"run"),this.rate);}},_stopTimer:function(){if(this._timer){d.disconnect(this._timer);this._timer=null;ctr--;}if(ctr<=0){clearInterval(_275);_275=null;ctr=0;}}});var _277=d.isIE?function(node){var ns=node.style;if(!ns.width.length&&d.style(node,"width")=="auto"){ns.width="auto";}}:function(){};dojo._fade=function(args){args.node=d.byId(args.node);var _278=_262({properties:{}},args),_279=(_278.properties.opacity={});_279.start=!("start" in _278)?function(){return +d.style(_278.node,"opacity")||0;}:_278.start;_279.end=_278.end;var anim=d.animateProperty(_278);d.connect(anim,"beforeBegin",d.partial(_277,_278.node));return anim;};dojo.fadeIn=function(args){return d._fade(_262({end:1},args));};dojo.fadeOut=function(args){return d._fade(_262({end:0},args));};dojo._defaultEasing=function(n){return 0.5+((Math.sin((n+1.5)*Math.PI))/2);};var _27a=function(_27b){this._properties=_27b;for(var p in _27b){var prop=_27b[p];if(prop.start instanceof d.Color){prop.tempColor=new d.Color();}}};_27a.prototype.getValue=function(r){var ret={};for(var p in this._properties){var prop=this._properties[p],_27c=prop.start;if(_27c instanceof d.Color){ret[p]=d.blendColors(_27c,prop.end,r,prop.tempColor).toCss();}else{if(!d.isArray(_27c)){ret[p]=((prop.end-_27c)*r)+_27c+(p!="opacity"?prop.units||"px":0);}}}return ret;};dojo.animateProperty=function(args){var n=args.node=d.byId(args.node);if(!args.easing){args.easing=d._defaultEasing;}var anim=new d.Animation(args);d.connect(anim,"beforeBegin",anim,function(){var pm={};for(var p in this.properties){if(p=="width"||p=="height"){this.node.display="block";}var prop=this.properties[p];if(d.isFunction(prop)){prop=prop(n);}prop=pm[p]=_262({},(d.isObject(prop)?prop:{end:prop}));if(d.isFunction(prop.start)){prop.start=prop.start(n);}if(d.isFunction(prop.end)){prop.end=prop.end(n);}var _27d=(p.toLowerCase().indexOf("color")>=0);function _27e(node,p){var v={height:node.offsetHeight,width:node.offsetWidth}[p];if(v!==undefined){return v;}v=d.style(node,p);return (p=="opacity")?+v:(_27d?v:parseFloat(v));};if(!("end" in prop)){prop.end=_27e(n,p);}else{if(!("start" in prop)){prop.start=_27e(n,p);}}if(_27d){prop.start=new d.Color(prop.start);prop.end=new d.Color(prop.end);}else{prop.start=(p=="opacity")?+prop.start:parseFloat(prop.start);}}this.curve=new _27a(pm);});d.connect(anim,"onAnimate",d.hitch(d,"style",anim.node));return anim;};dojo.anim=function(node,_27f,_280,_281,_282,_283){return d.animateProperty({node:node,duration:_280||d.Animation.prototype.duration,properties:_27f,easing:_281,onEnd:_282}).play(_283||0);};})();}if(!dojo._hasResource["dojo._base.browser"]){dojo._hasResource["dojo._base.browser"]=true;dojo.provide("dojo._base.browser");dojo.forEach(dojo.config.require,function(i){dojo["require"](i);});}if(dojo.config.afterOnLoad&&dojo.isBrowser){window.setTimeout(dojo._loadInit,1000);}})();
/*
	Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/

/*
	This is a compiled version of Dojo, built for deployment and not for
	development. To get an editable version, please visit:

		http://dojotoolkit.org

	for documentation and information on getting the source.
*/

if(!dojo._hasResource["dijit._base.manager"]){dojo._hasResource["dijit._base.manager"]=true;dojo.provide("dijit._base.manager");dojo.declare("dijit.WidgetSet",null,{constructor:function(){this._hash={};this.length=0;},add:function(_1){if(this._hash[_1.id]){throw new Error("Tried to register widget with id=="+_1.id+" but that id is already registered");}this._hash[_1.id]=_1;this.length++;},remove:function(id){if(this._hash[id]){delete this._hash[id];this.length--;}},forEach:function(_2,_3){_3=_3||dojo.global;var i=0,id;for(id in this._hash){_2.call(_3,this._hash[id],i++,this._hash);}return this;},filter:function(_4,_5){_5=_5||dojo.global;var _6=new dijit.WidgetSet(),i=0,id;for(id in this._hash){var w=this._hash[id];if(_4.call(_5,w,i++,this._hash)){_6.add(w);}}return _6;},byId:function(id){return this._hash[id];},byClass:function(_7){var _8=new dijit.WidgetSet(),id,_9;for(id in this._hash){_9=this._hash[id];if(_9.declaredClass==_7){_8.add(_9);}}return _8;},toArray:function(){var ar=[];for(var id in this._hash){ar.push(this._hash[id]);}return ar;},map:function(_a,_b){return dojo.map(this.toArray(),_a,_b);},every:function(_c,_d){_d=_d||dojo.global;var x=0,i;for(i in this._hash){if(!_c.call(_d,this._hash[i],x++,this._hash)){return false;}}return true;},some:function(_e,_f){_f=_f||dojo.global;var x=0,i;for(i in this._hash){if(_e.call(_f,this._hash[i],x++,this._hash)){return true;}}return false;}});dijit.registry=new dijit.WidgetSet();dijit._widgetTypeCtr={};dijit.getUniqueId=function(_10){var id;do{id=_10+"_"+(_10 in dijit._widgetTypeCtr?++dijit._widgetTypeCtr[_10]:dijit._widgetTypeCtr[_10]=0);}while(dijit.byId(id));return id;};dijit.findWidgets=function(_11){var _12=[];function _13(_14){for(var _15=_14.firstChild;_15;_15=_15.nextSibling){if(_15.nodeType==1){var _16=_15.getAttribute("widgetId");if(_16){var _17=dijit.byId(_16);_12.push(_17);}else{_13(_15);}}}};_13(_11);return _12;};dijit._destroyAll=function(){dijit._curFocus=null;dijit._prevFocus=null;dijit._activeStack=[];dojo.forEach(dijit.findWidgets(dojo.body()),function(_18){if(!_18._destroyed){if(_18.destroyRecursive){_18.destroyRecursive();}else{if(_18.destroy){_18.destroy();}}}});};if(dojo.isIE){dojo.addOnWindowUnload(function(){dijit._destroyAll();});}dijit.byId=function(id){return typeof id=="string"?dijit.registry._hash[id]:id;};dijit.byNode=function(_19){return dijit.registry.byId(_19.getAttribute("widgetId"));};dijit.getEnclosingWidget=function(_1a){while(_1a){var id=_1a.getAttribute&&_1a.getAttribute("widgetId");if(id){return dijit.byId(id);}_1a=_1a.parentNode;}return null;};dijit._isElementShown=function(_1b){var _1c=dojo.style(_1b);return (_1c.visibility!="hidden")&&(_1c.visibility!="collapsed")&&(_1c.display!="none")&&(dojo.attr(_1b,"type")!="hidden");};dijit.isTabNavigable=function(_1d){if(dojo.attr(_1d,"disabled")){return false;}else{if(dojo.hasAttr(_1d,"tabIndex")){return dojo.attr(_1d,"tabIndex")>=0;}else{switch(_1d.nodeName.toLowerCase()){case "a":return dojo.hasAttr(_1d,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return true;case "iframe":if(dojo.isMoz){return _1d.contentDocument.designMode=="on";}else{if(dojo.isWebKit){var doc=_1d.contentDocument,_1e=doc&&doc.body;return _1e&&_1e.contentEditable=="true";}else{doc=_1d.contentWindow.document;_1e=doc&&doc.body;return _1e&&_1e.firstChild&&_1e.firstChild.contentEditable=="true";}}default:return _1d.contentEditable=="true";}}}};dijit._getTabNavigable=function(_1f){var _20,_21,_22,_23,_24,_25;var _26=function(_27){dojo.query("> *",_27).forEach(function(_28){var _29=dijit._isElementShown(_28);if(_29&&dijit.isTabNavigable(_28)){var _2a=dojo.attr(_28,"tabIndex");if(!dojo.hasAttr(_28,"tabIndex")||_2a==0){if(!_20){_20=_28;}_21=_28;}else{if(_2a>0){if(!_22||_2a<_23){_23=_2a;_22=_28;}if(!_24||_2a>=_25){_25=_2a;_24=_28;}}}}if(_29&&_28.nodeName.toUpperCase()!="SELECT"){_26(_28);}});};if(dijit._isElementShown(_1f)){_26(_1f);}return {first:_20,last:_21,lowest:_22,highest:_24};};dijit.getFirstInTabbingOrder=function(_2b){var _2c=dijit._getTabNavigable(dojo.byId(_2b));return _2c.lowest?_2c.lowest:_2c.first;};dijit.getLastInTabbingOrder=function(_2d){var _2e=dijit._getTabNavigable(dojo.byId(_2d));return _2e.last?_2e.last:_2e.highest;};dijit.defaultDuration=dojo.config["defaultDuration"]||200;}if(!dojo._hasResource["dijit._base.focus"]){dojo._hasResource["dijit._base.focus"]=true;dojo.provide("dijit._base.focus");dojo.mixin(dijit,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return dijit.getBookmark().isCollapsed;},getBookmark:function(){var bm,rg,tg,sel=dojo.doc.selection,cf=dijit._curFocus;if(dojo.global.getSelection){sel=dojo.global.getSelection();if(sel){if(sel.isCollapsed){tg=cf?cf.tagName:"";if(tg){tg=tg.toLowerCase();if(tg=="textarea"||(tg=="input"&&(!cf.type||cf.type.toLowerCase()=="text"))){sel={start:cf.selectionStart,end:cf.selectionEnd,node:cf,pRange:true};return {isCollapsed:(sel.end<=sel.start),mark:sel};}}bm={isCollapsed:true};}else{rg=sel.getRangeAt(0);bm={isCollapsed:false,mark:rg.cloneRange()};}}}else{if(sel){tg=cf?cf.tagName:"";tg=tg.toLowerCase();if(cf&&tg&&(tg=="button"||tg=="textarea"||tg=="input")){if(sel.type&&sel.type.toLowerCase()=="none"){return {isCollapsed:true,mark:null};}else{rg=sel.createRange();return {isCollapsed:rg.text&&rg.text.length?false:true,mark:{range:rg,pRange:true}};}}bm={};try{rg=sel.createRange();bm.isCollapsed=!(sel.type=="Text"?rg.htmlText.length:rg.length);}catch(e){bm.isCollapsed=true;return bm;}if(sel.type.toUpperCase()=="CONTROL"){if(rg.length){bm.mark=[];var i=0,len=rg.length;while(i<len){bm.mark.push(rg.item(i++));}}else{bm.isCollapsed=true;bm.mark=null;}}else{bm.mark=rg.getBookmark();}}else{console.warn("No idea how to store the current selection for this browser!");}}return bm;},moveToBookmark:function(_2f){var _30=dojo.doc,_31=_2f.mark;if(_31){if(dojo.global.getSelection){var sel=dojo.global.getSelection();if(sel&&sel.removeAllRanges){if(_31.pRange){var r=_31;var n=r.node;n.selectionStart=r.start;n.selectionEnd=r.end;}else{sel.removeAllRanges();sel.addRange(_31);}}else{console.warn("No idea how to restore selection for this browser!");}}else{if(_30.selection&&_31){var rg;if(_31.pRange){rg=_31.range;}else{if(dojo.isArray(_31)){rg=_30.body.createControlRange();dojo.forEach(_31,function(n){rg.addElement(n);});}else{rg=_30.body.createTextRange();rg.moveToBookmark(_31);}}rg.select();}}}},getFocus:function(_32,_33){var _34=!dijit._curFocus||(_32&&dojo.isDescendant(dijit._curFocus,_32.domNode))?dijit._prevFocus:dijit._curFocus;return {node:_34,bookmark:(_34==dijit._curFocus)&&dojo.withGlobal(_33||dojo.global,dijit.getBookmark),openedForWindow:_33};},focus:function(_35){if(!_35){return;}var _36="node" in _35?_35.node:_35,_37=_35.bookmark,_38=_35.openedForWindow,_39=_37?_37.isCollapsed:false;if(_36){var _3a=(_36.tagName.toLowerCase()=="iframe")?_36.contentWindow:_36;if(_3a&&_3a.focus){try{_3a.focus();}catch(e){}}dijit._onFocusNode(_36);}if(_37&&dojo.withGlobal(_38||dojo.global,dijit.isCollapsed)&&!_39){if(_38){_38.focus();}try{dojo.withGlobal(_38||dojo.global,dijit.moveToBookmark,null,[_37]);}catch(e2){}}},_activeStack:[],registerIframe:function(_3b){return dijit.registerWin(_3b.contentWindow,_3b);},unregisterIframe:function(_3c){dijit.unregisterWin(_3c);},registerWin:function(_3d,_3e){var _3f=function(evt){dijit._justMouseDowned=true;setTimeout(function(){dijit._justMouseDowned=false;},0);dijit._onTouchNode(_3e||evt.target||evt.srcElement,"mouse");};var doc=dojo.isIE?_3d.document.documentElement:_3d.document;if(doc){if(dojo.isIE){doc.attachEvent("onmousedown",_3f);var _40=function(evt){if(evt.srcElement.tagName.toLowerCase()!="#document"&&dijit.isTabNavigable(evt.srcElement)){dijit._onFocusNode(_3e||evt.srcElement);}else{dijit._onTouchNode(_3e||evt.srcElement);}};doc.attachEvent("onactivate",_40);var _41=function(evt){dijit._onBlurNode(_3e||evt.srcElement);};doc.attachEvent("ondeactivate",_41);return function(){doc.detachEvent("onmousedown",_3f);doc.detachEvent("onactivate",_40);doc.detachEvent("ondeactivate",_41);doc=null;};}else{doc.addEventListener("mousedown",_3f,true);var _42=function(evt){dijit._onFocusNode(_3e||evt.target);};doc.addEventListener("focus",_42,true);var _43=function(evt){dijit._onBlurNode(_3e||evt.target);};doc.addEventListener("blur",_43,true);return function(){doc.removeEventListener("mousedown",_3f,true);doc.removeEventListener("focus",_42,true);doc.removeEventListener("blur",_43,true);doc=null;};}}},unregisterWin:function(_44){_44&&_44();},_onBlurNode:function(_45){dijit._prevFocus=dijit._curFocus;dijit._curFocus=null;if(dijit._justMouseDowned){return;}if(dijit._clearActiveWidgetsTimer){clearTimeout(dijit._clearActiveWidgetsTimer);}dijit._clearActiveWidgetsTimer=setTimeout(function(){delete dijit._clearActiveWidgetsTimer;dijit._setStack([]);dijit._prevFocus=null;},100);},_onTouchNode:function(_46,by){if(dijit._clearActiveWidgetsTimer){clearTimeout(dijit._clearActiveWidgetsTimer);delete dijit._clearActiveWidgetsTimer;}var _47=[];try{while(_46){var _48=dojo.attr(_46,"dijitPopupParent");if(_48){_46=dijit.byId(_48).domNode;}else{if(_46.tagName&&_46.tagName.toLowerCase()=="body"){if(_46===dojo.body()){break;}_46=dijit.getDocumentWindow(_46.ownerDocument).frameElement;}else{var id=_46.getAttribute&&_46.getAttribute("widgetId");if(id){_47.unshift(id);}_46=_46.parentNode;}}}}catch(e){}dijit._setStack(_47,by);},_onFocusNode:function(_49){if(!_49){return;}if(_49.nodeType==9){return;}dijit._onTouchNode(_49);if(_49==dijit._curFocus){return;}if(dijit._curFocus){dijit._prevFocus=dijit._curFocus;}dijit._curFocus=_49;dojo.publish("focusNode",[_49]);},_setStack:function(_4a,by){var _4b=dijit._activeStack;dijit._activeStack=_4a;for(var _4c=0;_4c<Math.min(_4b.length,_4a.length);_4c++){if(_4b[_4c]!=_4a[_4c]){break;}}var _4d;for(var i=_4b.length-1;i>=_4c;i--){_4d=dijit.byId(_4b[i]);if(_4d){_4d._focused=false;_4d._hasBeenBlurred=true;if(_4d._onBlur){_4d._onBlur(by);}if(_4d._setStateClass){_4d._setStateClass();}dojo.publish("widgetBlur",[_4d,by]);}}for(i=_4c;i<_4a.length;i++){_4d=dijit.byId(_4a[i]);if(_4d){_4d._focused=true;if(_4d._onFocus){_4d._onFocus(by);}if(_4d._setStateClass){_4d._setStateClass();}dojo.publish("widgetFocus",[_4d,by]);}}}});dojo.addOnLoad(function(){var _4e=dijit.registerWin(window);if(dojo.isIE){dojo.addOnWindowUnload(function(){dijit.unregisterWin(_4e);_4e=null;});}});}if(!dojo._hasResource["dojo.AdapterRegistry"]){dojo._hasResource["dojo.AdapterRegistry"]=true;dojo.provide("dojo.AdapterRegistry");dojo.AdapterRegistry=function(_4f){this.pairs=[];this.returnWrappers=_4f||false;};dojo.extend(dojo.AdapterRegistry,{register:function(_50,_51,_52,_53,_54){this.pairs[((_54)?"unshift":"push")]([_50,_51,_52,_53]);},match:function(){for(var i=0;i<this.pairs.length;i++){var _55=this.pairs[i];if(_55[1].apply(this,arguments)){if((_55[3])||(this.returnWrappers)){return _55[2];}else{return _55[2].apply(this,arguments);}}}throw new Error("No match found");},unregister:function(_56){for(var i=0;i<this.pairs.length;i++){var _57=this.pairs[i];if(_57[0]==_56){this.pairs.splice(i,1);return true;}}return false;}});}if(!dojo._hasResource["dijit._base.place"]){dojo._hasResource["dijit._base.place"]=true;dojo.provide("dijit._base.place");dijit.getViewport=function(){var _58=(dojo.doc.compatMode=="BackCompat")?dojo.body():dojo.doc.documentElement;var _59=dojo._docScroll();return {w:_58.clientWidth,h:_58.clientHeight,l:_59.x,t:_59.y};};dijit.placeOnScreen=function(_5a,pos,_5b,_5c){var _5d=dojo.map(_5b,function(_5e){var c={corner:_5e,pos:{x:pos.x,y:pos.y}};if(_5c){c.pos.x+=_5e.charAt(1)=="L"?_5c.x:-_5c.x;c.pos.y+=_5e.charAt(0)=="T"?_5c.y:-_5c.y;}return c;});return dijit._place(_5a,_5d);};dijit._place=function(_5f,_60,_61){var _62=dijit.getViewport();if(!_5f.parentNode||String(_5f.parentNode.tagName).toLowerCase()!="body"){dojo.body().appendChild(_5f);}var _63=null;dojo.some(_60,function(_64){var _65=_64.corner;var pos=_64.pos;if(_61){_61(_5f,_64.aroundCorner,_65);}var _66=_5f.style;var _67=_66.display;var _68=_66.visibility;_66.visibility="hidden";_66.display="";var mb=dojo.marginBox(_5f);_66.display=_67;_66.visibility=_68;var _69=Math.max(_62.l,_65.charAt(1)=="L"?pos.x:(pos.x-mb.w)),_6a=Math.max(_62.t,_65.charAt(0)=="T"?pos.y:(pos.y-mb.h)),_6b=Math.min(_62.l+_62.w,_65.charAt(1)=="L"?(_69+mb.w):pos.x),_6c=Math.min(_62.t+_62.h,_65.charAt(0)=="T"?(_6a+mb.h):pos.y),_6d=_6b-_69,_6e=_6c-_6a,_6f=(mb.w-_6d)+(mb.h-_6e);if(_63==null||_6f<_63.overflow){_63={corner:_65,aroundCorner:_64.aroundCorner,x:_69,y:_6a,w:_6d,h:_6e,overflow:_6f};}return !_6f;});_5f.style.left=_63.x+"px";_5f.style.top=_63.y+"px";if(_63.overflow&&_61){_61(_5f,_63.aroundCorner,_63.corner);}return _63;};dijit.placeOnScreenAroundNode=function(_70,_71,_72,_73){_71=dojo.byId(_71);var _74=_71.style.display;_71.style.display="";var _75=dojo.position(_71,true);_71.style.display=_74;return dijit._placeOnScreenAroundRect(_70,_75.x,_75.y,_75.w,_75.h,_72,_73);};dijit.placeOnScreenAroundRectangle=function(_76,_77,_78,_79){return dijit._placeOnScreenAroundRect(_76,_77.x,_77.y,_77.width,_77.height,_78,_79);};dijit._placeOnScreenAroundRect=function(_7a,x,y,_7b,_7c,_7d,_7e){var _7f=[];for(var _80 in _7d){_7f.push({aroundCorner:_80,corner:_7d[_80],pos:{x:x+(_80.charAt(1)=="L"?0:_7b),y:y+(_80.charAt(0)=="T"?0:_7c)}});}return dijit._place(_7a,_7f,_7e);};dijit.placementRegistry=new dojo.AdapterRegistry();dijit.placementRegistry.register("node",function(n,x){return typeof x=="object"&&typeof x.offsetWidth!="undefined"&&typeof x.offsetHeight!="undefined";},dijit.placeOnScreenAroundNode);dijit.placementRegistry.register("rect",function(n,x){return typeof x=="object"&&"x" in x&&"y" in x&&"width" in x&&"height" in x;},dijit.placeOnScreenAroundRectangle);dijit.placeOnScreenAroundElement=function(_81,_82,_83,_84){return dijit.placementRegistry.match.apply(dijit.placementRegistry,arguments);};dijit.getPopupAlignment=function(_85,_86){var _87={};dojo.forEach(_85,function(pos){switch(pos){case "after":_87[_86?"BR":"BL"]=_86?"BL":"BR";break;case "before":_87[_86?"BL":"BR"]=_86?"BR":"BL";break;case "below":_87[_86?"BL":"BR"]=_86?"TL":"TR";_87[_86?"BR":"BL"]=_86?"TR":"TL";break;case "above":default:_87[_86?"TL":"TR"]=_86?"BL":"BR";_87[_86?"TR":"TL"]=_86?"BR":"BL";break;}});return _87;};dijit.getPopupAroundAlignment=function(_88,_89){var _8a={};dojo.forEach(_88,function(pos){switch(pos){case "after":_8a[_89?"BR":"BL"]=_89?"BL":"BR";break;case "before":_8a[_89?"BL":"BR"]=_89?"BR":"BL";break;case "below":_8a[_89?"BL":"BR"]=_89?"TL":"TR";_8a[_89?"BR":"BL"]=_89?"TR":"TL";break;case "above":default:_8a[_89?"TL":"TR"]=_89?"BL":"BR";_8a[_89?"TR":"TL"]=_89?"BR":"BL";break;}});return _8a;};}if(!dojo._hasResource["dijit._base.window"]){dojo._hasResource["dijit._base.window"]=true;dojo.provide("dijit._base.window");dijit.getDocumentWindow=function(doc){if(dojo.isIE&&window!==document.parentWindow&&!doc._parentWindow){doc.parentWindow.execScript("document._parentWindow = window;","Javascript");var win=doc._parentWindow;doc._parentWindow=null;return win;}return doc._parentWindow||doc.parentWindow||doc.defaultView;};}if(!dojo._hasResource["dijit._base.popup"]){dojo._hasResource["dijit._base.popup"]=true;dojo.provide("dijit._base.popup");dijit.popup=new function(){var _8b=[],_8c=1000,_8d=1;this.moveOffScreen=function(_8e){var s=_8e.style;s.visibility="hidden";s.position="absolute";s.top="-9999px";if(s.display=="none"){s.display="";}dojo.body().appendChild(_8e);};var _8f=function(){for(var pi=_8b.length-1;pi>0&&_8b[pi].parent===_8b[pi-1].widget;pi--){}return _8b[pi];};var _90=[];this.open=function(_91){var _92=_91.popup,_93=_91.orient||(dojo._isBodyLtr()?{"BL":"TL","BR":"TR","TL":"BL","TR":"BR"}:{"BR":"TR","BL":"TL","TR":"BR","TL":"BL"}),_94=_91.around,id=(_91.around&&_91.around.id)?(_91.around.id+"_dropdown"):("popup_"+_8d++);var _95=_90.pop(),_96,_97;if(!_95){_96=dojo.create("div",{"class":"dijitPopup"},dojo.body());dijit.setWaiRole(_96,"presentation");}else{_96=_95[0];_97=_95[1];}dojo.attr(_96,{id:id,style:{zIndex:_8c+_8b.length,visibility:"hidden",top:"-9999px"},dijitPopupParent:_91.parent?_91.parent.id:""});var s=_92.domNode.style;s.display="";s.visibility="";s.position="";s.top="0px";_96.appendChild(_92.domNode);if(!_97){_97=new dijit.BackgroundIframe(_96);}else{_97.resize(_96);}var _98=_94?dijit.placeOnScreenAroundElement(_96,_94,_93,_92.orient?dojo.hitch(_92,"orient"):null):dijit.placeOnScreen(_96,_91,_93=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],_91.padding);_96.style.visibility="visible";var _99=[];_99.push(dojo.connect(_96,"onkeypress",this,function(evt){if(evt.charOrCode==dojo.keys.ESCAPE&&_91.onCancel){dojo.stopEvent(evt);_91.onCancel();}else{if(evt.charOrCode===dojo.keys.TAB){dojo.stopEvent(evt);var _9a=_8f();if(_9a&&_9a.onCancel){_9a.onCancel();}}}}));if(_92.onCancel){_99.push(dojo.connect(_92,"onCancel",_91.onCancel));}_99.push(dojo.connect(_92,_92.onExecute?"onExecute":"onChange",function(){var _9b=_8f();if(_9b&&_9b.onExecute){_9b.onExecute();}}));_8b.push({wrapper:_96,iframe:_97,widget:_92,parent:_91.parent,onExecute:_91.onExecute,onCancel:_91.onCancel,onClose:_91.onClose,handlers:_99});if(_92.onOpen){_92.onOpen(_98);}return _98;};this.close=function(_9c){while(dojo.some(_8b,function(_9d){return _9d.widget==_9c;})){var top=_8b.pop(),_9e=top.wrapper,_9f=top.iframe,_a0=top.widget,_a1=top.onClose;if(_a0.onClose){_a0.onClose();}dojo.forEach(top.handlers,dojo.disconnect);if(_a0&&_a0.domNode){this.moveOffScreen(_a0.domNode);}_9e.style.top="-9999px";_9e.style.visibility="hidden";_90.push([_9e,_9f]);if(_a1){_a1();}}};}();dijit._frames=new function(){var _a2=[];this.pop=function(){var _a3;if(_a2.length){_a3=_a2.pop();_a3.style.display="";}else{if(dojo.isIE){var _a4=dojo.config["dojoBlankHtmlUrl"]||(dojo.moduleUrl("dojo","resources/blank.html")+"")||"javascript:\"\"";var _a5="<iframe src='"+_a4+"'"+" style='position: absolute; left: 0px; top: 0px;"+"z-index: -1; filter:Alpha(Opacity=\"0\");'>";_a3=dojo.doc.createElement(_a5);}else{_a3=dojo.create("iframe");_a3.src="javascript:\"\"";_a3.className="dijitBackgroundIframe";dojo.style(_a3,"opacity",0.1);}_a3.tabIndex=-1;}return _a3;};this.push=function(_a6){_a6.style.display="none";_a2.push(_a6);};}();dijit.BackgroundIframe=function(_a7){if(!_a7.id){throw new Error("no id");}if(dojo.isIE||dojo.isMoz){var _a8=dijit._frames.pop();_a7.appendChild(_a8);if(dojo.isIE<7){this.resize(_a7);this._conn=dojo.connect(_a7,"onresize",this,function(){this.resize(_a7);});}else{dojo.style(_a8,{width:"100%",height:"100%"});}this.iframe=_a8;}};dojo.extend(dijit.BackgroundIframe,{resize:function(_a9){if(this.iframe&&dojo.isIE<7){dojo.style(this.iframe,{width:_a9.offsetWidth+"px",height:_a9.offsetHeight+"px"});}},destroy:function(){if(this._conn){dojo.disconnect(this._conn);this._conn=null;}if(this.iframe){dijit._frames.push(this.iframe);delete this.iframe;}}});}if(!dojo._hasResource["dijit._base.scroll"]){dojo._hasResource["dijit._base.scroll"]=true;dojo.provide("dijit._base.scroll");dijit.scrollIntoView=function(_aa,pos){try{_aa=dojo.byId(_aa);var doc=_aa.ownerDocument||dojo.doc,_ab=doc.body||dojo.body(),_ac=doc.documentElement||_ab.parentNode,_ad=dojo.isIE,_ae=dojo.isWebKit;if((!(dojo.isMoz||_ad||_ae)||_aa==_ab||_aa==_ac)&&(typeof _aa.scrollIntoView!="undefined")){_aa.scrollIntoView(false);return;}var _af=doc.compatMode=="BackCompat",_b0=_af?_ab:_ac,_b1=_ae?_ab:_b0,_b2=_b0.clientWidth,_b3=_b0.clientHeight,rtl=!dojo._isBodyLtr(),_b4=pos||dojo.position(_aa),el=_aa.parentNode,_b5=function(el){return ((_ad<=6||(_ad&&_af))?false:(dojo.style(el,"position").toLowerCase()=="fixed"));};if(_b5(_aa)){return;}while(el){if(el==_ab){el=_b1;}var _b6=dojo.position(el),_b7=_b5(el);with(_b6){if(el==_b1){w=_b2,h=_b3;if(_b1==_ac&&_ad&&rtl){x+=_b1.offsetWidth-w;}if(x<0||!_ad){x=0;}if(y<0||!_ad){y=0;}}else{var pb=dojo._getPadBorderExtents(el);w-=pb.w;h-=pb.h;x+=pb.l;y+=pb.t;}with(el){if(el!=_b1){var _b8=clientWidth,_b9=w-_b8;if(_b8>0&&_b9>0){w=_b8;if(_ad&&rtl){x+=_b9;}}_b8=clientHeight;_b9=h-_b8;if(_b8>0&&_b9>0){h=_b8;}}if(_b7){if(y<0){h+=y,y=0;}if(x<0){w+=x,x=0;}if(y+h>_b3){h=_b3-y;}if(x+w>_b2){w=_b2-x;}}var l=_b4.x-x,t=_b4.y-Math.max(y,0),r=l+_b4.w-w,bot=t+_b4.h-h;if(r*l>0){var s=Math[l<0?"max":"min"](l,r);_b4.x+=scrollLeft;scrollLeft+=(_ad>=8&&!_af&&rtl)?-s:s;_b4.x-=scrollLeft;}if(bot*t>0){_b4.y+=scrollTop;scrollTop+=Math[t<0?"max":"min"](t,bot);_b4.y-=scrollTop;}}}el=(el!=_b1)&&!_b7&&el.parentNode;}}catch(error){console.error("scrollIntoView: "+error);_aa.scrollIntoView(false);}};}if(!dojo._hasResource["dijit._base.sniff"]){dojo._hasResource["dijit._base.sniff"]=true;dojo.provide("dijit._base.sniff");(function(){var d=dojo,_ba=d.doc.documentElement,ie=d.isIE,_bb=d.isOpera,maj=Math.floor,ff=d.isFF,_bc=d.boxModel.replace(/-/,""),_bd={dj_ie:ie,dj_ie6:maj(ie)==6,dj_ie7:maj(ie)==7,dj_ie8:maj(ie)==8,dj_iequirks:ie&&d.isQuirks,dj_opera:_bb,dj_khtml:d.isKhtml,dj_webkit:d.isWebKit,dj_safari:d.isSafari,dj_chrome:d.isChrome,dj_gecko:d.isMozilla,dj_ff3:maj(ff)==3};_bd["dj_"+_bc]=true;for(var p in _bd){if(_bd[p]){if(_ba.className){_ba.className+=" "+p;}else{_ba.className=p;}}}dojo._loaders.unshift(function(){if(!dojo._isBodyLtr()){_ba.className+=" dijitRtl";for(var p in _bd){if(_bd[p]){_ba.className+=" "+p+"-rtl";}}}});})();}if(!dojo._hasResource["dijit._base.typematic"]){dojo._hasResource["dijit._base.typematic"]=true;dojo.provide("dijit._base.typematic");dijit.typematic={_fireEventAndReload:function(){this._timer=null;this._callback(++this._count,this._node,this._evt);this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:(this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay)),10);this._timer=setTimeout(dojo.hitch(this,"_fireEventAndReload"),this._currentTimeout);},trigger:function(evt,_be,_bf,_c0,obj,_c1,_c2){if(obj!=this._obj){this.stop();this._initialDelay=_c2||500;this._subsequentDelay=_c1||0.9;this._obj=obj;this._evt=evt;this._node=_bf;this._currentTimeout=-1;this._count=-1;this._callback=dojo.hitch(_be,_c0);this._fireEventAndReload();}},stop:function(){if(this._timer){clearTimeout(this._timer);this._timer=null;}if(this._obj){this._callback(-1,this._node,this._evt);this._obj=null;}},addKeyListener:function(_c3,_c4,_c5,_c6,_c7,_c8){if(_c4.keyCode){_c4.charOrCode=_c4.keyCode;dojo.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0");}else{if(_c4.charCode){_c4.charOrCode=String.fromCharCode(_c4.charCode);dojo.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0");}}return [dojo.connect(_c3,"onkeypress",this,function(evt){if(evt.charOrCode==_c4.charOrCode&&(_c4.ctrlKey===undefined||_c4.ctrlKey==evt.ctrlKey)&&(_c4.altKey===undefined||_c4.altKey==evt.altKey)&&(_c4.metaKey===undefined||_c4.metaKey==(evt.metaKey||false))&&(_c4.shiftKey===undefined||_c4.shiftKey==evt.shiftKey)){dojo.stopEvent(evt);dijit.typematic.trigger(_c4,_c5,_c3,_c6,_c4,_c7,_c8);}else{if(dijit.typematic._obj==_c4){dijit.typematic.stop();}}}),dojo.connect(_c3,"onkeyup",this,function(evt){if(dijit.typematic._obj==_c4){dijit.typematic.stop();}})];},addMouseListener:function(_c9,_ca,_cb,_cc,_cd){var dc=dojo.connect;return [dc(_c9,"mousedown",this,function(evt){dojo.stopEvent(evt);dijit.typematic.trigger(evt,_ca,_c9,_cb,_c9,_cc,_cd);}),dc(_c9,"mouseup",this,function(evt){dojo.stopEvent(evt);dijit.typematic.stop();}),dc(_c9,"mouseout",this,function(evt){dojo.stopEvent(evt);dijit.typematic.stop();}),dc(_c9,"mousemove",this,function(evt){dojo.stopEvent(evt);}),dc(_c9,"dblclick",this,function(evt){dojo.stopEvent(evt);if(dojo.isIE){dijit.typematic.trigger(evt,_ca,_c9,_cb,_c9,_cc,_cd);setTimeout(dojo.hitch(this,dijit.typematic.stop),50);}})];},addListener:function(_ce,_cf,_d0,_d1,_d2,_d3,_d4){return this.addKeyListener(_cf,_d0,_d1,_d2,_d3,_d4).concat(this.addMouseListener(_ce,_d1,_d2,_d3,_d4));}};}if(!dojo._hasResource["dijit._base.wai"]){dojo._hasResource["dijit._base.wai"]=true;dojo.provide("dijit._base.wai");dijit.wai={onload:function(){var div=dojo.create("div",{id:"a11yTestNode",style:{cssText:"border: 1px solid;"+"border-color:red green;"+"position: absolute;"+"height: 5px;"+"top: -999px;"+"background-image: url(\""+(dojo.config.blankGif||dojo.moduleUrl("dojo","resources/blank.gif"))+"\");"}},dojo.body());var cs=dojo.getComputedStyle(div);if(cs){var _d5=cs.backgroundImage;var _d6=(cs.borderTopColor==cs.borderRightColor)||(_d5!=null&&(_d5=="none"||_d5=="url(invalid-url:)"));dojo[_d6?"addClass":"removeClass"](dojo.body(),"dijit_a11y");if(dojo.isIE){div.outerHTML="";}else{dojo.body().removeChild(div);}}}};if(dojo.isIE||dojo.isMoz){dojo._loaders.unshift(dijit.wai.onload);}dojo.mixin(dijit,{_XhtmlRoles:/banner|contentinfo|definition|main|navigation|search|note|secondary|seealso/,hasWaiRole:function(_d7,_d8){var _d9=this.getWaiRole(_d7);return _d8?(_d9.indexOf(_d8)>-1):(_d9.length>0);},getWaiRole:function(_da){return dojo.trim((dojo.attr(_da,"role")||"").replace(this._XhtmlRoles,"").replace("wairole:",""));},setWaiRole:function(_db,_dc){var _dd=dojo.attr(_db,"role")||"";if(!this._XhtmlRoles.test(_dd)){dojo.attr(_db,"role",_dc);}else{if((" "+_dd+" ").indexOf(" "+_dc+" ")<0){var _de=dojo.trim(_dd.replace(this._XhtmlRoles,""));var _df=dojo.trim(_dd.replace(_de,""));dojo.attr(_db,"role",_df+(_df?" ":"")+_dc);}}},removeWaiRole:function(_e0,_e1){var _e2=dojo.attr(_e0,"role");if(!_e2){return;}if(_e1){var t=dojo.trim((" "+_e2+" ").replace(" "+_e1+" "," "));dojo.attr(_e0,"role",t);}else{_e0.removeAttribute("role");}},hasWaiState:function(_e3,_e4){return _e3.hasAttribute?_e3.hasAttribute("aria-"+_e4):!!_e3.getAttribute("aria-"+_e4);},getWaiState:function(_e5,_e6){return _e5.getAttribute("aria-"+_e6)||"";},setWaiState:function(_e7,_e8,_e9){_e7.setAttribute("aria-"+_e8,_e9);},removeWaiState:function(_ea,_eb){_ea.removeAttribute("aria-"+_eb);}});}if(!dojo._hasResource["dijit._base"]){dojo._hasResource["dijit._base"]=true;dojo.provide("dijit._base");}if(!dojo._hasResource["dojo.date.stamp"]){dojo._hasResource["dojo.date.stamp"]=true;dojo.provide("dojo.date.stamp");dojo.date.stamp.fromISOString=function(_ec,_ed){if(!dojo.date.stamp._isoRegExp){dojo.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;}var _ee=dojo.date.stamp._isoRegExp.exec(_ec),_ef=null;if(_ee){_ee.shift();if(_ee[1]){_ee[1]--;}if(_ee[6]){_ee[6]*=1000;}if(_ed){_ed=new Date(_ed);dojo.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(_f0){return _ed["get"+_f0]();}).forEach(function(_f1,_f2){if(_ee[_f2]===undefined){_ee[_f2]=_f1;}});}_ef=new Date(_ee[0]||1970,_ee[1]||0,_ee[2]||1,_ee[3]||0,_ee[4]||0,_ee[5]||0,_ee[6]||0);if(_ee[0]<100){_ef.setFullYear(_ee[0]||1970);}var _f3=0,_f4=_ee[7]&&_ee[7].charAt(0);if(_f4!="Z"){_f3=((_ee[8]||0)*60)+(Number(_ee[9])||0);if(_f4!="-"){_f3*=-1;}}if(_f4){_f3-=_ef.getTimezoneOffset();}if(_f3){_ef.setTime(_ef.getTime()+_f3*60000);}}return _ef;};dojo.date.stamp.toISOString=function(_f5,_f6){var _f7=function(n){return (n<10)?"0"+n:n;};_f6=_f6||{};var _f8=[],_f9=_f6.zulu?"getUTC":"get",_fa="";if(_f6.selector!="time"){var _fb=_f5[_f9+"FullYear"]();_fa=["0000".substr((_fb+"").length)+_fb,_f7(_f5[_f9+"Month"]()+1),_f7(_f5[_f9+"Date"]())].join("-");}_f8.push(_fa);if(_f6.selector!="date"){var _fc=[_f7(_f5[_f9+"Hours"]()),_f7(_f5[_f9+"Minutes"]()),_f7(_f5[_f9+"Seconds"]())].join(":");var _fd=_f5[_f9+"Milliseconds"]();if(_f6.milliseconds){_fc+="."+(_fd<100?"0":"")+_f7(_fd);}if(_f6.zulu){_fc+="Z";}else{if(_f6.selector!="time"){var _fe=_f5.getTimezoneOffset();var _ff=Math.abs(_fe);_fc+=(_fe>0?"-":"+")+_f7(Math.floor(_ff/60))+":"+_f7(_ff%60);}}_f8.push(_fc);}return _f8.join("T");};}if(!dojo._hasResource["dojo.parser"]){dojo._hasResource["dojo.parser"]=true;dojo.provide("dojo.parser");dojo.parser=new function(){var d=dojo;this._attrName=d._scopeName+"Type";this._query="["+this._attrName+"]";function _100(_101){if(d.isString(_101)){return "string";}if(typeof _101=="number"){return "number";}if(typeof _101=="boolean"){return "boolean";}if(d.isFunction(_101)){return "function";}if(d.isArray(_101)){return "array";}if(_101 instanceof Date){return "date";}if(_101 instanceof d._Url){return "url";}return "object";};function _102(_103,type){switch(type){case "string":return _103;case "number":return _103.length?Number(_103):NaN;case "boolean":return typeof _103=="boolean"?_103:!(_103.toLowerCase()=="false");case "function":if(d.isFunction(_103)){_103=_103.toString();_103=d.trim(_103.substring(_103.indexOf("{")+1,_103.length-1));}try{if(_103.search(/[^\w\.]+/i)!=-1){return new Function(_103);}else{return d.getObject(_103,false);}}catch(e){return new Function();}case "array":return _103?_103.split(/\s*,\s*/):[];case "date":switch(_103){case "":return new Date("");case "now":return new Date();default:return d.date.stamp.fromISOString(_103);}case "url":return d.baseUrl+_103;default:return d.fromJson(_103);}};var _104={};dojo.connect(dojo,"extend",function(){_104={};});function _105(_106){if(!_104[_106]){var cls=d.getObject(_106);if(!d.isFunction(cls)){throw new Error("Could not load class '"+_106+"'. Did you spell the name correctly and use a full path, like 'dijit.form.Button'?");}var _107=cls.prototype;var _108={},_109={};for(var name in _107){if(name.charAt(0)=="_"){continue;}if(name in _109){continue;}var _10a=_107[name];_108[name]=_100(_10a);}_104[_106]={cls:cls,params:_108};}return _104[_106];};this._functionFromScript=function(_10b){var _10c="";var _10d="";var _10e=_10b.getAttribute("args");if(_10e){d.forEach(_10e.split(/\s*,\s*/),function(part,idx){_10c+="var "+part+" = arguments["+idx+"]; ";});}var _10f=_10b.getAttribute("with");if(_10f&&_10f.length){d.forEach(_10f.split(/\s*,\s*/),function(part){_10c+="with("+part+"){";_10d+="}";});}return new Function(_10c+_10b.innerHTML+_10d);};this.instantiate=function(_110,_111,args){var _112=[],dp=dojo.parser;_111=_111||{};args=args||{};d.forEach(_110,function(node){if(!node){return;}var type=dp._attrName in _111?_111[dp._attrName]:node.getAttribute(dp._attrName);if(!type||!type.length){return;}var _113=_105(type),_114=_113.cls,ps=_114._noScript||_114.prototype._noScript;var _115={},_116=node.attributes;for(var name in _113.params){var item=name in _111?{value:_111[name],specified:true}:_116.getNamedItem(name);if(!item||(!item.specified&&(!dojo.isIE||name.toLowerCase()!="value"))){continue;}var _117=item.value;switch(name){case "class":_117="className" in _111?_111.className:node.className;break;case "style":_117="style" in _111?_111.style:(node.style&&node.style.cssText);}var _118=_113.params[name];if(typeof _117=="string"){_115[name]=_102(_117,_118);}else{_115[name]=_117;}}if(!ps){var _119=[],_11a=[];d.query("> script[type^='dojo/']",node).orphan().forEach(function(_11b){var _11c=_11b.getAttribute("event"),type=_11b.getAttribute("type"),nf=d.parser._functionFromScript(_11b);if(_11c){if(type=="dojo/connect"){_119.push({event:_11c,func:nf});}else{_115[_11c]=nf;}}else{_11a.push(nf);}});}var _11d=_114.markupFactory||_114.prototype&&_114.prototype.markupFactory;var _11e=_11d?_11d(_115,node,_114):new _114(_115,node);_112.push(_11e);var _11f=node.getAttribute("jsId");if(_11f){d.setObject(_11f,_11e);}if(!ps){d.forEach(_119,function(_120){d.connect(_11e,_120.event,null,_120.func);});d.forEach(_11a,function(func){func.call(_11e);});}});if(!_111._started){d.forEach(_112,function(_121){if(!args.noStart&&_121&&_121.startup&&!_121._started&&(!_121.getParent||!_121.getParent())){_121.startup();}});}return _112;};this.parse=function(_122,args){var root;if(!args&&_122&&_122.rootNode){args=_122;root=args.rootNode;}else{root=_122;}var list=d.query(this._query,root);return this.instantiate(list,null,args);};}();(function(){var _123=function(){if(dojo.config.parseOnLoad){dojo.parser.parse();}};if(dojo.exists("dijit.wai.onload")&&(dijit.wai.onload===dojo._loaders[0])){dojo._loaders.splice(1,0,_123);}else{dojo._loaders.unshift(_123);}})();}if(!dojo._hasResource["dijit._Widget"]){dojo._hasResource["dijit._Widget"]=true;dojo.provide("dijit._Widget");dojo.require("dijit._base");dojo.connect(dojo,"_connect",function(_124,_125){if(_124&&dojo.isFunction(_124._onConnect)){_124._onConnect(_125);}});dijit._connectOnUseEventHandler=function(_126){};dijit._lastKeyDownNode=null;if(dojo.isIE){(function(){var _127=function(evt){dijit._lastKeyDownNode=evt.srcElement;};dojo.doc.attachEvent("onkeydown",_127);dojo.addOnWindowUnload(function(){dojo.doc.detachEvent("onkeydown",_127);});})();}else{dojo.doc.addEventListener("keydown",function(evt){dijit._lastKeyDownNode=evt.target;},true);}(function(){var _128={},_129=function(_12a){var dc=_12a.declaredClass;if(!_128[dc]){var r=[],_12b,_12c=_12a.constructor.prototype;for(var _12d in _12c){if(dojo.isFunction(_12c[_12d])&&(_12b=_12d.match(/^_set([a-zA-Z]*)Attr$/))&&_12b[1]){r.push(_12b[1].charAt(0).toLowerCase()+_12b[1].substr(1));}}_128[dc]=r;}return _128[dc]||[];};dojo.declare("dijit._Widget",null,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:dijit._connectOnUseEventHandler,onDblClick:dijit._connectOnUseEventHandler,onKeyDown:dijit._connectOnUseEventHandler,onKeyPress:dijit._connectOnUseEventHandler,onKeyUp:dijit._connectOnUseEventHandler,onMouseDown:dijit._connectOnUseEventHandler,onMouseMove:dijit._connectOnUseEventHandler,onMouseOut:dijit._connectOnUseEventHandler,onMouseOver:dijit._connectOnUseEventHandler,onMouseLeave:dijit._connectOnUseEventHandler,onMouseEnter:dijit._connectOnUseEventHandler,onMouseUp:dijit._connectOnUseEventHandler,_blankGif:(dojo.config.blankGif||dojo.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(_12e,_12f){this.create(_12e,_12f);},create:function(_130,_131){this.srcNodeRef=dojo.byId(_131);this._connects=[];this._subscribes=[];this._deferredConnects=dojo.clone(this._deferredConnects);for(var attr in this.attributeMap){delete this._deferredConnects[attr];}for(attr in this._deferredConnects){if(this[attr]!==dijit._connectOnUseEventHandler){delete this._deferredConnects[attr];}}if(this.srcNodeRef&&(typeof this.srcNodeRef.id=="string")){this.id=this.srcNodeRef.id;}if(_130){this.params=_130;dojo.mixin(this,_130);}this.postMixInProperties();if(!this.id){this.id=dijit.getUniqueId(this.declaredClass.replace(/\./g,"_"));}dijit.registry.add(this);this.buildRendering();if(this.domNode){this._applyAttributes();var _132=this.srcNodeRef;if(_132&&_132.parentNode){_132.parentNode.replaceChild(this.domNode,_132);}for(attr in this.params){this._onConnect(attr);}}if(this.domNode){this.domNode.setAttribute("widgetId",this.id);}this.postCreate();if(this.srcNodeRef&&!this.srcNodeRef.parentNode){delete this.srcNodeRef;}this._created=true;},_applyAttributes:function(){var _133=function(attr,_134){if((_134.params&&attr in _134.params)||_134[attr]){_134.attr(attr,_134[attr]);}};for(var attr in this.attributeMap){_133(attr,this);}dojo.forEach(_129(this),function(a){if(!(a in this.attributeMap)){_133(a,this);}},this);},postMixInProperties:function(){},buildRendering:function(){this.domNode=this.srcNodeRef||dojo.create("div");},postCreate:function(){},startup:function(){this._started=true;},destroyRecursive:function(_135){this._beingDestroyed=true;this.destroyDescendants(_135);this.destroy(_135);},destroy:function(_136){this._beingDestroyed=true;this.uninitialize();var d=dojo,dfe=d.forEach,dun=d.unsubscribe;dfe(this._connects,function(_137){dfe(_137,d.disconnect);});dfe(this._subscribes,function(_138){dun(_138);});dfe(this._supportingWidgets||[],function(w){if(w.destroyRecursive){w.destroyRecursive();}else{if(w.destroy){w.destroy();}}});this.destroyRendering(_136);dijit.registry.remove(this.id);this._destroyed=true;},destroyRendering:function(_139){if(this.bgIframe){this.bgIframe.destroy(_139);delete this.bgIframe;}if(this.domNode){if(_139){dojo.removeAttr(this.domNode,"widgetId");}else{dojo.destroy(this.domNode);}delete this.domNode;}if(this.srcNodeRef){if(!_139){dojo.destroy(this.srcNodeRef);}delete this.srcNodeRef;}},destroyDescendants:function(_13a){dojo.forEach(this.getChildren(),function(_13b){if(_13b.destroyRecursive){_13b.destroyRecursive(_13a);}});},uninitialize:function(){return false;},onFocus:function(){},onBlur:function(){},_onFocus:function(e){this.onFocus();},_onBlur:function(){this.onBlur();},_onConnect:function(_13c){if(_13c in this._deferredConnects){var _13d=this[this._deferredConnects[_13c]||"domNode"];this.connect(_13d,_13c.toLowerCase(),_13c);delete this._deferredConnects[_13c];}},_setClassAttr:function(_13e){var _13f=this[this.attributeMap["class"]||"domNode"];dojo.removeClass(_13f,this["class"]);this["class"]=_13e;dojo.addClass(_13f,_13e);},_setStyleAttr:function(_140){var _141=this[this.attributeMap.style||"domNode"];if(dojo.isObject(_140)){dojo.style(_141,_140);}else{if(_141.style.cssText){_141.style.cssText+="; "+_140;}else{_141.style.cssText=_140;}}this.style=_140;},setAttribute:function(attr,_142){dojo.deprecated(this.declaredClass+"::setAttribute() is deprecated. Use attr() instead.","","2.0");this.attr(attr,_142);},_attrToDom:function(attr,_143){var _144=this.attributeMap[attr];dojo.forEach(dojo.isArray(_144)?_144:[_144],function(_145){var _146=this[_145.node||_145||"domNode"];var type=_145.type||"attribute";switch(type){case "attribute":if(dojo.isFunction(_143)){_143=dojo.hitch(this,_143);}var _147=_145.attribute?_145.attribute:(/^on[A-Z][a-zA-Z]*$/.test(attr)?attr.toLowerCase():attr);dojo.attr(_146,_147,_143);break;case "innerText":_146.innerHTML="";_146.appendChild(dojo.doc.createTextNode(_143));break;case "innerHTML":_146.innerHTML=_143;break;case "class":dojo.removeClass(_146,this[attr]);dojo.addClass(_146,_143);break;}},this);this[attr]=_143;},attr:function(name,_148){var args=arguments.length;if(args==1&&!dojo.isString(name)){for(var x in name){this.attr(x,name[x]);}return this;}var _149=this._getAttrNames(name);if(args>=2){if(this[_149.s]){args=dojo._toArray(arguments,1);return this[_149.s].apply(this,args)||this;}else{if(name in this.attributeMap){this._attrToDom(name,_148);}this[name]=_148;}return this;}else{return this[_149.g]?this[_149.g]():this[name];}},_attrPairNames:{},_getAttrNames:function(name){var apn=this._attrPairNames;if(apn[name]){return apn[name];}var uc=name.charAt(0).toUpperCase()+name.substr(1);return (apn[name]={n:name+"Node",s:"_set"+uc+"Attr",g:"_get"+uc+"Attr"});},toString:function(){return "[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]";},getDescendants:function(){return this.containerNode?dojo.query("[widgetId]",this.containerNode).map(dijit.byNode):[];},getChildren:function(){return this.containerNode?dijit.findWidgets(this.containerNode):[];},nodesWithKeyClick:["input","button"],connect:function(obj,_14a,_14b){var d=dojo,dc=d._connect,_14c=[];if(_14a=="ondijitclick"){if(!this.nodesWithKeyClick[obj.tagName.toLowerCase()]){var m=d.hitch(this,_14b);_14c.push(dc(obj,"onkeydown",this,function(e){if((e.keyCode==d.keys.ENTER||e.keyCode==d.keys.SPACE)&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey){dijit._lastKeyDownNode=e.target;d.stopEvent(e);}}),dc(obj,"onkeyup",this,function(e){if((e.keyCode==d.keys.ENTER||e.keyCode==d.keys.SPACE)&&e.target===dijit._lastKeyDownNode&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey){dijit._lastKeyDownNode=null;return m(e);}}));}_14a="onclick";}_14c.push(dc(obj,_14a,this,_14b));this._connects.push(_14c);return _14c;},disconnect:function(_14d){for(var i=0;i<this._connects.length;i++){if(this._connects[i]==_14d){dojo.forEach(_14d,dojo.disconnect);this._connects.splice(i,1);return;}}},subscribe:function(_14e,_14f){var d=dojo,_150=d.subscribe(_14e,this,_14f);this._subscribes.push(_150);return _150;},unsubscribe:function(_151){for(var i=0;i<this._subscribes.length;i++){if(this._subscribes[i]==_151){dojo.unsubscribe(_151);this._subscribes.splice(i,1);return;}}},isLeftToRight:function(){return dojo._isBodyLtr();},isFocusable:function(){return this.focus&&(dojo.style(this.domNode,"display")!="none");},placeAt:function(_152,_153){if(_152.declaredClass&&_152.addChild){_152.addChild(this,_153);}else{dojo.place(this.domNode,_152,_153);}return this;},_onShow:function(){this.onShow();},onShow:function(){},onHide:function(){}});})();}if(!dojo._hasResource["dojo.string"]){dojo._hasResource["dojo.string"]=true;dojo.provide("dojo.string");dojo.string.rep=function(str,num){if(num<=0||!str){return "";}var buf=[];for(;;){if(num&1){buf.push(str);}if(!(num>>=1)){break;}str+=str;}return buf.join("");};dojo.string.pad=function(text,size,ch,end){if(!ch){ch="0";}var out=String(text),pad=dojo.string.rep(ch,Math.ceil((size-out.length)/ch.length));return end?out+pad:pad+out;};dojo.string.substitute=function(_154,map,_155,_156){_156=_156||dojo.global;_155=_155?dojo.hitch(_156,_155):function(v){return v;};return _154.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(_157,key,_158){var _159=dojo.getObject(key,false,map);if(_158){_159=dojo.getObject(_158,false,_156).call(_156,_159,key);}return _155(_159,key).toString();});};dojo.string.trim=String.prototype.trim?dojo.trim:function(str){str=str.replace(/^\s+/,"");for(var i=str.length-1;i>=0;i--){if(/\S/.test(str.charAt(i))){str=str.substring(0,i+1);break;}}return str;};}if(!dojo._hasResource["dojo.cache"]){dojo._hasResource["dojo.cache"]=true;dojo.provide("dojo.cache");(function(){var _15a={};dojo.cache=function(_15b,url,_15c){if(typeof _15b=="string"){var _15d=dojo.moduleUrl(_15b,url);}else{_15d=_15b;_15c=url;}var key=_15d.toString();var val=_15c;if(_15c!==undefined&&!dojo.isString(_15c)){val=("value" in _15c?_15c.value:undefined);}var _15e=_15c&&_15c.sanitize?true:false;if(val||val===null){if(val==null){delete _15a[key];}else{val=_15a[key]=_15e?dojo.cache._sanitize(val):val;}}else{if(!(key in _15a)){val=dojo._getText(key);_15a[key]=_15e?dojo.cache._sanitize(val):val;}val=_15a[key];}return val;};dojo.cache._sanitize=function(val){if(val){val=val.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");var _15f=val.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(_15f){val=_15f[1];}}else{val="";}return val;};})();}if(!dojo._hasResource["dijit._Templated"]){dojo._hasResource["dijit._Templated"]=true;dojo.provide("dijit._Templated");dojo.declare("dijit._Templated",null,{templateString:null,templatePath:null,widgetsInTemplate:false,_skipNodeCache:false,_earlyTemplatedStartup:false,_stringRepl:function(tmpl){var _160=this.declaredClass,_161=this;return dojo.string.substitute(tmpl,this,function(_162,key){if(key.charAt(0)=="!"){_162=dojo.getObject(key.substr(1),false,_161);}if(typeof _162=="undefined"){throw new Error(_160+" template:"+key);}if(_162==null){return "";}return key.charAt(0)=="!"?_162:_162.toString().replace(/"/g,"&quot;");},this);},buildRendering:function(){this._attachPoints=[];var _163=dijit._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache);var node;if(dojo.isString(_163)){node=dojo._toDom(this._stringRepl(_163));if(node.nodeType!=1){throw new Error("Invalid template: "+_163);}}else{node=_163.cloneNode(true);}this.domNode=node;this._attachTemplateNodes(node);if(this.widgetsInTemplate){var _164=dojo.parser,qry,attr;if(_164._query!="[dojoType]"){qry=_164._query;attr=_164._attrName;_164._query="[dojoType]";_164._attrName="dojoType";}var cw=(this._startupWidgets=dojo.parser.parse(node,{noStart:!this._earlyTemplatedStartup}));if(qry){_164._query=qry;_164._attrName=attr;}this._supportingWidgets=dijit.findWidgets(node);this._attachTemplateNodes(cw,function(n,p){return n[p];});}this._fillContent(this.srcNodeRef);},_fillContent:function(_165){var dest=this.containerNode;if(_165&&dest){while(_165.hasChildNodes()){dest.appendChild(_165.firstChild);}}},_attachTemplateNodes:function(_166,_167){_167=_167||function(n,p){return n.getAttribute(p);};var _168=dojo.isArray(_166)?_166:(_166.all||_166.getElementsByTagName("*"));var x=dojo.isArray(_166)?0:-1;for(;x<_168.length;x++){var _169=(x==-1)?_166:_168[x];if(this.widgetsInTemplate&&_167(_169,"dojoType")){continue;}var _16a=_167(_169,"dojoAttachPoint");if(_16a){var _16b,_16c=_16a.split(/\s*,\s*/);while((_16b=_16c.shift())){if(dojo.isArray(this[_16b])){this[_16b].push(_169);}else{this[_16b]=_169;}this._attachPoints.push(_16b);}}var _16d=_167(_169,"dojoAttachEvent");if(_16d){var _16e,_16f=_16d.split(/\s*,\s*/);var trim=dojo.trim;while((_16e=_16f.shift())){if(_16e){var _170=null;if(_16e.indexOf(":")!=-1){var _171=_16e.split(":");_16e=trim(_171[0]);_170=trim(_171[1]);}else{_16e=trim(_16e);}if(!_170){_170=_16e;}this.connect(_169,_16e,_170);}}}var role=_167(_169,"waiRole");if(role){dijit.setWaiRole(_169,role);}var _172=_167(_169,"waiState");if(_172){dojo.forEach(_172.split(/\s*,\s*/),function(_173){if(_173.indexOf("-")!=-1){var pair=_173.split("-");dijit.setWaiState(_169,pair[0],pair[1]);}});}}},startup:function(){dojo.forEach(this._startupWidgets,function(w){if(w&&!w._started&&w.startup){w.startup();}});this.inherited(arguments);},destroyRendering:function(){dojo.forEach(this._attachPoints,function(_174){delete this[_174];},this);this._attachPoints=[];this.inherited(arguments);}});dijit._Templated._templateCache={};dijit._Templated.getCachedTemplate=function(_175,_176,_177){var _178=dijit._Templated._templateCache;var key=_176||_175;var _179=_178[key];if(_179){try{if(!_179.ownerDocument||_179.ownerDocument==dojo.doc){return _179;}}catch(e){}dojo.destroy(_179);}if(!_176){_176=dojo.cache(_175,{sanitize:true});}_176=dojo.string.trim(_176);if(_177||_176.match(/\$\{([^\}]+)\}/g)){return (_178[key]=_176);}else{var node=dojo._toDom(_176);if(node.nodeType!=1){throw new Error("Invalid template: "+_176);}return (_178[key]=node);}};if(dojo.isIE){dojo.addOnWindowUnload(function(){var _17a=dijit._Templated._templateCache;for(var key in _17a){var _17b=_17a[key];if(typeof _17b=="object"){dojo.destroy(_17b);}delete _17a[key];}});}dojo.extend(dijit._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});}if(!dojo._hasResource["dijit._Container"]){dojo._hasResource["dijit._Container"]=true;dojo.provide("dijit._Container");dojo.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){this.inherited(arguments);if(!this.containerNode){this.containerNode=this.domNode;}},addChild:function(_17c,_17d){var _17e=this.containerNode;if(_17d&&typeof _17d=="number"){var _17f=this.getChildren();if(_17f&&_17f.length>=_17d){_17e=_17f[_17d-1].domNode;_17d="after";}}dojo.place(_17c.domNode,_17e,_17d);if(this._started&&!_17c._started){_17c.startup();}},removeChild:function(_180){if(typeof _180=="number"&&_180>0){_180=this.getChildren()[_180];}if(_180&&_180.domNode){var node=_180.domNode;node.parentNode.removeChild(node);}},getChildren:function(){return dojo.query("> [widgetId]",this.containerNode).map(dijit.byNode);},hasChildren:function(){return dojo.query("> [widgetId]",this.containerNode).length>0;},destroyDescendants:function(_181){dojo.forEach(this.getChildren(),function(_182){_182.destroyRecursive(_181);});},_getSiblingOfChild:function(_183,dir){var node=_183.domNode,_184=(dir>0?"nextSibling":"previousSibling");do{node=node[_184];}while(node&&(node.nodeType!=1||!dijit.byNode(node)));return node&&dijit.byNode(node);},getIndexOfChild:function(_185){return dojo.indexOf(this.getChildren(),_185);},startup:function(){if(this._started){return;}dojo.forEach(this.getChildren(),function(_186){_186.startup();});this.inherited(arguments);}});}if(!dojo._hasResource["dijit._Contained"]){dojo._hasResource["dijit._Contained"]=true;dojo.provide("dijit._Contained");dojo.declare("dijit._Contained",null,{getParent:function(){var _187=dijit.getEnclosingWidget(this.domNode.parentNode);return _187&&_187.isContainer?_187:null;},_getSibling:function(_188){var node=this.domNode;do{node=node[_188+"Sibling"];}while(node&&node.nodeType!=1);return node&&dijit.byNode(node);},getPreviousSibling:function(){return this._getSibling("previous");},getNextSibling:function(){return this._getSibling("next");},getIndexInParent:function(){var p=this.getParent();if(!p||!p.getIndexOfChild){return -1;}return p.getIndexOfChild(this);}});}if(!dojo._hasResource["dijit.layout._LayoutWidget"]){dojo._hasResource["dijit.layout._LayoutWidget"]=true;dojo.provide("dijit.layout._LayoutWidget");dojo.declare("dijit.layout._LayoutWidget",[dijit._Widget,dijit._Container,dijit._Contained],{baseClass:"dijitLayoutContainer",isLayoutContainer:true,postCreate:function(){dojo.addClass(this.domNode,"dijitContainer");dojo.addClass(this.domNode,this.baseClass);this.inherited(arguments);},startup:function(){if(this._started){return;}this.inherited(arguments);var _189=this.getParent&&this.getParent();if(!(_189&&_189.isLayoutContainer)){this.resize();this.connect(dojo.isIE?this.domNode:dojo.global,"onresize",function(){this.resize();});}},resize:function(_18a,_18b){var node=this.domNode;if(_18a){dojo.marginBox(node,_18a);if(_18a.t){node.style.top=_18a.t+"px";}if(_18a.l){node.style.left=_18a.l+"px";}}var mb=_18b||{};dojo.mixin(mb,_18a||{});if(!("h" in mb)||!("w" in mb)){mb=dojo.mixin(dojo.marginBox(node),mb);}var cs=dojo.getComputedStyle(node);var me=dojo._getMarginExtents(node,cs);var be=dojo._getBorderExtents(node,cs);var bb=(this._borderBox={w:mb.w-(me.w+be.w),h:mb.h-(me.h+be.h)});var pe=dojo._getPadExtents(node,cs);this._contentBox={l:dojo._toPixelValue(node,cs.paddingLeft),t:dojo._toPixelValue(node,cs.paddingTop),w:bb.w-pe.w,h:bb.h-pe.h};this.layout();},layout:function(){},_setupChild:function(_18c){dojo.addClass(_18c.domNode,this.baseClass+"-child");if(_18c.baseClass){dojo.addClass(_18c.domNode,this.baseClass+"-"+_18c.baseClass);}},addChild:function(_18d,_18e){this.inherited(arguments);if(this._started){this._setupChild(_18d);}},removeChild:function(_18f){dojo.removeClass(_18f.domNode,this.baseClass+"-child");if(_18f.baseClass){dojo.removeClass(_18f.domNode,this.baseClass+"-"+_18f.baseClass);}this.inherited(arguments);}});dijit.layout.marginBox2contentBox=function(node,mb){var cs=dojo.getComputedStyle(node);var me=dojo._getMarginExtents(node,cs);var pb=dojo._getPadBorderExtents(node,cs);return {l:dojo._toPixelValue(node,cs.paddingLeft),t:dojo._toPixelValue(node,cs.paddingTop),w:mb.w-(me.w+pb.w),h:mb.h-(me.h+pb.h)};};(function(){var _190=function(word){return word.substring(0,1).toUpperCase()+word.substring(1);};var size=function(_191,dim){_191.resize?_191.resize(dim):dojo.marginBox(_191.domNode,dim);dojo.mixin(_191,dojo.marginBox(_191.domNode));dojo.mixin(_191,dim);};dijit.layout.layoutChildren=function(_192,dim,_193){dim=dojo.mixin({},dim);dojo.addClass(_192,"dijitLayoutContainer");_193=dojo.filter(_193,function(item){return item.layoutAlign!="client";}).concat(dojo.filter(_193,function(item){return item.layoutAlign=="client";}));dojo.forEach(_193,function(_194){var elm=_194.domNode,pos=_194.layoutAlign;var _195=elm.style;_195.left=dim.l+"px";_195.top=dim.t+"px";_195.bottom=_195.right="auto";dojo.addClass(elm,"dijitAlign"+_190(pos));if(pos=="top"||pos=="bottom"){size(_194,{w:dim.w});dim.h-=_194.h;if(pos=="top"){dim.t+=_194.h;}else{_195.top=dim.t+dim.h+"px";}}else{if(pos=="left"||pos=="right"){size(_194,{h:dim.h});dim.w-=_194.w;if(pos=="left"){dim.l+=_194.w;}else{_195.left=dim.l+dim.w+"px";}}else{if(pos=="client"){size(_194,dim);}}}});};})();}if(!dojo._hasResource["dijit.form._FormWidget"]){dojo._hasResource["dijit.form._FormWidget"]=true;dojo.provide("dijit.form._FormWidget");dojo.declare("dijit.form._FormWidget",[dijit._Widget,dijit._Templated],{baseClass:"",name:"",alt:"",value:"",type:"text",tabIndex:"0",disabled:false,intermediateChanges:false,scrollOnFocus:true,attributeMap:dojo.delegate(dijit._Widget.prototype.attributeMap,{value:"focusNode",id:"focusNode",tabIndex:"focusNode",alt:"focusNode",title:"focusNode"}),postMixInProperties:function(){this.nameAttrSetting=this.name?("name='"+this.name+"'"):"";this.inherited(arguments);},_setDisabledAttr:function(_196){this.disabled=_196;dojo.attr(this.focusNode,"disabled",_196);if(this.valueNode){dojo.attr(this.valueNode,"disabled",_196);}dijit.setWaiState(this.focusNode,"disabled",_196);if(_196){this._hovering=false;this._active=false;this.focusNode.setAttribute("tabIndex","-1");}else{this.focusNode.setAttribute("tabIndex",this.tabIndex);}this._setStateClass();},setDisabled:function(_197){dojo.deprecated("setDisabled("+_197+") is deprecated. Use attr('disabled',"+_197+") instead.","","2.0");this.attr("disabled",_197);},_onFocus:function(e){if(this.scrollOnFocus){dijit.scrollIntoView(this.domNode);}this.inherited(arguments);},_onMouse:function(_198){var _199=_198.currentTarget;if(_199&&_199.getAttribute){this.stateModifier=_199.getAttribute("stateModifier")||"";}if(!this.disabled){switch(_198.type){case "mouseenter":case "mouseover":this._hovering=true;this._active=this._mouseDown;break;case "mouseout":case "mouseleave":this._hovering=false;this._active=false;break;case "mousedown":this._active=true;this._mouseDown=true;var _19a=this.connect(dojo.body(),"onmouseup",function(){if(this._mouseDown&&this.isFocusable()){this.focus();}this._active=false;this._mouseDown=false;this._setStateClass();this.disconnect(_19a);});break;}this._setStateClass();}},isFocusable:function(){return !this.disabled&&!this.readOnly&&this.focusNode&&(dojo.style(this.domNode,"display")!="none");},focus:function(){dijit.focus(this.focusNode);},_setStateClass:function(){var _19b=this.baseClass.split(" ");function _19c(_19d){_19b=_19b.concat(dojo.map(_19b,function(c){return c+_19d;}),"dijit"+_19d);};if(this.checked){_19c("Checked");}if(this.state){_19c(this.state);}if(this.selected){_19c("Selected");}if(this.disabled){_19c("Disabled");}else{if(this.readOnly){_19c("ReadOnly");}else{if(this._active){_19c(this.stateModifier+"Active");}else{if(this._focused){_19c("Focused");}if(this._hovering){_19c(this.stateModifier+"Hover");}}}}var tn=this.stateNode||this.domNode,_19e={};dojo.forEach(tn.className.split(" "),function(c){_19e[c]=true;});if("_stateClasses" in this){dojo.forEach(this._stateClasses,function(c){delete _19e[c];});}dojo.forEach(_19b,function(c){_19e[c]=true;});var _19f=[];for(var c in _19e){_19f.push(c);}tn.className=_19f.join(" ");this._stateClasses=_19b;},compare:function(val1,val2){if(typeof val1=="number"&&typeof val2=="number"){return (isNaN(val1)&&isNaN(val2))?0:val1-val2;}else{if(val1>val2){return 1;}else{if(val1<val2){return -1;}else{return 0;}}}},onChange:function(_1a0){},_onChangeActive:false,_handleOnChange:function(_1a1,_1a2){this._lastValue=_1a1;if(this._lastValueReported==undefined&&(_1a2===null||!this._onChangeActive)){this._resetValue=this._lastValueReported=_1a1;}if((this.intermediateChanges||_1a2||_1a2===undefined)&&((typeof _1a1!=typeof this._lastValueReported)||this.compare(_1a1,this._lastValueReported)!=0)){this._lastValueReported=_1a1;if(this._onChangeActive){if(this._onChangeHandle){clearTimeout(this._onChangeHandle);}this._onChangeHandle=setTimeout(dojo.hitch(this,function(){this._onChangeHandle=null;this.onChange(_1a1);}),0);}}},create:function(){this.inherited(arguments);this._onChangeActive=true;this._setStateClass();},destroy:function(){if(this._onChangeHandle){clearTimeout(this._onChangeHandle);this.onChange(this._lastValueReported);}this.inherited(arguments);},setValue:function(_1a3){dojo.deprecated("dijit.form._FormWidget:setValue("+_1a3+") is deprecated.  Use attr('value',"+_1a3+") instead.","","2.0");this.attr("value",_1a3);},getValue:function(){dojo.deprecated(this.declaredClass+"::getValue() is deprecated. Use attr('value') instead.","","2.0");return this.attr("value");}});dojo.declare("dijit.form._FormValueWidget",dijit.form._FormWidget,{readOnly:false,attributeMap:dojo.delegate(dijit.form._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(_1a4){this.readOnly=_1a4;dojo.attr(this.focusNode,"readOnly",_1a4);dijit.setWaiState(this.focusNode,"readonly",_1a4);this._setStateClass();},postCreate:function(){if(dojo.isIE){this.connect(this.focusNode||this.domNode,"onkeydown",this._onKeyDown);}if(this._resetValue===undefined){this._resetValue=this.value;}},_setValueAttr:function(_1a5,_1a6){this.value=_1a5;this._handleOnChange(_1a5,_1a6);},_getValueAttr:function(){return this._lastValue;},undo:function(){this._setValueAttr(this._lastValueReported,false);},reset:function(){this._hasBeenBlurred=false;this._setValueAttr(this._resetValue,true);},_onKeyDown:function(e){if(e.keyCode==dojo.keys.ESCAPE&&!(e.ctrlKey||e.altKey||e.metaKey)){var te;if(dojo.isIE){e.preventDefault();te=document.createEventObject();te.keyCode=dojo.keys.ESCAPE;te.shiftKey=e.shiftKey;e.srcElement.fireEvent("onkeypress",te);}}},_layoutHackIE7:function(){if(dojo.isIE==7){var _1a7=this.domNode;var _1a8=_1a7.parentNode;var _1a9=_1a7.firstChild||_1a7;var _1aa=_1a9.style.filter;while(_1a8&&_1a8.clientHeight==0){_1a8._disconnectHandle=this.connect(_1a8,"onscroll",dojo.hitch(this,function(e){this.disconnect(_1a8._disconnectHandle);_1a8.removeAttribute("_disconnectHandle");_1a9.style.filter=(new Date()).getMilliseconds();setTimeout(function(){_1a9.style.filter=_1aa;},0);}));_1a8=_1a8.parentNode;}}}});}if(!dojo._hasResource["dijit.dijit"]){dojo._hasResource["dijit.dijit"]=true;dojo.provide("dijit.dijit");}
/*********************************************************** {COPYRIGHT-TOP} ***
* Licensed Materials - Property of IBM
* Tivoli Presentation Services
*
* (C) Copyright IBM Corp. 2002,2003 All Rights Reserved.
*
* US Government Users Restricted Rights - Use, duplication or
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
************************************************************ {COPYRIGHT-END} ***
* Change Activity on 6/20/03 version 1.17:
* @00=WCL, V3R0, 04/14/2002, JCP: Initial version
* @01=D96484, V3R2, 06/14/2002, bcourt: hide select/iframe elements
* @02=D99067, V3R2, 06/25/2002, bcourt: hide listbox scrollbar
* @03=D97043, V3R3, 09/03/2002, JCP: fix launch menu item on linux NS6
* @04=D104656, V3R3, 09/16/2002, JCP: form submit instead of triggers, mozilla compatibility
* @05=D107029, V3R4, 12/03/2002, Mark Rebuck:  Added support for timed menu hiding
* @06=D110173, V3R4, 03/24/2003, JCP: selection sometimes gets stuck
* @07=D113641, V3R4, 04/29/2003, LSR: Requirement #258 Shorten CSS Names
* @08=D113626, V3R4, 06/20/2003, JCP: clicking on text doesn't launch action on linux Moz13
*******************************************************************************/

var visibleMenu_ = null;
var padding_ = 10;

var transImg_ = "transparent.gif";

var arrowNorm_ = "contextArrowDefault.gif";
var arrowSel_ = "contextArrowSelected.gif";
var arrowDis_ = "contextArrowDisabled.gif";
var launchNorm_ = "contextLauncherDefault.gif";
var launchSel_ = "contextLauncherSelected.gif";

var arrowNormRTL_ = "contextArrowDefault.gif";
var arrowSelRTL_ = "contextArrowSelected.gif";
var arrowDisRTL_ = "contextArrowDisabled.gif";
var launchNormRTL_ = "contextLauncherDefault.gif";
var launchSelRTL_ = "contextLauncherSelected.gif";

//ARC CHANGES FOR SPECIFYING STYLES - BEGIN
var defaultContextMenuBorderStyle_ = "lwpShadowBorder";
var defaultContextMenuTableStyle_ = "lwpBorderAll";
//ARC CHANGES FOR SPECIFYING STYLES - END

var arrowWidth_ = "12";
var arrowHeight_ = "12";

var submenuAltText_ = "+";

//ARC CHANGES FOR SPECIFIYING EMPTY MENU TEXT - BEGIN
var defaultNoActionsText_ = "(0)";
var defaultNoActionsTextStyle_ = "lwpMenuItemDisabled";
//ARC CHANGES FOR SPECIFIYING EMPTY MENU TEXT - END

var hideCurrentMenuTimer_ = null;

var onmousedown_ = document.onmousedown;

function clearMenuTimer( ) { //@05
   if (null != hideCurrentMenuTimer_) {
      clearTimeout( hideCurrentMenuTimer_ );
      hideCurrentMenuTimer_ = null;
   }
}

function setMenuTimer( ) { // @05
   clearMenuTimer( );
   hideCurrentMenuTimer_ = setTimeout( 'hideCurrentContextMenu( )', 2000);
}

function debug( str ) {
   /*
   if ( xbDEBUG != null ) {
      xbDEBUG.dump( str );
   }
   */
}

// constructor
function UilContextMenu( name, isLTR, width, borderStyle, tableStyle, emptyMenuText, emptyMenuTextStyle, positionUnder ) {
   // member variables
   this.name = name;
   this.items = new Array();
   this.isVisible = false;
   this.isDismissable = true;
   this.selectedItem = null;
   this.isDynamic = false;
   this.isCacheable = false;
   this.isEmpty = true;
   this.isLTR = isLTR;
   this.hiddenItems = new Array(); //@01A
   this.isHyperlinkChild = true; //  We will reset later if needed.
   
   this.bottomPositioned = positionUnder;

   // html variables
   this.launcher = null;
   this.menuTag = null;

   //ARC CHANGES FOR SPECIFYING STYLES - BEGIN
   //styles for menu
   if ( borderStyle != null )
   {
       this.menuBorderStyle = borderStyle;
   }
   else
   {
       this.menuBorderStyle = defaultContextMenuBorderStyle_;
   }
   
   if ( tableStyle != null )
   {
       this.menuTableStyle = tableStyle;
   }
   else
   {
       this.menuTableStyle = defaultContextMenuTableStyle_;
   }
   //ARC CHANGES FOR SPECIFYING STYLES - END

   //ARC CHANGES FOR SPECIFIYING EMPTY MENU TEXT - BEGIN
   if ( emptyMenuText != null )
   {
   	   this.noActionsText = emptyMenuText;
   }
   else
   {
   	   this.noActionsText = defaultNoActionsText_;
   }
   
   if ( emptyMenuTextStyle != null )
   {
   	   this.noActionsTextStyle = emptyMenuTextStyle;
   }
   else
   {
   	   this.noActionsTextStyle = defaultNoActionsTextStyle_;
   }
   //ARC CHANGES FOR SPECIFIYING EMPTY MENU TEXT - END

   // external methods
   this.add = UilContextMenuAdd;
   this.addSeparator = UilContextMenuAddSeparator;
   this.show = UilContextMenuShow;
   this.hide = UilContextMenuHide;

   // internal methods
   this.create = UilContextMenuCreate;
   this.getMenuItem = UilContextMenuGetMenuItem;
   this.getSelectedItem = UilContextMenuGetSelectedItem;

   if ( this.name == null ) {
      this.name = "UilContextMenu_" + allMenus_.length;
   }
}

// adds a menu item to the context menu
function UilContextMenuAdd( item ) {
   this.items[ this.items.length ] = item;
   this.isEmpty = false;
}

function UilContextMenuAddSeparator() {
   var sep = new UilMenuItem();
   sep.isSeparator = true;
   this.add( sep );
}

// shows the context menu
// launcher- html element (anchor) that is launching the menu
// launchItem- menu item that is launching the menu
function UilContextMenuShow( launcher, launchItem ) {
   if ( this.items.length == 0 ) {
      // empty context menu
      debug( 'menu is empty!' );
      //ARC CHANGES FOR SPECIFIYING EMPTY MENU TEXT - BEGIN
      this.add( new UilMenuItem( this.noActionsText, false, "javascript:void(0);", null, null, null, null, this.noActionsTextStyle ) );
      //ARC CHANGES FOR SPECIFIYING EMPTY MENU TEXT - END
      this.isEmpty = true;
   }

   if ( this.menuTag == null ) {
      // create the context menu html
      this.create();
   } else {
      this.menuTag.style.left = ""; //196195 //Reset
      this.menuTag.style.top = ""; //196195 //Reset
      this.menuTag.style.width = ""; //"0px"; //196195 //Reset
      this.menuTag.style.height = ""; //196195 //Reset
      this.menuTag.style.overflow = "visible"; //196195 //Reset, No horizontal and vertical scrollbars
   }

   if ( this.menuTag != null) {
      // store the launcher for later
      this.launcher = launcher;
      if ( this.launcher.tagName == "IMG" ) {
         this.isHyperlinkChild = false;

         // we want the anchor tag
         this.launcher = this.launcher.parentNode;
      }

      // boundaries of window
      var bd = new ContextMenuBrowserDimensions();
      var maxX = bd.getScrollFromLeft() + bd.getViewableAreaWidth();
      var maxY = bd.getScrollFromTop() + bd.getViewableAreaHeight();
      var minX = bd.getScrollFromLeft();
      var minY = bd.getScrollFromTop();

      debug( 'max: ' + maxX + ', ' + maxY );

      var menuWidth = getWidth( this.menuTag );
      var menuHeight = getHeight( this.menuTag );

      // move the context menu to the right of the launcher
      var posX = 0;
      var posY = 0;
      var fUseUpperY = false; //196195
      var maxUpperPosY = 0; //196195

      if ( launchItem != null ) {
         // launched from submenu
         var launchTag = launchItem.itemTag;
         var launchTagWidth = getWidth( launchTag );
         var parentTag = launchItem.parentMenu.menuTag; //@04A
         var launchOffsetX = getLeft( parentTag ); //@04C
         var launchOffsetY = getTop( parentTag ); //@04C

         posX = launchOffsetX + getLeft( launchTag ) + launchTagWidth; //@04C
         posY = launchOffsetY + getTop( launchTag ); //@04C

         if ( !this.isLTR ) {
            posX -= launchTagWidth;
            posX -= menuWidth;
         }

         // try to keep it in the window
         if ( this.isLTR ) {
            if ( posX + menuWidth > maxX ) {
               // try to show it to the left of the parent menu
               var posX1 = launchOffsetX - menuWidth;
               var posX2 = maxX - menuWidth;
               if ( 0 <= posX1 ) {
                  posX = posX1;
               }
               else {
                  posX = Math.max( minX, posX2 );
               }
            }
         }
         else {
            if ( posX < 0 ) {
               // try to show it to the right of the parent menu
               var posX1 = launchOffsetX + launchTagWidth;
               if ( posX1 + menuWidth < maxX ) {
                  posX = posX1;
               }
               else {
                  posX = Math.min( maxX, maxX - menuWidth );
               }
            }
         }

         if ( posY + menuHeight > maxY ) {
            var posY1 = maxY - menuHeight;
            posY = Math.max( minY, posY1 );
         }
      }
      else {
         // launched from menu link
         var launcherLeft = getLeft( this.launcher, true )
         if ( this.launcher.tagName == "BUTTON" || this.bottomPositioned ) {
			
             posX = launcherLeft;
             
             // bidi
             if ( !this.isLTR ) {
                 //196195 posX += getWidth( this.launcher ) - getWidth( this.menuTag );
                 posX += getWidth( this.launcher ) - menuWidth; //196195
             }

             if (this.isLTR) {
                 if ((posX + menuWidth) > maxX) {
                     //196195 begins
                     if ((posX + getWidth(this.launcher)) > maxX) {
                         posX = Math.max(minX, maxX - menuWidth);
                     }
                     else 
                     //196195 ends
                         posX = Math.max(minX, posX + getWidth( this.launcher ) - menuWidth);
                 }
                 //196195 begins 
                 else if (posX < minX) {
                     posX = minX;
                 }
                 //196195 ends 
             }
             else{
                 if (posX < minX) {
                     //196195 if ((launcherLeft + menuWidth) < maxX) {
                     if ((launcherLeft > minX) && ((launcherLeft + menuWidth) < maxX)) { //196195
                         posX = launcherLeft;
                     }
                     else{
                         posX = Math.min(minX, maxX - menuWidth);
                     }
                 }
                 //196195 begins
                 else if ( (posX + menuWidth) > maxX) {
                     if (Math.min(posX, maxX - menuWidth) >= minX)
                         posX = Math.min(posX, maxX - menuWidth);
                 }
                 //196195 ends  
             }
             
             maxUpperPosY = getTop( this.launcher, true ); //196195
             var upperVisibleHeight = maxUpperPosY - minY; //196195
             posY = getTop( this.launcher, true ) + getHeight( this.launcher );
             var lowerVisibleHeight = maxY - posY; //196195
             //196195 if ( posY + menuHeight > maxY ) {
             if ( (posY + menuHeight > maxY) && (lowerVisibleHeight < upperVisibleHeight) ) { //196195
                // top
                posY -= (menuHeight + getHeight( this.launcher ));
                fUseUpperY = true; //196195
             }

             if ( posY < minY ) {
                posY = minY;
             }
         }
         else {

             // left-right
             posX = launcherLeft + this.launcher.offsetWidth;
             posY = getTop( this.launcher, true );

             if ( !this.isLTR ) {
                posX -= this.launcher.offsetWidth;
                posX -= menuWidth;
             }

             // keep it in the window
             if ( this.isLTR ) {
                if ( posX + menuWidth > maxX ) {
                   // try to show it on the left side of the launcher
                   var posX1 = launcherLeft - menuWidth;
                   if ( posX1 > 0 ) {
                      posX = posX1;
                   }
                   else {
                      posX = Math.max( minX, maxX - menuWidth );
                   }
                }
             }
             else {
                if ( posX < minX ) {
                   // try to show it on the right side of the launcher
                   var posX1 = launcherLeft + this.launcher.offsetWidth;
                   if ( posX1 + menuWidth < maxX ) {
                      posX = posX1;
                   }
                   else {
                      posX = Math.min( minX, maxX - menuWidth );
                   }
                }
             }

             if ( posY + menuHeight > maxY ) {
                posY = Math.max( minY, maxY - menuHeight );
             }
         }
         if ( ((posX + menuWidth) > maxX) ||
              (((posY + menuHeight) > maxY) && (fUseUpperY == false)) || 
              (((posY + menuHeight) > maxUpperPosY) && (fUseUpperY == true)) ) {
             if (posX + menuWidth > maxX) {
                 this.menuTag.style.width = (maxX - posX) + "px";
             }
             else{
                 this.menuTag.style.width = menuWidth + "px";
             }

             if (fUseUpperY == false) {
                 if (posY + menuHeight > maxY) {
                     this.menuTag.style.height = (maxY - posY) + "px";
                 }
                 else {
                     this.menuTag.style.height = menuHeight + "px";
                 }
             } else {
                 if (posY + menuHeight > maxUpperPosY) {
                     this.menuTag.style.height = (maxUpperPosY - posY) + "px";
                 }
                 else {
                     this.menuTag.style.height = menuHeight + "px";
                 }
             }

             this.menuTag.style.overflow = "auto";
         } else { //196195 begins
             this.menuTag.style.width = menuWidth + "px";
             this.menuTag.style.height = menuHeight + "px";
             this.menuTag.style.overflow = "visible"; //196195
         } //196196 ends
      }

      debug( 'show ' + this.name + ': ' + posX + ', ' + posY );
      this.menuTag.style.left = posX + "px";
      this.menuTag.style.top = posY + "px";

      // make the context menu visible
      this.menuTag.style.visibility = "visible";
      this.isVisible = true;

      // set focus on the first menu item
      this.items[0].setSelected( true );
      this.items[0].anchorTag.focus();

      // @01A - Hide any items that intersect this menu
      var coll = document.getElementsByTagName("SELECT");
      if (coll!=null)
      {
         for (i=0; i<coll.length; i++)
         {
            //Hide the element
            if (intersect(this.menuTag,coll[i]) == true ) {
               if (coll[i].style.visibility != "collapse") //@02C
               {
                  coll[i].style.visibility = "collapse"; //@02C
                  this.hiddenItems.push(coll[i]);
               }
            }
         }
      }
      coll = document.getElementsByTagName("IFRAME");
      if (coll!=null)
      {
         for (i=0; i<coll.length; i++)
         {
            //Hide the element
            if (intersect(this.menuTag,coll[i]) == true ) {
               if (coll[i].style.visibility != "hidden")
               {
                  coll[i].style.visibility = "hidden";
                  this.hiddenItems.push(coll[i]);
               }
            }
         }
      }

      // save old & set new hide action for this menu     
      onmousedown_ = document.onmousedown;
      document.onmousedown = hideCurrentContextMenu;
   }
}

// Test whether two objects overlap
function intersect(obj1 , obj2) //@01A
{
   var left1 =  parseInt(document.defaultView.getComputedStyle(obj1, '').getPropertyValue("left"));
   var right1 = left1 + parseInt(document.defaultView.getComputedStyle(obj1, '').getPropertyValue("width"));
   var top1 = parseInt(document.defaultView.getComputedStyle(obj1, '').getPropertyValue("top"));
   var bottom1 = top1 + parseInt(document.defaultView.getComputedStyle(obj1, '').getPropertyValue("height"));

   var left2 =  parseInt(document.defaultView.getComputedStyle(obj2, '').getPropertyValue("left"));
   var right2 = left2 + parseInt(document.defaultView.getComputedStyle(obj2, '').getPropertyValue("width"));
   var top2 = parseInt(document.defaultView.getComputedStyle(obj2, '').getPropertyValue("top"));
   var bottom2 = top2 + parseInt(document.defaultView.getComputedStyle(obj2, '').getPropertyValue("height"));

    //alert("Comparing: " +left1 + ", " + right1+ ", " +top1 + ", " + bottom1+ " to "  +left2 + ", "  +right2 + ", " +top2 + ", " +bottom2);
   if (lineIntersect(left1,right1, left2,right2)== true &&
       lineIntersect(top1,bottom1,top2,bottom2) == true) {
      return true;
   }
   return false;
}

// Test whether the two line segments a--b and c--d intersect.
function lineIntersect(a, b, c, d) //@01A
{
   //alert (a+"--"+b + "   " + c + "--" + d);
   //Assume that a < b && c < d
   if ( (a <= c  && c <= b) ||
        (a <= d && d <= b) ||
        (c <= a && d >= b ) )
   {
      return true;
   } else {
      return false;
   }
}

// hides the context menu
function UilContextMenuHide() {
   if ( this.menuTag != null ) {
      debug( 'hide ' + this.name );

      // hide any visible submenus first
      for ( var i=0; i<this.items.length; i++ ) {
         if ( this.items[i].submenu != null &&
              this.items[i].submenu.isVisible ) {
            this.items[i].submenu.hide();
         }
      }

      // clear selection
      if ( this.selectedItem != null ) {
         this.selectedItem.setSelected( false );
      }

      // make the context menu hidden
      this.menuTag.style.visibility = "hidden";
      this.isVisible = false;
      this.isDismissable = true;

      // @01A - Show any items that were hidden by this menu
      var itemCount = this.hiddenItems.length;
      for (i=0; i<itemCount; i++)
      {
         var item = this.hiddenItems.pop();
         item.style.visibility = "visible";
      }

      // clear the launcher
      this.launcher = null;
      
      // reset action      
      document.onmousedown = onmousedown_;
   }
}

// creates the context menu html element
function UilContextMenuCreate( recurse ) {
   if ( this.menuTag == null ) {
      this.menuTag = document.createElement( "DIV" );
      this.menuTag.style.position = "absolute";
      this.menuTag.style.cursor = "default";
      this.menuTag.style.visibility = "hidden";
      // following line does not work on Mozilla. SPR #PDIK66SJZ4
      //this.menuTag.style.width = "0px"; // this causes dynamic sizing
      //if (!this.isLTR) this.menuTag.dir = "RTL"; //196195
      this.menuTag.onmouseover = contextMenuDismissDisable;
      this.menuTag.onmouseout = contextMenuDismissEnable;
      this.menuTag.oncontextmenu = contextMenuOnContextMenu;

      var numItems = this.items.length;

      // check if this context menu contains icons or submenus
      var hasIcon = false;
      var hasSubmenu = false;
      for ( var i=0; i<numItems; i++ ) {
         if ( !this.items[i].isSeparator ) {
            if ( !hasSubmenu && this.items[i].submenu != null ) {
               hasSubmenu = true;
            }
            if ( !hasIcon && this.items[i].icon != null ) {
               hasIcon = true;
            }
            if ( hasSubmenu && hasIcon ) {
               break;
            }
         }
      }

      // create the menu items
      for ( var i=0; i<numItems; i++ ) {
         this.items[i].isFirst = ( i == 0 );
         this.items[i].isLast = ( i+1 == numItems );
         this.items[i].parentMenu = this;
         this.items[i].create( hasIcon, hasSubmenu );
      }

      // create the context menu border
      var border = document.createElement( "TABLE" );
      if (!this.isLTR) border.dir = "RTL";
      //border.className = "wclPopupMenuBorder"; //@04D
      border.rules = "none";
      border.cellPadding = 0;
      border.cellSpacing = 0;
      //border.width = "100%";
      border.border = 0;
      var borderBody = document.createElement( "TBODY" );
      var borderRow = document.createElement( "TR" );
      var borderData = document.createElement( "TD" );
      var borderDiv = document.createElement( "DIV" ); //@04A
      //borderDiv.className = "pop2"; //@04A   //@06C1
      
      //ARC CHANGES FOR SPECIFYING STYLES - BEGIN
      borderDiv.className = this.menuBorderStyle; 
      //ARC CHANGES FOR SPECIFYING STYLES - END

      borderData.appendChild( borderDiv ); //@04A
      borderRow.appendChild( borderData );
      borderBody.appendChild( borderRow );
      border.appendChild( borderBody );

      // create the context menu
      var table = document.createElement( "TABLE" );
      if (!this.isLTR) table.dir = "RTL";
      //table.className = "wclPopupMenu"; //@04D
      table.rules = "none";
      table.cellPadding = 0;
      table.cellSpacing = 0;
      table.width = "100%";
      table.border = 0;

      // add the menu items
      var tableBody = document.createElement( "TBODY" );
      table.appendChild( tableBody );

      // @04A - create another table for mozilla fix
      // (border styles not hidden correctly if set on table tag)
      var table2 = document.createElement( "TABLE" );
      if (!this.isLTR) table2.dir = "RTL";
      table2.rules = "none";
      table2.cellPadding = 0;
      table2.cellSpacing = 0;
      table2.width = "100%";
      table2.border = 0;
      var tableRow = document.createElement( "TR" );
      var tableData = document.createElement( "TD" );
      var tableDiv = document.createElement( "DIV" );
      //tableDiv.className = "pop1";     //@06C1

      //ARC CHANGES FOR SPECIFYING STYLES - BEGIN
      tableDiv.className = this.menuTableStyle;     //@06C1
      //ARC CHANGES FOR SPECIFYING STYLES - END

      var tableBody2 = document.createElement( "TBODY" );
      tableBody.appendChild( tableRow );
      tableRow.appendChild( tableData );
      tableData.appendChild( tableDiv );
      tableDiv.appendChild( table2 );
      table2.appendChild( tableBody2 );

      for ( var i=0; i<numItems; i++ ) {
         if ( this.items[i].isSeparator ) {
            this.items[i].createSeparator( tableBody2, hasSubmenu ); //@04C
         }
         else {
            tableBody2.appendChild( this.items[i].itemTag ); //@04C
         }
      }

      borderDiv.appendChild( table ); //@04C
      this.menuTag.appendChild( border );

      // add to document
      document.body.appendChild( this.menuTag );
   }

   if ( recurse ) {
      // this is used when cloning dynamic menus
      for ( var i=0; i<this.items.length; i++ ) {
         if ( this.items[i].submenu != null ) {
            this.items[i].submenu.create( recurse );
         }
      }
   }
}

// returns the menu item object associated with the html element
function UilContextMenuGetMenuItem( htmlElement ) {
   if ( htmlElement != null ) {
      if ( htmlElement.nodeType == 3 ) { //@06A
          // text node
          htmlElement = htmlElement.parentNode; //@06A
      }
      var tagName = htmlElement.tagName;
      var menuItemTag = null;
      if ( tagName == "IMG" ||
           tagName == "A" ) {
         menuItemTag = htmlElement.parentNode.parentNode;
      }
      else if ( tagName == "TD" ) {
         menuItemTag = htmlElement.parentNode;
      }
      for ( var i=0; i<this.items.length; i++ ) {
         if ( this.items[i].itemTag != null &&
              this.items[i].itemTag == menuItemTag ) {
            // found the item
            return this.items[i];
         }
         else if ( this.items[i].submenu != null &&
                   this.items[i].submenu.isVisible ) {
            // recurse through any visible submenus
            var item = this.items[i].submenu.getMenuItem( htmlElement );
            if ( item != null ) {
               // found the item
               return item;
            }
         }
      }
   }
   return null;
}

// returns the deepest selected menu item
function UilContextMenuGetSelectedItem() {
   var item = this.selectedItem;
   if ( item != null && item.submenu != null && item.submenu.isVisible ) {
      // recurse through the item's visible submenu
      return item.submenu.getSelectedItem();
   }
   return item;
}

// method called by an event handler (onmouseover for context menu div)
function contextMenuDismissEnable() {
   if ( visibleMenu_ != null ) {
      visibleMenu_.isDismissable = true;
      if (visibleMenu_.isHyperlinkChild) {
         setMenuTimer( ); // @05
      }
   }
}

// method called by an event handler (onmouseout for context menu div)
function contextMenuDismissDisable() {
   if ( visibleMenu_ != null ) {
      visibleMenu_.isDismissable = false;
      clearMenuTimer( ); // @05
   }
}

// method called by an event handler (oncontextmenu for context menu div)
function contextMenuOnContextMenu() {
   return false;
}

// constructor
function UilMenuItem( text, enabled, action, clientAction, submenu, icon, defItem,menuStyle, selectedMenuStyle ) {
   // member variables
   this.text = text;
   this.icon = icon;
   this.action = action;
   this.clientAction = clientAction;
   this.submenu = submenu;
   this.isSeparator = false;
   this.isSelected = false;
   this.isEnabled = ( enabled != null ) ? enabled : true;
   this.isDefault = ( defItem != null ) ? defItem : false;
   this.isFirst = false;
   this.isLast = false;
   this.parentMenu = null;
   
   if ( menuStyle != null ) {
      this.menuStyle = menuStyle; 
   }
   else {
      this.menuStyle = ( this.isEnabled ) ? "lwpMenuItem" : "lwpMenuItemDisabled"; 
   }

   this.selectedMenuStyle = ( selectedMenuStyle != null) ? selectedMenuStyle : "lwpSelectedMenuItem";

   // html variables
   this.itemTag = null;
   this.anchorTag = null;
   this.arrowTag = null;

   // internal methods
   this.create = UilMenuItemCreate;
   this.createSeparator = UilMenuItemCreateSeparator;
   this.setSelected = UilMenuItemSetSelected;
   this.updateStyle = UilMenuItemUpdateStyle;
   this.getNextItem = UilMenuItemGetNextItem;
   this.getPrevItem = UilMenuItemGetPrevItem;

   if ( this.submenu != null ) {
      // menu items with submenus do not have actions
      this.action = null;
   }
}

// creates the menu item html element
function UilMenuItemCreate( menuHasIcon, menuHasSubmenu ) {
   if ( !this.isSeparator ) {
      this.anchorTag = document.createElement( "A" );
      if ( this.action != null ) {
         this.anchorTag.href = "javascript:menuItemLaunchAction();";
         if ( this.clientAction != null ) {
            this.anchorTag.onclick = this.clientAction;
         }
      }
      else if ( this.submenu != null ) {
         this.anchorTag.href = "javascript:void(0);";
         this.anchorTag.onclick = menuItemShowSubmenu;
      }
      else if ( this.clientAction != null ) {
         this.anchorTag.href = "javascript:menuItemLaunchAction();";
         this.anchorTag.onclick = this.clientAction;
      }
      this.anchorTag.onfocus = menuItemFocus;
      this.anchorTag.onblur = menuItemBlur;
      this.anchorTag.onkeydown = menuItemKeyDown;
      this.anchorTag.innerHTML = this.text;
//      this.anchorTag.title = this.text; 
      this.anchorTag.title = this.anchorTag.innerHTML; 
      //this.anchorTag.className = "pop5";    //@06C1
      this.anchorTag.className = this.menuStyle;    //@06C1
      if ( this.isDefault ) {
         this.anchorTag.style.fontWeight = "bold";
      }

      var td = document.createElement( "TD" );
      td.noWrap = true;
      td.style.padding = "3px";
      td.appendChild( this.anchorTag );

      // left padding or icon
      var leftPad = document.createElement( "TD" );
      leftPad.noWrap = true;
      leftPad.innerHTML = "&nbsp;";
      leftPad.style.padding = "3px";
      if ( this.icon != null ) {
         var imgTag = document.createElement( "IMG" );
         imgTag.src = this.icon;
         if (imgTag.src == "" || imgTag.src == null) {
             var imgTag1 = "<img src=\"" + this.icon + "\"";
             if ( this.text != null ) {
                imgTag1 += " alt=\'" + this.text + "\'";
                imgTag1 += " title=\'" + this.text + "\'";
             }
             imgTag1 += "/>";
             leftPad.innerHTML = imgTag1;
         } else {
             if ( this.text != null ) {
                imgTag.alt = this.text;
                imgTag.title = this.text;
             }
             leftPad.appendChild( imgTag );
         }
      }
      else {
         leftPad.width = padding_;
      }

      // right padding
      var rightPad = document.createElement( "TD" );
      rightPad.noWrap = true;
      rightPad.width = padding_;
      rightPad.innerHTML = "&nbsp;";
      rightPad.style.padding = "3px";

      this.itemTag = document.createElement( "TR" );
      this.itemTag.onmousemove = menuItemMouseMove;
      this.itemTag.onmousedown = menuItemLaunchAction;
      //this.itemTag.className = "pop5";  //@06C1
      this.itemTag.className = this.menuStyle;
      // put together the table row
      this.itemTag.appendChild( leftPad );
      this.itemTag.appendChild( td );
      this.itemTag.appendChild( rightPad );
      if ( menuHasSubmenu ) {
         // submenu arrow
         var submenuArrow = document.createElement( "TD" );
         submenuArrow.noWrap = true;
         submenuArrow.style.padding = "3px";
         if ( this.submenu != null ) {
            var submenuImg = document.createElement( "IMG" );
            submenuImg.alt = submenuAltText_;
            submenuImg.title = submenuAltText_;
            submenuImg.width = arrowWidth_;
            submenuImg.height = arrowHeight_;
            if (this.parentMenu.isLTR) submenuImg.src = arrowNorm_;
            else submenuImg.src = arrowNormRTL_;
            submenuArrow.appendChild( submenuImg );
            this.arrowTag = submenuImg;
         }
         else {
            submenuArrow.innerHTML = "&nbsp;";
         }
         this.itemTag.appendChild( submenuArrow );
      }

      // update the style of the menu item
      this.updateStyle( this.itemTag );
   }
}

// create the context menu separator html elements
function UilMenuItemCreateSeparator( tableBody, menuHasSubmenu ) {
   // create the context menu separator
   var numCols = ( menuHasSubmenu ) ? 4 : 3;

   for ( var i=0; i<4; i++ ) {
      var tr = document.createElement( "TR" );
      if ( i == 1 ) {
         //tr.className = "pop3";   //@06C1
         tr.className = "portlet-separator";   //@06C1
      }
      else if ( i == 2 ) {
         //tr.className = "pop4";   //@06C1
         tr.className = "lwpMenuBackground";   //@06C1
      }
      else {
         //tr.className = "pop5";   //@06C1
         tr.className = "lwpMenuItem";   //@06C1
      }

      var td = document.createElement( "TD" );
      td.noWrap = true;
      td.width = "100%";
      td.height = "1px";
      td.colSpan = numCols;

      //mmd - 06/09/06 - commenting out this section of code because it causes many additional requests
      //to the server everytime a context menu is opened.  after unit testing, removing piece of code
      //does not appear to affect the function of the menus
      /*var img = document.createElement( "IMG" );
      img.src = transImg_;
      img.width = 1;
      img.height = 1;
      img.style.display = "block";
      td.appendChild( img );*/

      tr.appendChild( td );
      tableBody.appendChild( tr );
   }
}

// changes the selected state for menu item
function UilMenuItemSetSelected( isSelected ) {

   if ( isSelected && !this.isSelected ) {
      debug( 'selected: ' + this.text );
      // handle the previous selection first
      if ( this.parentMenu != null &&
           this.parentMenu.isVisible &&
           this.parentMenu.selectedItem != null &&
           this.parentMenu.selectedItem != this ) {
         // hide previous selection's submenu
         if ( this.parentMenu.selectedItem.submenu != null ) {
            this.parentMenu.selectedItem.submenu.hide();
         }
         // unselect previous selection from parent menu
         this.parentMenu.selectedItem.setSelected( false );
      }

      // select this menu item
      this.isSelected = true;
      if ( this.parentMenu != null && this.parentMenu.isVisible ) {
         this.parentMenu.selectedItem = this;
      }

      // update the styles
      this.updateStyle( this.itemTag );
   }
   else if ( !isSelected && this.isSelected ) {
      debug( 'deselected: ' + this.text );
      // menu item cannot be unselected if its submenu is visible
      if ( this.submenu == null || ( this.submenu != null && !this.submenu.isVisible ) ) {
         // unselect this menu item
         this.isSelected = false;
         if ( this.parentmenu != null ) {
            this.parentmenu.selectedItem = null;
         }

         // update the styles
         this.updateStyle( this.itemTag );
      }
   }
}

// recursively set the style of the menu item html element
function UilMenuItemUpdateStyle( tag, styleID ) {
   if ( tag != null ) {
      if ( styleID == null ) {
         //styleID = "pop5";  //@06C1
         styleID = this.menuStyle;
         if ( !this.isEnabled ) {
            //styleID = "pop7"; //@06C1
            styleID = this.menuStyle; 
         }
         else if ( this.isSelected ) {
            //styleID = "pop6";  //@06C1
            styleID = this.selectedMenuStyle;  //@06C1
         }
         if ( this.arrowTag != null ) {
            if ( this.isEnabled && this.isSelected ) {
               if (this.parentMenu.isLTR) this.arrowTag.src = arrowSel_;
               else this.arrowTag.src = arrowSelRTL_;
            }
            else if ( !this.isEnabled ) {
               if (this.parentMenu.isLTR) this.arrowTag.src = arrowDis_;
               else this.arrowTag.src = arrowDisRTL_;
            }
            else {
               if (this.parentMenu.isLTR) this.arrowTag.src = arrowNorm_;
               else this.arrowTag.src = arrowNormRTL_;
            }
         }
      }
      tag.className = styleID;
      if ( tag.childNodes != null ) {
         for ( var i=0; i<tag.childNodes.length; i++ ) {
            this.updateStyle( tag.childNodes[i], styleID );
         }
      }
   }
}

// returns the next enabled, non-separator menu item after the given item
function UilMenuItemGetNextItem() {
   var menu = this.parentMenu;
   if ( menu != null ) {
      for ( var i=0; i<menu.items.length; i++ ) {
         if ( menu.items[i] == this ) {
            for ( var j=i+1; j<menu.items.length; j++ ) {
               if ( !menu.items[j].isSeparator && menu.items[j].isEnabled ) {
                  return menu.items[j];
               }
            }
            // no next item
            return null;
         }
      }
   }
   return null;
}

// returns the previous enabled, non-separator menu item before the given item
function UilMenuItemGetPrevItem() {
   var menu = this.parentMenu;
   if ( menu != null ) {
      for ( var i=menu.items.length-1; i>=0; i-- ) {
         if ( menu.items[i] == this ) {
            for ( var j=i-1; j>=0; j-- ) {
               if ( !menu.items[j].isSeparator && menu.items[j].isEnabled ) {
                  return menu.items[j];
               }
            }
            // no previous item
            return null;
         }
      }
   }
   return null;
}

// launches the action for a menu item
// method called by an event handler (href for anchor tag)
function menuItemLaunchAction() {
   if ( visibleMenu_ != null ) {
      //var evt = window.event;
      //var item = visibleMenu_.getMenuItem( evt.target );
      var item = visibleMenu_.getSelectedItem();
      if ( item != null && item.isEnabled ) {
         hideCurrentContextMenu( true );
         if ( item.clientAction != null ) {
            eval( item.clientAction );
         }
         if ( item.action != null ) {
            if ( item.action.indexOf( "javascript:" ) == 0 ) {
               eval( item.action );
            }
            else {
               //window.location.href = item.action; //@04D
            }
         }
      }
   }
}

// shows the submenu for a menu item
// method called by an event handler (onclick for anchor tag)
function menuItemShowSubmenu(evt) {
   if ( visibleMenu_ != null ) {
      var item = visibleMenu_.getMenuItem( evt.target );
      if ( item != null && item.isEnabled ) {
         var menu = item.submenu;
         if ( menu != null ) {
            menu.show( item.anchorTag, item );
         }
      }
   }
}

// focus handler for menu item
// method called by an event handler (onfocus for anchor tag)
function menuItemFocus(evt) {
   if ( visibleMenu_ != null ) {
      var item = visibleMenu_.getMenuItem( evt.target );
      if ( item != null ) {
         // select the focused menu item
         //item.anchorTag.hideFocus = item.isEnabled;
         item.setSelected( true );
      }
   }
}

// blur handler for menu item
// method called by an event handler (onblur for anchor tag)
function menuItemBlur(evt) {
   if ( visibleMenu_ != null ) {
      var item = visibleMenu_.getMenuItem( evt.target );
      if ( item != null ) {
         /* //jcp
         if ( item.isFirst && evt.shiftKey ) {
            debug( 'blur = ' + item.text );
            // user is shift tabbing off the beginning of the menu
            // set focus on the launcher
            item.parentMenu.launcher.focus();
            // hide the menu
            item.parentMenu.hide();
         }
         */
      }
   }
}

// key press handler for menu item
// method called by an event handler (onkeydown for anchor tag)
function menuItemKeyDown(evt) {
   var item = null;
   if ( visibleMenu_ != null ) {
      item = visibleMenu_.getMenuItem( evt.target );
   }
   if ( item != null ) {
      var next = null;
      switch ( evt.keyCode ) {
      case 38: // up key
         next = item.getPrevItem();
         if ( next != null ) {
            next.anchorTag.focus();
         }
         else if ( item.parentMenu != visibleMenu_ ) {
            item.parentMenu.launcher.focus();
            item.parentMenu.hide();
         }
         else {
            visibleMenu_.launcher.focus();
            hideCurrentContextMenu( true );
         }
         return false;
         break;
      case 40: // down key
         next = item.getNextItem();
         if ( next != null ) {
            next.anchorTag.focus();
         }
         else if ( item.parentMenu != visibleMenu_ ) {
            item.parentMenu.launcher.focus();
            item.parentMenu.hide();
         }
         else {
            visibleMenu_.launcher.focus();
            hideCurrentContextMenu( true );
         }
         return false;
         break;
      case 39: // right key
         if ( visibleMenu_.isLTR ) {
            if ( item.submenu != null ) {
               menuItemShowSubmenu(evt);
               item.submenu.items[0].anchorTag.focus();
            }
         }
         else {
            if ( item.parentMenu != visibleMenu_ ) {
               item.parentMenu.launcher.focus();
               item.parentMenu.hide();
            }
         }
         return false;
         break;
      case 37: // left key
         if ( visibleMenu_.isLTR ) {
            if ( item.parentMenu != visibleMenu_ ) {
               item.parentMenu.launcher.focus();
               item.parentMenu.hide();
            }
         }
         else {
            if ( item.submenu != null ) {
               menuItemShowSubmenu(evt);
               item.submenu.items[0].anchorTag.focus();
            }
         }
         return false;
         break;
      case 9: // tab key
         visibleMenu_.launcher.focus();
         hideCurrentContextMenu( true );
         break;
      case 27: // escape key
         visibleMenu_.launcher.focus();
         hideCurrentContextMenu( true );
         break;
      case 13: // enter key
         break;
      default:
         break;
      }
   }
}

// handle mouse move for menu item
// method called by an event handler (onmousemove for item tag)
function menuItemMouseMove(evt) {
   if ( visibleMenu_ != null ) {
      var item = visibleMenu_.getMenuItem( evt.target );
      if ( item != null ) {
         if ( !item.isSelected ) {
            // set focus on the anchor and select the menu item
            item.anchorTag.focus();
         }
         if ( item.submenu != null && !item.submenu.isVisible && item.isEnabled ) {
            // show the submenu
            item.submenu.show( item.anchorTag, item );
         }
      }
   }
}

// handle mouse down event for menu item
// method called by an event handler (onmousedown for item tag)
function menuItemMouseDown(evt) {
   /* //@08D
   if ( visibleMenu_ != null ) {
      var item = visibleMenu_.getMenuItem( evt.target );
      if ( item != null ) {
         item.setSelected( true );
      }
      else { //@03A
         item = visibleMenu_.getSelectedItem();
      }
      if ( item != null && item.anchorTag != evt.target ) {
         //item.anchorTag.click();
         menuItemLaunchAction();
      }
   }
   */
   menuItemLaunchAction(); //@08A
}

var allMenus_ = new Array();

//ARC CHANGES FOR SPECIFYING STYLES - BEGIN
//ARC CHANGES FOR SPECIFIYING EMPTY MENU TEXT - BEGIN
function createContextMenu( name, isLTR, width, borderStyle, tableStyle, noActionsText, noActionsTextStyle, positionUnder ) {
   var menu = new UilContextMenu( name, isLTR, width, borderStyle, tableStyle, noActionsText, noActionsTextStyle, positionUnder );
   allMenus_[ allMenus_.length ] = menu;
   return menu;
}
//ARC CHANGES FOR SPECIFIYING EMPTY MENU TEXT - END
//ARC CHANGES FOR SPECIFYING STYLES - END

function getContextMenu( name ) {
   for ( var i=0; i<allMenus_.length; i++ ) {
      if ( allMenus_[i].name == name ) {
         return allMenus_[i];
      }
   }
   return null;
}

function showContextMenu( name, isDynamic, isCacheable ) {
   contextMenuShow( name, isDynamic, isCacheable, event.target, true );
}

function showContextMenu( name, launcher ) {
   contextMenuShow( name, false, false, launcher, true );
}

function contextMenuShow( name, isDynamic, isCacheable, launcher, doLoad ) {
   debug( "***** showContextMenu: " + name )

   //  We mnight need to find a suitable launcher...
   var oldLauncher = launcher;
   while ((null != launcher) && (null == launcher.tagName)) {
      launcher = launcher.parentNode;
   }
   if (null == launcher) { //  shouldn't happen, but...
      launcher = oldLauncher;
   }

   if ( eval( isDynamic ) ) {
      debug( 'showContextMenu: dynamic=true, load=' + eval( doLoad ) + ', cache=' + eval( isCacheable ) );
      // dynamically loaded menu
      if ( eval( doLoad ) ) {
         // load the url into hidden frame
         loadDynamicMenu( name );
      }

      // clone the dynamic menu from hidden frame
      menu = getDynamicMenu( name, eval( isCacheable ) );

      if ( menu == null && top.isContextMenuManager_ != null ) {
         // menu not done loading yet
         debug( 'showContextMenu: ' + name + ' added to queue' );
         top.contextMenuManagerRequest( name, window, launcher, isCacheable );
      }
   }
   else {
      debug( 'showContextMenu: static context menu' );
      // statically defined menu
      menu = getContextMenu( name );
      if ( menu == null ) {
         menu = createContextMenu( name, 150 );
      }
   }

   if ( menu != null ) {
      hideCurrentContextMenu( true );
      menu.show( launcher );
      visibleMenu_ = menu;
   }
   else {
      debug( 'showContextMenu: ' + name + ' unavailable' );
   }
   clearMenuTimer( ); // @05
}

// method called by an event handler (onmousedown for document)
function hideCurrentContextMenu( forceHide ) {
   if ( visibleMenu_ != null && ( forceHide == true || visibleMenu_.isDismissable ) ) {
//      contextMenuDismissEnable();
      if ( visibleMenu_.isVisible ) {
         visibleMenu_.hide();
      }
      if ( visibleMenu_.isDynamic && !visibleMenu_.isCacheable ) {
         uncacheContextMenu( visibleMenu_ );
      }
      visibleMenu_ = null;
   }
}

function uncacheContextMenu( menu ) {
   debug( 'uncache menu: ' + menu.name );
   // recurse
   for ( var i=0; i<menu.items.length; i++ ) {
      if ( menu.items[i].submenu != null ) {
         uncacheContextMenu( menu.items[i].submenu );
      }
   }

   // remove from all menus array
   for ( var i=0; i<allMenus_.length; i++ ) {
      if ( allMenus_[i] == menu ) {
         var temp = new Array();
         var index = 0;
         for ( var j=0; j<allMenus_.length; j++ ) {
            if ( j != i ) {
               temp[ index ] = allMenus_[ j ];
               index++;
            }
         }
         allMenus_ = temp;
         break;
      }
   }
}

function contextMenuSetIcons( transparentImage,
                              arrowDefault, arrowSelected, arrowDisabled,
                              launcherDefault, launcherSelected,
                              arrowDefaultRTL, arrowSelectedRTL, arrowDisabledRTL,
                              launcherDefaultRTL, launcherSelectedRTL ) {
   transImg_ = transparentImage;

   arrowNorm_ = arrowDefault;
   arrowSel_ = arrowSelected;
   arrowDis_ = arrowDisabled;
   launchNorm_ = launcherDefault;
   launchSel_ = launcherSelected;

   arrowNormRTL_ = arrowDefaultRTL;
   arrowSelRTL_ = arrowSelectedRTL;
   arrowDisRTL_ = arrowDisabledRTL;
   launchNormRTL_ = launcherDefaultRTL;
   launchSelRTL_ = launcherSelectedRTL;

   contextMenuPreloadImage( transImg_ );

   contextMenuPreloadImage( arrowNorm_ );
   contextMenuPreloadImage( arrowSel_ );
   contextMenuPreloadImage( arrowDis_ );
   contextMenuPreloadImage( launchNorm_ );
   contextMenuPreloadImage( launchSel_ );

   contextMenuPreloadImage( arrowNormRTL_ );
   contextMenuPreloadImage( arrowSelRTL_ );
   contextMenuPreloadImage( arrowDisRTL_ );
   contextMenuPreloadImage( launchNormRTL_ );
   contextMenuPreloadImage( launchSelRTL_ );
}

function contextMenuSetArrowIconDimensions( width, height ) {
   arrowWidth_ = width;
   arrowHeight_ = height;
}

function contextMenuPreloadImage( imgsrc ) {
   var preload = new Image();
   preload.src = imgsrc;
}

function toggleLauncherIcon( popupID, selected, isLTR ) {
   if ( selected ) {
      if ( isLTR ) {
         document.images[ popupID ].src = launchSel_;
      }
      else {
         document.images[ popupID ].src = launchSelRTL_;
      }
   }
   else {
      if ( isLTR ) {
         document.images[ popupID ].src = launchNorm_;
      }
      else {
         document.images[ popupID ].src = launchNormRTL_;
      }
   }
   return true;
}

function contextMenuSetNoActionsText( noActionsText, submenuAltText ) {
   noActionsText_ = noActionsText;
   submenuAltText_ = submenuAltText;
}

function contextMenuGetNoActionsText() {
   return noActionsText_;
}

function getWidth( tag ) {
   return tag.offsetWidth;
}

function getHeight( tag ) {
   return tag.offsetHeight;
}

function getLeft( tag, recurse ) {
   var size = 0;
   if ( tag != null ) {
      //size = parseInt( document.defaultView.getComputedStyle(tag, null).getPropertyValue("left") ); //@04D

      //@04A
      if ( recurse && tag.offsetParent != null ) {
         size += getLeft( tag.offsetParent, recurse );
      }
      if ( tag != null ) {
         size += tag.offsetLeft;
      }

   }
   return size;
}

function getTop( tag, recurse ) {
   var size = 0;
   if ( tag != null ) {
      //size = parseInt( document.defaultView.getComputedStyle(tag, null).getPropertyValue("top") ); //@04D

      //@04A
      if ( recurse && tag.offsetParent != null ) {
         size += getTop( tag.offsetParent, recurse );
      }
      if ( tag != null ) {
         size += tag.offsetTop;
      }

   }
   return size;
}

/*****************************************************
* code for dynamically loaded menus
*****************************************************/
function loadDynamicMenu( menuURL ) {
   debug( '* loadDynamicMenu: ' + menuURL );
   var menu = getContextMenu( menuURL );
   if ( menu != null ) {
      if ( menu.isVisible ) {
         // dynamic menu requested, but it's currently showing
         menu.hide();
      }
      if ( !menu.isCacheable ) {
         // make sure it's not in the cache
         uncacheContextMenu( menu );
      }
   }
   if ( getContextMenu( menuURL ) == null ) {
      if ( top.isContextMenuManager_ != null ) {
         debug( 'loadDynamicMenu: loading' );
         top.contextMenuManagerLoadDynamicMenu( menuURL );
      }
   }
}

function getDynamicMenu( menuURL, cache ) {
   debug( '* getDynamicMenu: ' + menuURL );
   var clone = getContextMenu( menuURL );
   if ( clone == null ) {
      if ( top.isContextMenuManager_ != null ) {
         if ( top.contextMenuManagerIsDynamicMenuLoaded() ) {
            var menu = top.contextMenuManagerGetDynamicMenu();
            debug( 'getDynamicMenu: fetched menu from other frame' );
            clone = cloneMenu( menu, menuURL, cache );
            if ( clone.items.length == 0 ) {
               contextMenuSetNoActionsText( top.contextMenuManagerGetNoActionsText() );
            }
         }
         else {
            debug( 'getDynamicMenu: menu not loaded' );
         }
      }
      else {
         debug( 'getDynamicMenu: menu manager not present' );
      }
   }
   else {
      debug( 'getDynamicMenu: menu previously loaded' );
   }
   return clone;
}

function cloneMenu( menu, name, cache ) {
   var clone = getContextMenu( name );
   if ( clone == null ) {
      if ( menu != null ) {
         clone = createContextMenu( name, menu.width );
      }
      else {
         clone = createContextMenu( name, 150 );
      }
      clone.isDynamic = true;
      clone.isCacheable = cache;
      if ( menu != null ) {
         for ( var i=0; i<menu.items.length; i++ ) {
            clone.add( cloneMenuItem( menu.items[i], name + "_sub" + i, cache ) );
         }
      }
   }
   return clone;
}

function cloneMenuItem( item, submenuName, cache ) {
   var submenu = null;
   if ( item.submenu != null ) {
      submenu = cloneMenu( item.submenu, submenuName, cache );
   }
   var clone = new UilMenuItem( item.text, item.isEnabled, item.action, item.clientAction, submenu, item.icon, null, null, null );
   clone.isEnabled = item.isEnabled;
   clone.isSelected = item.isSelected;
   clone.isSeparator = item.isSeparator;
   return clone;
}


//////////////////////////////////////////////////////////////////
// begin BrowserDimensions object definition
ContextMenuBrowserDimensions.prototype				= new Object();
ContextMenuBrowserDimensions.prototype.constructor = ContextMenuBrowserDimensions;
ContextMenuBrowserDimensions.superclass			= null;

function ContextMenuBrowserDimensions(){

    this.body = document.body;
    if (this.isStrictDoctype() && !this.isSafari()) {
        this.body = document.documentElement;
    }

}

ContextMenuBrowserDimensions.prototype.getScrollFromLeft = function(){
    return this.body.scrollLeft ;
}

ContextMenuBrowserDimensions.prototype.getScrollFromTop = function(){
    return this.body.scrollTop ;
}

ContextMenuBrowserDimensions.prototype.getViewableAreaWidth = function(){
    return this.body.clientWidth ;
}

ContextMenuBrowserDimensions.prototype.getViewableAreaHeight = function(){
    return this.body.clientHeight ;
}

ContextMenuBrowserDimensions.prototype.getHTMLElementWidth = function(){
    return this.body.scrollWidth ;
}

ContextMenuBrowserDimensions.prototype.getHTMLElementHeight = function(){
    return this.body.scrollHeight ;
}

ContextMenuBrowserDimensions.prototype.isStrictDoctype = function(){

    return (document.compatMode && document.compatMode != "BackCompat");

}

ContextMenuBrowserDimensions.prototype.isSafari = function(){

    return (navigator.userAgent.toLowerCase().indexOf("safari") >= 0);

}

// end BrowserDimensions object definition
//////////////////////////////////////////////////////////////////





  
  	
  
        
 
 
delete djConfig.baseUrl;
