
function FastArray()
{this.moHash=new Object();this.moArray=new Array();}
FastArray.prototype={Push:function(_sValue)
{var bRet=false;if(_sValue==null)
{}
else
{if(this.Exists(_sValue))
{this.Remove(this.moHash[_sValue]);}
this.moArray.push(_sValue);this.moHash[_sValue]=this.moArray.length-1;bRet=true;}
return bRet;},PushIfNotExists:function(_sValue)
{var bRet=false;if(_sValue==null)
{}
else
{if(!this.Exists(_sValue))
{this.moArray.push(_sValue);this.moHash[_sValue]=this.moArray.length-1;bRet=true;}}
return bRet;},Remove:function(_iIndex)
{var bRet=false;if(!YAHOO.lang.isNumber(_iIndex))
{_iIndex=this.moHash[_iIndex];}
if(_iIndex!=null)
{if(_iIndex<this.moArray.length)
{var sValue=this.moArray[_iIndex];delete this.moHash[sValue];this.moArray.splice(_iIndex,1);this._RepopulateIndex();bRet=true;}}
else
{}
return bRet;},GetSize:function()
{return this.moArray.length;},Exists:function(_sValue)
{var bRet=false;if(_sValue==null)
{}
else
{bRet=(_sValue in this.moHash)}
return bRet;},Get:function(_iIndex)
{var sRet=null;if((!YAHOO.lang.isNumber(_iIndex))||(_iIndex>=this.moArray.length))
{}
else
{sRet=this.moArray[_iIndex];}
return sRet;},GetArray:function()
{return this.moArray;},GetIndex:function(_oElement)
{var bParameters=false;var iResult=-1;if(_oElement in this.moHash)
{iResult=this.moHash[_oElement];}
return iResult;},_RepopulateIndex:function()
{this.moHash=new Object();for(var i=0;i<this.moArray.length;i++)
{this.moHash[this.moArray[i]]=i;}},Sort:function(_oFunc)
{this.moArray.sort(_oFunc);this._RepopulateIndex();}};function LoggerClass()
{this.mbIsSetup=false;this.mbWarningFilter=true;this.mbErrorFilter=true;this.mbTraceFilter=true;this.mbInfoFilter=true;this.mbTimeFilter=true;this.miLastMilliseconds=-1;this.moLog=new Array();this.moCategories=new FastArray();this.moProfile=new Array();this.moObjectToProfile=new Object();this.mbProfile=false;MarkTimeline=function(msg)
{var logger=window.console;if(logger&&logger.markTimeline)
{logger.markTimeline(msg);}}}
LoggerClass.Const={ID_CONSOLE:"Console",ID_TEXTAREA:"ConsoleTxt",ID_INTERVAL_FILTER:"IntervalFilterTxt",ID_COMMAND:"CommandPnl",ID_WARNING_FILTER:"WarningFilter",ID_ERROR_FILTER:"ErrorFilter",ID_TRACE_FILTER:"TraceFilter",ID_INFO_FILTER:"InfoFilter",ID_TIME_FILTER:"TimeFilter",ID_CATEGORY:"CategoryPnl",LOGTYPE_WARNING:"warn",LOGTYPE_ERROR:"error",LOGTYPE_TIME:"time",LOGTYPE_INFO:"info",LOGTYPE_TRACE:"trace",LOGTYPE_LAYOUT:"layout",KEY_MESSAGE:"Msg",KEY_TYPE:"Type",KEY_CATEGORY:"Cat",KEY_INTERVAL:"Int",KEY_FUNCTION_NAME:"fn",KEY_TIME:"t",KEY_INSTANCE:"I",KEY_TOTAL_TIME:"tt",KEY_REAL_TOTAL_TIME:"rtt",KEY_TIME_TO_REMOVE:"ttr",KEY_DATE_TIME:"dt"};LoggerClass.prototype={Setup:function(_sID)
{this.msVFormID=_sID.split(Matrix3.Const.SEPARATOR_CONTROL)[0];this.msConsoleID=this.msVFormID+Matrix3.Const.SEPARATOR_CONTROL+LoggerClass.Const.ID_TEXTAREA;this.msCategoryID=this.msVFormID+Matrix3.Const.SEPARATOR_CONTROL+LoggerClass.Const.ID_CATEGORY;var oDD=new YAHOO.util.DD(_sID);oDD.setHandleElId(this.msVFormID+Matrix3.Const.SEPARATOR_CONTROL+LoggerClass.Const.ID_COMMAND);this.mbIsSetup=true;},StartProfile:function()
{this.mbProfile=true;this.moProfile=new Array();this.moObjectToProfile=new Object();},StopProfile:function()
{this.mbProfile=false;var oArray=new Array();var iRealTime=0;for(var sKey in this.moObjectToProfile)
{oArray.push(this.moObjectToProfile[sKey]);iRealTime+=this.moObjectToProfile[sKey][LoggerClass.Const.KEY_REAL_TOTAL_TIME];}
oArray.sort(function(a,b)
{return b[LoggerClass.Const.KEY_REAL_TOTAL_TIME]-a[LoggerClass.Const.KEY_REAL_TOTAL_TIME];});this.ClearConsole();var sValue='<table cellspacing="5"><tr><td>name</td><td>Total real time ('+iRealTime+')</td><td>average real time</td><td>total time</td><td>average total time</td><td>call</td></tr>';for(var i=0;i<oArray.length;i++)
{if(oArray[i][LoggerClass.Const.KEY_REAL_TOTAL_TIME]==0)continue;sValue+='<tr><td>'
+oArray[i][LoggerClass.Const.KEY_FUNCTION_NAME]
+'</td><td>'
+oArray[i][LoggerClass.Const.KEY_REAL_TOTAL_TIME]
+' ( '+Math.ceil(oArray[i][LoggerClass.Const.KEY_REAL_TOTAL_TIME]*100/iRealTime)+'%)</td><td>'
+(Math.ceil(oArray[i][LoggerClass.Const.KEY_REAL_TOTAL_TIME]/oArray[i][LoggerClass.Const.KEY_INSTANCE]))
+'</td><td>'
+oArray[i][LoggerClass.Const.KEY_TOTAL_TIME]
+'</td><td>'
+(Math.ceil(oArray[i][LoggerClass.Const.KEY_TOTAL_TIME]/oArray[i][LoggerClass.Const.KEY_INSTANCE]))
+'</td><td>'
+oArray[i][LoggerClass.Const.KEY_INSTANCE]
+'</td></tr>';}
sValue+="</table>";$(this.msConsoleID).innerHTML=sValue;},Profile:function(_sFunc,_bStartTag)
{if(!this.mbProfile)return;if(_bStartTag)
{var oObj=new Object();oObj[LoggerClass.Const.KEY_FUNCTION_NAME]=_sFunc;oObj[LoggerClass.Const.KEY_TIME_TO_REMOVE]=0;oObj[LoggerClass.Const.KEY_DATE_TIME]=new Date().getTime();this.moProfile.push(oObj);if(!(_sFunc in this.moObjectToProfile))
{this.moObjectToProfile[_sFunc]=new Object();this.moObjectToProfile[_sFunc][LoggerClass.Const.KEY_FUNCTION_NAME]=_sFunc;this.moObjectToProfile[_sFunc][LoggerClass.Const.KEY_INSTANCE]=0;this.moObjectToProfile[_sFunc][LoggerClass.Const.KEY_TOTAL_TIME]=0;this.moObjectToProfile[_sFunc][LoggerClass.Const.KEY_REAL_TOTAL_TIME]=0;}
this.moObjectToProfile[_sFunc][LoggerClass.Const.KEY_INSTANCE]++;}
else
{var oObj=this.moProfile.pop();var iDateTime=new Date().getTime();var iTotalTime=(iDateTime-oObj[LoggerClass.Const.KEY_DATE_TIME]);var oProfileObj=this.moObjectToProfile[oObj[LoggerClass.Const.KEY_FUNCTION_NAME]];oProfileObj[LoggerClass.Const.KEY_TOTAL_TIME]+=iTotalTime;oProfileObj[LoggerClass.Const.KEY_REAL_TOTAL_TIME]+=iTotalTime-oObj[LoggerClass.Const.KEY_TIME_TO_REMOVE];if(this.moProfile.length>0)
{this.moProfile[this.moProfile.length-1][LoggerClass.Const.KEY_TIME_TO_REMOVE]+=iTotalTime;}}},Log:function(_sMessage,_sType,_sCategory)
{var bResult=false;if($(this.msConsoleID)&&Utils.IsString(_sMessage))
{if(!Utils.IsString(_sType))
{_sType=LoggerClass.Const.LOGTYPE_ERROR;}
if(!Utils.IsString(_sCategory))
{_sCategory="";}
var iMilliseconds=new Date().getTime();var iInterval=0;if(this.miLastMilliseconds!=-1)
{iInterval=iMilliseconds-this.miLastMilliseconds;}
if(_sType!=LoggerClass.Const.LOGTYPE_LAYOUT)
{_sMessage=_sMessage.replace(/&/g,"&amp;");_sMessage=_sMessage.replace(/</g,"&lt;");_sMessage=_sMessage.replace(/>/g,"&gt;");}
this.miLastMilliseconds=iMilliseconds;var oMsg=new Object();oMsg[LoggerClass.Const.KEY_MESSAGE]=_sMessage;oMsg[LoggerClass.Const.KEY_TYPE]=_sType;oMsg[LoggerClass.Const.KEY_CATEGORY]=_sCategory;oMsg[LoggerClass.Const.KEY_INTERVAL]=iInterval;this.moLog.push(oMsg);var sID=this.msVFormID+Matrix3.Const.SEPARATOR_CONTROL+_sCategory;if(_sCategory&&Utils.Trim(_sCategory)!=''&&!(this.moCategories.Exists(sID)))
{var oCat=document.createElement("div");var oCheckbox=document.createElement("input");oCheckbox.type="checkbox";oCheckbox.style.marginRight="3px";oCheckbox.style.width="auto";oCheckbox.style.height="auto";oCheckbox.id=sID;Utils.AddEvent(oCheckbox,"click",this.Refresh,this);oCat.appendChild(oCheckbox);var oLabel=document.createElement("span");oLabel.appendChild(document.createTextNode(_sCategory));oCat.appendChild(oLabel);$(this.msCategoryID).appendChild(oCat);this.moCategories.Push(sID);}
$(this.msConsoleID).innerHTML+=this.RenderLine(oMsg);}},RenderLine:function(oMsg)
{var sResult="";var bFilter=((this.mbWarningFilter&&oMsg[LoggerClass.Const.KEY_TYPE]==LoggerClass.Const.LOGTYPE_WARNING)||(this.mbErrorFilter&&oMsg[LoggerClass.Const.KEY_TYPE]==LoggerClass.Const.LOGTYPE_ERROR)||(this.mbInfoFilter&&oMsg[LoggerClass.Const.KEY_TYPE]==LoggerClass.Const.LOGTYPE_INFO)||(this.mbTimeFilter&&oMsg[LoggerClass.Const.KEY_TYPE]==LoggerClass.Const.LOGTYPE_TIME)||(this.mbTraceFilter&&oMsg[LoggerClass.Const.KEY_TYPE]==LoggerClass.Const.LOGTYPE_TRACE))&&(Utils.Trim(oMsg[LoggerClass.Const.KEY_CATEGORY])==""||$(this.msVFormID+Matrix3.Const.SEPARATOR_CONTROL+oMsg[LoggerClass.Const.KEY_CATEGORY]).checked);if(((isNaN(this.miIntervalFilter)||oMsg[LoggerClass.Const.KEY_INTERVAL]>this.miIntervalFilter)&&bFilter)||oMsg[LoggerClass.Const.KEY_TYPE]==LoggerClass.Const.LOGTYPE_LAYOUT)
{if(oMsg[LoggerClass.Const.KEY_TYPE]!=LoggerClass.Const.LOGTYPE_LAYOUT)
{var iInterval=oMsg[LoggerClass.Const.KEY_INTERVAL];var sColor="#000";if(iInterval<50)
{sColor="#000";}
else
if(iInterval<200)
{sColor="#0015FF";}else
if(iInterval<1000)
{sColor="#ED00FF";}
else
{sColor="#FF0000";}
sResult='<span style="width: 100%; color:'+sColor+'">'+oMsg[LoggerClass.Const.KEY_INTERVAL]+" "+oMsg[LoggerClass.Const.KEY_TYPE]+" "+oMsg[LoggerClass.Const.KEY_CATEGORY]+": "+oMsg[LoggerClass.Const.KEY_MESSAGE]+"</span><br />";}
else
{sResult=oMsg[LoggerClass.Const.KEY_MESSAGE];}}
return sResult;},ClearConsole:function()
{this.moLog=new Array();this.Refresh();},Refresh:function()
{$(this.msConsoleID).innerHTML='';var sValue="";for(var i=0;i<this.moLog.length;i++)
{sValue+=this.RenderLine(this.moLog[i]);}
$(this.msConsoleID).innerHTML=sValue;},EndTurn:function()
{this.Log("<br />",LoggerClass.Const.LOGTYPE_LAYOUT);this.miLastMilliseconds=-1;},UpdateIntervalFilter:function()
{this.miIntervalFilter=parseInt($(this.msVFormID+Matrix3.Const.SEPARATOR_CONTROL+LoggerClass.Const.ID_INTERVAL_FILTER).value);this.Refresh();},UpdateWarningFilter:function()
{this.mbWarningFilter=$(this.msVFormID+Matrix3.Const.SEPARATOR_CONTROL+LoggerClass.Const.ID_WARNING_FILTER).checked;this.Refresh();},UpdateErrorFilter:function()
{this.mbErrorFilter=$(this.msVFormID+Matrix3.Const.SEPARATOR_CONTROL+LoggerClass.Const.ID_ERROR_FILTER).checked;this.Refresh();},UpdateTimeFilter:function()
{this.mbTimeFilter=$(this.msVFormID+Matrix3.Const.SEPARATOR_CONTROL+LoggerClass.Const.ID_TIME_FILTER).checked;this.Refresh();},UpdateInfoFilter:function()
{this.mbInfoFilter=$(this.msVFormID+Matrix3.Const.SEPARATOR_CONTROL+LoggerClass.Const.ID_INFO_FILTER).checked;this.Refresh();},UpdateTraceFilter:function()
{this.mbTraceFilter=$(this.msVFormID+Matrix3.Const.SEPARATOR_CONTROL+LoggerClass.Const.ID_TRACE_FILTER).checked;this.Refresh();}};var Logger=new LoggerClass();HTMLElement.prototype.SetupIFrame=function()
{if(this.miOriginalWidth==-1||this.miOriginalHeight==-1)
{var self=this;var callback=function(){self.PollFrameSize();};setInterval(callback,100);}}
HTMLElement.prototype.PollFrameSize=function()
{try
{var bSizeChanged=false;if(this.miOriginalWidth==-1)
{var iWidth=this.childNodes[0].contentWindow.document.body.offsetWidth;if(iWidth!=this.miWidth)
{PositionMgr.GetInstance().AddToDirtyXList(this);bSizeChanged=true;}}
if(this.miOriginalHeight==-1)
{var iHeight=this.childNodes[0].contentWindow.document.body.offsetHeight;if(iHeight!=this.miHeight)
{PositionMgr.GetInstance().AddToDirtyYList(this);bSizeChanged=true;}}
if(bSizeChanged)
{PositionMgr.GetInstance().CalculatePosition();}}
catch(e){}}
function $(_sID,_bForce)
{return CacheMgr.GetInstance().GetEl(_sID,_bForce);}
function $PI(_sId,_bSearchOnlyInOldInstance)
{return ControlMgr.GetInstance().GetPositionItem(_sId,_bSearchOnlyInOldInstance);}
function $S(_sID,_sStyle,_bForce)
{return StyleMgr.GetInstance().GetStyle(_sID,_sStyle,_bForce);}
function $SetStyle(_sID,_sStyleType,_sStyleValue)
{StyleMgr.GetInstance().SetStyle(_sID,_sStyleType,_sStyleValue);}
function $AddClass(_sID,_sClass)
{StyleMgr.GetInstance().AddClass(_sID,_sClass);}
function $RemoveClass(_sID,_sClass)
{StyleMgr.GetInstance().RemoveClass(_sID,_sClass);}
function $ReplaceClass(_sID,_sToReplace,_sNewClass)
{StyleMgr.GetInstance().ReplaceClass(_sID,_sToReplace,_sNewClass);}
function $HasClass(_sID,_sClass)
{return StyleMgr.GetInstance().HasClass(_sID,_sClass);}
function $SwitchClass(_sID,_sClass)
{return StyleMgr.GetInstance().SwitchClass(_sID,_sClass);}
function $Control(_sID,_sType)
{return ControlMgr.GetInstance().GetControl(_sID,_sType);}
function $AddEvent(_oObj,_sEvent,_sBroadcast,_sChannel,_sArgs)
{CtrlEventMgr.GetInstance().AddEvent(_oObj,_sEvent,_sBroadcast,_sChannel,_sArgs);}
function $AddAction(_oObj,_sFunc,_sBroadcast,_sChannel,_sArgs)
{CtrlEventMgr.GetInstance().AddAction(_oObj,_sFunc,_sBroadcast,_sChannel,_sArgs);}
var $LS=function(_sFunct)
{try
{Logger.Profile(_sFunct,true);}catch(e){};};var $LE=function(_sFunct)
{try
{Logger.Profile(_sFunct,false);}catch(e){};};function CacheMgr()
{this.mbIsActive=true;this.Refresh();}
CacheMgr.Const={MGR_NAME:"Cache"};CacheMgr.moSingleton=null;CacheMgr.GetInstance=function()
{if(!CacheMgr.moSingleton){CacheMgr.moSingleton=new CacheMgr();}
return CacheMgr.moSingleton;};CacheMgr.prototype={GetEl:function(_oID,_bForce)
{var oResult=null;if(_oID)
{if((_oID.nodeType||_oID==window)&&!_bForce)
{oResult=_oID;}
else
{if(_bForce&&_oID.id)
{_oID=_oID.id;}
if(!(_oID in this.moCache)||!this.mbIsActive||!this.moCache[_oID].parentNode)
{oResult=document.getElementById(_oID);if(oResult)
{this.moCache[_oID]=oResult;Matrix3.RegisterInCache(_oID,CacheMgr);}}
else
{oResult=this.moCache[_oID];}}}
return oResult;},Refresh:function()
{this.moCache=new Object();},RefreshNode:function(_sID)
{delete(this.moCache[_sID]);},LoadCache:function()
{var oList=document.getElementsByTagName("div");for(var i=0;i<oList.length;i++)
{if(oList[i].id)
{this.moCache[oList[i].id]=oList[i];Matrix3.RegisterInCache(oList[i].id,CacheMgr);}}}};function ConstProperties()
{}
ConstProperties.Const={LABEL_TEXT:"LT",DISABLED:"D",NAME:"N",EVENT:"E",POSTBACK_EVENT:"PostbackEvent",PLEASE_WAIT_MSG:"PleaseWaitMsg",VALUE:"V",TEXT:"Text",OPTION_LIST:"OptionList",FLASH_STYLE:"FS",FLASH_SCROLLABLE:"FlashScrollable",SCROLL_RESTRICTION:"ScrollRestriction",FLASH_ID:"FID",FLASH_PADDING:"FP",FLASH_PADDING_TOP:"FPT",FLASH_PADDING_RIGHT:"FPR",FLASH_PADDING_BOTTOM:"FPB",FLASH_PADDING_LEFT:"FPL",CHILDREN_FLASH_STYLE:"CFS",SOURCE:"Source",TEMP_SOURCE:"TempSource",URL:"URL",IMAGE_HEIGHT:"ImageHeight",IMAGE_WIDTH:"ImageWidth",IMAGE_OVER:"ImageOver",IMAGE_OUT:"ImageOut",IMAGE_ERROR:"ImageError",LAYOUT:"Layout",CONTROL_EVENTS:"CE",CONTROL_ACTIONS:"CA",ETHEREAL:"Ethereal",ZINDEX:"ZIndex",PAGE_TRACKING:"PageTracking",EVENT_TRACKING:"EventTracking",SCROLL_TO_ME:"ScrollToMe",HANDLE:"Handle",FLASHVARS:"FlashVars",STAR:"Star",DESCRIPTION_TEXT:"DescriptionText",WARNING_TEXT:"WarningText",DATE_INTERVAL:"Interval",DATE_PERIOD_OPTIONS:"PeriodOptions",DATE_VALUE_TO:"ValueTo",DATE_USER_FORMAT:"UserFormat",DATE_SERVER_FORMAT:"ServerFormat",DATE_TIME:"DateTime",MAX_RESIZE_WIDTH:"MaxResizeWidth",MIN_RESIZE_WIDTH:"MinResizeWidth",MAX_RESIZE_HEIGHT:"MaxResizeHeight",MIN_RESIZE_HEIGHT:"MinResizeHeight",RESIZE_WIDTH:"ResizeWidth",RESIZE_HEIGHT:"ResizeHeight",AUTOLIMIT_RESIZE_HEIGHT:"AutoLimitResizeHeight",RESIZE_KEEP_RATIO:"ResizeKeepRatio",BLOCK_DRAG:"BlockDrag",DISABLE_MASK:"DisableMask",SCROLLBAR_SKIN:"ScrollBarSkin",IS_MENU:"IsMenu",CROP_WIDTH:"CropWidth",CROP_HEIGHT:"CropHeight",CROP_X:"CropX",CROP_Y:"CropY",CROP_DONT_KEEP_RATIO:"CropDontKeepRatio",CROP_SHOWCONTROLS:"CropShowControls",PROPERTY_FLOAT_SPACING:"FloatSpacing",PROPERTY_FLOAT_V_SPACING:"FloatVSpacing",PROPERTY_FLOAT_H_SPACING:"FloatHSpacing",PROPERTY_FLOAT_DIRECTION:"FloatDirection",PROPERTY_VALUE_HORIZONTAL:"horizontal",PROPERTY_VALUE_VERTICAL:"vertical",IN_PLACE_EDIT:"InPlaceEdit",COLUMNS_WIDTH:"CW",COLUMNS_CAN_GROW:"CCG",NEED_SIZE:"SizeNeeded",PROPERTY_INSTANCE_NAME:"InstanceName",SEQUENCE_LOADING_PREV:"SLP",SEQUENCE_LOADING_NEXT:"SLN",SEQUENCE_LOADING_CONTEXTUAL_TABLE:"SLCT"};function ConstValues()
{}
ConstValues.Const={T_STAR:"*",SUPER_CONTAINER:"SuperContainer",SCREEN:"screen",DEFAULT_LABEL_INPUT_SPACING:5,DEFAULT_AUTOCOMP_LIST_HEIGHT:300,SESSION_ID:"ASPSESSID",STANDARD_INPUT_HEIGHT:40,DISABLED_CONTROL_OPACITY:0.5}
function ControlHeap()
{this.moArray=new Array();this.moPresenceHash=new Object();this.GetSize=function()
{return this.moArray.length;},this.Add=function(_oControl)
{var iNewIndex=this.moArray.length;var iNextIndex;var oTmpControl;if(!this.moPresenceHash.hasOwnProperty(_oControl.GetId()))
{this.moArray[iNewIndex]=_oControl;iNextIndex=iNewIndex-1;iNextIndex>>=1;while(iNewIndex>0&&((this.moArray[iNewIndex]).miDeep>(this.moArray[iNextIndex]).miDeep))
{oTmpControl=this.moArray[iNewIndex];this.moArray[iNewIndex]=this.moArray[iNextIndex];this.moArray[iNextIndex]=oTmpControl;iNewIndex=iNextIndex;iNextIndex=iNewIndex-1;iNextIndex>>=1;}
this.moPresenceHash[_oControl.GetId()]=_oControl;}
else
{if(this.moPresenceHash[_oControl.GetId()]!=_oControl)
{this.Remove(this.moPresenceHash[_oControl.GetId()]);this.Add(_oControl);}}};this.IsControlDirty=function(_oControl)
{return this.moPresenceHash.hasOwnProperty(_oControl.GetId());};this.Peek=function()
{return this.moArray[0];};this.Pop=function()
{var oResult=this.moArray[0];if(this.moArray.length>1)
{this.moArray[0]=this.moArray.pop();this.BubbleUp(0);delete this.moPresenceHash[oResult.GetId()];}
else
{if(this.moArray.length==1)
{this.moArray=new Array();this.moPresenceHash=new Object();}}
return oResult;};this.BubbleUp=function(_iIndex)
{var iMovedIndex=_iIndex;var iLeftChildIndex;var iRightChildIndex;var bPlaced=false;var oTmpControl;while(!bPlaced)
{iLeftChildIndex=iMovedIndex;iLeftChildIndex<<=1;iLeftChildIndex++;iRightChildIndex=iLeftChildIndex;iRightChildIndex++;var iControlDepth=(this.moArray[iMovedIndex]).miDeep;var iLeftDiff=0;var iRightDiff=0;if(this.moArray[iLeftChildIndex]!=null)
{iLeftDiff=(this.moArray[iLeftChildIndex]).miDeep-iControlDepth;}
if(this.moArray[iRightChildIndex]!=null)
{iRightDiff=(this.moArray[iRightChildIndex]).miDeep-iControlDepth;}
if(iLeftDiff>=iRightDiff&&iLeftDiff>0)
{oTmpControl=this.moArray[iMovedIndex];this.moArray[iMovedIndex]=this.moArray[iLeftChildIndex];this.moArray[iLeftChildIndex]=oTmpControl;iMovedIndex=iLeftChildIndex;}
else if(iRightDiff>0)
{oTmpControl=this.moArray[iMovedIndex];this.moArray[iMovedIndex]=this.moArray[iRightChildIndex];this.moArray[iRightChildIndex]=oTmpControl;iMovedIndex=iRightChildIndex;}
else
{bPlaced=true;}}};this.Remove=function(_oControl)
{if(this.moPresenceHash.hasOwnProperty(_oControl.GetId())&&this.moPresenceHash[_oControl.GetId()]==_oControl)
{var iIndex=0;while(this.moArray[iIndex]!=_oControl)
{iIndex++;}
if(iIndex<this.moArray.length-1)
{this.moArray[iIndex]=this.moArray.pop();this.BubbleUp(iIndex);}
else
{this.moArray.pop();}
delete this.moPresenceHash[_oControl.GetId()];}
else
{if(this.moArray.indexOf(_oControl)!=-1)
{var iIndex=0;while(this.moArray[iIndex]!=_oControl)
{iIndex++;}
if(iIndex<this.moArray.length-1)
{this.moArray[iIndex]=this.moArray.pop();BubbleUp(iIndex);}
else
{this.moArray.pop();}
delete this.moPresenceHash[_oControl.GetId()];}
for(var sKey in this.moPresenceHash)
{if(this.moPresenceHash[sKey]==_oControl)
{delete this.moPresenceHash[sKey];break;}}}};}
function ControlMgr()
{this.Refresh();this.moReferences=new Object();this.moNewReferences=new Object();this.moRootPositionItem;this.moPropertyQueue=new Array();this.moHash=new Object();this.moOldHash=new Object();}
ControlMgr.moSingleton=null;ControlMgr.GetInstance=function()
{if(!ControlMgr.moSingleton)
{ControlMgr.moSingleton=new ControlMgr();}
return ControlMgr.moSingleton;};ControlMgr.FindControlChildren=function(_oControl,_iDepth)
{var oChildren=_oControl.childNodes;var oNodesToSearch=new Array();for(var oNode in oChildren)
{oNodesToSearch.push(oChildren[oNode]);}
var oResult=new Array();while(oNodesToSearch.length>0)
{var oCurrent=oNodesToSearch[0];oNodesToSearch.shift();var bOk=false;if(oCurrent.attributes&&oCurrent.attributes["class"])
{if((oCurrent.attributes["class"].value.indexOf("ABS")>-1)||(oCurrent.attributes["class"].value.indexOf("CT")>-1)||(oCurrent.attributes["class"].value.indexOf("PanelLine")>-1)||(oCurrent.attributes["class"].value.indexOf("PanelCol")>-1)||(oCurrent.attributes["class"].value.indexOf("DefaultPopupClass")>-1)||(oCurrent.attributes["class"].value.indexOf("PopupWrapper")>-1))
{if(oCurrent.attributes["class"].value.indexOf("DefaultPopupClass")!=-1&&oCurrent.id=="")
{oCurrent.id="ArtificialID_"+Math.floor(Math.random()*1000000000);}
if(oCurrent.attributes["data-p"]==null)
{oCurrent.setAttribute("data-p","al,,0,b,,0,,,-1,,,-1,");}
oResult.push(oCurrent);bOk=true;}}
if(!bOk)
{if(oCurrent.nodeType==3)
{if(_oControl.maTextNodes==null)
{_oControl.maTextNodes=new Array();}
_oControl.maTextNodes.push(oCurrent);}
else if(oCurrent.nodeType==1)
{if(oCurrent.attributes["class"]&&oCurrent.attributes["class"].value=="BG")
{_oControl.moBgDiv=oCurrent;}
else if(oCurrent.id==_oControl.id+"_img")
{_oControl.moLinkedImage=oCurrent;}}
var oChildren=oCurrent.childNodes;if(oChildren)
{for(var oNode in oChildren)
{oNodesToSearch.push(oChildren[oNode]);}}}}
return oResult;};ControlMgr.FindRootControl=function()
{var oRoot=$("BodyContent").firstChild;while(oRoot.id=="")
{oRoot=oRoot.firstChild;}
return oRoot;};ControlMgr.Const={MGR_NAME:"Control"};ControlMgr.prototype={GetControl:function(_sID,_sType)
{if(!(_sID in this.moObjects))
{var oObj=null;switch(_sType)
{case AudioCtrl.Const.CONTROL_NAME:{oObj=new AudioCtrl(_sID);break;}
case AutoCompletionCtrl.Const.CONTROL_NAME:{oObj=new AutoCompletionCtrl(_sID);break;}
case ButtonCtrl.Const.CONTROL_NAME:{oObj=new ButtonCtrl(_sID);break;}
case CheckBoxCtrl.Const.CONTROL_NAME:{oObj=new CheckBoxCtrl(_sID);break;}
case CropCtrl.Const.CONTROL_NAME:{oObj=new CropCtrl(_sID);break;}
case DateCtrl.Const.CONTROL_NAME:{oObj=new DateCtrl(_sID);break;}
case DropDownListCtrl.Const.CONTROL_NAME:{oObj=new DropDownListCtrl(_sID);break;}
case FlashCtrl.Const.CONTROL_NAME:{oObj=new FlashCtrl(_sID);break;}
case ImageCtrl.Const.CONTROL_NAME:{oObj=new ImageCtrl(_sID);break;}
case LabelCtrl.Const.CONTROL_NAME:{oObj=new LabelCtrl(_sID);break;}
case MenuCtrl.Const.CONTROL_NAME:{oObj=new MenuCtrl(_sID);break;}
case PanelAdvancedCtrl.Const.CONTROL_NAME:{oObj=new PanelAdvancedCtrl(_sID);break;}
case RadioButtonListCtrl.Const.CONTROL_NAME:{oObj=new RadioButtonListCtrl(_sID);break;}
case TextAreaCtrl.Const.CONTROL_NAME:{oObj=new TextAreaCtrl(_sID);break;}
case TextBoxCtrl.Const.CONTROL_NAME:{oObj=new TextBoxCtrl(_sID);break;}
case TextBoxPasswordCtrl.Const.CONTROL_NAME:{oObj=new TextBoxPasswordCtrl(_sID);break;}
case HyperlinkCtrl.Const.CONTROL_NAME:{oObj=new HyperlinkCtrl(_sID);break;}
case PanelTableCtrl.Const.CONTROL_NAME:{oObj=new PanelTableCtrl(_sID);break;}
case UploadCtrl.Const.CONTROL_NAME:{oObj=new UploadCtrl(_sID);break;}
case UploadFieldCtrl.Const.CONTROL_NAME:{oObj=new UploadFieldCtrl(_sID);break;}
case Popup.Const.CONTROL_NAME:{oObj=new Popup($(_sID),true);break;}
case MapCtrl.Const.CONTROL_NAME:{oObj=new MapCtrl(_sID);break;}
case MapMarkerCtrl.Const.CONTROL_NAME:{oObj=new MapMarkerCtrl(_sID);break;}
case TimeCtrl.Const.CONTROL_NAME:{oObj=new TimeCtrl(_sID);break;}
case HiddenCtrl.Const.CONTROL_NAME:{oObj=new HiddenCtrl(_sID);break;}
case VideoCtrl.Const.CONTROL_NAME:{oObj=new VideoCtrl(_sID);break;}
case PanelColCtrl.Const.CONTROL_NAME:{oObj=new PanelColCtrl(_sID);break;}
case SlideshowCtrl.Const.CONTROL_NAME:{oObj=new SlideshowCtrl(_sID);break;}
default:{throw"Cannot find the control "+_sType+" ("+_sID+")";}}
this.moObjects[_sID]=oObj;Matrix3.RegisterInCache(_sID,ControlMgr);}
return this.moObjects[_sID];},Refresh:function()
{this.moObjects=new Object();},RefreshNode:function(_sID)
{delete(this.moObjects[_sID]);this.RemovePositionItem(_sID);},CreateControl:function(_oControls,_oParentControl,_iDepth)
{var oDiv;if(_iDepth==null)
{_iDepth=0;}
var oResult;if(_oControls==null)
{oDiv=ControlMgr.FindRootControl();this.moRootPositionItem=oDiv;}
else
{oDiv=_oControls;}
var oProperties=null;var aChildren=ControlMgr.FindControlChildren(oDiv,_iDepth);if(oDiv.attributes["data-r"])
{oProperties=JSON.parse(oDiv.attributes["data-r"].value);}
var aoToPopulate=new Array();var aaChildrens=new Array();var oSplitter=/,/g;var sType=PositionItem.GetType(oDiv.attributes["class"].value);var oPos="";if(oDiv.attributes["class"].value=="ABS")
{var oOldVForm=ControlMgr.GetInstance().GetPositionItem(oDiv.id);if(oOldVForm!=null)
{oPos=oDiv.attributes["data-p"].value=oOldVForm.attributes["data-p"].value;}}
if(oDiv.attributes["data-p"]==null)
{oDiv.setAttribute("data-p","al,,0,b,,0,,,-1,,,-1,");}
else
{oPos=oDiv.attributes['data-p'].value;}
var oTabPos=oPos.split(oSplitter);oDiv.Setup(oDiv,sType,oTabPos[0],oTabPos[2],oTabPos[3],oTabPos[5],oTabPos[8],oTabPos[11],oTabPos[1],oTabPos[4],oTabPos[6],oTabPos[9],oTabPos[7],oTabPos[10],oProperties);this.moPropertyQueue.push(oDiv);if(_oParentControl!=null)
{oDiv.SetDeep(_oParentControl.miDeep+1);oDiv.moParent=_oParentControl;}
else
{oDiv.SetDeep(_iDepth);}
if(aChildren.length>0)
{aoToPopulate.push(oDiv);aaChildrens.push(aChildren);}
if(_oParentControl!=null)
{_oParentControl.GetContainerForChildren().push(oDiv);}
this.AddPositionItem(oDiv);oResult=oDiv;while(aoToPopulate.length>0)
{var oParentControl=aoToPopulate.shift();var aChildrens=aaChildrens.shift();for(var aChildrenDefinition in aChildrens)
{aChildrenDefinition=aChildrens[aChildrenDefinition];oProperties=null;aChildren=ControlMgr.FindControlChildren(aChildrenDefinition,oParentControl.miDeep+1);var sType=PositionItem.GetType(aChildrenDefinition.attributes["class"].value);if(aChildrenDefinition!=null)
{var oPos="";if(aChildrenDefinition.attributes['data-p'])
{oPos=aChildrenDefinition.attributes['data-p'].value;}
var oTabPos=oPos.split(oSplitter);if(aChildrenDefinition.attributes["data-r"])
{oProperties=JSON.parse(aChildrenDefinition.attributes["data-r"].value);}
aChildrenDefinition.Setup(aChildrenDefinition,sType,oTabPos[0],oTabPos[2],oTabPos[3],oTabPos[5],oTabPos[8],oTabPos[11],oTabPos[1],oTabPos[4],oTabPos[6],oTabPos[9],oTabPos[7],oTabPos[10],oProperties,oParentControl);this.moPropertyQueue.push(aChildrenDefinition);aChildrenDefinition.miDeep=oParentControl.miDeep+1;if(aChildren.length>0)
{aoToPopulate.push(aChildrenDefinition);aaChildrens.push(aChildren);}
oParentControl.GetContainerForChildren().push(aChildrenDefinition);this.AddPositionItem(aChildrenDefinition);}}}
return oResult;},ApplyPropertyQueue:function()
{for(var i=0;i<this.moPropertyQueue.length;i++)
{this.moPropertyQueue[i].ApplyProperties();}
this.moPropertyQueue=new Array();},AddReference:function(_sFlashID,_oControl)
{if(_sFlashID!=null)
{if(!this.moNewReferences.hasOwnProperty(_sFlashID)&&this.moReferences.hasOwnProperty(_sFlashID)&&_sFlashID!=ConstValues.Const.SUPER_CONTAINER)
{var oReplacedReference=this.moReferences[_sFlashID];}
this.moReferences[_sFlashID]=_oControl;this.moNewReferences[_sFlashID]=_oControl;}},RemoveReference:function(_sFlashID)
{if(!this.moNewReferences.hasOwnProperty(_sFlashID))
{delete this.moReferences[_sFlashID];}},Get:function(_sControlID)
{return this.moObjects[_sControlID];},GetReference:function(_sFlashID)
{return this.moReferences[_sFlashID];},GetAllPositionItems:function()
{return this.moHash;},GetAllControls:function()
{return this.moObjects;},AddPositionItem:function(_oPositionItem)
{var sID=_oPositionItem.GetId();if(this.moHash.hasOwnProperty(sID))
{this.moOldHash[sID]=this.moHash[sID];}
this.moHash[sID]=_oPositionItem;if(_oPositionItem.msCtrlType==PositionItem.Const.CONTROL_TYPE_PANEL)
{var sAlternativeID=_oPositionItem.GetAlternativeID();if(sAlternativeID!=null)
{if(this.moHash.hasOwnProperty(sAlternativeID))
{this.moOldHash[sAlternativeID]=this.moHash[sAlternativeID];}
this.moHash[sAlternativeID]=_oPositionItem;}}},GetRootPositionItem:function()
{return this.moRootPositionItem;},GetPositionItem:function(_sId,_bSearchOnlyInOldInstance)
{var oResult=null;if(_sId!=null)
{if(_bSearchOnlyInOldInstance)
{oResult=this.moOldHash[_sId];}
else
{oResult=this.moHash[_sId];}}
return oResult;},RemovePositionItem:function(_oPositionItem)
{var sID=_oPositionItem;if(_oPositionItem.GetId)
{sID=_oPositionItem.GetId();}
if(!(sID in this.moOldHash))
{delete this.moHash[sID];if(_oPositionItem.GetProperty)
{var sFlashID=_oPositionItem.GetProperty(ConstProperties.Const.FLASH_ID);if(sFlashID!=null)
{this.RemoveReference(sFlashID);}}}
if(_oPositionItem.msCtrlType==PositionItem.Const.CONTROL_TYPE_PANEL&&_oPositionItem.GetAlternativeID)
{var sAlternativeID=_oPositionItem.GetAlternativeID();if(sAlternativeID!=null)
{if(!(sAlternativeID in this.moOldHash))
{delete this.moHash[sAlternativeID];}}}},ClearOldInstance:function()
{this.moOldHash=new Object();this.moNewReferences=new Object();},ReInit:function()
{ControlMgr.moSingleton=new ControlMgr();}};function ControlsUtils()
{this.moKeywords=new RegExp("if|else|Math\.min|Math\.max|Math\.floor|Math\.round|return|[&\|()+*/<>=,;{}-]","g");}
ControlsUtils.moSingleton=null;ControlsUtils.GetInstance=function()
{if(!ControlsUtils.moSingleton)
{ControlsUtils.moSingleton=new ControlsUtils();}
return ControlsUtils.moSingleton;};ControlsUtils.prototype={GetAdvencedPosKeywordsRegex:function()
{return this.moKeywords;}}
function CtrlEventMgr()
{this.moBroadcastToChannel=new Object();this.moChannelToBroadcast=new Object();this.moObjectReference=new Object();}
CtrlEventMgr.moSingleton=null;CtrlEventMgr.GetInstance=function()
{if(!CtrlEventMgr.moSingleton)
{CtrlEventMgr.moSingleton=new CtrlEventMgr();}
return CtrlEventMgr.moSingleton;};CtrlEventMgr.Const={ALL:"*",SUFFIX_SETUP:"_Setup",MGR_NAME:"CtrlEvent"};CtrlEventMgr.prototype={AddEvent:function(_oObj,_sEvent,_sBroadcast,_sChannel,_sArgs)
{if(_oObj[_sEvent+CtrlEventMgr.Const.SUFFIX_SETUP])
{_oObj[_sEvent+CtrlEventMgr.Const.SUFFIX_SETUP].call(_oObj,_sArgs);}
if(_oObj[_sEvent]instanceof CtrlEvent)
{_oObj[_sEvent].Subscribe(function()
{CtrlEventMgr.GetInstance().Broadcast(_sBroadcast,_sChannel);});}},AddAction:function(_oObj,_sFunc,_sBroadcast,_sChannel,_sArgs)
{var oFunc=function()
{if(_oObj[_sFunc])
{_oObj[_sFunc](_sArgs);}};if(!(this.moObjectReference[_oObj.msID]instanceof Array))
{this.moObjectReference[_oObj.msID]=new Array();}
if(_oObj[_sFunc+CtrlEventMgr.Const.SUFFIX_SETUP])
{_oObj[_sFunc+CtrlEventMgr.Const.SUFFIX_SETUP](_sArgs);}
if(!this.moBroadcastToChannel[_sBroadcast])
{this.moBroadcastToChannel[_sBroadcast]=new Object();}
if(!this.moBroadcastToChannel[_sBroadcast][_sChannel])
{this.moBroadcastToChannel[_sBroadcast][_sChannel]=new Array();}
this.moBroadcastToChannel[_sBroadcast][_sChannel].push(oFunc);this.moObjectReference[_oObj.msID].push(new Array(_sBroadcast,_sChannel,this.moBroadcastToChannel[_sBroadcast][_sChannel].length-1));Matrix3.RegisterInCache(_oObj.msID,CtrlEventMgr);if(!this.moChannelToBroadcast[_sChannel])
{this.moChannelToBroadcast[_sChannel]=new Object();}
if(!this.moChannelToBroadcast[_sChannel][_sBroadcast])
{this.moChannelToBroadcast[_sChannel][_sBroadcast]=new Array();}
this.moChannelToBroadcast[_sChannel][_sBroadcast].push(oFunc);},Broadcast:function(_sBroadcast,_sChannel)
{if(CtrlEventMgr.Const.ALL in this.moBroadcastToChannel)
{var oHash=this.moBroadcastToChannel[CtrlEventMgr.Const.ALL];for(var sChan in oHash)
{var oArray=this.moBroadcastToChannel[_sBroadcast][sChan];if(oArray instanceof Array)
{for(var i=0;i<oArray.length;i++)
{if(oArray[i])
{oArray[i]();}}}}}
if(CtrlEventMgr.Const.ALL in this.moChannelToBroadcast)
{var oHash=this.moChannelToBroadcast[CtrlEventMgr.Const.ALL];for(var sBroad in oHash)
{var oArray=this.moChannelToBroadcast[_sChannel][sBroad];if(oArray instanceof Array)
{for(var i=0;i<oArray.length;i++)
{if(oArray[i])
{oArray[i]();}}}}}
if(this.moBroadcastToChannel[_sBroadcast]&&this.moBroadcastToChannel[_sBroadcast][_sChannel])
{var oArray=this.moBroadcastToChannel[_sBroadcast][_sChannel];if(oArray instanceof Array)
{for(var i=0;i<oArray.length;i++)
{if(oArray[i])
{oArray[i]();}}}}},RefreshNode:function(_sID)
{var oArray=this.moObjectReference[_sID];for(var i=0;i<oArray.length;i++)
{this.moChannelToBroadcast[oArray[i][1]][oArray[i][0]][oArray[i][2]]=null;this.moBroadcastToChannel[oArray[i][0]][oArray[i][1]][oArray[i][2]]=null;}}};function CtrlEvent(_oObj,_oActivateFunc)
{this.moObject=_oObj;this.moActivatedFunc=_oActivateFunc;this.moFunc=new Array();}
CtrlEvent.prototype={Subscribe:function(_oFunc)
{if(!this.mbActivatedEvt)
{if(this.moActivatedFunc)
{this.moActivatedFunc.call(this.moObject);}
this.mbActivatedEvt=true;}
this.moFunc.push(_oFunc);},Fire:function()
{for(var i=0;i<this.moFunc.length;i++)
{this.moFunc[i]();}}};function Dependency(_oSource,_oDest,_iType,_iSubType,_sAlignment,_iAxis)
{this.moSource=_oSource;this.moDest=_oDest;this.miType=_iType;this.miSubType=_iSubType;this.miAlignment=Dependency.StringAlignmentToInt(_sAlignment);this.miAxis=_iAxis;if(this.miAxis==Dependency.Const.AXIS_X)
{this.moSource.AddXDependent(this);this.moDest.AddXSource(this);}
else
{this.moSource.AddYDependent(this);this.moDest.AddYSource(this);}}
Dependency.Const={TYPE_PARENT:0,TYPE_PREVIOUS:1,TYPE_REFERENCE:2,TYPE_SCREEN:3,SUBTYPE_NONE:-1,SUBTYPE_POS:0,SUBTYPE_SIZE:1,ALIGNMENT_NONE:-1,ALIGNMENT_TOP:0,ALIGNMENT_ALIGN_TOP:1,ALIGNMENT_CENTER:2,ALIGNMENT_ALIGN_BOTTOM:3,ALIGNMENT_BOTTOM:4,ALIGNMENT_LEFT:5,ALIGNMENT_ALIGN_LEFT:6,ALIGNMENT_ALIGN_RIGHT:7,ALIGNMENT_RIGHT:8,ALIGNMENT_INTERNAL:9,AXIS_X:0,AXIS_Y:1};Dependency.StringAlignmentToInt=function(_sAlignment)
{var iResult=Dependency.ConstALIGNMENT_NONE;if(Utils.IsStringFilled(_sAlignment))
{switch(_sAlignment)
{case PositionItem.Const.XTYPE_TO_LEFT:iResult=Dependency.Const.ALIGNMENT_LEFT;break;case PositionItem.Const.XTYPE_ALIGN_LEFT:iResult=Dependency.Const.ALIGNMENT_ALIGN_LEFT;break;case PositionItem.Const.XTYPE_CENTER:iResult=Dependency.Const.ALIGNMENT_CENTER;break;case PositionItem.Const.XTYPE_TO_RIGHT:iResult=Dependency.Const.ALIGNMENT_RIGHT;break;case PositionItem.Const.XTYPE_ALIGN_RIGHT:iResult=Dependency.Const.ALIGNMENT_ALIGN_RIGHT;break;case PositionItem.Const.YTYPE_TO_TOP:iResult=Dependency.Const.ALIGNMENT_TOP;break;case PositionItem.Const.YTYPE_ALIGN_TOP:iResult=Dependency.Const.ALIGNMENT_ALIGN_TOP;break;case PositionItem.Const.YTYPE_CENTER:iResult=Dependency.Const.ALIGNMENT_CENTER;break;case PositionItem.Const.YTYPE_TO_BOTTOM:iResult=Dependency.Const.ALIGNMENT_BOTTOM;break;case PositionItem.Const.YTYPE_ALIGN_BOTTOM:iResult=Dependency.Const.ALIGNMENT_ALIGN_BOTTOM;break;case PositionItem.Const.WIDTHTYPE_INTERNAL:iResult=Dependency.Const.ALIGNMENT_INTERNAL;break;case PositionItem.Const.HEIGHTTYPE_INTERNAL:iResult=Dependency.Const.ALIGNMENT_INTERNAL;break;default:iResult=Dependency.Const.ALIGNMENT_NONE;break;}}
return iResult;};Dependency.prototype={ReplaceSource:function(_oNewSource,_bRemoveFromOldSource)
{if(_bRemoveFromOldSource==null)
{_bRemoveFromOldSource=true;}
if(this.miAxis==Dependency.Const.AXIS_X)
{if(_bRemoveFromOldSource)
{this.moSource.RemoveXDependent(this);}
this.moSource=_oNewSource;this.moSource.AddXDependent(this);}
else
{if(_bRemoveFromOldSource)
{this.moSource.RemoveYDependent(this);}
this.moSource=_oNewSource;this.moSource.AddYDependent(this);}},ReplaceDestination:function(_oNewDestination,_bRemoveFromOldDestination)
{if(_bRemoveFromOldDestination==null)
{_bRemoveFromOldDestination=true;}
if(this.miAxis==Dependency.Const.AXIS_X)
{if(_bRemoveFromOldDestination)
{this.moDest.RemoveXSource(this);}
this.moDest=_oNewDestination;this.moDest.AddXSource(this);}
else
{if(_bRemoveFromOldDestination)
{this.moDest.RemoveYSource(this);}
this.moDest=_oNewDestination;this.moDest.AddYSource(this);}},Delete:function(_bRemoveFromSource,_bRemoveFromDestination)
{if(_bRemoveFromSource==null)
{_bRemoveFromSource=true;}
if(_bRemoveFromDestination==null)
{_bRemoveFromDestination=true;}
if(this.miAxis==Dependency.Const.AXIS_X)
{if(_bRemoveFromSource)
{this.moSource.RemoveXDependent(this);}
if(_bRemoveFromDestination)
{this.moDest.RemoveXSource(this);}}
else
{if(_bRemoveFromSource)
{this.moSource.RemoveYDependent(this);}
if(_bRemoveFromDestination)
{this.moDest.RemoveYSource(this);}}},GetSource:function()
{return this.moSource;},GetDestination:function()
{return this.moDest;},GetType:function()
{return this.miType;},GetSubType:function()
{return this.miSubType;},GetAlignment:function()
{return this.miAlignment;},GetAxis:function()
{return this.miAxis;},toString:function()
{var sIDBuilder=new StringBuilder();sIDBuilder.append(this.moSource.GetId()+" to "+this.moDest.GetId()+"   type "+this.miType);return sIDBuilder.toString();}}
function HistoryMgr(){}
HistoryMgr.moInstance=null;HistoryMgr.GetInstance=function()
{if(!HistoryMgr.moInstance){HistoryMgr.moInstance=new HistoryMgr();}
return HistoryMgr.moInstance;};HistoryMgr.prototype={Init:function()
{this.msCurrentH=this.msOriginH=Matrix3.msURL;window.onhashchange=function()
{HistoryMgr.GetInstance().HashChanged(window.location.hash);}},HashChanged:function(_sNewH)
{if(!_sNewH||_sNewH=="#/"||_sNewH=="#/.")
{_sNewH=this.msOriginH;}
else
{_sNewH=_sNewH.substring(2);}
if(_sNewH!=this.msCurrentH)
{this.msCurrentH=_sNewH;Matrix3.LoadFullPage(HistoryMgr.GetURLFromH(_sNewH));}},UpdateHash:function(_sH)
{if(!_sH||_sH==this.msOriginH)
{_sH="";}
this.msCurrentH=_sH;window.location.hash="#/"+_sH;}}
HistoryMgr.GetURLFromH=function(_sH)
{var sResult;var sPrefix=_sH.substring(0,7);if(sPrefix!="http://"&&sPrefix!="https:/")
{sResult=document.baseURI;if(sResult.substring(0,7)=="http://")
{sResult+="C.aspx?VP3="+_sH;}
else
{sResult+="CS.aspx?VP3="+_sH;}}
else
{sResult=_sH;}
return sResult;}
ImageMgr.ControlImageLoaded=function(_oEvent,_oControl)
{var oImgElem=_oControl.moLinkedImage;if(oImgElem!=null)
{var iImageW=oImgElem.width;var iImageH=oImgElem.height;if(oImgElem.miImgW!=iImageW||oImgElem.miImgH!=iImageH)
{oImgElem.miImgW=iImageW;oImgElem.miImgH=iImageH;if(_oControl.GetOriginalWidth()==-1||_oControl.GetOriginalHeight()==-1)
{PositionMgr.GetInstance().AddToDirtyXList(_oControl);PositionMgr.GetInstance().AddToDirtyYList(_oControl);_oControl.ForceHasChanged();delete ImageMgr.GetInstance().maLoadingQueue[_oControl.GetId()];ImageMgr.GetInstance().miCpt--;if(!ImageMgr.GetInstance().miTimeout)
{if(ImageMgr.GetInstance().miCpt>0)
{ImageMgr.GetInstance().miTimeout=setTimeout(function(){ImageMgr.LaunchRepositioning()},500);}
else
{ImageMgr.GetInstance().miTimeout=setTimeout(function(){ImageMgr.LaunchRepositioning()},10);}}
else
{if(ImageMgr.GetInstance().miCpt==0)
{clearTimeout(ImageMgr.GetInstance().miTimeout);ImageMgr.GetInstance().miTimeout=setTimeout(function(){ImageMgr.LaunchRepositioning()},10);}}}
else
{if(_oControl.moProperties&&_oControl.moProperties.hasOwnProperty(AutoScaleProperties.Const.PROPERTY_POLICY))
{AutoScaleProperties.Apply(_oControl);}}}}}
ImageMgr.LaunchRepositioning=function()
{ImageMgr.GetInstance().miTimeout=null;if(!Matrix3.mbEvent)
{PositionMgr.GetInstance().CalculatePosition();}}
function ImageMgr()
{this.maLoadingQueue=new Object();this.miCpt=0;this.miTimeout;}
ImageMgr.Const={MGR_NAME:"Image"};ImageMgr.moSingleton=null;ImageMgr.GetInstance=function()
{if(!ImageMgr.moSingleton){ImageMgr.moSingleton=new ImageMgr();}
return ImageMgr.moSingleton;};ImageMgr.prototype={Push:function(_oImage,_oParent)
{if((_oParent.GetOriginalWidth()==-1||_oParent.GetOriginalHeight()==-1)&&!this.maLoadingQueue.hasOwnProperty(_oParent.GetId()))
{this.maLoadingQueue[_oParent.GetId()]=true;this.miCpt++;}
Utils.AddEvent(_oImage,"load",ImageMgr.ControlImageLoaded,this,_oParent);}}
function PositionItem()
{this.msId;this.msAdvancedX;this.masXTypes;this.miXOff;this.miOriginalXOff;this.msReferenceX;this.msAdvancedY;this.masYTypes;this.miYOff;this.miOriginalYOff;this.msReferenceY;this.msAdvancedWidth;this.msWidthType;this.miWidth;this.msWidthReference;this.miOriginalWidth;this.msAdvancedHeight;this.msHeightType;this.miHeight;this.msHeightReference;this.miOriginalHeight;this.mbEthereal;this.miPositionBroadcastMarker;this.moProperties;this.miDeep=0;this.masStyles;this.moXDependents;this.moXSources;this.moYDependents;this.moYSources;this.moQuickXSource;this.moQuickWSource;this.moQuickYSource;this.moQuickHSource;this.mbUpdateStyle;this.mbXMustBeCalculated;this.mbYMustBeCalculated;this.moActivatedProperties;this.moSuperContainer;this.msCtrlType;this.miPrePosX;this.miPrePosY;this.moBgDiv;this.maTextNodes;this.maiActualColWidth=new Array();this.maiColWidth=new Array();this.mabCanGrow=new Array();}
PositionItem.Const={PROPERTY_ADVANCED_X:"aFx",PROPERTY_ADVANCED_Y:"aFy",PROPERTY_ADVANCED_WIDTH:"aFw",PROPERTY_ADVANCED_HEIGHT:"aFh",KEY_PREVIOUS:"_PREVIOUS_",KEY_DEFAULT:"_DEFAULT_",XTYPE_TO_RIGHT:"r",XTYPE_TO_LEFT:"l",XTYPE_ALIGN_RIGHT:"ar",XTYPE_ALIGN_LEFT:"al",XTYPE_CENTER:"c",TYPE_WIDTH:"width",TYPE_HEIGHT:"height",YTYPE_TO_TOP:"t",YTYPE_TO_BOTTOM:"b",YTYPE_ALIGN_TOP:"at",YTYPE_ALIGN_BOTTOM:"ab",YTYPE_CENTER:"c",WIDTHTYPE_INTERNAL:"i",HEIGHTTYPE_INTERNAL:"i",L_FLOAT_LAYOUT:"float",REF_PARENT:"_parent",REF_SCREEN:"screen",REF_ANCESTOR_PREFIX:"_ancestor:",DEFAULT_SCROLLBAR_SKIN:"ScrollBar_Default",POSITIONING_LOOP_THRESHOLD:500,CONTROL_TYPE_AJAXBUTTON_BUY:"AjaxButtonBuy",CONTROL_TYPE_ANCHOR:"Anchor",CONTROL_TYPE_AUDIO:"Audio",CONTROL_TYPE_AUTOCOMPLETION:"AutoCompletion",CONTROL_TYPE_BUTTON:"Button",CONTROL_TYPE_CHECKBOX:"CheckBox",CONTROL_TYPE_CROP:"Crop",CONTROL_TYPE_DATE:"Date",CONTROL_TYPE_DATE_TIME:"DateTime",CONTROL_TYPE_DATE_INTERVAL:"DateInterval",CONTROL_TYPE_DATE_INTERVAL_TIME:"DateIntervalTime",CONTROL_TYPE_DROPDOWNLIST:"DropDownList",CONTROL_TYPE_FLASH:"Flash",CONTROL_TYPE_FLOAT_PANEL:"FloatPanel",CONTROL_TYPE_FREE_HTML:"FreeHTML",CONTROL_TYPE_HIDDEN:"Hidden",CONTROL_TYPE_HYPERLINK:"Hyperlink",CONTROL_TYPE_IFRAME:"IFrame",CONTROL_TYPE_IMAGE:"Image",CONTROL_TYPE_MEDIA:"Media",CONTROL_TYPE_LABEL:"Label",CONTROL_TYPE_LABELBO:"LabelBO",CONTROL_TYPE_PANEL:"Panel",CONTROL_TYPE_POPUP:"Popup",CONTROL_TYPE_PANEL_TABLE:"PanelTable",CONTROL_TYPE_PANEL_COL:"PanelCol",CONTROL_TYPE_PANEL_LINE:"PanelLine",CONTROL_TYPE_PARAMETER_BOOL:"ParameterBool",CONTROL_TYPE_PARAMETER_ENUM:"ParameterEnum",CONTROL_TYPE_PARAMETER_NUM:"ParameterNum",CONTROL_TYPE_PARAMETER_STR:"ParameterStr",CONTROL_TYPE_PROGRESS_BAR:"ProgressBar",CONTROL_TYPE_RADIOBUTTON_LIST:"RadioButtonList",CONTROL_TYPE_SLIDESHOW:"Slideshow",CONTROL_TYPE_SECTION_HEADER:"SectionHeader",CONTROL_TYPE_TEXTAREA:"TextArea",CONTROL_TYPE_TEXTBOX:"TextBox",CONTROL_TYPE_TEXTBOXPASSWORD:"TextBoxPassword",CONTROL_TYPE_TIMER:"Timer",CONTROL_TYPE_TIME:"Time",CONTROL_TYPE_MENU:"Menu",CONTROL_TYPE_MENU_ITEM:"MenuItem",CONTROL_TYPE_UPLOAD:"Upload",CONTROL_TYPE_UPLOAD_FIELD:"UploadField",CONTROL_TYPE_VIDEO:"Video",CONTROL_TYPE_YOUTUBE:"Youtube"};PositionItem.GetType=function(_sType,aChildrenDefinition)
{var sResult;if(_sType=="ABS"||_sType.substring(0,4)=="ABS ")
{sResult=PositionItem.Const.CONTROL_TYPE_PANEL;}
else if((_sType.indexOf("CT")>=0)||(_sType.indexOf("PanelCol")>=0)||(_sType.indexOf("PanelLine")>=0))
{if(_sType.indexOf("CT")==0)
{_sType=_sType.substring(3).split(" ")[0];}
else if(_sType.indexOf("ClearFixC CT")==0)
{_sType=_sType.substring(13).split(" ")[0];}
else
{_sType=_sType.split(" ")[0];}
switch(_sType)
{case"Label":sResult=PositionItem.Const.CONTROL_TYPE_LABEL;break;case"Panel":sResult=PositionItem.Const.CONTROL_TYPE_PANEL;break;case"PanelFloat":sResult=PositionItem.Const.CONTROL_TYPE_FLOAT_PANEL;break;case"PanelTable":sResult=PositionItem.Const.CONTROL_TYPE_PANEL_TABLE;break;case"Hyperlink":sResult=PositionItem.Const.CONTROL_TYPE_HYPERLINK;break;case"TextBox":sResult=PositionItem.Const.CONTROL_TYPE_TEXTBOX;break;case"TextArea":sResult=PositionItem.Const.CONTROL_TYPE_TEXTAREA;break;case"TextBoxPassword":sResult=PositionItem.Const.CONTROL_TYPE_TEXTBOXPASSWORD;break;case"DropDownList":sResult=PositionItem.Const.CONTROL_TYPE_DROPDOWNLIST;break;case"Button":sResult=PositionItem.Const.CONTROL_TYPE_BUTTON;break;case"Anchor":sResult=PositionItem.Const.CONTROL_TYPE_ANCHOR;break;case"IFrame":sResult=PositionItem.Const.CONTROL_TYPE_IFRAME;break;case"Image":sResult=PositionItem.Const.CONTROL_TYPE_IMAGE;break;case"AutoComp":sResult=PositionItem.Const.CONTROL_TYPE_AUTOCOMPLETION;break;case"PanelCol":sResult=PositionItem.Const.CONTROL_TYPE_PANEL_COL;break;case"PanelLine":sResult=PositionItem.Const.CONTROL_TYPE_PANEL_LINE;break;case"RadioButtonList":sResult=PositionItem.Const.CONTROL_TYPE_RADIOBUTTON_LIST;break;case"Slideshow":sResult=PositionItem.Const.CONTROL_TYPE_SLIDESHOW;break;case"CheckBox":sResult=PositionItem.Const.CONTROL_TYPE_CHECKBOX;break;case"Date":sResult=PositionItem.Const.CONTROL_TYPE_DATE;break;default:{sResult=_sType;break;}}}
else if(_sType.indexOf("DefaultPopupClass")>-1||_sType.indexOf("PopupContentClass")>-1)
{sResult=PositionItem.Const.CONTROL_TYPE_PANEL;}
else if(_sType.indexOf("VForm_PopupWrapper")>-1)
{sResult=PositionItem.Const.CONTROL_TYPE_POPUP;}
return sResult;}
PositionItem.TransformStringArrayToInt=function(_oArray)
{for(var i=0;i<_oArray.length;i++)
{_oArray[i]=parseInt(_oArray[i]);}}
PositionItem.TranslateAdvancedPosExpression=function(_sOriginal)
{var sTranslation=_sOriginal.replace(/return /g,"");sTranslation=sTranslation.replace(/min\(/g,"Math.min(");sTranslation=sTranslation.replace(/max\(/g,"Math.max(");sTranslation=sTranslation.replace(/floor\(/g,"Math.floor(");sTranslation=sTranslation.replace(/round\(/g,"Math.round(");return sTranslation;}
HTMLElement.prototype.Setup=function Setup(_oDiv,_sCtrlType,_sXType,_sXOff,_sYType,_sYOff,_sWidth,_sHeight,_sReferenceX,_sReferenceY,_sWidthType,_sHeightType,_sWidthReference,_sHeightReference,_oProperties,_oParent)
{this.moContainerForChildrens=new Array();this.x=0;this.y=0;this.miCachedPaddingLeft=-1;this.miCachedPaddingRight=-1;this.miCachedPaddingTop=-1;this.miCachedPaddingBottom=-1;this.msId=_oDiv.id;if(_oDiv.attributes!=null&&_oDiv.attributes["data-pid"]!=null)
{this.msId=_oDiv.attributes["data-pid"].value;}
this.msCtrlType=_sCtrlType;this.moProperties=_oProperties;this.moParent=_oParent;this.msAdvancedX=this.GetProperty(PositionItem.Const.PROPERTY_ADVANCED_X);this.msAdvancedY=this.GetProperty(PositionItem.Const.PROPERTY_ADVANCED_Y);this.msAdvancedWidth=this.GetProperty(PositionItem.Const.PROPERTY_ADVANCED_WIDTH);this.msAdvancedHeight=this.GetProperty(PositionItem.Const.PROPERTY_ADVANCED_HEIGHT);if(this.msAdvancedX!=null)this.msAdvancedX=PositionItem.TranslateAdvancedPosExpression(this.msAdvancedX);if(this.msAdvancedY!=null)this.msAdvancedY=PositionItem.TranslateAdvancedPosExpression(this.msAdvancedY);if(this.msAdvancedWidth!=null)this.msAdvancedWidth=PositionItem.TranslateAdvancedPosExpression(this.msAdvancedWidth);if(this.msAdvancedHeight!=null)this.msAdvancedHeight=PositionItem.TranslateAdvancedPosExpression(this.msAdvancedHeight);this.miXOff=parseInt(_sXOff);this.msReferenceX=new Array();this.masXTypes=new Array();if(Utils.IsStringFilled(_sReferenceX)&&!Utils.IsStringFilled(this.msAdvancedX))this.msReferenceX.push(_sReferenceX);if(Utils.IsStringFilled(_sXType)&&!Utils.IsStringFilled(this.msAdvancedX))this.masXTypes.push(_sXType);this.miYOff=parseInt(_sYOff);this.msReferenceY=new Array();this.masYTypes=new Array();if(Utils.IsStringFilled(_sReferenceY)&&!Utils.IsStringFilled(this.msAdvancedY))this.msReferenceY.push(_sReferenceY);if(Utils.IsStringFilled(_sYType)&&!Utils.IsStringFilled(this.msAdvancedY))this.masYTypes.push(_sYType);this.miWidth=parseInt(_sWidth);this.msWidthReference=new Array();this.msWidthType=new Array();if(Utils.IsStringFilled(_sWidthReference)&&!Utils.IsStringFilled(this.msAdvancedWidth))this.msWidthReference.push(_sWidthReference);if(Utils.IsStringFilled(_sWidthType)&&!Utils.IsStringFilled(this.msAdvancedWidth))this.msWidthType.push(_sWidthType);this.miHeight=parseInt(_sHeight);this.msHeightReference=new Array();this.msHeightType=new Array();if(Utils.IsStringFilled(_sHeightReference)&&!Utils.IsStringFilled(this.msAdvancedHeight))this.msHeightReference.push(_sHeightReference);if(Utils.IsStringFilled(_sHeightType)&&!Utils.IsStringFilled(this.msAdvancedHeight))this.msHeightType.push(_sHeightType);if(isNaN(this.miWidth))this.miWidth=0;if(isNaN(this.miHeight))this.miHeight=0;if(isNaN(this.miXOff))this.miXOff=0;if(isNaN(this.miYOff))this.miYOff=0;this.miOriginalWidth=this.miWidth;this.miOriginalHeight=this.miHeight;this.miOriginalXOff=this.miXOff;this.miOriginalYOff=this.miYOff;if(this.miWidth<0)
{this.miWidth=0;}
if(this.miHeight<0)
{this.miHeight=0;}
if(_oProperties!=null)
{if(_oProperties[ConstProperties.Const.COLUMNS_WIDTH])
{this.maiColWidth=_oProperties[ConstProperties.Const.COLUMNS_WIDTH].split(",");}
if(_oProperties[ConstProperties.Const.COLUMNS_CAN_GROW])
{this.mabCanGrow=eval("(["+_oProperties[ConstProperties.Const.COLUMNS_CAN_GROW]+"])");}}
if(this.maiColWidth==null)
{this.maiColWidth=new Array();}
if(this.mabCanGrow==null)
{this.mabCanGrow=new Array();}
PositionItem.TransformStringArrayToInt(this.maiColWidth);if(Utils.IsStringFilled(this.msAdvancedX))
{var sTempX=this.msAdvancedX;sTempX=sTempX.replace(ControlsUtils.GetInstance().GetAdvencedPosKeywordsRegex()," ");var sLastX=sTempX;do
{sLastX=sTempX;sTempX=sTempX.replace(/(^| )[0-9]+(\.[0-9]+)?( |$)/g," ");}while(sTempX!=sLastX);sTempX=sTempX.replace(/  +/g," ");sTempX=sTempX.replace(/(^ +)|( +$)/g,"");if(sTempX!="")
{var oReferences=sTempX.split(" ");for(var i=0;i<oReferences.length;i++)
{var sRef=oReferences[i];var asType=sRef.split(".");if(asType.length==1)
{if(asType[0]==PositionItem.Const.XTYPE_ALIGN_LEFT||asType[0]==PositionItem.Const.XTYPE_ALIGN_RIGHT||asType[0]==PositionItem.Const.XTYPE_CENTER||asType[0]==PositionItem.Const.XTYPE_TO_LEFT||asType[0]==PositionItem.Const.XTYPE_TO_RIGHT)
{this.msReferenceX.push(PositionItem.Const.KEY_PREVIOUS);this.masXTypes.push(asType[0]);}
else
{this.msReferenceX.push(asType[0]);this.masXTypes.push(PositionItem.Const.KEY_DEFAULT);}}
else
{this.msReferenceX.push(asType[0]);this.masXTypes.push(asType[1]);}}}}
if(Utils.IsStringFilled(this.msAdvancedY))
{var sTempY=this.msAdvancedY;sTempY=sTempY.replace(ControlsUtils.GetInstance().GetAdvencedPosKeywordsRegex()," ");var sLastY=sTempY;do
{sLastY=sTempY;sTempY=sTempY.replace(/(^| )[0-9]+(\.[0-9]+)?( |$)/g," ");}while(sTempY!=sLastY);sTempY=sTempY.replace(/  +/g," ");sTempY=sTempY.replace(/(^ +)|( +$)/g,"");if(sTempY!="")
{var oReferences=sTempY.split(" ");for(var i=0;i<oReferences.length;i++)
{var sRef=oReferences[i];var asType=sRef.split(".");if(asType.length==1)
{if(asType[0]==PositionItem.Const.YTYPE_ALIGN_BOTTOM||asType[0]==PositionItem.Const.YTYPE_ALIGN_TOP||asType[0]==PositionItem.Const.YTYPE_CENTER||asType[0]==PositionItem.Const.YTYPE_TO_BOTTOM||asType[0]==PositionItem.Const.YTYPE_TO_TOP)
{this.msReferenceY.push(PositionItem.Const.KEY_PREVIOUS);this.masYTypes.push(asType[0]);}
else
{this.msReferenceY.push(asType[0]);this.masYTypes.push(PositionItem.Const.KEY_DEFAULT);}}
else
{this.msReferenceY.push(asType[0]);this.masYTypes.push(asType[1]);}}}}
if(Utils.IsStringFilled(this.msAdvancedWidth))
{var sTempWidth=this.msAdvancedWidth;sTempWidth=sTempWidth.replace(ControlsUtils.GetInstance().GetAdvencedPosKeywordsRegex()," ");var sLastWidth=sTempWidth;do
{sLastWidth=sTempWidth;sTempWidth=sTempWidth.replace(/(^| )[0-9]+(\.[0-9]+)?( |$)/g," ");}while(sTempWidth!=sLastWidth);sTempWidth=sTempWidth.replace(/  +/g," ");sTempWidth=sTempWidth.replace(/(^ +)|( +$)/g,"");if(sTempWidth!="")
{var oReferences=sTempWidth.split(" ");for(var i=0;i<oReferences.length;i++)
{var sRef=oReferences[i];var asType=sRef.split(".");if(asType.length==1)
{if(asType[0]==PositionItem.Const.WIDTHTYPE_INTERNAL)
{this.msWidthReference.push(PositionItem.Const.KEY_PREVIOUS);this.msWidthType.push(asType[0]);}
else
{this.msWidthReference.push(asType[0]);this.msWidthType.push(PositionItem.Const.KEY_DEFAULT);}}
else
{this.msWidthReference.push(asType[0]);this.msWidthType.push(asType[1]);}}}}
if(Utils.IsStringFilled(this.msAdvancedHeight))
{var sTempHeight=this.msAdvancedHeight;sTempHeight=sTempHeight.replace(ControlsUtils.GetInstance().GetAdvencedPosKeywordsRegex()," ");var sLastHeight=sTempHeight;do
{sLastHeight=sTempHeight;sTempHeight=sTempHeight.replace(/(^| )[0-9]+(\.[0-9]+)?( |$)/g," ");}while(sTempHeight!=sLastHeight);sTempHeight=sTempHeight.replace(/  +/g," ");sTempHeight=sTempHeight.replace(/(^ +)|( +$)/g,"");if(sTempHeight!="")
{var oReferences=sTempHeight.split(" ");for(var i=0;i<oReferences.length;i++)
{var sRef=oReferences[i];var asType=sRef.split(".");if(asType.length==1)
{if(asType[0]==PositionItem.Const.HEIGHTTYPE_INTERNAL)
{this.msHeightReference.push(PositionItem.Const.KEY_PREVIOUS);this.msHeightType.push(asType[0]);}
else
{this.msHeightReference.push(asType[0]);this.msHeightType.push(PositionItem.Const.KEY_DEFAULT);}}
else
{this.msHeightReference.push(asType[0]);this.msHeightType.push(asType[1]);}}}}
this.miDeep=0;this.masStyles=new FastArray();this.mbUpdateStyle=true;this.mbXMustBeCalculated=true;this.mbYMustBeCalculated=true;this.moXDependents=new Array();this.moXSources=new Array();this.moYDependents=new Array();this.moYSources=new Array();this.moQuickXSource=null;this.moQuickWSource=null;this.moQuickYSource=null;this.moQuickHSource=null;this.moActivatedProperties=new Object();name=this.msId;this.moPlaceHolder=null;switch(this.msCtrlType)
{case PositionItem.Const.CONTROL_TYPE_FLOAT_PANEL:{this.mbHorizontalFlow=this.GetProperty(ConstProperties.Const.PROPERTY_FLOAT_DIRECTION,ConstProperties.Const.PROPERTY_VALUE_HORIZONTAL)==ConstProperties.Const.PROPERTY_VALUE_HORIZONTAL;var iForcedSpacing=this.GetProperty(ConstProperties.Const.PROPERTY_FLOAT_SPACING,0);if(this.mbHorizontalFlow)
{this.miForcedFlowSpacing=parseInt(this.GetProperty(ConstProperties.Const.PROPERTY_FLOAT_H_SPACING,iForcedSpacing));this.miForcedOrthgonalSpacing=parseInt(this.GetProperty(ConstProperties.Const.PROPERTY_FLOAT_V_SPACING,iForcedSpacing));}
else
{this.miForcedFlowSpacing=parseInt(this.GetProperty(ConstProperties.Const.PROPERTY_FLOAT_V_SPACING,iForcedSpacing));this.miForcedOrthgonalSpacing=parseInt(this.GetProperty(ConstProperties.Const.PROPERTY_FLOAT_H_SPACING,iForcedSpacing));}}
break;case PositionItem.Const.CONTROL_TYPE_PANEL:{if(this.GetProperty(ConstProperties.Const.IS_MENU))
{var oSelf=this;Matrix3.maPrePositionCalls.push(function(){MenuGroupMgr.ConfigureMenuControl(oSelf)});}
if(this.HasProperty(TooltipProperties.Const.PROPERTY_TOOLTIP_ID))
{TooltipProperties.ConfigureControl(this);}
this.mdFixedAspectRatio=this.GetFixedAspectRatio();this.mbFixedAspectRatio=(this.mdFixedAspectRatio!=-1)}
break;case PositionItem.Const.CONTROL_TYPE_HYPERLINK:case PositionItem.Const.CONTROL_TYPE_BUTTON:{if(this.miOriginalWidth==-1)
{$AddClass(this,"NoWrap");}
else if(this.maTextNodes&&this.msWidthReference.length==0)
{var oTextNode=this.maTextNodes[0].parentNode;var iHorizontalPadding=oTextNode.GetPaddingLeft()+oTextNode.GetPaddingRight();$SetStyle(oTextNode,"width",(this.miOriginalWidth-iHorizontalPadding)+"px");}
if(this.miOriginalHeight>0&&this.msHeightReference.length==0&&this.maTextNodes)
{var oTextNode=this.maTextNodes[0].parentNode;var iVerticalPadding=oTextNode.GetPaddingTop()+oTextNode.GetPaddingBottom();$SetStyle(oTextNode,"height",(this.miOriginalHeight-iVerticalPadding)+"px");}
if(this.moProperties)
{if(this.moProperties.hasOwnProperty(MultipleSourcesProperties.Const.PROPERTY_MULTIPLE_SOURCE))
{this.ActiveMultipleSources();}
if(this.moProperties.hasOwnProperty(ScrollTargetProperties.Const.PROPERTY_TARGET))
{new ScrollTargetProperties(this);}
if(this.moProperties.hasOwnProperty(ConstProperties.Const.SEQUENCE_LOADING_PREV)||this.moProperties.hasOwnProperty(ConstProperties.Const.SEQUENCE_LOADING_NEXT))
{SequenceLoadingMgr.GetInstance().RegisterButton(this);}}}
break;case PositionItem.Const.CONTROL_TYPE_IMAGE:{if(this.moProperties&&this.moProperties.hasOwnProperty(MultipleSourcesProperties.Const.PROPERTY_MULTIPLE_SOURCE))
{this.ActiveMultipleSources();}}
break;case PositionItem.Const.CONTROL_TYPE_SLIDESHOW:{$Control(this.msId,SlideshowCtrl.Const.CONTROL_NAME).Configure(this);}
break;case PositionItem.Const.CONTROL_TYPE_IFRAME:{this.SetupIFrame();}
break;}
if(this.moLinkedImage)
{ImageMgr.GetInstance().Push(this.moLinkedImage,this);if(this.moProperties&&this.moProperties.hasOwnProperty(AutoScaleProperties.Const.PROPERTY_POLICY))
{this.moLinkedImage.style.visibility="hidden";}}
if(this.HasProperty(ConstProperties.Const.NEED_SIZE))
{SizeLearningMgr.RegisterControl(this);}
if(this.HasProperty(ConstProperties.Const.FLASH_ID))
{var sFlashID=this.GetProperty(ConstProperties.Const.FLASH_ID);var asFlashIDs=sFlashID.split(' ');ControlMgr.GetInstance().AddReference(sFlashID,this);}
if(this.HasProperty(SlideshowCtrl.Const.PROPERTY_SLIDESHOW_ID))
{SlideshowMgr.GetInstance().RegisterNode(this);}
this.mbEthereal=this.GetProperty(ConstProperties.Const.ETHEREAL);}
HTMLElement.prototype.ApplyProperties=function()
{switch(this.msCtrlType)
{case PositionItem.Const.CONTROL_TYPE_HYPERLINK:case PositionItem.Const.CONTROL_TYPE_BUTTON:{if(this.moProperties)
{if(this.moProperties.hasOwnProperty(ConstProperties.Const.SEQUENCE_LOADING_PREV))
{var sVFormID=this.GetVFormId();Utils.AddEvent(this,"click",function(){SequenceLoadingMgr.GetInstance().NavigateSequence(false,sVFormID);},this);}
if(this.moProperties.hasOwnProperty(ConstProperties.Const.SEQUENCE_LOADING_NEXT))
{var sVFormID=this.GetVFormId();Utils.AddEvent(this,"click",function(){SequenceLoadingMgr.GetInstance().NavigateSequence(true,sVFormID);},this);}
ButtonCtrl.AutoConfigPulse(this);}}
break;}
if(this.msCtrlType==PositionItem.Const.CONTROL_TYPE_PANEL||this.msCtrlType==PositionItem.Const.CONTROL_TYPE_FLOAT_PANEL)
{if(this.moProperties&&(this.moProperties.hasOwnProperty(SequenceLoadingProperties.Const.PROPERTY_SEQUENCE_LOADING_INDEX)||this.moProperties.hasOwnProperty(SequenceLoadingProperties.Const.PROPERTY_SEQUENCE_LOADING)))
{SequenceLoadingProperties.ConfigureControl(this);}}}
HTMLElement.prototype.ExtractDependences=function(_oPrevious,_oSuperContainer)
{var oResult=[true,true];switch(this.msCtrlType)
{case PositionItem.Const.CONTROL_TYPE_FLOAT_PANEL:{oResult=[true,true];this.ExtractDependencesContainer(_oPrevious,_oSuperContainer);break;}
case PositionItem.Const.CONTROL_TYPE_PANEL:case PositionItem.Const.CONTROL_TYPE_POPUP:case PositionItem.Const.CONTROL_TYPE_PANEL_TABLE:case PositionItem.Const.CONTROL_TYPE_PANEL_LINE:case PositionItem.Const.CONTROL_TYPE_PANEL_COL:oResult=this.ExtractDependencesContainer(_oPrevious,_oSuperContainer);break;default:oResult=this.ExtractDependencesControl(_oPrevious,_oSuperContainer);break;}
return oResult;}
HTMLElement.prototype.ExtractDependencesContainer=function(_oPrevious,_oSuperContainer)
{var abResult=this.ExtractDependencesControl(_oPrevious);var iResizeWidth=this.GetProperty(ConstProperties.Const.RESIZE_WIDTH,-1);var iResizeHeight=this.GetProperty(ConstProperties.Const.RESIZE_HEIGHT,-1);if(iResizeWidth!=-1)
{ResizeMgr.GetInstance().AddToResizeXList(this);}
if(iResizeHeight!=-1)
{ResizeMgr.GetInstance().AddToResizeYList(this);}
var bAutoLimitResizeHeight=this.GetProperty(ConstProperties.Const.AUTOLIMIT_RESIZE_HEIGHT);var oContainerForChildren=this.moContainerForChildrens;var iNumChildrens=oContainerForChildren.length;var bAddXChildrenDependency=(iResizeWidth==-1)&&(this.GetOriginalWidth()==-1||this.ForceXChildrenDependence());var bAddYChildrenDependency=(iResizeHeight==-1||bAutoLimitResizeHeight)&&(this.GetOriginalHeight()==-1||this.ForceYChildrenDependence());var bXDependsOnlyFromLastControl=this.XDependsOnlyFromLastControl();var bYDependsOnlyFromLastControl=this.YDependsOnlyFromLastControl();var oLastControl;if(this.GetProperty(ConstProperties.Const.FLASH_ID)==ConstValues.Const.SUPER_CONTAINER)
{_oSuperContainer=this;}
for(var i=0;i<iNumChildrens;i++)
{var oControl=oContainerForChildren[i];var bLastControl=(i==iNumChildrens-1);if(oControl!=null)
{var abArray=oControl.ExtractDependences(oLastControl,_oSuperContainer);if(abArray[0])
{PositionMgr.GetInstance().AddToDirtyXList(oControl);}
if(abArray[1])
{PositionMgr.GetInstance().AddToDirtyYList(oControl);}
if(!oControl.IsEthereal())
{if((bAddXChildrenDependency&&!bXDependsOnlyFromLastControl)||(bAddXChildrenDependency&&bXDependsOnlyFromLastControl&&bLastControl))
{new Dependency(oControl,this,Dependency.Const.TYPE_PARENT,Dependency.Const.SUBTYPE_NONE,null,Dependency.Const.AXIS_X);abResult[0]=false;}
if((bAddYChildrenDependency&&!bYDependsOnlyFromLastControl)||(bAddYChildrenDependency&&bYDependsOnlyFromLastControl&&bLastControl))
{new Dependency(oControl,this,Dependency.Const.TYPE_PARENT,Dependency.Const.SUBTYPE_NONE,null,Dependency.Const.AXIS_Y);abResult[1]=false;}}
oLastControl=oControl;}}
return abResult;}
HTMLElement.prototype.ExtractDependencesControl=function ExtractDependencesControl(_oPrevious,_oSuperContainer)
{var abResult=[true,true];var oControl;var oSource;var sReference;var oParent;var bHasParent;var oPrevious;var bHasPrevious;var bHasSuperContainer;if(_oPrevious)
{oPrevious=_oPrevious;bHasPrevious=true;}
if(_oSuperContainer)
{this.moSuperContainer=_oSuperContainer;bHasSuperContainer=true;}
if(!bHasParent)
{oParent=this.GetParentContainer();bHasParent=true;}
for(var i=0;i<this.masXTypes.length;i++)
{var sReferenceX=this.msReferenceX[i];var bUsePreviousControl=false;if(Utils.IsStringFilled(sReferenceX)&&sReferenceX!=PositionItem.Const.KEY_PREVIOUS)
{if(sReferenceX==PositionItem.Const.REF_PARENT)
{oParent=this.GetParentContainer();bHasParent=true;if(oParent)
{this.moQuickXSource=new Dependency(oParent,this,Dependency.Const.TYPE_REFERENCE,Dependency.Const.SUBTYPE_POS,this.masXTypes[i],Dependency.Const.AXIS_X);abResult[0]=false;}}
else
{if(sReferenceX==PositionItem.Const.REF_ANCESTOR_PREFIX+ConstValues.Const.SUPER_CONTAINER)
{if(!bHasSuperContainer)
{this.moSuperContainer=this.GetAncestorWithFlashID(ConstValues.Const.SUPER_CONTAINER);bHasSuperContainer=true;}
oSource=this.moSuperContainer;}
else if(Utils.StartsWith(sReferenceX,PositionItem.Const.REF_ANCESTOR_PREFIX))
{oSource=this.GetAncestorWithFlashID(sReferenceX.substring(PositionItem.Const.REF_ANCESTOR_PREFIX.length));}
else
{oSource=ControlMgr.GetInstance().GetPositionItem(this.GetBrotherId(sReferenceX));if(oSource==null)
{oSource=ControlMgr.GetInstance().GetReference(sReferenceX);}}
if(oSource!=null)
{if(sReferenceX==PositionItem.Const.REF_SCREEN)
{this.moQuickXSource=new Dependency(oSource,this,Dependency.Const.TYPE_SCREEN,Dependency.Const.SUBTYPE_POS,this.masXTypes[i],Dependency.Const.AXIS_X);}
else
{this.moQuickXSource=new Dependency(oSource,this,Dependency.Const.TYPE_REFERENCE,Dependency.Const.SUBTYPE_POS,this.masXTypes[i],Dependency.Const.AXIS_X);}
PositionMgr.GetInstance().AddToDirtyXList(this);abResult[0]=false;}
else
{bUsePreviousControl=true;}}}
else
{bUsePreviousControl=true;}
if(bUsePreviousControl)
{if(!bHasPrevious)
{oPrevious=this.GetLastControl();bHasPrevious=true;}
if(oPrevious!=null)
{this.moQuickXSource=new Dependency(oPrevious,this,Dependency.Const.TYPE_PREVIOUS,Dependency.Const.SUBTYPE_POS,this.masXTypes[i],Dependency.Const.AXIS_X);abResult[0]=false;}}}
for(var i=0;i<this.msWidthReference.length;i++)
{var sWidthReference=this.msWidthReference[i];if(sWidthReference==PositionItem.Const.REF_PARENT)
{if(!bHasParent)
{oParent=GetParentContainer();bHasParent=true;}
if(oParent!=null)
{this.moQuickWSource=new Dependency(oParent,this,Dependency.Const.TYPE_REFERENCE,Dependency.Const.SUBTYPE_SIZE,this.msWidthType[i],Dependency.Const.AXIS_X);abResult[0]=false;}}
else
{if(sWidthReference==PositionItem.Const.REF_ANCESTOR_PREFIX+ConstValues.Const.SUPER_CONTAINER)
{if(!bHasSuperContainer)
{this.moSuperContainer=this.GetAncestorWithFlashID(ConstValues.Const.SUPER_CONTAINER);bHasSuperContainer=true;}
oSource=this.moSuperContainer;}
else if(Utils.StartsWith(sWidthReference,PositionItem.Const.REF_ANCESTOR_PREFIX))
{oSource=this.GetAncestorWithFlashID(sWidthReference.substring(PositionItem.Const.REF_ANCESTOR_PREFIX.length));}
else
{oSource=ControlMgr.GetInstance().GetPositionItem(this.GetBrotherId(sWidthReference));if(oSource==null)
{oSource=ControlMgr.GetInstance().GetReference(sWidthReference);}}
if(oSource!=null)
{if(sWidthReference==PositionItem.Const.REF_SCREEN)
{this.moQuickWSource=new Dependency(oSource,this,Dependency.Const.TYPE_SCREEN,Dependency.Const.SUBTYPE_SIZE,this.msWidthType[i],Dependency.Const.AXIS_X);}
else
{this.moQuickWSource=new Dependency(oSource,this,Dependency.Const.TYPE_REFERENCE,Dependency.Const.SUBTYPE_SIZE,this.msWidthType[i],Dependency.Const.AXIS_X);}
PositionMgr.GetInstance().AddToDirtyXList(this);abResult[0]=false;}}}
for(var i=0;i<this.masYTypes.length;i++)
{var sReferenceY=this.msReferenceY[i];if(Utils.IsStringFilled(sReferenceY)&&sReferenceY!=PositionItem.Const.KEY_PREVIOUS)
{if(sReferenceY==PositionItem.Const.REF_PARENT)
{if(!bHasParent)
{oParent=GetParentContainer();bHasParent=true;}
if(oParent!=null)
{this.moQuickYSource=new Dependency(oParent,this,Dependency.Const.TYPE_REFERENCE,Dependency.Const.SUBTYPE_POS,this.masYTypes[i],Dependency.Const.AXIS_Y);abResult[1]=false;}}
else
{if(sReferenceY==PositionItem.Const.REF_ANCESTOR_PREFIX+ConstValues.Const.SUPER_CONTAINER)
{if(!bHasSuperContainer)
{this.moSuperContainer=this.GetAncestorWithFlashID(ConstValues.Const.SUPER_CONTAINER);bHasSuperContainer=true;}
oSource=this.moSuperContainer;}
else if(Utils.StartsWith(sReferenceY,PositionItem.Const.REF_ANCESTOR_PREFIX))
{oSource=this.GetAncestorWithFlashID(sReferenceY.substring(PositionItem.Const.REF_ANCESTOR_PREFIX.length));}
else
{oSource=ControlMgr.GetInstance().GetPositionItem(this.GetBrotherId(sReferenceY));if(oSource==null)
{oSource=ControlMgr.GetInstance().GetReference(sReferenceY);}}
if(oSource!=null)
{if(sReferenceY==PositionItem.Const.REF_SCREEN)
{this.moQuickYSource=new Dependency(oSource,this,Dependency.Const.TYPE_SCREEN,Dependency.Const.SUBTYPE_POS,this.masYTypes[i],Dependency.Const.AXIS_Y);}
else
{this.moQuickYSource=new Dependency(oSource,this,Dependency.Const.TYPE_REFERENCE,Dependency.Const.SUBTYPE_POS,this.masYTypes[i],Dependency.Const.AXIS_Y);}
PositionMgr.GetInstance().AddToDirtyYList(this);abResult[1]=false;}
else
{bUsePreviousControl=true;}}}
else
{bUsePreviousControl=true;}
if(bUsePreviousControl)
{if(!bHasPrevious)
{oPrevious=this.GetLastControl();bHasPrevious=true;}
if(oPrevious!=null)
{this.moQuickYSource=new Dependency(oPrevious,this,Dependency.Const.TYPE_PREVIOUS,Dependency.Const.SUBTYPE_POS,this.masYTypes[i],Dependency.Const.AXIS_Y);abResult[1]=false;}}}
for(var i=0;i<this.msHeightReference.length;i++)
{var sHeightReference=this.msHeightReference[i];if(sHeightReference==PositionItem.Const.REF_PARENT)
{if(!bHasParent)
{oParent=this.GetParentContainer();bHasParent=true;}
if(oParent!=null)
{this.moQuickHSource=new Dependency(oParent,this,Dependency.Const.TYPE_REFERENCE,Dependency.Const.SUBTYPE_POS,this.msHeightType[i],Dependency.Const.AXIS_Y);abResult[1]=false;}}
else
{if(sHeightReference==PositionItem.Const.REF_ANCESTOR_PREFIX+ConstValues.Const.SUPER_CONTAINER)
{if(!bHasSuperContainer)
{this.moSuperContainer=this.GetAncestorWithFlashID(ConstValues.Const.SUPER_CONTAINER);bHasSuperContainer=true;}
oSource=this.moSuperContainer;}
else if(Utils.StartsWith(sHeightReference,PositionItem.Const.REF_ANCESTOR_PREFIX))
{oSource=this.GetAncestorWithFlashID(sHeightReference.substring(PositionItem.Const.REF_ANCESTOR_PREFIX.length));}
else
{oSource=ControlMgr.GetInstance().GetPositionItem(this.GetBrotherId(sHeightReference));if(oSource==null)
{oSource=ControlMgr.GetInstance().GetReference(sHeightReference);}}
if(oSource!=null)
{if(sHeightReference==PositionItem.Const.REF_SCREEN)
{this.moQuickHSource=new Dependency(oSource,this,Dependency.Const.TYPE_SCREEN,Dependency.Const.SUBTYPE_POS,this.msHeightType[i],Dependency.Const.AXIS_Y);}
else
{this.moQuickHSource=new Dependency(oSource,this,Dependency.Const.TYPE_REFERENCE,Dependency.Const.SUBTYPE_POS,this.msHeightType[i],Dependency.Const.AXIS_Y);}
PositionMgr.GetInstance().AddToDirtyYList(this);abResult[1]=false;}}}
return abResult;}
HTMLElement.prototype.CalculateXPosition=function CalculateXPosition()
{var oResult;switch(this.msCtrlType)
{case PositionItem.Const.CONTROL_TYPE_LABEL:case PositionItem.Const.CONTROL_TYPE_TEXTBOX:case PositionItem.Const.CONTROL_TYPE_DROPDOWNLIST:case PositionItem.Const.CONTROL_TYPE_TEXTBOXPASSWORD:case PositionItem.Const.CONTROL_TYPE_AUTOCOMPLETION:case PositionItem.Const.CONTROL_TYPE_RADIOBUTTON_LIST:case PositionItem.Const.CONTROL_TYPE_DATE:case PositionItem.Const.CONTROL_TYPE_TEXTAREA:case PositionItem.Const.CONTROL_TYPE_CHECKBOX:oResult=this.CalculateXPositionLabel();break;case PositionItem.Const.CONTROL_TYPE_HYPERLINK:case PositionItem.Const.CONTROL_TYPE_BUTTON:oResult=this.CalculateXPositionButton();break;case PositionItem.Const.CONTROL_TYPE_FLOAT_PANEL:oResult=this.CalculateXPositionFloatPnl();break;case PositionItem.Const.CONTROL_TYPE_IMAGE:oResult=this.CalculateXPositionImage();break;case PositionItem.Const.CONTROL_TYPE_IFRAME:oResult=this.CalculateXPositionIFrame();break;case PositionItem.Const.CONTROL_TYPE_PANEL:case PositionItem.Const.CONTROL_TYPE_POPUP:oResult=this.CalculateXPositionContainer();break;case PositionItem.Const.CONTROL_TYPE_PANEL_TABLE:oResult=this.CalculateXPositionPanelTable();break;case PositionItem.Const.CONTROL_TYPE_PANEL_COL:case PositionItem.Const.CONTROL_TYPE_PANEL_LINE:oResult=this.CalculateXPositionContainer();break;default:oResult=this.CalculateXPositionControl();break;}
return oResult;}
HTMLElement.prototype.CalculateYPosition=function CalculateYPosition()
{var oResult;switch(this.msCtrlType)
{case PositionItem.Const.CONTROL_TYPE_LABEL:case PositionItem.Const.CONTROL_TYPE_TEXTBOX:case PositionItem.Const.CONTROL_TYPE_DROPDOWNLIST:case PositionItem.Const.CONTROL_TYPE_TEXTBOXPASSWORD:case PositionItem.Const.CONTROL_TYPE_AUTOCOMPLETION:case PositionItem.Const.CONTROL_TYPE_RADIOBUTTON_LIST:case PositionItem.Const.CONTROL_TYPE_DATE:case PositionItem.Const.CONTROL_TYPE_TEXTAREA:case PositionItem.Const.CONTROL_TYPE_CHECKBOX:oResult=this.CalculateYPositionLabel();break;case PositionItem.Const.CONTROL_TYPE_BUTTON:case PositionItem.Const.CONTROL_TYPE_HYPERLINK:oResult=this.CalculateYPositionButton();break;case PositionItem.Const.CONTROL_TYPE_FLOAT_PANEL:oResult=this.CalculateYPositionFloatPnl();break;case PositionItem.Const.CONTROL_TYPE_IMAGE:oResult=this.CalculateYPositionImage();break;case PositionItem.Const.CONTROL_TYPE_IFRAME:oResult=this.CalculateYPositionIFrame();break;case PositionItem.Const.CONTROL_TYPE_PANEL:case PositionItem.Const.CONTROL_TYPE_POPUP:case PositionItem.Const.CONTROL_TYPE_PANEL_TABLE:oResult=this.CalculateYPositionContainer();break;case PositionItem.Const.CONTROL_TYPE_PANEL_COL:case PositionItem.Const.CONTROL_TYPE_PANEL_LINE:oResult=this.CalculateYPositionContainer();break;default:oResult=this.CalculateYPositionControl();break;}
return oResult;}
HTMLElement.prototype.CalculateXPositionControl=function CalculateXPositionControl()
{var bResult=false;var oSource=null;var iWidth=this.miWidth;var oParentRef;if(this.moPlaceHolder!=null)
{oParentRef=this.moPlaceHolder.moParent;}
else
{oParentRef=this.moParent;}
if(this.msWidthReference.length!=0||Utils.IsStringFilled(this.msAdvancedWidth))
{if(Utils.IsString(this.msAdvancedWidth))
{var sWidthExpression=this.msAdvancedWidth;for(var i=0;i<this.msWidthReference.length;i++)
{var iValue=0;var sWidthReference=this.msWidthReference[i];if(sWidthReference==PositionItem.Const.REF_PARENT)
{var oTmpControl=this.GetParentContainer();if(oTmpControl!=null)
{iValue=oTmpControl.GetWidth();}}
else
{if(sWidthReference==PositionItem.Const.REF_ANCESTOR_PREFIX+ConstValues.Const.SUPER_CONTAINER)
{oSource=this.moSuperContainer;}
else if(Utils.StartsWith(sWidthReference,PositionItem.Const.REF_ANCESTOR_PREFIX))
{oSource=this.GetAncestorWithFlashID(sWidthReference.substring(PositionItem.Const.REF_ANCESTOR_PREFIX.length));}
else
{oSource=ControlMgr.GetInstance().GetPositionItem(this.GetBrotherId(sWidthReference));if(oSource==null)
{oSource=ControlMgr.GetInstance().GetReference(sWidthReference);}}
if(oSource!=null)
{var iDiff=0;var oContainer;if(this.msWidthType[i]==PositionItem.Const.TYPE_HEIGHT)
{iValue=oSource.GetHeight();}
else
{if(this.msWidthType[i]==PositionItem.Const.WIDTHTYPE_INTERNAL&&oSource.IsContainer())
{oContainer=oSource;iDiff=-oContainer.GetPaddingLeft()-oContainer.GetPaddingRight();}
iValue=oSource.GetWidth()+iDiff;}}}
var oRegexp=(this.msWidthType[i]==PositionItem.Const.KEY_DEFAULT)?new RegExp(sWidthReference,"g"):new RegExp(sWidthReference+"."+this.msWidthType[i],"g");sWidthExpression=sWidthExpression.replace(oRegexp,iValue.toString());}
sWidthExpression=sWidthExpression.replace("--","");iWidth=eval(sWidthExpression);}
else
{oSource=null;if(this.moQuickWSource!=null)
{oSource=this.moQuickWSource.GetSource();if(this.moQuickWSource.GetType()==Dependency.Const.TYPE_REFERENCE)
{var iDiff=0;var oContainer;if(this.msWidthType.length!=0&&this.msWidthType[0]==PositionItem.Const.WIDTHTYPE_INTERNAL&&oSource.IsContainer())
{oContainer=oSource;iDiff=-oContainer.GetPaddingLeft()-oContainer.GetPaddingRight();}
iWidth=oSource.GetWidth()+this.miOriginalWidth+iDiff;}
else if(this.moQuickWSource.GetType()==Dependency.Const.TYPE_SCREEN)
{iWidth=oSource.GetWidth()+this.miOriginalWidth;}}}}
if(iWidth!=this.miWidth)
{this.SetWidth(iWidth);bResult=true;}
var iX=0;oSource=null;var iSourceX=0;var iSourceW=0;if(Utils.IsStringFilled(this.msAdvancedX))
{var sXEquation=this.msAdvancedX;for(var i=0;i<this.msReferenceX.length;i++)
{var iValue=0;var sReferenceX=this.msReferenceX[i];if(sReferenceX==PositionItem.Const.REF_PARENT)
{oSource=this.GetParentContainer();if(oSource!=null)
{iSourceW=oSource.GetWidth();}}
else
{if(sReferenceX==PositionItem.Const.REF_ANCESTOR_PREFIX+ConstValues.Const.SUPER_CONTAINER)
{oSource=this.moSuperContainer;}
else if(Utils.StartsWith(sReferenceX,PositionItem.Const.REF_ANCESTOR_PREFIX))
{oSource=this.GetAncestorWithFlashID(sReferenceX.substring(PositionItem.Const.REF_ANCESTOR_PREFIX.length));}
else if(sReferenceX==PositionItem.Const.KEY_PREVIOUS&&this.GetLastControl()!=null)
{oSource=this.GetLastControl();iSourceX=oSource.x;iSourceW=oSource.GetWidth();}
else
{oSource=ControlMgr.GetInstance().GetPositionItem(this.GetBrotherId(sReferenceX));if(oSource==null)
{oSource=ControlMgr.GetInstance().GetReference(sReferenceX);}}
if(oSource!=null)
{iSourceW=oSource.GetWidth();if(sReferenceX=="screen")
{iSourceX=oParentRef.globalToLocal(new Point(0,0)).x;}
else if(oSource.moParent==this.moParent)
{iSourceX=oSource.x;}
else
{iSourceX=oParentRef.globalToLocal(oSource.localToGlobal(new Point(0,0))).x;}}}
var sSourceX=this.masXTypes[i];if(oSource!=null)
{switch(sSourceX)
{case PositionItem.Const.XTYPE_TO_RIGHT:{iValue=iSourceX+iSourceW;}
break;case PositionItem.Const.XTYPE_TO_LEFT:{iValue=iSourceX-this.miWidth;}
break;case PositionItem.Const.XTYPE_ALIGN_RIGHT:{iValue=iSourceX+iSourceW-this.miWidth;}
break;case PositionItem.Const.XTYPE_ALIGN_LEFT:{iValue=iSourceX;}
break;case PositionItem.Const.XTYPE_CENTER:{iValue=Math.round(iSourceX+iSourceW/2-this.miWidth/2);}
break;case PositionItem.Const.TYPE_WIDTH:{iValue=iSourceW;}
break;case PositionItem.Const.TYPE_HEIGHT:{iValue=oSource.GetHeight();}
break;default:{sXEquation=sXEquation.replace(new RegExp(sReferenceX+"\.","g"),iValue.toString());}}}
if(sReferenceX!=PositionItem.Const.KEY_PREVIOUS)
{sXEquation=sXEquation.replace(new RegExp(sReferenceX+"\."+sSourceX,"g"),iValue.toString());}
else
{sXEquation=sXEquation.replace(new RegExp("([^.a-zA-Z]|^)"+sSourceX+"([^.a-zA-Z]|$)","g"),"$1"+iValue.toString()+"$2");}}
sXEquation=sXEquation.replace("--","");iX=eval(sXEquation);}
else
{oSource=null;if(this.moQuickXSource!=null)
{oSource=this.moQuickXSource.GetSource();iSourceW=oSource.GetWidth();if(this.moQuickXSource.GetType()==Dependency.Const.TYPE_REFERENCE)
{if(oSource.moParent==this.moParent)
{iSourceX=oSource.x;}
else
{iSourceX=oParentRef.globalToLocal(oSource.localToGlobal(new Point(0,0))).x;}}
else if(this.moQuickXSource.GetType()==Dependency.Const.TYPE_SCREEN)
{iSourceX=oParentRef.globalToLocal(ControlMgr.GetInstance().GetRootPositionItem().localToGlobal(new Point(0,0))).x;}
else
{iSourceX=oSource.x;}}
if(oSource!=null)
{switch(this.masXTypes[0])
{case PositionItem.Const.XTYPE_TO_RIGHT:{iX=iSourceX+iSourceW;}
break;case PositionItem.Const.XTYPE_TO_LEFT:{iX=iSourceX-this.miWidth;}
break;case PositionItem.Const.XTYPE_ALIGN_RIGHT:{iX=iSourceX+iSourceW-this.miWidth;}
break;case PositionItem.Const.XTYPE_ALIGN_LEFT:{iX=iSourceX;}
break;case PositionItem.Const.XTYPE_CENTER:{iX=Math.round(iSourceX+iSourceW/2-this.miWidth/2);}
break;default:{}}
iX+=this.miXOff;}
else
{var oParent=this.GetParentContainer();if(oParent!=null)
{iX=Math.max(parseInt(oParent.GetPaddingLeft()),parseInt(this.miXOff));}}}
bResult=bResult||this.mbXMustBeCalculated||(this.x!=iX);if(bResult)
{this.mbXMustBeCalculated=false;this.mbUpdateStyle=true;}
if(this.moPlaceHolder==null)
{if(this.moPosDecider==null)
{this.x=iX;}}
else
{this.moPlaceHolder.x=iX;}
return bResult;}
HTMLElement.prototype.CalculateXPositionContainer=function CalculateXPositionContainer()
{var bResult=false;var iResizeWidth=this.GetProperty(ConstProperties.Const.RESIZE_WIDTH,-1);var iWidth=this.GetOriginalWidth();var iOldWidth=this.GetWidth();if(iResizeWidth!=-1)
{iWidth=Utils.GetViewportWidth()-ResizeMgr.GetInstance().GetScrollbarSize()-iResizeWidth;}
else if(this.GetOriginalWidth()==-1)
{iWidth=this.GetPaddingLeft();var oContainerForChildren=this.GetContainerForChildren();var iStartIndex;if(this.XDependsOnlyFromLastControl())
{iStartIndex=oContainerForChildren.length-1;}
else
{iStartIndex=0;}
for(var i=iStartIndex;i<oContainerForChildren.length;i++)
{var oControl=oContainerForChildren[i];if(oControl!=null&&!oControl.IsEthereal())
{iWidth=Math.max(iWidth,oControl.x+Math.max(0,oControl.GetWidth()));}}
iWidth+=this.GetPaddingRight();}
this.SetWidth(iWidth);bResult=this.CalculateXPositionControl()||bResult;iWidth=this.GetWidth();var iMinResizeWidth=this.GetProperty(ConstProperties.Const.MIN_RESIZE_WIDTH);if(iMinResizeWidth&&(iMinResizeWidth!=0))
{iWidth=Math.max(iWidth,iMinResizeWidth);}
var iMaxResizeWidth=this.GetProperty(ConstProperties.Const.MAX_RESIZE_WIDTH);if(iMaxResizeWidth&&(iMaxResizeWidth!=0))
{iWidth=Math.min(iWidth,iMaxResizeWidth);}
if(this.mbFixedAspectRatio)
{var iHeight=Utils.GetViewportHeight()-this.GetProperty(ConstProperties.Const.RESIZE_HEIGHT);var dCurrentAspectRatio=iWidth/iHeight;if(dCurrentAspectRatio>this.mdFixedAspectRatio)
{iWidth=this.mdFixedAspectRatio*iHeight;}}
if(iWidth!=iOldWidth)
{this.SetUpdateStyle(true);bResult=true;}
this.SetWidth(iWidth);if(this.mbFixedAspectRatio&&bResult)
{PositionMgr.GetInstance().AddToDirtyYList(this);}
return bResult;}
HTMLElement.prototype.CalculateYPositionControl=function CalculateYPositionControl()
{var bResult=false;var oSource=null;var iHeight=this.miHeight;var oParentRef;if(this.moPlaceHolder!=null)
{oParentRef=this.moPlaceHolder.moParent;}
else
{oParentRef=this.moParent;}
if(this.msHeightReference.length!=0||Utils.IsStringFilled(this.msAdvancedHeight))
{if(Utils.IsString(this.msAdvancedHeight))
{var sHeightExpression=this.msAdvancedHeight;for(var i=0;i<this.msHeightReference.length;i++)
{var iValue=0;var sHeightReference=this.msHeightReference[i];if(sHeightReference==PositionItem.Const.REF_PARENT)
{var oTmpControl=this.GetParentContainer();if(oTmpControl!=null)
{iValue=oTmpControl.GetHeight();}}
else
{if(sHeightReference==PositionItem.Const.REF_ANCESTOR_PREFIX+ConstValues.Const.SUPER_CONTAINER)
{oSource=this.moSuperContainer;}
else if(Utils.StartsWith(sHeightReference,PositionItem.Const.REF_ANCESTOR_PREFIX))
{oSource=this.GetAncestorWithFlashID(sHeightReference.substring(PositionItem.Const.REF_ANCESTOR_PREFIX.length));}
else
{oSource=ControlMgr.GetInstance().GetPositionItem(this.GetBrotherId(sHeightReference));if(oSource==null)
{oSource=ControlMgr.GetInstance().GetReference(sHeightReference);}}
if(oSource!=null)
{var iDiff=0;var oContainer;if(this.msHeightType[i]==PositionItem.Const.TYPE_WIDTH)
{iValue=oSource.GetWidth();}
else
{if(this.msHeightType[i]==PositionItem.Const.WIDTHTYPE_INTERNAL&&oSource.IsContainer())
{oContainer=oSource;iDiff=-oContainer.GetPaddingLeft()-oContainer.GetPaddingRight();}
iValue=oSource.GetHeight()+iDiff;}}}
var oRegexp=(this.msHeightType[i]==PositionItem.Const.KEY_DEFAULT)?new RegExp(sHeightReference,"g"):new RegExp(sHeightReference+"."+this.msHeightType[i],"g");sHeightExpression=sHeightExpression.replace(oRegexp,iValue.toString());}
sHeightExpression=sHeightExpression.replace("--","");iHeight=eval(sHeightExpression);}
else
{oSource=null;if(this.moQuickHSource!=null)
{oSource=this.moQuickHSource.GetSource();if(this.moQuickHSource.GetType()==Dependency.Const.TYPE_REFERENCE)
{var iDiff=0;var oContainer;if(this.msHeightType.length!=0&&this.msHeightType[0]==PositionItem.Const.WIDTHTYPE_INTERNAL&&oSource.IsContainer())
{oContainer=oSource;iDiff=-oContainer.GetPaddingTop()-oContainer.GetPaddingBottom();}
iHeight=oSource.GetHeight()+this.miOriginalHeight+iDiff;}
else if(this.moQuickHSource.GetType()==Dependency.Const.TYPE_SCREEN)
{iHeight=oSource.GetHeight()+this.miOriginalHeight;}}}}
if(iHeight!=this.miHeight)
{this.SetHeight(iHeight);bResult=true;}
var iY=0;oSource=null;var iSourceY=0;var iSourceH=0;if(Utils.IsStringFilled(this.msAdvancedY))
{var sYEquation=this.msAdvancedY;for(var i=0;i<this.msReferenceY.length;i++)
{var iValue=0;var sReferenceY=this.msReferenceY[i];if(sReferenceY==PositionItem.Const.REF_PARENT)
{oSource=this.GetParentContainer();if(oSource!=null)
{iSourceH=oSource.GetHeight();}}
else
{if(sReferenceY==PositionItem.Const.REF_ANCESTOR_PREFIX+ConstValues.Const.SUPER_CONTAINER)
{oSource=this.moSuperContainer;}
else if(Utils.StartsWith(sReferenceY,PositionItem.Const.REF_ANCESTOR_PREFIX))
{oSource=this.GetAncestorWithFlashID(sReferenceY.substring(PositionItem.Const.REF_ANCESTOR_PREFIX.length));}
else if(sReferenceY==PositionItem.Const.KEY_PREVIOUS&&this.GetLastControl()!=null)
{oSource=this.GetLastControl();iSourceY=oSource.y;iSourceH=oSource.GetHeight();}
else
{oSource=ControlMgr.GetInstance().GetPositionItem(this.GetBrotherId(sReferenceY));if(oSource==null)
{oSource=ControlMgr.GetInstance().GetReference(sReferenceY);}}
if(oSource!=null)
{iSourceH=oSource.GetHeight();if(sReferenceY=="screen")
{iSourceY=oParentRef.globalToLocal(new Point(0,0)).y;}
else if(oSource.moParent==this.moParent)
{iSourceY=oSource.y;}
else
{iSourceY=oParentRef.globalToLocal(oSource.localToGlobal(new Point(0,0))).y;}}}
var sSourceY=this.masYTypes[i];if(oSource!=null)
{switch(sSourceY)
{case PositionItem.Const.YTYPE_TO_TOP:{iValue=iSourceY-this.miHeight;}
break;case PositionItem.Const.YTYPE_TO_BOTTOM:{iValue=iSourceY+iSourceH;}
break;case PositionItem.Const.YTYPE_ALIGN_TOP:{iValue=iSourceY;}
break;case PositionItem.Const.YTYPE_ALIGN_BOTTOM:{iValue=iSourceY+iSourceH-this.miHeight;}
break;case PositionItem.Const.YTYPE_CENTER:{iValue=Math.round(iSourceY+iSourceH/2-this.miHeight/2);}
break;case PositionItem.Const.TYPE_HEIGHT:{iValue=iSourceH;}
break;case PositionItem.Const.TYPE_WIDTH:{iValue=oSource.GetWidth();}
break;default:{sYEquation=sYEquation.replace(new RegExp(sReferenceY+"\.","g"),iValue.toString());}}}
if(sReferenceY!=PositionItem.Const.KEY_PREVIOUS)
{sYEquation=sYEquation.replace(new RegExp(sReferenceY+"\."+sSourceY,"g"),iValue.toString());}
else
{sYEquation=sYEquation.replace(new RegExp("([^.a-zA-Z]|^)"+sSourceY+"([^.a-zA-Z]|$)","g"),"$1"+iValue.toString()+"$2");}}
sYEquation=sYEquation.replace("--","");iY=eval(sYEquation);}
else
{oSource=null;if(this.moQuickYSource!=null)
{oSource=this.moQuickYSource.GetSource();iSourceH=oSource.GetHeight();if(this.moQuickYSource.GetType()==Dependency.Const.TYPE_REFERENCE)
{if(oSource.moParent==this.moParent)
{iSourceY=oSource.y;}
else
{iSourceY=oParentRef.globalToLocal(oSource.localToGlobal(new Point(0,0))).y;}}
else if(this.moQuickYSource.GetType()==Dependency.Const.TYPE_SCREEN)
{iSourceY=oParentRef.globalToLocal(ControlMgr.GetInstance().GetRootPositionItem().localToGlobal(new Point(0,0))).y;}
else
{iSourceY=oSource.y;}}
if(oSource!=null)
{switch(this.masYTypes[0])
{case PositionItem.Const.YTYPE_TO_TOP:{iY=iSourceY-this.miHeight;}
break;case PositionItem.Const.YTYPE_TO_BOTTOM:{iY=iSourceY+iSourceH;}
break;case PositionItem.Const.YTYPE_ALIGN_TOP:{iY=iSourceY;}
break;case PositionItem.Const.YTYPE_ALIGN_BOTTOM:{iY=iSourceY+iSourceH-this.miHeight;}
break;case PositionItem.Const.YTYPE_CENTER:{iY=Math.round(iSourceY+iSourceH/2-this.miHeight/2);}
break;default:{}}
iY+=this.miYOff;}
else
{var oParent=this.GetParentContainer();if(oParent!=null)
{iY=Math.max(oParent.GetPaddingTop(),parseInt(this.miYOff));}}}
bResult=bResult||this.mbYMustBeCalculated||(this.y!=iY);if(bResult)
{this.mbYMustBeCalculated=false;this.mbUpdateStyle=true;}
if(this.moPlaceHolder==null)
{if(this.moPosDecider==null)
{this.y=iY;}}
else
{this.moPlaceHolder.y=iY;}
return bResult;}
HTMLElement.prototype.CalculateYPositionContainer=function CalculateYPositionContainer()
{var bResult=false;var iResizeHeight=this.GetProperty(ConstProperties.Const.RESIZE_HEIGHT,-1);var iHeight=this.GetOriginalHeight();var iOldHeight=this.GetHeight();if(this.GetProperty("Fold")==FoldProperties.Const.CLOSE)
{iHeight=this.GetProperty("FoldMinCloseSize",0);}
else
{if(iResizeHeight!=-1)
{iHeight=Utils.GetViewportHeight()-iResizeHeight;}
else if(this.GetOriginalHeight()==-1)
{iHeight=this.GetPaddingTop();var oContainerForChildren=this.GetContainerForChildren();var iStartIndex;if(this.YDependsOnlyFromLastControl())
{iStartIndex=oContainerForChildren.length-1;}
else
{iStartIndex=0;}
for(var i=iStartIndex;i<oContainerForChildren.length;i++)
{var oControl=oContainerForChildren[i];if(oControl!=null&&!oControl.IsEthereal())
{iHeight=Math.max(iHeight,oControl.y+Math.max(0,oControl.GetHeight()));}}
iHeight+=this.GetPaddingBottom();}}
this.SetHeight(iHeight);bResult=this.CalculateYPositionControl()||bResult;iHeight=parseInt(this.GetHeight());var iMinResizeHeight=parseInt(this.GetProperty(ConstProperties.Const.MIN_RESIZE_HEIGHT));if(iMinResizeHeight&&(iMinResizeHeight!=0))
{iHeight=Math.max(iHeight,iMinResizeHeight);}
var iMaxResizeHeight=this.GetProperty(ConstProperties.Const.MAX_RESIZE_HEIGHT);var bAutoLimitResizeHeight=this.GetProperty(ConstProperties.Const.AUTOLIMIT_RESIZE_HEIGHT);if(bAutoLimitResizeHeight)
{iMaxResizeHeight=0;for(i=0;i<this.GetContainerForChildren().length;i++)
{oControl=(this.GetContainerForChildren())[i];if(oControl!=null)
{iMaxResizeHeight=Math.max(iMaxResizeHeight,oControl.y+Math.max(0,oControl.GetHeight()));}}}
if(iMaxResizeHeight&&(iMaxResizeHeight!=0))
{iHeight=Math.min(iHeight,iMaxResizeHeight);}
if(this.mbFixedAspectRatio)
{var iWidth=Utils.GetViewportWidth()-ResizeMgr.GetInstance().GetScrollbarSize()-this.GetProperty(ConstProperties.Const.RESIZE_WIDTH);var dCurrentAspectRatio=iWidth/iHeight;if(dCurrentAspectRatio<this.mdFixedAspectRatio)
{iHeight=iWidth/this.mdFixedAspectRatio;}}
if(iHeight!=iOldHeight)
{this.SetUpdateStyle(true);bResult=true;}
this.SetHeight(iHeight);return bResult;}
HTMLElement.prototype.GetId=function()
{return this.msId;}
HTMLElement.prototype.GetVFormId=function()
{var aSplittedID=this.msId.split(Matrix3.Const.SEPARATOR_CONTROL);if(aSplittedID.length==1)
{return this.msId.substr(0,this.msId.lastIndexOf(Matrix3.Const.SEPARATOR_HIERARCHY));}
else
{return aSplittedID[0];}}
HTMLElement.prototype.GetParentVFormId=function()
{var sVFormID=this.GetVFormId();return sVFormID.substr(0,sVFormID.lastIndexOf(Matrix3.Const.SEPARATOR_HIERARCHY));}
HTMLElement.prototype.GetProperty=function(_sPropertyName,_oDefaultValue)
{var oProperty;if(this.moProperties!=null)
{oProperty=this.moProperties[_sPropertyName];}
if(oProperty==null)
{oProperty=_oDefaultValue;}
return oProperty;}
HTMLElement.prototype.SetProperty=function(_sPropertyName,_oValue)
{if(this.moProperties==null)
{this.moProperties=new Object();}
this.moProperties[_sPropertyName]=_oValue;}
HTMLElement.prototype.HasProperty=function HasProperty(_sPropertyName)
{if(this.moProperties!=null)
{return this.moProperties.hasOwnProperty(_sPropertyName);}
else
{return false;}}
HTMLElement.prototype.GetParentContainer=function GetParentContainer()
{var oParent=null;var oCurrent=this;while(oCurrent!=null&&oParent==null)
{oCurrent=oCurrent.moParent;oParent=oCurrent;}
return oParent;}
HTMLElement.prototype.GetLastControl=function GetLastControl()
{var oResult=null;var oMyself;var oParent;if(this.moPlaceHolder!=null)
{oMyself=moPlaceHolder;oParent=moPlaceHolder.moParent.moParent;}
else
{oMyself=this;oParent=this.GetParentContainer();}
if(oParent!=null)
{var iIdx=oParent.GetContainerForChildren().indexOf(oMyself)-1;if(iIdx>=0)
{oResult=oParent.GetContainerForChildren()[iIdx];}}
return oResult;}
HTMLElement.prototype.GetBrotherId=function GetBrotherId(_sBrotherName)
{var aSplittedID=this.msId.split(Matrix3.Const.SEPARATOR_CONTROL);if(aSplittedID.length==1)
{return this.msId.substr(0,this.msId.lastIndexOf(Matrix3.Const.SEPARATOR_HIERARCHY))+Matrix3.Const.SEPARATOR_CONTROL+_sBrotherName;}
else
{return aSplittedID[0]+Matrix3.Const.SEPARATOR_CONTROL+_sBrotherName;}}
HTMLElement.prototype.IsEthereal=function IsEthereal()
{return this.mbEthereal;}
HTMLElement.prototype.IsUpdateStyle=function IsUpdateStyle()
{return this.mbUpdateStyle;}
HTMLElement.prototype.ApplyStyle=function ApplyStyle(_bComputeStyles)
{if(_bComputeStyles==null)
{_bComputeStyles=false;}
if(this.moProperties)
{if(this.moProperties.hasOwnProperty(AutoScaleProperties.Const.PROPERTY_POLICY))
{AutoScaleProperties.Apply(this);}
if(this.moProperties.hasOwnProperty(MultipleSourcesProperties.Const.PROPERTY_MULTIPLE_SOURCE))
{this.ApplyMultipleSources();}}
if(!Matrix3.mbEvent)
{this.mbUpdateStyle=false;}}
HTMLElement.prototype.TransferPositioningToDOM=function TransferPositioningToDOM()
{if(this.moFloatingParent)
{var aDiffPoint=this.moParent.offsetBetweenControls(this.moFloatingParent);this.style.left=(this.x-aDiffPoint.x)+"px";this.style.top=(this.y-aDiffPoint.y)+"px";this.style.width=this.miWidth+"px";this.style.height=this.miHeight+"px";}
else
{if(this.msCtrlType!=PositionItem.Const.CONTROL_TYPE_POPUP)
{this.style.left=this.x+"px";this.style.top=this.y+"px";this.style.width=this.miWidth+"px";this.style.height=this.miHeight+"px";}}
switch(this.msCtrlType)
{case PositionItem.Const.CONTROL_TYPE_TEXTAREA:{}
break;}}
HTMLElement.prototype.ApplyPostPositionProperties=function()
{if(this.HasProperty(ConstProperties.Const.SCROLL_TO_ME)&&this.GetProperty(ConstProperties.Const.SCROLL_TO_ME))
{var oParent=this.moParent;while(oParent!=null)
{if(oParent.IsScrollable())oParent.ScrollToMakeControlVisible(this);oParent=oParent.moParent;}
delete this.moProperties[ConstProperties.Const.SCROLL_TO_ME];}}
HTMLElement.prototype.IsScrollable=function()
{return((this.clientWidth&&this.scrollWidth&&this.clientWidth<this.scrollWidth)||(this.clientHeight&&this.scrollHeight&&this.clientHeight<this.scrollHeight))}
HTMLElement.prototype.ScrollToMakeControlVisible=function(_oTarget)
{var oControlCenter=new Point(_oTarget.GetWidth()/2,_oTarget.GetHeight()/2);oControlCenter=this.globalToLocal(_oTarget.localToGlobal(oControlCenter));var oOurCenter=new Point(this.GetWidth()/2,this.GetHeight()/2);var oDelta=new Point(oControlCenter.x-oOurCenter.x,oControlCenter.y-oOurCenter.y);this.scrollTop+=oDelta.y;this.scrollLeft+=oDelta.x;}
HTMLElement.prototype.SetDeep=function(_iDeep)
{this.miDeep=_iDeep;}
HTMLElement.prototype.GetDeep=function()
{return this.miDeep;}
HTMLElement.prototype.GetOriginalHeight=function()
{return this.miOriginalHeight;}
HTMLElement.prototype.GetOriginalWidth=function()
{return this.miOriginalWidth;}
HTMLElement.prototype.ForceXChildrenDependence=function()
{return(this.msCtrlType==PositionItem.Const.CONTROL_TYPE_FLOAT_PANEL);}
HTMLElement.prototype.ForceYChildrenDependence=function()
{return(this.msCtrlType==PositionItem.Const.CONTROL_TYPE_FLOAT_PANEL);}
HTMLElement.prototype.XDependsOnlyFromLastControl=function XDependsOnlyFromLastControl()
{return(this.msCtrlType==PositionItem.Const.CONTROL_TYPE_PANEL_LINE);}
HTMLElement.prototype.YDependsOnlyFromLastControl=function()
{return false;}
HTMLElement.prototype.GetContainerForChildren=function()
{return this.moContainerForChildrens;}
HTMLElement.prototype.IsContainer=function()
{var bResult=false;switch(this.msCtrlType)
{case PositionItem.Const.CONTROL_TYPE_PANEL:case PositionItem.Const.CONTROL_TYPE_POPUP:case PositionItem.Const.CONTROL_TYPE_PANEL_TABLE:case PositionItem.Const.CONTROL_TYPE_PANEL_COL:case PositionItem.Const.CONTROL_TYPE_PANEL_LINE:{bResult=true;}
break;}
return bResult;}
HTMLElement.prototype.GetWidth=function()
{return this.miWidth;}
HTMLElement.prototype.SetWidth=function(_iWidth)
{this.miWidth=parseInt(_iWidth);}
HTMLElement.prototype.GetHeight=function()
{return this.miHeight;}
HTMLElement.prototype.SetHeight=function(_iHeight)
{this.miHeight=parseInt(_iHeight);}
HTMLElement.prototype.SetXType=function(_sXType)
{this.masXTypes[0]=_sXType;}
HTMLElement.prototype.SetYType=function(_sYType)
{this.masYTypes[0]=_sYType;}
HTMLElement.prototype.GetPaddingTop=function()
{if(this.miCachedPaddingTop==-1)
{var iSkinVal=parseInt(getStyle(this,"padding-top"));var iGlobalPadding=this.GetProperty(ConstProperties.Const.FLASH_PADDING,iSkinVal);this.miCachedPaddingTop=this.GetProperty(ConstProperties.Const.FLASH_PADDING_TOP,iGlobalPadding);}
return this.miCachedPaddingTop;}
HTMLElement.prototype.GetPaddingRight=function GetPaddingRight()
{if(this.miCachedPaddingRight==-1)
{var iSkinVal=parseInt(getStyle(this,"padding-right"));var iGlobalPadding=this.GetProperty(ConstProperties.Const.FLASH_PADDING,iSkinVal);this.miCachedPaddingRight=this.GetProperty(ConstProperties.Const.FLASH_PADDING_RIGHT,iGlobalPadding);}
return this.miCachedPaddingRight;}
HTMLElement.prototype.GetPaddingBottom=function GetPaddingBottom()
{if(this.miCachedPaddingBottom==-1)
{var iSkinVal=parseInt(getStyle(this,"padding-bottom"));var iGlobalPadding=this.GetProperty(ConstProperties.Const.FLASH_PADDING,iSkinVal);this.miCachedPaddingBottom=this.GetProperty(ConstProperties.Const.FLASH_PADDING_BOTTOM,iGlobalPadding);}
return this.miCachedPaddingBottom;}
HTMLElement.prototype.GetPaddingLeft=function GetPaddingLeft()
{if(this.miCachedPaddingLeft==-1)
{var iSkinVal=parseInt(getStyle(this,"padding-left"));var iGlobalPadding=this.GetProperty(ConstProperties.Const.FLASH_PADDING,iSkinVal);this.miCachedPaddingLeft=this.GetProperty(ConstProperties.Const.FLASH_PADDING_LEFT,iGlobalPadding);}
return this.miCachedPaddingLeft;}
HTMLElement.prototype.SetUpdateStyle=function SetUpdateStyle(_bUpdateStyle)
{this.mbUpdateStyle=_bUpdateStyle;}
HTMLElement.prototype.GetActivatedProperty=function GetActivatedProperty(_sPropertyName)
{return this.moActivatedProperties[_sPropertyName];}
HTMLElement.prototype.AddXDependent=function AddXDependent(_oDependency)
{this.moXDependents.push(_oDependency);}
HTMLElement.prototype.AddYDependent=function AddYDependent(_oDependency)
{this.moYDependents.push(_oDependency);}
HTMLElement.prototype.RemoveXDependent=function RemoveXDependent(_oDependency)
{this.moXDependents.splice(this.moXDependents.indexOf(_oDependency),1);}
HTMLElement.prototype.RemoveYDependent=function RemoveYDependent(_oDependency)
{this.moYDependents.splice(this.moYDependents.indexOf(_oDependency),1);}
HTMLElement.prototype.AddXSource=function AddXSource(_oDependency)
{this.moXSources.push(_oDependency);}
HTMLElement.prototype.AddYSource=function AddYSource(_oDependency)
{this.moYSources.push(_oDependency);}
HTMLElement.prototype.RemoveXSource=function RemoveXSource(_oDependency)
{this.moXSources.splice(this.moXSources.indexOf(_oDependency),1);}
HTMLElement.prototype.RemoveYSource=function RemoveYSource(_oDependency)
{this.moYSources.splice(this.moYSources.indexOf(_oDependency),1);}
HTMLElement.prototype.GetXDependents=function GetXDependents()
{return this.moXDependents;}
HTMLElement.prototype.GetXSources=function GetXSourcesfunction()
{return this.moXSources;}
HTMLElement.prototype.GetYDependents=function GetYDependents()
{return this.moYDependents;}
HTMLElement.prototype.GetYSources=function GetYSources()
{return this.moYSources;}
HTMLElement.prototype.GetAncestorWithFlashID=function GetAncestorWithFlashID(_sFlashID,bSkipThisOne)
{if(bSkipThisOne==null)
{bSkipThisOne=true;}
var oResult=null;if(!bSkipThisOne&&this.GetProperty(ConstProperties.Const.FLASH_ID)==_sFlashID)
{oResult=this;}
else
{var oParent=this.GetParentContainer();if(oParent!=null)
{oResult=oParent.GetAncestorWithFlashID(_sFlashID,false);}
else
{if(_sFlashID==ConstValues.Const.SUPER_CONTAINER)
{return ResizeMgr.GetInstance().GetScreenAnchor();}}}
return oResult;}
HTMLElement.prototype.CalculateXPositionLabel=function CalculateXPositionLabel()
{var bResult=this.CalculateXPositionControl();if(bResult)
{var iWidth=this.GetWidth();if(this.GetOriginalWidth()==-1)
{iWidth=0;this.style.width="9999px";for(var i=0;i<this.childNodes.length;i++)
{var iOffsetRight=this.childNodes[i].offsetLeft+this.childNodes[i].offsetWidth;if(iOffsetRight!=undefined)
{iWidth=Math.max(iWidth,iOffsetRight+1);}}
if(iWidth!=this.GetWidth())
{this.SetWidth(iWidth);this.CalculateXPositionControl();bResult=true;this.mbUpdateStyle=true;}}
else if(this.msCtrlType==PositionItem.Const.CONTROL_TYPE_LABEL)
{var oLbl;var oVal;for(var i=0;i<this.childNodes.length;i++)
{if($HasClass(this.childNodes[i],"Lbl"))
{oLbl=this.childNodes[i];}
else if($HasClass(this.childNodes[i],"Value"))
{oVal=this.childNodes[i];}}
if(oLbl&&oVal)
{$AddClass(this,"_FLV");}
else
{$AddClass(this,"_FL");}}
if(this.GetOriginalHeight()==-1)
{PositionMgr.GetInstance().AddToDirtyYList(this);}}
return bResult;}
HTMLElement.prototype.CalculateYPositionLabel=function CalculateYPositionLabel()
{var bResult=false;if(this.GetOriginalHeight()==-1)
{var iHeight=0;this.style.width=this.miWidth+"px";var bSkip=false;for(var i=0;i<this.childNodes.length;i++)
{iHeight=Math.max(iHeight,this.childNodes[i].offsetTop+this.childNodes[i].offsetHeight);}
if(iHeight!=this.GetHeight())
{this.SetHeight(iHeight);bResult=true;this.mbUpdateStyle=true;}}
bResult=this.CalculateYPositionControl()||bResult;return bResult;}
HTMLElement.prototype.CalculateXPositionButton=function CalculateXPositionButton()
{var bResult=this.CalculateXPositionControl();if(bResult)
{var iWidth=this.GetWidth();if(this.GetOriginalWidth()==-1)
{iWidth=0;if(this.moLinkedImage)
{iWidth=this.moLinkedImage.width;if(iWidth==undefined)
{iWidth=0;}}
else if(!this.miTextWidth)
{if(this.childNodes.length>1)
{var oTextNode=this.childNodes.item(1);this.miTextWidth=oTextNode.offsetLeft+oTextNode.offsetWidth+1;}
else
{this.miTextWidth=0;}
iWidth=this.miTextWidth;}
else
{iWidth=this.miTextWidth;}
if(iWidth!=this.GetWidth())
{this.SetWidth(iWidth);this.CalculateXPositionControl();bResult=true;this.mbUpdateStyle=true;}}
if(bResult&&this.GetOriginalHeight()==-1)
{PositionMgr.GetInstance().AddToDirtyYList(this);}}
return bResult;}
HTMLElement.prototype.CalculateYPositionButton=function CalculateYPositionButton()
{var bResult=false;if(this.GetOriginalHeight()==-1)
{var iHeight=0;if(this.moLinkedImage)
{iHeight=this.moLinkedImage.height;if(iHeight==undefined)
{iHeight=0;}}
else if(this.miTextHeight==null)
{if(this.childNodes.length>1)
{this.style.width=this.miWidth+"px";var oTextNode=this.childNodes.item(1);this.miTextHeight=oTextNode.offsetTop+oTextNode.offsetHeight;}
else
{this.miTextHeight=0;}
iHeight=this.miTextHeight;}
else
{iHeight=this.miTextHeight;}
if(iHeight!=this.GetHeight())
{this.SetHeight(iHeight);bResult=true;this.mbUpdateStyle=true;}}
bResult=this.CalculateYPositionControl()||bResult;return bResult;}
HTMLElement.prototype.RecursiveRemove=function()
{var oStack=new Array();oStack.push(this);var oCurrent;var oCtrlMgr=ControlMgr.GetInstance();while(oStack.length>0)
{oCurrent=oStack.pop();oCtrlMgr.RemovePositionItem(oCurrent);if(oCurrent.moContainerForChildrens&&oCurrent.moContainerForChildrens.length>0)
{for(var i=0;i<oCurrent.moContainerForChildrens.length;i++)
{oStack.push(oCurrent.moContainerForChildrens[i]);}}}}
HTMLElement.prototype.CalculateXPositionImage=function CalculateXPositionImage()
{var bResult=false;if(this.GetOriginalWidth()==-1)
{if(this.moLinkedImage!=null)
{var iWidth=this.moLinkedImage.offsetWidth;if(iWidth!=undefined&&iWidth!=this.miWidth)
{this.SetWidth(iWidth);bResult=true;this.mbUpdateStyle=true;}}}
bResult=this.CalculateXPositionControl()||bResult;if(bResult&&this.moLinkedImage!=null&&this.moLinkedImage.offsetHeight!=undefined)
{if(this.moProperties&&this.GetOriginalHeight()==-1&&this.GetOriginalWidth()!=-1&&this.moProperties.hasOwnProperty(AutoScaleProperties.Const.PROPERTY_POLICY))
{AutoScaleProperties.Apply(this);PositionMgr.GetInstance().AddToDirtyYList(this);}}
return bResult;}
HTMLElement.prototype.CalculateYPositionImage=function CalculateYPositionImage()
{var bResult=false;if(this.GetOriginalHeight()==-1)
{if(this.moLinkedImage!=null)
{var iHeight=this.moLinkedImage.offsetHeight;if(iHeight!=undefined&&iHeight!=this.miHeight)
{this.SetHeight(iHeight);bResult=true;this.mbUpdateStyle=true;}}}
bResult=this.CalculateYPositionControl()||bResult;if(bResult&&this.moLinkedImage!=null&&this.moLinkedImage.offsetHeight!=undefined)
{if(this.moProperties&&this.GetOriginalWidth()==-1&&this.GetOriginalHeight()!=-1&&this.moProperties.hasOwnProperty(AutoScaleProperties.Const.PROPERTY_POLICY))
{AutoScaleProperties.Apply(this);PositionMgr.GetInstance().AddToDirtyXList(this);}}
return bResult;}
HTMLElement.prototype.CalculateXPositionIFrame=function()
{var bResult=false;if(this.GetOriginalWidth()==-1)
{var iWidth=0;try
{iWidth=this.childNodes[0].contentWindow.document.body.offsetWidth;}
catch(e){}
if(iWidth!=undefined&&iWidth!=this.miWidth)
{this.SetWidth(iWidth);bResult=true;this.mbUpdateStyle=true;}}
bResult=this.CalculateXPositionControl()||bResult;return bResult;}
HTMLElement.prototype.CalculateYPositionIFrame=function()
{var bResult=false;if(this.GetOriginalHeight()==-1)
{var iHeight=0;try
{iHeight=this.childNodes[0].contentWindow.document.body.offsetHeight;}
catch(e){}
if(iHeight!=undefined&&iHeight!=this.miHeight)
{this.SetHeight(iHeight);bResult=true;this.mbUpdateStyle=true;}}
bResult=this.CalculateYPositionControl()||bResult;return bResult;}
HTMLElement.prototype.CalculateXPositionPanelTable=function CalculateXPositionPanelTable()
{var bResult=this.CalculateXPositionContainer();var iRealColNumber=0;if(this.GetContainerForChildren().length>0)
{iRealColNumber=(this.GetContainerForChildren()[0]).GetContainerForChildren().length;}
if(this.maiActualColWidth==null||bResult)
{var oChildrens=this.moContainerForChildrens;this.ComputeActualColWidth(iRealColNumber,oChildrens);var iTotalWidth=this.GetWidth();for(var i=0;i<oChildrens.length;i++)
{var oLine=oChildrens[i];oLine.OverrideOriginalWidth(iTotalWidth);oLine.ForceHasChanged();PositionMgr.GetInstance().AddToDirtyXList(oLine);var iXOffset=0;var oColumns=oLine.moContainerForChildrens;if(oColumns.length==1)
{var oColumn=oColumns[0];oColumn.OverrideOriginalWidth(iTotalWidth);oColumn.ForceHasChanged();PositionMgr.GetInstance().AddToDirtyXList(oColumn);}
else
{for(var j=0;j<oColumns.length;j++)
{oColumn=oColumns[j];if(oColumn!=null)
{oColumn.OverrideOriginalWidth(this.maiActualColWidth[j]);oColumn.miXOff=iXOffset;iXOffset+=this.maiActualColWidth[j];oColumn.ForceHasChanged();PositionMgr.GetInstance().AddToDirtyXList(oColumn);}}}}}
return true;}
HTMLElement.prototype.ComputeActualColWidth=function ComputeActualColWidth(_iRealColNumber,_oChildrens)
{var iTotalWidth=this.GetWidth();this.maiActualColWidth=new Array();var iMinimumSize=0;var dGrowingZoneSize=0;for(var i=0;i<_iRealColNumber;i++)
{if(this.maiColWidth[i]!=null)
{if(this.maiColWidth[i]==-1)
{var oRepresentativeLine;if(_oChildrens.length==1)
{oRepresentativeLine=_oChildrens[0];}
else
{oRepresentativeLine=_oChildrens[Math.max(1,_oChildrens.length-1)];}
var oRepresentativeCol=oRepresentativeLine.moContainerForChildrens[i];oRepresentativeCol.OverrideOriginalWidth(-1);oRepresentativeCol.CalculateXPosition();this.maiActualColWidth[i]=oRepresentativeCol.GetWidth();}
else
{this.maiActualColWidth[i]=this.maiColWidth[i];}}
else
{this.maiActualColWidth[i]=100;}
iMinimumSize+=this.maiActualColWidth[i];if(this.mabCanGrow[i]==null||(this.mabCanGrow[i]==1))
{dGrowingZoneSize+=this.maiActualColWidth[i];}}
var dSpaceToFill=iTotalWidth-iMinimumSize;var dGrowthFactor=Math.max(1,(dSpaceToFill+dGrowingZoneSize)/dGrowingZoneSize);var iActualTotalWidth=0;for(i=0;i<_iRealColNumber;i++)
{if(this.mabCanGrow[i]==null||(this.mabCanGrow[i]==1))
{this.maiActualColWidth[i]*=dGrowthFactor;}
iActualTotalWidth+=this.maiActualColWidth[i];}}
HTMLElement.prototype.GetFixedAspectRatio=function()
{var dResult=-1;var bKeepAR=this.GetProperty(ConstProperties.Const.RESIZE_KEEP_RATIO);if(bKeepAR)
{var iMaxResizeWidth=this.GetProperty(ConstProperties.Const.MAX_RESIZE_WIDTH);var iMaxResizeHeight=this.GetProperty(ConstProperties.Const.MAX_RESIZE_HEIGHT);if(iMaxResizeWidth!=0&&iMaxResizeHeight!=0)
{dResult=parseFloat(iMaxResizeWidth)/parseFloat(iMaxResizeHeight);}}
return dResult;}
PositionItem.getAbsoluteXY=function(el)
{var parentNode=null;var pos=[];pos=[el.x,el.y];if(pos[0]==null)
{pos[0]=0;}
if(pos[1]==null)
{pos[1]=0;}
parentNode=el.moParent;if(parentNode!=el)
{while(parentNode)
{if(parentNode.x)
{pos[0]+=parentNode.x;}
if(parentNode.scrollLeft)
{pos[0]-=parentNode.scrollLeft;}
if(parentNode.y!=undefined)
{pos[1]+=parentNode.y;}
else if(parentNode.offsetTop&&parentNode.moParent!=undefined)
{pos[1]+=parentNode.offsetTop;}
if(parentNode.scrollTop)
{pos[1]-=parentNode.scrollTop;}
parentNode=parentNode.moParent;}}
if(pos[0]==null)
{pos[0]=0;}
if(pos[1]==null)
{pos[1]=0;}
return pos;}
HTMLElement.prototype.localToGlobal=function(_oPoint)
{var oPoint=PositionItem.getAbsoluteXY(this);return new Point(oPoint[0]+_oPoint.x,oPoint[1]+_oPoint.y);}
HTMLElement.prototype.globalToLocal=function(_oPoint)
{var oPoint=PositionItem.getAbsoluteXY(this);return new Point(_oPoint.x-oPoint[0],_oPoint.y-oPoint[1]);}
HTMLElement.prototype.offsetBetweenControls=function(_oDistantControl)
{var _oDistantControlPoint=PositionItem.getAbsoluteXY(_oDistantControl);var _oControlPoint=PositionItem.getAbsoluteXY(this);return new Point(_oDistantControlPoint[0]-_oControlPoint[0],_oDistantControlPoint[1]-_oControlPoint[1])}
HTMLElement.prototype.ForceHasChanged=function()
{this.mbXMustBeCalculated=true;this.mbYMustBeCalculated=true;}
HTMLElement.prototype.CopyDependenciesTo=function(_oControl)
{var oDependency;for(var i=0;i<this.moXDependents.length;i++)
{oDependency=this.moXDependents[i];oDependency.ReplaceSource(_oControl,false);}
this.moXDependents=new Array();for(var i=0;i<this.moYDependents.length;i++)
{oDependency=this.moYDependents[i];oDependency.ReplaceSource(_oControl,false);}
this.moYDependents=new Array();}
HTMLElement.prototype.FixAddDependency=function(_oControl)
{if(this.GetOriginalWidth()==-1||this.ForceXChildrenDependence())
{new Dependency(_oControl,this,Dependency.Const.TYPE_PARENT,Dependency.Const.SUBTYPE_NONE,null,Dependency.Const.AXIS_X);}
if(this.GetOriginalHeight()==-1||this.ForceYChildrenDependence())
{new Dependency(_oControl,this,Dependency.Const.TYPE_PARENT,Dependency.Const.SUBTYPE_NONE,null,Dependency.Const.AXIS_Y);}}
HTMLElement.prototype.AddControl=function(_oControl,_oOldControl,_oNextVForm)
{_oControl.moParent=this;if(this.moContainerForChildrens==null)
{return;}
if(_oOldControl!=null)
{if(_oOldControl==_oControl)
{this.moContainerForChildrens.splice(this.moContainerForChildrens.indexOf(_oOldControl),1);if(_oNextVForm!=null)
{this.moContainerForChildrens.splice(this.moContainerForChildrens.indexOf(_oNextVForm),0,_oControl);}
else
{this.moContainerForChildrens.push(_oControl);}}
else
{var iOldControlIndex=this.moContainerForChildrens.indexOf(_oOldControl);if(iOldControlIndex!=-1)
{this.moContainerForChildrens.splice(iOldControlIndex,1,_oControl);}
else
{this.moContainerForChildrens.push(_oControl);}}}
else if(_oNextVForm!=null)
{this.moContainerForChildrens.splice(this.moContainerForChildrens.indexOf(_oNextVForm),0,_oControl);}
else
{this.moContainerForChildrens.push(_oControl);}}
HTMLElement.prototype.OverrideOriginalWidth=function(_iWidth)
{this.miOriginalWidth=_iWidth;}
HTMLElement.prototype.OverrideOriginalHeight=function(_iHeight)
{this.miOriginalHeight=_iHeight;}
HTMLElement.prototype._Debug=function _Debug(oParentNode)
{var oControl=document.createElement('CONTROL');oParentNode.appendChild(oControl);oControl.setAttribute("name",this.msId);for(var i=0;i<this.moContainerForChildrens.length;i++)
{this.moContainerForChildrens[i]._Debug(oControl);}
if(this.moXDependents.length>0)
{var oDependencies=document.createElement('DEPENDENCIES_X');oControl.appendChild(oDependencies);for(var i=0;i<this.moXDependents.length;i++)
{var oDep=document.createElement('dep_X');oDependencies.appendChild(oDep);oDep.innerHTML=this.moXDependents[i].toString();}}
if(this.moYDependents.length>0)
{var oDependencies=document.createElement('DEPENDENCIES_Y');oControl.appendChild(oDependencies);for(var i=0;i<this.moYDependents.length;i++)
{var oDep=document.createElement('dep_Y');oDependencies.appendChild(oDep);oDep.innerHTML=this.moYDependents[i].toString();}}}
HTMLElement.prototype.IsUnderMouse=function(oEvt,_bTolerant)
{var oControlPoint=PositionItem.getAbsoluteXY(this);if(_bTolerant)
{return(oEvt.pageX>=oControlPoint[0]&&oEvt.pageX<=(oControlPoint[0]+this.GetWidth())&&oEvt.pageY>=oControlPoint[1]&&oEvt.pageY<=(oControlPoint[1]+this.GetHeight()))}
else
{return(oEvt.pageX>oControlPoint[0]&&oEvt.pageX<(oControlPoint[0]+this.GetWidth())&&oEvt.pageY>oControlPoint[1]&&oEvt.pageY<(oControlPoint[1]+this.GetHeight()))}}
HTMLElement.prototype.GetAlternativeID=function()
{var sResult=null;var sInstanceName=this.GetProperty(ConstProperties.Const.PROPERTY_INSTANCE_NAME);if(sInstanceName!=null)
{var sID=this.GetId();sResult=sID.substr(0,sID.lastIndexOf(Matrix3.Const.SEPARATOR_HIERARCHY))+Matrix3.Const.SEPARATOR_CONTROL+sInstanceName;}
return sResult;}
function getStyle(elem,style){if(window.getComputedStyle)return window.getComputedStyle(elem,null).getPropertyValue(style);if(elem.currentStyle)return elem.currentStyle[camelConv(style)];return false;};function PositionMgr()
{this.moXDirtyHeap=new ControlHeap();this.moYDirtyHeap=new ControlHeap();}
PositionMgr.Const={MGR_NAME:"Position",MAX_POSITIONING_DURATION:4000,RELEVENT_LOOP_IDENTIFICATION_ITERATIONS:2000,MAX_ITER_ON_SAME_CONTROL:500};DebugTooltip={FLASH_EDIT_BTN_ID:"Debug_VForm_LaunchFlashEditBtn"};PositionMgr.moSingleton=null;PositionMgr.GetInstance=function()
{if(!PositionMgr.moSingleton){PositionMgr.moSingleton=new PositionMgr();}
return PositionMgr.moSingleton;};PositionMgr.prototype={CalculatePosition:function(_bNoScrollbars,_bFirstCall)
{if(_bNoScrollbars==null)
{_bNoScrollbars=true;}
if(_bFirstCall==null)
{_bFirstCall=true;}
this.SetButtonStyleBlock(false);var bPosTweening=this.mdTweenDuration>0;this.miLastReposDate=new Date().getTime();if(_bFirstCall)
{SequenceLoadingMgr.GetInstance().PrePositioning();if(bPosTweening||this.mbLastPosHadTweening)
{var aoControls=ControlMgr.GetInstance().GetAllPositionItems();for(var sKey in aoControls)
{var oControl=aoControls[sKey];oControl.SavePrePositionState();}}}
if(!_bNoScrollbars)
{ResizeMgr.GetInstance().AssumeLateralScrollbarVisible();}
else
{ResizeMgr.GetInstance().AssumeLateralScrollbarHidden();}
var bXDirtyLeft=this.moXDirtyHeap.Peek()!=null;var bYDirtyLeft=this.moYDirtyHeap.Peek()!=null;var oDependency;var iSteps=0;this.mbTrackControlPositioning=false;while(bXDirtyLeft||bYDirtyLeft)
{while(bXDirtyLeft)
{var oXDirtyControl;oXDirtyControl=this.moXDirtyHeap.Pop();if(this.mbTrackControlPositioning)
{var sID=oXDirtyControl.GetId();if(!this.moControlFrequencyTable.hasOwnProperty(sID))
{this.moControlFrequencyTable[sID]=0;}
this.moControlFrequencyTable[sID]=parseInt(this.moControlFrequencyTable[sID])+1;this.miIterationsTracked++;}
if(oXDirtyControl.CalculateXPosition())
{for(var oDependency in oXDirtyControl.GetXDependents())
{var oDependant=oXDirtyControl.GetXDependents()[oDependency].GetDestination();this.moXDirtyHeap.Add(oDependant);if(oDependant.msCtrlType==PositionItem.Const.CONTROL_TYPE_FLOAT_PANEL)
{this.moYDirtyHeap.Add(oDependant);}}}
iSteps++;bXDirtyLeft=this.moXDirtyHeap.Peek()!=null;if(iSteps%1000==0&&(new Date().getTime()-this.miLastReposDate>PositionMgr.Const.MAX_POSITIONING_DURATION))
{if(this.mbTrackControlPositioning===false)
{this.mbTrackControlPositioning=true;this.miIterationsTracked=0;this.moControlFrequencyTable=new Object();}
else if(this.miIterationsTracked>=PositionMgr.Const.RELEVENT_LOOP_IDENTIFICATION_ITERATIONS)
{var bRealLoop=false;for(var sID in this.moControlFrequencyTable)
{if(this.moControlFrequencyTable[sID]>=PositionMgr.Const.MAX_ITER_ON_SAME_CONTROL)
{bRealLoop=true;break;}}
if(bRealLoop)
{if(ControlMgr.GetInstance().GetReference(DebugTooltip.FLASH_EDIT_BTN_ID)==null)
{return false;}
else
{var sLoopReport="\n------------------------------------------------------\nPositioning loop detected on X axis\n------------------------------------------------------\n";sLoopReport+="Involved controls :\nIterations | Control ID\n";for(var sID in this.moControlFrequencyTable)
{sLoopReport+=this.moControlFrequencyTable[sID]+" | "+sID+"\n";}
alert(sLoopReport);this.moXDirtyHeap=new ControlHeap();this.moYDirtyHeap=new ControlHeap();return false;}}}}}
bYDirtyLeft=this.moYDirtyHeap.Peek()!=null;while(bYDirtyLeft)
{var oYDirtyControl;oYDirtyControl=this.moYDirtyHeap.Pop();if(this.mbTrackControlPositioning)
{var sID=oYDirtyControl.GetId();if(!this.moControlFrequencyTable.hasOwnProperty(sID))
{this.moControlFrequencyTable[sID]=0;}
this.moControlFrequencyTable[sID]=parseInt(this.moControlFrequencyTable[sID])+1;this.miIterationsTracked++;}
if(oYDirtyControl.CalculateYPosition())
{for(var oDependency in oYDirtyControl.GetYDependents())
{var oDependant=oYDirtyControl.GetYDependents()[oDependency].GetDestination();this.moYDirtyHeap.Add(oDependant);if(oDependant.msCtrlType==PositionItem.Const.CONTROL_TYPE_FLOAT_PANEL)
{this.moXDirtyHeap.Add(oDependant);}}}
iSteps++;bYDirtyLeft=this.moYDirtyHeap.Peek()!=null;if(iSteps%1000==0&&(new Date().getTime()-this.miLastReposDate>PositionMgr.Const.MAX_POSITIONING_DURATION))
{if(this.mbTrackControlPositioning===false)
{this.mbTrackControlPositioning=true;this.miIterationsTracked=0;this.moControlFrequencyTable=new Object();}
else if(this.miIterationsTracked>=PositionMgr.Const.RELEVENT_LOOP_IDENTIFICATION_ITERATIONS)
{var bRealLoop=false;for(var sID in this.moControlFrequencyTable)
{if(this.moControlFrequencyTable[sID]>=PositionMgr.Const.MAX_ITER_ON_SAME_CONTROL)
{bRealLoop=true;break;}}
if(bRealLoop)
{if(ControlMgr.GetInstance().GetReference(DebugTooltip.FLASH_EDIT_BTN_ID)==null)
{return false;}
else
{var sLoopReport="\n------------------------------------------------------\nPositioning loop detected on Y axis\n------------------------------------------------------\n";sLoopReport+="Involved controls :\nIterations | Control ID\n";for(var sID in this.moControlFrequencyTable)
{sLoopReport+=this.moControlFrequencyTable[sID]+" | "+sID+"\n";}
alert(sLoopReport);this.moXDirtyHeap=new ControlHeap();this.moYDirtyHeap=new ControlHeap();return false;}}}}}
bXDirtyLeft=this.moXDirtyHeap.Peek()!=null;}
if(_bNoScrollbars&&(ControlMgr.GetInstance().GetRootPositionItem()!=null&&ControlMgr.GetInstance().GetRootPositionItem().miHeight>=Utils.GetViewportHeight()))
{var aoControls=ControlMgr.GetInstance().GetAllPositionItems();for(var sKey in aoControls)
{var oControl=aoControls[sKey];if(oControl.IsUpdateStyle()||oControl.moFloatingParent!=null)
{oControl.TransferPositioningToDOM();}}
this.CalculatePosition(false,false);}
else
{var iStopTime=new Date().getTime();var aoControls=ControlMgr.GetInstance().GetAllPositionItems();var aPositionGroupItemStack=[];for(var sKey in aoControls)
{var oControl=aoControls[sKey];if(oControl.IsUpdateStyle())
{oControl.ApplyStyle();oControl.TransferPositioningToDOM();}
if(oControl.moFloatingParent!=null)
{aPositionGroupItemStack.push(oControl);}
oControl.ApplyPostPositionProperties();}
for(var i in aPositionGroupItemStack)
{var oPosItem=aPositionGroupItemStack[i];if(oPosItem.moPosDecider!=null)
{oPosItem.moPosDecider.CalculateFloatingPosition();}
else
{oPosItem.CalculateXPosition();oPosItem.CalculateYPosition();}}
for(var i in aPositionGroupItemStack)
{aPositionGroupItemStack[i].TransferPositioningToDOM();}
this.SetButtonStyleBlock(true);if(bPosTweening)
{for(var sKey in aoControls)
{var oControl=aoControls[sKey];oControl.ApplyTweening(this.mdTweenDuration);}}
this.mbLastPosHadTweening=bPosTweening;this.mdTweenDuration=0.0;}
if(_bFirstCall)
{SizeLearningMgr.PositioningFinished();SequenceLoadingMgr.GetInstance().PostPositioning();ScrollTargetMgr.RefreshAllVisibility();}},AddToDirtyXList:function(_oControl)
{this.moXDirtyHeap.Add(_oControl);},AddToDirtyYList:function(_oControl)
{this.moYDirtyHeap.Add(_oControl);},ReInit:function()
{PositionMgr.moSingleton=new PositionMgr();},SetButtonStyleBlock:function(_bEnable)
{}}
function PostRenderMgr()
{this.maoFunctions=new Array();}
PostRenderMgr.moSingleton=null;PostRenderMgr.GetInstance=function()
{if(!PostRenderMgr.moSingleton){PostRenderMgr.moSingleton=new PostRenderMgr();}
return PostRenderMgr.moSingleton;};PostRenderMgr.prototype={AddFunction:function(_oFunc,_bAddedByEvalScript)
{if((_bAddedByEvalScript||!Matrix3.mbContentIsLoaded)&&!Matrix3.mbIsInit)
{this.maoFunctions.push(_oFunc);}},ExecuteFunctions:function()
{for(var i=0;i<this.maoFunctions.length;i++)
{this.maoFunctions[i]();}
this.maoFunctions=new Array();},GetFunctions:function()
{return this.maoFunctions;},Clear:function()
{this.maoFunctions=new Array();}};function Point(_iX,_iY)
{this.x=parseInt(_iX);this.y=parseInt(_iY);}
function ResizeMgr()
{var oScreenSize=this.GetScreenSize();this.miMinScreenWidth=700;this.moAnchorScreen=document.createElement('div');this.moAnchorScreen.setAttribute("id","AnchorFlashMatrix3Screen:"+ConstValues.Const.SCREEN);this.moAnchorScreen.Setup(this.moAnchorScreen,"Anchor",null,"0",null,"0",new String(Math.max(this.miMinScreenWidth,oScreenSize.x-this.miScollbarSize)),new String(oScreenSize.y),null,null,null,null,null,null,null);this.moAnchorScreen.SetDeep(ResizeMgr.Const.INT_MAX_VALUE);this.moAnchorPopupBase=document.createElement('div');this.moAnchorPopupBase.setAttribute("id","AnchorFlashMatrix3Screen:"+ConstValues.Const.SCREEN);this.moAnchorPopupBase.Setup(this.moAnchorPopupBase,"Anchor",null,"0",null,"0",new String(Math.max(this.miMinScreenWidth,oScreenSize.x-this.miScollbarSize)-ResizeMgr.Const.POPUP_MARGIN),new String(oScreenSize.y-ResizeMgr.Const.POPUP_MARGIN),null,null,null,null,null,null,null);this.moAnchorPopupBase.SetDeep(ResizeMgr.Const.INT_MAX_VALUE);ControlMgr.GetInstance().AddPositionItem(this.moAnchorPopupBase);this.moAnchorScreen;this.moAnchorPopupBase;this.miScollbarSize;}
ResizeMgr.Const={SCROLLBARS_SIZE:0,POPUP_MARGIN:16,INT_MAX_VALUE:999999};ResizeMgr.moSingleton=null;ResizeMgr.GetInstance=function()
{if(!ResizeMgr.moSingleton){ResizeMgr.moSingleton=new ResizeMgr();}
return ResizeMgr.moSingleton;};ResizeMgr.prototype={Clean:function()
{this.moSingleton=new ResizeMgr();},GetScrollbarSize:function()
{return this.miScollbarSize;},ExportScreenToLists:function()
{ControlMgr.GetInstance().AddReference(ConstValues.Const.SCREEN,this.moAnchorScreen);PositionMgr.GetInstance().AddToDirtyXList(this.moAnchorScreen);PositionMgr.GetInstance().AddToDirtyYList(this.moAnchorScreen);this.moAnchorScreen.ForceHasChanged();},Resize:function()
{var oScreenSize=this.GetScreenSize();this.moAnchorScreen.SetWidth(Math.max(this.miMinScreenWidth,oScreenSize.x-this.miScollbarSize));this.moAnchorPopupBase.SetWidth(Math.max(this.miMinScreenWidth,oScreenSize.x-this.miScollbarSize)-ResizeMgr.Const.POPUP_MARGIN);this.moAnchorScreen.SetHeight(oScreenSize.y);this.moAnchorPopupBase.SetHeight(oScreenSize.y-ResizeMgr.Const.POPUP_MARGIN);this.moAnchorScreen.ForceHasChanged();PositionMgr.GetInstance().AddToDirtyXList(ResizeMgr.GetInstance().moAnchorScreen);PositionMgr.GetInstance().AddToDirtyYList(ResizeMgr.GetInstance().moAnchorScreen);if(ControlMgr.GetInstance().GetRootPositionItem()!=null)
{PositionMgr.GetInstance().CalculatePosition();}},AssumeLateralScrollbarVisible:function()
{this.miScollbarSize=ResizeMgr.Const.SCROLLBARS_SIZE;var oScreenSize=this.GetScreenSize();this.moAnchorScreen.SetWidth(Math.max(this.miMinScreenWidth,oScreenSize.x-this.miScollbarSize));this.moAnchorPopupBase.SetWidth(Math.max(this.miMinScreenWidth,oScreenSize.x-this.miScollbarSize)-ResizeMgr.Const.POPUP_MARGIN);PositionMgr.GetInstance().AddToDirtyXList(this.moAnchorScreen);PositionMgr.GetInstance().AddToDirtyYList(this.moAnchorScreen);this.moAnchorScreen.ForceHasChanged();},AssumeLateralScrollbarHidden:function()
{this.miScollbarSize=0;var oScreenSize=this.GetScreenSize();this.moAnchorScreen.SetWidth(Math.max(this.miMinScreenWidth,oScreenSize.x-this.miScollbarSize));this.moAnchorPopupBase.SetWidth(Math.max(this.miMinScreenWidth,oScreenSize.x-this.miScollbarSize)-ResizeMgr.Const.POPUP_MARGIN);PositionMgr.GetInstance().AddToDirtyXList(this.moAnchorScreen);PositionMgr.GetInstance().AddToDirtyYList(this.moAnchorScreen);this.moAnchorScreen.ForceHasChanged();},AddToResizeXList:function(_oControl)
{new Dependency(this.moAnchorScreen,_oControl,Dependency.Const.TYPE_REFERENCE,Dependency.Const.SUBTYPE_SIZE,null,Dependency.Const.AXIS_X);},AddToResizeYList:function(_oControl)
{new Dependency(this.moAnchorScreen,_oControl,Dependency.Const.TYPE_REFERENCE,Dependency.Const.SUBTYPE_SIZE,null,Dependency.Const.AXIS_Y);},GetScreenAnchor:function()
{return this.moAnchorScreen;},GetPopupBaseAnchor:function()
{return this.moAnchorPopupBase;},GetScreenSize:function()
{var oResult;var iWidht=Utils.GetViewportWidth();var iHeight=Utils.GetViewportHeight();if((iWidht!=null)&&(iHeight!=null))
{oResult=new Point(iWidht,iHeight);}
else
{oResult=new Point(1280,1024);}
return oResult;},ReInit:function()
{ResizeMgr.moSingleton=new ResizeMgr();}}
ResizeMgr.SendResToServer=function()
{YAHOO.util.Connect.asyncRequest("GET","htm/Resolution.aspx?W="+Utils.GetViewportWidth()+"&H="+Utils.GetViewportHeight(),null,null);}
var Utils={Const:{GROUP_SEPARATOR:",",SUFFIX_LABEL:"_Lbl",TAG_RESOLUTION_WIDTH:"\\[RESOLUTION_WIDTH\\]",TAG_RESOLUTION_HEIGHT:"\\[RESOLUTION_HEIGHT\\]",OPTION_SEPARATOR:";",OPTION_VALUE_SEPARATOR:":",SEPARATOR_VALUE:"|"},HashToParameters:function(_oHashtable)
{var sResult="";if(_oHashtable instanceof Object)
{for(var sKey in _oHashtable)
{sResult+="&"+sKey+"="+encodeURIComponent(_oHashtable[sKey]);}
if(sResult.length!=0)
{sResult=sResult.substr(1);}}
return sResult;},IsString:function(_oObj)
{var bool=YAHOO.lang.isString(_oObj);return bool;},IsStringFilled:function(_oObj)
{var bool=YAHOO.lang.isString(_oObj)&&(_oObj!="");return bool;},GetLogSize:function()
{return YAHOO.widget.Logger.getStack().length;},IsMouseLeaveOrEnter:function(e,handler)
{if(e.type!='mouseout'&&e.type!='mouseover'&&e.type!='mouseup')return false;var reltg;if(e.relatedTarget)
{reltg=e.relatedTarget;}
else if(e.type=='mouseout')
{reltg=e.toElement;}
else if(e.type=="mouseover")
{reltg=e.fromElement;}
else if(e.type=="mouseup")
{reltg=(e.target)?e.target:e.srcElement;}
while(reltg&&reltg!=handler)
{reltg=reltg.parentNode;}
return(reltg!=handler);},GetHeight:function(elm,_bNumber)
{var elm=$(elm);var h=$S(elm,"height");if(h=="auto")
{$SetStyle(elm,"zoom","1");h=elm.clientHeight+"px";}
if(_bNumber)
{try
{h=parseInt(h);}
catch(e)
{h=parseInt(h.substring(0,h.length-2));}}
return h;},GetWidth:function(elm,_bNumber)
{var elm=$(elm);var h=$S(elm,"width");if(h=="auto")
{$SetStyle(elm,"zoom","1");h=elm.clientWidth+"px";}
if(_bNumber)
{try
{h=parseInt(h);}
catch(e)
{h=parseInt(h.substring(0,h.length-2));}}
return h;},GetAbsoluteWidth:function(_oElm)
{_oElm=$(_oElm);var iChildWidth=Utils.GetWidth(_oElm,true);var iChildMarginLeft=parseInt($S(_oElm,"marginLeft"));var iChildMarginRight=parseInt($S(_oElm,"marginRight"));var iChildBorderLeft=parseInt($S(_oElm,"borderLeft"));var iChildBorderRight=parseInt($S(_oElm,"borderRight"));if(isNaN(iChildWidth))iChildWidth=0;if(isNaN(iChildMarginLeft))iChildMarginLeft=0;if(isNaN(iChildMarginRight))iChildMarginRight=0;if(isNaN(iChildBorderLeft))iChildBorderLeft=0;if(isNaN(iChildBorderRight))iChildBorderRight=0;var iWidth=iChildWidth+iChildMarginLeft+iChildMarginRight+iChildBorderLeft+iChildBorderRight;return iWidth;},GetAbsoluteHeight:function(_oElm)
{_oElm=$(_oElm);var iChildHeight=Utils.GetHeight(_oElm,true);var iChildMarginTop=parseInt($S(_oElm,"marginTop"));var iChildMarginBottom=parseInt($S(_oElm,"marginBottom"));var iChildBorderTop=parseInt($S(_oElm,"borderTop"));var iChildBorderBottom=parseInt($S(_oElm,"borderBottom"));if(isNaN(iChildHeight))iChildHeight=0;if(isNaN(iChildMarginTop))iChildMarginTop=0;if(isNaN(iChildMarginBottom))iChildMarginBottom=0;if(isNaN(iChildBorderTop))iChildBorderTop=0;if(isNaN(iChildBorderBottom))iChildBorderBottom=0;var iHeight=iChildHeight+iChildMarginTop+iChildMarginBottom+iChildBorderTop+iChildBorderBottom;return iHeight;},GetX:function(elm)
{var iX=YAHOO.util.Dom.getX(elm);return iX;},GetY:function(elm)
{var iY=YAHOO.util.Dom.getY(elm);return iY;},Trim:function(_sStr)
{var sResult;if(_sStr)sResult=Utils.LeftTrim(Utils.RightTrim(_sStr));else sResult="";return sResult;},LeftTrim:function(_sStr)
{var oExp=/^\s+/g;var sResult=_sStr.replace(oExp,"");return sResult;},RightTrim:function(_sStr)
{var oExp=/\s+$/g;var sResult=_sStr.replace(oExp,"");return sResult;},IsFirefox:function()
{var sBrowser=navigator.userAgent.toLowerCase();var bIsFirefox=(sBrowser.indexOf('firefox')!=-1)?true:false;return bIsFirefox;},IsIE:function()
{return YAHOO.env.ua.ie>0;},IsIE6:function()
{return YAHOO.env.ua.ie>0&&YAHOO.env.ua.ie<7;},IsSafari:function()
{return YAHOO.env.ua.webkit>0;},AddEvent:function(_oObj,_sEvent,_oFn,_oScope,_oArgs)
{_oObj=$(_oObj);if(_oObj)
{if(!_oScope)
{_oScope=_oObj;}
var oFn=function(e)
{return _oFn.call(_oScope,e,_oArgs);};if(window.addEventListener)
{_oObj.addEventListener(_sEvent,oFn,false);}else if(window.attachEvent)
{_oObj.attachEvent("on"+_sEvent,oFn);}}
_oObj=null;_sEvent=null;},DetachEvent:function(_oObj,_sEvent,_oFn)
{if(window.addEventListener)
{_oObj.removeEventListener(_sEvent,oFn,false);}else if(window.attachEvent)
{_oObj.detachEvent("on"+_sEvent,oFn);}
_oObj=null;_sEvent=null;_oFn=null;},GetPageWidth:function()
{var iWidth=YAHOO.util.Dom.getDocumentWidth();return iWidth;},GetPageHeight:function()
{var iHeight=YAHOO.util.Dom.getDocumentHeight();return iHeight;},GetViewportWidth:function()
{var iWidth=YAHOO.util.Dom.getViewportWidth();return iWidth;},GetViewportHeight:function()
{var iHeight=YAHOO.util.Dom.getViewportHeight();return iHeight;},GetScrollTop:function()
{var iScroll=YAHOO.util.Dom.getDocumentScrollTop();return iScroll;},GetScrollLeft:function()
{var iScroll=YAHOO.util.Dom.getDocumentScrollLeft();return iScroll;},Augment:function(_oObj,_oToHeritObj)
{var oProp;for(oProp in _oToHeritObj.prototype)
{if(!(oProp in _oObj.prototype))
{_oObj.prototype[oProp]=_oToHeritObj.prototype[oProp];}}},OpenHelp:function(Link,WindowName)
{var Attributes='width=440, height=600,alwaysRaised=yes,toolbar=0,directories=0,menubar=0,status=1,resizable=yes,location=0,scrollbars=1,copyhistory=0,';var PositionAttributes='left='+(screen.width-440)+',top=0,screenX='+(screen.width-440)+',screenY=0';Attributes=Attributes+PositionAttributes;window.open(Link,WindowName,Attributes);},GetTextContent:function(_oNode)
{var sValue="";if(_oNode)
{if(_oNode.innerText)
{sValue=_oNode.innerText;}
else
{sValue=_oNode.textContent;}}
return sValue;},SetTextContent:function(_oNode,_sValue,_bHTML)
{if(_oNode)
{if(!_bHTML)
{if(_oNode.innerText)
{_oNode.innerText=_sValue;}
else
{_oNode.textContent=_sValue;}}
else
{_oNode.innerHTML=_sValue;}}},BuildMask:function(_sID,_sClass)
{var oMask=document.createElement("div");oMask.id=_sID;oMask.msIndex=StackMgr.GetInstance().GetIndex();$AddClass(oMask,_sClass);$SetStyle(oMask,"display","none");$SetStyle(oMask,"zIndex",""+oMask.msIndex);oMask.ResizeMask=function()
{$SetStyle(this,"width","100%");$SetStyle(this,"height","100%");var D=document;var iDocWidth=Math.max(Math.max(D.body.scrollWidth,D.documentElement.scrollWidth),Math.max(D.body.offsetWidth,D.documentElement.offsetWidth),Math.max(D.body.clientWidth,D.documentElement.clientWidth));var iDocHeight=Math.max(Math.max(D.body.scrollHeight,D.documentElement.scrollHeight),Math.max(D.body.offsetHeight,D.documentElement.offsetHeight),Math.max(D.body.clientHeight,D.documentElement.clientHeight));window.setTimeout('$SetStyle("'+this.id+'", "width", '+iDocWidth+'+"px");$SetStyle("'+this.id+'", "height", '+iDocHeight+'+"px");',1);};oMask.Show=function()
{this.mbIsVisible=true;$SetStyle(this,"display","block");this.ResizeMask();};oMask.Hide=function()
{this.mbIsVisible=false;$SetStyle(this,"display","none");};oMask.IsVisible=function()
{return this.mbIsVisible;};oMask.GetIndex=function()
{return this.msIndex;};Utils.AddEvent(window,"resize",oMask.ResizeMask,oMask);document.body.insertBefore(oMask,document.body.firstChild);return oMask;},TransformVirtualID:function(_sVirtualID)
{if(Utils.IsString(_sVirtualID))
{var oReg=new RegExp(Utils.Const.TAG_RESOLUTION_WIDTH,"g");_sVirtualID=_sVirtualID.replace(oReg,Utils.GetViewportWidth());oReg=new RegExp(Utils.Const.TAG_RESOLUTION_HEIGHT,"g");_sVirtualID=_sVirtualID.replace(oReg,Utils.GetViewportHeight());}
return _sVirtualID;},StartsWith:function(_sValue,_sStartValue)
{var bResult=false;if(Utils.IsString(_sValue)&&Utils.IsString(_sStartValue))
{bResult=(_sValue.indexOf(_sStartValue)==0);}
return bResult;},CloneNode:function(_oNode)
{var oClone=_oNode.cloneNode(false);var sInnerHTML='<span style="display:none;"><br /></span>'+_oNode.innerHTML;oClone.innerHTML=sInnerHTML;return oClone;},GetMousePosition:function(e)
{this.miMouseX=YAHOO.util.Event.getPageX(e);this.miMouseY=YAHOO.util.Event.getPageY(e);return new Array(this.miMouseX,this.miMouseY);},GetMousePositionX:function(event)
{var iX;if(event)
{iX=YAHOO.util.Event.getPageX(event);}
else
{iX=this.miMouseX;}
return iX;},GetMousePositionY:function(event)
{var iY;if(event)
{iY=YAHOO.util.Event.getPageY(event);}
else
{iY=this.miMouseY;}
return iY;},GetOptions:function(_sOptions)
{var oReturn=new Object();if(_sOptions)
{var oOptions=_sOptions.split(Utils.Const.OPTION_SEPARATOR);for(var i=0;i<oOptions.length;i++)
{var oValue=oOptions[i].split(Utils.Const.OPTION_VALUE_SEPARATOR);oReturn[oValue[0].toLowerCase()]=oValue[1];}}
return oReturn;},StopPropagation:function(e)
{e=e?e:window.event;if(e.stopPropagation)e.stopPropagation();if(e.preventDefault)e.preventDefault();e.cancelBubble=true;e.cancel=true;e.returnValue=false;return false;},CreateReference:function(_sNodeToReference)
{var sVFormID=_sNodeToReference.split(Matrix3.Const.SEPARATOR_CONTROL)[0];if(!(sVFormID in Matrix3.moReferences))
{Matrix3.moReferences[sVFormID]=new Object();}
Matrix3.moReferences[sVFormID][_sNodeToReference]=true;},ParseBool:function(_sBool)
{_sBool=_sBool.toLowerCase();if(_sBool=="1"||_sBool=="true"||_sBool=="yes"||_sBool=="on")
{return true;}
else
{return false;}},LoadScript:function(_sUrl,_fCallback)
{var script=document.createElement("script")
script.type="text/javascript";if(script.readyState)
{script.onreadystatechange=function()
{if(script.readyState=="loaded"||script.readyState=="complete")
{script.onreadystatechange=null;_fCallback();}};}else
{script.onload=function()
{_fCallback();};}
script.src=_sUrl;document.getElementsByTagName("head")[0].appendChild(script);}};if(typeof YAHOO=="undefined"){var YAHOO={};}
YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}
return o;};YAHOO.log=function(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.register=function(name,mainClass,data){var mods=YAHOO.env.modules;if(!mods[name]){mods[name]={versions:[],builds:[]};}
var m=mods[name],v=data.version,b=data.build,ls=YAHOO.env.listeners;m.name=name;m.version=v;m.build=b;m.versions.push(v);m.builds.push(b);m.mainClass=mainClass;for(var i=0;i<ls.length;i=i+1){ls[i](m);}
if(mainClass){mainClass.VERSION=v;mainClass.BUILD=b;}else{YAHOO.log("mainClass is undefined for module "+name,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(name){return YAHOO.env.modules[name]||null;};YAHOO.env.ua=function()
{var o={ie:0,opera:0,gecko:0,webkit:0,ipad:0};var ua=navigator.userAgent,m;if((/KHTML/).test(ua))
{o.webkit=1;}
m=ua.match(/AppleWebKit\/([^\s]*)/);if(m&&m[1])
{o.webkit=parseFloat(m[1]);}
if((ua.match(/iPhone/i))||(ua.match(/iPod/i)))
{o.ipad=1;}
if(!o.webkit)
{m=ua.match(/Opera[\s\/]([^\s]*)/);if(m&&m[1])
{o.opera=parseFloat(m[1]);}else
{m=ua.match(/MSIE\s([^;]*)/);if(m&&m[1])
{o.ie=parseFloat(m[1]);}else
{m=ua.match(/Gecko\/([^\s]*)/);if(m)
{o.gecko=1;m=ua.match(/rv:([^\s\)]*)/);if(m&&m[1])
{o.gecko=parseFloat(m[1]);}}}}}
return o;}();(function(){YAHOO.namespace("util","widget","example");if(typeof YAHOO_config!="undefined"){var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;if(l){for(i=0;i<ls.length;i=i+1){if(ls[i]==l){unique=false;break;}}
if(unique){ls.push(l);}}}})();YAHOO.lang={isArray:function(o){if(o){var l=YAHOO.lang;return l.isNumber(o.length)&&l.isFunction(o.splice)&&!l.hasOwnProperty(o.length);}
return false;},isBoolean:function(o){return typeof o==='boolean';},isFunction:function(o){return typeof o==='function';},isNull:function(o){return o===null;},isNumber:function(o){return typeof o==='number'&&isFinite(o);},isObject:function(o){return(o&&(typeof o==='object'||YAHOO.lang.isFunction(o)))||false;},isString:function(o){return typeof o==='string';},isUndefined:function(o){return typeof o==='undefined';},hasOwnProperty:function(o,prop){if(Object.prototype.hasOwnProperty){return o.hasOwnProperty(prop);}
return!YAHOO.lang.isUndefined(o[prop])&&o.constructor.prototype[prop]!==o[prop];},_IEEnumFix:function(r,s){if(YAHOO.env.ua.ie){var add=["toString","valueOf"];for(i=0;i<add.length;i=i+1){var fname=add[i],f=s[fname];if(YAHOO.lang.isFunction(f)&&f!=Object.prototype[fname]){r[fname]=f;}}}},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");}
var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;}
if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}
YAHOO.lang._IEEnumFix(subc.prototype,overrides);}},augmentObject:function(r,s){if(!s||!r){throw new Error("Absorb failed, verify dependencies.");}
var a=arguments,i,p,override=a[2];if(override&&override!==true){for(i=2;i<a.length;i=i+1){r[a[i]]=s[a[i]];}}else{for(p in s){if(override||!r[p]){r[p]=s[p];}}
YAHOO.lang._IEEnumFix(r,s);}},augmentProto:function(r,s){if(!s||!r){throw new Error("Augment failed, verify dependencies.");}
var a=[r.prototype,s.prototype];for(var i=2;i<arguments.length;i=i+1){a.push(arguments[i]);}
YAHOO.lang.augmentObject.apply(this,a);},dump:function(o,d){var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",COMMA=', ',ARROW=' => ';if(!l.isObject(o)||o instanceof Date||("nodeType"in o&&"tagName"in o)){return o;}else if(l.isFunction(o)){return FUN;}
d=(l.isNumber(d))?d:3;if(l.isArray(o)){s.push("[");for(i=0,len=o.length;i<len;i=i+1){if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
s.push(COMMA);}
if(s.length>1){s.pop();}
s.push("]");}else{s.push("{");for(i in o){if(l.hasOwnProperty(o,i)){s.push(i+ARROW);if(l.isObject(o[i])){s.push((d>0)?l.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
s.push(COMMA);}}
if(s.length>1){s.pop();}
s.push("}");}
return s.join("");},substitute:function(s,o,f){var i,j,k,key,v,meta,l=YAHOO.lang,saved=[],token,DUMP='dump',SPACE=' ',LBRACE='{',RBRACE='}';for(;;){i=s.lastIndexOf(LBRACE);if(i<0){break;}
j=s.indexOf(RBRACE,i);if(i+1>=j){break;}
token=s.substring(i+1,j);key=token;meta=null;k=key.indexOf(SPACE);if(k>-1){meta=key.substring(k+1);key=key.substring(0,k);}
v=o[key];if(f){v=f(key,v,meta);}
if(l.isObject(v)){if(l.isArray(v)){v=l.dump(v,parseInt(meta,10));}else{meta=meta||"";var dump=meta.indexOf(DUMP);if(dump>-1){meta=meta.substring(4);}
if(v.toString===Object.prototype.toString||dump>-1){v=l.dump(v,parseInt(meta,10));}else{v=v.toString();}}}else if(!l.isString(v)&&!l.isNumber(v)){v="~-"+saved.length+"-~";saved[saved.length]=token;}
s=s.substring(0,i)+v+s.substring(j+1);}
for(i=saved.length-1;i>=0;i=i-1){s=s.replace(new RegExp("~-"+i+"-~"),"{"+saved[i]+"}","g");}
return s;},trim:function(s){try{return s.replace(/^\s+|\s+$/g,"");}catch(e){return s;}},merge:function(){var o={},a=arguments,i;for(i=0;i<a.length;i=i+1){YAHOO.lang.augmentObject(o,a[i],true);}
return o;},isValue:function(o){var l=YAHOO.lang;return(l.isObject(o)||l.isString(o)||l.isNumber(o)||l.isBoolean(o));}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.3.0",build:"442"});(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={},reClassNameCache={};var isOpera=YAHOO.env.ua.opera,isSafari=YAHOO.env.ua.webkit,isGecko=YAHOO.env.ua.gecko,isIE=YAHOO.env.ua.ie;var patterns={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i};var toCamel=function(property){return property;if(!patterns.HYPHEN.test(property)){return property;}
if(propertyCache[property]){return propertyCache[property];}
var converted=property;while(patterns.HYPHEN.exec(converted)){converted=converted.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}
propertyCache[property]=converted;return converted;};var getClassRegEx=function(className){var re=reClassNameCache[className];if(!re){re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');reClassNameCache[className]=re;}
return re;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;if(property=='float'){property='cssFloat';}
var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}
return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}
return val/100;case'float':property='styleFloat';default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};}
if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(YAHOO.lang.isString(el.style.filter)){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}
break;case'float':property='styleFloat';default:el.style[property]=val;}};}else{setStyle=function(el,property,val){if(property=='float'){property='cssFloat';}
el.style[property]=val;};}
var testElement=function(node,method){return node&&node.nodeType==1&&(!method||method(node));};YAHOO.util.Dom={get:function(el){if(!el||el.tagName||el.item){return el;}
if(YAHOO.lang.isString(el)){return $(el);}
if(el.splice){var c=[];for(var i=0,len=el.length;i<len;++i){c[c.length]=Y.Dom.get(el[i]);}
return c;}
return el;},getStyle:function(el,property){var f=function(element){return $S(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){var f=function(element){$SetStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||$S(el,'display')=='none')&&el!=document.body){return false;}
var parentNode=null;var pos=[];var box;var doc=el.ownerDocument;if(el.getBoundingClientRect){box=el.getBoundingClientRect();return[box.left+Y.Dom.getDocumentScrollLeft(el.ownerDocument),box.top+Y.Dom.getDocumentScrollTop(el.ownerDocument)];}
else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;var hasAbs=$S(el,'position')=='absolute';if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;if(isSafari&&!hasAbs&&$S(parentNode,'position')=='absolute'){hasAbs=true;}
parentNode=parentNode.offsetParent;}}
if(isSafari&&hasAbs){pos[0]-=el.ownerDocument.body.offsetLeft;pos[1]-=el.ownerDocument.body.offsetTop;}}
parentNode=el.parentNode;while(parentNode.tagName&&!patterns.ROOT_TAG.test(parentNode.tagName))
{if($S(parentNode,'display').search(/^inline|table-row.*$/i)){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}
parentNode=parentNode.parentNode;}
return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=$S(el,'position');if(style_pos=='static'){$SetStyle(el,'position','relative');style_pos='relative';}
var pageXY=this.getXY(el);if(pageXY===false){return false;}
var delta=[parseInt($S(el,'left'),10),parseInt($S(el,'top'),10)];if(isNaN(delta[0])){delta[0]=(style_pos=='relative')?0:el.offsetLeft;}
if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop;}
if(pos[0]!==null){$SetStyle(el,"left",pos[0]-pageXY[0]+delta[0]+'px');}
if(pos[1]!==null){$SetStyle(el,"top",pos[1]-pageXY[1]+delta[1]+'px');}
if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true);}}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||$S(el,'display')=='none')&&el!=document.body){return false;}
var region=Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}
var nodes=[],elements=root.getElementsByTagName(tag),re=getClassRegEx(className);for(var i=0,len=elements.length;i<len;++i){if(re.test(elements[i].className)){nodes[nodes.length]=elements[i];if(apply){apply.call(elements[i],elements[i]);}}}
return nodes;},hasClass:function(el,className){var re=getClassRegEx(className);var f=function(el){return re.test(el.className);};return Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return false;}
el.className=YAHOO.lang.trim([el.className,className].join(' '));return true;};return Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,className){var re=getClassRegEx(className);var f=function(el){if(!this.hasClass(el,className)){return false;}
var c=el.className;el.className=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}
el.className=YAHOO.lang.trim(el.className);return true;};return Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(!newClassName||oldClassName===newClassName){return false;}
var re=getClassRegEx(oldClassName);var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return true;}
el.className=el.className.replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}
el.className=YAHOO.lang.trim(el.className);return true;};return Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';var f=function(el){if(el&&el.id){return el.id;}
var id=prefix+id_counter++;if(el){el.id=id;}
return id;};return Y.Dom.batch(el,f,Y.Dom,true)||f.apply(Y.Dom,arguments);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false;}
var f=function(node){if(haystack.contains&&node.nodeType&&!isSafari){return haystack.contains(node);}
else if(haystack.compareDocumentPosition&&node.nodeType){return!!(haystack.compareDocumentPosition(node)&16);}else if(node.nodeType){return!!this.getAncestorBy(node,function(el){return el==haystack;});}
return false;};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){if(isSafari){while(el=el.parentNode){if(el==document.documentElement){return true;}}
return false;}
return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}
var nodes=[],elements=root.getElementsByTagName(tag);for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];if(apply){apply(elements[i]);}}}
return nodes;},batch:function(el,method,o,override){el=(el&&el.tagName)?el:Y.Dom.get(el);if(!el||!method){return false;}
var scope=(override)?o:window;if(el.tagName||(!el.item&&!el.slice)){return method.call(scope,el,o);}
var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=method.call(scope,el[i],o);}
return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}
return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}
return width;},getAncestorBy:function(node,method){while(node=node.parentNode){if(testElement(node,method)){return node;}}
return null;},getAncestorByClassName:function(node,className){node=Y.Dom.get(node);if(!node){return null;}
var method=function(el){return Y.Dom.hasClass(el,className);};return Y.Dom.getAncestorBy(node,method);},getAncestorByTagName:function(node,tagName){node=Y.Dom.get(node);if(!node){return null;}
var method=function(el){return el.tagName&&el.tagName.toUpperCase()==tagName.toUpperCase();};return Y.Dom.getAncestorBy(node,method);},getPreviousSiblingBy:function(node,method){while(node){node=node.previousSibling;if(testElement(node,method)){return node;}}
return null;},getPreviousSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}
return Y.Dom.getPreviousSiblingBy(node);},getNextSiblingBy:function(node,method){while(node){node=node.nextSibling;if(testElement(node,method)){return node;}}
return null;},getNextSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}
return Y.Dom.getNextSiblingBy(node);},getFirstChildBy:function(node,method){var child=(testElement(node.firstChild,method))?node.firstChild:null;return child||Y.Dom.getNextSiblingBy(node.firstChild,method);},getFirstChild:function(node,method){node=Y.Dom.get(node);if(!node){return null;}
return Y.Dom.getFirstChildBy(node);},getLastChildBy:function(node,method){if(!node){return null;}
var child=(testElement(node.lastChild,method))?node.lastChild:null;return child||Y.Dom.getPreviousSiblingBy(node.lastChild,method);},getLastChild:function(node){node=Y.Dom.get(node);return Y.Dom.getLastChildBy(node);},getChildrenBy:function(node,method){var child=Y.Dom.getFirstChildBy(node,method);var children=child?[child]:[];Y.Dom.getNextSiblingBy(child,function(node){if(!method||method(node)){children[children.length]=node;}
return false;});return children;},getChildren:function(node){node=Y.Dom.get(node);if(!node){}
return Y.Dom.getChildrenBy(node);},getDocumentScrollLeft:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);},getDocumentScrollTop:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);},insertBefore:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null;}
return referenceNode.parentNode.insertBefore(newNode,referenceNode);},insertAfter:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null;}
if(referenceNode.nextSibling){return referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling);}else{return referenceNode.parentNode.appendChild(newNode);}}};})();YAHOO.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};YAHOO.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(YAHOO.lang.isArray(x)){y=x[1];x=x[0];}
this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.3.0",build:"442"});YAHOO.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this.scope=oScope||window;this.silent=silent;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}
var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(!fn){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}
if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);}
this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){if(!fn){return this.unsubscribeAll();}
var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}
return found;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}
var args=[],ret=true,i,rebuild=false;for(i=0;i<arguments.length;++i){args.push(arguments[i]);}
var argslength=args.length;if(!this.silent){}
for(i=0;i<len;++i){var s=this.subscribers[i];if(!s){rebuild=true;}else{if(!this.silent){}
var scope=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var param=null;if(args.length>0){param=args[0];}
ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);}
if(false===ret){if(!this.silent){}
return false;}}}
if(rebuild){var newlist=[],subs=this.subscribers;for(i=0,len=subs.length;i<len;++i){s=subs[i];newlist.push(subs[i]);}
this.subscribers=newlist;}
return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}
this.subscribers=[];return i;},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}
this.subscribers[index]=null;},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=YAHOO.lang.isUndefined(obj)?null:obj;this.override=override;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}
return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var DOMReady=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;var webkitKeymap={63232:38,63233:40,63234:37,63235:39};return{POLL_RETRYS:4000,POLL_INTERVAL:10,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,startInterval:function(){if(!this._interval){var self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:false});retryCount=this.POLL_RETRYS;this.startInterval();},onDOMReady:function(p_fn,p_obj,p_override){if(DOMReady){setTimeout(function(){var s=window;if(p_override){if(p_override===true){s=p_obj;}else{s=p_override;}}
p_fn.call(s,"DOMReady",[],p_obj);},0);}else{this.DOMReadyEvent.subscribe(p_fn,p_obj,p_override);}},onContentReady:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:true});retryCount=this.POLL_RETRYS;this.startInterval();},addListener:function(el,sType,fn,obj,override){if(!fn||!fn.call){return false;}
if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=this.on(el[i],sType,fn,obj,override)&&ok;}
return ok;}else if(YAHOO.lang.isString(el)){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,sType,fn,obj,override);});return true;}}
if(!el){return false;}
if("unload"==sType&&obj!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,obj,override];return true;}
var scope=el;if(override){if(override===true){scope=obj;}else{scope=override;}}
var wrappedFn=function(e){return fn.call(scope,YAHOO.util.Event.getEvent(e),obj);};var li=[el,sType,fn,wrappedFn,scope];var index=listeners.length;listeners[index]=li;if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1||el!=legacyEvents[legacyIndex][0]){legacyIndex=legacyEvents.length;legacyMap[el.id+sType]=legacyIndex;legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];legacyHandlers[legacyIndex]=[];el["on"+sType]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),legacyIndex);};}
legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(ex){this.lastError=ex;this.removeListener(el,sType,fn);return false;}}
return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true,le,lh,li,scope,ret;lh=legacyHandlers[legacyIndex];for(var i=0,len=lh.length;i<len;++i){li=lh[i];if(li&&li[this.WFN]){scope=li[this.ADJ_SCOPE];ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}
le=legacyEvents[legacyIndex];if(le&&le[2]){le[2](e);}
return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(this.webkit&&("click"==sType||"dblclick"==sType)){var v=parseInt(this.webkit,10);if(!isNaN(v)&&v<418){return true;}}
return false;},removeListener:function(el,sType,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],sType,fn)&&ok);}
return ok;}
if(!fn||!fn.call){return this.purgeElement(el,false,sType);}
if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners[i]=null;return true;}}
return false;}
var cacheItem=null;var index=arguments[3];if("undefined"==typeof index){index=this._getCacheIndex(el,sType,fn);}
if(index>=0){cacheItem=listeners[index];}
if(!el||!cacheItem){return false;}
if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist[i]=null;break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(ex){this.lastError=ex;return false;}}
delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners[index]=null;return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}
return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}
return y;},getXY:function(ev){return[this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}
return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(ex){this.lastError=ex;return t;}}
return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}
c=c.caller;}}
return ev;},getCharCode:function(ev){var code=ev.keyCode||ev.charCode||0;if(YAHOO.env.ua.webkit&&(code in webkitKeymap)){code=webkitKeymap[code];}
return code;},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}
return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}
return id;},_isValidCollection:function(o){try{return(o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");}catch(e){return false;}},elCache:{},getEl:function(id){return $(id);},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(e){if(!loadComplete){loadComplete=true;var EU=YAHOO.util.Event;EU._ready();EU._tryPreloadAttach();}},_ready:function(e){if(!DOMReady){DOMReady=true;var EU=YAHOO.util.Event;EU.DOMReadyEvent.fire();EU._simpleRemove(document,"DOMContentLoaded",EU._ready);}},_tryPreloadAttach:function(){if(this.locked){return false;}
if(this.isIE){if(!DOMReady){this.startInterval();return false;}}
this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0);}
var notAvail=[];var executeItem=function(el,item){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}
item.fn.call(scope,item.obj);};var i,len,item,el;for(i=0,len=onAvailStack.length;i<len;++i){item=onAvailStack[i];if(item&&!item.checkReady){el=this.getEl(item.id);if(el){executeItem(el,item);onAvailStack[i]=null;}else{notAvail.push(item);}}}
for(i=0,len=onAvailStack.length;i<len;++i){item=onAvailStack[i];if(item&&item.checkReady){el=this.getEl(item.id);if(el){if(loadComplete||el.nextSibling){executeItem(el,item);onAvailStack[i]=null;}}else{notAvail.push(item);}}}
retryCount=(notAvail.length===0)?0:retryCount-1;if(tryAgain){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}
this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn,l.index);}}
if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var results=[],searchLists;if(!sType){searchLists=[listeners,unloadListeners];}else if(sType=="unload"){searchLists=[unloadListeners];}else{searchLists=[listeners];}
for(var j=0;j<searchLists.length;++j){var searchList=searchLists[j];if(searchList&&searchList.length>0){for(var i=0,len=searchList.length;i<len;++i){var l=searchList[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){results.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}}
return(results.length)?results:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=unloadListeners.length;i<len;++i){l=unloadListeners[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else{scope=l[EU.ADJ_SCOPE];}}
l[EU.FN].call(scope,EU.getEvent(e),l[EU.OBJ]);unloadListeners[i]=null;l=null;scope=null;}}
unloadListeners=null;if(listeners&&listeners.length>0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}
j=j-1;}
l=null;EU.clearCache();}
for(i=0,len=legacyEvents.length;i<len;++i){legacyEvents[i][0]=null;legacyEvents[i]=null;}
legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var el,d=document,b=d.body;if(("undefined"!==typeof YAHOO_config)&&YAHOO_config.injecting){el=document.createElement("script");var p=d.getElementsByTagName("head")[0]||b;p.insertBefore(el,p.firstChild);}else{d.write('<scr'+'ipt id="_yui_eu_dr" defer="true" src="//:"><'+'/script>');el=document.getElementById("_yui_eu_dr");}
if(el){el.onreadystatechange=function(){if("complete"===this.readyState){this.parentNode.removeChild(this);YAHOO.util.Event._ready();}};}else{}
el=null;}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}
EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}
YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,p_override){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];}
subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var evts=this.__yui_events;if(p_type){var ce=evts[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}}else{for(var i in evts){var ret=true;if(YAHOO.lang.hasOwnProperty(evts,i)){ret=ret&&evts[i].unsubscribe(p_fn,p_obj);}}
return ret;}
return false;},unsubscribeAll:function(p_type){return this.unsubscribe(p_type);},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=(opts.silent);var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}
this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}
return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(!ce){return null;}
var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}
return ce.fire.apply(ce,args);},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}
return false;}};YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!attachTo){}else if(!keyData){}else if(!handler){}
if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}
var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=$(attachTo);}
if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
if(!keyData.alt){keyData.alt=false;}
if(!keyData.ctrl){keyData.ctrl=false;}
if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;var keyPressed;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);break;}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);break;}}}else{dataItem=keyData.keys;if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);}}}}
this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+
(attachTo.id?"["+attachTo.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.register("event",YAHOO.util.Event,{version:"2.3.0",build:"442"});YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:'application/x-www-form-urlencoded; charset=UTF-8',_use_default_xhr_header:true,_default_xhr_header:'XMLHttpRequest',_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function()
{if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,'click',function(e){var obj=YAHOO.util.Event.getTarget(e);if(obj.type=='submit'){YAHOO.util.Connect._submitElementValue=encodeURIComponent(obj.name)+"="+encodeURIComponent(obj.value);}});return true;}
return false;})(),startEvent:new YAHOO.util.CustomEvent('start'),completeEvent:new YAHOO.util.CustomEvent('complete'),successEvent:new YAHOO.util.CustomEvent('success'),failureEvent:new YAHOO.util.CustomEvent('failure'),uploadEvent:new YAHOO.util.CustomEvent('upload'),abortEvent:new YAHOO.util.CustomEvent('abort'),_customEvents:{onStart:['startEvent','start'],onComplete:['completeEvent','complete'],onSuccess:['successEvent','success'],onFailure:['failureEvent','failure'],onUpload:['uploadEvent','upload'],onAbort:['abortEvent','abort']},setProgId:function(id)
{this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b)
{this._use_default_post_header=b;},setDefaultXhrHeader:function(b)
{this._use_default_xhr_header=b;},setPollingInterval:function(i)
{if(typeof i=='number'&&isFinite(i)){this._polling_interval=i;}},createXhrObject:function(transactionId)
{var obj,http;try
{http=new XMLHttpRequest();obj={conn:http,tId:transactionId};}
catch(e)
{for(var i=0;i<this._msxml_progid.length;++i){try
{http=new ActiveXObject(this._msxml_progid[i]);obj={conn:http,tId:transactionId};break;}
catch(e){}}}
finally
{return obj;}},getConnectionObject:function(isFileUpload)
{var o;var tId=this._transaction_id;try
{if(!isFileUpload){o=this.createXhrObject(tId);}
else{o={};o.tId=tId;o.isUpload=true;}
if(o){this._transaction_id++;}}
catch(e){}
finally
{return o;}},asyncRequest:function(method,uri,callback,postData)
{var o=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();if(!o){return null;}
else{if(callback&&callback.customevents){this.initCustomEvents(o,callback);}
if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o,callback,uri,postData);return o;}
if(method.toUpperCase()=='GET'){if(this._sFormData.length!==0){uri+=((uri.indexOf('?')==-1)?'?':'&')+this._sFormData;}
else{uri+="?"+this._sFormData;}}
else if(method.toUpperCase()=='POST'){postData=postData?this._sFormData+"&"+postData:this._sFormData;}}
o.conn.open(method,uri,true);if(this._use_default_xhr_header){if(!this._default_headers['X-Requested-With']){this.initHeader('X-Requested-With',this._default_xhr_header,true);}}
if(this._isFormSubmit||(postData&&this._use_default_post_header)){this.initHeader('Content-Type',this._default_post_header);if(this._isFormSubmit){this.resetFormState();}}
if(this._has_default_headers||this._has_http_headers){this.setHeader(o);}
this.handleReadyState(o,callback);o.conn.send(postData||null);this.startEvent.fire(o);if(o.startEvent){o.startEvent.fire(o);}
return o;}},initCustomEvents:function(o,callback)
{for(var prop in callback.customevents){if(this._customEvents[prop][0]){o[this._customEvents[prop][0]]=new YAHOO.util.CustomEvent(this._customEvents[prop][1],(callback.scope)?callback.scope:null);o[this._customEvents[prop][0]].subscribe(callback.customevents[prop]);}}},handleReadyState:function(o,callback)
{var oConn=this;if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState===4){window.clearInterval(oConn._poll[o.tId]);delete oConn._poll[o.tId];if(callback&&callback.timeout){window.clearTimeout(oConn._timeOut[o.tId]);delete oConn._timeOut[o.tId];}
oConn.completeEvent.fire(o);if(o.completeEvent){o.completeEvent.fire(o);}
oConn.handleTransactionResponse(o,callback);}},this._polling_interval);},handleTransactionResponse:function(o,callback,isAbort)
{if(!callback){this.releaseObject(o);return;}
var httpStatus,responseObject;try
{if(o.conn.status!==undefined&&o.conn.status!==0){httpStatus=o.conn.status;}
else{httpStatus=13030;}}
catch(e){httpStatus=13030;}
if(httpStatus>=200&&httpStatus<300||httpStatus===1223){responseObject=this.createResponseObject(o,callback.argument);if(callback.success){if(!callback.scope){callback.success(responseObject);}
else{callback.success.apply(callback.scope,[responseObject]);}}
this.successEvent.fire(responseObject);if(o.successEvent){o.successEvent.fire(responseObject);}}
else{switch(httpStatus){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:responseObject=this.createExceptionObject(o.tId,callback.argument,(isAbort?isAbort:false));if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
else{callback.failure.apply(callback.scope,[responseObject]);}}
break;default:responseObject=this.createResponseObject(o,callback.argument);if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
else{callback.failure.apply(callback.scope,[responseObject]);}}}
this.failureEvent.fire(responseObject);if(o.failureEvent){o.failureEvent.fire(responseObject);}}
this.releaseObject(o);responseObject=null;},createResponseObject:function(o,callbackArg)
{var obj={};var headerObj={};try
{var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i<header.length;i++){var delimitPos=header[i].indexOf(':');if(delimitPos!=-1){headerObj[header[i].substring(0,delimitPos)]=header[i].substring(delimitPos+2);}}}
catch(e){}
obj.tId=o.tId;obj.status=(o.conn.status==1223)?204:o.conn.status;obj.statusText=(o.conn.status==1223)?"No Content":o.conn.statusText;obj.getResponseHeader=headerObj;obj.getAllResponseHeaders=headerStr;obj.responseText=o.conn.responseText;obj.responseXML=o.conn.responseXML;if(typeof callbackArg!==undefined){obj.argument=callbackArg;}
return obj;},createExceptionObject:function(tId,callbackArg,isAbort)
{var COMM_CODE=0;var COMM_ERROR='communication failure';var ABORT_CODE=-1;var ABORT_ERROR='transaction aborted';var obj={};obj.tId=tId;if(isAbort){obj.status=ABORT_CODE;obj.statusText=ABORT_ERROR;}
else{obj.status=COMM_CODE;obj.statusText=COMM_ERROR;}
if(callbackArg){obj.argument=callbackArg;}
return obj;},initHeader:function(label,value,isDefault)
{var headerObj=(isDefault)?this._default_headers:this._http_headers;if(headerObj[label]===undefined){headerObj[label]=value;}
else{headerObj[label]=value+","+headerObj[label];}
if(isDefault){this._has_default_headers=true;}
else{this._has_http_headers=true;}},setHeader:function(o)
{if(this._has_default_headers){for(var prop in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,prop)){o.conn.setRequestHeader(prop,this._default_headers[prop]);}}}
if(this._has_http_headers){for(var prop in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,prop)){o.conn.setRequestHeader(prop,this._http_headers[prop]);}}
delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(formId,isUpload,secureUri)
{this.resetFormState();var oForm;if(typeof formId=='string'){oForm=($(formId)||document.forms[formId]);}
else if(typeof formId=='object'){oForm=formId;}
else{return;}
if(isUpload){var io=this.createFrame(secureUri?secureUri:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}
var oElement,oName,oValue,oDisabled;var hasSubmit=false;for(var i=0;i<oForm.elements.length;i++){oElement=oForm.elements[i];oDisabled=oForm.elements[i].disabled;oName=oForm.elements[i].name;oValue=oForm.elements[i].value;if(!oDisabled&&oName)
{switch(oElement.type)
{case'select-one':case'select-multiple':for(var j=0;j<oElement.options.length;j++){if(oElement.options[j].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text)+'&';}
else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text)+'&';}}}
break;case'radio':case'checkbox':if(oElement.checked){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}
break;case'file':case undefined:case'reset':case'button':break;case'submit':if(hasSubmit===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+'&';}
else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}
hasSubmit=true;}
break;default:this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}}}
this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(secureUri){var frameId='yuiIO'+this._transaction_id;var io;if(window.ActiveXObject){io=document.createElement('<iframe id="'+frameId+'" name="'+frameId+'" />');if(typeof secureUri=='boolean'){io.src='javascript:false';}
else if(typeof secureURI=='string'){io.src=secureUri;}}
else{io=document.createElement('iframe');io.id=frameId;io.name=frameId;}
$SetStyle(io,"position","absolute");$SetStyle(io,"top","-1000px");$SetStyle(io,"left","-1000px");document.body.appendChild(io);},appendPostData:function(postData)
{var formElements=[];var postMessage=postData.split('&');for(var i=0;i<postMessage.length;i++){var delimitPos=postMessage[i].indexOf('=');if(delimitPos!=-1){formElements[i]=document.createElement('input');formElements[i].type='hidden';formElements[i].name=postMessage[i].substring(0,delimitPos);formElements[i].value=postMessage[i].substring(delimitPos+1);this._formNode.appendChild(formElements[i]);}}
return formElements;},uploadFile:function(o,callback,uri,postData){var frameId='yuiIO'+o.tId;var uploadEncoding='multipart/form-data';var io=$(frameId);var oConn=this;var rawFormAttributes={action:this._formNode.getAttribute('action'),method:this._formNode.getAttribute('method'),target:this._formNode.getAttribute('target')};this._formNode.setAttribute('action',uri);this._formNode.setAttribute('method','POST');this._formNode.setAttribute('target',frameId);if(this._formNode.encoding){this._formNode.setAttribute('encoding',uploadEncoding);}
else{this._formNode.setAttribute('enctype',uploadEncoding);}
if(postData){var oElements=this.appendPostData(postData);}
this._formNode.submit();this.startEvent.fire(o);if(o.startEvent){o.startEvent.fire(o);}
if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
if(oElements&&oElements.length>0){for(var i=0;i<oElements.length;i++){this._formNode.removeChild(oElements[i]);}}
for(var prop in rawFormAttributes){if(YAHOO.lang.hasOwnProperty(rawFormAttributes,prop)){if(rawFormAttributes[prop]){this._formNode.setAttribute(prop,rawFormAttributes[prop]);}
else{this._formNode.removeAttribute(prop);}}}
this.resetFormState();var uploadCallback=function()
{if(callback&&callback.timeout){window.clearTimeout(oConn._timeOut[o.tId]);delete oConn._timeOut[o.tId];}
oConn.completeEvent.fire(o);if(o.completeEvent){o.completeEvent.fire(o);}
var obj={};obj.tId=o.tId;obj.argument=callback.argument;try
{obj.responseText=io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:io.contentWindow.document.documentElement.textContent;obj.responseXML=io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}
catch(e){}
if(callback&&callback.upload){if(!callback.scope){callback.upload(obj);}
else{callback.upload.apply(callback.scope,[obj]);}}
oConn.uploadEvent.fire(obj);if(o.uploadEvent){o.uploadEvent.fire(obj);}
if(YAHOO.util.Event){YAHOO.util.Event.removeListener(io,"load",uploadCallback);}
else if(window.detachEvent){io.detachEvent('onload',uploadCallback);}
else{io.removeEventListener('load',uploadCallback,false);}
setTimeout(function(){document.body.removeChild(io);oConn.releaseObject(o);},100);};if(YAHOO.util.Event){YAHOO.util.Event.addListener(io,"load",uploadCallback);}
else if(window.attachEvent){io.attachEvent('onload',uploadCallback);}
else{io.addEventListener('load',uploadCallback,false);}},abort:function(o,callback,isTimeout)
{var abortStatus;if(o.conn){if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this._poll[o.tId]);delete this._poll[o.tId];if(isTimeout){window.clearTimeout(this._timeOut[o.tId]);delete this._timeOut[o.tId];}
abortStatus=true;}}
else if(o.isUpload===true){var frameId='yuiIO'+o.tId;var io=$(frameId);if(io){document.body.removeChild(io);if(isTimeout){window.clearTimeout(this._timeOut[o.tId]);delete this._timeOut[o.tId];}
abortStatus=true;}}
else{abortStatus=false;}
if(abortStatus===true){this.abortEvent.fire(o);if(o.abortEvent){o.abortEvent.fire(o);}
this.handleTransactionResponse(o,callback,true);}
else{}
return abortStatus;},isCallInProgress:function(o)
{if(o&&o.conn){return o.conn.readyState!==4&&o.conn.readyState!==0;}
else if(o&&o.isUpload===true){var frameId='yuiIO'+o.tId;return $(frameId)?true:false;}
else{return false;}},releaseObject:function(o)
{if(o.conn){o.conn=null;}
o=null;}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.3.0",build:"442"});YAHOO.util.Anim=function(el,attributes,duration,method){if(!el){}
this.init(el,attributes,duration,method);};YAHOO.util.Anim.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName||el;return("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(attr,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attr,val,unit){if(this.patterns.noNegatives.test(attr)){val=(val>0)?val:0;}
$SetStyle(this.getEl(),attr,val+unit);},getAttribute:function(attr){var el=this.getEl();var val=$S(el,attr);if(val!=='auto'&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);}
var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||($S(el,'position')=='absolute'&&pos)){val=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;}
return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return'px';}
return'';},setRuntimeAttribute:function(attr){var start;var end;var attributes=this.attributes;this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=='undefined');};if(!isset(attributes[attr]['to'])&&!isset(attributes[attr]['by'])){return false;}
start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]['by'][i]*1;}}else{end=start+attributes[attr]['by']*1;}}
this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);return true;},init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var actualFrames=0;el=YAHOO.util.Dom.get(el);this.attributes=attributes||{};this.duration=!YAHOO.lang.isUndefined(duration)?duration:1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.setEl=function(element){el=YAHOO.util.Dom.get(element);};this.getEl=function(){return el;};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}
this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}
YAHOO.util.AnimMgr.registerElement(this);return true;};this.stop=function(finish){if(finish){this.currentFrame=this.totalFrames;this._onTween.fire();}
YAHOO.util.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var attr in this.attributes){this.setRuntimeAttribute(attr);}
isAnimated=true;actualFrames=0;startTime=new Date();};var onTween=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){return('duration: '+data.duration+', currentFrame: '+data.currentFrame);};this.onTween.fire(data);var runtimeAttributes=this.runtimeAttributes;for(var attr in runtimeAttributes){this.setAttribute(attr,this.doMethod(attr,runtimeAttributes[attr].start,runtimeAttributes[attr].end),runtimeAttributes[attr].unit);}
actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new YAHOO.util.CustomEvent('_start',this,true);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this,true);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onComplete=new YAHOO.util.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=1000;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){tween._onComplete.fire();index=index||getIndex(tween);if(index==-1){return false;}
queue.splice(index,1);tweenCount-=1;if(tweenCount<=0){this.stop();}
return true;};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){if(queue[0].isAnimated()){this.unRegister(queue[0],0);}}
queue=[];thread=null;tweenCount=0;}
else{this.unRegister(tween);}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}
if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null)
{tween.currentFrame+=1;if(tween.useSeconds){correctFrame(tween);}
tween._onTween.fire();}
else{YAHOO.util.AnimMgr.stop(tween,i);}}};var getIndex=function(anim){for(var i=0,len=queue.length;i<len;++i){if(queue[i]==anim){return i;}}
return-1;};var correctFrame=function(tween){var frames=tween.totalFrames;var frame=tween.currentFrame;var expected=(tween.currentFrame*tween.duration*1000/tween.totalFrames);var elapsed=(new Date()-tween.getStartTime());var tweak=0;if(elapsed<tween.duration*1000){tweak=Math.round((elapsed/expected-1)*tween.currentFrame);}else{tweak=frames-(frame+1);}
if(tweak>0&&isFinite(tweak)){if(tween.currentFrame+tweak>=frames){tweak=frames-(frame+1);}
tween.currentFrame+=tweak;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(points,t){var n=points.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[points[i][0],points[i][1]];}
for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}
return[tmp[0][0],tmp[0][1]];};};(function(){YAHOO.util.ColorAnim=function(el,attributes,duration,method){YAHOO.util.ColorAnim.superclass.constructor.call(this,el,attributes,duration,method);};YAHOO.extend(YAHOO.util.ColorAnim,YAHOO.util.Anim);var Y=YAHOO.util;var superclass=Y.ColorAnim.superclass;var proto=Y.ColorAnim.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("ColorAnim "+id);};proto.patterns.color=/color$/i;proto.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;proto.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;proto.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;proto.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;proto.parseColor=function(s){if(s.length==3){return s;}
var c=this.patterns.hex.exec(s);if(c&&c.length==4){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}
c=this.patterns.rgb.exec(s);if(c&&c.length==4){return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}
c=this.patterns.hex3.exec(s);if(c&&c.length==4){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}
return null;};proto.getAttribute=function(attr){var el=this.getEl();if(this.patterns.color.test(attr)){var val=$S(el,attr);if(this.patterns.transparent.test(val)){var parent=el.parentNode;val=$S(parent,attr);while(parent&&this.patterns.transparent.test(val)){parent=parent.parentNode;val=$S(parent,attr);if(parent.tagName.toUpperCase()=='HTML'){val='#fff';}}}}else{val=superclass.getAttribute.call(this,attr);}
return val;};proto.doMethod=function(attr,start,end){var val;if(this.patterns.color.test(attr)){val=[];for(var i=0,len=start.length;i<len;++i){val[i]=superclass.doMethod.call(this,attr,start[i],end[i]);}
val='rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')';}
else{val=superclass.doMethod.call(this,attr,start,end);}
return val;};proto.setRuntimeAttribute=function(attr){superclass.setRuntimeAttribute.call(this,attr);if(this.patterns.color.test(attr)){var attributes=this.attributes;var start=this.parseColor(this.runtimeAttributes[attr].start);var end=this.parseColor(this.runtimeAttributes[attr].end);if(typeof attributes[attr]['to']==='undefined'&&typeof attributes[attr]['by']!=='undefined'){end=this.parseColor(attributes[attr].by);for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+end[i];}}
this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;}};})();YAHOO.util.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}
return-c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}
return-c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0){return b;}
if((t/=d)==1){return b+c;}
if(!p){p=d*.3;}
if(!a||a<Math.abs(c)){a=c;var s=p/4;}
else{var s=p/(2*Math.PI)*Math.asin(c/a);}
return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0){return b;}
if((t/=d)==1){return b+c;}
if(!p){p=d*.3;}
if(!a||a<Math.abs(c)){a=c;var s=p/4;}
else{var s=p/(2*Math.PI)*Math.asin(c/a);}
return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0){return b;}
if((t/=d/2)==2){return b+c;}
if(!p){p=d*(.3*1.5);}
if(!a||a<Math.abs(c)){a=c;var s=p/4;}
else{var s=p/(2*Math.PI)*Math.asin(c/a);}
if(t<1){return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}
return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;}
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-YAHOO.util.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}
return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;},bounceBoth:function(t,b,c,d){if(t<d/2){return YAHOO.util.Easing.bounceIn(t*2,0,c,d)*.5+b;}
return YAHOO.util.Easing.bounceOut(t*2-d,0,c,d)*.5+c*.5+b;}};(function(){YAHOO.util.Motion=function(el,attributes,duration,method){if(el){YAHOO.util.Motion.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Motion,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Motion.superclass;var proto=Y.Motion.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Motion "+id);};proto.patterns.points=/^points$/i;proto.setAttribute=function(attr,val,unit){if(this.patterns.points.test(attr)){unit=unit||'px';superclass.setAttribute.call(this,'left',val[0],unit);superclass.setAttribute.call(this,'top',val[1],unit);}else{superclass.setAttribute.call(this,attr,val,unit);}};proto.getAttribute=function(attr){if(this.patterns.points.test(attr)){var val=[superclass.getAttribute.call(this,'left'),superclass.getAttribute.call(this,'top')];}else{val=superclass.getAttribute.call(this,attr);}
return val;};proto.doMethod=function(attr,start,end){var val=null;if(this.patterns.points.test(attr)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;val=Y.Bezier.getPosition(this.runtimeAttributes[attr],t);}else{val=superclass.doMethod.call(this,attr,start,end);}
return val;};proto.setRuntimeAttribute=function(attr){if(this.patterns.points.test(attr)){var el=this.getEl();var attributes=this.attributes;var start;var control=attributes['points']['control']||[];var end;var i,len;if(control.length>0&&!(control[0]instanceof Array)){control=[control];}else{var tmp=[];for(i=0,len=control.length;i<len;++i){tmp[i]=control[i];}
control=tmp;}
if($S(el,'position')=='static'){$SetStyle(el,'position','relative');}
if(isset(attributes['points']['from'])){Y.Dom.setXY(el,attributes['points']['from']);}
else{Y.Dom.setXY(el,Y.Dom.getXY(el));}
start=this.getAttribute('points');if(isset(attributes['points']['to'])){end=translateValues.call(this,attributes['points']['to'],start);var pageXY=Y.Dom.getXY(this.getEl());for(i=0,len=control.length;i<len;++i){control[i]=translateValues.call(this,control[i],start);}}else if(isset(attributes['points']['by'])){end=[start[0]+attributes['points']['by'][0],start[1]+attributes['points']['by'][1]];for(i=0,len=control.length;i<len;++i){control[i]=[start[0]+control[i][0],start[1]+control[i][1]];}}
this.runtimeAttributes[attr]=[start];if(control.length>0){this.runtimeAttributes[attr]=this.runtimeAttributes[attr].concat(control);}
this.runtimeAttributes[attr][this.runtimeAttributes[attr].length]=end;}
else{superclass.setRuntimeAttribute.call(this,attr);}};var translateValues=function(val,start){var pageXY=Y.Dom.getXY(this.getEl());val=[val[0]-pageXY[0]+start[0],val[1]-pageXY[1]+start[1]];return val;};var isset=function(prop){return(typeof prop!=='undefined');};})();(function(){YAHOO.util.Scroll=function(el,attributes,duration,method){if(el){YAHOO.util.Scroll.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Scroll,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Scroll.superclass;var proto=Y.Scroll.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Scroll "+id);};proto.doMethod=function(attr,start,end){var val=null;if(attr=='scroll'){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=superclass.doMethod.call(this,attr,start,end);}
return val;};proto.getAttribute=function(attr){var val=null;var el=this.getEl();if(attr=='scroll'){val=[el.scrollLeft,el.scrollTop];}else{val=superclass.getAttribute.call(this,attr);}
return val;};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.3.0",build:"442"});YAHOO.widget.AutoComplete=function(elInput,elContainer,oDataSource,oConfigs){if(elInput&&elContainer&&oDataSource){if(oDataSource instanceof YAHOO.widget.DataSource){this.dataSource=oDataSource;}
else{return;}
if(YAHOO.util.Dom.inDocument(elInput)){if(YAHOO.lang.isString(elInput)){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+elInput;this._oTextbox=$(elInput);}
else{this._sName=(elInput.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+elInput.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._oTextbox=elInput;}
YAHOO.util.Dom.addClass(this._oTextbox,"yui-ac-input");}
else{return;}
if(YAHOO.util.Dom.inDocument(elContainer)){if(YAHOO.lang.isString(elContainer)){this._oContainer=$(elContainer);}
else{this._oContainer=elContainer;}
if($S(this._oContainer,"display")=="none"){}
var elParent=this._oContainer.parentNode;var elTag=elParent.tagName.toLowerCase();while(elParent&&(elParent!="document")){if(elTag=="div"){YAHOO.util.Dom.addClass(elParent,"yui-ac");break;}
else{elParent=elParent.parentNode;elTag=elParent.tagName.toLowerCase();}}
if(elTag!="div"){}}
else{return;}
if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}
this._initContainer();this._initProps();this._initList();this._initContainerHelpers();var oSelf=this;var oTextbox=this._oTextbox;var oContent=this._oContainer._oContent;YAHOO.util.Event.addListener(oTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);YAHOO.util.Event.addListener(oTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);YAHOO.util.Event.addListener(oTextbox,"focus",oSelf._onTextboxFocus,oSelf);YAHOO.util.Event.addListener(oTextbox,"blur",oSelf._onTextboxBlur,oSelf);YAHOO.util.Event.addListener(oContent,"mouseover",oSelf._onContainerMouseover,oSelf);YAHOO.util.Event.addListener(oContent,"mouseout",oSelf._onContainerMouseout,oSelf);YAHOO.util.Event.addListener(oContent,"scroll",oSelf._onContainerScroll,oSelf);YAHOO.util.Event.addListener(oContent,"resize",oSelf._onContainerResize,oSelf);if(oTextbox.form){YAHOO.util.Event.addListener(oTextbox.form,"submit",oSelf._onFormSubmit,oSelf);}
YAHOO.util.Event.addListener(oTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);this.textboxFocusEvent=new YAHOO.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=new YAHOO.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new YAHOO.util.CustomEvent("dataRequest",this);this.dataReturnEvent=new YAHOO.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.containerExpandEvent=new YAHOO.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new YAHOO.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new YAHOO.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=new YAHOO.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new YAHOO.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new YAHOO.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new YAHOO.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new YAHOO.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new YAHOO.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new YAHOO.util.CustomEvent("containerCollapse",this);this.textboxBlurEvent=new YAHOO.util.CustomEvent("textboxBlur",this);YAHOO.widget.AutoComplete._nIndex++;}
else{}};YAHOO.widget.AutoComplete.prototype.dataSource=null;YAHOO.widget.AutoComplete.prototype.minQueryLength=1;YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed=10;YAHOO.widget.AutoComplete.prototype.queryDelay=0.2;YAHOO.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";YAHOO.widget.AutoComplete.prototype.prehighlightClassName=null;YAHOO.widget.AutoComplete.prototype.delimChar=null;YAHOO.widget.AutoComplete.prototype.autoHighlight=true;YAHOO.widget.AutoComplete.prototype.typeAhead=false;YAHOO.widget.AutoComplete.prototype.animHoriz=false;YAHOO.widget.AutoComplete.prototype.animVert=true;YAHOO.widget.AutoComplete.prototype.animSpeed=0.3;YAHOO.widget.AutoComplete.prototype.forceSelection=false;YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete=true;YAHOO.widget.AutoComplete.prototype.alwaysShowContainer=false;YAHOO.widget.AutoComplete.prototype.useIFrame=false;YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName;};YAHOO.widget.AutoComplete.prototype.isContainerOpen=function(){return this._bContainerOpen;};YAHOO.widget.AutoComplete.prototype.getListItems=function(){return this._aListItems;};YAHOO.widget.AutoComplete.prototype.getListItemData=function(oListItem){if(oListItem._oResultData){return oListItem._oResultData;}
else{return false;}};YAHOO.widget.AutoComplete.prototype.setHeader=function(sHeader){if(sHeader){if(this._oContainer._oContent._oHeader){this._oContainer._oContent._oHeader.innerHTML=sHeader;$SetStyle(this._oContainer._oContent._oHeader,"display","block");}}
else{this._oContainer._oContent._oHeader.innerHTML="";$SetStyle(this._oContainer._oContent._oHeader,"display","none");}};YAHOO.widget.AutoComplete.prototype.setFooter=function(sFooter){if(sFooter){if(this._oContainer._oContent._oFooter){this._oContainer._oContent._oFooter.innerHTML=sFooter;$SetStyle(this._oContainer._oContent._oFooter,"display","block");}}
else{this._oContainer._oContent._oFooter.innerHTML="";$SetStyle(this._oContainer._oContent._oFooter,"display","none");}};YAHOO.widget.AutoComplete.prototype.setBody=function(sBody){if(sBody){if(this._oContainer._oContent._oBody){this._oContainer._oContent._oBody.innerHTML=sBody;$SetStyle(this._oContainer._oContent._oBody,"display","block");$SetStyle(this._oContainer._oContent,"display","block");}}
else{this._oContainer._oContent._oBody.innerHTML="";$SetStyle(this._oContainer._oContent,"display","none");}
this._maxResultsDisplayed=0;};YAHOO.widget.AutoComplete.prototype.formatResult=function(oResultItem,sQuery){var sResult=oResultItem[0];if(sResult){return sResult;}
else{return"";}};YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer=function(oTextbox,oContainer,sQuery,aResults){return true;};YAHOO.widget.AutoComplete.prototype.sendQuery=function(sQuery){this._sendQuery(sQuery);};YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery=function(sQuery){return sQuery;};YAHOO.widget.AutoComplete.prototype.destroy=function(){var instanceName=this.toString();var elInput=this._oTextbox;var elContainer=this._oContainer;this.textboxFocusEvent.unsubscribe();this.textboxKeyEvent.unsubscribe();this.dataRequestEvent.unsubscribe();this.dataReturnEvent.unsubscribe();this.dataErrorEvent.unsubscribe();this.containerExpandEvent.unsubscribe();this.typeAheadEvent.unsubscribe();this.itemMouseOverEvent.unsubscribe();this.itemMouseOutEvent.unsubscribe();this.itemArrowToEvent.unsubscribe();this.itemArrowFromEvent.unsubscribe();this.itemSelectEvent.unsubscribe();this.unmatchedItemSelectEvent.unsubscribe();this.selectionEnforceEvent.unsubscribe();this.containerCollapseEvent.unsubscribe();this.textboxBlurEvent.unsubscribe();YAHOO.util.Event.purgeElement(elInput,true);YAHOO.util.Event.purgeElement(elContainer,true);elContainer.innerHTML="";for(var key in this){if(this.hasOwnProperty(key)){this[key]=null;}}};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete._nIndex=0;YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._oTextbox=null;YAHOO.widget.AutoComplete.prototype._bFocused=true;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._oContainer=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._aListItems=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sSavedQuery=null;YAHOO.widget.AutoComplete.prototype._oCurItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._iFrameSrc="javascript:false;";YAHOO.widget.AutoComplete.prototype._queryInterval=null;YAHOO.widget.AutoComplete.prototype._sLastTextboxValue=null;YAHOO.widget.AutoComplete.prototype._initProps=function(){var minQueryLength=this.minQueryLength;if(!YAHOO.lang.isNumber(minQueryLength)){this.minQueryLength=1;}
var maxResultsDisplayed=this.maxResultsDisplayed;if(!YAHOO.lang.isNumber(maxResultsDisplayed)||(maxResultsDisplayed<1)){this.maxResultsDisplayed=10;}
var queryDelay=this.queryDelay;if(!YAHOO.lang.isNumber(queryDelay)||(queryDelay<0)){this.queryDelay=0.2;}
var delimChar=this.delimChar;if(YAHOO.lang.isString(delimChar)){this.delimChar=[delimChar];}
else if(!YAHOO.lang.isArray(delimChar)){this.delimChar=null;}
var animSpeed=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(!YAHOO.lang.isNumber(animSpeed)||(animSpeed<0)){this.animSpeed=0.3;}
if(!this._oAnim){this._oAnim=new YAHOO.util.Anim(this._oContainer._oContent,{},this.animSpeed);}
else{this._oAnim.duration=this.animSpeed;}}
if(this.forceSelection&&delimChar){}};YAHOO.widget.AutoComplete.prototype._initContainerHelpers=function(){if(this.useShadow&&!this._oContainer._oShadow){var oShadow=document.createElement("div");oShadow.className="yui-ac-shadow";this._oContainer._oShadow=this._oContainer.appendChild(oShadow);}
if(this.useIFrame&&!this._oContainer._oIFrame){var oIFrame=document.createElement("iframe");oIFrame.src=this._iFrameSrc;oIFrame.frameBorder=0;oIFrame.scrolling="no";$SetStyle(oIFrame,"position","absolute");$SetStyle(oIFrame,"width","100%");$SetStyle(oIFrame,"height","100%");oIFrame.tabIndex=-1;this._oContainer._oIFrame=this._oContainer.appendChild(oIFrame);}};YAHOO.widget.AutoComplete.prototype._initContainer=function(){YAHOO.util.Dom.addClass(this._oContainer,"yui-ac-container");if(!this._oContainer._oContent){var oContent=document.createElement("div");oContent.className="yui-ac-content";$SetStyle(oContent,"display","none");this._oContainer._oContent=this._oContainer.appendChild(oContent);var oHeader=document.createElement("div");oHeader.className="yui-ac-hd DoNotFollow";$SetStyle(oHeader,"display","none");this._oContainer._oContent._oHeader=this._oContainer._oContent.appendChild(oHeader);var oBody=document.createElement("div");oBody.className="yui-ac-bd DoNotFollow";this._oContainer._oContent._oBody=this._oContainer._oContent.appendChild(oBody);var oFooter=document.createElement("div");oFooter.className="yui-ac-ft";$SetStyle(oFooter,"display","none");this._oContainer._oContent._oFooter=this._oContainer._oContent.appendChild(oFooter);}
else{}};YAHOO.widget.AutoComplete.prototype._initList=function(){this._aListItems=[];while(this._oContainer._oContent._oBody.hasChildNodes()){var oldListItems=this.getListItems();if(oldListItems){for(var oldi=oldListItems.length-1;oldi>=0;oldi--){oldListItems[oldi]=null;}}
this._oContainer._oContent._oBody.innerHTML="";}
var oList=document.createElement("ul");oList=this._oContainer._oContent._oBody.appendChild(oList);for(var i=0;i<this.maxResultsDisplayed;i++){var oItem=document.createElement("li");oItem=oList.appendChild(oItem);this._aListItems[i]=oItem;this._initListItem(oItem,i);}
this._maxResultsDisplayed=this.maxResultsDisplayed;};YAHOO.widget.AutoComplete.prototype._initListItem=function(oItem,nItemIndex){var oSelf=this;$SetStyle(oItem,"display","none");oItem._nItemIndex=nItemIndex;oItem.mouseover=oItem.mouseout=oItem.onclick=null;YAHOO.util.Event.addListener(oItem,"mouseover",oSelf._onItemMouseover,oSelf);YAHOO.util.Event.addListener(oItem,"mouseout",oSelf._onItemMouseout,oSelf);YAHOO.util.Event.addListener(oItem,"click",oSelf._onItemMouseclick,oSelf);};YAHOO.widget.AutoComplete.prototype._onIMEDetected=function(oSelf){oSelf._enableIntervalDetection();};YAHOO.widget.AutoComplete.prototype._enableIntervalDetection=function(){var currValue=this._oTextbox.value;var lastValue=this._sLastTextboxValue;if(currValue!=lastValue){this._sLastTextboxValue=currValue;this._sendQuery(currValue);}};YAHOO.widget.AutoComplete.prototype._cancelIntervalDetection=function(oSelf){if(oSelf._queryInterval){clearInterval(oSelf._queryInterval);}};YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(nKeyCode){if((nKeyCode==9)||(nKeyCode==13)||(nKeyCode==16)||(nKeyCode==17)||(nKeyCode>=18&&nKeyCode<=20)||(nKeyCode==27)||(nKeyCode>=33&&nKeyCode<=35)||(nKeyCode>=36&&nKeyCode<=40)||(nKeyCode>=44&&nKeyCode<=45)){return true;}
return false;};YAHOO.widget.AutoComplete.prototype._sendQuery=function(sQuery){if(this.minQueryLength==-1){this._toggleContainer(false);return;}
var aDelimChar=(this.delimChar)?this.delimChar:null;if(aDelimChar){var nDelimIndex=-1;for(var i=aDelimChar.length-1;i>=0;i--){var nNewIndex=sQuery.lastIndexOf(aDelimChar[i]);if(nNewIndex>nDelimIndex){nDelimIndex=nNewIndex;}}
if(aDelimChar[i]==" "){for(var j=aDelimChar.length-1;j>=0;j--){if(sQuery[nDelimIndex-1]==aDelimChar[j]){nDelimIndex--;break;}}}
if(nDelimIndex>-1){var nQueryStart=nDelimIndex+1;while(sQuery.charAt(nQueryStart)==" "){nQueryStart+=1;}
this._sSavedQuery=sQuery.substring(0,nQueryStart);sQuery=sQuery.substr(nQueryStart);}
else if(sQuery.indexOf(this._sSavedQuery)<0){this._sSavedQuery=null;}}
if((sQuery&&(sQuery.length<this.minQueryLength))||(!sQuery&&this.minQueryLength>0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);}
this._toggleContainer(false);return;}
sQuery=encodeURIComponent(sQuery);this._nDelayID=-1;sQuery=this.doBeforeSendQuery(sQuery);this.dataRequestEvent.fire(this,sQuery);this.dataSource.getResults(this._populateList,sQuery,this);};YAHOO.widget.AutoComplete.prototype._populateList=function(sQuery,aResults,oSelf){if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,sQuery);}
if(!aResults){return;}
if(aResults.length==1&&oSelf.masSearch.length>0)
{oSelf._selectItem(oSelf._oCurItem);return;}
var isOpera=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);var contentStyle=oSelf._oContainer._oContent.style;contentStyle.width=(!isOpera)?null:"";contentStyle.height=(!isOpera)?null:"";var sCurQuery=decodeURIComponent(sQuery);oSelf._sCurQuery=sCurQuery;oSelf._bItemSelected=false;if(oSelf._maxResultsDisplayed!=oSelf.maxResultsDisplayed){oSelf._initList();}
var nItems=Math.min(aResults.length,oSelf.maxResultsDisplayed);oSelf._nDisplayedItems=nItems;if(nItems>0){oSelf._initContainerHelpers();var aItems=oSelf._aListItems;var ok=oSelf.doBeforeExpandContainer(oSelf._oTextbox,oSelf._oContainer,sQuery,aResults);for(var i=nItems-1;i>=0;i--){var oItemi=aItems[i];var oResultItemi=aResults[i];oItemi.innerHTML=oSelf.formatResult(oResultItemi,sCurQuery);$SetStyle(oItemi,"display","list-item");oItemi._sResultKey=oResultItemi[0];oItemi._oResultData=oResultItemi;}
for(var j=aItems.length-1;j>=nItems;j--){var oItemj=aItems[j];oItemj.innerHTML=null;$SetStyle(oItemj,"display","none");oItemj._sResultKey=null;oItemj._oResultData=null;}
oSelf._toggleContainer(ok);if(oSelf.autoHighlight){var oFirstItem=aItems[0];oSelf._toggleHighlight(oFirstItem,"to");oSelf.itemArrowToEvent.fire(oSelf,oFirstItem);oSelf._typeAhead(oFirstItem,sQuery);}
else{oSelf._oCurItem=null;}}
else{oSelf._toggleContainer(false);}
oSelf.dataReturnEvent.fire(oSelf,sQuery,aResults);};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var sValue=this._oTextbox.value;var sChar=(this.delimChar)?this.delimChar[0]:null;var nIndex=(sChar)?sValue.lastIndexOf(sChar,sValue.length-2):-1;if(nIndex>-1){this._oTextbox.value=sValue.substring(0,nIndex);}
else{this._oTextbox.value="";}
this._sSavedQuery=this._oTextbox.value;this.selectionEnforceEvent.fire(this);};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var foundMatch=null;for(var i=this._nDisplayedItems-1;i>=0;i--){var oItem=this._aListItems[i];var sMatch=oItem._sResultKey.toLowerCase();if(sMatch==this._sCurQuery.toLowerCase()){foundMatch=oItem;break;}}
return(foundMatch);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(oItem,sQuery){if(!this.typeAhead||(this._nKeyCode==8)){return;}
var oTextbox=this._oTextbox;var sValue=this._oTextbox.value;if(!oTextbox.setSelectionRange&&!oTextbox.createTextRange){return;}
var nStart=sValue.length;this._updateValue(oItem);var nEnd=oTextbox.value.length;this._selectText(oTextbox,nStart,nEnd);var sPrefill=oTextbox.value.substr(nStart,nEnd);this.typeAheadEvent.fire(this,sQuery,sPrefill);};YAHOO.widget.AutoComplete.prototype._selectText=function(oTextbox,nStart,nEnd){if(oTextbox.setSelectionRange){oTextbox.setSelectionRange(nStart,nEnd);}
else if(oTextbox.createTextRange){var oTextRange=oTextbox.createTextRange();oTextRange.moveStart("character",nStart);oTextRange.moveEnd("character",nEnd-oTextbox.value.length);oTextRange.select();}
else{oTextbox.select();}};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(bShow){var bFireEvent=false;var width=this._oContainer._oContent.offsetWidth+"px";var height=this._oContainer._oContent.offsetHeight+"px";if(this.useIFrame&&this._oContainer._oIFrame){bFireEvent=true;if(bShow){$SetStyle(this._oContainer._oIFrame,"width",width);$SetStyle(this._oContainer._oIFrame,"height",height);}
else{$SetStyle(this._oContainer._oIFrame,"width",0);$SetStyle(this._oContainer._oIFrame,"height",0);}}
if(this.useShadow&&this._oContainer._oShadow){bFireEvent=true;if(bShow){$SetStyle(this._oContainer._oShadow,"width",width);$SetStyle(this._oContainer._oShadow,"height",height);}
else{$SetStyle(this._oContainer._oShadow,"width",0);$SetStyle(this._oContainer._oShadow,"height",0);}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(bShow){var oContainer=this._oContainer;if(this.alwaysShowContainer&&this._bContainerOpen){return;}
if(!bShow){this._oContainer._oContent.scrollTop=0;var aItems=this._aListItems;if(aItems&&(aItems.length>0)){for(var i=aItems.length-1;i>=0;i--){$SetStyle(aItems[i],"display","none");}}
if(this._oCurItem){this._toggleHighlight(this._oCurItem,"from");}
this._oCurItem=null;this._nDisplayedItems=0;this._sCurQuery=null;}
if(!bShow&&!this._bContainerOpen){$SetStyle(oContainer._oContent,"display","none");return;}
var oAnim=this._oAnim;if(oAnim&&oAnim.getEl()&&(this.animHoriz||this.animVert)){if(!bShow){this._toggleContainerHelpers(bShow);}
if(oAnim.isAnimated()){oAnim.stop();}
var oClone=oContainer._oContent.cloneNode(true);oContainer.appendChild(oClone);$SetStyle(oClone,"top","-9000px");$SetStyle(oClone,"display","block");var wExp=oClone.offsetWidth;var hExp=oClone.offsetHeight;var wColl=(this.animHoriz)?0:wExp;var hColl=(this.animVert)?0:hExp;oAnim.attributes=(bShow)?{width:{to:wExp},height:{to:hExp}}:{width:{to:wColl},height:{to:hColl}};if(bShow&&!this._bContainerOpen){$SetStyle(oContainer._oContent,"width",wColl+"px");$SetStyle(oContainer._oContent,"height",hColl+"px");}
else{$SetStyle(oContainer._oContent,"width",wExp+"px");$SetStyle(oContainer._oContent,"height",hExp+"px");}
oContainer.removeChild(oClone);oClone=null;var oSelf=this;var onAnimComplete=function(){oAnim.onComplete.unsubscribeAll();if(bShow){oSelf.containerExpandEvent.fire(oSelf);}
else{$SetStyle(oContainer._oContent,"display","none");oSelf.containerCollapseEvent.fire(oSelf);}
oSelf._toggleContainerHelpers(bShow);};$SetStyle(oContainer._oContent,"display","block");oAnim.onComplete.subscribe(onAnimComplete);oAnim.animate();this._bContainerOpen=bShow;}
else{if(bShow){$SetStyle(oContainer._oContent,"display","block");this.containerExpandEvent.fire(this);}
else{$SetStyle(oContainer._oContent,"display","none");this.containerCollapseEvent.fire(this);}
this._toggleContainerHelpers(bShow);this._bContainerOpen=bShow;}};YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(oNewItem,sType){var sHighlight=this.highlightClassName;if(this._oCurItem){YAHOO.util.Dom.removeClass(this._oCurItem,sHighlight);}
if((sType=="to")&&sHighlight){YAHOO.util.Dom.addClass(oNewItem,sHighlight);this._oCurItem=oNewItem;}};YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(oNewItem,sType){if(oNewItem==this._oCurItem){return;}
var sPrehighlight=this.prehighlightClassName;if((sType=="mouseover")&&sPrehighlight){YAHOO.util.Dom.addClass(oNewItem,sPrehighlight);}
else{YAHOO.util.Dom.removeClass(oNewItem,sPrehighlight);}};YAHOO.widget.AutoComplete.prototype._updateValue=function(oItem){var oTextbox=this._oTextbox;var sDelimChar=(this.delimChar)?(this.delimChar[0]||this.delimChar):null;var sSavedQuery=this._sSavedQuery;var sResultKey=oItem._sResultKey;oTextbox.focus();oTextbox.value="";if(sDelimChar){if(sSavedQuery){oTextbox.value=sSavedQuery;}
oTextbox.value+=sResultKey+sDelimChar;if(sDelimChar!=" "){oTextbox.value+=" ";}}
else{oTextbox.value=sResultKey;}
if(oTextbox.type=="textarea"){oTextbox.scrollTop=oTextbox.scrollHeight;}
var end=oTextbox.value.length;this._selectText(oTextbox,end,end);this._oCurItem=oItem;};YAHOO.widget.AutoComplete.prototype._selectItem=function(oItem){this._bItemSelected=true;this._updateValue(oItem);this._cancelIntervalDetection(this);this.itemSelectEvent.fire(this,oItem,oItem._oResultData);this._toggleContainer(false);this._oTextbox.setAttribute("autocomplete","on");};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(this._oCurItem){this._selectItem(this._oCurItem);}
else{this._toggleContainer(false);}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(nKeyCode){if(this._bContainerOpen){var oCurItem=this._oCurItem;var nCurItemIndex=-1;if(oCurItem){nCurItemIndex=oCurItem._nItemIndex;}
var nNewItemIndex=(nKeyCode==40)?(nCurItemIndex+1):(nCurItemIndex-1);if(nNewItemIndex<-2||nNewItemIndex>=this._nDisplayedItems){return;}
if(oCurItem){this._toggleHighlight(oCurItem,"from");this.itemArrowFromEvent.fire(this,oCurItem);}
if(nNewItemIndex==-1){this._oCurItem=null;return;}
if(nNewItemIndex==-2){this._toggleContainer(false);return;}
var oNewItem=this._aListItems[nNewItemIndex];var iHeight=(YAHOO.env.ua.ie)?0:oNewItem.offsetHeight;var iInvHeight=(!YAHOO.env.ua.ie)?0:oNewItem.offsetHeight;var oContent=this._oContainer._oContent._oBody;var scrollOn=(($S(oContent,"overflow")=="auto")||($S(oContent,"overflowY")=="auto"));if(scrollOn&&(nNewItemIndex>-1)&&(nNewItemIndex<this._nDisplayedItems)){if(nKeyCode==40){if((oNewItem.offsetTop+oNewItem.offsetHeight)>(oContent.scrollTop+oContent.offsetHeight)){oContent.scrollTop=(oNewItem.offsetTop+iInvHeight)-oContent.offsetHeight;}
else if((oNewItem.offsetTop+oNewItem.offsetHeight)<oContent.scrollTop){oContent.scrollTop=oNewItem.offsetTop;}}
else{if((oNewItem.offsetTop-iHeight)<oContent.scrollTop){oContent.scrollTop=oNewItem.offsetTop-iHeight;}
else if(oNewItem.offsetTop>(oContent.scrollTop+oContent.offsetHeight)){oContent.scrollTop=(oNewItem.offsetTop+oNewItem.offsetHeight)-oContent.offsetHeight;}}}
this._toggleHighlight(oNewItem,"to");this.itemArrowToEvent.fire(this,oNewItem);if(this.typeAhead){this._updateValue(oNewItem);}}};YAHOO.widget.AutoComplete.prototype._onItemMouseover=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseover");}
else{oSelf._toggleHighlight(this,"to");}
oSelf.itemMouseOverEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseout=function(v,oSelf){if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(this,"mouseout");}
else{oSelf._toggleHighlight(this,"from");}
oSelf.itemMouseOutEvent.fire(oSelf,this);};YAHOO.widget.AutoComplete.prototype._onItemMouseclick=function(v,oSelf)
{if(oSelf.mbForceLeafSelection)
{oSelf.NextSearch();}
else
{oSelf._toggleHighlight(this,"to");oSelf._selectItem(this);}};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(v,oSelf){oSelf._bOverContainer=true;};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(v,oSelf)
{oSelf._bOverContainer=false;if(oSelf._bFocused)
{oSelf._oTextbox.focus();}
if(oSelf._oCurItem)
{oSelf._toggleHighlight(oSelf._oCurItem,"to");}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(v,oSelf){oSelf._oTextbox.focus();};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(v,oSelf){oSelf._toggleContainerHelpers(oSelf._bContainerOpen);};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(v,oSelf){var nKeyCode=v.keyCode;if(nKeyCode!=13)
{oSelf._oTextbox.setAttribute("autocomplete","off");}
switch(nKeyCode){case 9:if(oSelf.mbForceLeafSelection)
{oSelf.NextSearch();}
else
{if(oSelf._oCurItem){if(oSelf.delimChar&&(oSelf._nKeyCode!=nKeyCode)){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
oSelf._selectItem(oSelf._oCurItem);}
else{oSelf._toggleContainer(false);}}
break;case 13:if(oSelf.mbForceLeafSelection)
{oSelf.NextSearch();}
else
{if(oSelf._oCurItem&&oSelf.miNbOfResult>0){if(oSelf._nKeyCode!=nKeyCode){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}
oSelf._selectItem(oSelf._oCurItem);}
else{oSelf._toggleContainer(false);}}
break;case 27:oSelf._toggleContainer(false);return;case 39:oSelf.NextSearch();break;case 37:oSelf.PreviousSearch();break;case 38:YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);break;case 40:YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);break;default:break;}};YAHOO.widget.AutoComplete.prototype.NextSearch=function()
{if(this._oCurItem&&this.moCtrl.msChildFilterFile)
{var sLastSearch=(this.msLastSearch)?this.msLastSearch:this._oTextbox.value;this.masSearch.push(sLastSearch);this.msLastSearch=this._oCurItem._oResultData[2];this.sendQuery(this._oCurItem._oResultData[2]);}};YAHOO.widget.AutoComplete.prototype.PreviousSearch=function()
{if(this._oCurItem&&this.moCtrl.msChildFilterFile)
{var sLastSearch=this.masSearch.pop();this.msLastSearch=sLastSearch;this.sendQuery(sLastSearch);}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(v,oSelf){var nKeyCode=v.keyCode;var isMac=(navigator.userAgent.toLowerCase().indexOf("mac")!=-1);if(isMac){switch(nKeyCode){case 9:if(oSelf.delimChar&&(oSelf._nKeyCode!=nKeyCode)){YAHOO.util.Event.stopEvent(v);}
break;case 13:if(oSelf._nKeyCode!=nKeyCode){YAHOO.util.Event.stopEvent(v);}
break;case 38:case 40:YAHOO.util.Event.stopEvent(v);break;default:break;}}
else if(nKeyCode==229){oSelf._queryInterval=setInterval(function(){oSelf._onIMEDetected(oSelf);},500);}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(v,oSelf){oSelf._initProps();var nKeyCode=v.keyCode;oSelf._nKeyCode=nKeyCode;var sText=this.value;if(oSelf._isIgnoreKey(nKeyCode)||(sText.toLowerCase()==oSelf._sCurQuery)){return;}
else{oSelf._bItemSelected=false;YAHOO.util.Dom.removeClass(oSelf._oCurItem,oSelf.highlightClassName);oSelf._oCurItem=null;oSelf.textboxKeyEvent.fire(oSelf,nKeyCode);}
oSelf.masSearch=new Array();oSelf.msLastSearch=null;if(oSelf.queryDelay>0){var nDelayID=setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay*1000));if(oSelf._nDelayID!=-1){clearTimeout(oSelf._nDelayID);}
oSelf._nDelayID=nDelayID;}
else{oSelf._sendQuery(sText);}};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(v,oSelf){oSelf._oTextbox.setAttribute("autocomplete","off");oSelf._bFocused=true;if(!oSelf._bItemSelected){oSelf.textboxFocusEvent.fire(oSelf);}};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(v,oSelf)
{oSelf._oTextbox.setAttribute("autocomplete","on");if((oSelf._nKeyCode==9))
{if(!oSelf._bItemSelected)
{var oMatch=oSelf._textMatchesOption();if((!oSelf._bContainerOpen||(oSelf._bContainerOpen&&(oMatch===null))))
{if(oSelf.forceSelection&&($(oSelf.msID+AutoCompletionCtrl.Const.VALUEFIELD).value==""||oSelf.mbFirstKeyUp))
{oSelf._clearSelection();}
else
{oSelf.unmatchedItemSelectEvent.fire(oSelf,oSelf._sCurQuery);}}
else
{oSelf._selectItem(oMatch);}}
if(oSelf._bContainerOpen)
{oSelf._toggleContainer(false);}
oSelf._cancelIntervalDetection(oSelf);oSelf._bFocused=false;oSelf.textboxBlurEvent.fire(oSelf);}
else if(!oSelf._bOverContainer)
{if(oSelf._bContainerOpen)
{oSelf._toggleContainer(false);}
oSelf._bFocused=false;oSelf.textboxBlurEvent.fire(oSelf);}};YAHOO.widget.AutoComplete.prototype._onFormSubmit=function(v,oSelf){if(oSelf.allowBrowserAutocomplete){oSelf._oTextbox.setAttribute("autocomplete","on");}
else{oSelf._oTextbox.setAttribute("autocomplete","off");}};YAHOO.widget.DataSource=function(){};YAHOO.widget.DataSource.ERROR_DATANULL="Response data was null";YAHOO.widget.DataSource.ERROR_DATAPARSE="Response data could not be parsed";YAHOO.widget.DataSource.prototype.maxCacheEntries=15;YAHOO.widget.DataSource.prototype.queryMatchContains=false;YAHOO.widget.DataSource.prototype.queryMatchSubset=false;YAHOO.widget.DataSource.prototype.queryMatchCase=false;YAHOO.widget.DataSource.prototype.toString=function(){return"DataSource "+this._sName;};YAHOO.widget.DataSource.prototype.getResults=function(oCallbackFn,sQuery,oParent){var aResults=this._doQueryCache(oCallbackFn,sQuery,oParent);if(aResults.length===0){this.queryEvent.fire(this,oParent,sQuery);this.doQuery(oCallbackFn,sQuery,oParent);}};YAHOO.widget.DataSource.prototype.doQuery=function(oCallbackFn,sQuery,oParent){};YAHOO.widget.DataSource.prototype.flushCache=function(){if(this._aCache){this._aCache=[];}
if(this._aCacheHelper){this._aCacheHelper=[];}
this.cacheFlushEvent.fire(this);};YAHOO.widget.DataSource.prototype.queryEvent=null;YAHOO.widget.DataSource.prototype.cacheQueryEvent=null;YAHOO.widget.DataSource.prototype.getResultsEvent=null;YAHOO.widget.DataSource.prototype.getCachedResultsEvent=null;YAHOO.widget.DataSource.prototype.dataErrorEvent=null;YAHOO.widget.DataSource.prototype.cacheFlushEvent=null;YAHOO.widget.DataSource._nIndex=0;YAHOO.widget.DataSource.prototype._sName=null;YAHOO.widget.DataSource.prototype._aCache=null;YAHOO.widget.DataSource.prototype._init=function(){var maxCacheEntries=this.maxCacheEntries;if(!YAHOO.lang.isNumber(maxCacheEntries)||(maxCacheEntries<0)){maxCacheEntries=0;}
if(maxCacheEntries>0&&!this._aCache){this._aCache=[];}
this._sName="instance"+YAHOO.widget.DataSource._nIndex;YAHOO.widget.DataSource._nIndex++;this.queryEvent=new YAHOO.util.CustomEvent("query",this);this.cacheQueryEvent=new YAHOO.util.CustomEvent("cacheQuery",this);this.getResultsEvent=new YAHOO.util.CustomEvent("getResults",this);this.getCachedResultsEvent=new YAHOO.util.CustomEvent("getCachedResults",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.cacheFlushEvent=new YAHOO.util.CustomEvent("cacheFlush",this);};YAHOO.widget.DataSource.prototype._addCacheElem=function(oResult){var aCache=this._aCache;if(!aCache||!oResult||!oResult.query||!oResult.results){return;}
if(aCache.length>=this.maxCacheEntries){aCache.shift();}
aCache.push(oResult);};YAHOO.widget.DataSource.prototype._doQueryCache=function(oCallbackFn,sQuery,oParent){var aResults=[];var bMatchFound=false;var aCache=this._aCache;var nCacheLength=(aCache)?aCache.length:0;var bMatchContains=this.queryMatchContains;if((this.maxCacheEntries>0)&&aCache&&(nCacheLength>0)){this.cacheQueryEvent.fire(this,oParent,sQuery);if(!this.queryMatchCase){var sOrigQuery=sQuery;sQuery=sQuery.toLowerCase();}
for(var i=nCacheLength-1;i>=0;i--){var resultObj=aCache[i];var aAllResultItems=resultObj.results;var matchKey=(!this.queryMatchCase)?encodeURIComponent(resultObj.query).toLowerCase():encodeURIComponent(resultObj.query);if(matchKey==sQuery){bMatchFound=true;aResults=aAllResultItems;if(i!=nCacheLength-1){aCache.splice(i,1);this._addCacheElem(resultObj);}
break;}
else if(this.queryMatchSubset){for(var j=sQuery.length-1;j>=0;j--){var subQuery=sQuery.substr(0,j);if(matchKey==subQuery){bMatchFound=true;for(var k=aAllResultItems.length-1;k>=0;k--){var aRecord=aAllResultItems[k];var sKeyIndex=(this.queryMatchCase)?encodeURIComponent(aRecord[0]).indexOf(sQuery):encodeURIComponent(aRecord[0]).toLowerCase().indexOf(sQuery);if((!bMatchContains&&(sKeyIndex===0))||(bMatchContains&&(sKeyIndex>-1))){aResults.unshift(aRecord);}}
resultObj={};resultObj.query=sQuery;resultObj.results=aResults;this._addCacheElem(resultObj);break;}}
if(bMatchFound){break;}}}
if(bMatchFound){this.getCachedResultsEvent.fire(this,oParent,sOrigQuery,aResults);oCallbackFn(sOrigQuery,aResults,oParent);}}
return aResults;};YAHOO.widget.DS_XHR=function(sScriptURI,aSchema,oConfigs){if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
if(!YAHOO.lang.isArray(aSchema)||!YAHOO.lang.isString(sScriptURI)){return;}
this.schema=aSchema;this.scriptURI=sScriptURI;this._init();};YAHOO.widget.DS_XHR.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_XHR.TYPE_JSON=0;YAHOO.widget.DS_XHR.TYPE_XML=1;YAHOO.widget.DS_XHR.TYPE_FLAT=2;YAHOO.widget.DS_XHR.ERROR_DATAXHR="XHR response failed";YAHOO.widget.DS_XHR.prototype.connMgr=YAHOO.util.Connect;YAHOO.widget.DS_XHR.prototype.connTimeout=0;YAHOO.widget.DS_XHR.prototype.scriptURI=null;YAHOO.widget.DS_XHR.prototype.scriptQueryParam="query";YAHOO.widget.DS_XHR.prototype.scriptQueryAppend="";YAHOO.widget.DS_XHR.prototype.responseType=YAHOO.widget.DS_XHR.TYPE_JSON;YAHOO.widget.DS_XHR.prototype.responseStripAfter="\n<!-";YAHOO.widget.DS_XHR.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var isXML=(this.responseType==YAHOO.widget.DS_XHR.TYPE_XML);var sUri=this.scriptURI+"?"+this.scriptQueryParam+"="+sQuery;if(this.scriptQueryAppend.length>0){sUri+="&"+this.scriptQueryAppend;}
var oResponse=null;var oSelf=this;var responseSuccess=function(oResp){if(!oSelf._oConn||(oResp.tId!=oSelf._oConn.tId)){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}
for(var foo in oResp){}
if(!isXML){oResp=oResp.responseText;}
else{oResp=oResp.responseXML;}
if(oResp===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}
var aResults=oSelf.parseResponse(sQuery,oResp,oParent);var resultObj={};resultObj.query=decodeURIComponent(sQuery);resultObj.results=aResults;if(aResults===null){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATAPARSE);aResults=[];}
else{oSelf.getResultsEvent.fire(oSelf,oParent,sQuery,aResults);oSelf._addCacheElem(resultObj);}
oCallbackFn(sQuery,aResults,oParent);};var responseFailure=function(oResp){oSelf.dataErrorEvent.fire(oSelf,oParent,sQuery,YAHOO.widget.DS_XHR.ERROR_DATAXHR);return;};var oCallback={success:responseSuccess,failure:responseFailure};if(YAHOO.lang.isNumber(this.connTimeout)&&(this.connTimeout>0)){oCallback.timeout=this.connTimeout;}
if(this._oConn){this.connMgr.abort(this._oConn);}
oSelf._oConn=this.connMgr.asyncRequest("GET",sUri,oCallback,null);};YAHOO.widget.DS_XHR.prototype.parseResponse=function(sQuery,oResponse,oParent){var aSchema=this.schema;var aResults=[];var bError=false;var nEnd=((this.responseStripAfter!=="")&&(oResponse.indexOf))?oResponse.indexOf(this.responseStripAfter):-1;if(nEnd!=-1){oResponse=oResponse.substring(0,nEnd);}
switch(this.responseType){case YAHOO.widget.DS_XHR.TYPE_JSON:var jsonList,jsonObjParsed;var isNotMac=(navigator.userAgent.toLowerCase().indexOf('khtml')==-1);if(oResponse.parseJSON&&isNotMac){jsonObjParsed=oResponse.parseJSON();if(!jsonObjParsed){bError=true;}
else{try{jsonList=eval("jsonObjParsed."+aSchema[0]);}
catch(e){bError=true;break;}}}
else if(window.JSON&&isNotMac){jsonObjParsed=JSON.parse(oResponse);if(!jsonObjParsed){bError=true;break;}
else{try{jsonList=eval("jsonObjParsed."+aSchema[0]);}
catch(e){bError=true;break;}}}
else{try{while(oResponse.substring(0,1)==" "){oResponse=oResponse.substring(1,oResponse.length);}
if(oResponse.indexOf("{")<0){bError=true;break;}
if(oResponse.indexOf("{}")===0){break;}
var jsonObjRaw=eval("("+oResponse+")");if(!jsonObjRaw){bError=true;break;}
jsonList=eval("(jsonObjRaw."+aSchema[0]+")");}
catch(e){bError=true;break;}}
if(!jsonList){bError=true;break;}
if(!YAHOO.lang.isArray(jsonList)){jsonList=[jsonList];}
for(var i=jsonList.length-1;i>=0;i--){var aResultItem=[];var jsonResult=jsonList[i];for(var j=aSchema.length-1;j>=1;j--){var dataFieldValue=jsonResult[aSchema[j]];if(!dataFieldValue){dataFieldValue="";}
aResultItem.unshift(dataFieldValue);}
if(aResultItem.length==1){aResultItem.push(jsonResult);}
aResults.unshift(aResultItem);}
break;case YAHOO.widget.DS_XHR.TYPE_XML:var xmlList=oResponse.getElementsByTagName(aSchema[0]);if(!xmlList){bError=true;break;}
for(var k=xmlList.length-1;k>=0;k--){var result=xmlList.item(k);var aFieldSet=[];for(var m=aSchema.length-1;m>=1;m--){var sValue=null;var xmlAttr=result.attributes.getNamedItem(aSchema[m]);if(xmlAttr){sValue=xmlAttr.value;}
else{var xmlNode=result.getElementsByTagName(aSchema[m]);if(xmlNode&&xmlNode.item(0)&&xmlNode.item(0).firstChild){sValue=xmlNode.item(0).firstChild.nodeValue;}
else{sValue="";}}
aFieldSet.unshift(sValue);}
aResults.unshift(aFieldSet);}
break;case YAHOO.widget.DS_XHR.TYPE_FLAT:if(oResponse.length>0){var newLength=oResponse.length-aSchema[0].length;if(oResponse.substr(newLength)==aSchema[0]){oResponse=oResponse.substr(0,newLength);}
var aRecords=oResponse.split(aSchema[0]);for(var n=aRecords.length-1;n>=0;n--){aResults[n]=aRecords[n].split(aSchema[1]);}}
break;default:break;}
sQuery=null;oResponse=null;oParent=null;if(bError){return null;}
else{return aResults;}};YAHOO.widget.DS_XHR.prototype._oConn=null;YAHOO.widget.DS_JSFunction=function(oFunction,oConfigs){if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
if(!YAHOO.lang.isFunction(oFunction)){return;}
else{this.dataFunction=oFunction;this._init();}};YAHOO.widget.DS_JSFunction.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSFunction.prototype.dataFunction=null;YAHOO.widget.DS_JSFunction.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var oFunction=this.dataFunction;var aResults=[];aResults=oFunction(sQuery);if(aResults===null){this.dataErrorEvent.fire(this,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATANULL);return;}
var resultObj={};resultObj.query=decodeURIComponent(sQuery);resultObj.results=aResults;this._addCacheElem(resultObj);this.getResultsEvent.fire(this,oParent,sQuery,aResults);oCallbackFn(sQuery,aResults,oParent);return;};YAHOO.widget.DS_JSArray=function(aData,oConfigs){if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){this[sConfig]=oConfigs[sConfig];}}
if(!YAHOO.lang.isArray(aData)){return;}
else{this.data=aData;this._init();}};YAHOO.widget.DS_JSArray.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSArray.prototype.data=null;YAHOO.widget.DS_JSArray.prototype.doQuery=function(oCallbackFn,sQuery,oParent){var i;var aData=this.data;var aResults=[];var bMatchFound=false;var bMatchContains=this.queryMatchContains;if(sQuery){if(!this.queryMatchCase){sQuery=sQuery.toLowerCase();}
for(i=aData.length-1;i>=0;i--){var aDataset=[];if(YAHOO.lang.isString(aData[i])){aDataset[0]=aData[i];}
else if(YAHOO.lang.isArray(aData[i])){aDataset=aData[i];}
if(YAHOO.lang.isString(aDataset[0])){var sKeyIndex=(this.queryMatchCase)?encodeURIComponent(aDataset[0]).indexOf(sQuery):encodeURIComponent(aDataset[0]).toLowerCase().indexOf(sQuery);if((!bMatchContains&&(sKeyIndex===0))||(bMatchContains&&(sKeyIndex>-1))){aResults.unshift(aDataset);}}}}
else{for(i=aData.length-1;i>=0;i--){if(YAHOO.lang.isString(aData[i])){aResults.unshift([aData[i]]);}
else if(YAHOO.lang.isArray(aData[i])){aResults.unshift(aData[i]);}}}
this.getResultsEvent.fire(this,oParent,sQuery,aResults);oCallbackFn(sQuery,aResults,oParent);};YAHOO.register("autocomplete",YAHOO.widget.AutoComplete,{version:"2.3.0",build:"442"});(function(){YAHOO.util.Config=function(owner){if(owner){this.init(owner);}
if(!owner){}};var Lang=YAHOO.lang,CustomEvent=YAHOO.util.CustomEvent,Config=YAHOO.util.Config;Config.CONFIG_CHANGED_EVENT="configChanged";Config.BOOLEAN_TYPE="boolean";Config.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(owner){this.owner=owner;this.configChangedEvent=this.createEvent(Config.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=CustomEvent.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(val){return(typeof val==Config.BOOLEAN_TYPE);},checkNumber:function(val){return(!isNaN(val));},fireEvent:function(key,value){var property=this.config[key];if(property&&property.event){property.event.fire(value);}},addProperty:function(key,propertyObject){key=key.toLowerCase();this.config[key]=propertyObject;propertyObject.event=this.createEvent(key,{scope:this.owner});propertyObject.event.signature=CustomEvent.LIST;propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner);}
this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}},getConfig:function(){var cfg={},prop,property;for(prop in this.config){property=this.config[prop];if(property&&property.event){cfg[prop]=property.value;}}
return cfg;},getProperty:function(key){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.value;}else{return undefined;}},resetProperty:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event){if(this.initialConfig[key]&&!Lang.isUndefined(this.initialConfig[key])){this.setProperty(key,this.initialConfig[key]);}
return true;}else{return false;}},setProperty:function(key,value,silent){var property;key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{property=this.config[key];if(property&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){this.fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
return true;}}else{return false;}}},queueProperty:function(key,value){key=key.toLowerCase();var property=this.config[key],foundDuplicate=false,iLen,queueItem,queueItemKey,queueItemValue,sLen,supercedesCheck,qLen,queueItemCheck,queueItemCheckKey,queueItemCheckValue,i,s,q;if(property&&property.event){if(!Lang.isUndefined(value)&&property.validator&&!property.validator(value)){return false;}else{if(!Lang.isUndefined(value)){property.value=value;}else{value=property.value;}
foundDuplicate=false;iLen=this.eventQueue.length;for(i=0;i<iLen;i++){queueItem=this.eventQueue[i];if(queueItem){queueItemKey=queueItem[0];queueItemValue=queueItem[1];if(queueItemKey==key){this.eventQueue[i]=null;this.eventQueue.push([key,(!Lang.isUndefined(value)?value:queueItemValue)]);foundDuplicate=true;break;}}}
if(!foundDuplicate&&!Lang.isUndefined(value)){this.eventQueue.push([key,value]);}}
if(property.supercedes){sLen=property.supercedes.length;for(s=0;s<sLen;s++){supercedesCheck=property.supercedes[s];qLen=this.eventQueue.length;for(q=0;q<qLen;q++){queueItemCheck=this.eventQueue[q];if(queueItemCheck){queueItemCheckKey=queueItemCheck[0];queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey==supercedesCheck.toLowerCase()){this.eventQueue.push([queueItemCheckKey,queueItemCheckValue]);this.eventQueue[q]=null;break;}}}}}
return true;}else{return false;}},refireEvent:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event&&!Lang.isUndefined(property.value)){if(this.queueInProgress){this.queueProperty(key);}else{this.fireEvent(key,property.value);}}},applyConfig:function(userConfig,init){var prop;if(init){this.initialConfig=userConfig;}
for(prop in userConfig){this.queueProperty(prop,userConfig[prop]);}},refresh:function(){var prop;for(prop in this.config){this.refireEvent(prop);}},fireQueue:function(){var i,queueItem,key,value,property;this.queueInProgress=true;for(i=0;i<this.eventQueue.length;i++){queueItem=this.eventQueue[i];if(queueItem){key=queueItem[0];value=queueItem[1];property=this.config[key];property.value=value;this.fireEvent(key,value);}}
this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(key,handler,obj,override){var property=this.config[key.toLowerCase()];if(property&&property.event){if(!Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
return true;}else{return false;}},unsubscribeFromConfigEvent:function(key,handler,obj){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}},toString:function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
return output;},outputEventQueue:function(){var output="",queueItem,q,nQueue=this.eventQueue.length;for(q=0;q<nQueue;q++){queueItem=this.eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
return output;},destroy:function(){var oConfig=this.config,sProperty,oProperty;for(sProperty in oConfig){if(Lang.hasOwnProperty(oConfig,sProperty)){oProperty=oConfig[sProperty];oProperty.event.unsubscribeAll();oProperty.event=null;}}
this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};Config.alreadySubscribed=function(evt,fn,obj){var nSubscribers=evt.subscribers.length,subsc,i;if(nSubscribers>0){i=nSubscribers-1;do{subsc=evt.subscribers[i];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}
while(i--);}
return false;};YAHOO.lang.augmentProto(Config,YAHOO.util.EventProvider);}());YAHOO.widget.DateMath={DAY:"D",WEEK:"W",YEAR:"Y",MONTH:"M",ONE_DAY_MS:1000*60*60*24,add:function(date,field,amount){var d=new Date(date.getTime());switch(field){case this.MONTH:var newMonth=date.getMonth()+amount;var years=0;if(newMonth<0){while(newMonth<0){newMonth+=12;years-=1;}}else if(newMonth>11){while(newMonth>11){newMonth-=12;years+=1;}}
d.setMonth(newMonth);d.setFullYear(date.getFullYear()+years);break;case this.DAY:d.setDate(date.getDate()+amount);break;case this.YEAR:d.setFullYear(date.getFullYear()+amount);break;case this.WEEK:d.setDate(date.getDate()+(amount*7));break;}
return d;},subtract:function(date,field,amount){return this.add(date,field,(amount*-1));},before:function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()<ms){return true;}else{return false;}},after:function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()>ms){return true;}else{return false;}},between:function(date,dateBegin,dateEnd){if(this.after(date,dateBegin)&&this.before(date,dateEnd)){return true;}else{return false;}},getJan1:function(calendarYear){return new Date(calendarYear,0,1);},getDayOffset:function(date,calendarYear){var beginYear=this.getJan1(calendarYear);var dayOffset=Math.ceil((date.getTime()-beginYear.getTime())/this.ONE_DAY_MS);return dayOffset;},getWeekNumber:function(date,calendarYear){date=this.clearTime(date);var nearestThurs=new Date(date.getTime()+(4*this.ONE_DAY_MS)-((date.getDay())*this.ONE_DAY_MS));var jan1=new Date(nearestThurs.getFullYear(),0,1);var dayOfYear=((nearestThurs.getTime()-jan1.getTime())/this.ONE_DAY_MS)-1;var weekNum=Math.ceil((dayOfYear)/7);return weekNum;},isYearOverlapWeek:function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getFullYear()!=weekBeginDate.getFullYear()){overlaps=true;}
return overlaps;},isMonthOverlapWeek:function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getMonth()!=weekBeginDate.getMonth()){overlaps=true;}
return overlaps;},findMonthStart:function(date){var start=new Date(date.getFullYear(),date.getMonth(),1);return start;},findMonthEnd:function(date){var start=this.findMonthStart(date);var nextMonth=this.add(start,this.MONTH,1);var end=this.subtract(nextMonth,this.DAY,1);return end;},clearTime:function(date){date.setHours(12,0,0,0);return date;}};YAHOO.widget.Calendar=function(id,containerId,config){this.init(id,containerId,config);};YAHOO.widget.Calendar.IMG_ROOT=null;YAHOO.widget.Calendar.DATE="D";YAHOO.widget.Calendar.MONTH_DAY="MD";YAHOO.widget.Calendar.WEEKDAY="WD";YAHOO.widget.Calendar.RANGE="R";YAHOO.widget.Calendar.MONTH="M";YAHOO.widget.Calendar.DISPLAY_DAYS=42;YAHOO.widget.Calendar.STOP_RENDER="S";YAHOO.widget.Calendar.SHORT="short";YAHOO.widget.Calendar.LONG="long";YAHOO.widget.Calendar.MEDIUM="medium";YAHOO.widget.Calendar.ONE_CHAR="1char";YAHOO.widget.Calendar._DEFAULT_CONFIG={PAGEDATE:{key:"pagedate",value:null},SELECTED:{key:"selected",value:null},TITLE:{key:"title",value:""},CLOSE:{key:"close",value:false},IFRAME:{key:"iframe",value:(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<=6)?true:false},MINDATE:{key:"mindate",value:null},MAXDATE:{key:"maxdate",value:null},MULTI_SELECT:{key:"multi_select",value:false},START_WEEKDAY:{key:"start_weekday",value:0},SHOW_WEEKDAYS:{key:"show_weekdays",value:true},SHOW_WEEK_HEADER:{key:"show_week_header",value:false},SHOW_WEEK_FOOTER:{key:"show_week_footer",value:false},HIDE_BLANK_WEEKS:{key:"hide_blank_weeks",value:false},NAV_ARROW_LEFT:{key:"nav_arrow_left",value:null},NAV_ARROW_RIGHT:{key:"nav_arrow_right",value:null},MONTHS_SHORT:{key:"months_short",value:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},MONTHS_LONG:{key:"months_long",value:["January","February","March","April","May","June","July","August","September","October","November","December"]},WEEKDAYS_1CHAR:{key:"weekdays_1char",value:["S","M","T","W","T","F","S"]},WEEKDAYS_SHORT:{key:"weekdays_short",value:["Su","Mo","Tu","We","Th","Fr","Sa"]},WEEKDAYS_MEDIUM:{key:"weekdays_medium",value:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},WEEKDAYS_LONG:{key:"weekdays_long",value:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},LOCALE_MONTHS:{key:"locale_months",value:"long"},LOCALE_WEEKDAYS:{key:"locale_weekdays",value:"short"},DATE_DELIMITER:{key:"date_delimiter",value:","},DATE_FIELD_DELIMITER:{key:"date_field_delimiter",value:"/"},DATE_RANGE_DELIMITER:{key:"date_range_delimiter",value:"-"},MY_MONTH_POSITION:{key:"my_month_position",value:1},MY_YEAR_POSITION:{key:"my_year_position",value:2},MD_MONTH_POSITION:{key:"md_month_position",value:1},MD_DAY_POSITION:{key:"md_day_position",value:2},MDY_MONTH_POSITION:{key:"mdy_month_position",value:1},MDY_DAY_POSITION:{key:"mdy_day_position",value:2},MDY_YEAR_POSITION:{key:"mdy_year_position",value:3},MY_LABEL_MONTH_POSITION:{key:"my_label_month_position",value:1},MY_LABEL_YEAR_POSITION:{key:"my_label_year_position",value:2},MY_LABEL_MONTH_SUFFIX:{key:"my_label_month_suffix",value:" "},MY_LABEL_YEAR_SUFFIX:{key:"my_label_year_suffix",value:""}};YAHOO.widget.Calendar._EVENT_TYPES={BEFORE_SELECT:"beforeSelect",SELECT:"select",BEFORE_DESELECT:"beforeDeselect",DESELECT:"deselect",CHANGE_PAGE:"changePage",BEFORE_RENDER:"beforeRender",RENDER:"render",RESET:"reset",CLEAR:"clear"};YAHOO.widget.Calendar._STYLES={CSS_ROW_HEADER:"calrowhead",CSS_ROW_FOOTER:"calrowfoot",CSS_CELL:"calcell",CSS_CELL_SELECTOR:"selector",CSS_CELL_SELECTED:"selected",CSS_CELL_SELECTABLE:"selectable",CSS_CELL_RESTRICTED:"restricted",CSS_CELL_TODAY:"today",CSS_CELL_OOM:"oom",CSS_CELL_OOB:"previous",CSS_HEADER:"calheader",CSS_HEADER_TEXT:"calhead",CSS_BODY:"calbody",CSS_WEEKDAY_CELL:"calweekdaycell",CSS_WEEKDAY_ROW:"calweekdayrow",CSS_FOOTER:"calfoot",CSS_CALENDAR:"yui-calendar DoNotFollow",CSS_SINGLE:"single",CSS_CONTAINER:"yui-calcontainer",CSS_NAV_LEFT:"calnavleft",CSS_NAV_RIGHT:"calnavright",CSS_CLOSE:"calclose",CSS_CELL_TOP:"calcelltop",CSS_CELL_LEFT:"calcellleft",CSS_CELL_RIGHT:"calcellright",CSS_CELL_BOTTOM:"calcellbottom",CSS_CELL_HOVER:"calcellhover",CSS_CELL_HIGHLIGHT1:"highlight1",CSS_CELL_HIGHLIGHT2:"highlight2",CSS_CELL_HIGHLIGHT3:"highlight3",CSS_CELL_HIGHLIGHT4:"highlight4"};YAHOO.widget.Calendar.prototype={Config:null,parent:null,index:-1,cells:null,cellDates:null,id:null,oDomContainer:null,today:null,renderStack:null,_renderStack:null,_selectedDates:null,domEventMap:null};YAHOO.widget.Calendar.prototype.init=function(id,containerId,config){this.initEvents();this.today=new Date();YAHOO.widget.DateMath.clearTime(this.today);this.id=id;this.oDomContainer=$(containerId);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};this.initStyles();$AddClass(this.oDomContainer,this.Style.CSS_CONTAINER);$AddClass(this.oDomContainer,this.Style.CSS_SINGLE);this.cellDates=[];this.cells=[];this.renderStack=[];this._renderStack=[];this.setupConfig();if(config){this.cfg.applyConfig(config,true);}
this.cfg.fireQueue();};YAHOO.widget.Calendar.prototype.configIframe=function(type,args,obj){var useIframe=args[0];if(!this.parent){if(YAHOO.util.Dom.inDocument(this.oDomContainer)){if(useIframe){var pos=$S(this.oDomContainer,"position");if(pos=="absolute"||pos=="relative"){if(!YAHOO.util.Dom.inDocument(this.iframe)){this.iframe=document.createElement("iframe");this.iframe.src="javascript:false;";$SetStyle(this.iframe,"opacity","0");if(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<=6){$AddClass(this.iframe,"fixedsize");}
this.oDomContainer.insertBefore(this.iframe,this.oDomContainer.firstChild);}}}else{if(this.iframe){if(this.iframe.parentNode){this.iframe.parentNode.removeChild(this.iframe);}
this.iframe=null;}}}}};YAHOO.widget.Calendar.prototype.configTitle=function(type,args,obj){var title=args[0];var close=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.CLOSE.key);var titleDiv;if(title&&title!==""){titleDiv=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE,"div",this.oDomContainer)[0]||document.createElement("div");titleDiv.className=YAHOO.widget.CalendarGroup.CSS_2UPTITLE;titleDiv.innerHTML=title;this.oDomContainer.insertBefore(titleDiv,this.oDomContainer.firstChild);$AddClass(this.oDomContainer,"withtitle");}else{titleDiv=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE,"div",this.oDomContainer)[0]||null;if(titleDiv){YAHOO.util.Event.purgeElement(titleDiv);this.oDomContainer.removeChild(titleDiv);}
if(!close){$RemoveClass(this.oDomContainer,"withtitle");}}};YAHOO.widget.Calendar.prototype.configClose=function(type,args,obj){var close=args[0];var title=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.TITLE.key);var DEPR_CLOSE_PATH="us/my/bn/x_d.gif";var linkClose;if(close===true){linkClose=YAHOO.util.Dom.getElementsByClassName("link-close","a",this.oDomContainer)[0]||document.createElement("a");linkClose.href="#";linkClose.className="link-close";YAHOO.util.Event.addListener(linkClose,"click",function(e,cal){cal.hide();YAHOO.util.Event.preventDefault(e);},this);if(YAHOO.widget.Calendar.IMG_ROOT!==null){var imgClose=document.createElement("img");imgClose.src=YAHOO.widget.Calendar.IMG_ROOT+DEPR_CLOSE_PATH;imgClose.className=YAHOO.widget.CalendarGroup.CSS_2UPCLOSE;linkClose.appendChild(imgClose);}else{linkClose.innerHTML='<span class="'+YAHOO.widget.CalendarGroup.CSS_2UPCLOSE+' '+this.Style.CSS_CLOSE+'"></span>';}
this.oDomContainer.appendChild(linkClose);$AddClass(this.oDomContainer,"withtitle");}else{linkClose=YAHOO.util.Dom.getElementsByClassName("link-close","a",this.oDomContainer)[0]||null;if(linkClose){YAHOO.util.Event.purgeElement(linkClose);this.oDomContainer.removeChild(linkClose);}
if(!title||title===""){$RemoveClass(this.oDomContainer,"withtitle");}}};YAHOO.widget.Calendar.prototype.initEvents=function(){var defEvents=YAHOO.widget.Calendar._EVENT_TYPES;this.beforeSelectEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT);this.selectEvent=new YAHOO.util.CustomEvent(defEvents.SELECT);this.beforeDeselectEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT);this.deselectEvent=new YAHOO.util.CustomEvent(defEvents.DESELECT);this.changePageEvent=new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE);this.beforeRenderEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);this.renderEvent=new YAHOO.util.CustomEvent(defEvents.RENDER);this.resetEvent=new YAHOO.util.CustomEvent(defEvents.RESET);this.clearEvent=new YAHOO.util.CustomEvent(defEvents.CLEAR);this.beforeSelectEvent.subscribe(this.onBeforeSelect,this,true);this.selectEvent.subscribe(this.onSelect,this,true);this.beforeDeselectEvent.subscribe(this.onBeforeDeselect,this,true);this.deselectEvent.subscribe(this.onDeselect,this,true);this.changePageEvent.subscribe(this.onChangePage,this,true);this.renderEvent.subscribe(this.onRender,this,true);this.resetEvent.subscribe(this.onReset,this,true);this.clearEvent.subscribe(this.onClear,this,true);};YAHOO.widget.Calendar.prototype.doSelectCell=function(e,cal){var cell,index,d,date;var target=YAHOO.util.Event.getTarget(e);var tagName=target.tagName.toLowerCase();var defSelector=false;while(tagName!="td"&&!$HasClass(target,cal.Style.CSS_CELL_SELECTABLE)){if(!defSelector&&tagName=="a"&&$HasClass(target,cal.Style.CSS_CELL_SELECTOR)){defSelector=true;}
target=target.parentNode;tagName=target.tagName.toLowerCase();if(tagName=="html"){return;}}
if(defSelector){YAHOO.util.Event.preventDefault(e);}
cell=target;if($HasClass(cell,cal.Style.CSS_CELL_SELECTABLE)){index=cell.id.split("cell")[1];d=cal.cellDates[index];date=new Date(d[0],d[1]-1,d[2]);var link;if(cal.Options.MULTI_SELECT){link=cell.getElementsByTagName("a")[0];if(link){link.blur();}
var cellDate=cal.cellDates[index];var cellDateIndex=cal._indexOfSelectedFieldArray(cellDate);if(cellDateIndex>-1){cal.deselectCell(index);}else{cal.selectCell(index);}}else{link=cell.getElementsByTagName("a")[0];if(link){link.blur();}
cal.selectCell(index);}}};YAHOO.widget.Calendar.prototype.doCellMouseOver=function(e,cal){var target;if(e){target=YAHOO.util.Event.getTarget(e);}else{target=this;}
while(target.tagName.toLowerCase()!="td"){target=target.parentNode;if(target.tagName.toLowerCase()=="html"){return;}}
if($HasClass(target,cal.Style.CSS_CELL_SELECTABLE)){$AddClass(target,cal.Style.CSS_CELL_HOVER);}};YAHOO.widget.Calendar.prototype.doCellMouseOut=function(e,cal){var target;if(e){target=YAHOO.util.Event.getTarget(e);}else{target=this;}
while(target.tagName.toLowerCase()!="td"){target=target.parentNode;if(target.tagName.toLowerCase()=="html"){return;}}
if($HasClass(target,cal.Style.CSS_CELL_SELECTABLE)){$RemoveClass(target,cal.Style.CSS_CELL_HOVER);}};YAHOO.widget.Calendar.prototype.setupConfig=function(){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;this.cfg.addProperty(defCfg.PAGEDATE.key,{value:new Date(),handler:this.configPageDate});this.cfg.addProperty(defCfg.SELECTED.key,{value:[],handler:this.configSelected});this.cfg.addProperty(defCfg.TITLE.key,{value:defCfg.TITLE.value,handler:this.configTitle});this.cfg.addProperty(defCfg.CLOSE.key,{value:defCfg.CLOSE.value,handler:this.configClose});this.cfg.addProperty(defCfg.IFRAME.key,{value:defCfg.IFRAME.value,handler:this.configIframe,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.MINDATE.key,{value:defCfg.MINDATE.value,handler:this.configMinDate});this.cfg.addProperty(defCfg.MAXDATE.key,{value:defCfg.MAXDATE.value,handler:this.configMaxDate});this.cfg.addProperty(defCfg.MULTI_SELECT.key,{value:defCfg.MULTI_SELECT.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.START_WEEKDAY.key,{value:defCfg.START_WEEKDAY.value,handler:this.configOptions,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,{value:defCfg.SHOW_WEEKDAYS.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key,{value:defCfg.SHOW_WEEK_HEADER.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{value:defCfg.SHOW_WEEK_FOOTER.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key,{value:defCfg.HIDE_BLANK_WEEKS.value,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key,{value:defCfg.NAV_ARROW_LEFT.value,handler:this.configOptions});this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key,{value:defCfg.NAV_ARROW_RIGHT.value,handler:this.configOptions});this.cfg.addProperty(defCfg.MONTHS_SHORT.key,{value:defCfg.MONTHS_SHORT.value,handler:this.configLocale});this.cfg.addProperty(defCfg.MONTHS_LONG.key,{value:defCfg.MONTHS_LONG.value,handler:this.configLocale});this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key,{value:defCfg.WEEKDAYS_1CHAR.value,handler:this.configLocale});this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key,{value:defCfg.WEEKDAYS_SHORT.value,handler:this.configLocale});this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,{value:defCfg.WEEKDAYS_MEDIUM.value,handler:this.configLocale});this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,{value:defCfg.WEEKDAYS_LONG.value,handler:this.configLocale});var refreshLocale=function(){this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);};this.cfg.subscribeToConfigEvent(defCfg.START_WEEKDAY.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.MONTHS_SHORT.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.MONTHS_LONG.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_1CHAR.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_SHORT.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_MEDIUM.key,refreshLocale,this,true);this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_LONG.key,refreshLocale,this,true);this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,{value:defCfg.LOCALE_MONTHS.value,handler:this.configLocaleValues});this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,{value:defCfg.LOCALE_WEEKDAYS.value,handler:this.configLocaleValues});this.cfg.addProperty(defCfg.DATE_DELIMITER.key,{value:defCfg.DATE_DELIMITER.value,handler:this.configLocale});this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key,{value:defCfg.DATE_FIELD_DELIMITER.value,handler:this.configLocale});this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key,{value:defCfg.DATE_RANGE_DELIMITER.value,handler:this.configLocale});this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,{value:defCfg.MY_MONTH_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,{value:defCfg.MY_YEAR_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,{value:defCfg.MD_MONTH_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,{value:defCfg.MD_DAY_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,{value:defCfg.MDY_MONTH_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,{value:defCfg.MDY_DAY_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,{value:defCfg.MDY_YEAR_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,{value:defCfg.MY_LABEL_MONTH_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key,{value:defCfg.MY_LABEL_YEAR_POSITION.value,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,{value:defCfg.MY_LABEL_MONTH_SUFFIX.value,handler:this.configLocale});this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key,{value:defCfg.MY_LABEL_YEAR_SUFFIX.value,handler:this.configLocale});};YAHOO.widget.Calendar.prototype.configPageDate=function(type,args,obj){this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key,this._parsePageDate(args[0]),true);};YAHOO.widget.Calendar.prototype.configMinDate=function(type,args,obj){var val=args[0];if(YAHOO.lang.isString(val)){val=this._parseDate(val);this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MINDATE.key,new Date(val[0],(val[1]-1),val[2]));}};YAHOO.widget.Calendar.prototype.configMaxDate=function(type,args,obj){var val=args[0];if(YAHOO.lang.isString(val)){val=this._parseDate(val);this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MAXDATE.key,new Date(val[0],(val[1]-1),val[2]));}};YAHOO.widget.Calendar.prototype.configSelected=function(type,args,obj){var selected=args[0];var cfgSelected=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;if(selected){if(YAHOO.lang.isString(selected)){this.cfg.setProperty(cfgSelected,this._parseDates(selected),true);}}
if(!this._selectedDates){this._selectedDates=this.cfg.getProperty(cfgSelected);}};YAHOO.widget.Calendar.prototype.configOptions=function(type,args,obj){this.Options[type.toUpperCase()]=args[0];};YAHOO.widget.Calendar.prototype.configLocale=function(type,args,obj){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;this.Locale[type.toUpperCase()]=args[0];this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);};YAHOO.widget.Calendar.prototype.configLocaleValues=function(type,args,obj){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;type=type.toLowerCase();var val=args[0];switch(type){case defCfg.LOCALE_MONTHS.key:switch(val){case YAHOO.widget.Calendar.SHORT:this.Locale.LOCALE_MONTHS=this.cfg.getProperty(defCfg.MONTHS_SHORT.key).concat();break;case YAHOO.widget.Calendar.LONG:this.Locale.LOCALE_MONTHS=this.cfg.getProperty(defCfg.MONTHS_LONG.key).concat();break;}
break;case defCfg.LOCALE_WEEKDAYS.key:switch(val){case YAHOO.widget.Calendar.ONE_CHAR:this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty(defCfg.WEEKDAYS_1CHAR.key).concat();break;case YAHOO.widget.Calendar.SHORT:this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty(defCfg.WEEKDAYS_SHORT.key).concat();break;case YAHOO.widget.Calendar.MEDIUM:this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty(defCfg.WEEKDAYS_MEDIUM.key).concat();break;case YAHOO.widget.Calendar.LONG:this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty(defCfg.WEEKDAYS_LONG.key).concat();break;}
var START_WEEKDAY=this.cfg.getProperty(defCfg.START_WEEKDAY.key);if(START_WEEKDAY>0){for(var w=0;w<START_WEEKDAY;++w){this.Locale.LOCALE_WEEKDAYS.push(this.Locale.LOCALE_WEEKDAYS.shift());}}
break;}};YAHOO.widget.Calendar.prototype.initStyles=function(){var defStyle=YAHOO.widget.Calendar._STYLES;this.Style={CSS_ROW_HEADER:defStyle.CSS_ROW_HEADER,CSS_ROW_FOOTER:defStyle.CSS_ROW_FOOTER,CSS_CELL:defStyle.CSS_CELL,CSS_CELL_SELECTOR:defStyle.CSS_CELL_SELECTOR,CSS_CELL_SELECTED:defStyle.CSS_CELL_SELECTED,CSS_CELL_SELECTABLE:defStyle.CSS_CELL_SELECTABLE,CSS_CELL_RESTRICTED:defStyle.CSS_CELL_RESTRICTED,CSS_CELL_TODAY:defStyle.CSS_CELL_TODAY,CSS_CELL_OOM:defStyle.CSS_CELL_OOM,CSS_CELL_OOB:defStyle.CSS_CELL_OOB,CSS_HEADER:defStyle.CSS_HEADER,CSS_HEADER_TEXT:defStyle.CSS_HEADER_TEXT,CSS_BODY:defStyle.CSS_BODY,CSS_WEEKDAY_CELL:defStyle.CSS_WEEKDAY_CELL,CSS_WEEKDAY_ROW:defStyle.CSS_WEEKDAY_ROW,CSS_FOOTER:defStyle.CSS_FOOTER,CSS_CALENDAR:defStyle.CSS_CALENDAR,CSS_SINGLE:defStyle.CSS_SINGLE,CSS_CONTAINER:defStyle.CSS_CONTAINER,CSS_NAV_LEFT:defStyle.CSS_NAV_LEFT,CSS_NAV_RIGHT:defStyle.CSS_NAV_RIGHT,CSS_CLOSE:defStyle.CSS_CLOSE,CSS_CELL_TOP:defStyle.CSS_CELL_TOP,CSS_CELL_LEFT:defStyle.CSS_CELL_LEFT,CSS_CELL_RIGHT:defStyle.CSS_CELL_RIGHT,CSS_CELL_BOTTOM:defStyle.CSS_CELL_BOTTOM,CSS_CELL_HOVER:defStyle.CSS_CELL_HOVER,CSS_CELL_HIGHLIGHT1:defStyle.CSS_CELL_HIGHLIGHT1,CSS_CELL_HIGHLIGHT2:defStyle.CSS_CELL_HIGHLIGHT2,CSS_CELL_HIGHLIGHT3:defStyle.CSS_CELL_HIGHLIGHT3,CSS_CELL_HIGHLIGHT4:defStyle.CSS_CELL_HIGHLIGHT4};};YAHOO.widget.Calendar.prototype.buildMonthLabel=function(){var pageDate=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key);var monthLabel=this.Locale.LOCALE_MONTHS[pageDate.getMonth()]+this.Locale.MY_LABEL_MONTH_SUFFIX;var yearLabel=pageDate.getFullYear()+this.Locale.MY_LABEL_YEAR_SUFFIX;if(this.Locale.MY_LABEL_MONTH_POSITION==2||this.Locale.MY_LABEL_YEAR_POSITION==1){return yearLabel+monthLabel;}else{return monthLabel+yearLabel;}};YAHOO.widget.Calendar.prototype.buildDayLabel=function(workingDate){return workingDate.getDate();};YAHOO.widget.Calendar.prototype.renderHeader=function(html){var colSpan=7;var DEPR_NAV_LEFT="us/tr/callt.gif";var DEPR_NAV_RIGHT="us/tr/calrt.gif";var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;if(this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)){colSpan+=1;}
if(this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)){colSpan+=1;}
html[html.length]="<thead>";html[html.length]="<tr>";html[html.length]='<th colspan="'+colSpan+'" class="'+this.Style.CSS_HEADER_TEXT+'">';html[html.length]='<div class="'+this.Style.CSS_HEADER+'">';var renderLeft,renderRight=false;if(this.parent){if(this.index===0){renderLeft=true;}
if(this.index==(this.parent.cfg.getProperty("pages")-1)){renderRight=true;}}else{renderLeft=true;renderRight=true;}
var cal=this.parent||this;if(renderLeft){var leftArrow=this.cfg.getProperty(defCfg.NAV_ARROW_LEFT.key);if(leftArrow===null&&YAHOO.widget.Calendar.IMG_ROOT!==null){leftArrow=YAHOO.widget.Calendar.IMG_ROOT+DEPR_NAV_LEFT;}
var leftStyle=(leftArrow===null)?"":' style="background-image:url('+leftArrow+')"';html[html.length]='<a class="'+this.Style.CSS_NAV_LEFT+'"'+leftStyle+' >&#160;</a>';}
html[html.length]=this.buildMonthLabel();if(renderRight){var rightArrow=this.cfg.getProperty(defCfg.NAV_ARROW_RIGHT.key);if(rightArrow===null&&YAHOO.widget.Calendar.IMG_ROOT!==null){rightArrow=YAHOO.widget.Calendar.IMG_ROOT+DEPR_NAV_RIGHT;}
var rightStyle=(rightArrow===null)?"":' style="background-image:url('+rightArrow+')"';html[html.length]='<a class="'+this.Style.CSS_NAV_RIGHT+'"'+rightStyle+' >&#160;</a>';}
html[html.length]='</div>\n</th>\n</tr>';if(this.cfg.getProperty(defCfg.SHOW_WEEKDAYS.key)){html=this.buildWeekdays(html);}
html[html.length]='</thead>';return html;};YAHOO.widget.Calendar.prototype.buildWeekdays=function(html){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;html[html.length]='<tr class="'+this.Style.CSS_WEEKDAY_ROW+'">';if(this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)){html[html.length]='<th>&#160;</th>';}
for(var i=0;i<this.Locale.LOCALE_WEEKDAYS.length;++i){html[html.length]='<th class="calweekdaycell">'+this.Locale.LOCALE_WEEKDAYS[i]+'</th>';}
if(this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)){html[html.length]='<th>&#160;</th>';}
html[html.length]='</tr>';return html;};YAHOO.widget.Calendar.prototype.renderBody=function(workingDate,html){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;var startDay=this.cfg.getProperty(defCfg.START_WEEKDAY.key);this.preMonthDays=workingDate.getDay();if(startDay>0){this.preMonthDays-=startDay;}
if(this.preMonthDays<0){this.preMonthDays+=7;}
this.monthDays=YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();this.postMonthDays=YAHOO.widget.Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;workingDate=YAHOO.widget.DateMath.subtract(workingDate,YAHOO.widget.DateMath.DAY,this.preMonthDays);var weekNum,weekClass;var weekPrefix="w";var cellPrefix="_cell";var workingDayPrefix="wd";var dayPrefix="d";var cellRenderers;var renderer;var todayYear=this.today.getFullYear();var todayMonth=this.today.getMonth();var todayDate=this.today.getDate();var useDate=this.cfg.getProperty(defCfg.PAGEDATE.key);var hideBlankWeeks=this.cfg.getProperty(defCfg.HIDE_BLANK_WEEKS.key);var showWeekFooter=this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key);var showWeekHeader=this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key);var mindate=this.cfg.getProperty(defCfg.MINDATE.key);var maxdate=this.cfg.getProperty(defCfg.MAXDATE.key);if(mindate){mindate=YAHOO.widget.DateMath.clearTime(mindate);}
if(maxdate){maxdate=YAHOO.widget.DateMath.clearTime(maxdate);}
html[html.length]='<tbody class="m'+(useDate.getMonth()+1)+' '+this.Style.CSS_BODY+'">';var i=0;var tempDiv=document.createElement("div");var cell=document.createElement("td");tempDiv.appendChild(cell);var jan1=new Date(useDate.getFullYear(),0,1);var cal=this.parent||this;for(var r=0;r<6;r++){weekNum=YAHOO.widget.DateMath.getWeekNumber(workingDate,useDate.getFullYear(),startDay);weekClass=weekPrefix+weekNum;if(r!==0&&hideBlankWeeks===true&&workingDate.getMonth()!=useDate.getMonth()){break;}else{html[html.length]='<tr class="'+weekClass+'">';if(showWeekHeader){html=this.renderRowHeader(weekNum,html);}
for(var d=0;d<7;d++){cellRenderers=[];renderer=null;this.clearElement(cell);cell.className=this.Style.CSS_CELL;cell.id=this.id+cellPrefix+i;if(workingDate.getDate()==todayDate&&workingDate.getMonth()==todayMonth&&workingDate.getFullYear()==todayYear){cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;}
var workingArray=[workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];this.cellDates[this.cellDates.length]=workingArray;if(workingDate.getMonth()!=useDate.getMonth()){cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;}else{$AddClass(cell,workingDayPrefix+workingDate.getDay());$AddClass(cell,dayPrefix+workingDate.getDate());for(var s=0;s<this.renderStack.length;++s){var rArray=this.renderStack[s];var type=rArray[0];var month;var day;var year;switch(type){case YAHOO.widget.Calendar.DATE:month=rArray[1][1];day=rArray[1][2];year=rArray[1][0];if(workingDate.getMonth()+1==month&&workingDate.getDate()==day&&workingDate.getFullYear()==year){renderer=rArray[2];this.renderStack.splice(s,1);}
break;case YAHOO.widget.Calendar.MONTH_DAY:month=rArray[1][0];day=rArray[1][1];if(workingDate.getMonth()+1==month&&workingDate.getDate()==day){renderer=rArray[2];this.renderStack.splice(s,1);}
break;case YAHOO.widget.Calendar.RANGE:var date1=rArray[1][0];var date2=rArray[1][1];var d1month=date1[1];var d1day=date1[2];var d1year=date1[0];var d1=new Date(d1year,d1month-1,d1day);var d2month=date2[1];var d2day=date2[2];var d2year=date2[0];var d2=new Date(d2year,d2month-1,d2day);if(workingDate.getTime()>=d1.getTime()&&workingDate.getTime()<=d2.getTime()){renderer=rArray[2];if(workingDate.getTime()==d2.getTime()){this.renderStack.splice(s,1);}}
break;case YAHOO.widget.Calendar.WEEKDAY:var weekday=rArray[1][0];if(workingDate.getDay()+1==weekday){renderer=rArray[2];}
break;case YAHOO.widget.Calendar.MONTH:month=rArray[1][0];if(workingDate.getMonth()+1==month){renderer=rArray[2];}
break;}
if(renderer){cellRenderers[cellRenderers.length]=renderer;}}}
if(this._indexOfSelectedFieldArray(workingArray)>-1){cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected;}
if((mindate&&(workingDate.getTime()<mindate.getTime()))||(maxdate&&(workingDate.getTime()>maxdate.getTime()))){cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;}else{cellRenderers[cellRenderers.length]=cal.styleCellDefault;cellRenderers[cellRenderers.length]=cal.renderCellDefault;}
for(var x=0;x<cellRenderers.length;++x){if(cellRenderers[x].call(cal,workingDate,cell)==YAHOO.widget.Calendar.STOP_RENDER){break;}}
workingDate.setTime(workingDate.getTime()+YAHOO.widget.DateMath.ONE_DAY_MS);if(i>=0&&i<=6){$AddClass(cell,this.Style.CSS_CELL_TOP);}
if((i%7)===0){$AddClass(cell,this.Style.CSS_CELL_LEFT);}
if(((i+1)%7)===0){$AddClass(cell,this.Style.CSS_CELL_RIGHT);}
var postDays=this.postMonthDays;if(hideBlankWeeks&&postDays>=7){var blankWeeks=Math.floor(postDays/7);for(var p=0;p<blankWeeks;++p){postDays-=7;}}
if(i>=((this.preMonthDays+postDays+this.monthDays)-7)){$AddClass(cell,this.Style.CSS_CELL_BOTTOM);}
html[html.length]=tempDiv.innerHTML;i++;}
if(showWeekFooter){html=this.renderRowFooter(weekNum,html);}
html[html.length]='</tr>';}}
html[html.length]='</tbody>';return html;};YAHOO.widget.Calendar.prototype.renderFooter=function(html){return html;};YAHOO.widget.Calendar.prototype.render=function(){this.beforeRenderEvent.fire();var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;var workingDate=YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty(defCfg.PAGEDATE.key));this.resetRenderers();this.cellDates.length=0;YAHOO.util.Event.purgeElement(this.oDomContainer,true);var html=[];html[html.length]='<table cellSpacing="0" class="'+this.Style.CSS_CALENDAR+' y'+workingDate.getFullYear()+'" id="'+this.id+'">';html=this.renderHeader(html);html=this.renderBody(workingDate,html);html=this.renderFooter(html);html[html.length]='</table>';this.oDomContainer.innerHTML=html.join("\n");this.applyListeners();this.cells=this.oDomContainer.getElementsByTagName("td");this.cfg.refireEvent(defCfg.TITLE.key);this.cfg.refireEvent(defCfg.CLOSE.key);this.cfg.refireEvent(defCfg.IFRAME.key);this.renderEvent.fire();};YAHOO.widget.Calendar.prototype.applyListeners=function(){var root=this.oDomContainer;var cal=this.parent||this;var anchor="a";var mousedown="mousedown";var linkLeft=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT,anchor,root);var linkRight=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT,anchor,root);if(linkLeft&&linkLeft.length>0){this.linkLeft=linkLeft[0];YAHOO.util.Event.addListener(this.linkLeft,mousedown,cal.previousMonth,cal,true);}
if(linkRight&&linkRight.length>0){this.linkRight=linkRight[0];YAHOO.util.Event.addListener(this.linkRight,mousedown,cal.nextMonth,cal,true);}
if(this.domEventMap){var el,elements;for(var cls in this.domEventMap){if(YAHOO.lang.hasOwnProperty(this.domEventMap,cls)){var items=this.domEventMap[cls];if(!(items instanceof Array)){items=[items];}
for(var i=0;i<items.length;i++){var item=items[i];elements=YAHOO.util.Dom.getElementsByClassName(cls,item.tag,this.oDomContainer);for(var c=0;c<elements.length;c++){el=elements[c];YAHOO.util.Event.addListener(el,item.event,item.handler,item.scope,item.correct);}}}}}
YAHOO.util.Event.addListener(this.oDomContainer,"click",this.doSelectCell,this);YAHOO.util.Event.addListener(this.oDomContainer,"mouseover",this.doCellMouseOver,this);YAHOO.util.Event.addListener(this.oDomContainer,"mouseout",this.doCellMouseOut,this);};YAHOO.widget.Calendar.prototype.getDateByCellId=function(id){var date=this.getDateFieldsByCellId(id);return new Date(date[0],date[1]-1,date[2]);};YAHOO.widget.Calendar.prototype.getDateFieldsByCellId=function(id){id=id.toLowerCase().split("_cell")[1];id=parseInt(id,10);return this.cellDates[id];};YAHOO.widget.Calendar.prototype.renderOutOfBoundsDate=function(workingDate,cell){$AddClass(cell,this.Style.CSS_CELL_OOB);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar.STOP_RENDER;};YAHOO.widget.Calendar.prototype.renderRowHeader=function(weekNum,html){html[html.length]='<th class="calrowhead">'+weekNum+'</th>';return html;};YAHOO.widget.Calendar.prototype.renderRowFooter=function(weekNum,html){html[html.length]='<th class="calrowfoot">'+weekNum+'</th>';return html;};YAHOO.widget.Calendar.prototype.renderCellDefault=function(workingDate,cell){cell.innerHTML='<a href="#" class="'+this.Style.CSS_CELL_SELECTOR+'">'+this.buildDayLabel(workingDate)+"</a>";};YAHOO.widget.Calendar.prototype.styleCellDefault=function(workingDate,cell){$AddClass(cell,this.Style.CSS_CELL_SELECTABLE);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight1=function(workingDate,cell){$AddClass(cell,this.Style.CSS_CELL_HIGHLIGHT1);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight2=function(workingDate,cell){$AddClass(cell,this.Style.CSS_CELL_HIGHLIGHT2);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight3=function(workingDate,cell){$AddClass(cell,this.Style.CSS_CELL_HIGHLIGHT3);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight4=function(workingDate,cell){$AddClass(cell,this.Style.CSS_CELL_HIGHLIGHT4);};YAHOO.widget.Calendar.prototype.renderCellStyleToday=function(workingDate,cell){$AddClass(cell,this.Style.CSS_CELL_TODAY);};YAHOO.widget.Calendar.prototype.renderCellStyleSelected=function(workingDate,cell){$AddClass(cell,this.Style.CSS_CELL_SELECTED);};YAHOO.widget.Calendar.prototype.renderCellNotThisMonth=function(workingDate,cell){$AddClass(cell,this.Style.CSS_CELL_OOM);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar.STOP_RENDER;};YAHOO.widget.Calendar.prototype.renderBodyCellRestricted=function(workingDate,cell){$AddClass(cell,this.Style.CSS_CELL);$AddClass(cell,this.Style.CSS_CELL_RESTRICTED);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar.STOP_RENDER;};YAHOO.widget.Calendar.prototype.addMonths=function(count){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;this.cfg.setProperty(cfgPageDate,YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate),YAHOO.widget.DateMath.MONTH,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.subtractMonths=function(count){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;this.cfg.setProperty(cfgPageDate,YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate),YAHOO.widget.DateMath.MONTH,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.addYears=function(count){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;this.cfg.setProperty(cfgPageDate,YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate),YAHOO.widget.DateMath.YEAR,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.subtractYears=function(count){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;this.cfg.setProperty(cfgPageDate,YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate),YAHOO.widget.DateMath.YEAR,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.nextMonth=function(){this.addMonths(1);};YAHOO.widget.Calendar.prototype.previousMonth=function(){this.subtractMonths(1);};YAHOO.widget.Calendar.prototype.nextYear=function(){this.addYears(1);};YAHOO.widget.Calendar.prototype.previousYear=function(){this.subtractYears(1);};YAHOO.widget.Calendar.prototype.reset=function(){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;this.cfg.resetProperty(defCfg.SELECTED.key);this.cfg.resetProperty(defCfg.PAGEDATE.key);this.resetEvent.fire();};YAHOO.widget.Calendar.prototype.clear=function(){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;this.cfg.setProperty(defCfg.SELECTED.key,[]);this.cfg.setProperty(defCfg.PAGEDATE.key,new Date(this.today.getTime()));this.clearEvent.fire();};YAHOO.widget.Calendar.prototype.select=function(date){var aToBeSelected=this._toFieldArray(date);var validDates=[];var selected=[];var cfgSelected=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;for(var a=0;a<aToBeSelected.length;++a){var toSelect=aToBeSelected[a];if(!this.isDateOOB(this._toDate(toSelect))){if(validDates.length===0){this.beforeSelectEvent.fire();selected=this.cfg.getProperty(cfgSelected);}
validDates.push(toSelect);if(this._indexOfSelectedFieldArray(toSelect)==-1){selected[selected.length]=toSelect;}}}
if(validDates.length>0){if(this.parent){this.parent.cfg.setProperty(cfgSelected,selected);}else{this.cfg.setProperty(cfgSelected,selected);}
this.selectEvent.fire(validDates);}
return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.selectCell=function(cellIndex){var cell=this.cells[cellIndex];var cellDate=this.cellDates[cellIndex];var dCellDate=this._toDate(cellDate);var selectable=$HasClass(cell,this.Style.CSS_CELL_SELECTABLE);if(selectable){this.beforeSelectEvent.fire();var cfgSelected=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;var selected=this.cfg.getProperty(cfgSelected);var selectDate=cellDate.concat();if(this._indexOfSelectedFieldArray(selectDate)==-1){selected[selected.length]=selectDate;}
if(this.parent){this.parent.cfg.setProperty(cfgSelected,selected);}else{this.cfg.setProperty(cfgSelected,selected);}
this.renderCellStyleSelected(dCellDate,cell);this.selectEvent.fire([selectDate]);this.doCellMouseOut.call(cell,null,this);}
return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselect=function(date){var aToBeDeselected=this._toFieldArray(date);var validDates=[];var selected=[];var cfgSelected=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;for(var a=0;a<aToBeDeselected.length;++a){var toDeselect=aToBeDeselected[a];if(!this.isDateOOB(this._toDate(toDeselect))){if(validDates.length===0){this.beforeDeselectEvent.fire();selected=this.cfg.getProperty(cfgSelected);}
validDates.push(toDeselect);var index=this._indexOfSelectedFieldArray(toDeselect);if(index!=-1){selected.splice(index,1);}}}
if(validDates.length>0){if(this.parent){this.parent.cfg.setProperty(cfgSelected,selected);}else{this.cfg.setProperty(cfgSelected,selected);}
this.deselectEvent.fire(validDates);}
return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselectCell=function(cellIndex){var cell=this.cells[cellIndex];var cellDate=this.cellDates[cellIndex];var cellDateIndex=this._indexOfSelectedFieldArray(cellDate);var selectable=$HasClass(cell,this.Style.CSS_CELL_SELECTABLE);if(selectable){this.beforeDeselectEvent.fire();var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;var selected=this.cfg.getProperty(defCfg.SELECTED.key);var dCellDate=this._toDate(cellDate);var selectDate=cellDate.concat();if(cellDateIndex>-1){if(this.cfg.getProperty(defCfg.PAGEDATE.key).getMonth()==dCellDate.getMonth()&&this.cfg.getProperty(defCfg.PAGEDATE.key).getFullYear()==dCellDate.getFullYear()){$RemoveClass(cell,this.Style.CSS_CELL_SELECTED);}
selected.splice(cellDateIndex,1);}
if(this.parent){this.parent.cfg.setProperty(defCfg.SELECTED.key,selected);}else{this.cfg.setProperty(defCfg.SELECTED.key,selected);}
this.deselectEvent.fire(selectDate);}
return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselectAll=function(){this.beforeDeselectEvent.fire();var cfgSelected=YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;var selected=this.cfg.getProperty(cfgSelected);var count=selected.length;var sel=selected.concat();if(this.parent){this.parent.cfg.setProperty(cfgSelected,[]);}else{this.cfg.setProperty(cfgSelected,[]);}
if(count>0){this.deselectEvent.fire(sel);}
return this.getSelectedDates();};YAHOO.widget.Calendar.prototype._toFieldArray=function(date){var returnDate=[];if(date instanceof Date){returnDate=[[date.getFullYear(),date.getMonth()+1,date.getDate()]];}else if(YAHOO.lang.isString(date)){returnDate=this._parseDates(date);}else if(YAHOO.lang.isArray(date)){for(var i=0;i<date.length;++i){var d=date[i];returnDate[returnDate.length]=[d.getFullYear(),d.getMonth()+1,d.getDate()];}}
return returnDate;};YAHOO.widget.Calendar.prototype._toDate=function(dateFieldArray){if(dateFieldArray instanceof Date){return dateFieldArray;}else{return new Date(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);}};YAHOO.widget.Calendar.prototype._fieldArraysAreEqual=function(array1,array2){var match=false;if(array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]){match=true;}
return match;};YAHOO.widget.Calendar.prototype._indexOfSelectedFieldArray=function(find){var selected=-1;var seldates=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);for(var s=0;s<seldates.length;++s){var sArray=seldates[s];if(find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]){selected=s;break;}}
return selected;};YAHOO.widget.Calendar.prototype.isDateOOM=function(date){return(date.getMonth()!=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key).getMonth());};YAHOO.widget.Calendar.prototype.isDateOOB=function(date){var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;var minDate=this.cfg.getProperty(defCfg.MINDATE.key);var maxDate=this.cfg.getProperty(defCfg.MAXDATE.key);var dm=YAHOO.widget.DateMath;if(minDate){minDate=dm.clearTime(minDate);}
if(maxDate){maxDate=dm.clearTime(maxDate);}
var clearedDate=new Date(date.getTime());clearedDate=dm.clearTime(clearedDate);return((minDate&&clearedDate.getTime()<minDate.getTime())||(maxDate&&clearedDate.getTime()>maxDate.getTime()));};YAHOO.widget.Calendar.prototype._parsePageDate=function(date){var parsedDate;var defCfg=YAHOO.widget.Calendar._DEFAULT_CONFIG;if(date){if(date instanceof Date){parsedDate=YAHOO.widget.DateMath.findMonthStart(date);}else{var month,year,aMonthYear;aMonthYear=date.split(this.cfg.getProperty(defCfg.DATE_FIELD_DELIMITER.key));month=parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_MONTH_POSITION.key)-1],10)-1;year=parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_YEAR_POSITION.key)-1],10);parsedDate=new Date(year,month,1);}}else{parsedDate=new Date(this.today.getFullYear(),this.today.getMonth(),1);}
return parsedDate;};YAHOO.widget.Calendar.prototype.onBeforeSelect=function(){if(this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MULTI_SELECT.key)===false){if(this.parent){this.parent.callChildFunction("clearAllBodyCellStyles",this.Style.CSS_CELL_SELECTED);this.parent.deselectAll();}else{this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);this.deselectAll();}}};YAHOO.widget.Calendar.prototype.onSelect=function(selected){};YAHOO.widget.Calendar.prototype.onBeforeDeselect=function(){};YAHOO.widget.Calendar.prototype.onDeselect=function(deselected){};YAHOO.widget.Calendar.prototype.onChangePage=function(){this.render();};YAHOO.widget.Calendar.prototype.onRender=function(){};YAHOO.widget.Calendar.prototype.onReset=function(){this.render();};YAHOO.widget.Calendar.prototype.onClear=function(){this.render();};YAHOO.widget.Calendar.prototype.validate=function(){return true;};YAHOO.widget.Calendar.prototype._parseDate=function(sDate){var aDate=sDate.split(this.Locale.DATE_FIELD_DELIMITER);var rArray;if(aDate.length==2){rArray=[aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];rArray.type=YAHOO.widget.Calendar.MONTH_DAY;}else{rArray=[aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];rArray.type=YAHOO.widget.Calendar.DATE;}
for(var i=0;i<rArray.length;i++){rArray[i]=parseInt(rArray[i],10);}
return rArray;};YAHOO.widget.Calendar.prototype._parseDates=function(sDates){var aReturn=[];var aDates=sDates.split(this.Locale.DATE_DELIMITER);for(var d=0;d<aDates.length;++d){var sDate=aDates[d];if(sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER)!=-1){var aRange=sDate.split(this.Locale.DATE_RANGE_DELIMITER);var dateStart=this._parseDate(aRange[0]);var dateEnd=this._parseDate(aRange[1]);var fullRange=this._parseRange(dateStart,dateEnd);aReturn=aReturn.concat(fullRange);}else{var aDate=this._parseDate(sDate);aReturn.push(aDate);}}
return aReturn;};YAHOO.widget.Calendar.prototype._parseRange=function(startDate,endDate){var dStart=new Date(startDate[0],startDate[1]-1,startDate[2]);var dCurrent=YAHOO.widget.DateMath.add(new Date(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);var dEnd=new Date(endDate[0],endDate[1]-1,endDate[2]);var results=[];results.push(startDate);while(dCurrent.getTime()<=dEnd.getTime()){results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);dCurrent=YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);}
return results;};YAHOO.widget.Calendar.prototype.resetRenderers=function(){this.renderStack=this._renderStack.concat();};YAHOO.widget.Calendar.prototype.clearElement=function(cell){cell.innerHTML="&#160;";cell.className="";};YAHOO.widget.Calendar.prototype.addRenderer=function(sDates,fnRender){var aDates=this._parseDates(sDates);for(var i=0;i<aDates.length;++i){var aDate=aDates[i];if(aDate.length==2){if(aDate[0]instanceof Array){this._addRenderer(YAHOO.widget.Calendar.RANGE,aDate,fnRender);}else{this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,aDate,fnRender);}}else if(aDate.length==3){this._addRenderer(YAHOO.widget.Calendar.DATE,aDate,fnRender);}}};YAHOO.widget.Calendar.prototype._addRenderer=function(type,aDates,fnRender){var add=[type,aDates,fnRender];this.renderStack.unshift(add);this._renderStack=this.renderStack.concat();};YAHOO.widget.Calendar.prototype.addMonthRenderer=function(month,fnRender){this._addRenderer(YAHOO.widget.Calendar.MONTH,[month],fnRender);};YAHOO.widget.Calendar.prototype.addWeekdayRenderer=function(weekday,fnRender){this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[weekday],fnRender);};YAHOO.widget.Calendar.prototype.clearAllBodyCellStyles=function(style){for(var c=0;c<this.cells.length;++c){$RemoveClass(this.cells[c],style);}};YAHOO.widget.Calendar.prototype.setMonth=function(month){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;var current=this.cfg.getProperty(cfgPageDate);current.setMonth(parseInt(month,10));this.cfg.setProperty(cfgPageDate,current);};YAHOO.widget.Calendar.prototype.setYear=function(year){var cfgPageDate=YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;var current=this.cfg.getProperty(cfgPageDate);current.setFullYear(parseInt(year,10));this.cfg.setProperty(cfgPageDate,current);};YAHOO.widget.Calendar.prototype.getSelectedDates=function(){var returnDates=[];var selected=this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);for(var d=0;d<selected.length;++d){var dateArray=selected[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}
returnDates.sort(function(a,b){return a-b;});return returnDates;};YAHOO.widget.Calendar.prototype.hide=function(){$SetStyle(this.oDomContainer,"display","none");};YAHOO.widget.Calendar.prototype.show=function(){$SetStyle(this.oDomContainer,"display","block");};YAHOO.widget.Calendar.prototype.browser=function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}();YAHOO.widget.Calendar.prototype.toString=function(){return"Calendar "+this.id;};YAHOO.widget.Calendar_Core=YAHOO.widget.Calendar;YAHOO.widget.Cal_Core=YAHOO.widget.Calendar;YAHOO.widget.CalendarGroup=function(id,containerId,config){if(arguments.length>0){this.init(id,containerId,config);}};YAHOO.widget.CalendarGroup.prototype.init=function(id,containerId,config){this.initEvents();this.initStyles();this.pages=[];this.id=id;this.containerId=containerId;this.oDomContainer=$(containerId);$AddClass(this.oDomContainer,YAHOO.widget.CalendarGroup.CSS_CONTAINER);$AddClass(this.oDomContainer,YAHOO.widget.CalendarGroup.CSS_MULTI_UP);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};this.setupConfig();if(config){this.cfg.applyConfig(config,true);}
this.cfg.fireQueue();if(YAHOO.env.ua.opera){this.renderEvent.subscribe(this._fixWidth,this,true);}};YAHOO.widget.CalendarGroup.prototype.setupConfig=function(){var defCfg=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG;this.cfg.addProperty(defCfg.PAGES.key,{value:defCfg.PAGES.value,validator:this.cfg.checkNumber,handler:this.configPages});this.cfg.addProperty(defCfg.PAGEDATE.key,{value:new Date(),handler:this.configPageDate});this.cfg.addProperty(defCfg.SELECTED.key,{value:[],handler:this.configSelected});this.cfg.addProperty(defCfg.TITLE.key,{value:defCfg.TITLE.value,handler:this.configTitle});this.cfg.addProperty(defCfg.CLOSE.key,{value:defCfg.CLOSE.value,handler:this.configClose});this.cfg.addProperty(defCfg.IFRAME.key,{value:defCfg.IFRAME.value,handler:this.configIframe,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.MINDATE.key,{value:defCfg.MINDATE.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MAXDATE.key,{value:defCfg.MAXDATE.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MULTI_SELECT.key,{value:defCfg.MULTI_SELECT.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.START_WEEKDAY.key,{value:defCfg.START_WEEKDAY.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,{value:defCfg.SHOW_WEEKDAYS.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key,{value:defCfg.SHOW_WEEK_HEADER.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{value:defCfg.SHOW_WEEK_FOOTER.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key,{value:defCfg.HIDE_BLANK_WEEKS.value,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key,{value:defCfg.NAV_ARROW_LEFT.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key,{value:defCfg.NAV_ARROW_RIGHT.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MONTHS_SHORT.key,{value:defCfg.MONTHS_SHORT.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MONTHS_LONG.key,{value:defCfg.MONTHS_LONG.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key,{value:defCfg.WEEKDAYS_1CHAR.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key,{value:defCfg.WEEKDAYS_SHORT.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,{value:defCfg.WEEKDAYS_MEDIUM.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,{value:defCfg.WEEKDAYS_LONG.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,{value:defCfg.LOCALE_MONTHS.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,{value:defCfg.LOCALE_WEEKDAYS.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.DATE_DELIMITER.key,{value:defCfg.DATE_DELIMITER.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key,{value:defCfg.DATE_FIELD_DELIMITER.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key,{value:defCfg.DATE_RANGE_DELIMITER.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,{value:defCfg.MY_MONTH_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,{value:defCfg.MY_YEAR_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,{value:defCfg.MD_MONTH_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,{value:defCfg.MD_DAY_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,{value:defCfg.MDY_MONTH_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,{value:defCfg.MDY_DAY_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,{value:defCfg.MDY_YEAR_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,{value:defCfg.MY_LABEL_MONTH_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key,{value:defCfg.MY_LABEL_YEAR_POSITION.value,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,{value:defCfg.MY_LABEL_MONTH_SUFFIX.value,handler:this.delegateConfig});this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key,{value:defCfg.MY_LABEL_YEAR_SUFFIX.value,handler:this.delegateConfig});};YAHOO.widget.CalendarGroup.prototype.initEvents=function(){var me=this;var strEvent="Event";var sub=function(fn,obj,bOverride){for(var p=0;p<me.pages.length;++p){var cal=me.pages[p];cal[this.type+strEvent].subscribe(fn,obj,bOverride);}};var unsub=function(fn,obj){for(var p=0;p<me.pages.length;++p){var cal=me.pages[p];cal[this.type+strEvent].unsubscribe(fn,obj);}};var defEvents=YAHOO.widget.Calendar._EVENT_TYPES;this.beforeSelectEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT);this.beforeSelectEvent.subscribe=sub;this.beforeSelectEvent.unsubscribe=unsub;this.selectEvent=new YAHOO.util.CustomEvent(defEvents.SELECT);this.selectEvent.subscribe=sub;this.selectEvent.unsubscribe=unsub;this.beforeDeselectEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT);this.beforeDeselectEvent.subscribe=sub;this.beforeDeselectEvent.unsubscribe=unsub;this.deselectEvent=new YAHOO.util.CustomEvent(defEvents.DESELECT);this.deselectEvent.subscribe=sub;this.deselectEvent.unsubscribe=unsub;this.changePageEvent=new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE);this.changePageEvent.subscribe=sub;this.changePageEvent.unsubscribe=unsub;this.beforeRenderEvent=new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);this.beforeRenderEvent.subscribe=sub;this.beforeRenderEvent.unsubscribe=unsub;this.renderEvent=new YAHOO.util.CustomEvent(defEvents.RENDER);this.renderEvent.subscribe=sub;this.renderEvent.unsubscribe=unsub;this.resetEvent=new YAHOO.util.CustomEvent(defEvents.RESET);this.resetEvent.subscribe=sub;this.resetEvent.unsubscribe=unsub;this.clearEvent=new YAHOO.util.CustomEvent(defEvents.CLEAR);this.clearEvent.subscribe=sub;this.clearEvent.unsubscribe=unsub;};YAHOO.widget.CalendarGroup.prototype.configPages=function(type,args,obj){var pageCount=args[0];var cfgPageDate=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;var sep="_";var groupCalClass="groupcal";var firstClass="first-of-type";var lastClass="last-of-type";for(var p=0;p<pageCount;++p){var calId=this.id+sep+p;var calContainerId=this.containerId+sep+p;var childConfig=this.cfg.getConfig();childConfig.close=false;childConfig.title=false;var cal=this.constructChild(calId,calContainerId,childConfig);var caldate=cal.cfg.getProperty(cfgPageDate);this._setMonthOnDate(caldate,caldate.getMonth()+p);cal.cfg.setProperty(cfgPageDate,caldate);$RemoveClass(cal.oDomContainer,this.Style.CSS_SINGLE);$AddClass(cal.oDomContainer,groupCalClass);if(p===0){$AddClass(cal.oDomContainer,firstClass);}
if(p==(pageCount-1)){$AddClass(cal.oDomContainer,lastClass);}
cal.parent=this;cal.index=p;this.pages[this.pages.length]=cal;}};YAHOO.widget.CalendarGroup.prototype.configPageDate=function(type,args,obj){var val=args[0];var firstPageDate;var cfgPageDate=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];if(p===0){firstPageDate=cal._parsePageDate(val);cal.cfg.setProperty(cfgPageDate,firstPageDate);}else{var pageDate=new Date(firstPageDate);this._setMonthOnDate(pageDate,pageDate.getMonth()+p);cal.cfg.setProperty(cfgPageDate,pageDate);}}};YAHOO.widget.CalendarGroup.prototype.configSelected=function(type,args,obj){var cfgSelected=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key;this.delegateConfig(type,args,obj);var selected=(this.pages.length>0)?this.pages[0].cfg.getProperty(cfgSelected):[];this.cfg.setProperty(cfgSelected,selected,true);};YAHOO.widget.CalendarGroup.prototype.delegateConfig=function(type,args,obj){var val=args[0];var cal;for(var p=0;p<this.pages.length;p++){cal=this.pages[p];cal.cfg.setProperty(type,val);}};YAHOO.widget.CalendarGroup.prototype.setChildFunction=function(fnName,fn){var pageCount=this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);for(var p=0;p<pageCount;++p){this.pages[p][fnName]=fn;}};YAHOO.widget.CalendarGroup.prototype.callChildFunction=function(fnName,args){var pageCount=this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);for(var p=0;p<pageCount;++p){var page=this.pages[p];if(page[fnName]){var fn=page[fnName];fn.call(page,args);}}};YAHOO.widget.CalendarGroup.prototype.constructChild=function(id,containerId,config){var container=$(containerId);if(!container){container=document.createElement("div");container.id=containerId;this.oDomContainer.appendChild(container);}
return new YAHOO.widget.Calendar(id,containerId,config);};YAHOO.widget.CalendarGroup.prototype.setMonth=function(month){month=parseInt(month,10);var currYear;var cfgPageDate=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];var pageDate=cal.cfg.getProperty(cfgPageDate);if(p===0){currYear=pageDate.getFullYear();}else{pageDate.setYear(currYear);}
this._setMonthOnDate(pageDate,month+p);cal.cfg.setProperty(cfgPageDate,pageDate);}};YAHOO.widget.CalendarGroup.prototype.setYear=function(year){var cfgPageDate=YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;year=parseInt(year,10);for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];var pageDate=cal.cfg.getProperty(cfgPageDate);if((pageDate.getMonth()+1)==1&&p>0){year+=1;}
cal.setYear(year);}};YAHOO.widget.CalendarGroup.prototype.render=function(){this.renderHeader();for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.render();}
this.renderFooter();};YAHOO.widget.CalendarGroup.prototype.select=function(date){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.select(date);}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.selectCell=function(cellIndex){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.selectCell(cellIndex);}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.deselect=function(date){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.deselect(date);}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.deselectAll=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.deselectAll();}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.deselectCell=function(cellIndex){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.deselectCell(cellIndex);}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.reset=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.reset();}};YAHOO.widget.CalendarGroup.prototype.clear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.clear();}};YAHOO.widget.CalendarGroup.prototype.nextMonth=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.nextMonth();}};YAHOO.widget.CalendarGroup.prototype.previousMonth=function(){for(var p=this.pages.length-1;p>=0;--p){var cal=this.pages[p];cal.previousMonth();}};YAHOO.widget.CalendarGroup.prototype.nextYear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.nextYear();}};YAHOO.widget.CalendarGroup.prototype.previousYear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.previousYear();}};YAHOO.widget.CalendarGroup.prototype.getSelectedDates=function(){var returnDates=[];var selected=this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key);for(var d=0;d<selected.length;++d){var dateArray=selected[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}
returnDates.sort(function(a,b){return a-b;});return returnDates;};YAHOO.widget.CalendarGroup.prototype.addRenderer=function(sDates,fnRender){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.addRenderer(sDates,fnRender);}};YAHOO.widget.CalendarGroup.prototype.addMonthRenderer=function(month,fnRender){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.addMonthRenderer(month,fnRender);}};YAHOO.widget.CalendarGroup.prototype.addWeekdayRenderer=function(weekday,fnRender){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.addWeekdayRenderer(weekday,fnRender);}};YAHOO.widget.CalendarGroup.prototype.renderHeader=function(){};YAHOO.widget.CalendarGroup.prototype.renderFooter=function(){};YAHOO.widget.CalendarGroup.prototype.addMonths=function(count){this.callChildFunction("addMonths",count);};YAHOO.widget.CalendarGroup.prototype.subtractMonths=function(count){this.callChildFunction("subtractMonths",count);};YAHOO.widget.CalendarGroup.prototype.addYears=function(count){this.callChildFunction("addYears",count);};YAHOO.widget.CalendarGroup.prototype.subtractYears=function(count){this.callChildFunction("subtractYears",count);};YAHOO.widget.CalendarGroup.prototype.show=function(){$SetStyle(this.oDomContainer,"display","block");if(YAHOO.env.ua.opera){this._fixWidth();}};YAHOO.widget.CalendarGroup.prototype._setMonthOnDate=function(date,iMonth){if(YAHOO.env.ua.webkit&&YAHOO.env.ua.webkit<420&&(iMonth<0||iMonth>11)){var DM=YAHOO.widget.DateMath;var newDate=DM.add(date,DM.MONTH,iMonth-date.getMonth());date.setTime(newDate.getTime());}else{date.setMonth(iMonth);}};YAHOO.widget.CalendarGroup.prototype._fixWidth=function(){var startW=this.oDomContainer.offsetWidth;var w=0;for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];w+=cal.oDomContainer.offsetWidth;}
if(w>0){$SetStyle(this.oDomContainer,"width",w+"px");}};YAHOO.widget.CalendarGroup.CSS_CONTAINER="yui-calcontainer";YAHOO.widget.CalendarGroup.CSS_MULTI_UP="multi";YAHOO.widget.CalendarGroup.CSS_2UPTITLE="title";YAHOO.widget.CalendarGroup.CSS_2UPCLOSE="close-icon";YAHOO.lang.augmentProto(YAHOO.widget.CalendarGroup,YAHOO.widget.Calendar,"buildDayLabel","buildMonthLabel","renderOutOfBoundsDate","renderRowHeader","renderRowFooter","renderCellDefault","styleCellDefault","renderCellStyleHighlight1","renderCellStyleHighlight2","renderCellStyleHighlight3","renderCellStyleHighlight4","renderCellStyleToday","renderCellStyleSelected","renderCellNotThisMonth","renderBodyCellRestricted","initStyles","configTitle","configClose","configIframe","hide","browser");YAHOO.widget.CalendarGroup._DEFAULT_CONFIG=YAHOO.widget.Calendar._DEFAULT_CONFIG;YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES={key:"pages",value:2};YAHOO.widget.CalendarGroup.prototype.toString=function(){return"CalendarGroup "+this.id;};YAHOO.widget.CalGrp=YAHOO.widget.CalendarGroup;YAHOO.widget.Calendar2up=function(id,containerId,config){this.init(id,containerId,config);};YAHOO.extend(YAHOO.widget.Calendar2up,YAHOO.widget.CalendarGroup);YAHOO.widget.Cal2up=YAHOO.widget.Calendar2up;YAHOO.register("calendar",YAHOO.widget.Calendar,{version:"2.3.0",build:"442"});(function(){YAHOO.util.Config=function(owner){if(owner){this.init(owner);}
if(!owner){}};var Lang=YAHOO.lang,CustomEvent=YAHOO.util.CustomEvent,Config=YAHOO.util.Config;Config.CONFIG_CHANGED_EVENT="configChanged";Config.BOOLEAN_TYPE="boolean";Config.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(owner){this.owner=owner;this.configChangedEvent=this.createEvent(Config.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=CustomEvent.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(val){return(typeof val==Config.BOOLEAN_TYPE);},checkNumber:function(val){return(!isNaN(val));},fireEvent:function(key,value){var property=this.config[key];if(property&&property.event){property.event.fire(value);}},addProperty:function(key,propertyObject){key=key.toLowerCase();this.config[key]=propertyObject;propertyObject.event=this.createEvent(key,{scope:this.owner});propertyObject.event.signature=CustomEvent.LIST;propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner);}
this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}},getConfig:function(){var cfg={},prop,property;for(prop in this.config){property=this.config[prop];if(property&&property.event){cfg[prop]=property.value;}}
return cfg;},getProperty:function(key){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.value;}else{return undefined;}},resetProperty:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event){if(this.initialConfig[key]&&!Lang.isUndefined(this.initialConfig[key])){this.setProperty(key,this.initialConfig[key]);return true;}}else{return false;}},setProperty:function(key,value,silent){var property;key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{property=this.config[key];if(property&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){this.fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
return true;}}else{return false;}}},queueProperty:function(key,value){key=key.toLowerCase();var property=this.config[key],foundDuplicate=false,iLen,queueItem,queueItemKey,queueItemValue,sLen,supercedesCheck,qLen,queueItemCheck,queueItemCheckKey,queueItemCheckValue,i,s,q;if(property&&property.event){if(!Lang.isUndefined(value)&&property.validator&&!property.validator(value)){return false;}else{if(!Lang.isUndefined(value)){property.value=value;}else{value=property.value;}
foundDuplicate=false;iLen=this.eventQueue.length;for(i=0;i<iLen;i++){queueItem=this.eventQueue[i];if(queueItem){queueItemKey=queueItem[0];queueItemValue=queueItem[1];if(queueItemKey==key){this.eventQueue[i]=null;this.eventQueue.push([key,(!Lang.isUndefined(value)?value:queueItemValue)]);foundDuplicate=true;break;}}}
if(!foundDuplicate&&!Lang.isUndefined(value)){this.eventQueue.push([key,value]);}}
if(property.supercedes){sLen=property.supercedes.length;for(s=0;s<sLen;s++){supercedesCheck=property.supercedes[s];qLen=this.eventQueue.length;for(q=0;q<qLen;q++){queueItemCheck=this.eventQueue[q];if(queueItemCheck){queueItemCheckKey=queueItemCheck[0];queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey==supercedesCheck.toLowerCase()){this.eventQueue.push([queueItemCheckKey,queueItemCheckValue]);this.eventQueue[q]=null;break;}}}}}
return true;}else{return false;}},refireEvent:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event&&!Lang.isUndefined(property.value)){if(this.queueInProgress){this.queueProperty(key);}else{this.fireEvent(key,property.value);}}},applyConfig:function(userConfig,init){var sKey,oValue,oConfig;if(init){oConfig={};for(sKey in userConfig){if(Lang.hasOwnProperty(userConfig,sKey)){oConfig[sKey.toLowerCase()]=userConfig[sKey];}}
this.initialConfig=oConfig;}
for(sKey in userConfig){if(Lang.hasOwnProperty(userConfig,sKey)){this.queueProperty(sKey,userConfig[sKey]);}}},refresh:function(){var prop;for(prop in this.config){this.refireEvent(prop);}},fireQueue:function(){var i,queueItem,key,value,property;this.queueInProgress=true;for(i=0;i<this.eventQueue.length;i++){queueItem=this.eventQueue[i];if(queueItem){key=queueItem[0];value=queueItem[1];property=this.config[key];property.value=value;this.fireEvent(key,value);}}
this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(key,handler,obj,override){var property=this.config[key.toLowerCase()];if(property&&property.event){if(!Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
return true;}else{return false;}},unsubscribeFromConfigEvent:function(key,handler,obj){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}},toString:function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
return output;},outputEventQueue:function(){var output="",queueItem,q,nQueue=this.eventQueue.length;for(q=0;q<nQueue;q++){queueItem=this.eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
return output;},destroy:function(){var oConfig=this.config,sProperty,oProperty;for(sProperty in oConfig){if(Lang.hasOwnProperty(oConfig,sProperty)){oProperty=oConfig[sProperty];oProperty.event.unsubscribeAll();oProperty.event=null;}}
this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};Config.alreadySubscribed=function(evt,fn,obj){var nSubscribers=evt.subscribers.length,subsc,i;if(nSubscribers>0){i=nSubscribers-1;do{subsc=evt.subscribers[i];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}
while(i--);}
return false;};YAHOO.lang.augmentProto(Config,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}else{}};var Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,Event=YAHOO.util.Event,CustomEvent=YAHOO.util.CustomEvent,Module=YAHOO.widget.Module,m_oModuleTemplate,m_oHeaderTemplate,m_oBodyTemplate,m_oFooterTemplate,EVENT_TYPES={"BEFORE_INIT":"beforeInit","INIT":"init","APPEND":"append","BEFORE_RENDER":"beforeRender","RENDER":"render","CHANGE_HEADER":"changeHeader","CHANGE_BODY":"changeBody","CHANGE_FOOTER":"changeFooter","CHANGE_CONTENT":"changeContent","DESTORY":"destroy","BEFORE_SHOW":"beforeShow","SHOW":"show","BEFORE_HIDE":"beforeHide","HIDE":"hide"},DEFAULT_CONFIG={"VISIBLE":{key:"visible",value:true,validator:YAHOO.lang.isBoolean},"EFFECT":{key:"effect",suppressEvent:true,supercedes:["visible"]},"MONITOR_RESIZE":{key:"monitorresize",value:true}};Module.IMG_ROOT=null;Module.IMG_ROOT_SSL=null;Module.CSS_MODULE="yui-module";Module.CSS_HEADER="hd";Module.CSS_BODY="bd";Module.CSS_FOOTER="ft";Module.RESIZE_MONITOR_SECURE_URL="javascript:false;";Module.textResizeEvent=new CustomEvent("textResize");function createModuleTemplate(){if(!m_oModuleTemplate){m_oModuleTemplate=document.createElement("div");m_oModuleTemplate.innerHTML=("<div class=\""+
Module.CSS_HEADER+"\"></div>"+"<div class=\""+
Module.CSS_BODY+"\"></div><div class=\""+
Module.CSS_FOOTER+"\"></div>");m_oHeaderTemplate=m_oModuleTemplate.firstChild;m_oBodyTemplate=m_oHeaderTemplate.nextSibling;m_oFooterTemplate=m_oBodyTemplate.nextSibling;}
return m_oModuleTemplate;}
function createHeader(){if(!m_oHeaderTemplate){createModuleTemplate();}
return(m_oHeaderTemplate.cloneNode(false));}
function createBody(){if(!m_oBodyTemplate){createModuleTemplate();}
return(m_oBodyTemplate.cloneNode(false));}
function createFooter(){if(!m_oFooterTemplate){createModuleTemplate();}
return(m_oFooterTemplate.cloneNode(false));}
Module.prototype={constructor:Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:Module.IMG_ROOT,initEvents:function(){var SIGNATURE=CustomEvent.LIST;this.beforeInitEvent=this.createEvent(EVENT_TYPES.BEFORE_INIT);this.beforeInitEvent.signature=SIGNATURE;this.initEvent=this.createEvent(EVENT_TYPES.INIT);this.initEvent.signature=SIGNATURE;this.appendEvent=this.createEvent(EVENT_TYPES.APPEND);this.appendEvent.signature=SIGNATURE;this.beforeRenderEvent=this.createEvent(EVENT_TYPES.BEFORE_RENDER);this.beforeRenderEvent.signature=SIGNATURE;this.renderEvent=this.createEvent(EVENT_TYPES.RENDER);this.renderEvent.signature=SIGNATURE;this.changeHeaderEvent=this.createEvent(EVENT_TYPES.CHANGE_HEADER);this.changeHeaderEvent.signature=SIGNATURE;this.changeBodyEvent=this.createEvent(EVENT_TYPES.CHANGE_BODY);this.changeBodyEvent.signature=SIGNATURE;this.changeFooterEvent=this.createEvent(EVENT_TYPES.CHANGE_FOOTER);this.changeFooterEvent.signature=SIGNATURE;this.changeContentEvent=this.createEvent(EVENT_TYPES.CHANGE_CONTENT);this.changeContentEvent.signature=SIGNATURE;this.destroyEvent=this.createEvent(EVENT_TYPES.DESTORY);this.destroyEvent.signature=SIGNATURE;this.beforeShowEvent=this.createEvent(EVENT_TYPES.BEFORE_SHOW);this.beforeShowEvent.signature=SIGNATURE;this.showEvent=this.createEvent(EVENT_TYPES.SHOW);this.showEvent.signature=SIGNATURE;this.beforeHideEvent=this.createEvent(EVENT_TYPES.BEFORE_HIDE);this.beforeHideEvent.signature=SIGNATURE;this.hideEvent=this.createEvent(EVENT_TYPES.HIDE);this.hideEvent.signature=SIGNATURE;},platform:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1){return"windows";}else if(ua.indexOf("macintosh")!=-1){return"mac";}else{return false;}}(),browser:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty(DEFAULT_CONFIG.VISIBLE.key,{handler:this.configVisible,value:DEFAULT_CONFIG.VISIBLE.value,validator:DEFAULT_CONFIG.VISIBLE.validator});this.cfg.addProperty(DEFAULT_CONFIG.EFFECT.key,{suppressEvent:DEFAULT_CONFIG.EFFECT.suppressEvent,supercedes:DEFAULT_CONFIG.EFFECT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.MONITOR_RESIZE.key,{handler:this.configMonitorResize,value:DEFAULT_CONFIG.MONITOR_RESIZE.value});},init:function(el,userConfig){var elId,i,child;this.initEvents();this.beforeInitEvent.fire(Module);this.cfg=new Config(this);if(this.isSecure){this.imageRoot=Module.IMG_ROOT_SSL;}
if(typeof el=="string"){elId=el;el=$(el);if(!el){el=(createModuleTemplate()).cloneNode(false);el.id=elId;}}
this.element=el;if(el.id){this.id=el.id;}
child=this.element.firstChild;if(child){do{switch(child.className){case Module.CSS_HEADER:this.header=child;break;case Module.CSS_BODY:this.body=child;break;case Module.CSS_FOOTER:this.footer=child;break;}}while((child=child.nextSibling));}
this.initDefaultConfig();Dom.addClass(this.element,Module.CSS_MODULE);if(userConfig){this.cfg.applyConfig(userConfig,true);}
if(!Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}
this.initEvent.fire(Module);},initResizeMonitor:function(){var oDoc,oIFrame,sHTML;function fireTextResize(){Module.textResizeEvent.fire();}
if(!YAHOO.env.ua.opera){oIFrame=Dom.get("_yuiResizeMonitor");if(!oIFrame){oIFrame=document.createElement("iframe");if(this.isSecure&&Module.RESIZE_MONITOR_SECURE_URL&&YAHOO.env.ua.ie){oIFrame.src=Module.RESIZE_MONITOR_SECURE_URL;}
if(YAHOO.env.ua.gecko){sHTML="<html><head><script "+"type=\"text/javascript\">"+"window.onresize=function(){window.parent."+"YAHOO.widget.Module.textResizeEvent."+"fire();};window.parent.YAHOO.widget.Module."+"textResizeEvent.fire();</script></head>"+"<body></body></html>";oIFrame.src="data:text/html;charset=utf-8,"+
encodeURIComponent(sHTML);}
oIFrame.id="_yuiResizeMonitor";$SetStyle(oIFrame,"position","absolute");$SetStyle(oIFrame,"visibility","hidden");document.body.appendChild(oIFrame);$SetStyle(oIFrame,"width","10em");$SetStyle(oIFrame,"height","10em");$SetStyle(oIFrame,"top",(-1*oIFrame.offsetHeight)+"px");$SetStyle(oIFrame,"left",(-1*oIFrame.offsetWidth)+"px");$SetStyle(oIFrame,"borderWidth","0");$SetStyle(oIFrame,"visibility","visible");if(YAHOO.env.ua.webkit){oDoc=oIFrame.contentWindow.document;oDoc.open();oDoc.close();}}
if(oIFrame&&oIFrame.contentWindow){Module.textResizeEvent.subscribe(this.onDomResize,this,true);if(!Module.textResizeInitialized){if(!Event.on(oIFrame.contentWindow,"resize",fireTextResize)){Event.on(oIFrame,"resize",fireTextResize);}
Module.textResizeInitialized=true;}
this.resizeMonitor=oIFrame;}}},onDomResize:function(e,obj){var nLeft=-1*this.resizeMonitor.offsetWidth,nTop=-1*this.resizeMonitor.offsetHeight;$SetStyle(this.resizeMonitor,"top",nTop+"px");$SetStyle(this.resizeMonitor,"left",nLeft+"px");},setHeader:function(headerContent){var oHeader=this.header||(this.header=createHeader());if(typeof headerContent=="string"){oHeader.innerHTML=headerContent;}else{oHeader.innerHTML="";oHeader.appendChild(headerContent);}
this.changeHeaderEvent.fire(headerContent);this.changeContentEvent.fire();},appendToHeader:function(element){var oHeader=this.header||(this.header=createHeader());oHeader.appendChild(element);this.changeHeaderEvent.fire(element);this.changeContentEvent.fire();},setBody:function(bodyContent){var oBody=this.body||(this.body=createBody());if(typeof bodyContent=="string"){oBody.innerHTML=bodyContent;}else{oBody.innerHTML="";oBody.appendChild(bodyContent);}
this.changeBodyEvent.fire(bodyContent);this.changeContentEvent.fire();},appendToBody:function(element){var oBody=this.body||(this.body=createBody());oBody.appendChild(element);this.changeBodyEvent.fire(element);this.changeContentEvent.fire();},setFooter:function(footerContent){var oFooter=this.footer||(this.footer=createFooter());if(typeof footerContent=="string"){oFooter.innerHTML=footerContent;}else{oFooter.innerHTML="";oFooter.appendChild(footerContent);}
this.changeFooterEvent.fire(footerContent);this.changeContentEvent.fire();},appendToFooter:function(element){var oFooter=this.footer||(this.footer=createFooter());oFooter.appendChild(element);this.changeFooterEvent.fire(element);this.changeContentEvent.fire();},render:function(appendToNode,moduleElement){var me=this,firstChild;function appendTo(element){if(typeof element=="string"){element=$(element);}
if(element){element.appendChild(me.element);me.appendEvent.fire();}}
this.beforeRenderEvent.fire();if(!moduleElement){moduleElement=this.element;}
if(appendToNode){appendTo(appendToNode);}else{if(!Dom.inDocument(this.element)){return false;}}
if(this.header&&!Dom.inDocument(this.header)){firstChild=moduleElement.firstChild;if(firstChild){moduleElement.insertBefore(this.header,firstChild);}else{moduleElement.appendChild(this.header);}}
if(this.body&&!Dom.inDocument(this.body)){if(this.footer&&Dom.isAncestor(this.moduleElement,this.footer)){moduleElement.insertBefore(this.body,this.footer);}else{moduleElement.appendChild(this.body);}}
if(this.footer&&!Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}
this.renderEvent.fire();return true;},destroy:function(){var parent,e;if(this.element){Event.purgeElement(this.element,true);parent=this.element.parentNode;}
if(parent){parent.removeChild(this.element);}
this.element=null;this.header=null;this.body=null;this.footer=null;Module.textResizeEvent.unsubscribe(this.onDomResize,this);this.cfg.destroy();this.cfg=null;this.destroyEvent.fire();for(e in this){if(e instanceof CustomEvent){e.unsubscribeAll();}}},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(type,args,obj){var visible=args[0];if(visible){this.beforeShowEvent.fire();$SetStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();$SetStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{Module.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}},toString:function(){return"Module "+this.id;}};YAHOO.lang.augmentProto(Module,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};var Lang=YAHOO.lang,CustomEvent=YAHOO.util.CustomEvent,Module=YAHOO.widget.Module,Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,Overlay=YAHOO.widget.Overlay,m_oIFrameTemplate,EVENT_TYPES={"BEFORE_MOVE":"beforeMove","MOVE":"move"},DEFAULT_CONFIG={"X":{key:"x",validator:Lang.isNumber,suppressEvent:true,supercedes:["iframe"]},"Y":{key:"y",validator:Lang.isNumber,suppressEvent:true,supercedes:["iframe"]},"XY":{key:"xy",suppressEvent:true,supercedes:["iframe"]},"CONTEXT":{key:"context",suppressEvent:true,supercedes:["iframe"]},"FIXED_CENTER":{key:"fixedcenter",value:false,validator:Lang.isBoolean,supercedes:["iframe","visible"]},"WIDTH":{key:"width",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"HEIGHT":{key:"height",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"ZINDEX":{key:"zindex",value:null},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:false,validator:Lang.isBoolean,supercedes:["iframe","x","y","xy"]},"IFRAME":{key:"iframe",value:(YAHOO.env.ua.ie==6?true:false),validator:Lang.isBoolean,supercedes:["zindex"]}};Overlay.IFRAME_SRC="javascript:false;";Overlay.IFRAME_OFFSET=3;Overlay.TOP_LEFT="tl";Overlay.TOP_RIGHT="tr";Overlay.BOTTOM_LEFT="bl";Overlay.BOTTOM_RIGHT="br";Overlay.CSS_OVERLAY="yui-overlay";Overlay.windowScrollEvent=new CustomEvent("windowScroll");Overlay.windowResizeEvent=new CustomEvent("windowResize");Overlay.windowScrollHandler=function(e){if(YAHOO.env.ua.ie){if(!window.scrollEnd){window.scrollEnd=-1;}
clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){Overlay.windowScrollEvent.fire();},1);}else{Overlay.windowScrollEvent.fire();}};Overlay.windowResizeHandler=function(e){if(YAHOO.env.ua.ie){if(!window.resizeEnd){window.resizeEnd=-1;}
clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){Overlay.windowResizeEvent.fire();},100);}else{Overlay.windowResizeEvent.fire();}};Overlay._initialized=null;if(Overlay._initialized===null){Event.on(window,"scroll",Overlay.windowScrollHandler);Event.on(window,"resize",Overlay.windowResizeHandler);Overlay._initialized=true;}
YAHOO.extend(Overlay,Module,{init:function(el,userConfig){Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(Overlay);Dom.addClass(this.element,Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}
if(this.platform=="mac"&&YAHOO.env.ua.gecko){if(!Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}
if(!Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}
this.initEvent.fire(Overlay);},initEvents:function(){Overlay.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.beforeMoveEvent=this.createEvent(EVENT_TYPES.BEFORE_MOVE);this.beforeMoveEvent.signature=SIGNATURE;this.moveEvent=this.createEvent(EVENT_TYPES.MOVE);this.moveEvent.signature=SIGNATURE;},initDefaultConfig:function(){Overlay.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.X.key,{handler:this.configX,validator:DEFAULT_CONFIG.X.validator,suppressEvent:DEFAULT_CONFIG.X.suppressEvent,supercedes:DEFAULT_CONFIG.X.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.Y.key,{handler:this.configY,validator:DEFAULT_CONFIG.Y.validator,suppressEvent:DEFAULT_CONFIG.Y.suppressEvent,supercedes:DEFAULT_CONFIG.Y.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.XY.key,{handler:this.configXY,suppressEvent:DEFAULT_CONFIG.XY.suppressEvent,supercedes:DEFAULT_CONFIG.XY.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.CONTEXT.key,{handler:this.configContext,suppressEvent:DEFAULT_CONFIG.CONTEXT.suppressEvent,supercedes:DEFAULT_CONFIG.CONTEXT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.FIXED_CENTER.key,{handler:this.configFixedCenter,value:DEFAULT_CONFIG.FIXED_CENTER.value,validator:DEFAULT_CONFIG.FIXED_CENTER.validator,supercedes:DEFAULT_CONFIG.FIXED_CENTER.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.WIDTH.key,{handler:this.configWidth,suppressEvent:DEFAULT_CONFIG.WIDTH.suppressEvent,supercedes:DEFAULT_CONFIG.WIDTH.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.HEIGHT.key,{handler:this.configHeight,suppressEvent:DEFAULT_CONFIG.HEIGHT.suppressEvent,supercedes:DEFAULT_CONFIG.HEIGHT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.ZINDEX.key,{handler:this.configzIndex,value:DEFAULT_CONFIG.ZINDEX.value});this.cfg.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value,validator:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator,supercedes:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.IFRAME.key,{handler:this.configIframe,value:DEFAULT_CONFIG.IFRAME.value,validator:DEFAULT_CONFIG.IFRAME.validator,supercedes:DEFAULT_CONFIG.IFRAME.supercedes});},moveTo:function(x,y){this.cfg.setProperty("xy",[x,y]);},hideMacGeckoScrollbars:function(){Dom.removeClass(this.element,"show-scrollbars");Dom.addClass(this.element,"hide-scrollbars");},showMacGeckoScrollbars:function(){Dom.removeClass(this.element,"hide-scrollbars");Dom.addClass(this.element,"show-scrollbars");},configVisible:function(type,args,obj){var visible=args[0],currentVis=$S(this.element,"visibility"),effect=this.cfg.getProperty("effect"),effectInstances=[],isMacGecko=(this.platform=="mac"&&YAHOO.env.ua.gecko),alreadySubscribed=Config.alreadySubscribed,eff,ei,e,i,j,k,h,nEffects,nEffectInstances;if(currentVis=="inherit"){e=this.element.parentNode;while(e.nodeType!=9&&e.nodeType!=11){currentVis=$S(e,"visibility");if(currentVis!="inherit"){break;}
e=e.parentNode;}
if(currentVis=="inherit"){currentVis="visible";}}
if(effect){if(effect instanceof Array){nEffects=effect.length;for(i=0;i<nEffects;i++){eff=effect[i];effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}else{effectInstances[effectInstances.length]=effect.effect(this,effect.duration);}}
if(visible){if(isMacGecko){this.showMacGeckoScrollbars();}
if(effect){if(visible){if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();nEffectInstances=effectInstances.length;for(j=0;j<nEffectInstances;j++){ei=effectInstances[j];if(j===0&&!alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}
ei.animateIn();}}}}else{if(currentVis!="visible"||currentVis===""){this.beforeShowEvent.fire();$SetStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}
if(effect){if(currentVis=="visible"){this.beforeHideEvent.fire();nEffectInstances=effectInstances.length;for(k=0;k<nEffectInstances;k++){h=effectInstances[k];if(k===0&&!alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}
h.animateOut();}}else if(currentVis===""){$SetStyle(this.element,"visibility","hidden");}}else{if(currentVis=="visible"||currentVis===""){this.beforeHideEvent.fire();$SetStyle(this.element,"visibility","hidden");this.hideEvent.fire();}}}},doCenterOnDOMEvent:function(){if(this.cfg.getProperty("visible")){this.center();}},configFixedCenter:function(type,args,obj){var val=args[0],alreadySubscribed=Config.alreadySubscribed,windowResizeEvent=Overlay.windowResizeEvent,windowScrollEvent=Overlay.windowScrollEvent;if(val){this.center();if(!alreadySubscribed(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center);}
if(!alreadySubscribed(windowResizeEvent,this.doCenterOnDOMEvent,this)){windowResizeEvent.subscribe(this.doCenterOnDOMEvent,this,true);}
if(!alreadySubscribed(windowScrollEvent,this.doCenterOnDOMEvent,this)){windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(type,args,obj){var height=args[0],el=this.element;$SetStyle(el,"height",height);this.cfg.refireEvent("iframe");},configWidth:function(type,args,obj){var width=args[0],el=this.element;$SetStyle(el,"width",width);this.cfg.refireEvent("iframe");},configzIndex:function(type,args,obj){var zIndex=args[0],el=this.element;if(!zIndex){zIndex=$S(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}
if(this.iframe){if(zIndex<=0){zIndex=1;}
$SetStyle(this.iframe,"zIndex",(zIndex-1));}
$SetStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);},configXY:function(type,args,obj){var pos=args[0],x=pos[0],y=pos[1];this.cfg.setProperty("x",x);this.cfg.setProperty("y",y);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},configX:function(type,args,obj){var x=args[0],y=this.cfg.getProperty("y");this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},configY:function(type,args,obj){var x=this.cfg.getProperty("x"),y=args[0];this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},showIframe:function(){var oIFrame=this.iframe,oParentNode;if(oIFrame){oParentNode=this.element.parentNode;if(oParentNode!=oIFrame.parentNode){oParentNode.appendChild(oIFrame);}
$SetStyle(oIFrame,"display","block");}},hideIframe:function(){if(this.iframe){$SetStyle(this.iframe,"display","none");}},syncIframe:function(){var oIFrame=this.iframe,oElement=this.element,nOffset=Overlay.IFRAME_OFFSET,nDimensionOffset=(nOffset*2),aXY;if(oIFrame){$SetStyle(oIFrame,"width",(oElement.offsetWidth+nDimensionOffset+"px"));$SetStyle(oIFrame,"height",(oElement.offsetHeight+nDimensionOffset+"px"));aXY=this.cfg.getProperty("xy");if(!Lang.isArray(aXY)||(isNaN(aXY[0])||isNaN(aXY[1]))){this.syncPosition();aXY=this.cfg.getProperty("xy");}
Dom.setXY(oIFrame,[(aXY[0]-nOffset),(aXY[1]-nOffset)]);}},configIframe:function(type,args,obj){var bIFrame=args[0];function createIFrame(){var oIFrame=this.iframe,oElement=this.element,oParent,aXY;if(!oIFrame){if(!m_oIFrameTemplate){m_oIFrameTemplate=document.createElement("iframe");if(this.isSecure){m_oIFrameTemplate.src=Overlay.IFRAME_SRC;}
if(YAHOO.env.ua.ie){$SetStyle(m_oIFrameTemplate,"filter","alpha(opacity=0)");m_oIFrameTemplate.frameBorder=0;}
else{$SetStyle(m_oIFrameTemplate,"opacity","0");}
$SetStyle(m_oIFrameTemplate,"position","absolute");$SetStyle(m_oIFrameTemplate,"border","none");$SetStyle(m_oIFrameTemplate,"margin","0");$SetStyle(m_oIFrameTemplate,"padding","0");$SetStyle(m_oIFrameTemplate,"display","none");}
oIFrame=m_oIFrameTemplate.cloneNode(false);oParent=oElement.parentNode;if(oParent){oParent.appendChild(oIFrame);}else{document.body.appendChild(oIFrame);}
this.iframe=oIFrame;}
this.showIframe();this.syncIframe();if(!this._hasIframeEventListeners){this.showEvent.subscribe(this.showIframe);this.hideEvent.subscribe(this.hideIframe);this.changeContentEvent.subscribe(this.syncIframe);this._hasIframeEventListeners=true;}}
function onBeforeShow(){createIFrame.call(this);this.beforeShowEvent.unsubscribe(onBeforeShow);this._iframeDeferred=false;}
if(bIFrame){if(this.cfg.getProperty("visible")){createIFrame.call(this);}
else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(onBeforeShow);this._iframeDeferred=true;}}}else{this.hideIframe();if(this._hasIframeEventListeners){this.showEvent.unsubscribe(this.showIframe);this.hideEvent.unsubscribe(this.hideIframe);this.changeContentEvent.unsubscribe(this.syncIframe);this._hasIframeEventListeners=false;}}},configConstrainToViewport:function(type,args,obj){var val=args[0];if(val){if(!Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}}else{this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(type,args,obj){var contextArgs=args[0],contextEl,elementMagnetCorner,contextMagnetCorner;if(contextArgs){contextEl=contextArgs[0];elementMagnetCorner=contextArgs[1];contextMagnetCorner=contextArgs[2];if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[$(contextEl),elementMagnetCorner,contextMagnetCorner],true);}
if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner);}}}},align:function(elementAlign,contextAlign){var contextArgs=this.cfg.getProperty("context"),me=this,context,element,contextRegion;function doAlign(v,h){switch(elementAlign){case Overlay.TOP_LEFT:me.moveTo(h,v);break;case Overlay.TOP_RIGHT:me.moveTo((h-element.offsetWidth),v);break;case Overlay.BOTTOM_LEFT:me.moveTo(h,(v-element.offsetHeight));break;case Overlay.BOTTOM_RIGHT:me.moveTo((h-element.offsetWidth),(v-element.offsetHeight));break;}}
if(contextArgs){context=contextArgs[0];element=this.element;me=this;if(!elementAlign){elementAlign=contextArgs[1];}
if(!contextAlign){contextAlign=contextArgs[2];}
if(element&&context){contextRegion=Dom.getRegion(context);switch(contextAlign){case Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}},enforceConstraints:function(type,args,obj){var pos=args[0],x=pos[0],y=pos[1],offsetHeight=this.element.offsetHeight,offsetWidth=this.element.offsetWidth,viewPortWidth=Dom.getViewportWidth(),viewPortHeight=Dom.getViewportHeight(),scrollX=Dom.getDocumentScrollLeft(),scrollY=Dom.getDocumentScrollTop(),topConstraint=scrollY+10,leftConstraint=scrollX+10,bottomConstraint=scrollY+viewPortHeight-offsetHeight-10,rightConstraint=scrollX+viewPortWidth-offsetWidth-10;if(x<leftConstraint){x=leftConstraint;}else if(x>rightConstraint){x=rightConstraint;}
if(y<topConstraint){y=topConstraint;}else if(y>bottomConstraint){y=bottomConstraint;}
this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);},center:function(){var scrollX=Dom.getDocumentScrollLeft(),scrollY=Dom.getDocumentScrollTop(),viewPortWidth=Dom.getClientWidth(),viewPortHeight=Dom.getClientHeight(),elementWidth=this.element.offsetWidth,elementHeight=this.element.offsetHeight,x=(viewPortWidth/2)-(elementWidth/2)+scrollX,y=(viewPortHeight/2)-(elementHeight/2)+scrollY;this.cfg.setProperty("xy",[parseInt(x,10),parseInt(y,10)]);this.cfg.refireEvent("iframe");},syncPosition:function(){var pos=Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);},onDomResize:function(e,obj){var me=this;Overlay.superclass.onDomResize.call(this,e,obj);setTimeout(function(){me.syncPosition();me.cfg.refireEvent("iframe");me.cfg.refireEvent("context");},0);},bringToTop:function(){var aOverlays=[],oElement=this.element;function compareZIndexDesc(p_oOverlay1,p_oOverlay2){var sZIndex1=$S(p_oOverlay1,"zIndex"),sZIndex2=$S(p_oOverlay2,"zIndex"),nZIndex1=(!sZIndex1||isNaN(sZIndex1))?0:parseInt(sZIndex1,10),nZIndex2=(!sZIndex2||isNaN(sZIndex2))?0:parseInt(sZIndex2,10);if(nZIndex1>nZIndex2){return-1;}else if(nZIndex1<nZIndex2){return 1;}else{return 0;}}
function isOverlayElement(p_oElement){var oOverlay=Dom.hasClass(p_oElement,Overlay.CSS_OVERLAY),Panel=YAHOO.widget.Panel;if(oOverlay&&!Dom.isAncestor(oElement,oOverlay)){if(Panel&&Dom.hasClass(p_oElement,Panel.CSS_PANEL)){aOverlays[aOverlays.length]=p_oElement.parentNode;}
else{aOverlays[aOverlays.length]=p_oElement;}}}
Dom.getElementsBy(isOverlayElement,"DIV",document.body);aOverlays.sort(compareZIndexDesc);var oTopOverlay=aOverlays[0],nTopZIndex;if(oTopOverlay){nTopZIndex=$S(oTopOverlay,"zIndex");if(!isNaN(nTopZIndex)&&oTopOverlay!=oElement){this.cfg.setProperty("zindex",(parseInt(nTopZIndex,10)+2));}}},destroy:function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}
this.iframe=null;Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);Overlay.superclass.destroy.call(this);},toString:function(){return"Overlay "+this.id;}});}());(function(){YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);};var Overlay=YAHOO.widget.Overlay,Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,CustomEvent=YAHOO.util.CustomEvent,OverlayManager=YAHOO.widget.OverlayManager;OverlayManager.CSS_FOCUSED="focused";OverlayManager.prototype={constructor:OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(userConfig){this.cfg=new Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;};this.focus=function(overlay){var o=this.find(overlay);if(o){if(activeOverlay!=o){if(activeOverlay){activeOverlay.blur();}
this.bringToTop(o);activeOverlay=o;Dom.addClass(activeOverlay.element,OverlayManager.CSS_FOCUSED);o.focusEvent.fire();}}};this.remove=function(overlay){var o=this.find(overlay),originalZ;if(o){if(activeOverlay==o){activeOverlay=null;}
originalZ=$S(o.element,"zIndex");o.cfg.setProperty("zIndex",-1000,true);this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,(this.overlays.length-1));o.hideEvent.unsubscribe(o.blur);o.destroyEvent.unsubscribe(this._onOverlayDestroy,o);if(o.element){Event.removeListener(o.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);}
o.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);o.focusEvent.unsubscribeAll();o.blurEvent.unsubscribeAll();o.focusEvent=null;o.blurEvent=null;o.focus=null;o.blur=null;}};this.blurAll=function(){var nOverlays=this.overlays.length,i;if(nOverlays>0){i=nOverlays-1;do{this.overlays[i].blur();}
while(i--);}};this._onOverlayBlur=function(p_sType,p_aArgs){activeOverlay=null;};var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}
if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},_onOverlayElementFocus:function(p_oEvent){var oTarget=Event.getTarget(p_oEvent),oClose=this.close;if(oClose&&(oTarget==oClose||Dom.isAncestor(oClose,oTarget))){this.blur();}
else{this.focus();}},_onOverlayDestroy:function(p_sType,p_aArgs,p_oOverlay){this.remove(p_oOverlay);},register:function(overlay){var mgr=this,zIndex,regcount,i,nOverlays;if(overlay instanceof Overlay){overlay.cfg.addProperty("manager",{value:this});overlay.focusEvent=overlay.createEvent("focus");overlay.focusEvent.signature=CustomEvent.LIST;overlay.blurEvent=overlay.createEvent("blur");overlay.blurEvent.signature=CustomEvent.LIST;overlay.focus=function(){mgr.focus(this);};overlay.blur=function(){if(mgr.getActive()==this){Dom.removeClass(this.element,OverlayManager.CSS_FOCUSED);this.blurEvent.fire();}};overlay.blurEvent.subscribe(mgr._onOverlayBlur);overlay.hideEvent.subscribe(overlay.blur);overlay.destroyEvent.subscribe(this._onOverlayDestroy,overlay,this);Event.on(overlay.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus,null,overlay);zIndex=$S(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex,10));}else{overlay.cfg.setProperty("zIndex",0);}
this.overlays.push(overlay);this.bringToTop(overlay);return true;}else if(overlay instanceof Array){regcount=0;nOverlays=overlay.length;for(i=0;i<nOverlays;i++){if(this.register(overlay[i])){regcount++;}}
if(regcount>0){return true;}}else{return false;}},bringToTop:function(p_oOverlay){var oOverlay=this.find(p_oOverlay),nTopZIndex,oTopOverlay,aOverlays;if(oOverlay){aOverlays=this.overlays;aOverlays.sort(this.compareZIndexDesc);oTopOverlay=aOverlays[0];if(oTopOverlay){nTopZIndex=$S(oTopOverlay.element,"zIndex");if(!isNaN(nTopZIndex)&&oTopOverlay!=oOverlay){oOverlay.cfg.setProperty("zIndex",(parseInt(nTopZIndex,10)+2));}
aOverlays.sort(this.compareZIndexDesc);}}},find:function(overlay){var aOverlays=this.overlays,nOverlays=aOverlays.length,i;if(nOverlays>0){i=nOverlays-1;if(overlay instanceof Overlay){do{if(aOverlays[i]==overlay){return aOverlays[i];}}
while(i--);}else if(typeof overlay=="string"){do{if(aOverlays[i].id==overlay){return aOverlays[i];}}
while(i--);}
return null;}},compareZIndexDesc:function(o1,o2){var zIndex1=o1.cfg.getProperty("zIndex"),zIndex2=o2.cfg.getProperty("zIndex");if(zIndex1>zIndex2){return-1;}else if(zIndex1<zIndex2){return 1;}else{return 0;}},showAll:function(){var aOverlays=this.overlays,nOverlays=aOverlays.length,i;if(nOverlays>0){i=nOverlays-1;do{aOverlays[i].show();}
while(i--);}},hideAll:function(){var aOverlays=this.overlays,nOverlays=aOverlays.length,i;if(nOverlays>0){i=nOverlays-1;do{aOverlays[i].hide();}
while(i--);}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.Tooltip=function(el,userConfig){YAHOO.widget.Tooltip.superclass.constructor.call(this,el,userConfig);};var Lang=YAHOO.lang,Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,Tooltip=YAHOO.widget.Tooltip,m_oShadowTemplate,DEFAULT_CONFIG={"PREVENT_OVERLAP":{key:"preventoverlap",value:true,validator:Lang.isBoolean,supercedes:["x","y","xy"]},"SHOW_DELAY":{key:"showdelay",value:200,validator:Lang.isNumber},"AUTO_DISMISS_DELAY":{key:"autodismissdelay",value:5000,validator:Lang.isNumber},"HIDE_DELAY":{key:"hidedelay",value:250,validator:Lang.isNumber},"TEXT":{key:"text",suppressEvent:true},"CONTAINER":{key:"container"}};Tooltip.CSS_TOOLTIP="yui-tt";function restoreOriginalWidth(p_sType,p_aArgs,p_oObject){var sOriginalWidth=p_oObject[0],sNewWidth=p_oObject[1],oConfig=this.cfg,sCurrentWidth=oConfig.getProperty("width");if(sCurrentWidth==sNewWidth){oConfig.setProperty("width",sOriginalWidth);}
this.unsubscribe("hide",this._onHide,p_oObject);}
function setWidthToOffsetWidth(p_sType,p_aArgs){var oBody=document.body,oConfig=this.cfg,sOriginalWidth=oConfig.getProperty("width"),sNewWidth,oClone;if((!sOriginalWidth||sOriginalWidth=="auto")&&(oConfig.getProperty("container")!=oBody||oConfig.getProperty("x")>=Dom.getViewportWidth()||oConfig.getProperty("y")>=Dom.getViewportHeight())){oClone=this.element.cloneNode(true);$SetStyle(oClone,"visibility","hidden");$SetStyle(oClone,"top","0px");$SetStyle(oClone,"left","0px");oBody.appendChild(oClone);sNewWidth=(oClone.offsetWidth+"px");oBody.removeChild(oClone);oClone=null;oConfig.setProperty("width",sNewWidth);oConfig.refireEvent("xy");this.subscribe("hide",restoreOriginalWidth,[(sOriginalWidth||""),sNewWidth]);}}
function onDOMReady(p_sType,p_aArgs,p_oObject){this.render(p_oObject);}
function onInit(){Event.onDOMReady(onDOMReady,this.cfg.getProperty("container"),this);}
YAHOO.extend(Tooltip,YAHOO.widget.Overlay,{init:function(el,userConfig){Tooltip.superclass.init.call(this,el);this.beforeInitEvent.fire(Tooltip);Dom.addClass(this.element,Tooltip.CSS_TOOLTIP);if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.subscribe("beforeShow",setWidthToOffsetWidth);this.subscribe("init",onInit);this.subscribe("render",this.onRender);this.initEvent.fire(Tooltip);},initDefaultConfig:function(){Tooltip.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.PREVENT_OVERLAP.key,{value:DEFAULT_CONFIG.PREVENT_OVERLAP.value,validator:DEFAULT_CONFIG.PREVENT_OVERLAP.validator,supercedes:DEFAULT_CONFIG.PREVENT_OVERLAP.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.SHOW_DELAY.key,{handler:this.configShowDelay,value:200,validator:DEFAULT_CONFIG.SHOW_DELAY.validator});this.cfg.addProperty(DEFAULT_CONFIG.AUTO_DISMISS_DELAY.key,{handler:this.configAutoDismissDelay,value:DEFAULT_CONFIG.AUTO_DISMISS_DELAY.value,validator:DEFAULT_CONFIG.AUTO_DISMISS_DELAY.validator});this.cfg.addProperty(DEFAULT_CONFIG.HIDE_DELAY.key,{handler:this.configHideDelay,value:DEFAULT_CONFIG.HIDE_DELAY.value,validator:DEFAULT_CONFIG.HIDE_DELAY.validator});this.cfg.addProperty(DEFAULT_CONFIG.TEXT.key,{handler:this.configText,suppressEvent:DEFAULT_CONFIG.TEXT.suppressEvent});this.cfg.addProperty(DEFAULT_CONFIG.CONTAINER.key,{handler:this.configContainer,value:document.body});},configText:function(type,args,obj){var text=args[0];if(text){this.setBody(text);}},configContainer:function(type,args,obj){var container=args[0];if(typeof container=='string'){this.cfg.setProperty("container",$(container),true);}},_removeEventListeners:function(){var aElements=this._context,nElements,oElement,i;if(aElements){nElements=aElements.length;if(nElements>0){i=nElements-1;do{oElement=aElements[i];Event.removeListener(oElement,"mouseover",this.onContextMouseOver);Event.removeListener(oElement,"mousemove",this.onContextMouseMove);Event.removeListener(oElement,"mouseout",this.onContextMouseOut);}
while(i--);}}},configContext:function(type,args,obj){var context=args[0],aElements,nElements,oElement,i;if(context){if(!(context instanceof Array)){if(typeof context=="string"){this.cfg.setProperty("context",[$(context)],true);}else{this.cfg.setProperty("context",[context],true);}
context=this.cfg.getProperty("context");}
this._removeEventListeners();this._context=context;aElements=this._context;if(aElements){nElements=aElements.length;if(nElements>0){i=nElements-1;do{oElement=aElements[i];Event.on(oElement,"mouseover",this.onContextMouseOver,this);Event.on(oElement,"mousemove",this.onContextMouseMove,this);Event.on(oElement,"mouseout",this.onContextMouseOut,this);}
while(i--);}}}},onContextMouseMove:function(e,obj){obj.pageX=Event.getPageX(e);obj.pageY=Event.getPageY(e);},onContextMouseOver:function(e,obj){var context=this;if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}
Event.on(context,"mousemove",obj.onContextMouseMove,obj);if(context.title){obj._tempTitle=context.title;context.title="";}
obj.showProcId=obj.doShow(e,context);},onContextMouseOut:function(e,obj){var el=this;if(obj._tempTitle){el.title=obj._tempTitle;obj._tempTitle=null;}
if(obj.showProcId){clearTimeout(obj.showProcId);obj.showProcId=null;}
if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}
obj.hideProcId=setTimeout(function(){obj.hide();},obj.cfg.getProperty("hidedelay"));},doShow:function(e,context){var yOffset=25,me=this;if(YAHOO.env.ua.opera&&context.tagName&&context.tagName.toUpperCase()=="A"){yOffset+=12;}
return setTimeout(function(){if(me._tempTitle){me.setBody(me._tempTitle);}else{me.cfg.refireEvent("text");}
me.moveTo(me.pageX,me.pageY+yOffset);if(me.cfg.getProperty("preventoverlap")){me.preventOverlap(me.pageX,me.pageY);}
Event.removeListener(context,"mousemove",me.onContextMouseMove);me.show();me.hideProcId=me.doHide();},this.cfg.getProperty("showdelay"));},doHide:function(){var me=this;return setTimeout(function(){me.hide();},this.cfg.getProperty("autodismissdelay"));},preventOverlap:function(pageX,pageY){var height=this.element.offsetHeight,mousePoint=new YAHOO.util.Point(pageX,pageY),elementRegion=Dom.getRegion(this.element);elementRegion.top-=5;elementRegion.left-=5;elementRegion.right+=5;elementRegion.bottom+=5;if(elementRegion.contains(mousePoint)){this.cfg.setProperty("y",(pageY-height-5));}},onRender:function(p_sType,p_aArgs){function sizeShadow(){var oElement=this.element,oShadow=this._shadow;if(oShadow){$SetStyle(oShadow,"width",(oElement.offsetWidth+6)+"px");$SetStyle(oShadow,"height",(oElement.offsetHeight+1)+"px");}}
function addShadowVisibleClass(){Dom.addClass(this._shadow,"yui-tt-shadow-visible");}
function removeShadowVisibleClass(){Dom.removeClass(this._shadow,"yui-tt-shadow-visible");}
function createShadow(){var oShadow=this._shadow,oElement,Module,nIE,me;if(!oShadow){oElement=this.element;Module=YAHOO.widget.Module;nIE=YAHOO.env.ua.ie;me=this;if(!m_oShadowTemplate){m_oShadowTemplate=document.createElement("div");m_oShadowTemplate.className="yui-tt-shadow";}
oShadow=m_oShadowTemplate.cloneNode(false);oElement.appendChild(oShadow);this._shadow=oShadow;addShadowVisibleClass.call(this);this.subscribe("beforeShow",addShadowVisibleClass);this.subscribe("beforeHide",removeShadowVisibleClass);if(nIE==6||(nIE==7&&document.compatMode=="BackCompat")){window.setTimeout(function(){sizeShadow.call(me);},0);this.cfg.subscribeToConfigEvent("width",sizeShadow);this.cfg.subscribeToConfigEvent("height",sizeShadow);this.subscribe("changeContent",sizeShadow);Module.textResizeEvent.subscribe(sizeShadow,this,true);this.subscribe("destroy",function(){Module.textResizeEvent.unsubscribe(sizeShadow,this);});}}}
function onBeforeShow(){createShadow.call(this);this.unsubscribe("beforeShow",onBeforeShow);}
if(this.cfg.getProperty("visible")){createShadow.call(this);}
else{this.subscribe("beforeShow",onBeforeShow);}},destroy:function(){this._removeEventListeners();Tooltip.superclass.destroy.call(this);},toString:function(){return"Tooltip "+this.id;}});}());(function(){YAHOO.widget.Panel=function(el,userConfig){YAHOO.widget.Panel.superclass.constructor.call(this,el,userConfig);};var Lang=YAHOO.lang,DD=YAHOO.util.DD,Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Overlay=YAHOO.widget.Overlay,CustomEvent=YAHOO.util.CustomEvent,Config=YAHOO.util.Config,Panel=YAHOO.widget.Panel,m_oMaskTemplate,m_oUnderlayTemplate,m_oCloseIconTemplate,EVENT_TYPES={"SHOW_MASK":"showMask","HIDE_MASK":"hideMask","DRAG":"drag"},DEFAULT_CONFIG={"CLOSE":{key:"close",value:true,validator:Lang.isBoolean,supercedes:["visible"]},"DRAGGABLE":{key:"draggable",value:(DD?true:false),validator:Lang.isBoolean,supercedes:["visible"]},"UNDERLAY":{key:"underlay",value:"shadow",supercedes:["visible"]},"MODAL":{key:"modal",value:false,validator:Lang.isBoolean,supercedes:["visible"]},"KEY_LISTENERS":{key:"keylisteners",suppressEvent:true,supercedes:["visible"]}};Panel.CSS_PANEL="yui-panel";Panel.CSS_PANEL_CONTAINER="yui-panel-container";function createHeader(p_sType,p_aArgs){if(!this.header){this.setHeader("&#160;");}}
function restoreOriginalWidth(p_sType,p_aArgs,p_oObject){var sOriginalWidth=p_oObject[0],sNewWidth=p_oObject[1],oConfig=this.cfg,sCurrentWidth=oConfig.getProperty("width");if(sCurrentWidth==sNewWidth){oConfig.setProperty("width",sOriginalWidth);}
this.unsubscribe("hide",restoreOriginalWidth,p_oObject);}
function setWidthToOffsetWidth(p_sType,p_aArgs){var nIE=YAHOO.env.ua.ie,oConfig,sOriginalWidth,sNewWidth;if(nIE==6||(nIE==7&&document.compatMode=="BackCompat")){oConfig=this.cfg;sOriginalWidth=oConfig.getProperty("width");if(!sOriginalWidth||sOriginalWidth=="auto"){sNewWidth=(this.element.offsetWidth+"px");oConfig.setProperty("width",sNewWidth);this.subscribe("hide",restoreOriginalWidth,[(sOriginalWidth||""),sNewWidth]);}}}
function onElementFocus(){this.blur();}
function addFocusEventHandlers(p_sType,p_aArgs){var me=this;function isFocusable(el){var sTagName=el.tagName.toUpperCase(),bFocusable=false;switch(sTagName){case"A":case"BUTTON":case"SELECT":case"TEXTAREA":if(!Dom.isAncestor(me.element,el)){Event.on(el,"focus",onElementFocus,el,true);bFocusable=true;}
break;case"INPUT":if(el.type!="hidden"&&!Dom.isAncestor(me.element,el)){Event.on(el,"focus",onElementFocus,el,true);bFocusable=true;}
break;}
return bFocusable;}
this.focusableElements=Dom.getElementsBy(isFocusable);}
function removeFocusEventHandlers(p_sType,p_aArgs){var aElements=this.focusableElements,nElements=aElements.length,el2,i;for(i=0;i<nElements;i++){el2=aElements[i];Event.removeListener(el2,"focus",onElementFocus);}}
YAHOO.extend(Panel,Overlay,{init:function(el,userConfig){Panel.superclass.init.call(this,el);this.beforeInitEvent.fire(Panel);Dom.addClass(this.element,Panel.CSS_PANEL);this.buildWrapper();if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.subscribe("showMask",addFocusEventHandlers);this.subscribe("hideMask",removeFocusEventHandlers);this.initEvent.fire(Panel);},initEvents:function(){Panel.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.showMaskEvent=this.createEvent(EVENT_TYPES.SHOW_MASK);this.showMaskEvent.signature=SIGNATURE;this.hideMaskEvent=this.createEvent(EVENT_TYPES.HIDE_MASK);this.hideMaskEvent.signature=SIGNATURE;this.dragEvent=this.createEvent(EVENT_TYPES.DRAG);this.dragEvent.signature=SIGNATURE;},initDefaultConfig:function(){Panel.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.CLOSE.key,{handler:this.configClose,value:DEFAULT_CONFIG.CLOSE.value,validator:DEFAULT_CONFIG.CLOSE.validator,supercedes:DEFAULT_CONFIG.CLOSE.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.DRAGGABLE.key,{handler:this.configDraggable,value:DEFAULT_CONFIG.DRAGGABLE.value,validator:DEFAULT_CONFIG.DRAGGABLE.validator,supercedes:DEFAULT_CONFIG.DRAGGABLE.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.UNDERLAY.key,{handler:this.configUnderlay,value:DEFAULT_CONFIG.UNDERLAY.value,supercedes:DEFAULT_CONFIG.UNDERLAY.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.MODAL.key,{handler:this.configModal,value:DEFAULT_CONFIG.MODAL.value,validator:DEFAULT_CONFIG.MODAL.validator,supercedes:DEFAULT_CONFIG.MODAL.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.KEY_LISTENERS.key,{handler:this.configKeyListeners,suppressEvent:DEFAULT_CONFIG.KEY_LISTENERS.suppressEvent,supercedes:DEFAULT_CONFIG.KEY_LISTENERS.supercedes});},configClose:function(type,args,obj){var val=args[0],oClose=this.close;function doHide(e,obj){obj.hide();}
if(val){if(!oClose){if(!m_oCloseIconTemplate){m_oCloseIconTemplate=document.createElement("span");m_oCloseIconTemplate.innerHTML="&#160;";m_oCloseIconTemplate.className="container-close";}
oClose=m_oCloseIconTemplate.cloneNode(true);this.innerElement.appendChild(oClose);Event.on(oClose,"click",doHide,this);this.close=oClose;}else{$SetStyle(oClose,"display","block");}}else{if(oClose){$SetStyle(oClose,"display","none");}}},configDraggable:function(type,args,obj){var val=args[0];if(val){if(!DD){this.cfg.setProperty("draggable",false);return;}
if(this.header){$SetStyle(this.header,"cursor","move");this.registerDragDrop();}
this.subscribe("beforeRender",createHeader);this.subscribe("beforeShow",setWidthToOffsetWidth);}else{if(this.dd){this.dd.unreg();}
if(this.header){$SetStyle(this.header,"cursor","auto");}
this.unsubscribe("beforeRender",createHeader);this.unsubscribe("beforeShow",setWidthToOffsetWidth);}},configUnderlay:function(type,args,obj){var UA=YAHOO.env.ua,bMacGecko=(this.platform=="mac"&&UA.gecko),sUnderlay=args[0].toLowerCase(),oUnderlay=this.underlay,oElement=this.element;function createUnderlay(){var nIE;if(!oUnderlay){if(!m_oUnderlayTemplate){m_oUnderlayTemplate=document.createElement("div");m_oUnderlayTemplate.className="underlay";}
oUnderlay=m_oUnderlayTemplate.cloneNode(false);this.element.appendChild(oUnderlay);this.underlay=oUnderlay;nIE=UA.ie;if(nIE==6||(nIE==7&&document.compatMode=="BackCompat")){this.sizeUnderlay();this.cfg.subscribeToConfigEvent("width",this.sizeUnderlay);this.cfg.subscribeToConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.subscribe(this.sizeUnderlay);YAHOO.widget.Module.textResizeEvent.subscribe(this.sizeUnderlay,this,true);}}}
function onBeforeShow(){createUnderlay.call(this);this._underlayDeferred=false;this.beforeShowEvent.unsubscribe(onBeforeShow);}
function destroyUnderlay(){if(this._underlayDeferred){this.beforeShowEvent.unsubscribe(onBeforeShow);this._underlayDeferred=false;}
if(oUnderlay){this.cfg.unsubscribeFromConfigEvent("width",this.sizeUnderlay);this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.sizeUnderlay);YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay,this,true);this.element.removeChild(oUnderlay);this.underlay=null;}}
switch(sUnderlay){case"shadow":Dom.removeClass(oElement,"matte");Dom.addClass(oElement,"shadow");break;case"matte":if(!bMacGecko){destroyUnderlay.call(this);}
Dom.removeClass(oElement,"shadow");Dom.addClass(oElement,"matte");break;default:if(!bMacGecko){destroyUnderlay.call(this);}
Dom.removeClass(oElement,"shadow");Dom.removeClass(oElement,"matte");break;}
if((sUnderlay=="shadow")||(bMacGecko&&!oUnderlay)){if(this.cfg.getProperty("visible")){createUnderlay.call(this);}
else{if(!this._underlayDeferred){this.beforeShowEvent.subscribe(onBeforeShow);this._underlayDeferred=true;}}}},configModal:function(type,args,obj){var modal=args[0];if(modal){if(!this._hasModalityEventListeners){this.subscribe("beforeShow",this.buildMask);this.subscribe("beforeShow",this.bringToTop);this.subscribe("beforeShow",this.showMask);this.subscribe("hide",this.hideMask);Overlay.windowResizeEvent.subscribe(this.sizeMask,this,true);this._hasModalityEventListeners=true;}}else{if(this._hasModalityEventListeners){if(this.cfg.getProperty("visible")){this.hideMask();this.removeMask();}
this.unsubscribe("beforeShow",this.buildMask);this.unsubscribe("beforeShow",this.bringToTop);this.unsubscribe("beforeShow",this.showMask);this.unsubscribe("hide",this.hideMask);Overlay.windowResizeEvent.unsubscribe(this.sizeMask,this);this._hasModalityEventListeners=false;}}},removeMask:function(){var oMask=this.mask,oParentNode;if(oMask){this.hideMask();oParentNode=oMask.parentNode;if(oParentNode){oParentNode.removeChild(oMask);}
this.mask=null;}},configKeyListeners:function(type,args,obj){var listeners=args[0],listener,nListeners,i;if(listeners){if(listeners instanceof Array){nListeners=listeners.length;for(i=0;i<nListeners;i++){listener=listeners[i];if(!Config.alreadySubscribed(this.showEvent,listener.enable,listener)){this.showEvent.subscribe(listener.enable,listener,true);}
if(!Config.alreadySubscribed(this.hideEvent,listener.disable,listener)){this.hideEvent.subscribe(listener.disable,listener,true);this.destroyEvent.subscribe(listener.disable,listener,true);}}}else{if(!Config.alreadySubscribed(this.showEvent,listeners.enable,listeners)){this.showEvent.subscribe(listeners.enable,listeners,true);}
if(!Config.alreadySubscribed(this.hideEvent,listeners.disable,listeners)){this.hideEvent.subscribe(listeners.disable,listeners,true);this.destroyEvent.subscribe(listeners.disable,listeners,true);}}}},configHeight:function(type,args,obj){var height=args[0],el=this.innerElement;$SetStyle(el,"height",height);this.cfg.refireEvent("iframe");},configWidth:function(type,args,obj){var width=args[0],el=this.innerElement;$SetStyle(el,"width",width);this.cfg.refireEvent("iframe");},configzIndex:function(type,args,obj){Panel.superclass.configzIndex.call(this,type,args,obj);var maskZ=0,currentZ=$S(this.element,"zIndex");if(this.mask){if(!currentZ||isNaN(currentZ)){currentZ=0;}
if(currentZ===0){this.cfg.setProperty("zIndex",1);}else{maskZ=currentZ-1;$SetStyle(this.mask,"zIndex",maskZ);}}},buildWrapper:function(){var elementParent=this.element.parentNode,originalElement=this.element,wrapper=document.createElement("div");wrapper.className=Panel.CSS_PANEL_CONTAINER;wrapper.id=originalElement.id+"_c";if(elementParent){elementParent.insertBefore(wrapper,originalElement);}
wrapper.appendChild(originalElement);this.element=wrapper;this.innerElement=originalElement;$SetStyle(this.innerElement,"visibility","inherit");},sizeUnderlay:function(){var oUnderlay=this.underlay,oElement;if(oUnderlay){oElement=this.element;$SetStyle(oUnderlay,"width",oElement.offsetWidth+"px");$SetStyle(oUnderlay,"height",oElement.offsetHeight+"px");}},registerDragDrop:function(){var me=this;if(this.header){if(!DD){return;}
this.dd=new DD(this.element.id,this.id);if(!this.header.id){this.header.id=this.id+"_h";}
this.dd.startDrag=function(){var offsetHeight,offsetWidth,viewPortWidth,viewPortHeight,scrollX,scrollY,topConstraint,leftConstraint,bottomConstraint,rightConstraint;if(YAHOO.env.ua.ie==6){Dom.addClass(me.element,"drag");}
if(me.cfg.getProperty("constraintoviewport")){offsetHeight=me.element.offsetHeight;offsetWidth=me.element.offsetWidth;viewPortWidth=Dom.getViewportWidth();viewPortHeight=Dom.getViewportHeight();scrollX=Dom.getDocumentScrollLeft();scrollY=Dom.getDocumentScrollTop();topConstraint=scrollY+10;leftConstraint=scrollX+10;bottomConstraint=scrollY+viewPortHeight-offsetHeight-10;rightConstraint=scrollX+viewPortWidth-offsetWidth-10;this.minX=leftConstraint;this.maxX=rightConstraint;this.constrainX=true;this.minY=topConstraint;this.maxY=bottomConstraint;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}
me.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){me.syncPosition();me.cfg.refireEvent("iframe");if(this.platform=="mac"&&YAHOO.env.ua.gecko){this.showMacGeckoScrollbars();}
me.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(YAHOO.env.ua.ie==6){Dom.removeClass(me.element,"drag");}
me.dragEvent.fire("endDrag",arguments);me.moveEvent.fire(me.cfg.getProperty("xy"));};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}},buildMask:function(){var oMask=this.mask;if(!oMask){if(!m_oMaskTemplate){m_oMaskTemplate=document.createElement("div");m_oMaskTemplate.className="mask";m_oMaskTemplate.innerHTML="&#160;";}
oMask=m_oMaskTemplate.cloneNode(true);oMask.id=this.id+"_mask";document.body.insertBefore(oMask,document.body.firstChild);this.mask=oMask;}},hideMask:function(){if(this.cfg.getProperty("modal")&&this.mask){$SetStyle(this.mask,"display","none");this.hideMaskEvent.fire();Dom.removeClass(document.body,"masked");}},showMask:function(){if(this.cfg.getProperty("modal")&&this.mask){Dom.addClass(document.body,"masked");this.sizeMask();$SetStyle(this.mask,"display","block");this.showMaskEvent.fire();}},sizeMask:function(){if(this.mask){$SetStyle(this.mask,"height",Dom.getDocumentHeight()+"px");$SetStyle(this.mask,"width",Dom.getDocumentWidth()+"px");}},render:function(appendToNode){return Panel.superclass.render.call(this,appendToNode,this.innerElement);},destroy:function(){Overlay.windowResizeEvent.unsubscribe(this.sizeMask,this);this.removeMask();if(this.close){Event.purgeElement(this.close);}
Panel.superclass.destroy.call(this);},toString:function(){return"Panel "+this.id;}});}());(function(){YAHOO.widget.Dialog=function(el,userConfig){YAHOO.widget.Dialog.superclass.constructor.call(this,el,userConfig);};var Event=YAHOO.util.Event,CustomEvent=YAHOO.util.CustomEvent,Dom=YAHOO.util.Dom,KeyListener=YAHOO.util.KeyListener,Connect=YAHOO.util.Connect,Dialog=YAHOO.widget.Dialog,Lang=YAHOO.lang,EVENT_TYPES={"BEFORE_SUBMIT":"beforeSubmit","SUBMIT":"submit","MANUAL_SUBMIT":"manualSubmit","ASYNC_SUBMIT":"asyncSubmit","FORM_SUBMIT":"formSubmit","CANCEL":"cancel"},DEFAULT_CONFIG={"POST_METHOD":{key:"postmethod",value:"async"},"BUTTONS":{key:"buttons",value:"none"}};Dialog.CSS_DIALOG="yui-dialog";function removeButtonEventHandlers(){var aButtons=this._aButtons,nButtons,oButton,i;if(Lang.isArray(aButtons)){nButtons=aButtons.length;if(nButtons>0){i=nButtons-1;do{oButton=aButtons[i];if(oButton instanceof YAHOO.widget.Button){oButton.destroy();}
else if(oButton.tagName.toUpperCase()=="BUTTON"){Event.purgeElement(oButton);Event.purgeElement(oButton,false);}}
while(i--);}}}
YAHOO.extend(Dialog,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){Dialog.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty(DEFAULT_CONFIG.POST_METHOD.key,{handler:this.configPostMethod,value:DEFAULT_CONFIG.POST_METHOD.value,validator:function(val){if(val!="form"&&val!="async"&&val!="none"&&val!="manual"){return false;}else{return true;}}});this.cfg.addProperty(DEFAULT_CONFIG.BUTTONS.key,{handler:this.configButtons,value:DEFAULT_CONFIG.BUTTONS.value});},initEvents:function(){Dialog.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.beforeSubmitEvent=this.createEvent(EVENT_TYPES.BEFORE_SUBMIT);this.beforeSubmitEvent.signature=SIGNATURE;this.submitEvent=this.createEvent(EVENT_TYPES.SUBMIT);this.submitEvent.signature=SIGNATURE;this.manualSubmitEvent=this.createEvent(EVENT_TYPES.MANUAL_SUBMIT);this.manualSubmitEvent.signature=SIGNATURE;this.asyncSubmitEvent=this.createEvent(EVENT_TYPES.ASYNC_SUBMIT);this.asyncSubmitEvent.signature=SIGNATURE;this.formSubmitEvent=this.createEvent(EVENT_TYPES.FORM_SUBMIT);this.formSubmitEvent.signature=SIGNATURE;this.cancelEvent=this.createEvent(EVENT_TYPES.CANCEL);this.cancelEvent.signature=SIGNATURE;},init:function(el,userConfig){Dialog.superclass.init.call(this,el);this.beforeInitEvent.fire(Dialog);Dom.addClass(this.element,Dialog.CSS_DIALOG);this.cfg.setProperty("visible",false);if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.subscribe("changeBody",this.registerForm);this.initEvent.fire(Dialog);},doSubmit:function(){var oForm=this.form,bUseFileUpload=false,bUseSecureFileUpload=false,aElements,nElements,i,sMethod;switch(this.cfg.getProperty("postmethod")){case"async":aElements=oForm.elements;nElements=aElements.length;if(nElements>0){i=nElements-1;do{if(aElements[i].type=="file"){bUseFileUpload=true;break;}}
while(i--);}
if(bUseFileUpload&&YAHOO.env.ua.ie&&this.isSecure){bUseSecureFileUpload=true;}
sMethod=(oForm.getAttribute("method")||"POST").toUpperCase();Connect.setForm(oForm,bUseFileUpload,bUseSecureFileUpload);Connect.asyncRequest(sMethod,oForm.getAttribute("action"),this.callback);this.asyncSubmitEvent.fire();break;case"form":oForm.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}},registerForm:function(){var form=this.element.getElementsByTagName("form")[0],me=this,firstElement,lastElement;if(this.form){if(this.form==form&&Dom.isAncestor(this.element,this.form)){return;}
else{Event.purgeElement(this.form);this.form=null;}}
if(!form){form=document.createElement("form");form.name="frm_"+this.id;this.body.appendChild(form);}
if(form){this.form=form;Event.on(form,"submit",function(e){Event.stopEvent(e);this.submit();this.form.blur();});this.firstFormElement=function(){var f,el,nElements=form.elements.length;for(f=0;f<nElements;f++){el=form.elements[f];if(el.focus&&!el.disabled&&el.type!="hidden"){return el;}}
return null;}();this.lastFormElement=function(){var f,el,nElements=form.elements.length;for(f=nElements-1;f>=0;f--){el=form.elements[f];if(el.focus&&!el.disabled&&el.type!="hidden"){return el;}}
return null;}();if(this.cfg.getProperty("modal")){firstElement=this.firstFormElement||this.firstButton;if(firstElement){this.preventBackTab=new KeyListener(firstElement,{shift:true,keys:9},{fn:me.focusLast,scope:me,correctScope:true});this.showEvent.subscribe(this.preventBackTab.enable,this.preventBackTab,true);this.hideEvent.subscribe(this.preventBackTab.disable,this.preventBackTab,true);}
lastElement=this.lastButton||this.lastFormElement;if(lastElement){this.preventTabOut=new KeyListener(lastElement,{shift:false,keys:9},{fn:me.focusFirst,scope:me,correctScope:true});this.showEvent.subscribe(this.preventTabOut.enable,this.preventTabOut,true);this.hideEvent.subscribe(this.preventTabOut.disable,this.preventTabOut,true);}}}},configClose:function(type,args,obj){var val=args[0];function doCancel(e,obj){obj.cancel();}
if(val){if(!this.close){this.close=document.createElement("div");Dom.addClass(this.close,"container-close");this.close.innerHTML="&#160;";this.innerElement.appendChild(this.close);Event.on(this.close,"click",doCancel,this);}else{$SetStyle(this.close,"display","block");}}else{if(this.close){$SetStyle(this.close,"display","none");}}},configButtons:function(type,args,obj){var Button=YAHOO.widget.Button,aButtons=args[0],oInnerElement=this.innerElement,oButton,oButtonEl,oYUIButton,nButtons,oSpan,oFooter,i;removeButtonEventHandlers.call(this);this._aButtons=null;if(Lang.isArray(aButtons)){oSpan=document.createElement("span");oSpan.className="button-group";nButtons=aButtons.length;this._aButtons=[];for(i=0;i<nButtons;i++){oButton=aButtons[i];if(Button){oYUIButton=new Button({label:oButton.text,container:oSpan});oButtonEl=oYUIButton.get("element");if(oButton.isDefault){oYUIButton.addClass("default");this.defaultHtmlButton=oButtonEl;}
if(Lang.isFunction(oButton.handler)){oYUIButton.set("onclick",{fn:oButton.handler,obj:this,scope:this});}
else if(Lang.isObject(oButton.handler)&&Lang.isFunction(oButton.handler.fn)){oYUIButton.set("onclick",{fn:oButton.handler.fn,obj:((!Lang.isUndefined(oButton.handler.obj))?oButton.handler.obj:this),scope:(oButton.handler.scope||this)});}
this._aButtons[this._aButtons.length]=oYUIButton;}
else{oButtonEl=document.createElement("button");oButtonEl.setAttribute("type","button");if(oButton.isDefault){oButtonEl.className="default";this.defaultHtmlButton=oButtonEl;}
oButtonEl.innerHTML=oButton.text;if(Lang.isFunction(oButton.handler)){Event.on(oButtonEl,"click",oButton.handler,this,true);}
else if(Lang.isObject(oButton.handler)&&Lang.isFunction(oButton.handler.fn)){Event.on(oButtonEl,"click",oButton.handler.fn,((!Lang.isUndefined(oButton.handler.obj))?oButton.handler.obj:this),(oButton.handler.scope||this));}
oSpan.appendChild(oButtonEl);this._aButtons[this._aButtons.length]=oButtonEl;}
oButton.htmlButton=oButtonEl;if(i===0){this.firstButton=oButtonEl;}
if(i==(nButtons-1)){this.lastButton=oButtonEl;}}
this.setFooter(oSpan);oFooter=this.footer;if(Dom.inDocument(this.element)&&!Dom.isAncestor(oInnerElement,oFooter)){oInnerElement.appendChild(oFooter);}
this.buttonSpan=oSpan;}else{oSpan=this.buttonSpan;oFooter=this.footer;if(oSpan&&oFooter){oFooter.removeChild(oSpan);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}
this.cfg.refireEvent("iframe");this.cfg.refireEvent("underlay");},getButtons:function(){var aButtons=this._aButtons;if(aButtons){return aButtons;}},focusFirst:function(type,args,obj){var oElement=this.firstFormElement,oEvent;if(args){oEvent=args[1];if(oEvent){Event.stopEvent(oEvent);}}
if(oElement){try{oElement.focus();}
catch(oException){}}else{this.focusDefaultButton();}},focusLast:function(type,args,obj){var aButtons=this.cfg.getProperty("buttons"),oElement=this.lastFormElement,oEvent;if(args){oEvent=args[1];if(oEvent){Event.stopEvent(oEvent);}}
if(aButtons&&Lang.isArray(aButtons)){this.focusLastButton();}else{if(oElement){try{oElement.focus();}
catch(oException){}}}},focusDefaultButton:function(){var oElement=this.defaultHtmlButton;if(oElement){try{oElement.focus();}
catch(oException){}}},blurButtons:function(){var aButtons=this.cfg.getProperty("buttons"),nButtons,oButton,oElement,i;if(aButtons&&Lang.isArray(aButtons)){nButtons=aButtons.length;if(nButtons>0){i=(nButtons-1);do{oButton=aButtons[i];if(oButton){oElement=oButton.htmlButton;if(oElement){try{oElement.blur();}
catch(oException){}}}}
while(i--);}}},focusFirstButton:function(){var aButtons=this.cfg.getProperty("buttons"),oButton,oElement;if(aButtons&&Lang.isArray(aButtons)){oButton=aButtons[0];if(oButton){oElement=oButton.htmlButton;if(oElement){try{oElement.focus();}
catch(oException){}}}}},focusLastButton:function(){var aButtons=this.cfg.getProperty("buttons"),nButtons,oButton,oElement;if(aButtons&&Lang.isArray(aButtons)){nButtons=aButtons.length;if(nButtons>0){oButton=aButtons[(nButtons-1)];if(oButton){oElement=oButton.htmlButton;if(oElement){try{oElement.focus();}
catch(oException){}}}}}},configPostMethod:function(type,args,obj){var postmethod=args[0];this.registerForm();},validate:function(){return true;},submit:function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();this.hide();return true;}else{return false;}},cancel:function(){this.cancelEvent.fire();this.hide();},getData:function(){var oForm=this.form,aElements,nTotalElements,oData,sName,oElement,nElements,sType,sTagName,aOptions,nOptions,aValues,oOption,sValue,oRadio,oCheckbox,i,n;function isFormElement(p_oElement){var sTag=p_oElement.tagName.toUpperCase();return((sTag=="INPUT"||sTag=="TEXTAREA"||sTag=="SELECT")&&p_oElement.name==sName);}
if(oForm){aElements=oForm.elements;nTotalElements=aElements.length;oData={};for(i=0;i<nTotalElements;i++){sName=aElements[i].name;oElement=Dom.getElementsBy(isFormElement,"*",oForm);nElements=oElement.length;if(nElements>0){if(nElements==1){oElement=oElement[0];sType=oElement.type;sTagName=oElement.tagName.toUpperCase();switch(sTagName){case"INPUT":if(sType=="checkbox"){oData[sName]=oElement.checked;}
else if(sType!="radio"){oData[sName]=oElement.value;}
break;case"TEXTAREA":oData[sName]=oElement.value;break;case"SELECT":aOptions=oElement.options;nOptions=aOptions.length;aValues=[];for(n=0;n<nOptions;n++){oOption=aOptions[n];if(oOption.selected){sValue=oOption.value;if(!sValue||sValue===""){sValue=oOption.text;}
aValues[aValues.length]=sValue;}}
oData[sName]=aValues;break;}}
else{sType=oElement[0].type;switch(sType){case"radio":for(n=0;n<nElements;n++){oRadio=oElement[n];if(oRadio.checked){oData[sName]=oRadio.value;break;}}
break;case"checkbox":aValues=[];for(n=0;n<nElements;n++){oCheckbox=oElement[n];if(oCheckbox.checked){aValues[aValues.length]=oCheckbox.value;}}
oData[sName]=aValues;break;}}}}}
return oData;},destroy:function(){removeButtonEventHandlers.call(this);this._aButtons=null;var aForms=this.element.getElementsByTagName("form"),oForm;if(aForms.length>0){oForm=aForms[0];if(oForm){Event.purgeElement(oForm);this.body.removeChild(oForm);this.form=null;}}
Dialog.superclass.destroy.call(this);},toString:function(){return"Dialog "+this.id;}});}());(function(){YAHOO.widget.SimpleDialog=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,el,userConfig);};var Dom=YAHOO.util.Dom,SimpleDialog=YAHOO.widget.SimpleDialog,DEFAULT_CONFIG={"ICON":{key:"icon",value:"none",suppressEvent:true},"TEXT":{key:"text",value:"",suppressEvent:true,supercedes:["icon"]}};SimpleDialog.ICON_BLOCK="blckicon";SimpleDialog.ICON_ALARM="alrticon";SimpleDialog.ICON_HELP="hlpicon";SimpleDialog.ICON_INFO="infoicon";SimpleDialog.ICON_WARN="warnicon";SimpleDialog.ICON_TIP="tipicon";SimpleDialog.ICON_CSS_CLASSNAME="yui-icon";SimpleDialog.CSS_SIMPLEDIALOG="yui-simple-dialog";YAHOO.extend(SimpleDialog,YAHOO.widget.Dialog,{initDefaultConfig:function(){SimpleDialog.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.ICON.key,{handler:this.configIcon,value:DEFAULT_CONFIG.ICON.value,suppressEvent:DEFAULT_CONFIG.ICON.suppressEvent});this.cfg.addProperty(DEFAULT_CONFIG.TEXT.key,{handler:this.configText,value:DEFAULT_CONFIG.TEXT.value,suppressEvent:DEFAULT_CONFIG.TEXT.suppressEvent,supercedes:DEFAULT_CONFIG.TEXT.supercedes});},init:function(el,userConfig){SimpleDialog.superclass.init.call(this,el);this.beforeInitEvent.fire(SimpleDialog);Dom.addClass(this.element,SimpleDialog.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(userConfig){this.cfg.applyConfig(userConfig,true);}
this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(SimpleDialog);},registerForm:function(){SimpleDialog.superclass.registerForm.call(this);this.form.innerHTML+="<input type=\"hidden\" name=\""+
this.id+"\" value=\"\"/>";},configIcon:function(type,args,obj){var sIcon=args[0],oBody=this.body,sCSSClass=SimpleDialog.ICON_CSS_CLASSNAME,oIcon,oIconParent;if(sIcon&&sIcon!="none"){oIcon=Dom.getElementsByClassName(sCSSClass,"*",oBody);if(oIcon){oIconParent=oIcon.parentNode;if(oIconParent){oIconParent.removeChild(oIcon);oIcon=null;}}
if(sIcon.indexOf(".")==-1){oIcon=document.createElement("span");oIcon.className=(sCSSClass+" "+sIcon);oIcon.innerHTML="&#160;";}else{oIcon=document.createElement("img");oIcon.src=(this.imageRoot+sIcon);oIcon.className=sCSSClass;}
if(oIcon){oBody.insertBefore(oIcon,oBody.firstChild);}}},configText:function(type,args,obj){var text=args[0];if(text){this.setBody(text);this.cfg.refireEvent("icon");}},toString:function(){return"SimpleDialog "+this.id;}});}());(function(){YAHOO.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}
this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;};var Dom=YAHOO.util.Dom,CustomEvent=YAHOO.util.CustomEvent,Easing=YAHOO.util.Easing,ContainerEffect=YAHOO.widget.ContainerEffect;ContainerEffect.FADE=function(overlay,dur){var fade=new ContainerEffect(overlay,{attributes:{opacity:{from:0,to:1}},duration:dur,method:Easing.easeIn},{attributes:{opacity:{to:0}},duration:dur,method:Easing.easeOut},overlay.element);fade.handleStartAnimateIn=function(type,args,obj){Dom.addClass(obj.overlay.element,"hide-select");if(!obj.overlay.underlay){obj.overlay.cfg.refireEvent("underlay");}
if(obj.overlay.underlay){obj.initialUnderlayOpacity=$S(obj.overlay.underlay,"opacity");$SetStyle(obj.overlay.underlay,"filter",null);}
$SetStyle(obj.overlay.element,"visibility","visible");$SetStyle(obj.overlay.element,"opacity",0);};fade.handleCompleteAnimateIn=function(type,args,obj){Dom.removeClass(obj.overlay.element,"hide-select");if($S(obj.overlay.element,"filter")){$SetStyle(obj.overlay.element,"filter",null);}
if(obj.overlay.underlay){$SetStyle(obj.overlay.underlay,"opacity",obj.initialUnderlayOpacity);}
obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};fade.handleStartAnimateOut=function(type,args,obj){Dom.addClass(obj.overlay.element,"hide-select");if(obj.overlay.underlay){$SetStyle(obj.overlay.underlay,"filter",null);}};fade.handleCompleteAnimateOut=function(type,args,obj){Dom.removeClass(obj.overlay.element,"hide-select");if($S(obj.overlay.element,"filter")){$SetStyle(obj.overlay.element,"filter",null);}
$SetStyle(obj.overlay.element,"visibility","hidden");$SetStyle(obj.overlay.element,"opacity",1);obj.overlay.cfg.refireEvent("iframe");obj.animateOutCompleteEvent.fire();};fade.init();return fade;};ContainerEffect.SLIDE=function(overlay,dur){var x=overlay.cfg.getProperty("x")||Dom.getX(overlay.element),y=overlay.cfg.getProperty("y")||Dom.getY(overlay.element),clientWidth=Dom.getClientWidth(),offsetWidth=overlay.element.offsetWidth,slide=new ContainerEffect(overlay,{attributes:{points:{to:[x,y]}},duration:dur,method:Easing.easeIn},{attributes:{points:{to:[(clientWidth+25),y]}},duration:dur,method:Easing.easeOut},overlay.element,YAHOO.util.Motion);slide.handleStartAnimateIn=function(type,args,obj){$SetStyle(obj.overlay.element,"left",((-25)-offsetWidth)+"px");$SetStyle(obj.overlay.element,"top",y+"px");};slide.handleTweenAnimateIn=function(type,args,obj){var pos=Dom.getXY(obj.overlay.element),currentX=pos[0],currentY=pos[1];if($S(obj.overlay.element,"visibility")=="hidden"&&currentX<x){$SetStyle(obj.overlay.element,"visibility","visible");}
obj.overlay.cfg.setProperty("xy",[currentX,currentY],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateIn=function(type,args,obj){obj.overlay.cfg.setProperty("xy",[x,y],true);obj.startX=x;obj.startY=y;obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};slide.handleStartAnimateOut=function(type,args,obj){var vw=Dom.getViewportWidth(),pos=Dom.getXY(obj.overlay.element),yso=pos[1],currentTo=obj.animOut.attributes.points.to;obj.animOut.attributes.points.to=[(vw+25),yso];};slide.handleTweenAnimateOut=function(type,args,obj){var pos=Dom.getXY(obj.overlay.element),xto=pos[0],yto=pos[1];obj.overlay.cfg.setProperty("xy",[xto,yto],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateOut=function(type,args,obj){$SetStyle(obj.overlay.element,"visibility","hidden");obj.overlay.cfg.setProperty("xy",[x,y]);obj.animateOutCompleteEvent.fire();};slide.init();return slide;};ContainerEffect.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=CustomEvent.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=CustomEvent.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=CustomEvent.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=CustomEvent.LIST;this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);},animateIn:function(){this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();},handleStartAnimateIn:function(type,args,obj){},handleTweenAnimateIn:function(type,args,obj){},handleCompleteAnimateIn:function(type,args,obj){},handleStartAnimateOut:function(type,args,obj){},handleTweenAnimateOut:function(type,args,obj){},handleCompleteAnimateOut:function(type,args,obj){},toString:function(){var output="ContainerEffect";if(this.overlay){output+=" ["+this.overlay.toString()+"]";}
return output;}};YAHOO.lang.augmentProto(ContainerEffect,YAHOO.util.EventProvider);})();YAHOO.register("container",YAHOO.widget.Module,{version:"2.3.0",build:"442"});if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function()
{var Event=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function()
{this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(sMethod,args)
{for(var i in this.ids)
{for(var j in this.ids[i])
{var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD))
{continue;}
oDD[sMethod].apply(oDD,args);}}},_onLoad:function()
{this.init();Event.on(document,"mouseup",this.handleMouseUp,this,true);Event.on(document,"mousemove",this.handleMouseMove,this,true);Event.on(window,"unload",this._onUnload,this,true);Event.on(window,"resize",this._onResize,this,true);},_onResize:function(e)
{this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,moCacheElemXY:new Object(),startX:0,startY:0,regDragDrop:function(oDD,sGroup)
{if(!this.initialized){this.init();}
if(!this.ids[sGroup])
{this.ids[sGroup]={};}
this.ids[sGroup][oDD.id]=oDD;},removeDDFromGroup:function(oDD,sGroup)
{if(!this.ids[sGroup])
{this.ids[sGroup]={};}
var obj=this.ids[sGroup];if(obj&&obj[oDD.id])
{delete obj[oDD.id];}},_remove:function(oDD)
{for(var g in oDD.groups)
{if(g&&this.ids[g][oDD.id])
{delete this.ids[g][oDD.id];}}
delete this.handleIds[oDD.id];},regHandle:function(sDDId,sHandleId)
{if(!this.handleIds[sDDId])
{this.handleIds[sDDId]={};}
this.handleIds[sDDId][sHandleId]=sHandleId;},isDragDrop:function(id)
{return(this.getDDById(id))?true:false;},getRelated:function(p_oDD,bTargetsOnly)
{var oDDs=[];for(var i in p_oDD.groups)
{for(j in this.ids[i])
{var dd=this.ids[i][j];if(!this.isTypeOfDD(dd))
{continue;}
if(!bTargetsOnly||dd.isTarget)
{oDDs[oDDs.length]=dd;}}}
return oDDs;},isLegalTarget:function(oDD,oTargetDD)
{var targets=this.getRelated(oDD,true);for(var i=0,len=targets.length;i<len;++i)
{if(targets[i].id==oTargetDD.id)
{return true;}}
return false;},isTypeOfDD:function(oDD)
{return(oDD&&oDD.__ygDragDrop);},isHandle:function(sDDId,sHandleId)
{return(this.handleIds[sDDId]&&this.handleIds[sDDId][sHandleId]);},getDDById:function(id,_bDroppable)
{for(var i in this.ids)
{if(this.ids[i][id]&&(_bDroppable==undefined||((_bDroppable&&this.ids[i][id]instanceof DroppableItem)||(!_bDroppable&&this.ids[i][id]instanceof DraggableItem))))
{return this.ids[i][id];}}
return null;},handleMouseDown:function(e,oDD)
{this.currentTarget=YAHOO.util.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=YAHOO.util.Event.getPageX(e);this.startY=YAHOO.util.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function()
{var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX,DDM.startY);},this.clickTimeThresh);},startDrag:function(x,y)
{clearTimeout(this.clickTimeout);var dc=this.dragCurrent;if(dc)
{dc.b4StartDrag(x,y);}
if(dc)
{dc.startDrag(x,y);}
this.dragThreshMet=true;},handleMouseUp:function(e)
{if(this.dragCurrent)
{clearTimeout(this.clickTimeout);if(this.dragThreshMet)
{this.fireEvents(e,true);}else
{}
this.stopDrag(e);this.stopEvent(e);}},stopEvent:function(e)
{if(e!=null&&e.target!=null&&e.target.type!=null&&e.target.type=="application/x-shockwave-flash")
{return;}
if(this.stopPropagation)
{YAHOO.util.Event.stopPropagation(e);}
if(this.preventDefault)
{YAHOO.util.Event.preventDefault(e);}},stopDrag:function(e,silent)
{if(this.dragCurrent&&!silent)
{if(this.dragThreshMet)
{this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}
this.dragCurrent.onMouseUp(e);}
this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e)
{var dc=this.dragCurrent;if(dc)
{if(YAHOO.util.Event.isIE&&!e.button)
{this.stopEvent(e);return this.handleMouseUp(e);}
if(!this.dragThreshMet)
{var diffX=Math.abs(this.startX-YAHOO.util.Event.getPageX(e));var diffY=Math.abs(this.startY-YAHOO.util.Event.getPageY(e));if(diffX>this.clickPixelThresh||diffY>this.clickPixelThresh)
{this.startDrag(this.startX,this.startY);}}
var bStopEvent=true;if(this.dragThreshMet)
{dc.b4Drag(e);if(dc)
{dc.onDrag(e);}
if(dc)
{this.fireEvents(e,false);bStopEvent=false;}}
if(bStopEvent||!YAHOO.util.Event.isIE)this.stopEvent(e);else
{throw"ie hack to avoid over propagation bug";}}},fireEvents:function(e,isDrop)
{var dc=this.dragCurrent;if(!dc||dc.isLocked())
{return;}
var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var oldOvers=[];var outEvts=[];var overEvts=[];var dropEvts=[];var enterEvts=[];for(var i in this.dragOvers)
{var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo))
{continue;}
if(!this.isOverTarget(pt,ddo,this.mode,curRegion))
{outEvts.push(ddo);}
oldOvers[i]=true;delete this.dragOvers[i];}
for(var sGroup in dc.groups)
{if("string"!=typeof sGroup)
{continue;}
for(i in this.ids[sGroup])
{var oDD=this.ids[sGroup][i];if(!this.isTypeOfDD(oDD))
{continue;}
if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc)
{if(this.isOverTarget(pt,oDD,this.mode,curRegion))
{if(isDrop)
{dropEvts.push(oDD);}else
{if(!oldOvers[oDD.id])
{enterEvts.push(oDD);}else
{overEvts.push(oDD);}
this.dragOvers[oDD.id]=oDD;}}}}}
this.interactionInfo={out:outEvts,enter:enterEvts,over:overEvts,drop:dropEvts,point:pt,draggedRegion:curRegion,sourceRegion:this.locationCache[dc.id],validDrop:isDrop};if(isDrop&&!dropEvts.length)
{this.interactionInfo.validDrop=false;dc.onInvalidDrop(e);}
if(this.mode)
{if(outEvts.length)
{dc.b4DragOut(e,outEvts);if(dc)
{dc.onDragOut(e,outEvts);}}
if(enterEvts.length)
{if(dc)
{dc.onDragEnter(e,enterEvts);}}
if(overEvts.length)
{if(dc)
{dc.b4DragOver(e,overEvts);}
if(dc)
{dc.onDragOver(e,overEvts);}}
if(dropEvts.length)
{if(dc)
{dc.b4DragDrop(e,dropEvts);}
if(dc)
{dc.onDragDrop(e,dropEvts);}}}else
{var len=0;for(i=0,len=outEvts.length;i<len;++i)
{if(dc)
{dc.b4DragOut(e,outEvts[i].id);}
if(dc)
{dc.onDragOut(e,outEvts[i].id);}}
for(i=0,len=enterEvts.length;i<len;++i)
{if(dc)
{dc.onDragEnter(e,enterEvts[i].id);}}
for(i=0,len=overEvts.length;i<len;++i)
{if(dc)
{dc.b4DragOver(e,overEvts[i].id);}
if(dc)
{dc.onDragOver(e,overEvts[i].id);}}
dropEvts.sort(function(a,b)
{return b.miDropPriority-a.miDropPriority;});for(i=0,len=dropEvts.length;i<len;++i)
{if(dc)
{dc.b4DragDrop(e,dropEvts[i].id);}
if(dc)
{if(dc.onDragDrop(e,dropEvts[i].id))
{break;}}}}},getBestMatch:function(dds)
{var winner=null;var len=dds.length;if(len==1)
{winner=dds[0];}else
{for(var i=0;i<len;++i)
{var dd=dds[i];if(this.mode==this.INTERSECT&&dd.cursorIsOver)
{winner=dd;break;}else
{if(!winner||!winner.overlap||(dd.overlap&&winner.overlap.getArea()<dd.overlap.getArea()))
{winner=dd;}}}}
return winner;},refreshCache:function(groups)
{var g=groups||this.ids;for(var sGroup in g)
{if("string"!=typeof sGroup)
{continue;}
for(var i in this.ids[sGroup])
{var oDD=this.ids[sGroup][i];if(this.isTypeOfDD(oDD))
{var loc=this.getLocation(oDD);if(loc)
{this.locationCache[oDD.id]=loc;}else
{delete this.locationCache[oDD.id];}}}}},verifyEl:function(el)
{try
{if(el)
{var parent=el.offsetParent;if(parent)
{return true;}}}catch(e)
{}
return false;},getLocation:function(oDD)
{if(!this.isTypeOfDD(oDD))
{return null;}
var el=oDD.getEl(),pos,x1,x2,y1,y2,t,r,b,l;try
{pos=YAHOO.util.Dom.getXY(el);}catch(e){}
if(!pos)
{return null;}
x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);},isOverTarget:function(pt,oTarget,intersect,curRegion)
{var loc=this.locationCache[oTarget.id];if(!loc||!this.useCache)
{loc=this.getLocation(oTarget);this.locationCache[oTarget.id]=loc;}
if(!loc)
{return false;}
oTarget.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||(!intersect&&!dc.constrainX&&!dc.constrainY))
{return oTarget.cursorIsOver;}
oTarget.overlap=null;if(!curRegion)
{var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);}
var overlap=curRegion.intersect(loc);if(overlap)
{oTarget.overlap=overlap;return(intersect)?true:oTarget.cursorIsOver;}else
{return false;}},_onUnload:function(e,me)
{this.unregAll();},unregAll:function()
{if(this.dragCurrent)
{this.stopDrag();this.dragCurrent=null;}
this._execOnAll("unreg",[]);for(i in this.elementCache)
{delete this.elementCache[i];}
this.elementCache={};this.ids={};},elementCache:{},getElWrapper:function(id)
{var oWrapper=this.elementCache[id];if(!oWrapper||!oWrapper.el)
{oWrapper=this.elementCache[id]=new this.ElementWrapper(YAHOO.util.Dom.get(id));}
return oWrapper;},getElement:function(id)
{return YAHOO.util.Dom.get(id);},getCss:function(id)
{var el=YAHOO.util.Dom.get(id);return(el)?el.style:null;},ElementWrapper:function(el)
{this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el)
{return YAHOO.util.Dom.getX(el);},getPosY:function(el)
{return YAHOO.util.Dom.getY(el);},swapNode:function(n1,n2)
{if(n1.swapNode)
{n1.swapNode(n2);}else
{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1)
{p.insertBefore(n1,n2);}else if(n2==n1.nextSibling)
{p.insertBefore(n2,n1);}else
{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}},getScroll:function()
{var t,l,dde=document.documentElement,db=document.body;if(dde&&(dde.scrollTop||dde.scrollLeft))
{t=dde.scrollTop;l=dde.scrollLeft;}else if(db)
{t=db.scrollTop;l=db.scrollLeft;}else
{}
return{top:t,left:l};},getStyle:function(el,styleProp)
{return YAHOO.util.Dom.getStyle(el,styleProp);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(moveEl,targetEl)
{var aCoord=YAHOO.util.Dom.getXY(targetEl);YAHOO.util.Dom.setXY(moveEl,aCoord);},getClientHeight:function()
{return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function()
{return YAHOO.util.Dom.getViewportWidth();},numericSort:function(a,b){return(a-b);},_timeoutCount:0,_addListeners:function()
{var DDM=YAHOO.util.DDM;if(YAHOO.util.Event&&document)
{DDM._onLoad();}else
{if(DDM._timeoutCount>2000)
{}else
{setTimeout(DDM._addListeners,10);if(document&&document.body)
{DDM._timeoutCount+=1;}}}},handleWasClicked:function(node,id)
{if(this.isHandle(id,node.id))
{return true;}else
{var p=node.parentNode;while(p)
{if(this.isHandle(id,p.id))
{return true;}else
{p=p.parentNode;}}}
return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}
(function(){var Event=YAHOO.util.Event;var Dom=YAHOO.util.Dom;YAHOO.util.DragDrop=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=Dom.get(this.id);}
return this._domRef;},getDragEl:function(){return Dom.get(this.dragElId);},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);Event.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,sGroup,config){this.config=config||{};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof id!=="string"){this._domRef=id;id=Dom.generateId(id);}
this.id=id;this.addToGroup((sGroup)?sGroup:"default");this.handleElId=id;Event.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(iTop,iRight,iBot,iLeft){if(!iRight&&0!==iRight){this.padding=[iTop,iTop,iTop,iTop];}else if(!iBot&&0!==iBot){this.padding=[iTop,iRight,iTop,iRight];}else{this.padding=[iTop,iRight,iBot,iLeft];}},setInitPosition:function(diffX,diffY){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}
var dx=diffX||0;var dy=diffY||0;var p;if(DDM.moCacheElemXY)
{if(!(el.id in DDM.moCacheElemXY))
{DDM.moCacheElemXY[el.id]=Dom.getXY(el);DragDropMgr.mbIsReorder=false;}
p=DDM.moCacheElemXY[el.id];}
else
{p=Dom.getXY(el);}
this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||Dom.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(sGroup){this.groups[sGroup]=true;this.DDM.regDragDrop(this,sGroup);},removeFromGroup:function(sGroup){if(this.groups[sGroup]){delete this.groups[sGroup];}
this.DDM.removeDDFromGroup(this,sGroup);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
Event.on(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var button=e.which||e.button;if(this.primaryButtonOnly&&button>1){return;}
if(this.isLocked()){return;}
this.b4MouseDown(e);this.onMouseDown(e);this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(Event.getPageX(e),Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var target=Event.getTarget(e);return(this.isValidHandleChild(target)&&(this.id==this.handleElId||this.DDM.handleWasClicked(target,this.id)));},getTargetCoord:function(iPageX,iPageY){var x=iPageX-this.deltaX;var y=iPageY-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}
if(x>this.maxX){x=this.maxX;}}
if(this.constrainY){if(y<this.minY){y=this.minY;}
if(y>this.maxY){y=this.maxY;}}
x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};},addInvalidHandleType:function(tagName){var type=tagName.toUpperCase();this.invalidHandleTypes[type]=type;},addInvalidHandleId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(cssClass){this.invalidHandleClasses.push(cssClass);},removeInvalidHandleType:function(tagName){var type=tagName.toUpperCase();delete this.invalidHandleTypes[type];},removeInvalidHandleId:function(id){if(typeof id!=="string"){id=Dom.generateId(id);}
delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(cssClass){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==cssClass){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(node){var valid=true;var nodeName;try{nodeName=node.nodeName.toUpperCase();}catch(e){nodeName=node.nodeName;}
valid=valid&&!this.invalidHandleTypes[nodeName];valid=valid&&!this.invalidHandleIds[node.id];for(var i=0,len=this.invalidHandleClasses.length;valid&&i<len;++i){valid=!Dom.hasClass(node,this.invalidHandleClasses[i]);}
return valid;},setXTicks:function(iStartX,iTickSize){this.xTicks=[];this.xTickSize=iTickSize;var tickMap={};for(var i=this.initPageX;i>=this.minX;i=i-iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}
this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(iStartY,iTickSize){this.yTicks=[];this.yTickSize=iTickSize;var tickMap={};for(var i=this.initPageY;i>=this.minY;i=i-iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}
this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(iLeft,iRight,iTickSize){this.leftConstraint=parseInt(iLeft,10);this.rightConstraint=parseInt(iRight,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(iTickSize){this.setXTicks(this.initPageX,iTickSize);}
this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,iDown,iTickSize){this.topConstraint=parseInt(iUp,10);this.bottomConstraint=parseInt(iDown,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(iTickSize){this.setYTicks(this.initPageY,iTickSize);}
this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}
if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}
if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,tickArray){if(!tickArray){return val;}else if(tickArray[0]>=val){return tickArray[0];}else{for(var i=0,len=tickArray.length;i<len;++i){var next=i+1;if(tickArray[next]&&tickArray[next]>=val){var diff1=val-tickArray[i];var diff2=tickArray[next]-val;return(diff2>diff1)?tickArray[i]:tickArray[next];}}
return tickArray[tickArray.length-1];}},toString:function(){return("DragDrop "+this.id);}};})();YAHOO.util.DD=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(iPageX,iPageY){var x=iPageX-this.startPageX;var y=iPageY-this.startPageY;this.setDelta(x,y);},setDelta:function(iDeltaX,iDeltaY){this.deltaX=iDeltaX;this.deltaY=iDeltaY;},setDragElPos:function(iPageX,iPageY){var el=this.getDragEl();this.alignElWithMouse(el,iPageX,iPageY);},alignElWithMouse:function(el,iPageX,iPageY){var oCoord=this.getTargetCoord(iPageX,iPageY);if(!this.deltaSetXY){var aCoord=[oCoord.x,oCoord.y];YAHOO.util.Dom.setXY(el,aCoord);var newLeft=parseInt($S(el,"left"),10);var newTop=parseInt($S(el,"top"),10);this.deltaSetXY=[newLeft-oCoord.x,newTop-oCoord.y];}else{$SetStyle(el,"left",(oCoord.x+this.deltaSetXY[0])+"px");$SetStyle(el,"top",(oCoord.y+this.deltaSetXY[1])+"px");}
this.cachePosition(oCoord.x,oCoord.y);this.autoScroll(oCoord.x,oCoord.y,el.offsetHeight,el.offsetWidth);},cachePosition:function(iPageX,iPageY){if(iPageX){this.lastPageX=iPageX;this.lastPageY=iPageY;}else{var aCoord=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var clientH=this.DDM.getClientHeight();var clientW=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot<thresh){window.scrollTo(sl,st+scrAmt);}
if(y<st&&st>0&&y-st<thresh){window.scrollTo(sl,st-scrAmt);}
if(right>clientW&&toRight<thresh){window.scrollTo(sl+scrAmt,st);}
if(x<sl&&sl>0&&x-sl<thresh){window.scrollTo(sl-scrAmt,st);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},b4Drag:function(e){this.setDragElPos(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(id,sGroup,config){if(id){this.init(id,sGroup,config);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this,body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}
var div=this.getDragEl(),Dom=YAHOO.util.Dom;if(!div){div=document.createElement("div");div.id=this.dragElId;var s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;s.height="25px";s.width="25px";var _data=document.createElement('div');$SetStyle(_data,'height','100%');$SetStyle(_data,'width','100%');$SetStyle(_data,'backgroundColor','#ccc');$SetStyle(_data,'opacity','0');div.appendChild(_data);body.insertBefore(div,body.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(iPageX,iPageY){var el=this.getEl();var dragEl=this.getDragEl();var s=dragEl.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}
this.setDragElPos(iPageX,iPageY);$SetStyle(dragEl,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var DOM=YAHOO.util.Dom;var el=this.getEl();var dragEl=this.getDragEl();var bt=parseInt($S(dragEl,"borderTopWidth"),10);var br=parseInt($S(dragEl,"borderRightWidth"),10);var bb=parseInt($S(dragEl,"borderBottomWidth"),10);var bl=parseInt($S(dragEl,"borderLeftWidth"),10);if(isNaN(bt)){bt=0;}
if(isNaN(br)){br=0;}
if(isNaN(bb)){bb=0;}
if(isNaN(bl)){bl=0;}
var newWidth=Math.max(0,el.offsetWidth-br-bl);var newHeight=Math.max(0,el.offsetHeight-bt-bb);$SetStyle(dragEl,"width",newWidth+"px");$SetStyle(dragEl,"height",newHeight+"px");}},b4MouseDown:function(e){this.setStartPosition();var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){$SetStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(e){var DOM=YAHOO.util.Dom;var lel=this.getEl();var del=this.getDragEl();$SetStyle(del,"visibility","");$SetStyle(lel,"visibility","hidden");YAHOO.util.DDM.moveToEl(lel,del);$SetStyle(del,"visibility","hidden");$SetStyle(lel,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(id,sGroup,config){if(id){this.initTarget(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.3.0",build:"442"});YAHOO.widget.ImageCropper=function(img,config){var YD=YAHOO.util.Dom;var YE=YAHOO.util.Event;var YL=YAHOO.lang;var _self=this;var _outerElem;var _cropElem;var _initialized=false;var _loadTimer;function _getPixelBorderWidth(el,border){var p,s,value;if(YAHOO.env.ua.ie){switch(border){case"top":value=el.clientTop;break;case"right":value=el.offsetWidth-el.clientWidth-el.clientLeft;break;case"bottom":value=el.offsetHeight-el.clientHeight-el.clientTop;break;case"left":value=el.clientLeft;break;default:throw new Error("Invalid border: "+border);}}else{switch(border){case"top":p="borderTopWidth";break;case"right":p="borderRightWidth";break;case"bottom":p="borderBottomWidth";break;case"left":p="borderLeftWidth";break;default:throw new Error("Invalid border: "+border);}
s=$S(el,p);value=parseInt(s,10);}
return value;}
function _getGeometry(el){var ol,ot,blw,btw,pblw,pbtw;blw=_getPixelBorderWidth(el,"left");btw=_getPixelBorderWidth(el,"top");ol=el.offsetLeft+blw;ot=el.offsetTop+btw;if(YAHOO.env.ua.gecko||YAHOO.env.ua.opera){pblw=_getPixelBorderWidth(el.offsetParent,"left");pbtw=_getPixelBorderWidth(el.offsetParent,"top");if(YAHOO.env.ua.gecko){ol+=pblw;ot+=pbtw;}else if(YAHOO.env.ua.opera){ol-=pblw;ot-=pbtw;}}
return{x:ol,y:ot,w:el.clientWidth,h:el.clientHeight};}
function _setGeometry(el,x,y,w,h){var p,d;$SetStyle(el,"position","absolute");$SetStyle(el,"left",x+"px");$SetStyle(el,"top",y+"px");$SetStyle(el,"width",w+"px");$SetStyle(el,"height",h+"px");p=_getGeometry(el);d=p.x-x;if(d!==0&&x>d){$SetStyle(el,"left",(x-d)+"px");}
d=p.y-y;if(d!==0&&y>d){$SetStyle(el,"top",(y-d)+"px");}
d=p.w-w;if(d!==0&&w>d){$SetStyle(el,"width",(w-d)+"px");}
d=p.h-h;if(d!==0&&h>d){$SetStyle(el,"height",(h-d)+"px");}}
function _init(){var mask,x,y,w,h,r,p,dd;if(_initialized){return;}
$SetStyle(img,"width","auto");$SetStyle(img,"height","auto");_outerElem=document.createElement("DIV");_outerElem.className="image-cropper";img.parentNode.replaceChild(_outerElem,img);_outerElem.appendChild(img);mask=document.createElement("DIV");mask.className="ICMask";$SetStyle(mask,"width",img.clientWidth+"px");$SetStyle(mask,"height",img.clientHeight+"px");_outerElem.appendChild(mask);_cropElem=document.createElement("DIV");_cropElem.className="cropper";$SetStyle(_cropElem,"background","url("+img.src+")");_outerElem.appendChild(_cropElem);if(config){w=config.w;h=config.h;x=config.x;y=config.y;r=config.xyratio;}
if(!YL.isNumber(w)||w<0||w>img.clientWidth){w=Math.floor(img.clientWidth/3);}
if(YL.isNumber(r)&&r>0){h=r*w;}
if(!YL.isNumber(h)||h<0||h>img.clientHeight){h=Math.floor(img.clientHeight/3);}
if(!YL.isNumber(x)||x<0||x+w>img.clientWidth){x=(img.clientWidth-w)/2;}
if(!YL.isNumber(y)||y<0||y+h>img.clientHeight){y=(img.clientHeight-h)/2;}
_setGeometry(_cropElem,x,y,w,h);p=_getGeometry(_cropElem);$SetStyle(_cropElem,"backgroundPosition",(-p.x)+"px "+(-p.y)+"px");if(!config||config.noresize!==true){_createHooks();}
dd=new YAHOO.util.DD(_cropElem);dd.scroll=false;dd.startDrag=function(){p=_getGeometry(_cropElem);this.resetConstraints();this.setXConstraint(p.x,img.clientWidth-p.x-p.w);this.setYConstraint(p.y,img.clientHeight-p.y-p.h);};dd.onDrag=function(evt){p=_getGeometry(_cropElem);$SetStyle(_cropElem,"backgroundPosition",(-p.x)+"px "+(-p.y)+"px");};dd.endDrag=function(evt){_self.onChangeEvent.fire();};_initialized=true;}
function _createHooks(){var i,hook,dd,mouseX,mouseY,obj;for(i=0;i<4||(!config||!YL.isNumber(config.xyratio)||config.xyratio<=0)&&i<8;i++){hook=document.createElement("DIV");_cropElem.appendChild(hook);switch(i){case 0:YD.addClass(hook,"t");YD.addClass(hook,"l");break;case 1:YD.addClass(hook,"t");YD.addClass(hook,"r");break;case 2:YD.addClass(hook,"b");YD.addClass(hook,"l");break;case 3:YD.addClass(hook,"b");YD.addClass(hook,"r");break;case 4:YD.addClass(hook,"t");YD.addClass(hook,"c");break;case 5:YD.addClass(hook,"m");YD.addClass(hook,"r");break;case 6:YD.addClass(hook,"b");YD.addClass(hook,"c");break;case 7:YD.addClass(hook,"m");YD.addClass(hook,"l");break;}
dd=new YAHOO.util.DD(hook);dd.scroll=false;dd.alignElWithMouse=function(el,iPageX,iPageY){};dd.startDrag=function(x,y){obj=_getGeometry(_cropElem);mouseX=x;mouseY=y;};dd.onDrag=function(evt){var dx,dy,x,y,w,r,h,p;dx=YE.getPageX(evt)-mouseX;dy=YE.getPageY(evt)-mouseY;hook=this.getEl();if(YD.hasClass(hook,"l")){if(dx<0){dx=Math.max(-obj.x,dx);}else{dx=Math.min(obj.w,dx);}
x=obj.x+dx;w=obj.w-dx;}else if(YD.hasClass(hook,"r")){if(dx<0){dx=Math.max(-obj.w,dx);}else{dx=Math.min(img.clientWidth-obj.x-obj.w,dx);}
x=obj.x;w=obj.w+dx;}else{dx=0;x=obj.x;w=obj.w;}
if(YD.hasClass(hook,"t")){if(dy<0){dy=Math.max(-obj.y,dy);}else{dy=Math.min(obj.h,dy);}
y=obj.y+dy;h=obj.h-dy;}else if(YD.hasClass(hook,"b")){if(dy<0){dy=Math.max(-obj.h,dy);}else{dy=Math.min(img.clientHeight-obj.y-obj.h,dy);}
y=obj.y;h=obj.h+dy;}else{dy=0;y=obj.y;h=obj.h;}
if(config&&YL.isNumber(config.xyratio)&&config.xyratio>0){r=config.xyratio;h=Math.floor(w*r);if(YD.hasClass(hook,"t")){y=obj.y+obj.h-h;if(y<0){y=0;dy=-obj.y;h=obj.h-dy;w=Math.floor(h/r);if(YD.hasClass(hook,"l")){dx=Math.floor(-dy/r);x=obj.x-dx;}}}else{if(y+h>img.clientHeight){h=img.clientHeight-y;w=Math.floor(h/r);if(YD.hasClass(hook,"l")){dy=h-obj.h;dx=Math.floor(dy/r);x=obj.x-dx;}}}}
_setGeometry(_cropElem,x,y,w,h);p=_getGeometry(_cropElem);$SetStyle(_cropElem,"backgroundPosition",(-p.x)+"px "+(-p.y)+"px");};dd.endDrag=function(evt){_self.onChangeEvent.fire();};}}
this.onChangeEvent=new YAHOO.util.CustomEvent("onChange");this.getCropRegion=function(){return _getGeometry(_cropElem);};this.IsInitialized=function()
{return _initialized;};this.setCropRegion=function(x,y,w,h){_setGeometry(_cropElem,x,y,w,h);p=_getGeometry(_cropElem);$SetStyle(_cropElem,"backgroundPosition",(-p.x)+"px "+(-p.y)+"px");};img=YD.get(img);if(!img||img.tagName!=="IMG"||config&&!YL.isObject(config)){throw new Error("Invalid argument");}
if(YAHOO.env.ua.webkit){_loadTimer=setInterval(function(){if(img.width!==0||img.height!==0){clearInterval(_loadTimer);_init();}},100);}else if(!img.complete||img.naturalWidth===0){YE.addListener(img,"load",_init);}else{_init();}};YAHOO.namespace("lang");YAHOO.lang.JSON={_ESCAPES:/\\["\\\/bfnrtu]/g,_VALUES:/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS:/(?:^|:|,)(?:\s*\[)+/g,_INVALID:/^[\],:{}\s]*$/,_SPECIAL_CHARS:/["\\\x00-\x1f\x7f-\x9f]/g,_PARSE_DATE:/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/,_CHARS:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},_applyFilter:function(C,B){var A=function(E,D){var F,G;if(D&&typeof D==="object"){for(F in D){if(YAHOO.lang.hasOwnProperty(D,F)){G=A(F,D[F]);if(G===undefined){delete D[F];}else{D[F]=G;}}}}return B(E,D);};if(YAHOO.lang.isFunction(B)){A("",C);}return C;},isValid:function(A){if(!YAHOO.lang.isString(A)){return false;}return this._INVALID.test(A.replace(this._ESCAPES,"@").replace(this._VALUES,"]").replace(this._BRACKETS,""));},dateToString:function(B){function A(C){return C<10?"0"+C:C;}return'"'+B.getUTCFullYear()+"-"+A(B.getUTCMonth()+1)+"-"+A(B.getUTCDate())+"T"+A(B.getUTCHours())+":"+A(B.getUTCMinutes())+":"+A(B.getUTCSeconds())+'Z"';},stringToDate:function(B){if(this._PARSE_DATE.test(B)){var A=new Date();A.setUTCFullYear(RegExp.$1,(RegExp.$2|0)-1,RegExp.$3);A.setUTCHours(RegExp.$4,RegExp.$5,RegExp.$6);return A;}},parse:function(s,filter){if(this.isValid(s)){return this._applyFilter(eval("("+s+")"),filter);}throw new SyntaxError("parseJSON");},stringify:function(C,K,F){var E=YAHOO.lang,H=E.JSON,D=H._CHARS,A=this._SPECIAL_CHARS,B=[];var I=function(N){if(!D[N]){var J=N.charCodeAt();D[N]="\\u00"+Math.floor(J/16).toString(16)+(J%16).toString(16);}return D[N];};var M=function(J){return'"'+J.replace(A,I)+'"';};var L=H.dateToString;var G=function(J,T,R){var W=typeof J,P,Q,O,N,U,V,S;if(W==="string"){return M(J);}if(W==="boolean"||J instanceof Boolean){return String(J);}if(W==="number"||J instanceof Number){return isFinite(J)?String(J):"null";}if(J instanceof Date){return L(J);}if(E.isArray(J)){for(P=B.length-1;P>=0;--P){if(B[P]===J){return"null";}}B[B.length]=J;S=[];if(R>0){for(P=J.length-1;P>=0;--P){S[P]=G(J[P],T,R-1)||"null";}}B.pop();return"["+S.join(",")+"]";}if(W==="object"){if(!J){return"null";}for(P=B.length-1;P>=0;--P){if(B[P]===J){return"null";}}B[B.length]=J;S=[];if(R>0){if(T){for(P=0,O=0,Q=T.length;P<Q;++P){if(typeof T[P]==="string"){U=G(J[T[P]],T,R-1);if(U){S[O++]=M(T[P])+":"+U;}}}}else{O=0;for(N in J){if(typeof N==="string"&&E.hasOwnProperty(J,N)){U=G(J[N],T,R-1);if(U){S[O++]=M(N)+":"+U;}}}}}B.pop();return"{"+S.join(",")+"}";}return undefined;};F=F>=0?F:1/0;return G(C,K,F);}};YAHOO.register("json",YAHOO.lang.JSON,{version:"2.5.2",build:"1076"});function Collection(){this.moCollectionToVForm=new Object();this.moVFormToCollection=new Object();}
Collection.prototype={Add:function(_sCollectionID,_sVFormID)
{var bResult=false;var bParameters=true;if(!YAHOO.lang.isString(_sCollectionID))
{bParameters=false;}
if(!YAHOO.lang.isString(_sVFormID))
{bParameters=false;}
if(bParameters)
{if(!(_sCollectionID in this.moCollectionToVForm))
{this.moCollectionToVForm[_sCollectionID]=new FastArray();}
if(!(_sVFormID in this.moVFormToCollection))
{this.moVFormToCollection[_sVFormID]=new FastArray();}
if(this.moCollectionToVForm[_sCollectionID].PushIfNotExists(_sVFormID)&&this.moVFormToCollection[_sVFormID].PushIfNotExists(_sCollectionID))
{bResult=true;}}
return bResult;},GetVFormIndexes:function(_sVFormID)
{var bParameters=true;var oHash=null;if(!YAHOO.lang.isString(_sVFormID))
{bParameters=false;}
if(bParameters)
{oHash=new Object();if(_sVFormID in this.moVFormToCollection)
{var aoCollections=this.moVFormToCollection[_sVFormID].GetArray();for(var i=0;i<aoCollections.length;i++)
{var sCollection=aoCollections[i];oHash[sCollection]=this.moCollectionToVForm[sCollection].GetIndex(_sVFormID).toString();}}}
return oHash;},GetVFormList:function(_sCollectionID)
{var bParameters=true;var oList=null;if(!YAHOO.lang.isString(_sCollectionID))
{bParameters=false;}
if(bParameters)
{if(_sCollectionID in this.moCollectionToVForm)
{oList=this.moCollectionToVForm[_sCollectionID].GetArray();}
else if(_sCollectionID=="")
{oList=new Array();for(var sVFormId in Matrix3.moVFormTable)
{oList.push(sVFormId);}}
else
{oList=new Array();}}
return oList;},IsVFormInCollection:function(_sVFormID,_sCollectionID)
{var bResult=false;var bParameters=true;if(!YAHOO.lang.isString(_sVFormID))
{bParameters=false;}
if(!YAHOO.lang.isString(_sCollectionID))
{bParameters=false;}
if(bParameters)
{if(_sCollectionID in this.moCollectionToVForm)
{bResult=this.moCollectionToVForm[_sCollectionID].Exists(_sVFormID);}}
else if(_sCollectionID=="")
{bResult=true;}
return bResult;}};function EventItem(_sSourceVForm,_sSourceEvent,_sSourceType,_sTargetVForm,_sTargetEvent,_sTargetType,_sEventDelay){if(YAHOO.lang.isString(_sSourceVForm))
{this.msSourceVForm=_sSourceVForm;}
else
{this.msSourceVForm=null;}
if(YAHOO.lang.isString(_sSourceEvent)||_sSourceEvent==null)
{this.msSourceEvent=_sSourceEvent;}
else
{this.msSourceEvent=null;}
if(YAHOO.lang.isString(_sSourceType)&&(_sSourceType==Matrix3.Const.RETURNTYPE_FULL||_sSourceType==Matrix3.Const.RETURNTYPE_VIEWSTATE))
{this.msSourceType=_sSourceType;}
else
{this.msSourceType=null;}
if(YAHOO.lang.isString(_sTargetVForm)||_sTargetVForm==null)
{this.msTargetVForm=_sTargetVForm;}
else
{this.msTargetVForm=null;}
if(YAHOO.lang.isString(_sTargetEvent)||_sTargetEvent==null)
{this.msTargetEvent=_sTargetEvent;}
else
{this.msTargetEvent=null;}
if((YAHOO.lang.isString(_sTargetType)&&(_sTargetType==Matrix3.Const.RETURNTYPE_FULL||_sTargetType==Matrix3.Const.RETURNTYPE_VIEWSTATE))||_sTargetType==null)
{this.msTargetType=_sTargetType;}
else
{this.msTargetType=null;}
if(YAHOO.lang.isString(_sEventDelay)&&(_sEventDelay==Matrix3.Const.DELAY_BUFFERED||_sEventDelay==Matrix3.Const.DELAY_IMMEDIAT))
{this.msEventDelay=_sEventDelay;}
else
{this.msEventDelay=null;}}
EventItem.Const={SEPARATOR:"|",SOURCE_VFORM:"SVF",SOURCE_EVENT:"SE",SOURCE_TYPE:"SRT",TARGET_VFORM:"TVF",TARGET_VFORM_SUB_ID:"TVFS",TARGET_EVENT:"TE",TARGET_TYPE:"TRT",DELAY:"D"}
EventItem.CreateID=function(_sSourceVForm,_sSourceEvent,_sTargetVForm,_sTargetEvent)
{var sResult=null;if(YAHOO.lang.isString(_sSourceVForm)&&(_sSourceEvent==null||YAHOO.lang.isString(_sSourceEvent))&&(_sTargetVForm==null||YAHOO.lang.isString(_sTargetVForm))&&(_sTargetEvent==null||YAHOO.lang.isString(_sTargetEvent)))
{sResult=_sSourceVForm;if(_sSourceEvent!=null)
{sResult+=EventItem.Const.SEPARATOR+_sSourceEvent;}
if(_sTargetVForm!=null)
{sResult+=EventItem.Const.SEPARATOR+_sTargetVForm;}
if(_sTargetEvent!=null)
{sResult+=EventItem.Const.SEPARATOR+_sTargetEvent;}}
else
{}
return sResult;};EventItem.prototype={GetSourceVForm:function()
{return this.msSourceVForm;},GetSourceType:function()
{return this.msSourceType;},GetTargetVForm:function()
{return this.msTargetVForm;},GetTargetType:function()
{return this.msTargetType;},GetID:function()
{return EventItem.CreateID(this.msSourceVForm,this.msSourceEvent,this.msTargetVForm,this.msTargetEvent);},GetObjectToSerialize:function()
{var oHash=new Object();if(YAHOO.lang.isString(this.msSourceVForm))
{oHash[EventItem.Const.SOURCE_VFORM]=this.msSourceVForm;}
if(YAHOO.lang.isString(this.msSourceEvent))
{oHash[EventItem.Const.SOURCE_EVENT]=this.msSourceEvent;}
if(YAHOO.lang.isString(this.msTargetVForm))
{oHash[EventItem.Const.TARGET_VFORM]=this.msTargetVForm;oHash[EventItem.Const.TARGET_VFORM_SUB_ID]=this.GetSubID(this.msTargetVForm);}
if(YAHOO.lang.isString(this.msTargetEvent))
{oHash[EventItem.Const.TARGET_EVENT]=this.msTargetEvent;}
if(YAHOO.lang.isString(this.msEventDelay))
{oHash[EventItem.Const.DELAY]=this.msEventDelay;}
return oHash;},GetSubID:function(_sVFormID)
{var sResult=null;var oVFormInfoItem=Matrix3.GetVFormInfoItem(_sVFormID);if(oVFormInfoItem)
{sResult=oVFormInfoItem.GetSubID();}
return sResult;}};function EventTable(){this.moEventList=new Array();this.moEventTable=new Object();}
EventTable.prototype={AddEventItem:function(_oEventItem)
{var bResult=false;if(_oEventItem instanceof EventItem)
{this.moEventList.push(_oEventItem);this.moEventTable[_oEventItem.GetID()]=this.moEventList.length-1;bResult=true;}
else
{}
return bResult;},Merge:function(_oEventTable)
{var bResult=false;if(_oEventTable instanceof EventTable)
{var oEventList=_oEventTable.GetEventList();for(var i=0;i<oEventList.length;i++)
{var oItem=oEventList[i];if(oItem.GetID()in this.moEventTable)
{this.moEventList.splice(this.moEventTable[oItem.GetID()],1);for(var j=0;j<this.moEventList.length;j++)
{this.moEventTable[this.moEventList[j].GetID()]=j;}}
this.moEventList.push(oItem);}
for(var i=0;i<this.moEventList.length;i++)
{this.moEventTable[this.moEventList[i].GetID()]=i;}}
else
{}
return bResult;},GetEventList:function()
{return this.moEventList;},Serialize:function()
{var oTempArray=new Array();for(var i=0;i<this.moEventList.length;i++)
{oTempArray.push(this.moEventList[i].GetObjectToSerialize());}
var sResult=JSON.stringify(oTempArray);return sResult;}};var Matrix3={Init:function()
{try
{this.AddLoading();this.AddPositioning();this.mbContentIsLoaded=true;this.moEventTable=new EventTable();this.moTriggerTable=new TriggerTable();this.moVFormTable=new Object();this.moPopupTable=new Object();this.moCollection=new Collection();this.miVersion=null;this.msScript="";this.msWaitMsg="";this.maPrePositionCalls=new Array();this.miReloadTimeout;this.moEffects=new Object();this.mbIsInit=true;this.mbEvent=false;this.mbModal=true;this.maNodeToExtract=new Array();var oXML=document.createElement("div");var oViewState=$(Matrix3.Const.HIDDENFIELDS);oXML.appendChild(oViewState);var oVForms=$(Matrix3.Const.LAYER_VFORMS);if(oVForms)
{var oNodes=new Array();var oChildren=oVForms.childNodes;for(var i=0;i<oChildren.length;i++)
{oNodes.push(oChildren[i]);}
for(var i=0;i<oNodes.length;i++)
{oXML.appendChild(oNodes[i]);}}
ResizeMgr.GetInstance().ExportScreenToLists();ControlMgr.GetInstance().CreateControl(null);if(!YAHOO.env.ua.ie)
{CacheMgr.GetInstance().LoadCache();}
var oVFormTable=Matrix3.PreRender(oXML);Matrix3.Render(oVFormTable);YAHOO.util.Event.addListener(document,"keydown",this.KeyPressCallback,this,true);this.msLastViewportSize=Utils.GetViewportWidth()+"x"+Utils.GetViewportHeight();Utils.AddEvent(window,"resize",function()
{var sNewViewportSize=Utils.GetViewportWidth()+"x"+Utils.GetViewportHeight();if(sNewViewportSize!=Matrix3.msLastViewportSize)
{Matrix3.msLastViewportSize=sNewViewportSize;YAHOO.util.DragDropMgr.refreshCache();YAHOO.util.Connect.asyncRequest("GET","htm/Resolution.aspx?W="+Utils.GetViewportWidth()+"&H="+Utils.GetViewportHeight(),null,null);var bHasPopup=false;for(var sPopupId in Matrix3.moPopupTable)
{bHasPopup=true;break;}
if(!bHasPopup&&!Matrix3.mbBlockReloadOnResize)
{if(Matrix3.miReloadTimeout)
{clearTimeout(Matrix3.miReloadTimeout);}
Matrix3.miReloadTimeout=setTimeout(function(){window.location.href=Matrix3.msURL},500);}}});Utils.AddEvent(window,"mousemove",function(e){Utils.GetMousePosition(e);});HistoryMgr.GetInstance().Init();YAHOO.util.DragDropMgr.clickPixelThresh=4;}
catch(e)
{this.LogError(e);}},GetTriggerTable:function()
{return this.moTriggerTable;},GetSelectGroupCommandEventTable:function(_sSourceVForm,_sSourceEvent,_sSourceType,_sTargetType,_sEventDelay,_sCommandArgs)
{var oEventTable=new EventTable();var asGroups=_sCommandArgs.split(',');for(var i=0;i<asGroups.length;i++)
{var sGroup=asGroups[i].trim();if(sGroup!="")
{var aoSelected=MultipleSelectionMgr.GetInstance().GetObjects(sGroup,MultipleSelectionMgr.Const.FLAG_SELECTED);var aoArgs=new Array();if(aoSelected!=null)
{for(var i=0;i<aoSelected.length;i++)
{var oArg=new Object();var oSelected=aoSelected[i];var sTargetID=oSelected.GetID();var asTargetID=sTargetID.split(Matrix3.Const.SEPARATOR_CONTROL);oArg[Matrix3.Const.ARG_VFORMID]=asTargetID[0];var sControlID=null;if(asTargetID.length>0)
{oArg[Matrix3.Const.ARG_CONTROL]=asTargetID[1];}
var sGroup=null;var oFastArray=null;if(sTargetID in MultipleSelectionMgr.GetInstance().moSelectionItemGroups)
{oFastArray=MultipleSelectionMgr.GetInstance().moSelectionItemGroups[sTargetID];if(oFastArray!=null)
{var asArray=oFastArray.GetArray();if(asArray.length>0)
{oArg[Matrix3.Const.ARG_GROUPS]=asArray.join(',');}}}
var oEventItem=new EventItem(_sSourceVForm,_sSourceEvent,_sSourceType,oArg[Matrix3.Const.ARG_VFORMID],Matrix3.Const.EVENT_SELECT,_sTargetType,_sEventDelay);oEventTable.AddEventItem(oEventItem);aoArgs.push(oArg);}}}}
var sArgs=JSON.stringify(aoArgs);var oResult=new Object();oResult[Matrix3.Const.COMMAND_EVENT]=oEventTable;oResult[Matrix3.Const.COMMAND_ARGS]=sArgs;return oResult},GetDragCommandEventTable:function(_sSourceVForm,_sSourceEvent,_sSourceType,_sTargetType,_sEventDelay,_sCommandArgs)
{var oRet=new EventTable();if(YAHOO.lang.isArray(_sCommandArgs))
{for(var i=0;i<_sCommandArgs.length;i++)
{var oEventItem=new EventItem(_sSourceVForm,_sSourceEvent,_sSourceType,_sCommandArgs[i],Matrix3.Const.EVENT_DRAG,_sTargetType,_sEventDelay);oRet.AddEventItem(oEventItem);}}
else
{}
return oRet;},GetReorderCommandEventTable:function(_sSourceVForm,_sSourceEvent,_sSourceType,_sTargetType,_sEventDelay,_sCommandArgs)
{var oRet=new EventTable();if(YAHOO.lang.isArray(_sCommandArgs))
{var bFirst=false;for(var i=0;i<_sCommandArgs.length;i++)
{var oEventTable=this.moTriggerTable.GetEventTable(_sCommandArgs[i],_sSourceEvent,_sSourceType,_sEventDelay,this.moCollection);if(oEventTable!=null)
{oRet.Merge(oEventTable);bFirst=true;}
if(i!=0||!bFirst)
{var oEventItem=new EventItem(_sCommandArgs[i],_sSourceEvent,_sSourceType,_sCommandArgs[i],_sSourceEvent,_sTargetType,_sEventDelay);oRet.AddEventItem(oEventItem);}}
this.mbReorderOptimization=true;}
else
{}
return oRet;},FinishLoad:function()
{this.miNumberOfAction--;if(this.miNumberOfAction==0)
{Matrix3.PostRender();}},LoadEffects:function(_sVFormEffects)
{this.moEffects=new Object();if(_sVFormEffects)
{var asEffects=_sVFormEffects.split(Matrix3.Const.SEPARATOR_EFFECT);for(var i=0;i<asEffects.length;i++)
{var asFunction=asEffects[i].split(Matrix3.Const.SEPARATOR_EFFECT_FUNCTION);if(asFunction.length==2)
{this.moEffects[asFunction[0]]=asFunction[1];}}}},ShowWaitMsg:function(_sMsg,_sWaitMsgMode,_oOptions)
{var oOptions=Utils.GetOptions(_oOptions);if(_sMsg&&$S(Matrix3.Const.ID_WAIT_MSG,"display")=="none")
{document.body.style.cursor="wait";$(Matrix3.Const.ID_WAIT_MSG_CONTENT).innerHTML=_sMsg;var iX=0;var iY=0;$SetStyle(Matrix3.Const.ID_WAIT_MSG,"visibility","hidden");$SetStyle(Matrix3.Const.ID_WAIT_MSG,"display","block");if(Utils.IsSafari()&&_sWaitMsgMode==Matrix3.Const.WAITMSG_MODE_POSTBACK)
{$SetStyle(Matrix3.Const.ID_WAIT_MSG_CLOSE,"display","block");}
var iWidth=Utils.GetAbsoluteWidth(Matrix3.Const.ID_WAIT_MSG);var iHeight=Utils.GetAbsoluteHeight(Matrix3.Const.ID_WAIT_MSG);switch(_sWaitMsgMode)
{case Matrix3.Const.WAITMSG_MODE_MOUSE:{var iX=Utils.GetMousePositionX();var iY=Utils.GetMousePositionY();break;}
default:{iX=(Utils.GetViewportWidth()-iWidth)/2+document.body.scrollLeft;iY=(Utils.GetViewportHeight()-iHeight)/2+document.body.scrollTop;}}
if(iX+iWidth>Utils.GetViewportWidth())
{iX=Utils.GetViewportWidth()-iWidth;}
if(iY+iHeight>Utils.GetViewportHeight())
{iY=Utils.GetViewportHeight()-iHeight;}
$SetStyle(Matrix3.Const.ID_WAIT_MSG,"left",iX+"px");$SetStyle(Matrix3.Const.ID_WAIT_MSG,"top",iY+"px");$SetStyle(Matrix3.Const.ID_WAIT_MSG,"visibility","visible");}},HideWaitMsg:function(_bFromCloseBtn)
{$SetStyle(Matrix3.Const.ID_WAIT_MSG,"display","none");document.body.style.cursor="auto";$SetStyle(Matrix3.Const.ID_WAIT_MSG_CLOSE,"display","none");if(_bFromCloseBtn)
{Matrix3.RemoveLoading();this.mbEvent=false;this.mbModal=true;}},AddEvent:function(_sSourceVForm,_sSourceEvent,_sSourceType,_sEventDelay,_sArgs,_sCommand,_sCommandArgs,_sVirtualID,_sPreload,_sVFormEffects,_bForce,_sWaitMsg,_bHistory,_sPageVirtualID,_sWaitMsgMode)
{try
{if(!_bForce&&_sEventDelay!=Matrix3.Const.DELAY_BUFFERED)
{if(!this.AddLoading())
{return;}
LoadingAjaxMgr.GetInstance().DisplayAll();}
if(this.mbEvent)
{window.setTimeout(function(){Matrix3.AddEvent(_sSourceVForm,_sSourceEvent,_sSourceType,_sEventDelay,_sArgs,_sCommand,_sCommandArgs,_sVirtualID,_sPreload,_sVFormEffects,true,_sWaitMsg,_bHistory,_sPageVirtualID,_sWaitMsgMode);},Matrix3.Const.RETRY_DELAY);return;}
this.mbEvent=true;Matrix3.ShowWaitMsg(_sWaitMsg,_sWaitMsgMode);if(UploadCtrl.miUploadInProgress>0)
{this.mbEvent=false;window.setTimeout(function(){Matrix3.AddEvent(_sSourceVForm,_sSourceEvent,_sSourceType,_sEventDelay,_sArgs,_sCommand,_sCommandArgs,_sVirtualID,_sPreload,_sVFormEffects,true,_sWaitMsg,_bHistory,_sPageVirtualID,_sWaitMsgMode);},Matrix3.Const.RETRY_DELAY);return;}
this.LoadEffects(_sVFormEffects);var bResult=true;if(!YAHOO.lang.isString(_sSourceVForm))
{if(this.mbHistory)
{window.location.reload(true);}
bResult=false;}
if(!YAHOO.lang.isString(_sSourceEvent))
{bResult=false;}
if(_sSourceType!=Matrix3.Const.RETURNTYPE_FULL&&_sSourceType!=Matrix3.Const.RETURNTYPE_VIEWSTATE)
{bResult=false;}
if(_sEventDelay!=Matrix3.Const.DELAY_BUFFERED&&_sEventDelay!=Matrix3.Const.DELAY_IMMEDIAT)
{bResult=false;}
if(!YAHOO.lang.isString(_sArgs))
{_sArgs=null;}
if(!(!_sCommand||_sCommand==""||(YAHOO.lang.isString(_sCommand)&&_sCommand==Matrix3.Const.COMMAND_MULTIPLE_SELECT_F)||(YAHOO.lang.isString(_sCommand)&&_sCommand==Matrix3.Const.COMMAND_MULTIPLE_SELECT_VS)||(YAHOO.lang.isString(_sCommand)&&_sCommand==Matrix3.Const.COMMAND_DROP_VS)||(YAHOO.lang.isString(_sCommand)&&_sCommand==Matrix3.Const.COMMAND_DROP_F)||(YAHOO.lang.isString(_sCommand)&&_sCommand==Matrix3.Const.COMMAND_REORDER)))
{bResult=false;}
if(bResult)
{var oCommandEventTable=null;if(_sCommand!=Matrix3.Const.COMMAND_REORDER)
{var oEventTable=this.moTriggerTable.GetEventTable(_sSourceVForm,_sSourceEvent,_sSourceType,_sEventDelay,this.moCollection);this.moEventTable.Merge(oEventTable);}
switch(_sCommand)
{case Matrix3.Const.COMMAND_MULTIPLE_SELECT_F:{var oRet=this.GetSelectGroupCommandEventTable(_sSourceVForm,_sSourceEvent,_sSourceType,Matrix3.Const.RETURNTYPE_FULL,_sEventDelay,_sCommandArgs)
oCommandEventTable=oRet[Matrix3.Const.COMMAND_EVENT];_sArgs=oRet[Matrix3.Const.COMMAND_ARGS];break;}
case Matrix3.Const.COMMAND_MULTIPLE_SELECT_VS:{var oRet=this.GetSelectGroupCommandEventTable(_sSourceVForm,_sSourceEvent,_sSourceType,Matrix3.Const.RETURNTYPE_VIEWSTATE,_sEventDelay,_sCommandArgs)
oCommandEventTable=oRet[Matrix3.Const.COMMAND_EVENT];_sArgs=oRet[Matrix3.Const.COMMAND_ARGS];break;}
case Matrix3.Const.COMMAND_DROP_F:oCommandEventTable=this.GetDragCommandEventTable(_sSourceVForm,_sSourceEvent,_sSourceType,Matrix3.Const.RETURNTYPE_FULL,_sEventDelay,_sCommandArgs)
break;case Matrix3.Const.COMMAND_DROP_VS:oCommandEventTable=this.GetDragCommandEventTable(_sSourceVForm,_sSourceEvent,_sSourceType,Matrix3.Const.RETURNTYPE_VIEWSTATE,_sEventDelay,_sCommandArgs)
break;case Matrix3.Const.COMMAND_REORDER:oCommandEventTable=this.GetReorderCommandEventTable(_sSourceVForm,_sSourceEvent,_sSourceType,Matrix3.Const.RETURNTYPE_FULL,_sEventDelay,_sCommandArgs);}
if(oCommandEventTable!=null)
{this.moEventTable.Merge(oCommandEventTable);}
if(_sEventDelay==Matrix3.Const.DELAY_IMMEDIAT)
{var sBody=this.GetPostBody(_sArgs,true,false,_sVirtualID);this.SendRequest(sBody,_sSourceVForm);}}}
catch(e)
{this.LogError(e);}
return bResult;},DoPostBack:function(_sSourceVForm,_sSourceEvent,_sArgs,_sPleaseWaitMsg)
{var bResult=true;LoadingPostBackMgr.GetInstance().DisplayAll();Matrix3.ShowWaitMsg(_sPleaseWaitMsg,Matrix3.Const.WAITMSG_MODE_POSTBACK);if(!YAHOO.lang.isString(_sSourceVForm))
{bResult=false;}
if(!YAHOO.lang.isString(_sSourceEvent))
{bResult=false;}
if(!YAHOO.lang.isString(_sArgs))
{_sArgs=null;}
if(bResult)
{var oEventTable=this.moTriggerTable.GetEventTable(_sSourceVForm,_sSourceEvent,Matrix3.Const.RETURNTYPE_FULL,Matrix3.Const.DELAY_IMMEDIAT,this.moCollection);this.moEventTable.Merge(oEventTable);var oBody=this.GetPostBody(_sArgs,false);for(var sKey in oBody)
{if(!$(sKey))
{var oElem=document.createElement("input");oElem.id=sKey;oElem.name=sKey;oElem.type="hidden";document.getElementById(Matrix3.Const.ID_FORM).appendChild(oElem);}
$(sKey).value=oBody[sKey];}
document.getElementById(Matrix3.Const.ID_FORM).submit();Matrix3.PostRender(true);}
return bResult;},AddPositioning:function()
{window.setTimeout('$SetStyle("'+Matrix3.Const.POSITIONING_MASK_ID+'", "width", 100 + "%");$SetStyle("'+Matrix3.Const.POSITIONING_MASK_ID+'", "height", 100 + "%");',1);return true;},RemovePositioning:function()
{$SetStyle(Matrix3.Const.POSITIONING_MASK_ID,"display","none");},AddLoading:function()
{if(this.mbIsLoading)
{return false;}
this.mbIsLoading=true;if(this.mbModal)
{$SetStyle(Matrix3.Const.LOADING_MASK_ID,"width","100%");$SetStyle(Matrix3.Const.LOADING_MASK_ID,"height","100%");$SetStyle(Matrix3.Const.LOADING_MASK_ID,"display","block");window.setTimeout('$SetStyle("'+Matrix3.Const.LOADING_MASK_ID+'", "width", 100 + "%");$SetStyle("'+Matrix3.Const.LOADING_MASK_ID+'", "height", 100 + "%");',1);}
$SetStyle(Matrix3.Const.LOADING_PANEL_ID,"top",(Utils.GetScrollTop()+Matrix3.Const.LOADING_BORDER)+"px");$SetStyle(Matrix3.Const.LOADING_PANEL_ID,"right",Matrix3.Const.LOADING_BORDER+"px");$SetStyle(Matrix3.Const.LOADING_PANEL_ID,"display","block");$SetStyle(Matrix3.Const.LOADING_PANEL_ID,"opacity","0");var oLoadingPnl=$(Matrix3.Const.LOADING_PANEL_ID);if(oLoadingPnl)
{if(oLoadingPnl.moTween)
{oLoadingPnl.moTween.stop(true);}
oLoadingPnl.moTween=Effect.Appear(oLoadingPnl,0.25);setTimeout(function(){if(oLoadingPnl.moTween){oLoadingPnl.moTween.animate();}},250);}
return true;},AddPopup:function(_oNode)
{var bResult=false;if(_oNode!=null&&(_oNode.id!=null&&_oNode.id!=undefined&&_oNode.id!=""))
{var oExistingNode=$(_oNode.id);if(oExistingNode!=null)
{this.RemovePopup(_oNode.id);}
_oNode=this.EvalScript(_oNode);var oPopup=new Popup(_oNode);oPopup.Show();this.moPopupTable[oPopup.msID]=oPopup;bResult=true;}
else
{}
Matrix3.FinishLoad();return bResult;},EvalScript:function(_oNode)
{var bParameters=true;if(_oNode==null||!YAHOO.lang.isObject(_oNode)||!_oNode.childNodes)
{bParameters=false;}
if(bParameters)
{var oTags=_oNode.getElementsByTagName("script");for(var i=0;i<oTags.length;i++)
{var sScript=oTags.item(i).innerHTML;if(YAHOO.lang.isString(sScript)&&sScript!="")
{this.msScript+=" "+sScript.substring(0,sScript.length-2)+",true);";}}
while(oTags.length!=0)
{oTags.item(0).parentNode.removeChild(oTags.item(0));}}
return _oNode;},AddVForm:function(_oNode,_sParentID,_sNextID,_sEffect,_sVirtualID,_bFromCache)
{var bResult=false;var bParameters=true;var sRealEffect=_sEffect;if(_sEffect&&(sRealEffect in this.moEffects))
{sRealEffect=this.moEffects[_sEffect];}
if(!(sRealEffect in VFormEffects))
{if(!this.mbHistory)
{sRealEffect=VFormEffects.Const.EFFECT_NONE;}
else
{sRealEffect=VFormEffects.Const.EFFECT_REPLACE;}}
if(_oNode==null||_oNode.id==null||_oNode.id==undefined||_oNode.id=="")
{bParameters=false;}
if(!YAHOO.lang.isString(_sParentID)&&_sParentID!=null)
{bParameters=false;}
if(_sNextID!=null&&!YAHOO.lang.isString(_sNextID))
{bParameters=false;}
$SetStyle(_oNode,"visibility","hidden");if(bParameters)
{if(this.mbFullPage)
{$("BodyContent").appendChild(_oNode);ControlMgr.GetInstance().moRootPositionItem=_oNode;Matrix3.FinishLoad();}
else
{var oParentNode;if(!YAHOO.lang.isString(_sParentID))
{var oVFormNode=ControlMgr.GetInstance().GetPositionItem(_oNode.id,true);if(oVFormNode!=null)
{oParentNode=oVFormNode.moParent;var oSibling=oVFormNode.nextSibling;while(oSibling!=null&&_sNextID==null)
{_sNextID=oSibling.id;oSibling=oSibling.nextSibling;if(_sNextID=="")
{_sNextID=null;}}}}
else
{oParentNode=$(_sParentID);}
if(oParentNode!=null)
{if(_sNextID!=null)
{var oNextNode=$PI(_sNextID);if(oNextNode==null)
{oNextNode=$(_sNextID);}
if(oNextNode!=null)
{var oOldNode=ControlMgr.GetInstance().GetPositionItem(_oNode.id,true);if(oOldNode!=null&&oOldNode.moParent===oParentNode)
{this.NewRefreshCaches(oOldNode.id);oOldNode.CopyDependenciesTo(_oNode);oOldNode.parentNode.removeChild(oOldNode);oOldNode.RecursiveRemove();}
oNextNode=$(_sNextID);if(oNextNode==null)
{var oSiblings=oParentNode.moContainerForChildrens;if(oSiblings&&oSiblings.length>0)
{oNextNode=oSiblings[0];}}
oParentNode.AddControl(_oNode,oOldNode,oNextNode);VFormEffects[sRealEffect].call(this,_oNode,oParentNode,oNextNode);bResult=true;}
else
{console.log("Insertion skipped for "+_oNode.id);}}
else
{var oOldNode=ControlMgr.GetInstance().GetPositionItem(_oNode.id,true);oParentNode.AddControl(_oNode,oOldNode,oNextNode);if(oOldNode!=null&&oOldNode.moParent===oParentNode)
{if(Matrix3.IsPopup(oOldNode.id))
{$AddClass(_oNode,"PopupContentClass");}
this.NewRefreshCaches(oOldNode.id);oOldNode.CopyDependenciesTo(_oNode);oOldNode.RecursiveRemove();oOldNode.parentNode.replaceChild(_oNode,oOldNode);this.EvalScript(_oNode);Matrix3.FinishLoad();}
else
{VFormEffects[sRealEffect].call(this,_oNode,oParentNode);oParentNode.FixAddDependency(_oNode);}
bResult=true;}
if(oParentNode!=null&&oParentNode.msCtrlType==PositionItem.Const.CONTROL_TYPE_FLOAT_PANEL)
{PositionMgr.GetInstance().AddToDirtyXList(oParentNode);PositionMgr.GetInstance().AddToDirtyYList(oParentNode);}}
else
{if(Utils.IsString(_sParentID))
{throw"Matrix3.AddVForm() : _sParentID ( "+_sParentID+" ) not found for VForm "+_oNode.id;}
else
{throw"Matrix3.AddVForm() : VForm with id "+_oNode.id+" is not found in the page and its parent is not given. The VForm cannot be added...";}}}}
return bResult;},RefreshNode:function(_oNode)
{var bRef=false;if(_oNode.type=="hidden"&&_oNode.name==Matrix3.Const.CONTROL_REFERENCE)
{var sID=_oNode.value;_oNode=$(sID);if(!_oNode)
{_oNode=document.createElement("div");_oNode.id=sID;}
this.RefreshCaches(_oNode.id);bRef=true;}
else
{if(_oNode.id)
{_oNode=_oNode.id;try{MultipleSelectionMgr.GetInstance().RefreshNode(_oNode);}catch(e){};try{CacheMgr.GetInstance().RefreshNode(_oNode);}catch(e){};try{ControlMgr.GetInstance().RefreshNode(_oNode);}catch(e){};try{StyleMgr.GetInstance().RefreshNode(_oNode);}catch(e){};try{CtrlEventMgr.GetInstance().RefreshNode(_oNode);}catch(e){};try{WysiwygProperties.RefreshNode(_oNode);}catch(e){};try{LoadingPostBackMgr.GetInstance().RefreshNode(_oNode);}catch(e){};try{WindowExitEvent.RefreshNode(_oNode);}catch(e){};try{MapCtrl.RefreshNode(_oNode);}catch(e){};try{PositionGroupProperties.RefreshNode(_oNode);}catch(e){};}}
if(bRef&&_oNode.parentNode)
{_oNode.parentNode.removeChild(_oNode);}},RegisterInCache:function(_sID,_oMgr)
{var sVFormID;var iIndex=_sID.indexOf(Matrix3.Const.SEPARATOR_CONTROL);if(iIndex==-1)
{sVFormID=_sID;}
else
{sVFormID=_sID.substring(0,iIndex);}
var oCallback=function()
{if(_oMgr.GetInstance)
{_oMgr.GetInstance().RefreshNode(_sID);}
else
{_oMgr.RefreshNode(_sID);}};if(!(sVFormID in this.moMgrCache))
{this.moMgrCache[sVFormID]=new Object();}
this.moMgrCache[sVFormID][_sID+_oMgr.Const.MGR_NAME]=oCallback;while(sVFormID!='')
{var iIndex=sVFormID.lastIndexOf(Matrix3.Const.SEPARATOR_HIERARCHY);var sNewVFormID;if(iIndex!=-1)
{sNewVFormID=sVFormID.substring(0,iIndex);if(!(sNewVFormID in this.moMgrCache))
{this.moMgrCache[sNewVFormID]=new Object();}
if(!(Matrix3.Const.CHILD_VFORM in this.moMgrCache[sNewVFormID]))
{this.moMgrCache[sNewVFormID][Matrix3.Const.CHILD_VFORM]=new Object();}
this.moMgrCache[sNewVFormID][Matrix3.Const.CHILD_VFORM][sVFormID]=true;}
else
{sNewVFormID='';}
sVFormID=sNewVFormID;}},NewRefreshCaches:function(_sID)
{_sID=_sID.split(Matrix3.Const.SEPARATOR_CONTROL)[0];if(_sID in this.moMgrCache)
{for(var sKey in this.moMgrCache[_sID])
{if(sKey==Matrix3.Const.CHILD_VFORM)
{for(var sChild in this.moMgrCache[_sID][sKey])
{this.NewRefreshCaches(sChild);}}
else
{this.moMgrCache[_sID][sKey]();}}
delete(this.moMgrCache[_sID]);for(var sRef in this.moReferences[_sID])
{var oNode=$(sRef);if(oNode&&oNode.parentNode)
{oNode.parentNode.removeChild(oNode);}
else
{oNode=$PI(sRef);if(oNode&&oNode.parentNode)
{oNode.parentNode.removeChild(oNode);}}}
delete this.moReferences[_sID];}},RefreshCaches:function(_oNode)
{_oNode=$(_oNode);if(_oNode)
{this.RefreshNode(_oNode);if(_oNode.className&&_oNode.className.indexOf(Matrix3.Const.CLASS_DONOTFOLLOW)!=-1)
{return;}
var oChildNodes=_oNode.getElementsByTagName("div");for(var i=0;i<oChildNodes.length;i++)
{this.RefreshNode(oChildNodes.item(i));}
oChildNodes=_oNode.getElementsByTagName("span");for(var i=0;i<oChildNodes.length;i++)
{this.RefreshNode(oChildNodes.item(i));}
oChildNodes=_oNode.getElementsByTagName("input");for(var i=0;i<oChildNodes.length;i++)
{this.RefreshNode(oChildNodes.item(i));}
oChildNodes=_oNode.getElementsByTagName("textarea");for(var i=0;i<oChildNodes.length;i++)
{this.RefreshNode(oChildNodes.item(i));}
oChildNodes=_oNode.getElementsByTagName("select");for(var i=0;i<oChildNodes.length;i++)
{this.RefreshNode(oChildNodes.item(i));}
oChildNodes=_oNode.getElementsByTagName("img");for(var i=0;i<oChildNodes.length;i++)
{this.RefreshNode(oChildNodes.item(i));}
oChildNodes=_oNode.getElementsByTagName("a");for(var i=0;i<oChildNodes.length;i++)
{this.RefreshNode(oChildNodes.item(i));}
oChildNodes=_oNode.getElementsByTagName("table");for(var i=0;i<oChildNodes.length;i++)
{this.RefreshNode(oChildNodes.item(i));}
oChildNodes=_oNode.getElementsByTagName("tr");for(var i=0;i<oChildNodes.length;i++)
{this.RefreshNode(oChildNodes.item(i));}}},AjaxFailure:function(_oResponse)
{var bResult=false;var bParameters=true;if(!YAHOO.lang.isObject(_oResponse)||_oResponse==null||!YAHOO.lang.isString(_oResponse.responseText))
{bParameters=false;}
if(bParameters)
{bResult=this.ProcessFailure(_oResponse.responseText);}
return bResult;},AjaxSuccess:function(_oResponse)
{try
{var bResult=false;var bParameters=true;if((!YAHOO.lang.isObject(_oResponse))||_oResponse==null||!YAHOO.lang.isString(_oResponse.responseText))
{bParameters=false;}
if(bParameters)
{var sResponseText=_oResponse.responseText;if(sResponseText!=null)
{if(sResponseText.substr(0,4)=="<div"||sResponseText.substr(0,6)=="<table"||sResponseText.substr(0,Matrix3.Const.RETURN_VALIDMARKER.length)==Matrix3.Const.RETURN_VALIDMARKER)
{var oXML=document.createElement("DIV");oXML.innerHTML='<span style="display:none;"><br /></span>'+sResponseText;var oVFormTable=Matrix3.PreRender(oXML);Matrix3.Render(oVFormTable);bResult=true;}
else if(sResponseText.substr(0,Matrix3.Const.REDIRECT_MARKER.length)==Matrix3.Const.REDIRECT_MARKER)
{var sRedirectURL=sResponseText.substr(Matrix3.Const.REDIRECT_MARKER.length);if(sRedirectURL.indexOf('VP3=')!=-1)
{sRedirectURL+="&"+Matrix3.Const.MARKER_RESOLUTION_WIDTH+"="+Utils.GetViewportWidth();sRedirectURL+="&"+Matrix3.Const.MARKER_RESOLUTION_HEIGHT+"="+Utils.GetViewportHeight();}
document.location=sRedirectURL;bResult=true;}
else
{Matrix3.ProcessFailure(sResponseText);}}
else
{}}}
catch(e)
{this.LogError(e);}
return bResult;},ExecuteDefaultAction:function(_sVFormID)
{var bResult=false;var bParameters=true;if(!YAHOO.lang.isString(_sVFormID))
{bParameters=false;}
if(bParameters)
{if(_sVFormID in this.moVFormTable)
{if(VFormInfoItem.Const.FIELD_DEFAULTACTION in this.moVFormTable[_sVFormID])
{eval(this.moVFormTable[_sVFormID][VFormInfoItem.Const.FIELD_DEFAULTACTION]);bResult=true;}
else if(!DefaultActionProperties.ExecuteDefaultAction(_sVFormID))
{var iIndex=_sVFormID.lastIndexOf(Matrix3.Const.SEPARATOR_HIERARCHY);if(iIndex!=-1)
{var sParent=_sVFormID.substring(0,iIndex);this.ExecuteDefaultAction(sParent);}}}}
return bResult;},GetVFormInfoItem:function(_sVFormID)
{var oRet=null;if(!YAHOO.lang.isString(_sVFormID))
{}
else
{var sID=_sVFormID;if(YAHOO.lang.isObject(Matrix3.moVFormTable[sID])&&Matrix3.moVFormTable[sID]!=null)
{var sPersistant=Matrix3.moVFormTable[sID][VFormInfoItem.Const.FIELD_PERSISTANT];var sSubID=null;if(Matrix3.moVFormTable[sID].hasOwnProperty(VFormInfoItem.Const.FIELD_SUB_ID))
{sSubID=Matrix3.moVFormTable[sID][VFormInfoItem.Const.FIELD_SUB_ID];}
var sParentVForm=null;var sParentPanel=null;var sParentIdx=sID.lastIndexOf(Matrix3.Const.SEPARATOR_HIERARCHY);var bIsPopup=Matrix3.IsPopup(sID);if(!bIsPopup&&(sParentIdx>0))
{sParentVForm=sID.substr(0,sParentIdx);}
else if(bIsPopup)
{sParentPanel=Matrix3.Const.POPUP_LAYER_ID;}
var oNode=$(sID);if((oNode!=null)&&(oNode.parentNode!=null))
{var sParentID=oNode.parentNode.id;var sPanelIdx=sParentID.indexOf(Matrix3.Const.SEPARATOR_CONTROL);if(sPanelIdx>0)
{sParentPanel=sParentID.substr(sPanelIdx+1);}
oRet=new VFormInfoItem(sID,sSubID,sPersistant,sParentVForm,sParentPanel);}
else
{}}
else
{}}
return oRet;},GetPostBody:function(_sArgs,_bAjax,_bPreload,_sVirtualID)
{var bParameters=true;var sResult="";var oDoPostBackResult=new Object();var oVFormInfoTable=new VFormInfoTable();var oControlsTable=new Object();var oVFormTable=new Object();var oFinalVFormTable=new Object();if(!YAHOO.lang.isString(_sArgs)&&_sArgs!=null)
{bParameters=false;}
if(bParameters)
{if(typeof(tinyMCE)!='undefined')
{tinyMCE.triggerSave();}
var oEventList=this.moEventTable.GetEventList();for(var i=0;i<oEventList.length;i++)
{var oEventItem=oEventList[i];if(!(oEventItem.GetSourceVForm()in oVFormTable)&&!(oEventItem.GetSourceVForm()in oFinalVFormTable))
{if(oEventItem.GetSourceType()!=Matrix3.Const.RETURNTYPE_VIEWSTATE)
{this.GetVFormControls($(oEventItem.GetSourceVForm()),oControlsTable,oVFormTable);}
else
{oFinalVFormTable[oEventItem.GetSourceVForm()]=oEventItem.GetSourceVForm();}}
if(oEventItem.GetTargetVForm()!=null)
{if(!(oEventItem.GetTargetVForm()in oVFormTable)&&!(oEventItem.GetTargetVForm()in oFinalVFormTable))
{if(oEventItem.GetTargetType()!=Matrix3.Const.RETURNTYPE_VIEWSTATE)
{this.GetVFormControls($(oEventItem.GetTargetVForm()),oControlsTable,oVFormTable);}
else
{oFinalVFormTable[oEventItem.GetTargetVForm()]=oEventItem.GetTargetVForm();}}}}
for(var sVFormID in oVFormTable)
{oFinalVFormTable[sVFormID]=sVFormID;}
for(var sVFormID in oFinalVFormTable)
{var oVFormInfoItem=this.GetVFormInfoItem(sVFormID);oVFormInfoTable.AddVFormInfoItem(oVFormInfoItem);}
if(!_bAjax)
{oDoPostBackResult[Matrix3.Const.TRIGGER_LIST]=this.moEventTable.Serialize();oDoPostBackResult[Matrix3.Const.VFORM_TABLE]=oVFormInfoTable.Serialize();oDoPostBackResult[Matrix3.Const.ARGUMENTS]=_sArgs;oDoPostBackResult[Matrix3.Const.DOPOSTBACK_MARKER]="1";oDoPostBackResult[Matrix3.Const.MARKER_RESOLUTION_WIDTH]=Utils.GetViewportWidth();oDoPostBackResult[Matrix3.Const.MARKER_RESOLUTION_HEIGHT]=Utils.GetViewportHeight();}
else
{sResult+=Matrix3.Const.TRIGGER_LIST+"="+this.moEventTable.Serialize();sResult+="&"+Matrix3.Const.VFORM_TABLE+"="+oVFormInfoTable.Serialize();var sParams=Utils.HashToParameters(oControlsTable);if(sParams!="")
{sResult+="&"+sParams;}
if(_sArgs!=null)
{sResult+="&"+Matrix3.Const.ARGUMENTS+"="+_sArgs;}
sResult+="&"+Matrix3.Const.AJAX_MARKER+"=1";sResult+="&"+Matrix3.Const.PRELOAD_MARKER+"="+((_bPreload)?"1":"0");if(_sVirtualID)
{sResult+="&"+Matrix3.Const.VIRTUALID_MARKER+"="+_sVirtualID;}
sResult+="&"+Matrix3.Const.MARKER_RESOLUTION_WIDTH+"="+Utils.GetViewportWidth();sResult+="&"+Matrix3.Const.MARKER_RESOLUTION_HEIGHT+"="+Utils.GetViewportHeight();}}
this.moEventTable=new EventTable();if(!_bAjax)
{return oDoPostBackResult;}else
{return sResult;}},GetVFormControls:function(_oNode,_oControlTable,_oVFormTable)
{var bParameters=true;var bResult=false;if(_oNode==null||_oNode.childNodes==undefined)
{bParameters=false;}
if(!YAHOO.lang.isObject(_oControlTable)||_oControlTable==null)
{bParameters=false;}
if(!YAHOO.lang.isObject(_oVFormTable)||_oVFormTable==null)
{bParameters=false;}
if(bParameters)
{if($HasClass(_oNode,Matrix3.Const.CLASS_DONOTFOLLOW))
{return;}
if(_oNode.id!=null&&_oNode.id!=""&&_oNode.id.indexOf(Matrix3.Const.SEPARATOR_CONTROL)==-1)
{if(!(_oNode.id in _oVFormTable))
{_oVFormTable[_oNode.id]=_oNode.id;if(_oNode.id in this.moReferences)
{var oRefTable=this.moReferences[_oNode.id];for(var sRef in oRefTable)
{var oNode=$(sRef);if(oNode)
{this.GetVFormControls(oNode,_oControlTable,_oVFormTable);}
else
{oNode=$PI(sRef);if(oNode)
{this.GetVFormControls(oNode,_oControlTable,_oVFormTable);}}}}}
else
{return true;}}
var oChilds=_oNode.childNodes;for(var i=0;i<oChilds.length;i++)
{var oChild=oChilds[i];switch(oChild.nodeName.toLowerCase())
{case"input":if(oChild.type.toLowerCase()=="radio")
{if(oChild.checked==true)
{_oControlTable[oChild.name]=oChild.value;}}
else if(oChild.type.toLowerCase()=="checkbox")
{if(oChild.checked==true)
{_oControlTable[oChild.name]="true";}
else
{_oControlTable[oChild.name]="false";}}
else if(oChild.type.toLowerCase()=="hidden"&&oChild.name==Matrix3.Const.CONTROL_REFERENCE)
{this.GetVFormControls($(oChild.value),_oControlTable,_oVFormTable);}
else
{_oControlTable[oChild.id]=oChild.value;}
break;case"textarea":_oControlTable[oChild.id]=oChild.value;break;case"select":_oControlTable[oChild.id]=oChild.value;break;case"object":if(oChild.type.toLowerCase()=="application/x-shockwave-flash")
{try
{_oControlTable[oChild.parentNode.id]=oChild.Matrix_GetControlValue();}
catch(e){}}
else
{this.GetVFormControls(oChild,_oControlTable,_oVFormTable);}
break;case"div":{if(oChild.msCtrlType&&oChild.msCtrlType==PositionItem.Const.CONTROL_TYPE_FLOAT_PANEL&&oChild.HasProperty(SequenceLoadingProperties.Const.PROPERTY_SEQUENCE_LOADING))
{var oSequenceLoadingProperties=SequenceLoadingMgr.GetInstance().Get(oChild.GetVFormId());if(oSequenceLoadingProperties!=null)
{_oControlTable[oChild.id]=oSequenceLoadingProperties.GetSelectedIndex();}}
this.GetVFormControls(oChild,_oControlTable,_oVFormTable);}
break;default:this.GetVFormControls(oChild,_oControlTable,_oVFormTable);}}
bResult=true;}
return bResult;},IsPopup:function(_sVFormID)
{var bResult=false;var bParameters=true;if(!YAHOO.lang.isString(_sVFormID))
{bParameters=false;}
if(bParameters)
{bResult=_sVFormID in Matrix3.moPopupTable;}
return bResult;},KeyPressCallback:function(_oKeyEvent)
{var oKeyCode;if(_oKeyEvent.keyCode)
{oKeyCode=_oKeyEvent.keyCode;}
else if(_oKeyEvent.which)
{oKeyCode=_oKeyEvent.which;}
var oElement;if(_oKeyEvent.target)
{oElement=_oKeyEvent.target;}
else if(_oKeyEvent.srcElement)
{oElement=_oKeyEvent.srcElement;}
if(oKeyCode==13&&oElement!=null&&YAHOO.lang.isObject(oElement)&&oElement.type!="textarea")
{var sID=oElement.id;if(YAHOO.lang.isString(sID))
{var iIndex=sID.indexOf(Matrix3.Const.SEPARATOR_CONTROL);if(iIndex>0)
{var sVFormID=sID.substring(0,iIndex);if(sVFormID!="")
{this.ExecuteDefaultAction(sVFormID);}}}}},PostRender:function(_bDoPostBack)
{eval(this.msScript);ControlMgr.GetInstance().ClearOldInstance();if(!_bDoPostBack)
{LoadingPostBackMgr.GetInstance().HideAll();LoadingAjaxMgr.GetInstance().HideAll();}
PostRenderMgr.GetInstance().ExecuteFunctions();this.msScript="";if(!DragDropMgr.mbIsReorder)
{YAHOO.util.DDM.moCacheElemXY=null;}
if(!_bDoPostBack)
{this.RemoveLoading();}
if(!this.mbIsInit)
{YAHOO.util.DragDropMgr.refreshCache();MultipleSelectionMgr.GetInstance().Refresh();}
else
{this.mbIsInit=false;}
this.mbHistory=false;this.mbModal=true;this.mbEvent=false;this.mbFullPage=false;if(!_bDoPostBack||!Utils.IsSafari())
{Matrix3.HideWaitMsg();}
Utils.AddEvent(window,"resize",ResizeMgr.GetInstance().Resize,ResizeMgr.GetInstance());Logger.EndTurn();return true;},PreRender:function(_oXML)
{if(this.mbFullPage)
{var oRootVF=$(Matrix3.Const.ID_PANEL_MAIN).firstChild;this.NewRefreshCaches(oRootVF.id);oRootVF.parentNode.removeChild(oRootVF);oRootVF.RecursiveRemove();ControlMgr.GetInstance().ReInit();PositionMgr.GetInstance().ReInit();ResizeMgr.GetInstance().ReInit();ResizeMgr.GetInstance().ExportScreenToLists();}
var bParameters=true;var oRet=null;this.maNodeToExtract=new Array();if(_oXML==null||_oXML.nodeName==null||_oXML.nodeName==""||_oXML.nodeName==undefined)
{bParameters=false;}
if(bParameters)
{oRet=new Object();var oActionTable=null;var oChildList=_oXML.childNodes;oActionTable=Matrix3.SetupClientInfo(oChildList[oChildList.length-1].value);for(var i=0;i<oChildList.length-1;i++)
{var oNode=oChildList[i];if(!oNode||oNode.nodeName.toUpperCase()=='SPAN')continue;if(oNode.id=="script")
{this.EvalScript(oNode);continue;}
while(!oNode.id)
{oNode=oNode.firstChild;}
var sID=oNode.id;{oRet[sID]=new Object();oRet[sID][VFormInfoItem.Const.FIELD_XMLCONTENT]=oNode;var sParentID=null;var oActiontableLine=oActionTable[sID];if(oActiontableLine!=null)
{var oActionList=oActiontableLine[VFormInfoItem.Const.FIELD_ACTIONLIST]
if(oActionList!=null&&oActionList.length>0)
{var oAction=oActionList[0];if(oAction!=null&&oAction.hasOwnProperty(VFormInfoItem.Const.ACTIONLIST_PARENT))
{sParentID=oAction[VFormInfoItem.Const.ACTIONLIST_PARENT];}}}
var iInsertionDepth=this.GetVFormInsertionDepth(sID,sParentID);var oPositionItem=ControlMgr.GetInstance().CreateControl(oNode,null,iInsertionDepth);PositionMgr.GetInstance().AddToDirtyXList(oPositionItem);PositionMgr.GetInstance().AddToDirtyYList(oPositionItem);this.maNodeToExtract.push(oPositionItem);}}
if(oActionTable!=null)
{for(var sID in oActionTable)
{if(!(sID in oRet))
{oRet[sID]=new Object();}
oRet[sID][VFormInfoItem.Const.FIELD_ACTIONLIST]=oActionTable[sID][VFormInfoItem.Const.FIELD_ACTIONLIST];oRet[sID][VFormInfoItem.Const.ACTIONLIST_EFFECT]=oActionTable[sID][VFormInfoItem.Const.ACTIONLIST_EFFECT];oRet[sID][VFormInfoItem.Const.ACTIONLIST_VIRTUALID]=oActionTable[sID][VFormInfoItem.Const.ACTIONLIST_VIRTUALID];}}
else
{oRet=null;}}
return oRet;},ProcessFailure:function(_sError)
{var bParameters=true;if(!YAHOO.lang.isString(_sError))
{bParameters=false;}
if(bParameters&&!this.mbDebug)
{document.write(_sError);document.close();}
return bParameters;},RemoveClientInfo:function(_sVFormID)
{var bParameters=true;var bResult=false;if(!YAHOO.lang.isString(_sVFormID))
{bParameters=false;}
if(bParameters)
{bResult=true;}
return bResult;},RemoveLoading:function()
{$SetStyle(Matrix3.Const.LOADING_PANEL_ID,"display","none");$SetStyle(Matrix3.Const.LOADING_MASK_ID,"display","none");this.mbIsLoading=false;},RemoveVForm:function(_sVFormID,_sEffect,_sVirtualID,_bNoFinishLoad,_bFromCache)
{var bParameters=true;var bResult=false;if(!YAHOO.lang.isString(_sVFormID))
{bParameters=false;}
if(bParameters)
{var oNode=$(_sVFormID);if(oNode!=null)
{this.NewRefreshCaches(oNode.id);oNode.parentNode.removeChild(oNode);oNode.RecursiveRemove();oParentNode=oNode.moParent;if(oParentNode!=null&&oParentNode.msCtrlType)
{var iNodeIndex=oParentNode.GetContainerForChildren().indexOf(oNode)
if(iNodeIndex!=-1)
{oParentNode.GetContainerForChildren().splice(iNodeIndex,1);}
PositionMgr.GetInstance().AddToDirtyXList(oParentNode);PositionMgr.GetInstance().AddToDirtyYList(oParentNode);}
bResult=Matrix3.RemoveClientInfo(_sVFormID);}
else
{}}
if(!_bNoFinishLoad)
{Matrix3.FinishLoad();}
return bResult;},RemovePopup:function(_sVFormID)
{var bResult=false;if(!YAHOO.lang.isString(_sVFormID))
{}
else
{var oPopup=this.moPopupTable[_sVFormID];if(oPopup instanceof Popup)
{oPopup.Remove();bResult=Matrix3.RemoveClientInfo(_sVFormID);bResult=true;}
else
{}}
Matrix3.FinishLoad();return bResult;},Render:function(_oVFormTable)
{var bParameters=true;var bResult=false;if(!YAHOO.lang.isObject(_oVFormTable)||_oVFormTable==null)
{bParameters=false;}
this.miNumberOfAction=0;var oOrderedActions=new Array();if(bParameters)
{var oSortedActions=new Array();for(var sID in _oVFormTable)
{oSortedActions.push(sID);}
var iIndex=0;while(iIndex<oSortedActions.length)
{var sID=oSortedActions[iIndex];var oActionList=_oVFormTable[sID][VFormInfoItem.Const.FIELD_ACTIONLIST];if(oActionList instanceof Array&&oActionList.length>0&&oActionList[0][VFormInfoItem.Const.ACTIONLIST_ACTION]==VFormInfoItem.Const.ACTIONLIST_ACTION_ADD)
{var sInsertBeforeID=oActionList[0][VFormInfoItem.Const.ACTIONLIST_NEXTVFORM];if(sInsertBeforeID&&_oVFormTable.hasOwnProperty(sInsertBeforeID))
{var iBeforeIDIndex=oSortedActions.indexOf(sInsertBeforeID);if(iBeforeIDIndex!=-1&&iBeforeIDIndex>iIndex)
{oSortedActions[iIndex]=sInsertBeforeID;oSortedActions[iBeforeIDIndex]=sID;iIndex--;}}}
iIndex++;}
this.miNumberOfAction=oSortedActions.length;this.miNumberOfAction++;for(var iActn=0;iActn<oSortedActions.length;iActn++)
{var sID=oSortedActions[iActn];var oActionList=_oVFormTable[sID][VFormInfoItem.Const.FIELD_ACTIONLIST];if(oActionList instanceof Array)
{var sEffect=_oVFormTable[sID][VFormInfoItem.Const.ACTIONLIST_EFFECT];var sVirtualID=_oVFormTable[sID][VFormInfoItem.Const.ACTIONLIST_VIRTUALID];this.miNumberOfAction+=oActionList.length-1;for(var i=0;i<oActionList.length;i++)
{var oAction=oActionList[i];switch(oAction[VFormInfoItem.Const.ACTIONLIST_ACTION])
{case VFormInfoItem.Const.ACTIONLIST_ACTION_ADD:{if(_oVFormTable[sID][VFormInfoItem.Const.FIELD_XMLCONTENT]!=null&&_oVFormTable[sID][VFormInfoItem.Const.FIELD_XMLCONTENT].nodeName!=null&&_oVFormTable[sID][VFormInfoItem.Const.FIELD_XMLCONTENT].nodeName!=undefined&&_oVFormTable[sID][VFormInfoItem.Const.FIELD_XMLCONTENT].nodeName!="")
{if(oAction[VFormInfoItem.Const.ACTIONLIST_LAYOUT]==VFormInfoItem.Const.ACTIONLIST_LAYOUT_POPUP)
{Matrix3.AddPopup(_oVFormTable[sID][VFormInfoItem.Const.FIELD_XMLCONTENT]);}
else
{Matrix3.AddVForm(_oVFormTable[sID][VFormInfoItem.Const.FIELD_XMLCONTENT],oAction[VFormInfoItem.Const.ACTIONLIST_PARENT],oAction[VFormInfoItem.Const.ACTIONLIST_NEXTVFORM],sEffect,sVirtualID);}}
else
{Matrix3.FinishLoad();}}
break;case VFormInfoItem.Const.ACTIONLIST_ACTION_REMOVE:{if(Matrix3.IsPopup(sID))
{Matrix3.RemovePopup(sID);}
else
{Matrix3.RemoveVForm(sID,sEffect,sVirtualID);}}
break;}
bResult=true;}}
else
{Matrix3.AddVForm(_oVFormTable[sID][VFormInfoItem.Const.FIELD_XMLCONTENT],null,null,sEffect,sVirtualID);bResult=true;}}}
if(this.mbIsInit||this.mbFullPage)
{var oPositionItem=ControlMgr.GetInstance().GetRootPositionItem();PositionMgr.GetInstance().AddToDirtyXList(oPositionItem);PositionMgr.GetInstance().AddToDirtyYList(oPositionItem);oPositionItem.ExtractDependences();}
else
{for(var i=0;i<this.maNodeToExtract.length;i++)
{this.maNodeToExtract[i].ExtractDependences();}}
this.ProcessPrePositionCalls();PositionMgr.GetInstance().CalculatePosition();if(!this.mbIsInit)
{for(var i=0;i<this.maNodeToExtract.length;i++)
{$SetStyle(this.maNodeToExtract[i],"visibility","visible");}}
ControlMgr.GetInstance().ApplyPropertyQueue();for(var sPopupId in this.moPopupTable)
{var oPopup=this.moPopupTable[sPopupId];oPopup.CenterIfNeeded();}
Matrix3.RemovePositioning();this.miNumberOfAction--;if(this.miNumberOfAction<=0)
{Matrix3.PostRender();}
return bResult;},ProcessPrePositionCalls:function()
{for(var i in this.maPrePositionCalls)
{this.maPrePositionCalls[i]();}
this.maPrePositionCalls=new Array();},SendRequest:function(_sPostBody,_sSourceVForm)
{var bParameters=true;var bResult=false;if(!YAHOO.lang.isString(_sPostBody))
{bParameters=false;}
if(bParameters)
{var callback={success:this.AjaxSuccess,failure:this.AjaxFailure,scope:this}
try
{bResult=true;var oReq=YAHOO.util.Connect.asyncRequest("POST",this.msURL,callback,_sPostBody);setTimeout(function(){if(YAHOO.util.Connect.isCallInProgress(oReq)){Matrix3.LogSlowRequest(oReq,_sPostBody)}},Matrix3.Const.SLOW_REQ_LOG_THRESHOLD);}
catch(e)
{}}
return bResult;},LoadFullPage:function(_sURL)
{this.mbEvent=true;this.mbFullPage=true;var callback={success:this.AjaxSuccess,failure:this.AjaxFailure,scope:this}
var sPostBody="_FPA_=1";var oReq=YAHOO.util.Connect.asyncRequest("POST",_sURL,callback,sPostBody);},SetupClientInfo:function(_sClientInfo)
{var bParameters=true;var oResult=null;if(!YAHOO.lang.isString(_sClientInfo))
{bParameters=false;}
if(bParameters)
{var sDecodedClientInfo=decodeURIComponent(_sClientInfo);var oClientInfo=null;{oClientInfo=JSON.parse(sDecodedClientInfo);this.mbBlockReloadOnResize=oClientInfo.hasOwnProperty(Matrix3.Const.BLOCK_RELOAD_ON_RESIZE);if(oClientInfo.hasOwnProperty(Matrix3.Const.MIN_RES_WIDTH))
{ResizeMgr.GetInstance().miMinScreenWidth=parseInt(oClientInfo[Matrix3.Const.MIN_RES_WIDTH]);}
if(oClientInfo.hasOwnProperty(Matrix3.Const.RESOLUTION_VALIDITY_BOUNDARIES))
{var oLowerBound=oClientInfo[Matrix3.Const.RESOLUTION_VALIDITY_BOUNDARIES][0];var oUpperBound=oClientInfo[Matrix3.Const.RESOLUTION_VALIDITY_BOUNDARIES][1];var iViewportWidth=Utils.GetViewportWidth();var iViewportHeight=Utils.GetViewportHeight();var bPageNeedResolutionReload=((oLowerBound[0]!=-1&&iViewportWidth<oLowerBound[0])||(oLowerBound[1]!=-1&&iViewportHeight<oLowerBound[1])||(oUpperBound[0]!=-1&&iViewportWidth>oUpperBound[0])||(oUpperBound[1]!=-1&&iViewportHeight>oUpperBound[1]))
if(bPageNeedResolutionReload)
{var callback={success:function(){window.location.reload();},failure:null,scope:this}
YAHOO.util.Connect.asyncRequest("GET","htm/Resolution.aspx?W="+Utils.GetViewportWidth()+"&H="+Utils.GetViewportHeight(),callback,null);var oMask=document.createElement("div");oMask.id="ReloadingMask"
document.getElementById(Matrix3.Const.ID_FORM).appendChild(oMask);$SetStyle(oMask,"background-color","#FFF");$SetStyle(oMask,"width",Utils.GetViewportWidth()+"px");$SetStyle(oMask,"height",Utils.GetViewportHeight()+"px");}}
var oTriggerList=oClientInfo[Matrix3.Const.TRIGGER_LIST];if(oTriggerList!=null)
{var oNewTriggerTable=new TriggerTable();for(var i=0;i<oTriggerList.length;i++)
{var oServerItem=oTriggerList[i];var oTriggerItem=new TriggerItem(oServerItem[TriggerItem.Const.SOURCE_VFORM],oServerItem[TriggerItem.Const.SOURCE_EVENT],oServerItem[TriggerItem.Const.TARGET_VFORM],oServerItem[TriggerItem.Const.TARGET_EVENT],oServerItem[TriggerItem.Const.TARGET_TYPE],oServerItem[TriggerItem.Const.DELAY]);oNewTriggerTable.AddTriggerItem(oTriggerItem);}
this.moTriggerTable.Merge(oNewTriggerTable);}
var oVFormInfoTable=oClientInfo[Matrix3.Const.VFORM_TABLE];if(oVFormInfoTable!=null)
{oResult=new Object();for(var sID in oVFormInfoTable)
{this.moVFormTable[sID]=oVFormInfoTable[sID];if(VFormInfoItem.Const.FIELD_ACTIONLIST in oVFormInfoTable[sID])
{oResult[sID]=new Object();oResult[sID][VFormInfoItem.Const.FIELD_ACTIONLIST]=oVFormInfoTable[sID][VFormInfoItem.Const.FIELD_ACTIONLIST];oResult[sID][VFormInfoItem.Const.ACTIONLIST_EFFECT]=oVFormInfoTable[sID][VFormInfoItem.Const.ACTIONLIST_EFFECT];oResult[sID][VFormInfoItem.Const.ACTIONLIST_VIRTUALID]=Utils.TransformVirtualID(oVFormInfoTable[sID][VFormInfoItem.Const.ACTIONLIST_VIRTUALID]);}}}
if(Matrix3.Const.VERSION in oClientInfo)
{this.miVersion=oClientInfo[Matrix3.Const.VERSION];}
if(Matrix3.Const.URL in oClientInfo)
{this.msURL=oClientInfo[Matrix3.Const.URL];FramesMgr.GetInstance().SetURL(this.msURL);}
if(Matrix3.Const.EURL in oClientInfo)
{HistoryMgr.GetInstance().UpdateHash(oClientInfo[Matrix3.Const.EURL]);}
if(Matrix3.Const.COLLECTION in oClientInfo)
{for(var sKey in oClientInfo[Matrix3.Const.COLLECTION])
{if(oClientInfo[Matrix3.Const.COLLECTION][sKey]instanceof Array)
{var asArray=oClientInfo[Matrix3.Const.COLLECTION][sKey];for(var i=0;i<asArray.length;i++)
{this.moCollection.Add(sKey,asArray[i]);}}}}}}
return oResult;},GetVFormInsertionDepth:function(_sID,_sParentID)
{var iResult=0;var oReplaced=ControlMgr.GetInstance().GetPositionItem(_sID);if(oReplaced!=null)
{iResult=oReplaced.miDeep;}else if(_sParentID!=null)
{var oParent=ControlMgr.GetInstance().GetPositionItem(_sParentID);if(oParent!=null)
{iResult=oParent.miDeep+1;}}
return iResult;},LogSlowRequest:function(_oReq,_sPostBody)
{var sWarning="Data request is taking longer than "+Matrix3.Const.SLOW_REQ_LOG_THRESHOLD/1000+"s.\nRequest summary: \n"+"Url: "+encodeURIComponent(this.msURL)+"\n"+"Parameters: "+encodeURIComponent(_sPostBody)+"\n";Matrix3.LogWarning(sWarning);},LogError:function(_e)
{var sErrorMsg=_e.name+": "+_e.message;var sPostBody="RM=Javascript2&EM="+sErrorMsg;YAHOO.util.Connect.asyncRequest("POST","htm/LogError.aspx",null,sPostBody);setTimeout("document.location = 'C.aspx?VP3=ErrorPage';",100);},LogWarning:function(_sMessage)
{var sPostBody="RM=Javascript2&WM="+_sMessage;YAHOO.util.Connect.asyncRequest("POST","htm/LogError.aspx",null,sPostBody);}};Matrix3.Const={DELAY_BUFFERED:"B",DELAY_IMMEDIAT:"I",RETURNTYPE_FULL:"F",RETURNTYPE_VIEWSTATE:"VS",SEPARATOR_HIERARCHY:".",TRIGGER_LIST:"TL",VFORM_TABLE:"VFT",RESOLUTION_VALIDITY_BOUNDARIES:"RVB",MIN_RES_WIDTH:"MRW",BLOCK_RELOAD_ON_RESIZE:"BRR",URL:"URL",EURL:"EURL",VERSION:"V",SEPARATOR_CONTROL:":",HIDDENFIELDS:"HIDDENFIELDS",LOADING_PANEL_ID:"LoadingPopupID",LOADING_MASK_ID:"LoadingPopupMask",POSITIONING_MASK_ID:"PositioningMask",RETURN_VALIDMARKER:'<input type="hidden" name="HIDDENFIELDS" id="HIDDENFIELDS" value="',POPUP_LAYER_ID:"PopupLayer",SUFFIX_POPUP:"_Popup",COLLECTION:"CL",ARGUMENTS:"ARGS",AJAX_MARKER:"_AJAX_",DOPOSTBACK_MARKER:"_PB_",COMMAND_MULTIPLE_SELECT_VS:"GroupSelectionVS",COMMAND_MULTIPLE_SELECT_F:"GroupSelectionFULL",COMMAND_DROP_VS:"DropVS",COMMAND_DROP_F:"DropFULL",EVENT_DROP:"DROP",EVENT_DRAG:"DRAG",EVENT_SELECT:"SELECT",ARG_VFORMID:"V",ARG_CONTROL:"C",ARG_PANEL:"Pnl",ARG_GROUPS:"G",ARG_POSITION:"P",ARG_NEXT_VFORMID:"N",ARG_PREVIOUS_VFORMID:"PVF",ARG_COORDX:"X",ARG_COORDY:"Y",COMMAND_EVENT:"ET",COMMAND_ARGS:"A",COMMAND_REORDER:"Reorder",EVENT_REORDER:"REORDER",REDIRECT_MARKER:"REDIRECT=",LOADING_BORDER:10,FORM:"Form1",PRELOAD_MARKER:"_PRELOAD_",VIRTUALID_MARKER:"_VI_",MARKER_RESOLUTION_WIDTH:"RW",MARKER_RESOLUTION_HEIGHT:"RH",FIELD_PRELOAD:"P",FIELD_VIRTUALID:"VI",EVENT_FROM_PRELOAD:"P",EVENT_FROM_USER:"U",SEPARATOR_EFFECT:",",SEPARATOR_EFFECT_FUNCTION:":",SEPARATOR_VIRTUALID:";",LAYER_VFORMS:"LAYERVFORMS",RETRY_DELAY:200,SLOW_REQ_LOG_THRESHOLD:15000,POST_RENDER_FUNCTION:"PostRenderMgr.GetInstance().AddFunction(function(){",ID_PANEL_MAIN:"BodyContent",CONTROL_REFERENCE:"Ref",CLASS_DONOTFOLLOW:"DoNotFollow",ID_WAIT_MSG:"WaitMsg",ID_WAIT_MSG_CLOSE:"WaitMsgClose",ID_WAIT_MSG_CONTENT:"WaitMsgContent",ID_FORM:"Form1",WAITMSG_MODE_MOUSE:"mouse",WAITMSG_MODE_POSTBACK:"postback",PROPERTY_HTTPS_VFORM:"Https",CLASS_PNG:"png",ID_CONSOLE:"Console",SAFARI_HIDE_MSG_DELAY:3000,INFO_IMAGE_BASE:"Info_ImageBase",CHILD_VFORM:"CVF",PLEASEWAITMSG_OPTION_SHOW_CLOSE:"ShowClose"};var sLocH=window.location.hash;if(sLocH!=''&&sLocH.substring(0,2)=="#/")
{window.location.href=HistoryMgr.GetURLFromH(sLocH.substring(2));throw"";}
Matrix3.moMgrCache=new Object();Matrix3.moReferences=new Object();Matrix3.mbDebug=true;YAHOO.util.Event.onDOMReady(Matrix3.Init,Matrix3,true);function TriggerItem(_sSourceVForm,_sSourceEvent,_sTargetVForm,_sTargetEvent,_sTargetType){if(YAHOO.lang.isString(_sSourceVForm))
{this.msSourceVForm=_sSourceVForm;}
else
{this.msSourceVForm=null;}
if(YAHOO.lang.isString(_sSourceEvent)||_sSourceEvent==null)
{this.msSourceEvent=_sSourceEvent;}
else
{this.msSourceEvent=null}
if(YAHOO.lang.isString(_sTargetVForm))
{this.msTargetVForm=_sTargetVForm;}
else
{this.msTargetVForm=null;}
if(YAHOO.lang.isString(_sTargetEvent)||_sTargetEvent==null)
{this.msTargetEvent=_sTargetEvent;}
else
{this.msTargetEvent=null;}
if(YAHOO.lang.isString(_sTargetType)&&(_sTargetType==Matrix3.Const.RETURNTYPE_FULL||_sTargetType==Matrix3.Const.RETURNTYPE_VIEWSTATE))
{this.msTargetType=_sTargetType;}
else
{this.msTargetType=null;}
this.msID=TriggerItem.CreateID(this.msSourceVForm,this.msSourceEvent,this.msTargetVForm,this.msTargetEvent);}
TriggerItem.Const={SEPARATOR:"|",SOURCE_VFORM:"SVF",SOURCE_EVENT:"SE",TARGET_VFORM:"TVF",TARGET_EVENT:"TE",TARGET_TYPE:"TRT",DELAY:"D"};TriggerItem.CreateID=function(_sSourceVForm,_sSourceEvent,_sTargetVForm,_sTargetEvent)
{var sResult=new StringBuilder();sResult.append(_sSourceVForm);if(_sSourceEvent!=null)
{sResult.append(TriggerItem.Const.SEPARATOR);sResult.append(_sSourceEvent);}
if(_sTargetVForm!=null)
{sResult.append(TriggerItem.Const.SEPARATOR);sResult.append(_sTargetVForm);}
if(_sTargetEvent!=null)
{sResult.append(TriggerItem.Const.SEPARATOR);sResult.append(_sTargetEvent);}
return sResult.toString();};TriggerItem.prototype={GetID:function()
{return this.msID;},GetSourceVForm:function()
{return this.msSourceVForm;},GetSourceEvent:function()
{return this.msSourceEvent;},GetTargetVForm:function()
{return this.msTargetVForm;},GetTargetEvent:function()
{return this.msTargetEvent;},GetTargetType:function()
{return this.msTargetType;}};function TriggerTable(){this.moTriggerList=new Array();this.moTriggerTable=new Object();}
TriggerTable.Const={MAX_RECURSE:50,VFORM_NOT_MATCH:-2,VFORM_MATCH:-1};TriggerTable.prototype={AddTriggerItem:function(_oTriggerItem)
{var bResult=false;if(_oTriggerItem instanceof TriggerItem&&!(_oTriggerItem.GetID()in this.moTriggerTable))
{this.moTriggerList.push(_oTriggerItem);this.moTriggerTable[_oTriggerItem.GetID()]=this.moTriggerList.length-1;bResult=true;}
else
{}
return bResult;},GetTriggerList:function()
{return this.moTriggerList;},Merge:function(_oTriggerTable)
{var bResult=false;if(_oTriggerTable instanceof TriggerTable)
{var oTriggerList=_oTriggerTable.GetTriggerList();for(var i=0;i<oTriggerList.length;i++)
{var oItem=oTriggerList[i];if(oItem.GetID()in this.moTriggerTable)
{this.moTriggerList.splice(this.moTriggerTable[oItem.GetID()],1);for(var j=0;j<this.moTriggerList.length;j++)
{this.moTriggerTable[this.moTriggerList[j].GetID()]=j;}}
this.moTriggerList.push(oItem);}
for(var i=0;i<this.moTriggerList.length;i++)
{this.moTriggerTable[this.moTriggerList[i].GetID()]=i;}}
else
{}
return bResult;},CheckMatchingVForm:function(_sSourceVForm,_sCheckVForm,_oCollection)
{var iRet=TriggerTable.Const.VFORM_NOT_MATCH;var bParameters=true;if((_sSourceVForm==null)||(!YAHOO.lang.isString(_sSourceVForm))||(_sSourceVForm.indexOf('[')>=0))
{bParameters=false;}
if(!YAHOO.lang.isString(_sCheckVForm))
{bParameters=false;}
if((_oCollection!=null)&&(!_oCollection instanceof Collection))
{bParameters=false;}
if(bParameters)
{var sSeparator=Matrix3.Const.SEPARATOR_HIERARCHY;var asTriggerItemSourceVFormComponents=_sCheckVForm.split(sSeparator);var sCollection=null;var iStartCollectionIdx=_sCheckVForm.indexOf('{*}');if((iStartCollectionIdx>=0)&&(iStartCollectionIdx<asTriggerItemSourceVFormComponents[0].length))
{sCollection=_sCheckVForm.substr(0,iStartCollectionIdx);}
else
{}
if(sCollection!=null)
{if(_oCollection!=null)
{var asVFormList=_oCollection.GetVFormList(sCollection);if(asVFormList!=null)
{var sEndCheck=_sCheckVForm.substr(asTriggerItemSourceVFormComponents[0].length);for(var i=0;(iRet<0)&&(i<asVFormList.length);i++)
{var sRegexp=asVFormList[i]+sEndCheck;if(sRegexp.indexOf("[*]")!=-1)
{sRegexp=sRegexp.replace(/\./g,"\\.");sRegexp=sRegexp.replace(/\[\*]/g,"\\.[0-9a-zA-Z]+");sRegexp="^"+sRegexp+"$";if(new RegExp(sRegexp,"g").test(_sSourceVForm))
{iRet=i;}}
else
{if(sRegexp==_sSourceVForm)
{iRet=i;}}}}
else
{}}
else
{}}
else
{var sRegexp=_sCheckVForm;if(sRegexp.indexOf("[*]")!=-1)
{sRegexp=sRegexp.replace(/\./g,"\\.");sRegexp=sRegexp.replace(/\[\*]/g,"\\.[0-9a-zA-Z]+");sRegexp="^"+sRegexp+"$";if(new RegExp(sRegexp,"g").test(_sSourceVForm))
{iRet=TriggerTable.Const.VFORM_MATCH;}}
else
{if(sRegexp==_sSourceVForm)
{iRet=TriggerTable.Const.VFORM_MATCH;}}}}
return iRet;},FindAllIndex:function(_sSourceVForm,_sSourceEvent,_oCollection)
{var aiIndexes=new Array();if((_sSourceVForm==null)||(!YAHOO.lang.isString(_sSourceVForm))||(_sSourceVForm.indexOf('[')>=0))
{}
else if((_sSourceEvent!=null)&&(!YAHOO.lang.isString(_sSourceEvent)))
{}
else if((_oCollection!=null)&&(!_oCollection instanceof Collection))
{}
else
{if(YAHOO.lang.isUndefined(_sSourceEvent))
{_sSourceEvent=null;}
for(var i=0;i<this.moTriggerList.length;i++)
{var oItem=this.moTriggerList[i];var sSourceVForm=oItem.GetSourceVForm();var sSourceEvent=oItem.GetSourceEvent();var iMatchingIndex=this.CheckMatchingVForm(_sSourceVForm,sSourceVForm,_oCollection);if((iMatchingIndex>=TriggerTable.Const.VFORM_MATCH)&&((_sSourceEvent==sSourceEvent)||(sSourceEvent==null)))
{var iCollectionIndex=null;var iArrayIndex=i;if(iMatchingIndex>=0)
{iCollectionIndex=iMatchingIndex;}
aiIndexes.push(new Array(iArrayIndex,iCollectionIndex));}}}
return aiIndexes;},GetEventTable:function(_sSourceVForm,_sSourceEvent,_sReturnType,_sEventDelay,_oCollection,_bFirstCall,_iRecurseCount)
{var oEventTable=new EventTable();if(YAHOO.lang.isUndefined(_iRecurseCount))
{_iRecurseCount=0;}
if(!YAHOO.lang.isBoolean(_bFirstCall))
{_bFirstCall=true;}
if(!(_oCollection instanceof Collection))
{_oCollection=new Collection();}
if(!YAHOO.lang.isString(_sSourceVForm)||!$(_sSourceVForm))
{}
else if(!YAHOO.lang.isString(_sSourceEvent)&&_sSourceEvent!=null)
{}
else if(_iRecurseCount>TriggerTable.Const.MAX_RECURSE)
{}
else
{if(YAHOO.lang.isString(_sSourceVForm)&&(_sEventDelay==Matrix3.Const.DELAY_BUFFERED||_sEventDelay==Matrix3.Const.DELAY_IMMEDIAT)&&(_sReturnType==Matrix3.Const.RETURNTYPE_FULL||_sReturnType==Matrix3.Const.RETURNTYPE_VIEWSTATE))
{var oEventItem;if(_sEventDelay==Matrix3.Const.DELAY_IMMEDIAT)
{var aiIndexes=this.FindAllIndex(_sSourceVForm,_sSourceEvent,_oCollection);for(var i=0;i<aiIndexes.length;i++)
{var oTriggerItem=this.moTriggerList[aiIndexes[i][0]];var asTargetVForms=this.GetComponents(oTriggerItem.GetTargetVForm(),_oCollection,aiIndexes[i][1]);if(asTargetVForms!=null)
{var oTempEventTable=new EventTable();for(var j=0;j<asTargetVForms.length;j++)
{if($(asTargetVForms[j]))
{oEventItem=new EventItem(_sSourceVForm,_sSourceEvent,_sReturnType,asTargetVForms[j],oTriggerItem.GetTargetEvent(),oTriggerItem.GetTargetType(),Matrix3.Const.DELAY_IMMEDIAT);oEventTable.AddEventItem(oEventItem);var oEventTableDependencies=this.GetEventTable(asTargetVForms[j],oTriggerItem.GetTargetEvent(),oTriggerItem.GetTargetType(),_sEventDelay,_oCollection,false,_iRecurseCount+1);oTempEventTable.Merge(oEventTableDependencies);}}
oEventTable.Merge(oTempEventTable);}
else
{}}}
if(_bFirstCall&&(oEventTable.moEventList.length==0))
{oEventItem=new EventItem(_sSourceVForm,_sSourceEvent,_sReturnType,null,null,null,_sEventDelay);oEventTable.AddEventItem(oEventItem);}}}
return oEventTable;},GetComponents:function(_sExpression,_oCollection,_iIndex)
{var bParameters=true;var asIDs=null;if(!YAHOO.lang.isString(_sExpression))
{bParameters=false;}
if(!(_oCollection instanceof Collection))
{bParameters=false;}
if(!YAHOO.lang.isNumber(_iIndex))
{_iIndex=null;}
if(bParameters)
{asIDs=new Array();var bResult=false;var oRegexp=new RegExp("^([^\\]{[*#}]*)([{[][*#][\\]}])(.*)$");if(_sExpression.match(oRegexp))
{var asMatches=oRegexp.exec(_sExpression);var iIndex=asMatches[1].lastIndexOf(Matrix3.Const.SEPARATOR_HIERARCHY);if(iIndex>0)
{sStart=asMatches[1].substr(0,iIndex);sIdentifier=asMatches[1].substring(iIndex+1,asMatches[1].length);}
else
{sStart="";sIdentifier=asMatches[1];}
var sCommand=asMatches[2];var sEnd=asMatches[3];var asItems=null;switch(sCommand)
{case"{*}":if(sStart=="")
{asItems=_oCollection.GetVFormList(sIdentifier);bResult=true;}
break;case"[*]":asItems=this.GetChilds(sIdentifier);if(asItems!=null)
{bResult=true;}
break;case"{#}":if(_iIndex!=null)
{var oItem=_oCollection.GetVFormList(sIdentifier)[_iIndex];if(YAHOO.lang.isString(oItem))
{asItems=new Array(oItem);bResult=true;}}
break;case"[#]":if(_iIndex!=null)
{var oItem=this.GetChilds(sIdentifier)[_iIndex];if(YAHOO.lang.isString(oItem))
{asItems=new Array(oItem);bResult=true;}}
break;}
if(bResult&&asItems!=null)
{for(var i=0;i<asItems.length;i++)
{var sNewExpression=asItems[i]+sEnd;var asArray=this.GetComponents(sNewExpression,_oCollection);if(asArray!=null)
{asIDs=asIDs.concat(asArray);}
else
{bResult=false;}}}}
else if(_sExpression.match("^[^\\]{[*#}]*$"))
{asIDs.push(_sExpression);bResult=true;}
if(!bResult)
{asIDs=null;}}
return asIDs;},GetChilds:function(_sVFormID)
{var bParameters=true;var asChildIDs=null;if(!YAHOO.lang.isString(_sVFormID))
{bParameters=false;}
if(bParameters)
{var oElement=$(_sVFormID);if(oElement!=null&&(oElement.id!=null&&oElement.id!=undefined&&oElement.id!=""))
{var oNodeChilds=oElement.childNodes;asChildIDs=new Array();for(var i=0;i<oNodeChilds.length;i++)
{if(oNodeChilds[i]!=null&&(oNodeChilds[i].id!=null&&oNodeChilds[i].id!=undefined&&oNodeChilds[i].id!=""))
{asChildIDs.push(oNodeChilds[i].id);}}}}
return asChildIDs;}};function VFormInfoItem(_sVFormID,_sVFormSubID,_sPersistant,_sVFormParent,_sVFormPanel)
{if(YAHOO.lang.isString(_sVFormID))
{this.msVFormID=_sVFormID;}
else
{this.msVFormID=null;}
if(YAHOO.lang.isString(_sVFormSubID)||_sVFormSubID==null)
{this.msSubID=_sVFormSubID;}
else
{this.msSubID=null;}
if(YAHOO.lang.isString(_sPersistant)||_sPersistant==null)
{this.msPersistant=_sPersistant;}
else
{this.msPersistant=null;}
if(YAHOO.lang.isString(_sVFormParent)||_sVFormParent==null)
{this.msVFormParent=_sVFormParent;}
else
{this.msVFormParent=null;}
if(YAHOO.lang.isString(_sVFormPanel)||_sVFormPanel==null)
{this.msVFormPanel=_sVFormPanel;}
else
{this.msVFormPanel=null;}}
VFormInfoItem.Const={FIELD_PERSISTANT:"VS",FIELD_ACTIONLIST:"AL",FIELD_COLLECTIONLIST:"CL",ACTIONLIST_PARENT:"P",FIELD_VFORMPARENT:"PV",FIELD_VFORMPANEL:"PP",ACTIONLIST_NEXTVFORM:"N",ACTIONLIST_ACTION:"A",ACTIONLIST_ACTION_ADD:"A",ACTIONLIST_ACTION_REMOVE:"R",ACTIONLIST_LAYOUT:"L",ACTIONLIST_LAYOUT_INLINE:"I",ACTIONLIST_LAYOUT_POPUP:"P",ACTIONLIST_ID:"ID",ACTIONLIST_EFFECT:"E",ACTIONLIST_VIRTUALID:"VI",FIELD_DEFAULTACTION:"DA",FIELD_REFRESHLIST:"RL",FIELD_XMLCONTENT:"X",FIELD_SUB_ID:"S"};VFormInfoItem.prototype={GetObjectToSerialize:function()
{var oHash=new Object();oHash[VFormInfoItem.Const.FIELD_PERSISTANT]=this.msPersistant;oHash[VFormInfoItem.Const.FIELD_SUB_ID]=this.msSubID;oHash[VFormInfoItem.Const.FIELD_VFORMPARENT]=this.msVFormParent;oHash[VFormInfoItem.Const.FIELD_VFORMPANEL]=this.msVFormPanel;oHash[VFormInfoItem.Const.FIELD_COLLECTIONLIST]=Matrix3.moCollection.GetVFormIndexes(this.msVFormID);return oHash;},GetID:function()
{return this.msVFormID;},GetSubID:function()
{return this.msSubID;},GetVFormPanel:function()
{return this.msVFormPanel;},GetSubID:function()
{return this.msSubID;},GetPersistant:function()
{return this.msPersistant;},GetVFormParent:function()
{return this.msVFormParent;}};function VFormInfoTable(){this.moVFormInfoTable=new Object();}
VFormInfoTable.prototype={AddVFormInfoItem:function(_oVFormInfoItem)
{var bResult=false;if(_oVFormInfoItem instanceof VFormInfoItem)
{this.moVFormInfoTable[_oVFormInfoItem.GetID()]=_oVFormInfoItem;bResult=true;}
return bResult;},Serialize:function()
{var oTempHash=new Object();for(var sKey in this.moVFormInfoTable)
{oTempHash[sKey]=this.moVFormInfoTable[sKey].GetObjectToSerialize();}
var sResult=JSON.stringify(oTempHash);return sResult;}};var Event=YAHOO.util.Event;var DDM=YAHOO.util.DragDropMgr;var DragDropMgr={mbIsDrag:false,mbIsReorder:false,masRulers:new Array(),moCurrentHRuler:null,moCurrentVRuler:null,moDDObjects:new Object(),IsDrag:function()
{return this.mbIsDrag;},SetDrag:function(_bIsDrag)
{this.mbIsDrag=_bIsDrag;},AddRuler:function(_sPosition,_sAlign,_oParentDiv)
{if(_sAlign.toLowerCase()=="horizontal")
{var iY=Utils.GetY(_oParentDiv)+parseInt(_sPosition);this.masRulers.push(new Array(iY,_sAlign,_oParentDiv));}
else
{var iX=Utils.GetX(_oParentDiv)+parseInt(_sPosition);this.masRulers.push(new Array(iX,_sAlign,_oParentDiv));}},GetCurrentVRuler:function()
{return this.moCurrentVRuler;},GetCurrentHRuler:function()
{return this.moCurrentHRuler;},ClearRulers:function()
{this.masRulers=new Array();},CleanCurrentHRuler:function()
{if(this.moCurrentHRuler)
{$RemoveClass(this.moCurrentHRuler[2],DragDropMgr.Const.CLASS_HRULER_OVER);this.moCurrentHRuler=null;}},CleanCurrentVRuler:function()
{if(this.moCurrentVRuler)
{$RemoveClass(this.moCurrentVRuler[2],DragDropMgr.Const.CLASS_VRULER_OVER);this.moCurrentVRuler=null;}},GetRulers:function()
{return this.masRulers;},UpdateHRuler:function(_oRuler)
{var bChanged=false;if(this.moCurrentHRuler!=_oRuler)
{if(this.moCurrentHRuler)
{$RemoveClass(this.moCurrentHRuler[2],DragDropMgr.Const.CLASS_HRULER_OVER);}
$AddClass(_oRuler[2],DragDropMgr.Const.CLASS_HRULER_OVER);bChanged=true;this.moCurrentHRuler=_oRuler;}
return bChanged;},UpdateVRuler:function(_oRuler)
{var bChanged=false;if(this.moCurrentVRuler!=_oRuler)
{if(this.moCurrentVRuler)
{$RemoveClass(this.moCurrentVRuler[2],DragDropMgr.Const.CLASS_VRULER_OVER);}
$AddClass(_oRuler[2],DragDropMgr.Const.CLASS_VRULER_OVER);bChanged=true;this.moCurrentVRuler=_oRuler;}
return bChanged;},RefreshNode:function(_sID)
{this.moDDObjects[_sID].unreg();delete this.moDDObjects[_sID];},AddDDObject:function(_oID)
{this.moDDObjects[_oID.id]=_oID;},GetDDObject:function(_sId)
{return this.moDDObjects[_sId];}};DragDropMgr.Const={CLASS_VRULER_OVER:"VRulerOver",CLASS_HRULER_OVER:"HRulerOver",RULER_ATTRACTION:10,MGR_NAME:"DragDropMgr"};function DraggableItem(_sID,_sGroup,_oConfig,_bReorder,_sNotScroll,_sColor,_sProxyMode,_sVFormEffects,_sPleaseWaitMsg,_sProxyMessage,_sVirtualID,_sPageVirtualID,_sDropPriority,_sReturnType,_sReorderMode,_bDontMoveWhenReorder)
{this.mbIsReorder=_bReorder;this.moReorderProxy=new Object();this.msHighlightColor=_sColor;this.msProxyMode=_sProxyMode;this.msVFormEffects=_sVFormEffects;this.msPleaseWaitMsg=_sPleaseWaitMsg;this.msProxyMessage=_sProxyMessage;this.msVirtualID=_sVirtualID;this.msPageVirtualID=_sPageVirtualID;this.mbMouseIsOver=false;this.msReturnType=_sReturnType;this.msReorderMode=_sReorderMode;this.mbDontMoveWhenReorder=_bDontMoveWhenReorder;if(Utils.IsIE())
{Utils.AddEvent(_sID,"mouseover",function(e)
{if(Utils.IsMouseLeaveOrEnter(e,_sID))
{this.mbMouseIsOver=true;}},this);Utils.AddEvent(_sID,"mouseout",function(e)
{if(Utils.IsMouseLeaveOrEnter(e,_sID))
{this.mbMouseIsOver=false;}},this);}
if(_bReorder)
{DragDropMgr.mbIsReorder=true;}
_sDropPriority=parseInt(_sDropPriority);if(isNaN(_sDropPriority))
{this.miDropPriority=0;}
else
{this.miDropPriority=_sDropPriority;}
if($(DraggableItem.Const.DRAGELEMENT_ID)==null)
{var oDrag=document.createElement("div");oDrag.id=DraggableItem.Const.DRAGELEMENT_ID;$SetStyle(oDrag,"position","absolute");document.body.appendChild(oDrag);}
var bScroll=(_sNotScroll==""||_sNotScroll=="false"||_sNotScroll=="0");DraggableItem.superclass.constructor.call(this,_sID,_sGroup,{dragElId:DraggableItem.Const.DRAGELEMENT_ID,scroll:bScroll});$(_sID).onselectstart=function(){return false;}
this.miLastX=0;this.miLastY=0;this.mbInsertBefore=true;var oElement=$PI(_sID);var sHandle=oElement.GetProperty(ConstProperties.Const.HANDLE);if(sHandle!=null)
{var oHandle=$PI(oElement.GetBrotherId(sHandle));if(oHandle!=null)
{this.setHandleElId(oHandle);}}};DraggableItem.Const={SUFFIX_PROXY:"_Proxy",FEEDBACK_CLASS:"DragDrop_Feedback",FEEDBACK_INVALID_CLASS:"DragDrop_FeedbackInvalid",PROXY_CLASS:"DragDrop_Proxy",DRAGELEMENT_ID:"DragDrop_DragElement",ISDRAG_CLASS:"DragDrop_IsDrag",REORDERPROXY_ID:"DragDrop_ReorderProxy",REORDERPROXY_CLASS:"DragDrop_ReorderProxy",KEY_NEXT_VFORM_ID:"NextVFormID",KEY_PREVIOUS_VFORM_ID:"PreviousVFormID",INSERT_AFTER_CLASS:"InsertAfter",INSERT_PREVIOUS_CLASS:"InsertBefore",CONTROL_IMAGEPANEL:"ImagePanel",CLASS_OVERTARGET:"OverTarget",CLASS_DRAG_DROP_HORIZONTAL:"DragDrop_Feedback_H",CLASS_DRAG_DROP_VERTICAL:"DragDrop_Feedback_V",PROXY_IMAGE_SIZE:100,PROXY_MODE_IMAGE:"Image",CLASS_PROXY:"Proxy",ID_PROXY_MESSAGE:"DragProxyMessage",REORDER_MODE_VERTICAL:"vertical"};YAHOO.extend(DraggableItem,YAHOO.util.DDProxy,{startDrag:function(x,y)
{if($Control(this.msOriginalID,PanelAdvancedCtrl.Const.CONTROL_NAME).Event_StartDrag)
{$Control(this.msOriginalID,PanelAdvancedCtrl.Const.CONTROL_NAME).Event_StartDrag.Fire();}
this.mbMouseIsOver=true;var asGroups=MultipleSelectionMgr.GetInstance().GetItemsFromGroupsIn(this.id);this.masGroups=new Array();var bIDInsert=false;if(asGroups!=null&&asGroups.length>0)
{for(var i=0;i<asGroups.length;i++)
{if(asGroups[i].GetID()==this.id)
{bIDInsert=true;}
this.masGroups.push(asGroups[i].GetID());$AddClass(asGroups[i].GetID(),DraggableItem.Const.ISDRAG_CLASS);}}
if(!bIDInsert)
{this.masGroups.push(this.id);}
$AddClass(this.getEl(),DraggableItem.Const.ISDRAG_CLASS);$AddClass(this.getDragEl(),DraggableItem.Const.FEEDBACK_CLASS);$AddClass(this.getDragEl(),DraggableItem.Const.FEEDBACK_INVALID_CLASS);this.getDragEl().innerHTML='<div id="'+DraggableItem.Const.ID_PROXY_MESSAGE+'" class="'+((this.msProxyMessage=='')?StyleMgr.Const.CLASS_INVISIBLE:'')+'">'+this.msProxyMessage+'</div>';if(this.msProxyMode==DraggableItem.Const.PROXY_MODE_IMAGE)
{var oImageChild=null;var oImageChildren=$(this.id).getElementsByTagName("img");for(var i=0;i<oImageChildren.length;i++)
{oImageChild=oImageChildren.item(i).parentNode;if($HasClass(oImageChild,DraggableItem.Const.CLASS_PROXY)||$HasClass(oImageChild.parentNode,DraggableItem.Const.CLASS_PROXY)||$HasClass(oImageChild.parentNode.parentNode,DraggableItem.Const.CLASS_PROXY))
{break;}}
if(!oImageChild&&oImageChildren.length>0)
{oImageChild=oImageChildren.item(0).parentNode;}
if(oImageChild)
{this.getDragEl().innerHTML+=Utils.CloneNode(oImageChild).innerHTML;var oImg=this.getDragEl().getElementsByTagName("img").item(0);var iWidth=Utils.GetWidth(oImg,true);var iHeight=Utils.GetHeight(oImg,true);if(iWidth>iHeight)
{if(iWidth>DraggableItem.Const.PROXY_IMAGE_SIZE)
{iHeight=Math.round(iHeight/iWidth*DraggableItem.Const.PROXY_IMAGE_SIZE);iWidth=DraggableItem.Const.PROXY_IMAGE_SIZE;}}
else if(iHeight>DraggableItem.Const.PROXY_IMAGE_SIZE)
{iWidth=Math.round(iWidth/iHeight*DraggableItem.Const.PROXY_IMAGE_SIZE);iHeight=DraggableItem.Const.PROXY_IMAGE_SIZE;}
$SetStyle(oImg,"width",iWidth+"px");$SetStyle(oImg,"height",iHeight+"px");$SetStyle(oImg,"opacity",0.75);}}
else
{this.getDragEl().innerHTML+="";$SetStyle(this.getDragEl(),"width","22px");$SetStyle(this.getDragEl(),"height","22px");}
$SetStyle(this.getDragEl(),"display","block");DragDropMgr.SetDrag(true);},handleMouseDown:function(e,oDD)
{var button=e.which||e.button;if(this.primaryButtonOnly&&button>1)
{return;}
if(this.isLocked())
{return;}
this.b4MouseDown(e);this.onMouseDown(e);var pt=new YAHOO.util.Point(Event.getPageX(e),Event.getPageY(e));if(this.hasOuterHandles||this.DDM.isOverTarget(pt,this))
{if(this.clickValidator(e))
{this.setStartPosition();this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}}},setDragElPos:function(iPageX,iPageY)
{var oEl=this.getDragEl();iPageX=iPageX-20;iPageY=iPageY-20;$SetStyle(oEl,"top",iPageY+"px");$SetStyle(oEl,"left",iPageX+"px");this.cachePosition(iPageX,iPageY);this.autoScroll(iPageX,iPageY,oEl.offsetHeight,oEl.offsetWidth);},onDrag:function(e)
{Utils.GetMousePosition(e);var iX=Event.getPageX(e);var iY=Event.getPageY(e);if(this.msReorderMode==DraggableItem.Const.REORDER_MODE_VERTICAL)
{if(Math.abs(iY-this.miLastY)>1)
{this.mbInsertBefore=(iY<this.miLastY);this.miLastY=iY;}}
else
{if(Math.abs(iX-this.miLastX)>5)
{this.mbInsertBefore=(iX<this.miLastX);this.miLastX=iX;}}
var asRulers=DragDropMgr.GetRulers();var mbHFound=false;var mbVFound=false;for(var i=0;i<asRulers.length;i++)
{if(!mbHFound&&asRulers[i][1].toLowerCase()=="horizontal"&&iY>asRulers[i][0]&&iY<(asRulers[i][0]+DragDropMgr.Const.RULER_ATTRACTION))
{if(DragDropMgr.UpdateHRuler(asRulers[i],DragDropMgr.Const.CLASS_HRULER_OVER))
{$AddClass(this.getDragEl(),DraggableItem.Const.CLASS_DRAG_DROP_HORIZONTAL);}
$SetStyle(this.getDragEl(),"top",(asRulers[i][0]-19)+"px");mbHFound=true;}
if(!mbVFound&&asRulers[i][1].toLowerCase()=="vertical"&&iX>asRulers[i][0]&&iX<(asRulers[i][0]+DragDropMgr.Const.RULER_ATTRACTION))
{if(DragDropMgr.UpdateVRuler(asRulers[i],DragDropMgr.Const.CLASS_VRULER_OVER))
{$AddClass(this.getDragEl(),DraggableItem.Const.CLASS_DRAG_DROP_VERTICAL);}
$SetStyle(this.getDragEl(),"left",(asRulers[i][0]-19)+"px");mbVFound=true;}}
if(!mbHFound)
{DragDropMgr.CleanCurrentHRuler();$RemoveClass(this.getDragEl(),DraggableItem.Const.CLASS_DRAG_DROP_HORIZONTAL);}
if(!mbVFound)
{DragDropMgr.CleanCurrentVRuler();$RemoveClass(this.getDragEl(),DraggableItem.Const.CLASS_DRAG_DROP_VERTICAL);}},onDragDrop:function(e,id)
{var oDD;var bResult=false;if("string"==typeof id)
{oDD=YAHOO.util.DDM.getDDById(id,true);}else
{oDD=YAHOO.util.DDM.getBestMatch(id);}
$RemoveClass(id,DraggableItem.Const.CLASS_OVERTARGET);var sNextVFormID;if(oDD instanceof DroppableItem&&(!oDD.mbIsReorder||(oDD.mbIsReorder&&!this.mbIsReorder))&&(!Utils.IsIE()||!this.mbMouseIsOver))
{var aoArguments=new Array();var asCommandArgs=new Array();if(this.moReorderProxy.msLastInsertID)
{this.masGroups=MultipleSelectionMgr.GetInstance().Sort(this.masGroups,this.moReorderProxy.msLastInsertID,this.moReorderProxy.mbInsertBefore,false);$RemoveClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_PREVIOUS_CLASS);$RemoveClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_AFTER_CLASS);}
var sPanelDropID=oDD.id.split(Matrix3.Const.SEPARATOR_CONTROL)[1];for(var i=0;i<this.masGroups.length;i++)
{var oDragElement=YAHOO.util.DDM.getDDById(this.masGroups[i],false);if(oDragElement!=null)
{var asID=this.masGroups[i].split(Matrix3.Const.SEPARATOR_CONTROL);var oArg=new Object();oArg[Matrix3.Const.ARG_VFORMID]=asID[0];oArg[Matrix3.Const.ARG_PANEL]=sPanelDropID;asCommandArgs.push(asID[0]);if(asID.length>=1)
{oArg[Matrix3.Const.ARG_CONTROL]=asID[1];}
var asGroupSelected=new Array();for(var sGroup in oDragElement.groups)
{asGroupSelected.push(sGroup);}
if(asGroupSelected.length>0)
{oArg[Matrix3.Const.ARG_GROUPS]=asGroupSelected.join(',');}
var aiCoord=Utils.GetMousePosition(e);var iSourceX=Utils.GetX(id);var iSourceY=Utils.GetY(id);var iX=(aiCoord[0]-iSourceX);var iY=(aiCoord[1]-iSourceY);var oCurrentHRuler=DragDropMgr.GetCurrentHRuler();if(oCurrentHRuler)
{iY=oCurrentHRuler[0]-iSourceY;}
var oCurrentVRuler=DragDropMgr.GetCurrentVRuler();if(oCurrentVRuler)
{iX=oCurrentVRuler[0]-iSourceX;}
DragDropMgr.CleanCurrentHRuler();DragDropMgr.CleanCurrentVRuler();oArg[Matrix3.Const.ARG_COORDX]=""+Math.round(iX);oArg[Matrix3.Const.ARG_COORDY]=""+Math.round(iY);var sDestVFormID=$(id.split(Matrix3.Const.SEPARATOR_CONTROL)[0]);var sNextID=(sDestVFormID.nextSibling)?sDestVFormID.nextSibling.id:null;oArg[Matrix3.Const.ARG_NEXT_VFORMID]=sNextID;var sPreviousID=(sDestVFormID.previousSibling)?sDestVFormID.previousSibling.id:null;oArg[Matrix3.Const.ARG_PREVIOUS_VFORMID]=sPreviousID;var oSelectedItem=MultipleSelectionMgr.GetInstance().GetSelectedItemByID(this.masGroups[i]);if(oSelectedItem!=null)
{if(!oSelectedItem.IsKeepSelected())
{oSelectedItem.DeselectItem();}
oArg[Matrix3.Const.ARG_POSITION]=""+oSelectedItem.GetIndex();if(this.moReorderProxy.msLastInsertID&&oDD.mbIsReorder)
{var sVFormID=this.moReorderProxy.msLastInsertID.split(Matrix3.Const.SEPARATOR_CONTROL)[0];if(this.moReorderProxy.mbInsertBefore)
{sNextVFormID=sVFormID;}
else
{if($(sVFormID).nextSibling)
{sNextVFormID=$(sVFormID).nextSibling.id;}}
oArg[Matrix3.Const.ARG_NEXT_VFORMID]=sNextVFormID;}}}
aoArguments.push(oArg);}
var sRealID;if(sNextVFormID)
{sRealID=sNextVFormID;}
else
{var asID=id.split(Matrix3.Const.SEPARATOR_CONTROL);sRealID=asID[0];}
var sCommand=this.msReturnType==Matrix3.Const.RETURNTYPE_FULL?Matrix3.Const.COMMAND_DROP_F:Matrix3.Const.COMMAND_DROP_VS;Matrix3.AddEvent(sRealID,Matrix3.Const.EVENT_DROP,Matrix3.Const.RETURNTYPE_FULL,Matrix3.Const.DELAY_IMMEDIAT,JSON.stringify(aoArguments),sCommand,asCommandArgs,this.msVirtualID,'',this.msVFormEffects,false,this.msPleaseWaitMsg,false,this.msPageVirtualID);bResult=true;}
else if(oDD instanceof DroppableItem&&(!Utils.IsIE()||!this.mbMouseIsOver))
{var aoArguments=new Array();this.masGroups=MultipleSelectionMgr.GetInstance().Sort(this.masGroups,this.moReorderProxy.msLastInsertID,this.moReorderProxy.mbInsertBefore,true);var asCommandArgs=new Array();var oVForm=(this.moReorderProxy.mbInsertBefore)?this.moReorderProxy.moVForm:this.moReorderProxy.moVForm.nextSibling;for(var i=0;i<this.masGroups.length;i++)
{var asID=this.masGroups[i].split(Matrix3.Const.SEPARATOR_CONTROL);asCommandArgs.push(asID[0]);var oSelectedItem=MultipleSelectionMgr.GetInstance().GetSelectedItemByID(this.masGroups[i]);oSelectedItem.DeselectItem();var oItem=new Object();oItem["msVFormID"]=asID[0];oItem["miPosition"]=oSelectedItem.GetIndex();oItem["msParentVFormID"]=this.moReorderProxy.moVForm.id.substring(0,this.moReorderProxy.moVForm.id.lastIndexOf(Matrix3.Const.SEPARATOR_HIERARCHY));oItem["msBeforeVFormID"]=(oVForm==null)?null:oVForm.id;aoArguments.push(oItem);if(!this.mbDontMoveWhenReorder)
{var oChild=$(asID[0]);this.moReorderProxy.moVForm.parentNode.insertBefore(oChild,oVForm);oChild.moParent.AddControl(oChild,oChild,oVForm);oVForm=$(asID[0]).nextSibling;var oNode=$(asID[0]+Matrix3.Const.SEPARATOR_CONTROL+DraggableItem.Const.CONTROL_IMAGEPANEL);}}
PositionMgr.GetInstance().AddToDirtyXList(this.moReorderProxy.moVForm.moParent);PositionMgr.GetInstance().AddToDirtyYList(this.moReorderProxy.moVForm.moParent);this.moReorderProxy.moVForm.moParent.ForceHasChanged()
PositionMgr.GetInstance().CalculatePosition();$RemoveClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_PREVIOUS_CLASS);$RemoveClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_AFTER_CLASS);Matrix3.AddEvent("reorder",Matrix3.Const.EVENT_REORDER,Matrix3.Const.RETURNTYPE_FULL,Matrix3.Const.DELAY_IMMEDIAT,JSON.stringify(aoArguments),Matrix3.Const.COMMAND_REORDER,asCommandArgs,this.msVirtualID,'',this.msVFormEffects,false,this.msPleaseWaitMsg,false,this.msPageVirtualID);bResult=true;}
else if(this.moReorderProxy.moVForm)
{$RemoveClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_PREVIOUS_CLASS);$RemoveClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_AFTER_CLASS);}
return bResult;},endDrag:function()
{window.clearTimeout(DragDropMgr.moEndDragEvent);for(var i=0;i<this.masGroups.length;i++)
{$RemoveClass(this.masGroups[i],DraggableItem.Const.ISDRAG_CLASS);$RemoveClass(this.masGroups[i],MultipleSelectionMgr.Const.ITEM_OVER_CLASS);}
if($Control(this.msOriginalID,PanelAdvancedCtrl.Const.CONTROL_NAME).Event_EndDrag)
{if(isNaN($Control(this.msOriginalID,PanelAdvancedCtrl.Const.CONTROL_NAME).Event_EndDrag.miDelay))
{$Control(this.msOriginalID,PanelAdvancedCtrl.Const.CONTROL_NAME).Event_EndDrag.Fire();}
else
{var oSelf=this;window.setTimeout(function()
{if(!DragDropMgr.IsDrag()&&$Control(oSelf.msOriginalID,PanelAdvancedCtrl.Const.CONTROL_NAME).Event_EndDrag)
{$Control(oSelf.msOriginalID,PanelAdvancedCtrl.Const.CONTROL_NAME).Event_EndDrag.Fire();}},$Control(oSelf.msOriginalID,PanelAdvancedCtrl.Const.CONTROL_NAME).Event_EndDrag.miDelay);}}
$SetStyle(this.getDragEl(),"display","none");this.moReorderProxy=new Object();DragDropMgr.SetDrag(false);},onInvalidDrop:function(e)
{},onDragEnter:function(el,id)
{var oDD;if("string"==typeof id)
{oDD=YAHOO.util.DDM.getDDById(id,true);}else
{oDD=YAHOO.util.DDM.getBestMatch(id);}
if(oDD&&YAHOO.util.DragDropMgr.isLegalTarget(this,oDD)&&oDD instanceof DroppableItem)
{if(oDD.msProxyMessage!='')
{$(DraggableItem.Const.ID_PROXY_MESSAGE).innerHTML=oDD.msProxyMessage;$RemoveClass(DraggableItem.Const.ID_PROXY_MESSAGE,StyleMgr.Const.CLASS_INVISIBLE);}
$RemoveClass(this.getDragEl(),DraggableItem.Const.FEEDBACK_INVALID_CLASS);$AddClass(id,DraggableItem.Const.CLASS_OVERTARGET);if(oDD.mbIsReorder)
{var asID=id.split(Matrix3.Const.SEPARATOR_CONTROL);var oVForm=$(asID[0]);var oCurrentVFormID=this.id.split(Matrix3.Const.SEPARATOR_CONTROL)[0];var oParentNode=oVForm.parentNode;if(oParentNode)
{if(this.moReorderProxy.moVForm)
{$RemoveClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_AFTER_CLASS);$RemoveClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_PREVIOUS_CLASS);}
this.moReorderProxy.msLastInsertID=id;this.moReorderProxy.moVForm=oVForm;this.moReorderProxy.mbInsertBefore=this.mbInsertBefore;if(this.mbInsertBefore)
{$RemoveClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_AFTER_CLASS);$AddClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_PREVIOUS_CLASS);}
else
{$AddClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_AFTER_CLASS);$RemoveClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_PREVIOUS_CLASS);}}}}},onDragOver:function(el,id)
{var oDD;if("string"==typeof id)
{oDD=YAHOO.util.DDM.getDDById(id,true);}else
{oDD=YAHOO.util.DDM.getBestMatch(id);}
if(oDD&&YAHOO.util.DragDropMgr.isLegalTarget(this,oDD)&&oDD instanceof DroppableItem)
{$RemoveClass(this.getDragEl(),DraggableItem.Const.FEEDBACK_INVALID_CLASS);if(this.moReorderProxy&&this.moReorderProxy.msLastInsertID)
{this.moReorderProxy.mbInsertBefore=this.mbInsertBefore;if(this.mbInsertBefore)
{$RemoveClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_AFTER_CLASS);$AddClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_PREVIOUS_CLASS);}
else
{$AddClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_AFTER_CLASS);$RemoveClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_PREVIOUS_CLASS);}}}},onDragOut:function(el,id)
{var oDD;if("string"==typeof id)
{oDD=YAHOO.util.DDM.getDDById(id,true);}else
{oDD=YAHOO.util.DDM.getBestMatch(id);}
$RemoveClass(id,DraggableItem.Const.CLASS_OVERTARGET);var asVForm=id.split(Matrix3.Const.SEPARATOR_CONTROL);if(this.moReorderProxy&&this.moReorderProxy.moVForm&&this.moReorderProxy.moVForm.id==asVForm[0])
{$RemoveClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_PREVIOUS_CLASS);$RemoveClass(this.moReorderProxy.moVForm,DraggableItem.Const.INSERT_AFTER_CLASS);this.moReorderProxy.msLastInsertID=null;this.moReorderProxy.moVForm=null;}
if(oDD&&YAHOO.util.DragDropMgr.isLegalTarget(this,oDD)&&oDD instanceof DroppableItem&&(!this.moReorderProxy||!this.moReorderProxy.moVForm))
{if(this.msProxyMessage=='')
{$AddClass(DraggableItem.Const.ID_PROXY_MESSAGE,StyleMgr.Const.CLASS_INVISIBLE);}
else
{$RemoveClass(DraggableItem.Const.ID_PROXY_MESSAGE,StyleMgr.Const.CLASS_INVISIBLE);}
$(DraggableItem.Const.ID_PROXY_MESSAGE).innerHTML=this.msProxyMessage;$AddClass(this.getDragEl(),DraggableItem.Const.FEEDBACK_INVALID_CLASS);}}});function DroppableItem(_sID,_sGroup,_oConfig,_bReorder,_sProxyMessage,_sDropPriority)
{this.msProxyMessage=_sProxyMessage;_sDropPriority=parseInt(_sDropPriority);if(isNaN(_sDropPriority))
{this.miDropPriority=0;}
else
{this.miDropPriority=_sDropPriority;}
DroppableItem.superclass.constructor.call(this,_sID,_sGroup,_oConfig);this.mbIsReorder=_bReorder;$(_sID).onselectstart=function(){return false;};}
YAHOO.extend(DroppableItem,YAHOO.util.DDTarget,{});var Effect={Pulse:function(_sID,_iDuration,_bInfinite)
{var oID=$(_sID,true);var oAnim=null;if(YAHOO.env.ua.ipad)_iDuration=0;if(isNaN(_iDuration))
{_iDuration=Effect.Const.DEFAULT_DURATION;}
if(oID!=null&&$S(oID,"display")=="block")
{var oAnim=Effect.Fade(oID,_iDuration,0.3);oAnim.onComplete.subscribe(function(){var oID=$(_sID,true);if(oID!=null&&$S(oID,"display")=="block")
{var oEff=Effect.Appear(oID,_iDuration,0.3);if(_bInfinite)
{oEff.onComplete.subscribe(function()
{var oID=$(_sID,true);var oReAnim=Effect.Pulse(oID,_iDuration,true);if(oReAnim&&oID!=null)
{window.setTimeout(function(){oReAnim.animate();},1);}});}
oEff.animate();}});}
return oAnim;},Fade:function(_sID,_iDuration,_iBase)
{var oID=$(_sID);if(_iBase==null||isNaN(_iBase))
{_iBase=0;}
if(YAHOO.env.ua.ipad)_iDuration=0;if(_iDuration==null||isNaN(_iDuration))
{_iDuration=Effect.Const.DEFAULT_DURATION;}
var oAtt={opacity:{from:1,to:_iBase}}
var oAnim=new YAHOO.util.Anim(oID,oAtt,_iDuration,YAHOO.util.Easing.easeNone);oAnim.msID=_sID;oAnim.onComplete.subscribe(function()
{if(_iBase==0)
{$SetStyle(this.msID,"display","none");}});return oAnim;},Appear:function(_sID,_iDuration,_iBase)
{var oID=$(_sID);if(_iBase==null||isNaN(_iBase))
{_iBase=0.01;}
if(YAHOO.env.ua.ipad)_iDuration=0;$SetStyle(oID,"opacity",_iBase);$SetStyle(oID,"display","block");if(_iDuration==null||isNaN(_iDuration))
{_iDuration=Effect.Const.DEFAULT_DURATION;}
var oAtt={opacity:{from:_iBase,to:1}}
var oAnim=new YAHOO.util.Anim(oID,oAtt,_iDuration);return oAnim;},Highlight:function(_sID,_iDuration,_sColor)
{var oID=$(_sID);if(YAHOO.env.ua.ipad)_iDuration=0;if(!_sColor||Utils.Trim(_sColor)=='')
{_sColor="rgb(255,0,0)";}
if(isNaN(_iDuration))
{_iDuration=Effect.Const.DEFAULT_DURATION;}
var sOldBg=$S(oID,"backgroundColor");var oAtt={backgroundColor:{to:_sColor}}
var oAnim=new YAHOO.util.ColorAnim(oID,oAtt,_iDuration/2);oAnim.backgroundColor=sOldBg;oAnim.onComplete.subscribe(function(){var oAtt={backgroundColor:{to:this.backgroundColor}}
var oAnim2=new YAHOO.util.ColorAnim(oID,oAtt,_iDuration/2);oAnim2.onComplete.subscribe(function()
{$SetStyle(oID,"backgroundColor","");});oAnim2.animate();});return oAnim;},Show:function(_sID)
{$SetStyle(_sID,"display","block");},Hide:function(_sID)
{$SetStyle(_sID,"display","none");},SlideBottom:function(_sID,_iDuration)
{var oID=$(_sID);if(YAHOO.env.ua.ipad)_iDuration=0;if(_iDuration==null||isNaN(_iDuration))
{_iDuration=Effect.Const.DEFAULT_DURATION;}
var oAtt={height:{from:Utils.GetHeight(oID,true),to:1}}
var oAnim=new YAHOO.util.Anim(oID,oAtt,_iDuration);oAnim.onComplete.subscribe(function()
{$SetStyle(oID,"display","none");});return oAnim;}};Effect.Const={EFFECT_NONE:"None",SEPARATOR_DURATION:"|",DEFAULT_DURATION:1};function FramesMgr()
{this.moFrames=new Object();};FramesMgr.Const={FRAME_PARAMETER_START:"&FRM=",FRAME_PARAMETER_END:"&",FRAME_PAIR_SEPARATOR:",",FRAME_NAME_CONTENT_SEPARATOR:":"}
FramesMgr.moSingleton=null;FramesMgr.GetInstance=function()
{if(!FramesMgr.moSingleton)
{FramesMgr.moSingleton=new FramesMgr();}
return FramesMgr.moSingleton;};FramesMgr.prototype={SetURL:function(_sURL)
{this.moFrames=new Object();var iFrameParameterStart=_sURL.indexOf(FramesMgr.Const.FRAME_PARAMETER_START);if(iFrameParameterStart!=-1)
{var sURL=_sURL.substr(iFrameParameterStart+FramesMgr.Const.FRAME_PARAMETER_START.length);var iFrameParameterEnd=sURL.indexOf(FramesMgr.Const.FRAME_PARAMETER_END);if(iFrameParameterEnd!=-1)
{sURL=sURL.substr(0,iFrameParameterEnd);}
var asFrameArray=sURL.split(FramesMgr.Const.FRAME_PAIR_SEPARATOR);for(var i=0;i<asFrameArray.length;i++)
{var sFrameNameContentPair=asFrameArray[i];var asFrame=sFrameNameContentPair.split(FramesMgr.Const.FRAME_NAME_CONTENT_SEPARATOR);if(asFrame.length==2)
{this.moFrames[asFrame[0]]=asFrame[1];}}}},GetFrameContent:function(_sFrameName)
{var sResult=null;if(this.moFrames.hasOwnProperty(_sFrameName))
{sResult=this.moFrames[_sFrameName];}
return sResult;},CurrentFramesString:function()
{var oResult=new StringBuilder();var sResult="";var bFramesFound=false;if(this.moFrames!=null)
{oResult.append(FramesMgr.Const.FRAME_PARAMETER_START);for(var sFrameName in this.moFrames)
{bFramesFound=true;oResult.append(sFrameName);oResult.append(FramesMgr.Const.FRAME_NAME_CONTENT_SEPARATOR);oResult.append(this.moFrames[sFrameName]);oResult.append(FramesMgr.Const.FRAME_PAIR_SEPARATOR);}}
if(bFramesFound)
{sResult=oResult.toString();sResult=sResult.substr(0,sResult.length-1);}
return sResult;}}
var JSON={copyright:'(c)2005 JSON.org',license:'http://www.crockford.com/JSON/license.html',stringify:function(v){var sResult=YAHOO.lang.JSON.stringify(v);return sResult;},parse:function(text){var oResult;if(YAHOO.env.ua.webkit<500&&YAHOO.env.ua.webkit>0)
{oResult=eval(text);}
else
{oResult=eval('('+text+')');}
return oResult;}};function MultipleSelectionMgr()
{this.moCollectionObjects=new Object();this.moSelectionItemGroups=new Object();this.moSelectionItems=new Object();this.moLastElements=new Object();};MultipleSelectionMgr.Const={MGR_NAME:"MultipleSelection",FLAG_NONE:0x00000000,FLAG_NOT_SELECT:0x00000001,FLAG_SELECTED:0x00000010,FLAG_ALL:0x00000011,ITEM_OVER_CLASS:"Over",DOUBLE_CLICK_INTERVAL:500};MultipleSelectionMgr.moSingleton=null;MultipleSelectionMgr.GetInstance=function(_bCheckControl)
{if(!MultipleSelectionMgr.moSingleton){MultipleSelectionMgr.moSingleton=new MultipleSelectionMgr();}
return MultipleSelectionMgr.moSingleton;};MultipleSelectionMgr.miTimer=0;MultipleSelectionMgr.miLastID="";MultipleSelectionMgr.Click=function(e,_oSelectedItem)
{var sID=_oSelectedItem.GetID();if(sID!=null)
{MultipleSelectionMgr.GetInstance().ClickOn(_oSelectedItem,e.ctrlKey||e.metaKey,e.shiftKey);var iDateTime=new Date().getTime();if(_oSelectedItem.moSrcObj.Event_DoubleClick&&iDateTime-MultipleSelectionMgr.miTimer<=MultipleSelectionMgr.Const.DOUBLE_CLICK_INTERVAL&&MultipleSelectionMgr.miLastID==_oSelectedItem.msID)
{_oSelectedItem.moSrcObj.Event_DoubleClick.Fire();}
MultipleSelectionMgr.miTimer=iDateTime;MultipleSelectionMgr.miLastID=_oSelectedItem.msID;}};MultipleSelectionMgr.Over=function(e,_oSelectedItem)
{if(DragDropMgr.IsDrag())return;if(this.moLastOver)
{$RemoveClass(this.moLastOver,MultipleSelectionMgr.Const.ITEM_OVER_CLASS);}
$AddClass(_oSelectedItem.GetID(),MultipleSelectionMgr.Const.ITEM_OVER_CLASS);this.moLastOver=_oSelectedItem.GetID();};MultipleSelectionMgr.Out=function(e,_oSelectedItem)
{$RemoveClass(_oSelectedItem.GetID(),MultipleSelectionMgr.Const.ITEM_OVER_CLASS);};MultipleSelectionMgr.prototype={Add:function(_sGroup,_oSelectedItem)
{var bParameters=true;var bResult=false;if(!YAHOO.lang.isString(_sGroup))
{bParameters=false;}
if(!(_oSelectedItem instanceof SelectionItem))
{bParameters=false;}
if(bParameters)
{if(!(_sGroup in this.moCollectionObjects))
{this.moCollectionObjects[_sGroup]=new FastArray();}
if(!(_oSelectedItem in this.moSelectionItemGroups))
{this.moSelectionItemGroups[_oSelectedItem]=new FastArray();}
bResult=(this.moCollectionObjects[_sGroup].Push(_oSelectedItem)&&this.moSelectionItemGroups[_oSelectedItem].Push(_sGroup));Matrix3.RegisterInCache(_oSelectedItem.toString(),MultipleSelectionMgr);this.moSelectionItems[_oSelectedItem.toString()]=_oSelectedItem;if(parseFloat(_oSelectedItem.GetIndex())&&_oSelectedItem.GetIndex()!=-1)
{var oLastSelectionItem=this.moLastElements[_sGroup];if(oLastSelectionItem!=null)
{if((oLastSelectionItem instanceof SelectionItem)&&oLastSelectionItem.miIndex<_oSelectedItem.GetIndex())
{oLastSelectionItem.miNextItem=_oSelectedItem;_oSelectedItem.miPreviousItem=oLastSelectionItem;this.moLastElements[_sGroup]=_oSelectedItem;}
else
{var oNextSelectionItem=oLastSelectionItem;var oPreviousSelectionItem=oLastSelectionItem.miPreviousItem;while(oPreviousSelectionItem!=null&&oPreviousSelectionItem.GetIndex()>_oSelectedItem.GetIndex())
{oNextSelectionItem=oPreviousSelectionItem;oPreviousSelectionItem=oPreviousSelectionItem.miPreviousItem;}
if(oPreviousSelectionItem!=null&&oPreviousSelectionItem.GetIndex()==_oSelectedItem.GetIndex())
{if(oPreviousSelectionItem.miNextItem!=null)
{oPreviousSelectionItem.miNextItem.miPreviousItem=_oSelectedItem;}
if(oPreviousSelectionItem.miPreviousItem!=null)
{oPreviousSelectionItem.miPreviousItem.miNextItem=_oSelectedItem;}}
else
{oNextSelectionItem.miPreviousItem=_oSelectedItem;_oSelectedItem.miNextItem=oNextSelectionItem;if(oPreviousSelectionItem!=null)
{_oSelectedItem.miPreviousItem=oPreviousSelectionItem;oPreviousSelectionItem.miNextItem=_oSelectedItem;}}}}
else
{this.moLastElements[_sGroup]=_oSelectedItem;}}
var oElement=$PI(_oSelectedItem.GetID());var sHandle=oElement.GetProperty(ConstProperties.Const.HANDLE);if(sHandle!=null)
{var oHandle=$PI(oElement.GetBrotherId(sHandle));if(oHandle!=null)
{oElement=oHandle;}}
Utils.AddEvent(oElement,"click",function(e){MultipleSelectionMgr.Click(e,_oSelectedItem);});Utils.AddEvent(oElement,"mouseover",function(e){MultipleSelectionMgr.Over(e,_oSelectedItem);});Utils.AddEvent(oElement,"mouseout",function(e){MultipleSelectionMgr.Out(e,_oSelectedItem);});}
return bResult;},ClickOn:function(_oSelectedItem,_bCtrl,_bShiftKey)
{if(_oSelectedItem in this.moSelectionItemGroups)
{var bSelected=false;var aoGroups=this.moSelectionItemGroups[_oSelectedItem].GetArray();for(var i=0;i<aoGroups.length;i++)
{if(_bShiftKey)
{var iPreviousClicked=-1;var sGroup=null;var aoItemArray=this.moCollectionObjects[aoGroups[i]].GetArray();for(var j=0;(iPreviousClicked<0)&&(j<aoItemArray.length);j++)
{if(aoItemArray[j].IsSelected())
{iPreviousClicked=j;sGroup=aoGroups[i];}}
if(iPreviousClicked>=0)
{this.DeselectAll(sGroup);var iNewClicked=this.moCollectionObjects[aoGroups[i]].moHash[_oSelectedItem];if(iNewClicked>=0)
{var iFirst=iPreviousClicked;var iLast=iNewClicked;if(iPreviousClicked>iNewClicked)
{iFirst=iNewClicked;iLast=iPreviousClicked;}
for(var k=iFirst;k<=iLast;k++)
{aoItemArray[k].SelectItem();}}
bSelected=true;}}
if(!bSelected)
{if(!_bCtrl&&_oSelectedItem.IsForceControl())
{this.DeselectGroup(aoGroups[i],_oSelectedItem);}
else
{_oSelectedItem.ChangeState();}}}}},DeselectGroup:function(_sGroup,_oSelectedItem)
{var bParameters=true;var bResult=false;if(!YAHOO.lang.isString(_sGroup)||!(_sGroup in this.moCollectionObjects))
{bParameters=false;}
if(!(_oSelectedItem instanceof SelectionItem)&&_oSelectedItem!=null)
{bParameters=false;}
if(bParameters)
{var aoItems=this.moCollectionObjects[_sGroup].GetArray();var iCpt=0;for(var i=0;i<aoItems.length;i++)
{if(_oSelectedItem!=aoItems[i]&&aoItems[i].IsSelected())
{aoItems[i].DeselectItem();iCpt++;}}
if(_oSelectedItem!=null)
{if(!_oSelectedItem.IsSelected())
{_oSelectedItem.SelectItem();}
else if(iCpt==0&&_oSelectedItem.IsSelected())
{_oSelectedItem.DeselectItem();}}
bResult=true;}
return bResult;},Remove:function(_sGroup,_oSelectedItem)
{var bParameters=true;var bResult=false;if(!YAHOO.lang.isString(_sGroup))
{bParameters=false;}
if(!(_oSelectedItem instanceof SelectionItem))
{bParameters=false;}
if(bParameters)
{if((_sGroup in this.moCollectionObjects)&&(_oSelectedItem in this.moSelectionItemGroups))
{bResult=this.moCollectionObjects[_sGroup].Remove(_oSelectedItem)&&this.moSelectionItemGroups[_oSelectedItem].Remove(_sGroup);if(this.moCollectionObjects[_sGroup].GetSize()==0)
{delete(this.moCollectionObjects[_sGroup]);}
if(this.moSelectionItemGroups[_oSelectedItem].GetSize()==0)
{delete(this.moSelectionItemGroups[_oSelectedItem]);}
delete(this.moSelectionItems[_oSelectedItem.toString()]);}}
return bResult;},GetObjects:function(_sGroup,_xSelectFlags,_sID)
{var bParameters=true;var aoArray=null;if(!YAHOO.lang.isString(_sGroup))
{bParameters=false;}
if(!YAHOO.lang.isNumber(_xSelectFlags))
{_xSelectFlags=MultipleSelectionMgr.Const.FLAG_ALL;}
if(bParameters)
{aoArray=new Array();if(_sGroup in this.moCollectionObjects)
{var aoItems=this.moCollectionObjects[_sGroup].GetArray();for(var i=0;i<aoItems.length;i++)
{var oItem=aoItems[i];if(_sID==oItem.GetID())
{aoArray.push(oItem);}
else if(((_xSelectFlags&MultipleSelectionMgr.Const.FLAG_SELECTED)==MultipleSelectionMgr.Const.FLAG_SELECTED)&&oItem.IsSelected())
{aoArray.push(oItem);}
else if(((_xSelectFlags&MultipleSelectionMgr.Const.FLAG_NOT_SELECT)==MultipleSelectionMgr.Const.FLAG_NOT_SELECT)&&!oItem.IsSelected())
{aoArray.push(oItem);}}}}
return aoArray;},GetItemsFromGroupsIn:function(_sID)
{var bParameters=true;var aoResult=null;if(!YAHOO.lang.isString(_sID))
{bParameters=false;}
if(bParameters)
{aoResult=new Array();if(_sID in this.moSelectionItemGroups)
{var asGroups=this.moSelectionItemGroups[_sID].GetArray();for(var i=0;i<asGroups.length;i++)
{var aoItems=this.GetObjects(asGroups[i],MultipleSelectionMgr.Const.FLAG_SELECTED,_sID);if(aoItems!=null)
{aoResult=aoResult.concat(aoItems);}}}}
return aoResult;},Contains:function(_sGroup,_oItem)
{var bParameters=true;var bResult=false;if(!YAHOO.lang.isString(_sGroup))
{bParameters=false;}
if(!(_oItem instanceof SelectionItem))
{bParameters=false;}
if(bParameters)
{if(_sGroup in this.moCollectionObjects&&this.moCollectionObjects[_sGroup].Exists(_oItem))
{bResult=true;}}
return bResult;},SelectAll:function(_sGroup)
{var bParameters=true;var bRet=false;if(!YAHOO.lang.isString(_sGroup))
{bParameters=false;}
if(bParameters)
{var aoObjects=this.GetObjects(_sGroup,MultipleSelectionMgr.Const.FLAG_NOT_SELECT);if(aoObjects!=null)
{for(var i=0;i<aoObjects.length;i++)
{aoObjects[i].SelectItem();}
bRet=true;}}
return bRet;},DeselectAll:function(_sGroup)
{var bParameters=true;var bRet=false;if(!YAHOO.lang.isString(_sGroup))
{bParameters=false;}
if(bParameters)
{var aoObjects=this.GetObjects(_sGroup,MultipleSelectionMgr.Const.FLAG_SELECTED);if(aoObjects!=null)
{for(var i=0;i<aoObjects.length;i++)
{aoObjects[i].DeselectItem();}
bRet=true;}
else
{}}
return bRet;},InvertAll:function(_sGroup)
{var bParameters=true;var bRet=false;if(!YAHOO.lang.isString(_sGroup))
{bParameters=false;}
if(bParameters)
{var aoObjects=this.GetObjects(_sGroup,MultipleSelectionMgr.Const.FLAG_ALL);if(aoObjects!=null)
{for(var i=0;i<aoObjects.length;i++)
{aoObjects[i].ChangeState();}
bRet=true;}
else
{}}
return bRet;},RefreshNode:function(_sID)
{var oArray=this.moSelectionItemGroups[_sID].GetArray();for(var i=0;i<oArray.length;i++)
{this.Remove(oArray[i],this.moSelectionItems[_sID]);}},GetSelectedItemByID:function(_sID)
{return this.moSelectionItems[_sID];},Sort:function(_asID,_sID,_bBefore,_bInsert)
{var oRefItem=this.GetSelectedItemByID(_sID);var iStartIndex=0;var iEndIndex;var oStartItem;var oEndItem;if(oRefItem&&oRefItem.miIndex>=0)
{if(_bBefore)
{iEndIndex=oRefItem.miIndex;oEndItem=oRefItem;iStartIndex=(oRefItem.miPreviousItem)?oRefItem.miPreviousItem.miIndex:0;oStartItem=oRefItem.miPreviousItem;}
else
{iEndIndex=(oRefItem.miNextItem)?oRefItem.miNextItem.miIndex:(oRefItem.miIndex+1);oEndItem=oRefItem.miNextItem;iStartIndex=oRefItem.miIndex;oStartItem=oRefItem;}
var fRatio=(iEndIndex-iStartIndex)/(_asID.length+1);for(var i=0;i<_asID.length;i++)
{var oItem=this.GetSelectedItemByID(_asID[i]);if(oItem&&oItem!=oStartItem)
{oItem.miIndex=iStartIndex+(fRatio*(i+1));if(_bInsert)
{if(oItem!=oEndItem)
{if(oItem.miPreviousItem)
{oItem.miPreviousItem.miNextItem=oItem.miNextItem;}
if(oItem.miNextItem)
{oItem.miNextItem.miPreviousItem=oItem.miPreviousItem;}
oItem.miPreviousItem=oStartItem;oItem.miNextItem=oEndItem;if(oItem.miPreviousItem)
{oItem.miPreviousItem.miNextItem=oItem;}
if(oItem.miNextItem)
{oItem.miNextItem.miPreviousItem=oItem;}
oStartItem=oItem;}
else if((i+1)<_asID.length)
{oStartItem=oEndItem;iEndIndex=oEndItem.miNextItem.miIndex;oEndItem=oEndItem.miNextItem;}}}}
var sCompareSrc=(iStartIndex+fRatio)+"";sCompareSrc=sCompareSrc.substring(0,15);var sCompareTo=iStartIndex+"";sCompareTo=sCompareTo.substring(0,15);if(parseFloat(sCompareSrc)==parseFloat(sCompareTo))
{var oFirstItem=oRefItem;while(oFirstItem.miPreviousItem)
{oFirstItem=oFirstItem.miPreviousItem;}
_asID=new Array();var iCpt=1;do
{oFirstItem.miIndex=iCpt;iCpt+=1;_asID.push(oFirstItem.GetID());oFirstItem=oFirstItem.miNextItem;}while(oFirstItem);}
for(var sKey in this.moCollectionObjects)
{this.moCollectionObjects[sKey].Sort(this.SortByIndex);}}
return _asID;},Refresh:function()
{for(var sKey in this.moCollectionObjects)
{this.moCollectionObjects[sKey].Sort(this.SortByIndex);}},SortByIndex:function(a,b)
{if(!isNaN(a.miIndex)&&!isNaN(b.miIndex))
{return a.miIndex-b.miIndex;}
else
{return 0;}}};function SelectionItem(_sID,_bForceCtrl,_sIdx,_sIsSelected,_sDeactivateSelection,_sKeepSelected,_oSrcObj)
{if(YAHOO.lang.isString(_sID))
{this.msID=_sID;if(_sIsSelected&&(_sIsSelected.toUpperCase()=="TRUE"||_sIsSelected=="1"))
{this.SelectItem();}
else
{this.mbIsSelected=false;}}
this.moSrcObj=_oSrcObj;if(YAHOO.lang.isBoolean(_bForceCtrl))
{this.mbForceCtrl=_bForceCtrl;}
else
{this.mbForceCtrl=false;}
if(Utils.Trim(_sKeepSelected)==""||_sKeepSelected=="0")
{this.mbKeepSelected=false;}
else
{this.mbKeepSelected=true;}
if(_sDeactivateSelection&&_sDeactivateSelection!='')
{this.mbDeactivateSelection=true;}
var iIndex=parseFloat(_sIdx);if(isNaN(iIndex))
{iIndex=-1;}
if(iIndex||_sIdx==0)
{this.miIndex=iIndex;}
if(!Matrix3.mbDebug)
{$PI(_sID).onselectstart=function(){return false;}}}
SelectionItem.Const={CLASS_SELECTED:"Selected"};SelectionItem.prototype={IsSelected:function()
{return this.mbIsSelected;},IsForceControl:function()
{return this.mbForceCtrl;},IsKeepSelected:function()
{return this.mbKeepSelected;},ChangeState:function(_bDisableEvent)
{if(this.mbIsSelected)
{this.DeselectItem(_bDisableEvent);}
else
{this.SelectItem(_bDisableEvent);}},GetID:function()
{return this.msID;},SelectItem:function(_bDisableEvent)
{if(this.mbDeactivateSelection)return;$AddClass(this.GetID(),SelectionItem.Const.CLASS_SELECTED);if(!_bDisableEvent&&$Control(this.GetID(),PanelAdvancedCtrl.Const.CONTROL_NAME).Event_SelectionChange)
{ClipboardProperties.msCache="1";$Control(this.GetID(),PanelAdvancedCtrl.Const.CONTROL_NAME).Event_SelectionChange.Fire();}
this.mbIsSelected=true;},DeselectItem:function(_bDisableEvent)
{$RemoveClass(this.GetID(),SelectionItem.Const.CLASS_SELECTED);if(!_bDisableEvent&&$Control(this.GetID(),PanelAdvancedCtrl.Const.CONTROL_NAME).Event_SelectionChange)
{ClipboardProperties.msCache="0";$Control(this.GetID(),PanelAdvancedCtrl.Const.CONTROL_NAME).Event_SelectionChange.Fire();}
this.mbIsSelected=false;},GetIndex:function()
{return this.miIndex;},toString:function()
{return this.msID;}};function StackMgr()
{this.miIndex=StackMgr.Const.START_INDEX;};StackMgr.moSingleton=null;StackMgr.GetInstance=function()
{if(!StackMgr.moSingleton)
{StackMgr.moSingleton=new StackMgr();}
return StackMgr.moSingleton;};StackMgr.Const={START_INDEX:100,INDEX_INCREMENT:5};StackMgr.prototype={GetIndex:function()
{this.miIndex+=StackMgr.Const.INDEX_INCREMENT;return this.miIndex;}};function StringBuilder(value)
{this.strings=new Array("");this.append(value);}
StringBuilder.prototype.append=function(value)
{if(value)
{this.strings.push(value);}};StringBuilder.prototype.clear=function()
{this.strings.length=1;};StringBuilder.prototype.toString=function()
{return this.strings.join("");};String.prototype.endsWith=function(str)
{var lastIndex=this.lastIndexOf(str);return(lastIndex!=-1)&&(lastIndex+str.length==this.length);}
function StyleMgr()
{this.mbIsActive=true;this.moStyleCache=new Object();this.moClassCache=new Object();if(document.defaultView&&document.defaultView.getComputedStyle){this._GetStyle=function(el,property){var value=null;if(property=='float'){property='cssFloat';}
value=el.style[property];if(!value)
{var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[property];}}
return value;};}else if(document.documentElement.currentStyle&&YAHOO.env.ua.ie){this._GetStyle=function(el,property){switch(property){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}
return val/100;case'float':property='styleFloat';default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{this._GetStyle=function(el,property){var sResult=el.style[property];return sResult;};}
if(YAHOO.env.ua.ie){this._SetStyle=function(el,property,val){switch(property){case'opacity':if(YAHOO.lang.isString(el.style.filter)){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}
break;case'float':property='styleFloat';default:if(val=="")
{el.style[property]="";}
else
{el.style[property]=val;}}};}else{this._SetStyle=function(el,property,val){if(property=='float'){property='cssFloat';}
if(val=="")
{el.style[property]="";}
else
{el.style[property]=val;}};}};StyleMgr.moSingleton=null;StyleMgr.GetInstance=function()
{if(!StyleMgr.moSingleton){StyleMgr.moSingleton=new StyleMgr();}
return StyleMgr.moSingleton;};StyleMgr.Const={CLASS_INVISIBLE:"InvisibleC",CLASS_WARNING:"Warn",MGR_NAME:"Style"};StyleMgr.prototype={HasClass:function(_oElem,_sClass)
{_oElem=$(_oElem);var bResult=false;if(_oElem)
{var oReg=null;if(_sClass in this.moClassCache)
{oReg=this.moClassCache[_sClass];}
else
{oReg=new RegExp('(?:^|\\s+)'+_sClass+'(?:\\s+|$)');this.moClassCache[_sClass]=oReg;}
bResult=oReg.test(_oElem.className);}
return bResult;},AddClass:function(_oElem,_sClass)
{_oElem=$(_oElem);if(_oElem&&!this.HasClass(_oElem,_sClass))
{_oElem.className=_oElem.className+" "+_sClass;}},SwitchClass:function(_oElem,_sClass)
{if($HasClass(_oElem,_sClass))
{$RemoveClass(_oElem,_sClass);}
else
{$AddClass(_oElem,_sClass);}},RemoveClass:function(_oElem,_sClass)
{_oElem=$(_oElem);if(_oElem&&this.HasClass(_oElem,_sClass))
{_oElem.className=_oElem.className.replace(this.moClassCache[_sClass]," ");_oElem.className=Utils.Trim(_oElem.className);}},ReplaceClass:function(_oElem,_sToReplace,_sNewClass)
{this.RemoveClass(_oElem,_sToReplace);this.AddClass(_oElem,_sNewClass);},GetStyle:function(_sID,_sStyle,_bForce)
{var oEl=$(_sID);if(!oEl)
{return null;}
var sResult="";if(oEl.id&&this.mbIsActive&&!_bForce)
{if(!(oEl.id in this.moStyleCache)||!(_sStyle in this.moStyleCache[oEl.id]))
{if(!(oEl.id in this.moStyleCache))
{this.moStyleCache[oEl.id]=new Object();Matrix3.RegisterInCache(oEl.id,StyleMgr);}
this.moStyleCache[oEl.id][_sStyle]=this._GetStyle(oEl,_sStyle);}
sResult=this.moStyleCache[oEl.id][_sStyle];}
else
{sResult=this._GetStyle(oEl,_sStyle);}
return sResult;},RefreshNode:function(_sID)
{delete(this.moStyleCache[_sID]);},SetStyle:function(_sID,_sStyleType,_sStyleValue)
{var oEl=$(_sID);if(!oEl)
{return;}
if(oEl.id&&this.mbIsActive)
{if(!(oEl.id in this.moStyleCache))
{this.moStyleCache[oEl.id]=new Object();Matrix3.RegisterInCache(oEl.id,StyleMgr);}
if(_sStyleValue!="")
{this.moStyleCache[oEl.id][_sStyleType]=_sStyleValue;}
else
{delete(this.moStyleCache[oEl.id][_sStyleType]);}}
this._SetStyle(oEl,_sStyleType,_sStyleValue);},Refresh:function()
{this.moStyleCache=new Object();}};var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&
