/*********************************************************** {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";
var wclIsOpera_ = /Opera/.test(navigator.userAgent);
//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();
/*
// no longer needed since fixed in Opera 9, and no other non-IE browsers need this
// @01A - Hide any items that intersect this menu
var coll = document.getElementsByTagName("SELECT");
if (coll!=null)
{
for (i=0; i= 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";
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 = " ";
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 = " ";
}
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=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= 0);
}
ContextMenuBrowserDimensions.prototype.isOpera = function(){
return /Opera/.test(navigator.userAgent);;
}
// end BrowserDimensions object definition
//////////////////////////////////////////////////////////////////
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.debug( 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.
if ( this.debug.enabled ) { this.debug.log( this.className, "getCookie( " + cookieName + " )" ); }
cookieName = cookieName + "="
var retVal = null;
if ( this.debug.enabled ) {
this.debug.log( this.className, "document.cookie=" + document.cookie );
this.debug.log( this.className, "indexOf cookieName: " + document.cookie.indexOf( cookieName ) );
}
if ( document.cookie.indexOf( cookieName ) >= 0 )
{
var cookies = document.cookie.split(";");
var c = 0;
if ( this.debug.enabled && cookies.length > 0 ) {
this.debug.log( this.className, "cookies[0] = " + cookies[0] );
}
while ( c < cookies.length && ( cookies[c].indexOf( cookieName ) == -1 ) )
{
if ( this.debug.enabled ) { this.debug.log( this.className, "cookies[" + c + "] = " + cookies[0] ); }
c=c+1;
}
//Make sure there's no leading or trailing spaces on our cookie name/value pair.
var cookieNVP = cookies[c].replace( /^[ \s]+|[ \s]+$/, '' );
if ( this.debug.enabled ) {
this.debug.log( this.className, "cookieName=\"" + cookieName + "\"." );
this.debug.log( this.className, "cookieName.length=\"" + cookieName.length + "\"." );
this.debug.log( this.className, "cookieNVP=\"" + cookieNVP + "\"." );
this.debug.log( this.className, "cookieNVP.length=\"" + cookieNVP.length + "\"." );
}
var cookieValue = cookieNVP.substring( cookieName.length );
if ( this.debug.enabled ) { this.debug.log( this.className, "cookie value =\"" + cookieValue + "\"."); }
if ( cookieValue != "null" )
{
retVal = cookieValue;
}
}
if ( this.debug.enabled ) { this.debug.log( this.className, "getCookie( " + cookieName + " ) return " + retVal ); }
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;
if ( this.debug.enabled ) { this.debug.log( this.className, "document.cookie after setting the cookie=" + document.cookie ); }
},
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 ] + ") "); }
if(wpsFLY_isIE){
this.setCookie( cookieName, "null", this._deleteDate);
}else{
this.setCookie( cookieName, "");
}
}
}
//////////////////////////////////////////////////////////////////
// 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(){
if(this.isSafari()) return document.documentElement.clientHeight;
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);
}
BrowserDimensions.prototype.isOpera = function(){
return (navigator.userAgent.toLowerCase().indexOf("opera") >= 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 ( var c=0; c < this.arrayPosition; c=c+1 )
{
this.elements[c].enable();
}
}
function enableRegisteredElementInternal( id )
{
for ( var 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 ( var c=0; c < this.arrayPosition; c=c+1 )
{
this.elements[c].disable();
}
}
function disableRegisteredElementInternal( id )
{
for ( var 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()
{
if ( document.getElementById( this.ID ) ) {
//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()
{
if ( document.getElementById( this.ID ) ) {
//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();
}
}
var Spry; if (!Spry) Spry = {}; if (!Spry.Widget) Spry.Widget = {};
Spry.BrowserSniff = function()
{
var b = navigator.appName.toString();
var up = navigator.platform.toString();
var ua = navigator.userAgent.toString();
this.mozilla = this.ie = this.opera = r = false;
var re_opera = /Opera.([0-9\.]*)/i;
var re_msie = /MSIE.([0-9\.]*)/i;
var re_gecko = /gecko/i;
var re_safari = /safari\/([\d\.]*)/i;
if (ua.match(re_opera)) {
r = ua.match(re_opera);
this.opera = true;
this.version = parseFloat(r[1]);
} else if (ua.match(re_msie)) {
r = ua.match(re_msie);
this.ie = true;
this.version = parseFloat(r[1]);
} else if (ua.match(re_safari)) {
this.safari = true;
this.version = 1.4;
} else if (ua.match(re_gecko)) {
var re_gecko_version = /rv:\s*([0-9\.]+)/i;
r = ua.match(re_gecko_version);
this.mozilla = true;
this.version = parseFloat(r[1]);
}
this.windows = this.mac = this.linux = false;
this.Platform = ua.match(/windows/i) ? "windows" :
(ua.match(/linux/i) ? "linux" :
(ua.match(/mac/i) ? "mac" :
ua.match(/unix/i)? "unix" : "unknown"));
this[this.Platform] = true;
this.v = this.version;
if (this.safari && this.mac && this.mozilla) {
this.mozilla = false;
}
};
Spry.is = new Spry.BrowserSniff();
// Constructor for Menu Bar
// element should be an ID of an unordered list (
tag)
// preloadImage1 and preloadImage2 are images for the rollover state of a menu
Spry.Widget.MenuBar = function(element, opts)
{
this.init(element, opts);
};
Spry.Widget.MenuBar.prototype.init = function(element, opts)
{
this.element = this.getElement(element);
// represents the current (sub)menu we are operating on
this.currMenu = null;
this.showDelay = 100;
this.hideDelay = 100;
if(typeof document.getElementById == 'undefined' || (navigator.vendor == 'Apple Computer, Inc.' && typeof window.XMLHttpRequest == 'undefined') || (Spry.is.ie && typeof document.uniqueID == 'undefined'))
{
// bail on older unsupported browsers
return;
}
// Fix IE6 CSS images flicker
if (Spry.is.ie && Spry.is.version < 7){
try {
document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}
}
this.upKeyCode = Spry.Widget.MenuBar.KEY_UP;
this.downKeyCode = Spry.Widget.MenuBar.KEY_DOWN;
this.leftKeyCode = Spry.Widget.MenuBar.KEY_LEFT;
this.rightKeyCode = Spry.Widget.MenuBar.KEY_RIGHT;
this.escKeyCode = Spry.Widget.MenuBar.KEY_ESC;
this.hoverClass = 'MenuBarItemHover';
this.subHoverClass = 'MenuBarItemSubmenuHover';
this.subVisibleClass ='MenuBarSubmenuVisible';
this.hasSubClass = 'MenuBarItemSubmenu';
this.activeClass = 'MenuBarActive';
this.isieClass = 'MenuBarItemIE';
this.verticalClass = 'MenuBarVertical';
this.horizontalClass = 'MenuBarHorizontal';
this.enableKeyboardNavigation = true;
this.hasFocus = false;
// load hover images now
if(opts)
{
for(var k in opts)
{
if (typeof this[k] == 'undefined')
{
var rollover = new Image;
rollover.src = opts[k];
}
}
Spry.Widget.MenuBar.setOptions(this, opts);
}
// safari doesn't support tabindex
if (Spry.is.safari)
this.enableKeyboardNavigation = false;
if(this.element)
{
this.currMenu = this.element;
var items = this.element.getElementsByTagName('div');
for(var i=0; i 0 && this.enableKeyboardNavigation)
items[i].getElementsByTagName('div')[0].tabIndex='-1';
this.initialize(items[i], element);
if(Spry.is.ie)
{
this.addClassName(items[i], this.isieClass);
items[i].style.position = "static";
}
}
if (this.enableKeyboardNavigation)
{
var self = this;
this.addEventListener(document, 'keydown', function(e){self.keyDown(e); }, false);
}
if(Spry.is.ie)
{
if(this.hasClassName(this.element, this.verticalClass))
{
this.element.style.position = "relative";
}
var linkitems = this.element.getElementsByTagName('a');
for(var i=0; i 0)
{
layers[0].parentNode.removeChild(layers[0]);
}
};
// clearMenus for Menu Bar
// root is the top level unordered list (
tag)
Spry.Widget.MenuBar.prototype.clearMenus = function(root)
{
var menus = root.getElementsByTagName('div');
for(var i=0; i 0 ? submenus[0] : null);
if(menu)
this.addClassName(link, this.hasSubClass);
if(!Spry.is.ie)
{
// define a simple function that comes standard in IE to determine
// if a node is within another node
listitem.contains = function(testNode)
{
// this refers to the list item
if(testNode == null)
return false;
if(testNode == this)
return true;
else
return this.contains(testNode.parentNode);
};
}
// need to save this for scope further down
var self = this;
this.addEventListener(listitem, 'mouseover', function(e){self.mouseOver(listitem, e);}, false);
this.addEventListener(listitem, 'mouseout', function(e){if (self.enableKeyboardNavigation) self.clearSelection(); self.mouseOut(listitem, e);}, false);
if (this.enableKeyboardNavigation)
{
this.addEventListener(link, 'blur', function(e){self.onBlur(listitem);}, false);
this.addEventListener(link, 'focus', function(e){self.keyFocus(listitem, e);}, false);
}
};
Spry.Widget.MenuBar.prototype.keyFocus = function (listitem, e)
{
this.lastOpen = listitem.getElementsByTagName('a')[0];
this.addClassName(this.lastOpen, listitem.getElementsByTagName('div').length > 0 ? this.subHoverClass : this.hoverClass);
this.hasFocus = true;
};
Spry.Widget.MenuBar.prototype.onBlur = function (listitem)
{
this.clearSelection(listitem);
};
Spry.Widget.MenuBar.prototype.clearSelection = function(el){
//search any intersection with the current open element
if (!this.lastOpen)
return;
if (el)
{
el = el.getElementsByTagName('a')[0];
// check children
var item = this.lastOpen;
while (item != this.element)
{
var tmp = el;
while (tmp != this.element)
{
if (tmp == item)
return;
try{
tmp = tmp.parentNode;
}catch(err){break;}
}
item = item.parentNode;
}
}
var item = this.lastOpen;
while (item != this.element)
{
this.hideSubmenu(item.parentNode);
var link = item.getElementsByTagName('a')[0];
this.removeClassName(link, this.hoverClass);
this.removeClassName(link, this.subHoverClass);
item = item.parentNode;
}
this.lastOpen = false;
};
Spry.Widget.MenuBar.prototype.keyDown = function (e)
{
if (!this.hasFocus)
return;
if (!this.lastOpen)
{
this.hasFocus = false;
return;
}
var e = e|| event;
var listitem = this.lastOpen.parentNode;
var link = this.lastOpen;
var submenus = listitem.getElementsByTagName('div');
var menu = (submenus.length > 0 ? submenus[0] : null);
var hasSubMenu = (menu) ? true : false;
Spry.Widget.MenuBar.stopPropagation(e);
var opts = [listitem, menu, null, this.getSibling(listitem, 'previousSibling'), this.getSibling(listitem, 'nextSibling')];
if (!opts[3])
opts[2] = (listitem.parentNode.parentNode.nodeName.toLowerCase() == 'div')?listitem.parentNode.parentNode:null;
var found = 0;
switch (e.keyCode){
case this.upKeyCode:
found = this.getElementForKey(opts, 'y', 1);
break;
case this.downKeyCode:
found = this.getElementForKey(opts, 'y', -1);
break;
case this.leftKeyCode:
found = this.getElementForKey(opts, 'x', 1);
break;
case this.rightKeyCode:
found = this.getElementForKey(opts, 'x', -1);
break;
case this.escKeyCode:
case 9:
this.clearSelection();
this.hasFocus = false;
default: return;
}
switch (found)
{
case 0: return;
case 1:
//subopts
this.mouseOver(listitem, e);
break;
case 2:
//parent
this.mouseOut(opts[2], e);
break;
case 3:
case 4:
// left - right
this.removeClassName(link, hasSubMenu ? this.subHoverClass : this.hoverClass);
break;
}
var link = opts[found].getElementsByTagName('a')[0];
if (opts[found].nodeName.toLowerCase() == 'div')
opts[found] = opts[found].getElementsByTagName('div')[0];
this.addClassName(link, opts[found].getElementsByTagName('div').length > 0 ? this.subHoverClass : this.hoverClass);
this.lastOpen = link;
opts[found].getElementsByTagName('a')[0].focus();
};
Spry.Widget.MenuBar.prototype.mouseOver = function (listitem, e)
{
var link = listitem.getElementsByTagName('a')[0];
var submenus = listitem.getElementsByTagName('div');
var menu = (submenus.length > 0 ? submenus[0] : null);
var hasSubMenu = (menu) ? true : false;
if (this.enableKeyboardNavigation)
this.clearSelection(listitem);
if(this.bubbledTextEvent())
{
// ignore bubbled text events
return;
}
if (listitem.closetime)
clearTimeout(listitem.closetime);
if(this.currMenu == listitem)
{
this.currMenu = null;
}
// move the focus too
if (this.hasFocus)
link.focus();
// show menu highlighting
this.addClassName(link, hasSubMenu ? this.subHoverClass : this.hoverClass);
this.lastOpen = link;
if(menu && !this.hasClassName(menu, this.subHoverClass))
{
var self = this;
listitem.opentime = window.setTimeout(function(){self.showSubmenu(menu);}, this.showDelay);
}
};
Spry.Widget.MenuBar.prototype.mouseOut = function (listitem, e)
{
var link = listitem.getElementsByTagName('a')[0];
var submenus = listitem.getElementsByTagName('div');
var menu = (submenus.length > 0 ? submenus[0] : null);
var hasSubMenu = (menu) ? true : false;
if(this.bubbledTextEvent())
{
// ignore bubbled text events
return;
}
var related = (typeof e.relatedTarget != 'undefined' ? e.relatedTarget : e.toElement);
if(!listitem.contains(related))
{
if (listitem.opentime)
clearTimeout(listitem.opentime);
this.currMenu = listitem;
// remove menu highlighting
this.removeClassName(link, hasSubMenu ? this.subHoverClass : this.hoverClass);
if(menu)
{
var self = this;
listitem.closetime = window.setTimeout(function(){self.hideSubmenu(menu);}, this.hideDelay);
}
if (this.hasFocus)
link.blur();
}
};
Spry.Widget.MenuBar.prototype.getSibling = function(element, sibling)
{
var child = element[sibling];
while (child && child.nodeName.toLowerCase() !='div')
child = child[sibling];
return child;
};
Spry.Widget.MenuBar.prototype.getElementForKey = function(els, prop, dir)
{
var found = 0;
var rect = Spry.Widget.MenuBar.getPosition;
var ref = rect(els[found]);
var hideSubmenu = false;
//make the subelement visible to compute the position
if (els[1] && !this.hasClassName(els[1], this.MenuBarSubmenuVisible))
{
els[1].style.visibility = 'hidden';
this.showSubmenu(els[1]);
hideSubmenu = true;
}
for (var i = 0; i < els.length; i++)
if (els[i])
{
var tmp = rect(els[i]);
if ( (dir * tmp[prop]) < (dir * ref[prop]))
{
ref = tmp;
found = i;
}
}
// hide back the submenu
if (els[1] && hideSubmenu){
this.hideSubmenu(els[1]);
els[1].style.visibility = '';
}
return found;
};
Spry.Widget.MenuBar.camelize = function(str)
{
if (str.indexOf('-') == -1){
return str;
}
var oStringList = str.split('-');
var isFirstEntry = true;
var camelizedString = '';
for(var i=0; i < oStringList.length; i++)
{
if(oStringList[i].length>0)
{
if(isFirstEntry)
{
camelizedString = oStringList[i];
isFirstEntry = false;
}
else
{
var s = oStringList[i];
camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
}
}
}
return camelizedString;
};
Spry.Widget.MenuBar.getStyleProp = function(element, prop)
{
var value;
try
{
if (element.style)
value = element.style[Spry.Widget.MenuBar.camelize(prop)];
if (!value)
if (document.defaultView && document.defaultView.getComputedStyle)
{
var css = document.defaultView.getComputedStyle(element, null);
value = css ? css.getPropertyValue(prop) : null;
}
else if (element.currentStyle)
{
value = element.currentStyle[Spry.Widget.MenuBar.camelize(prop)];
}
}
catch (e) {}
return value == 'auto' ? null : value;
};
Spry.Widget.MenuBar.getIntProp = function(element, prop)
{
var a = parseInt(Spry.Widget.MenuBar.getStyleProp(element, prop),10);
if (isNaN(a))
return 0;
return a;
};
Spry.Widget.MenuBar.getPosition = function(el, doc)
{
doc = doc || document;
if (typeof(el) == 'string') {
el = doc.getElementById(el);
}
if (!el) {
return false;
}
if (el.parentNode === null || Spry.Widget.MenuBar.getStyleProp(el, 'display') == 'none') {
//element must be visible to have a box
return false;
}
var ret = {x:0, y:0};
var parent = null;
var box;
if (el.getBoundingClientRect) { // IE
box = el.getBoundingClientRect();
var scrollTop = doc.documentElement.scrollTop || doc.body.scrollTop;
var scrollLeft = doc.documentElement.scrollLeft || doc.body.scrollLeft;
ret.x = box.left + scrollLeft;
ret.y = box.top + scrollTop;
} else if (doc.getBoxObjectFor) { // gecko
box = doc.getBoxObjectFor(el);
ret.x = box.x;
ret.y = box.y;
} else { // safari/opera
ret.x = el.offsetLeft;
ret.y = el.offsetTop;
parent = el.offsetParent;
if (parent != el) {
while (parent) {
ret.x += parent.offsetLeft;
ret.y += parent.offsetTop;
parent = parent.offsetParent;
}
}
// opera & (safari absolute) incorrectly account for body offsetTop
if (Spry.is.opera || Spry.is.safari && Spry.Widget.MenuBar.getStyleProp(el, 'position') == 'absolute')
ret.y -= doc.body.offsetTop;
}
if (el.parentNode)
parent = el.parentNode;
else
parent = null;
if (parent.nodeName){
var cas = parent.nodeName.toUpperCase();
while (parent && cas != 'BODY' && cas != 'HTML') {
cas = parent.nodeName.toUpperCase();
ret.x -= parent.scrollLeft;
ret.y -= parent.scrollTop;
if (parent.parentNode)
parent = parent.parentNode;
else
parent = null;
}
}
// adjust the margin
var gi = Spry.Widget.MenuBar.getIntProp;
var btw = gi(el, "margin-top");
var blw = gi(el, "margin-left");
ret.x -= blw;
ret.y -= btw;
return ret;
};
Spry.Widget.MenuBar.stopPropagation = function(ev)
{
if (ev.stopPropagation)
ev.stopPropagation();
else
ev.cancelBubble = true;
};
Spry.Widget.MenuBar.setOptions = function(obj, optionsObj, ignoreUndefinedProps)
{
if (!optionsObj)
return;
for (var optionName in optionsObj)
{
if (ignoreUndefinedProps && optionsObj[optionName] == undefined)
continue;
obj[optionName] = optionsObj[optionName];
}
};
//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated. All rights reserved.
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
function ControlVersion()
{
var version;
var axo;
var e;
// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
try {
// version will be set for 7.X or greater players
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
version = axo.GetVariable("$version");
} catch (e) {
}
if (!version)
{
try {
// version will be set for 6.X players only
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
// installed player is some revision of 6.0
// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
// so we have to be careful.
// default to the first public version
version = "WIN 6,0,21,0";
// throws if AllowScripAccess does not exist (introduced in 6.0r47)
axo.AllowScriptAccess = "always";
// safe to call for 6.0r47 or greater
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 4.X or 5.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 3.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = "WIN 3,0,18,0";
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 2.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
version = "WIN 2,0,0,11";
} catch (e) {
version = -1;
}
}
return version;
}
// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
// NS/Opera version >= 3 check for Flash plugin in plugin array
var flashVer = -1;
if (navigator.plugins != null && navigator.plugins.length > 0) {
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
var descArray = flashDescription.split(" ");
var tempArrayMajor = descArray[2].split(".");
var versionMajor = tempArrayMajor[0];
var versionMinor = tempArrayMajor[1];
var versionRevision = descArray[3];
if (versionRevision == "") {
versionRevision = descArray[4];
}
if (versionRevision[0] == "d") {
versionRevision = versionRevision.substring(1);
} else if (versionRevision[0] == "r") {
versionRevision = versionRevision.substring(1);
if (versionRevision.indexOf("d") > 0) {
versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
}
}
var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
}
}
// MSN/WebTV 2.6 supports Flash 4
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
// WebTV 2.5 supports Flash 3
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
// older WebTV supports Flash 2
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
else if ( isIE && isWin && !isOpera ) {
flashVer = ControlVersion();
}
return flashVer;
}
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
versionStr = GetSwfVer();
if (versionStr == -1 ) {
return false;
} else if (versionStr != 0) {
if(isIE && isWin && !isOpera) {
// Given "WIN 2,0,0,11"
tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
tempString = tempArray[1]; // "2,0,0,11"
versionArray = tempString.split(","); // ['2', '0', '0', '11']
} else {
versionArray = versionStr.split(".");
}
var versionMajor = versionArray[0];
var versionMinor = versionArray[1];
var versionRevision = versionArray[2];
// is the major.revision >= requested major.revision AND the minor version >= requested minor
if (versionMajor > parseFloat(reqMajorVer)) {
return true;
} else if (versionMajor == parseFloat(reqMajorVer)) {
if (versionMinor > parseFloat(reqMinorVer))
return true;
else if (versionMinor == parseFloat(reqMinorVer)) {
if (versionRevision >= parseFloat(reqRevision))
return true;
}
}
return false;
}
}
function AC_AddExtension(src, ext)
{
if (src.indexOf('?') != -1)
return src.replace(/\?/, ext+'?');
else
return src + ext;
}
function AC_Generateobj(objAttrs, params, embedAttrs)
{
var str = '';
if (isIE && isWin && !isOpera)
{
str += '';
}
else
{
str += '';
}
document.write(str);
}
function AC_FL_RunContent(){
var ret =
AC_GetArgs
( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
, "application/x-shockwave-flash"
);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_SW_RunContent(){
var ret =
AC_GetArgs
( arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
, null
);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
var ret = new Object();
ret.embedAttrs = new Object();
ret.params = new Object();
ret.objAttrs = new Object();
for (var i=0; i < args.length; i=i+2){
var currArg = args[i].toLowerCase();
switch (currArg){
case "classid":
break;
case "pluginspage":
ret.embedAttrs[args[i]] = args[i+1];
break;
case "src":
case "movie":
args[i+1] = AC_AddExtension(args[i+1], ext);
ret.embedAttrs["src"] = args[i+1];
ret.params[srcParamName] = args[i+1];
break;
case "onafterupdate":
case "onbeforeupdate":
case "onblur":
case "oncellchange":
case "onclick":
case "ondblClick":
case "ondrag":
case "ondragend":
case "ondragenter":
case "ondragleave":
case "ondragover":
case "ondrop":
case "onfinish":
case "onfocus":
case "onhelp":
case "onmousedown":
case "onmouseup":
case "onmouseover":
case "onmousemove":
case "onmouseout":
case "onkeypress":
case "onkeydown":
case "onkeyup":
case "onload":
case "onlosecapture":
case "onpropertychange":
case "onreadystatechange":
case "onrowsdelete":
case "onrowenter":
case "onrowexit":
case "onrowsinserted":
case "onstart":
case "onscroll":
case "onbeforeeditfocus":
case "onactivate":
case "onbeforedeactivate":
case "ondeactivate":
case "type":
case "codebase":
case "id":
ret.objAttrs[args[i]] = args[i+1];
break;
case "width":
case "height":
case "align":
case "vspace":
case "hspace":
case "class":
case "title":
case "accesskey":
case "name":
case "tabindex":
ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
break;
default:
ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
}
}
ret.objAttrs["classid"] = classid;
if (mimeType) ret.embedAttrs["type"] = mimeType;
return ret;
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i 12) {
return false;
}
// Calculate the maxDay according to the current month
switch (theMonth) {
case 1: // January
case 3: // March
case 5: // May
case 7: // July
case 8: // August
case 10: // October
case 12: // December
maxDay = 31;
break;
case 4: // April
case 6: // June
case 9: // September
case 11: // November
maxDay = 30;
break;
case 2: // February
if ((parseInt(theYear/4, 10) * 4 == theYear) && (theYear % 100 != 0 || theYear % 400 == 0)) {
maxDay = 29;
} else {
maxDay = 28;
}
break;
}
// Check day value to be between 1..maxDay
if (theDay < 1 || theDay > maxDay) {
return false;
}
// If successfull we'll return the date object
return (new Date(theYear, theMonth - 1, theDay)); //JavaScript requires a month between 0 and 11
}
} else {
return false;
}
}
},
'time': {
validation: function(value, options) {
// HH:MM:SS T
var formatRegExp = /([hmst]+)/gi;
var valueRegExp = /(\d+|AM?|PM?)/gi;
var formatGroups = options.format.match(formatRegExp);
var valueGroups = value.match(valueRegExp);
//mast match and have same length
if (formatGroups !== null && valueGroups !== null) {
if (formatGroups.length != valueGroups.length) {
return false;
}
var hourIndex = -1;
var minuteIndex = -1;
var secondIndex = -1;
//T is AM or PM
var tIndex = -1;
var theHour = 0, theMinute = 0, theSecond = 0, theT = 'AM';
for (var i=0; i (formatGroups[hourIndex] == 'HH' ? 23 : 12 )) {
return false;
}
}
if (minuteIndex != -1) {
var theMinute = parseInt(valueGroups[minuteIndex], 10);
if (isNaN(theMinute) || theMinute > 59) {
return false;
}
}
if (secondIndex != -1) {
var theSecond = parseInt(valueGroups[secondIndex], 10);
if (isNaN(theSecond) || theSecond > 59) {
return false;
}
}
if (tIndex != -1) {
var theT = valueGroups[tIndex].toUpperCase();
if (
formatGroups[tIndex].toUpperCase() == 'TT' && !/^a|pm$/i.test(theT) ||
formatGroups[tIndex].toUpperCase() == 'T' && !/^a|p$/i.test(theT)
) {
return false;
}
}
var date = new Date(2000, 0, 1, theHour + (theT.charAt(0) == 'P'?12:0), theMinute, theSecond);
return date;
} else {
return false;
}
}
},
'credit_card': {
characterMasking: /\d/,
validation: function(value, options) {
var regExp = null;
options.format = options.format || 'ALL';
switch (options.format.toUpperCase()) {
case 'ALL': regExp = /^[3-6]{1}[0-9]{12,18}$/; break;
case 'VISA': regExp = /^4(?:[0-9]{12}|[0-9]{15})$/; break;
case 'MASTERCARD': regExp = /^5[1-5]{1}[0-9]{14}$/; break;
case 'AMEX': regExp = /^3(4|7){1}[0-9]{13}$/; break;
case 'DISCOVER': regExp = /^6011[0-9]{12}$/; break;
case 'DINERSCLUB': regExp = /^3(?:(0[0-5]{1}[0-9]{11})|(6[0-9]{12})|(8[0-9]{12}))$/; break;
}
if (!regExp.test(value)) {
return false;
}
var digits = [];
var j = 1, digit = '';
for (var i = value.length - 1; i >= 0; i--) {
if ((j%2) == 0) {
digit = parseInt(value.charAt(i), 10) * 2;
digits[digits.length] = digit.toString().charAt(0);
if (digit.toString().length == 2) {
digits[digits.length] = digit.toString().charAt(1);
}
} else {
digit = value.charAt(i);
digits[digits.length] = digit;
}
j++;
}
var sum = 0;
for(i=0; i < digits.length; i++ ) {
sum += parseInt(digits[i], 10);
}
if ((sum%10) == 0) {
return true;
}
return false;
}
},
'zip_code': {
formats: {
'zip_us9': {
pattern:'00000-0000'
},
'zip_us5': {
pattern:'00000'
},
'zip_uk': {
characterMasking: /[\dA-Z\s]/,
validation: function(value, options) {
//check one of the following masks
// AN NAA, ANA NAA, ANN NAA, AAN NAA, AANA NAA, AANN NAA
return /^[A-Z]{1,2}\d[\dA-Z]?\s?\d[A-Z]{2}$/.test(value);
}
},
'zip_canada': {
characterMasking: /[\dA-Z\s]/,
pattern: 'A0A 0A0'
},
'zip_custom': {}
}
},
'phone_number': {
formats: {
//US phone number; 10 digits
'phone_us': {
pattern:'(000) 000-0000'
},
'phone_custom': {}
}
},
'social_security_number': {
pattern:'000-00-0000'
},
'ip': {
characterMaskingFormats: {
'ipv4': /[\d\.]/i,
'ipv6_ipv4': /[\d\.\:A-F\/]/i,
'ipv6': /[\d\.\:A-F\/]/i
},
validation: function (value, options) {
return Spry.Widget.ValidationTextField.validateIP(value, options.format);
}
},
'url': {
characterMasking: /[^\s]/,
validation: function(value, options) {
//fix for ?ID=223429 and ?ID=223387
/* the following regexp matches components of an URI as specified in http://tools.ietf.org/html/rfc3986#page-51 page 51, Appendix B.
scheme = $2
authority = $4
path = $5
query = $7
fragment = $9
*/
var URI_spliter = /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
var parts = value.match(URI_spliter);
if (parts && parts[4]) {
//encode each component of the domain name using Punycode encoding scheme: http://tools.ietf.org/html/rfc3492
var host = parts[4].split(".");
var punyencoded = '';
for (var i=0; i 1080::8:800:200C:417A
FF01:0:0:0:0:0:0:101 --> FF01::101
0:0:0:0:0:0:0:1 --> ::1
0:0:0:0:0:0:0:0 --> ::
2.5.4 IPv6 Addresses with Embedded IPv4 Addresses
IPv4-compatible IPv6 address (tunnel IPv6 packets over IPv4 routing infrastructures)
::0:129.144.52.38
IPv4-mapped IPv6 address (represent the addresses of IPv4-only nodes as IPv6 addresses)
::ffff:129.144.52.38
The text representation of IPv6 addresses and prefixes in Augmented BNF (Backus-Naur Form) [ABNF] for reference purposes.
[ABNF http://tools.ietf.org/html/rfc2234]
IPv6address = hexpart [ ":" IPv4address ]
IPv4address = 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT
IPv6prefix = hexpart "/" 1*2DIGIT
hexpart = hexseq | hexseq "::" [ hexseq ] | "::" [ hexseq ]
hexseq = hex4 *( ":" hex4)
hex4 = 1*4HEXDIG
*/
Spry.Widget.ValidationTextField.validateIP = function (value, format)
{
var validIPv6Addresses = [
//preferred
/^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}(?:\/\d{1,3})?$/i,
//various compressed
/^[a-f0-9]{0,4}::(?:\/\d{1,3})?$/i,
/^:(?::[a-f0-9]{1,4}){1,6}(?:\/\d{1,3})?$/i,
/^(?:[a-f0-9]{1,4}:){1,6}:(?:\/\d{1,3})?$/i,
/^(?:[a-f0-9]{1,4}:)(?::[a-f0-9]{1,4}){1,6}(?:\/\d{1,3})?$/i,
/^(?:[a-f0-9]{1,4}:){2}(?::[a-f0-9]{1,4}){1,5}(?:\/\d{1,3})?$/i,
/^(?:[a-f0-9]{1,4}:){3}(?::[a-f0-9]{1,4}){1,4}(?:\/\d{1,3})?$/i,
/^(?:[a-f0-9]{1,4}:){4}(?::[a-f0-9]{1,4}){1,3}(?:\/\d{1,3})?$/i,
/^(?:[a-f0-9]{1,4}:){5}(?::[a-f0-9]{1,4}){1,2}(?:\/\d{1,3})?$/i,
/^(?:[a-f0-9]{1,4}:){6}(?::[a-f0-9]{1,4})(?:\/\d{1,3})?$/i,
//IPv6 mixes with IPv4
/^(?:[a-f0-9]{1,4}:){6}(?:\d{1,3}\.){3}\d{1,3}(?:\/\d{1,3})?$/i,
/^:(?::[a-f0-9]{1,4}){0,4}:(?:\d{1,3}\.){3}\d{1,3}(?:\/\d{1,3})?$/i,
/^(?:[a-f0-9]{1,4}:){1,5}:(?:\d{1,3}\.){3}\d{1,3}(?:\/\d{1,3})?$/i,
/^(?:[a-f0-9]{1,4}:)(?::[a-f0-9]{1,4}){1,4}:(?:\d{1,3}\.){3}\d{1,3}(?:\/\d{1,3})?$/i,
/^(?:[a-f0-9]{1,4}:){2}(?::[a-f0-9]{1,4}){1,3}:(?:\d{1,3}\.){3}\d{1,3}(?:\/\d{1,3})?$/i,
/^(?:[a-f0-9]{1,4}:){3}(?::[a-f0-9]{1,4}){1,2}:(?:\d{1,3}\.){3}\d{1,3}(?:\/\d{1,3})?$/i,
/^(?:[a-f0-9]{1,4}:){4}(?::[a-f0-9]{1,4}):(?:\d{1,3}\.){3}\d{1,3}(?:\/\d{1,3})?$/i
];
var validIPv4Addresses = [
//IPv4
/^(\d{1,3}\.){3}\d{1,3}$/i
];
var validAddresses = [];
if (format == 'ipv6' || format == 'ipv6_ipv4') {
validAddresses = validAddresses.concat(validIPv6Addresses);
}
if (format == 'ipv4' || format == 'ipv6_ipv4') {
validAddresses = validAddresses.concat(validIPv4Addresses);
}
var ret = false;
for (var i=0; i 255 || !regExp.test(pieces[i]) || pieces[i].length>3 || /^0{2,3}$/.test(pieces[i])) {
return false;
}
}
}
if (ret && value.indexOf("/") != -1) {
// if prefix-length is specified must be in [1-128]
var prefLen = value.match(/\/\d{1,3}$/);
if (!prefLen) return false;
var prefLenVal = parseInt(prefLen[0].replace(/^\//,''), 10);
if (isNaN(prefLenVal) || prefLenVal > 128 || prefLenVal < 1) {
return false;
}
}
return ret;
};
Spry.Widget.ValidationTextField.onloadDidFire = false;
Spry.Widget.ValidationTextField.loadQueue = [];
Spry.Widget.ValidationTextField.prototype.isBrowserSupported = function()
{
return Spry.is.ie && Spry.is.v >= 5 && Spry.is.windows
||
Spry.is.mozilla && Spry.is.v >= 1.4
||
Spry.is.safari
||
Spry.is.opera && Spry.is.v >= 9;
};
Spry.Widget.ValidationTextField.prototype.init = function(element, options)
{
this.element = this.getElement(element);
this.errors = 0;
this.flags = {locked: false, restoreSelection: true};
this.options = {};
this.event_handlers = [];
this.validClass = "textfieldValidState";
this.focusClass = "textfieldFocusState";
this.requiredClass = "textfieldRequiredState";
this.hintClass = "textfieldHintState";
this.invalidFormatClass = "textfieldInvalidFormatState";
this.invalidRangeMinClass = "textfieldMinValueState";
this.invalidRangeMaxClass = "textfieldMaxValueState";
this.invalidCharsMinClass = "textfieldMinCharsState";
this.invalidCharsMaxClass = "textfieldMaxCharsState";
this.textfieldFlashTextClass = "textfieldFlashText";
if (Spry.is.safari) {
this.flags.lastKeyPressedTimeStamp = 0;
}
switch (this.type) {
case 'phone_number':options.format = Spry.Widget.Utils.firstValid(options.format, 'phone_us');break;
case 'currency':options.format = Spry.Widget.Utils.firstValid(options.format, 'comma_dot');break;
case 'zip_code':options.format = Spry.Widget.Utils.firstValid(options.format, 'zip_us5');break;
case 'date':
options.format = Spry.Widget.Utils.firstValid(options.format, 'mm/dd/yy');
break;
case 'time':
options.format = Spry.Widget.Utils.firstValid(options.format, 'HH:mm');
options.pattern = options.format.replace(/[hms]/gi, "0").replace(/TT/gi, 'AM').replace(/T/gi, 'A');
break;
case 'ip':
options.format = Spry.Widget.Utils.firstValid(options.format, 'ipv4');
options.characterMasking = Spry.Widget.ValidationTextField.ValidationDescriptors[this.type].characterMaskingFormats[options.format];
break;
}
//retrieve the validation type descriptor to be used with this instance (base on type and format)
//widgets may have different validations depending on format (like zip_code with formats)
var validationDescriptor = {};
if (options.format && Spry.Widget.ValidationTextField.ValidationDescriptors[this.type].formats) {
if (Spry.Widget.ValidationTextField.ValidationDescriptors[this.type].formats[options.format]) {
Spry.Widget.Utils.setOptions(validationDescriptor, Spry.Widget.ValidationTextField.ValidationDescriptors[this.type].formats[options.format]);
}
} else {
Spry.Widget.Utils.setOptions(validationDescriptor, Spry.Widget.ValidationTextField.ValidationDescriptors[this.type]);
}
//set default values for some parameters which were not aspecified
options.useCharacterMasking = Spry.Widget.Utils.firstValid(options.useCharacterMasking, false);
options.hint = Spry.Widget.Utils.firstValid(options.hint, '');
options.isRequired = Spry.Widget.Utils.firstValid(options.isRequired, true);
options.additionalError = Spry.Widget.Utils.firstValid(options.additionalError, false);
if (options.additionalError)
options.additionalError = this.getElement(options.additionalError);
//set widget validation parameters
//get values from validation type descriptor
//use the user specified values, if defined
options.characterMasking = Spry.Widget.Utils.firstValid(options.characterMasking, validationDescriptor.characterMasking);
options.regExpFilter = Spry.Widget.Utils.firstValid(options.regExpFilter, validationDescriptor.regExpFilter);
options.pattern = Spry.Widget.Utils.firstValid(options.pattern, validationDescriptor.pattern);
options.validation = Spry.Widget.Utils.firstValid(options.validation, validationDescriptor.validation);
if (typeof options.validation == 'string') {
options.validation = eval(options.validation);
}
options.minValue = Spry.Widget.Utils.firstValid(options.minValue, validationDescriptor.minValue);
options.maxValue = Spry.Widget.Utils.firstValid(options.maxValue, validationDescriptor.maxValue);
options.minChars = Spry.Widget.Utils.firstValid(options.minChars, validationDescriptor.minChars);
options.maxChars = Spry.Widget.Utils.firstValid(options.maxChars, validationDescriptor.maxChars);
Spry.Widget.Utils.setOptions(this, options);
Spry.Widget.Utils.setOptions(this.options, options);
};
Spry.Widget.ValidationTextField.prototype.destroy = function() {
if (this.event_handlers)
for (var i=0; i this.maxChars) {
errors = errors | Spry.Widget.ValidationTextField.ERROR_CHARS_MAX;
continueValidations = false;
}
}
//validation - testValue passes widget validation function
if (!mustRevert && this.validation && continueValidations) {
var value = this.validation(fixedValue, this.options);
if (false === value) {
errors = errors | Spry.Widget.ValidationTextField.ERROR_FORMAT;
continueValidations = false;
} else {
this.typedValue = value;
}
}
if(!mustRevert && this.validation && this.minValue !== null && continueValidations) {
var minValue = this.validation(this.minValue.toString(), this.options);
if (minValue !== false) {
if (this.typedValue < minValue) {
errors = errors | Spry.Widget.ValidationTextField.ERROR_RANGE_MIN;
continueValidations = false;
}
}
}
if(!mustRevert && this.validation && this.maxValue !== null && continueValidations) {
var maxValue = this.validation(this.maxValue.toString(), this.options);
if (maxValue !== false) {
if( this.typedValue > maxValue) {
errors = errors | Spry.Widget.ValidationTextField.ERROR_RANGE_MAX;
continueValidations = false;
}
}
}
//an invalid value was tested; must make sure it does not get inside the input
if (this.useCharacterMasking && mustRevert) {
this.revertState(revertValue);
}
this.errors = errors;
this.fixedValue = fixedValue;
this.flags.locked = false;
return mustRevert;
};
Spry.Widget.ValidationTextField.prototype.onChange = function(e)
{
if (Spry.is.opera && this.flags.operaRevertOnKeyUp) {
return true;
}
if (Spry.is.ie && e && e.propertyName != 'value') {
return true;
}
if (this.flags.drop) {
//delay this if it's a drop operation
var self = this;
setTimeout(function() {
self.flags.drop = false;
self.onChange(null);
}, 0);
return;
}
if (this.flags.hintOn) {
return true;
}
if (this.keyCode == 8 || this.keyCode == 46 ) {
var mustRevert = this.doValidations(this.input.value, this.input.value);
this.oldValue = this.input.value;
if ((mustRevert || this.errors) && this.validateOn & Spry.Widget.ValidationTextField.ONCHANGE) {
var self = this;
setTimeout(function() {self.validate();}, 0);
return true;
}
}
var mustRevert = this.doValidations(this.input.value, this.oldValue);
if ((!mustRevert || this.errors) && this.validateOn & Spry.Widget.ValidationTextField.ONCHANGE) {
var self = this;
setTimeout(function() {self.validate();}, 0);
}
return true;
};
Spry.Widget.ValidationTextField.prototype.onKeyUp = function(e) {
if (this.flags.operaRevertOnKeyUp) {
this.setValue(this.oldValue);
Spry.Widget.Utils.stopEvent(e);
this.selection.moveTo(this.selection.start, this.selection.start);
this.flags.operaRevertOnKeyUp = false;
return false;
}
if (this.flags.operaPasteOperation) {
window.clearInterval(this.flags.operaPasteOperation);
this.flags.operaPasteOperation = null;
}
};
Spry.Widget.ValidationTextField.prototype.operaPasteMonitor = function() {
if (this.input.value != this.oldValue) {
var mustRevert = this.doValidations(this.input.value, this.input.value);
if (mustRevert) {
this.setValue(this.oldValue);
this.selection.moveTo(this.selection.start, this.selection.start);
} else {
this.onChange();
}
}
};
Spry.Widget.ValidationTextField.prototype.compileDatePattern = function ()
{
var dateValidationPatternString = "";
var groupPatterns = [];
var fullGroupPatterns = [];
var autocompleteCharacters = [];
var formatRegExp = /^([mdy]+)([\.\-\/\\\s]+)([mdy]+)([\.\-\/\\\s]+)([mdy]+)$/i;
var formatGroups = this.options.format.match(formatRegExp);
if (formatGroups !== null) {
for (var i=1; i 0) {
this.range.setEndPoint("EndToEnd", ta_range);
}
} else if (this.element.nodeName == "INPUT"){
this.range = this.element.ownerDocument.selection.createRange();
this.range.move("character", -10000);
this.start = this.range.moveStart("character", start);
this.end = this.start + this.range.moveEnd("character", end - start);
}
this.range.select();
} else {
this.start = start;
try { this.element.selectionStart = start;} catch(err) {}
this.end = end;
try { this.element.selectionEnd = end;} catch(err) {}
}
this.ignore = true;
this.update();
};
Spry.Widget.SelectionDescriptor.prototype.moveEnd = function(amount)
{
if (Spry.is.ie && Spry.is.windows) {
this.range.moveEnd("character", amount);
this.range.select();
} else {
try { this.element.selectionEnd++;} catch(err) {}
}
this.update();
};
Spry.Widget.SelectionDescriptor.prototype.collapse = function(begin)
{
if (Spry.is.ie && Spry.is.windows) {
this.range = this.element.ownerDocument.selection.createRange();
this.range.collapse(begin);
this.range.select();
} else {
if (begin) {
try { this.element.selectionEnd = this.element.selectionStart;} catch(err) {}
} else {
try { this.element.selectionStart = this.element.selectionEnd;} catch(err) {}
}
}
this.update();
};
//////////////////////////////////////////////////////////////////////
//
// Spry.Widget.Form - common for all widgets
//
//////////////////////////////////////////////////////////////////////
if (!Spry.Widget.Form) Spry.Widget.Form = {};
if (!Spry.Widget.Form.onSubmitWidgetQueue) Spry.Widget.Form.onSubmitWidgetQueue = [];
if (!Spry.Widget.Form.validate) {
Spry.Widget.Form.validate = function(vform) {
var isValid = true;
var isElementValid = true;
var q = Spry.Widget.Form.onSubmitWidgetQueue;
var qlen = q.length;
for (var i = 0; i < qlen; i++) {
if (!q[i].isDisabled() && q[i].form == vform) {
isElementValid = q[i].validate();
isValid = isElementValid && isValid;
}
}
return isValid;
}
};
if (!Spry.Widget.Form.onSubmit) {
Spry.Widget.Form.onSubmit = function(e, form)
{
if (Spry.Widget.Form.validate(form) == false) {
return false;
}
return true;
};
};
if (!Spry.Widget.Form.onReset) {
Spry.Widget.Form.onReset = function(e, vform)
{
var q = Spry.Widget.Form.onSubmitWidgetQueue;
var qlen = q.length;
for (var i = 0; i < qlen; i++) {
if (!q[i].isDisabled() && q[i].form == vform && typeof(q[i].reset) == 'function') {
q[i].reset();
}
}
return true;
};
};
if (!Spry.Widget.Form.destroy) {
Spry.Widget.Form.destroy = function(form)
{
var q = Spry.Widget.Form.onSubmitWidgetQueue;
for (var i = 0; i < Spry.Widget.Form.onSubmitWidgetQueue.length; i++) {
if (q[i].form == form && typeof(q[i].destroy) == 'function') {
q[i].destroy();
i--;
}
}
}
};
if (!Spry.Widget.Form.destroyAll) {
Spry.Widget.Form.destroyAll = function()
{
var q = Spry.Widget.Form.onSubmitWidgetQueue;
for (var i = 0; i < Spry.Widget.Form.onSubmitWidgetQueue.length; i++) {
if (typeof(q[i].destroy) == 'function') {
q[i].destroy();
i--;
}
}
}
};
//////////////////////////////////////////////////////////////////////
//
// Spry.Widget.Utils
//
//////////////////////////////////////////////////////////////////////
if (!Spry.Widget.Utils) Spry.Widget.Utils = {};
Spry.Widget.Utils.punycode_constants = {
base : 36, tmin : 1, tmax : 26, skew : 38, damp : 700,
initial_bias : 72, initial_n : 0x80, delimiter : 0x2D,
maxint : 2<<26-1
};
Spry.Widget.Utils.punycode_encode_digit = function (d) {
return String.fromCharCode(d + 22 + 75 * (d < 26));
};
Spry.Widget.Utils.punycode_adapt = function (delta, numpoints, firsttime) {
delta = firsttime ? delta / this.punycode_constants.damp : delta >> 1;
delta += delta / numpoints;
for (var k = 0; delta > ((this.punycode_constants.base - this.punycode_constants.tmin) * this.punycode_constants.tmax) / 2; k += this.punycode_constants.base) {
delta /= this.punycode_constants.base - this.punycode_constants.tmin;
}
return k + (this.punycode_constants.base - this.punycode_constants.tmin + 1) * delta / (delta + this.punycode_constants.skew);
};
/**
* returns a Punicode representation of a UTF-8 string
* adapted from http://tools.ietf.org/html/rfc3492
*/
Spry.Widget.Utils.punycode_encode = function (input, max_out) {
var inputc = input.split("");
input = [];
for(var i=0; i 0) {
output += String.fromCharCode(this.punycode_constants.delimiter);
out++;
}
while (h < input_len) {
for (m = this.punycode_constants.maxint, j = 0; j < input_len; j++) {
if (input[j] >= n && input[j] < m) {
m = input[j];
}
}
if (m - n > (this.punycode_constants.maxint - delta) / (h + 1)) {
return false;
}
delta += (m - n) * (h + 1);
n = m;
for (j = 0; j < input_len; j++) {
if (input[j] < n ) {
if (++delta == 0) {
return false;
}
}
if (input[j] == n) {
for (q = delta, k = this.punycode_constants.base; true; k += this.punycode_constants.base) {
if (out >= max_out) {
return false;
}
t = k <= bias ? this.punycode_constants.tmin : k >= bias + this.punycode_constants.tmax ? this.punycode_constants.tmax : k - bias;
if (q < t) {
break;
}
output += this.punycode_encode_digit(t + (q - t) % (this.punycode_constants.base - t));
out++;
q = (q - t) / (this.punycode_constants.base - t);
}
output += this.punycode_encode_digit(q);
out++;
bias = this.punycode_adapt(delta, h + 1, h == b);
delta = 0;
h++;
}
}
delta++, n++;
}
return output;
};
Spry.Widget.Utils.setOptions = function(obj, optionsObj, ignoreUndefinedProps)
{
if (!optionsObj)
return;
for (var optionName in optionsObj)
{
if (ignoreUndefinedProps && optionsObj[optionName] == undefined)
continue;
obj[optionName] = optionsObj[optionName];
}
};
Spry.Widget.Utils.firstValid = function() {
var ret = null;
for(var i=0; i 0)
return;
var handlers = this.event_handlers;
if (this.input)
{
var self = this;
this.input.setAttribute("AutoComplete", "off");
if (this.validateOn & Spry.Widget.ValidationConfirm.ONCHANGE)
{
var changeEvent =
Spry.is.mozilla || Spry.is.opera || Spry.is.safari?"input":
Spry.is.ie?"propertychange":
"change";
handlers.push([this.input, changeEvent, function(e){if (self.isDisabled()) return true; return self.validate(e||event);}]);
if (Spry.is.mozilla || Spry.is.safari)
handlers.push([this.input, "dragdrop", function(e){if (self.isDisabled()) return true; return self.validate(e);}]);
else if (Spry.is.ie)
handlers.push([this.input, "drop", function(e){if (self.isDisabled()) return true; return self.validate(event);}]);
}
handlers.push([this.input, "blur", function(e) {if (self.isDisabled()) return true; return self.onBlur(e||event);}]);
handlers.push([this.input, "focus", function(e) { if (self.isDisabled()) return true; return self.onFocus(e || event); }]);
for (var i=0; i 0 && this.input.value != this.firstInput.value)
{
this.switchClassName(this.element, this.invalidClass);
this.switchClassName(this.additionalError, this.invalidClass);
return false;
}
this.switchClassName(this.element, this.validClass);
this.switchClassName(this.additionalError, this.validClass);
return true;
};
Spry.Widget.ValidationConfirm.prototype.onBlur = function(e)
{
this.removeClassName(this.element, this.focusClass);
this.removeClassName(this.additionalError, this.focusClass);
if (this.validateOn & Spry.Widget.ValidationConfirm.ONBLUR)
this.validate(e);
};
Spry.Widget.ValidationConfirm.prototype.onFocus = function()
{
this.addClassName(this.element, this.focusClass);
this.addClassName(this.additionalError, this.focusClass);
};
Spry.Widget.ValidationConfirm.prototype.switchClassName = function(ele, className)
{
var classes = [this.validClass, this.requiredClass, this.invalidClass];
for (var i =0; i< classes.length; i++)
this.removeClassName(ele, classes[i]);
this.addClassName(ele, className);
};
Spry.Widget.ValidationConfirm.prototype.addClassName = function(ele, className)
{
if (!ele || !className || (ele.className && ele.className.indexOf(className) != -1 && ele.className.search(new RegExp("\\b" + className + "\\b")) != -1))
return;
ele.className += (ele.className ? " " : "") + className;
};
Spry.Widget.ValidationConfirm.prototype.removeClassName = function(ele, className)
{
if (!ele || !className || (ele.className && ele.className.indexOf(className) != -1 && ele.className.search(new RegExp("\\b" + className + "\\b")) == -1))
return;
ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
};
Spry.Widget.ValidationConfirm.prototype.isBrowserSupported = function()
{
return Spry.is.ie && Spry.is.v >= 5 && Spry.is.windows
||
Spry.is.mozilla && Spry.is.v >= 1.4
||
Spry.is.safari
||
Spry.is.opera && Spry.is.v >= 9;
};
Spry.Widget.ValidationConfirm.prototype.isDisabled = function()
{
return this.input && (this.input.disabled || this.input.readOnly) || !this.input;
};
//////////////////////////////////////////////////////////////////////
//
// Spry.Widget.Form - common for all widgets
//
//////////////////////////////////////////////////////////////////////
if (!Spry.Widget.Form) Spry.Widget.Form = {};
if (!Spry.Widget.Form.onSubmitWidgetQueue) Spry.Widget.Form.onSubmitWidgetQueue = [];
if (!Spry.Widget.Form.validate)
{
Spry.Widget.Form.validate = function(vform)
{
var isValid = true;
var isElementValid = true;
var q = Spry.Widget.Form.onSubmitWidgetQueue;
var qlen = q.length;
for (var i = 0; i < qlen; i++)
if (!q[i].isDisabled() && q[i].form == vform)
{
isElementValid = q[i].validate();
isValid = isElementValid && isValid;
}
return isValid;
};
};
if (!Spry.Widget.Form.onSubmit)
{
Spry.Widget.Form.onSubmit = function(e, form)
{
if (Spry.Widget.Form.validate(form) == false)
return false;
return true;
};
};
if (!Spry.Widget.Form.onReset)
{
Spry.Widget.Form.onReset = function(e, vform)
{
var q = Spry.Widget.Form.onSubmitWidgetQueue;
var qlen = q.length;
for (var i = 0; i < qlen; i++)
if (!q[i].isDisabled() && q[i].form == vform && typeof(q[i].reset) == 'function')
q[i].reset();
return true;
};
};
if (!Spry.Widget.Form.destroy)
{
Spry.Widget.Form.destroy = function(form)
{
var q = Spry.Widget.Form.onSubmitWidgetQueue;
for (var i = 0; i < Spry.Widget.Form.onSubmitWidgetQueue.length; i++)
if (q[i].form == form && typeof(q[i].destroy) == 'function')
{
q[i].destroy();
i--;
}
}
};
if (!Spry.Widget.Form.destroyAll)
{
Spry.Widget.Form.destroyAll = function()
{
var q = Spry.Widget.Form.onSubmitWidgetQueue;
for (var i = 0; i < Spry.Widget.Form.onSubmitWidgetQueue.length; i++)
if (typeof(q[i].destroy) == 'function')
{
q[i].destroy();
i--;
}
}
};
//////////////////////////////////////////////////////////////////////
//
// Spry.Widget.Utils
//
//////////////////////////////////////////////////////////////////////
if (!Spry.Widget.Utils) Spry.Widget.Utils = {};
Spry.Widget.Utils.showError = function(msg)
{
alert('Spry.ValidationConfirm ERR: ' + msg);
};
Spry.Widget.Utils.setOptions = function(obj, optionsObj, ignoreUndefinedProps)
{
if (!optionsObj)
return;
for (var optionName in optionsObj)
{
if (ignoreUndefinedProps && optionsObj[optionName] == undefined)
continue;
obj[optionName] = optionsObj[optionName];
}
};
Spry.Widget.Utils.firstValid = function()
{
var ret = null;
for(var i=0; i= 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 _8=_1[i];_2+="var "+_8[0]+" = {}; "+_8[1]+" = "+_8[0]+";"+_8[1]+"._scopeName = '"+_8[1]+"';";_3+=(i==0?"":",")+_8[0];_4+=(i==0?"":",")+_8[1];_5[_8[0]]=_8[1];_6[_8[1]]=_8[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{if(this["navigator"]){if(/3[\.0-9]+.*Safari/i.test(navigator.appVersion)&&this["console"]){this.console={_c:this.console,log:function(s){this._c.log(s);},info:function(s){this._c.info(s);},error:function(s){this._c.error(s);},warn:function(s){this._c.warn(s);}};}}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 tcn=tn+"";console[tcn]=("log" in console)?function(){var a=Array.apply({},arguments);a.unshift(tcn+":");console["log"](a.join(" "));}:function(){};})();}}}if(typeof dojo=="undefined"){this.dojo={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};}var d=dojo;if(typeof dijit=="undefined"){this.dijit={_scopeName:"dijit"};}if(typeof dojox=="undefined"){this.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 opt in djConfig){d.config[opt]=djConfig[opt];}}dojo.locale=d.config.locale;var rev="$Rev: 18832 $".match(/\d+/);dojo.version={major:1,minor:3,patch:2,flag:"_IBM",revision:rev?+rev[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 _15={};dojo._mixin=function(obj,_17){for(var x in _17){if(_15[x]===undefined||_15[x]!=_17[x]){obj[x]=_17[x];}}if(d.isIE&&_17){var p=_17.toString;if(typeof p=="function"&&p!=obj.toString&&p!=_15.toString&&p!="\nfunction toString() {\n [native code]\n}\n"){obj.toString=_17.toString;}}return obj;};dojo.mixin=function(obj,_1b){if(!obj){obj={};}for(var i=1,l=arguments.length;i0){console.warn("files still in flight!");return;}d._callLoaded();};dojo._callLoaded=function(){if(typeof setTimeout=="object"||(dojo.config.useXDomain&&d.isOpera)){if(dojo.isAIR){setTimeout(function(){dojo.loaded();},0);}else{setTimeout(dojo._scopeName+".loaded();",0);}}else{d.loaded();}};dojo._getModuleSymbols=function(_4b){var _4c=_4b.split(".");for(var i=_4c.length;i>0;i--){var _4e=_4c.slice(0,i).join(".");if((i==1)&&!this._moduleHasPrefix(_4e)){_4c[0]="../"+_4c[0];}else{var _4f=this._getModulePrefix(_4e);if(_4f!=_4e){_4c.splice(0,i,_4f);break;}}}return _4c;};dojo._global_omit_module_check=false;dojo.loadInit=function(_50){_50();};dojo._loadModule=dojo.require=function(_51,_52){_52=this._global_omit_module_check||_52;var _53=this._loadedModules[_51];if(_53){return _53;}var _54=this._getModuleSymbols(_51).join("/")+".js";var _55=(!_52)?_51:null;var ok=this._loadPath(_54,_55);if(!ok&&!_52){throw new Error("Could not load '"+_51+"'; last tried '"+_54+"'");}if(!_52&&!this._isXDomain){_53=this._loadedModules[_51];if(!_53){throw new Error("symbol '"+_51+"' is not defined after loading '"+_54+"'");}}return _53;};dojo.provide=function(_57){_57=_57+"";return (d._loadedModules[_57]=d.getObject(_57,true));};dojo.platformRequire=function(_58){var _59=_58.common||[];var _5a=_59.concat(_58[d._name]||_58["default"]||[]);for(var x=0;x<_5a.length;x++){var _5c=_5a[x];if(_5c.constructor==Array){d._loadModule.apply(d,_5c);}else{d._loadModule(_5c);}}};dojo.requireIf=function(_5d,_5e){if(_5d===true){var _5f=[];for(var i=1;i0&&!(j==1&&_70[0]=="")&&_70[j]==".."&&_70[j-1]!=".."){if(j==(_70.length-1)){_70.splice(j,1);_70[j-1]="";}else{_70.splice(j-1,2);j-=2;}}}}_6d.path=_70.join("/");}}}}uri=[];if(_6d.scheme){uri.push(_6d.scheme,":");}if(_6d.authority){uri.push("//",_6d.authority);}uri.push(_6d.path);if(_6d.query){uri.push("?",_6d.query);}if(_6d.fragment){uri.push("#",_6d.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(_73,url){var loc=d._getModuleSymbols(_73).join("/");if(!loc){return null;}if(loc.lastIndexOf("/")!=loc.length-1){loc+="/";}var _76=loc.indexOf(":");if(loc.charAt(0)!="/"&&(_76==-1||_76>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 _78=document.getElementsByTagName("script");var _79=/dojo(\.xd)?\.js(\W|$)/i;for(var i=0;i<_78.length;i++){var src=_78[i].getAttribute("src");if(!src){continue;}var m=src.match(_79);if(m){if(!d.config.baseUrl){d.config.baseUrl=src.substring(0,m.index);}var cfg=_78[i].getAttribute("djConfig");if(cfg){var _7e=eval("({ "+cfg+" })");for(var x in _7e){dojo.config[x]=_7e[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;var _84=Math.max(dav.indexOf("WebKit"),dav.indexOf("Safari"),0);if(_84&&!dojo.isChrome){d.isSafari=parseFloat(dav.split("Version/")[1]);if(!d.isSafari||parseFloat(dav.substr(_84+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]||dua.split("Shiretoko/")[1])||undefined;}if(document.all&&!d.isOpera){d.isIE=parseFloat(dav.split("MSIE ")[1])||undefined;if(d.isIE>=8&&document.documentMode!=5){d.isIE=document.documentMode;}}if(dojo.isIE&&window.location.protocol==="file:"){dojo.config.ieForceActiveXXhr=true;}var cm=document.compatMode;d.isQuirks=cm=="BackCompat"||cm=="QuirksMode"||d.isIE<6;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 _86,_87;if(!dojo.isIE||!dojo.config.ieForceActiveXXhr){try{_86=new XMLHttpRequest();}catch(e){}}if(!_86){for(var i=0;i<3;++i){var _89=d._XMLHTTP_PROGIDS[i];try{_86=new ActiveXObject(_89);}catch(e){_87=e;}if(_86){d._XMLHTTP_PROGIDS=[_89];break;}}}if(!_86){throw new Error("XMLHTTP not available: "+_87);}return _86;};d._isDocumentOk=function(_8a){var _8b=_8a.status||0;return (_8b>=200&&_8b<300)||_8b==304||_8b==1223||(!_8b&&(location.protocol=="file:"||location.protocol=="chrome:"));};var _8c=window.location+"";var _8d=document.getElementsByTagName("base");var _8e=(_8d&&_8d.length>0);d._getText=function(uri,_90){var _91=this._xhrObj();if(!_8e&&dojo._Url){uri=(new dojo._Url(_8c,uri)).toString();}if(d.config.cacheBust){uri+="";uri+=(uri.indexOf("?")==-1?"?":"&")+String(d.config.cacheBust).replace(/\W+/g,"");}_91.open("GET",uri,false);try{_91.send(null);if(!d._isDocumentOk(_91)){var err=Error("Unable to load "+uri+" status:"+_91.status);err.status=_91.status;err.responseText=_91.responseText;throw err;}}catch(e){if(_90){return null;}throw e;}return _91.responseText;};var _w=window;var _94=function(_95,fp){var _97=_w[_95]||function(){};_w[_95]=function(){fp.apply(_w,arguments);_97.apply(_w,arguments);};};d._windowUnloaders=[];d.windowUnloaded=function(){var mll=d._windowUnloaders;while(mll.length){(mll.pop())();}};var _99=0;d.addOnWindowUnload=function(obj,_9b){d._onto(d._windowUnloaders,obj,_9b);if(!_99){_99=1;_94("onunload",d.windowUnloaded);}};var _9c=0;d.addOnUnload=function(obj,_9e){d._onto(d._unloaders,obj,_9e);if(!_9c){_9c=1;_94("onbeforeunload",dojo.unloaded);}};})();dojo._initFired=false;dojo._loadInit=function(e){dojo._initFired=true;var _a0=e&&e.type?e.type.toLowerCase():"load";if(arguments.callee.initialized||(_a0!="domcontentloaded"&&_a0!="load")){return;}arguments.callee.initialized=true;if("_khtmlTimer" in dojo){clearInterval(dojo._khtmlTimer);delete dojo._khtmlTimer;}if(dojo._inFlightCount==0){dojo._modulesLoaded();}};if(!dojo.config.afterOnLoad){if(document.addEventListener){if(dojo.isWebKit>525||dojo.isOpera||dojo.isFF>=3||(dojo.isMoz&&dojo.config.enableMozDomContentLoaded===true)){document.addEventListener("DOMContentLoaded",dojo._loadInit,null);}window.addEventListener("load",dojo._loadInit,null);}if(dojo.isAIR){window.addEventListener("load",dojo._loadInit,null);}else{if((dojo.isWebKit<525)||dojo.isKhtml){dojo._khtmlTimer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){dojo._loadInit();}},10);}}}if(dojo.isIE){if(!dojo.config.afterOnLoad){document.write(""+"");}try{document.namespaces.add("v","urn:schemas-microsoft-com:vml");document.createStyleSheet().addRule("v\\:*","behavior:url(#default#VML); display:inline-block");}catch(e){}}}(function(){var mp=dojo.config["modulePaths"];if(mp){for(var _a2 in mp){dojo.registerModulePath(_a2,mp[_a2]);}}})();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");}if(!dojo._hasResource["dojo._base.lang"]){dojo._hasResource["dojo._base.lang"]=true;dojo.provide("dojo._base.lang");dojo.isString=function(it){return !!arguments.length&&it!=null&&(typeof it=="string"||it instanceof String);};dojo.isArray=function(it){return it&&(it instanceof Array||typeof it=="array");};dojo.isFunction=(function(){var _a5=function(it){var t=typeof it;return it&&(t=="function"||it instanceof Function);};return dojo.isSafari?function(it){if(typeof it=="function"&&it=="[object NodeList]"){return false;}return _a5(it);}:_a5;})();dojo.isObject=function(it){return it!==undefined&&(it===null||typeof it=="object"||dojo.isArray(it)||dojo.isFunction(it));};dojo.isArrayLike=function(it){var d=dojo;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&&!dojo.isFunction(it)&&/\{\s*\[native code\]\s*\}/.test(String(it));};dojo.extend=function(_ad,_ae){for(var i=1,l=arguments.length;i2){return dojo._hitchArgs.apply(dojo,arguments);}if(!_b8){_b8=_b7;_b7=null;}if(dojo.isString(_b8)){_b7=_b7||dojo.global;if(!_b7[_b8]){throw (["dojo.hitch: scope[\"",_b8,"\"] is null (scope=\"",_b7,"\")"].join(""));}return function(){return _b7[_b8].apply(_b7,arguments||[]);};}return !_b7?_b8:function(){return _b8.apply(_b7,arguments||[]);};};dojo.delegate=dojo._delegate=(function(){function TMP(){};return function(obj,_ba){TMP.prototype=obj;var tmp=new TMP();if(_ba){dojo._mixin(tmp,_ba);}return tmp;};})();(function(){var _bc=function(obj,_be,_bf){return (_bf||[]).concat(Array.prototype.slice.call(obj,_be||0));};var _c0=function(obj,_c2,_c3){var arr=_c3||[];for(var x=_c2||0;x=0){this._fire();}return this;},_fire:function(){var _13c=this.chain;var _13d=this.fired;var res=this.results[_13d];var self=this;var cb=null;while((_13c.length>0)&&(this.paused==0)){var f=_13c.shift()[_13d];if(!f){continue;}var func=function(){var ret=f(res);if(typeof ret!="undefined"){res=ret;}_13d=((res instanceof Error)?1:0);if(res instanceof dojo.Deferred){cb=function(res){self._resback(res);self.paused--;if((self.paused==0)&&(self.fired>=0)){self._fire();}};this.paused++;}};if(dojo.config.debugAtAllCosts){func.call(this);}else{try{func.call(this);}catch(err){_13d=1;res=err;}}}this.fired=_13d;this.results[_13d]=res;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(json){return eval("("+json+")");};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,_148,_149){if(it===undefined){return "undefined";}var _14a=typeof it;if(_14a=="number"||_14a=="boolean"){return it+"";}if(it===null){return "null";}if(dojo.isString(it)){return dojo._escapeString(it);}var _14b=arguments.callee;var _14c;_149=_149||"";var _14d=_148?_149+dojo.toJsonIndentStr:"";var tf=it.__json__||it.json;if(dojo.isFunction(tf)){_14c=tf.call(it);if(it!==_14c){return _14b(_14c,_148,_14d);}}if(it.nodeType&&it.cloneNode){throw new Error("Can't serialize DOM nodes");}var sep=_148?" ":"";var _150=_148?"\n":"";if(dojo.isArray(it)){var res=dojo.map(it,function(obj){var val=_14b(obj,_148,_14d);if(typeof val!="string"){val="undefined";}return _150+_14d+val;});return "["+res.join(","+sep)+_150+_149+"]";}if(_14a=="function"){return null;}var _154=[],key;for(key in it){var _156,val;if(typeof key=="number"){_156="\""+key+"\"";}else{if(typeof key=="string"){_156=dojo._escapeString(key);}else{continue;}}val=_14b(it[key],_148,_14d);if(typeof val!="string"){continue;}_154.push(_150+_14d+_156+":"+sep+val);}return "{"+_154.join(","+sep)+_150+_149+"}";};}if(!dojo._hasResource["dojo._base.array"]){dojo._hasResource["dojo._base.array"]=true;dojo.provide("dojo._base.array");(function(){var _158=function(arr,obj,cb){return [dojo.isString(arr)?arr.split(""):arr,obj||dojo.global,dojo.isString(cb)?new Function("item","index","array",cb):cb];};dojo.mixin(dojo,{indexOf:function(_15c,_15d,_15e,_15f){var step=1,end=_15c.length||0,i=0;if(_15f){i=end-1;step=end=-1;}if(_15e!=undefined){i=_15e;}if((_15f&&i>end)||i>=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(_1ad,_1ae){dojo.global=_1ad;dojo.doc=_1ae;};dojo.withGlobal=function(_1af,_1b0,_1b1,_1b2){var _1b3=dojo.global;try{dojo.global=_1af;return dojo.withDoc.call(null,_1af.document,_1b0,_1b1,_1b2);}finally{dojo.global=_1b3;}};dojo.withDoc=function(_1b4,_1b5,_1b6,_1b7){var _1b8=dojo.doc,_1b9=dojo._bodyLtr;try{dojo.doc=_1b4;delete dojo._bodyLtr;if(_1b6&&dojo.isString(_1b5)){_1b5=_1b6[_1b5];}return _1b5.apply(_1b6,_1b7||[]);}finally{dojo.doc=_1b8;if(_1b9!==undefined){dojo._bodyLtr=_1b9;}}};}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 _1be=name;if(!dojo.isIE&&(name=="mouseenter"||name=="mouseleave")){var ofp=fp;name=(name=="mouseenter")?"mouseover":"mouseout";fp=function(e){if(dojo.isFF<=2){try{e.relatedTarget.tagName;}catch(e2){return;}}if(!dojo.isDescendant(e.relatedTarget,node)){return ofp.call(this,e);}};}node.addEventListener(name,fp,false);return fp;},remove:function(node,_1c2,_1c3){if(node){_1c2=del._normalizeEventName(_1c2);if(!dojo.isIE&&(_1c2=="mouseenter"||_1c2=="mouseleave")){_1c2=(_1c2=="mouseenter")?"mouseover":"mouseout";}node.removeEventListener(_1c2,_1c3,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,_1c9){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,_1cc){return del._fixEvent(evt,_1cc);};dojo.stopEvent=function(evt){evt.preventDefault();evt.stopPropagation();};var _1ce=dojo._listener;dojo._connect=function(obj,_1d0,_1d1,_1d2,_1d3){var _1d4=obj&&(obj.nodeType||obj.attachEvent||obj.addEventListener);var lid=_1d4?(_1d3?2:1):0,l=[dojo._listener,del,_1ce][lid];var h=l.add(obj,_1d0,dojo.hitch(_1d1,_1d2));return [obj,_1d0,h,lid];};dojo._disconnect=function(obj,_1d9,_1da,_1db){([dojo._listener,del,_1ce][_1db]).remove(obj,_1d9,_1da);};dojo.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,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};if(dojo.isIE){var _1dc=function(e,code){try{return (e.keyCode=code);}catch(e){return 0;}};var iel=dojo._listener;var _1e0=(dojo._ieListenersName="_"+dojo._scopeName+"_listeners");if(!dojo.config._allow_leaks){_1ce=iel=dojo._ie_listener={handlers:[],add:function(_1e1,_1e2,_1e3){_1e1=_1e1||dojo.global;var f=_1e1[_1e2];if(!f||!f[_1e0]){var d=dojo._getIeDispatcher();d.target=f&&(ieh.push(f)-1);d[_1e0]=[];f=_1e1[_1e2]=d;}return f[_1e0].push(ieh.push(_1e3)-1);},remove:function(_1e7,_1e8,_1e9){var f=(_1e7||dojo.global)[_1e8],l=f&&f[_1e0];if(f&&l&&_1e9--){delete ieh[l[_1e9]];delete l[_1e9];}}};var ieh=iel.handlers;}dojo.mixin(del,{add:function(node,_1ed,fp){if(!node){return;}_1ed=del._normalizeEventName(_1ed);if(_1ed=="onkeypress"){var kd=node.onkeydown;if(!kd||!kd[_1e0]||!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,_1ed,del._fixCallback(fp));},remove:function(node,_1f2,_1f3){_1f2=del._normalizeEventName(_1f2);iel.remove(node,_1f2,_1f3);if(_1f2=="onkeypress"){var kd=node.onkeydown;if(--kd._stealthKeydownRefs<=0){iel.remove(node,"onkeydown",kd._stealthKeydownHandle);delete kd._stealthKeydownHandle;}}},_normalizeEventName:function(_1f5){return _1f5.slice(0,2)!="on"?"on"+_1f5:_1f5;},_nop:function(){},_fixEvent:function(evt,_1f7){if(!evt){var w=_1f7&&(_1f7.ownerDocument||_1f7.document||_1f7).parentWindow||window;evt=w.event;}if(!evt){return (evt);}evt.target=evt.srcElement;evt.currentTarget=(_1f7||evt.srcElement);evt.layerX=evt.offsetX;evt.layerY=evt.offsetY;var se=evt.srcElement,doc=(se&&se.ownerDocument)||document;var _1fb=((dojo.isIE<6)||(doc["compatMode"]=="BackCompat"))?doc.body:doc.documentElement;var _1fc=dojo._getIeDocumentElementOffset();evt.pageX=evt.clientX+dojo._fixIeBiDiScrollLeft(_1fb.scrollLeft||0)-_1fc.x;evt.pageY=evt.clientY+(_1fb.scrollTop||0)-_1fc.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[_1e0]){return;}var k=evt.keyCode;var _202=k!=13&&k!=32&&k!=27&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222);if(_202||evt.ctrlKey){var c=_202?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;_1dc(evt,faux.keyCode);}},_stopPropagation:function(){this.cancelBubble=true;},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;if(this.ctrlKey){_1dc(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,_207){var faux=dojo.mixin({},evt,_207);del._setKeyChar(faux);faux.preventDefault=function(){evt.preventDefault();};faux.stopPropagation=function(){evt.stopPropagation();};return faux;};if(dojo.isOpera){dojo.mixin(del,{_fixEvent:function(evt,_20a){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,_20d,fp){if(!node){return;}var _20f=del._add(node,_20d,fp);if(del._normalizeEventName(_20d)=="keypress"){_20f._stealthKeyDownHandle=del._add(node,"keydown",function(evt){var k=evt.keyCode;var _212=k!=13&&k!=32&&k!=27&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222);if(_212||evt.ctrlKey){var c=_212?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 _20f;},remove:function(node,_216,_217){if(node){if(_217._stealthKeyDownHandle){del._remove(node,"keydown",_217._stealthKeyDownHandle);}del._remove(node,_216,_217);}},_fixEvent:function(evt,_219){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,_21c){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(_21c,args);var lls=[].concat(ls);for(var i in lls){var f=h[lls[i]];if(!(i in ap)&&f){f.apply(_21c,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(dojo.isString(id)){var _d=doc||dojo.doc;var te=_d.getElementById(id);if(te&&(te.attributes.id.value==id||te.id==id)){return te;}else{var eles=_d.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{return id;}};}else{dojo.byId=function(id,doc){return dojo.isString(id)?(doc||dojo.doc).getElementById(id):id;};}(function(){var d=dojo;var _232=null;d.addOnWindowUnload(function(){_232=null;});dojo._destroyElement=dojo.destroy=function(node){node=d.byId(node);try{if(!_232||_232.ownerDocument!=node.ownerDocument){_232=node.ownerDocument.createElement("div");}_232.appendChild(node.parentNode?node.parentNode.removeChild(node):node);_232.innerHTML="";}catch(e){}};dojo.isDescendant=function(node,_235){try{node=d.byId(node);_235=d.byId(_235);while(node){if(node===_235){return true;}node=node.parentNode;}}catch(e){}return false;};dojo.setSelectable=function(node,_237){node=d.byId(node);if(d.isMozilla){node.style.MozUserSelect=_237?"":"none";}else{if(d.isKhtml||d.isWebKit){node.style.KhtmlUserSelect=_237?"auto":"none";}else{if(d.isIE){var v=(node.unselectable=_237?"":"on");d.query("*",node).forEach("item.unselectable = '"+v+"'");}}}};var _239=function(node,ref){var _23c=ref.parentNode;if(_23c){_23c.insertBefore(node,ref);}};var _23d=function(node,ref){var _240=ref.parentNode;if(_240){if(_240.lastChild==ref){_240.appendChild(node);}else{_240.insertBefore(node,ref.nextSibling);}}};dojo.place=function(node,_242,_243){_242=d.byId(_242);if(d.isString(node)){node=node.charAt(0)=="<"?d._toDom(node,_242.ownerDocument):d.byId(node);}if(typeof _243=="number"){var cn=_242.childNodes;if(!cn.length||cn.length<=_243){_242.appendChild(node);}else{_239(node,cn[_243<0?0:_243]);}}else{switch(_243){case "before":_239(node,_242);break;case "after":_23d(node,_242);break;case "replace":_242.parentNode.replaceChild(node,_242);break;case "only":d.empty(_242);_242.appendChild(node);break;case "first":if(_242.firstChild){_239(node,_242.firstChild);break;}default:_242.appendChild(node);}}return node;};dojo.boxModel="content-box";if(d.isIE){var _dcm=document.compatMode;d.boxModel=_dcm=="BackCompat"||_dcm=="QuirksMode"||d.isIE<6?"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(_24c,_24d){return parseFloat(_24d)||0;};}else{d._toPixelValue=function(_24e,_24f){if(!_24f){return 0;}if(_24f=="medium"){return 4;}if(_24f.slice&&_24f.slice(-2)=="px"){return parseFloat(_24f);}with(_24e){var _250=style.left;var _251=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=_24f;_24f=style.pixelLeft;}catch(e){_24f=0;}style.left=_250;runtimeStyle.left=_251;}return _24f;};}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,_25a){var ov=_25a*100;node.style.zoom=1;af(node,1).Enabled=!(_25a==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,_25a);});}return _25a;}:function(node,_25e){return node.style.opacity=_25e;};var _25f={left:true,top:true};var _260=/margin|padding|width|height|max|min|offset/;var _261=function(node,type,_264){type=type.toLowerCase();if(d.isIE){if(_264=="auto"){if(type=="height"){return node.offsetHeight;}if(type=="width"){return node.offsetWidth;}}if(type=="fontweight"){switch(_264){case 700:return "bold";case 400:default:return "normal";}}}if(!(type in _25f)){_25f[type]=_260.test(type);}return _25f[type]?px(node,_264):_264;};var _265=d.isIE?"styleFloat":"cssFloat",_266={"cssFloat":_265,"styleFloat":_265,"float":_265};dojo.style=function(node,_268,_269){var n=d.byId(node),args=arguments.length,op=(_268=="opacity");_268=_266[_268]||_268;if(args==3){return op?d._setOpacity(n,_269):n.style[_268]=_269;}if(args==2&&op){return d._getOpacity(n);}var s=gcs(n);if(args==2&&!d.isString(_268)){for(var x in _268){d.style(node,x,_268[x]);}return s;}return (args==1)?s:_261(n,_268,s[_268]||n.style[_268]);};dojo._getPadExtents=function(n,_270){var s=_270||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,_275){var ne="none",s=_275||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,_27b){var s=_27b||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,_280){var s=_280||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,_287){var s=_287||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,_292){var s=_292||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,_299){var s=_299||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,_2a8,_2a9,_2aa){if(d._usesBorderBox(node)){var pb=d._getPadBorderExtents(node,_2aa);if(_2a8>=0){_2a8+=pb.w;}if(_2a9>=0){_2a9+=pb.h;}}d._setBox(node,NaN,NaN,_2a8,_2a9);};dojo._setMarginBox=function(node,_2ad,_2ae,_2af,_2b0,_2b1){var s=_2b1||gcs(node),bb=d._usesBorderBox(node),pb=bb?_2b5:d._getPadBorderExtents(node,s);if(d.isWebKit){if(d._isButtonTag(node)){var ns=node.style;if(_2af>=0&&!ns.width){ns.width="4px";}if(_2b0>=0&&!ns.height){ns.height="4px";}}}var mb=d._getMarginExtents(node,s);if(_2af>=0){_2af=Math.max(_2af-pb.w-mb.w,0);}if(_2b0>=0){_2b0=Math.max(_2b0-pb.h-mb.h,0);}d._setBox(node,_2ad,_2ae,_2af,_2b0);};var _2b5={l:0,t:0,w:0,h:0};dojo.marginBox=function(node,box){var n=d.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=d.byId(node),s=gcs(n),b=box;return !b?d._getContentBox(n,s):d._setContentSize(n,b.w,b.h,s);};var _2c2=function(node,prop){if(!(node=(node||0).parentNode)){return 0;}var val,_2c6=0,_b=d.body();while(node&&node.style){if(gcs(node).position=="fixed"){return 0;}val=node[prop];if(val){_2c6+=val-0;if(node==_b){break;}}node=node.parentNode;}return _2c6;};dojo._docScroll=function(){var _b=d.body(),_w=d.global,de=d.doc.documentElement;return {y:(_w.pageYOffset||de.scrollTop||_b.scrollTop||0),x:(_w.pageXOffset||d._fixIeBiDiScrollLeft(de.scrollLeft)||_b.scrollLeft||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<7){return {x:d._isBodyLtr()||window.parent==window?de.clientLeft:de.offsetWidth-de.clientWidth-de.clientLeft,y:de.clientTop};}else{if(d.isIE<8){return {x:de.getBoundingClientRect().left,y:de.getBoundingClientRect().top};}else{return {x:0,y:0};}}};dojo._fixIeBiDiScrollLeft=function(_2cc){var dd=d.doc;if(d.isIE<8&&!d._isBodyLtr()){var de=dd.compatMode=="BackCompat"?dd.body:dd.documentElement;return _2cc+de.clientWidth-de.scrollWidth;}return _2cc;};dojo._abs=function(node,_2d0){var db=d.body(),dh=d.body().parentNode,ret;if(node["getBoundingClientRect"]){var _2d4=node.getBoundingClientRect();ret={x:_2d4.left,y:_2d4.top};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);}if(d.isIE){var _2d6=d._getIeDocumentElementOffset();ret.x-=_2d6.x+(d.isQuirks?db.clientLeft:0);ret.y-=_2d6.y+(d.isQuirks?db.clientTop:0);}}else{ret={x:0,y:0};if(node["offsetParent"]){ret.x-=_2c2(node,"scrollLeft");ret.y-=_2c2(node,"scrollTop");var _2d7=node;do{var n=_2d7.offsetLeft,t=_2d7.offsetTop;ret.x+=isNaN(n)?0:n;ret.y+=isNaN(t)?0:t;cs=gcs(_2d7);if(_2d7!=node){if(d.isFF){ret.x+=2*px(_2d7,cs.borderLeftWidth);ret.y+=2*px(_2d7,cs.borderTopWidth);}else{ret.x+=px(_2d7,cs.borderLeftWidth);ret.y+=px(_2d7,cs.borderTopWidth);}}if(d.isFF&&cs.position=="static"){var _2da=_2d7.parentNode;while(_2da!=_2d7.offsetParent){var pcs=gcs(_2da);if(pcs.position=="static"){ret.x+=px(_2d7,pcs.borderLeftWidth);ret.y+=px(_2d7,pcs.borderTopWidth);}_2da=_2da.parentNode;}}_2d7=_2d7.offsetParent;}while((_2d7!=dh)&&_2d7);}else{if(node.x&&node.y){ret.x+=isNaN(node.x)?0:node.x;ret.y+=isNaN(node.y)?0:node.y;}}}if(_2d0){var _2dc=d._docScroll();ret.x+=_2dc.x;ret.y+=_2dc.y;}return ret;};dojo.coords=function(node,_2de){var n=d.byId(node),s=gcs(n),mb=d._getMarginBox(n,s);var abs=d._abs(n,_2de);mb.x=abs.x;mb.y=abs.y;return mb;};var _2e3=d.isIE<8;var _2e4=function(name){switch(name.toLowerCase()){case "tabindex":return _2e3?"tabIndex":"tabindex";case "readonly":return "readOnly";case "class":return "className";case "for":case "htmlfor":return _2e3?"htmlFor":"for";default:return name;}};var _2e6={colspan:"colSpan",enctype:"enctype",frameborder:"frameborder",method:"method",rowspan:"rowSpan",scrolling:"scrolling",shape:"shape",span:"span",type:"type",valuetype:"valueType",classname:"className",innerhtml:"innerHTML"};dojo.hasAttr=function(node,name){node=d.byId(node);var _2e9=_2e4(name);_2e9=_2e9=="htmlFor"?"for":_2e9;var attr=node.getAttributeNode&&node.getAttributeNode(_2e9);return attr?attr.specified:false;};var _2eb={},_ctr=0,_2ed=dojo._scopeName+"attrid",_2ee={col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1};dojo.attr=function(node,name,_2f1){node=d.byId(node);var args=arguments.length;if(args==2&&!d.isString(name)){for(var x in name){d.attr(node,x,name[x]);}return;}name=_2e4(name);if(args==3){if(d.isFunction(_2f1)){var _2f4=d.attr(node,_2ed);if(!_2f4){_2f4=_ctr++;d.attr(node,_2ed,_2f4);}if(!_2eb[_2f4]){_2eb[_2f4]={};}var h=_2eb[_2f4][name];if(h){d.disconnect(h);}else{try{delete node[name];}catch(e){}}_2eb[_2f4][name]=d.connect(node,name,_2f1);}else{if(typeof _2f1=="boolean"){node[name]=_2f1;}else{if(name==="style"&&!d.isString(_2f1)){d.style(node,_2f1);}else{if(name=="className"){node.className=_2f1;}else{if(name==="innerHTML"){if(d.isIE&&node.tagName.toLowerCase() in _2ee){d.empty(node);node.appendChild(d._toDom(_2f1,node.ownerDocument));}else{node[name]=_2f1;}}else{node.setAttribute(name,_2f1);}}}}}}else{var prop=_2e6[name.toLowerCase()];if(prop){return node[prop];}var _2f7=node[name];return (typeof _2f7=="boolean"||typeof _2f7=="function")?_2f7:(d.hasAttr(node,name)?node.getAttribute(name):null);}};dojo.removeAttr=function(node,name){d.byId(node).removeAttribute(_2e4(name));};dojo.create=function(tag,_2fb,_2fc,pos){var doc=d.doc;if(_2fc){_2fc=d.byId(_2fc);doc=_2fc.ownerDocument;}if(d.isString(tag)){tag=doc.createElement(tag);}if(_2fb){d.attr(tag,_2fb);}if(_2fc){d.place(tag,_2fc,pos);}return tag;};d.empty=d.isIE?function(node){node=d.byId(node);for(var c;c=node.lastChild;){d.destroy(c);}}:function(node){d.byId(node).innerHTML="";};var _302={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"]},_303=/<\s*([\w\:]+)/,_304={},_305=0,_306="__"+d._scopeName+"ToDomId";for(var _307 in _302){var tw=_302[_307];tw.pre=_307=="option"?"