﻿if( typeof( Syncfusion_UtilityLibrary_version ) == "undefined" || Syncfusion_UtilityLibrary_version != "1.0" )
alert( "\"UtilityLibrary.js (1.0 version)\" not included!" );Syncfusion_BaseEdit_version = "1.0";///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
function SF_BaseEditTextBox( sRootID )
{
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
var m_oSelf = this;var c_etbTypeBrowser = null;var c_sAttrClntID = "ClntID";var c_sAttrClntText = "ClntText";var c_sAttrClntTooltip = "ClntTooltip";var c_sAttrClntValue = "ClntValue";var c_sAttrClntInstanceName = "ClntInstanceName";var c_sAttrClntTextBoxID = "ClntTextBoxID";var c_sOnValueChange = "ClientOnValueChange";var c_sOnMouseOver = "ClientOnMouseOver";var c_sOnMouseOut = "ClientOnMouseOut";var c_sOnFocusIn = "ClientOnFocusIn";var c_sOnFocusOut = "ClientOnFocusOut";//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
this.hlp = document._helper;this.keys = document._helper.keys;this.insertMode = true;this.textbox = null;this.bIsArrowButtonClick = false;this.oInterval = "";this.lastSpecChar;this.lockArrows = false;var m_oParent = null;var m_oTextBox = null;var m_sClientInstanceName = "";var m_bFocused = false;var m_hTimer = null;var m_sHiddenLoadData = "";//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
this.GetRoot = function()
{ 
var oRes = null;if( null == m_oParent )
{
m_oParent = document.getElementById( sRootID )
}
oRes = m_oParent;return oRes;}
//////////////////////////////////////////////////////////////
this.GetTextBox = function()
{
var oRes = null;if( null == m_oTextBox )
{
var oRoot = this.GetRoot();var aInputs = oRoot.getElementsByTagName("INPUT");m_oTextBox = aInputs[0];if (!m_oTextBox)
{
var sTextBoxID = oRoot.getAttribute( c_sAttrClntTextBoxID );m_oTextBox = document.getElementById( sTextBoxID );}
}
oRes = m_oTextBox;return oRes;}
this.EnsureTextBox = function()
{
if (!this.textbox)
{
this.textbox = this.GetTextBox();}
}
this.GetHiddenData = function()
{
var oRes = document.getElementById( sRootID + "_hidden" );return oRes.value;}
this.SetHiddenData = function( sVal )
{
var oRes = document.getElementById( sRootID + "_hidden" );oRes.value = sVal;}
//////////////////////////////////////////////////////////////
this.Self = function()
{
return m_oSelf;}
//////////////////////////////////////////////////////////////
this.GetClientInstanceName = function()
{
var sRes = ""
if( "" == m_sClientInstanceName )
{
var oParent = this.GetRoot();m_sClientInstanceName = oParent.getAttribute( c_sAttrClntInstanceName );}
sRes = m_sClientInstanceName;return sRes;}
//////////////////////////////////////////////////////////////
this.GetTypeBrowser = function()
{
if( null == c_etbTypeBrowser )
{
c_etbTypeBrowser = GetInternalTypeBrowser();}
function GetInternalTypeBrowser()
{
var sRes = null;switch( window.navigator.appName )
{
case ETypeBrowser.IE: 
{
if( navigator.userAgent.indexOf( 'Opera' ) != -1 )
sRes = ETypeBrowser.Opera;else
sRes = ETypeBrowser.IE;break;} 
case ETypeBrowser.Netscape: 
{
sRes = ETypeBrowser.Netscape;break;}
default:
{
sRes = ETypeBrowser.Unknown;break;}
}
return sRes;}
return c_etbTypeBrowser;}
//////////////////////////////////////////////////////////////
this.IsIE = function()
{
var bRes = false;var etbBrowser = this.GetTypeBrowser();if( ETypeBrowser.IE == etbBrowser )
{
bRes = true;}
return bRes;}
//////////////////////////////////////////////////////////////
this.IsNetscape = function()
{
var bRes = false;var etbBrowser = this.GetTypeBrowser();if( ETypeBrowser.Netscape == etbBrowser )
{
bRes = true;}
return bRes;}
this.IsSafari = function()
{
var bRes = this.IsNetscape() &&( navigator.userAgent.indexOf('Safari') != -1 ) ;return bRes;}
this.IsMacOS = function()
{
var bRes = this.IsSafari() &&( navigator.userAgent.indexOf('Mac OS') != -1 ) ;return bRes;}
//////////////////////////////////////////////////////////////
this.IsOpera = function()
{
var bRes = false;if( !this.IsIE() && !this.IsNetscape() )
{
bRes = true;}
return bRes;}
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
this.OnFocus = function( event, element )
{
this.keys.lastEvent = event;this.textbox = element;if ( null == this.m_sSavingValue )
{
this.SaveDefaultValue();}
if( !IsTrue( this.bIsArrowButtonClick ) )
{
this.ProcessOnFocusIn( this.GetRoot(), event )
}
this.CorrectStartSelection();this.Preparing();if( this.IsNetscape() )
{
this.SelectControlInNetscape();}
m_bFocused = true;}
///////////////////////////////////////////////////////////
this.SelectControlInNetscape = function()
{
function CorrectStartSelection()
{
m_oSelf.CorrectStartSelection();}
window.setTimeout( CorrectStartSelection, 1 );}
///////////////////////////////////////////////////////////
this.OnBlur = function( event, element )
{
m_bFocused = false;this.SaveDefaultValue();if( !IsTrue( this.bIsArrowButtonClick ) )
{
this.ProcessOnFocusOut( this.GetRoot(), event );}
} 
//////////////////////////////////////////////////////////////
this.OnKeyPress = function( event, element )
{
if( !this.IsOpera() )
this.keys.lastEvent = event;if( this.keys.bc.specKeyAndNetscape( this.lastSpecChar, this.keys.lastEvent, this.lockArrows ) )
return true;this.lastSpecChar = this.keys.bc.getKeyCode( this.keys.lastEvent );var bRes = this.ProcessKey();if( this.IsOpera() && !bRes )
this.RunTimeOut();if( event &&( event.keyCode != 13 ) )
{
event.cancelBubble = true;if (event.stopPropagation)
{
event.stopPropagation();}
}
return bRes;}
//////////////////////////////////////////////////////////////
this.OnPaste = function( event, element )
{
var clipboardText = this.keys.bc.getClipboardData();var newText = this.ProcessPasteValue( clipboardText );this.ValidateAndSet( newText );return false;}
//////////////////////////////////////////////////////////////
this.RunTimeOut = function()
{
var sValue = this.GetTextBox().value;var nPosCarret = this.posCaret;var tb = this.GetTextBox();function RefreshValue()
{
tb.setSelectionRange( nPosCarret, nPosCarret );tb.value = sValue;}
window.setTimeout( RefreshValue, 1 );}
this.SetSelectionDelayed = function( nPosCarret, nSelLen )
{
var tb = this.GetTextBox();function fn()
{
m_oSelf.hlp.selectText( tb, nPosCarret, nSelLen );}
window.setTimeout( fn, 1 );}
//////////////////////////////////////////////////////////////
this.AddKeyCaptHandler = function()
{
if( ETypeBrowser.Netscape == this.GetTypeBrowser() )
{ 
var sClientID = this.textbox.getAttribute("ClientID");var oTextBox = document.getElementById( sClientID );if ( oTextBox )
{
oTextBox.addEventListener( "keypress", OnKeyCapt, true );}
}
return false;}
//////////////////////////////////////////////////////////////
this.RemoveKeyCaptHandler = function()
{
if( ETypeBrowser.Netscape == this.GetTypeBrowser() )
{
var sClientID = this.textbox.getAttribute("ClientID");var oTextBox = document.getElementById( sClientID );if ( oTextBox )
{
oTextBox.removeEventListener( "keypress", OnKeyCapt, true );}
}
}
////////////////////////////////////////////////////////////////////
this.SaveDefaultValue = function()
{
var sValue = this.textbox.value;if( "" != sValue && null != sValue)
{
this.m_sSavingValue = sValue;}
}
///////////////////////////////////////////////////////////////////
function OnKeyCapt( event )
{
event.preventDefault();event.stopPropagation();}
///////////////////////////////////////////////////////////
this.OnKeyDown = function ( event, element )
{ 
this.keys.lastEvent = event;this.lastSpecChar = this.keys.bc.getKeyCode( this.keys.lastEvent );this.textbox = element;var bRes = false;do
{
if ( this.keys.isPasteKey() )
{
bRes = this.ProcessKey();break;}
if( 32 == this.keys.lastEvent.keyCode )
{
bRes = true;break;}
if( 27 == event.keyCode )
{
this.ResetValueToDefault();this.ProcessEscKey();bRes = this.AddKeyCaptHandler();break;}
this.RemoveKeyCaptHandler();if( ETypeBrowser.Opera == this.GetTypeBrowser() )
{
break;}
if( ETypeBrowser.Netscape == this.GetTypeBrowser() && this.keys.isBackSpaceKey() )
{
bRes = true;break;}
bRes = this.ProcessSpecificKey();if( this.IsSafari() && this.IsMacOS() )
{
event.returnValue = false;}
}
while( false );return bRes;}
this.ProcessEscKey = function()
{
}
///////////////////////////////////////////////////////////
this.StartIncrementValue = function( event, textboxId )
{
this.RemoveKeyCaptHandler();this.keys.lastEvent = event;var oParent = document.getElementById( textboxId );var tags = oParent.getElementsByTagName( "INPUT" );this.textbox = tags[ 0 ];if( this.textbox != null )
{
return this.IncrementValue();}
}
this.StopIncrementValue = function( event, textboxId )
{
this.keys.lastEvent = event;var oParent = document.getElementById( textboxId );var tags = oParent.getElementsByTagName( "INPUT" );this.textbox = tags[ 0 ];if( this.StopAutoIncrement != null )
{
this.StopAutoIncrement();}
this.SaveDefaultValue();}
this.StartDecrementValue = function ( event, textboxId )
{
this.RemoveKeyCaptHandler();this.keys.lastEvent = event;var oParent = document.getElementById( textboxId );var tags = oParent.getElementsByTagName( "INPUT" );this.textbox = tags[ 0 ];if( this.textbox != null )
{
return this.DecrementValue();}
}
this.StopDecrementValue = function ( event, textboxId )
{
this.keys.lastEvent = event;var oParent = document.getElementById( textboxId );var tags = oParent.getElementsByTagName( "INPUT" );this.textbox = tags[ 0 ];if( this.StopAutoIncrement != null )
{
this.StopAutoIncrement();}
this.SaveDefaultValue();}
///////////////////////////////////////////////////////////
this.OnMouseClickIncr = function ( event, textboxId )
{
this.StopIncrementValue( event , textboxId );return false;}
///////////////////////////////////////////////////////////
this.OnMouseClickDecr = function ( event, textboxId )
{
this.StopDecrementValue( event, textboxId );return false;}
///////////////////////////////////////////////////////////
this.OnMouseUpIncr = function ( event, textboxId )
{
this.StopIncrementValue( event , textboxId );}
///////////////////////////////////////////////////////////
this.OnMouseUpDecr = function ( event, textboxId )
{
this.StopDecrementValue( event, textboxId );}
///////////////////////////////////////////////////////////
this.OnMouseDownIncr = function ( event, textboxId )
{ 
this.bIsArrowButtonClick = true;this.StartIncrementValue( event, textboxId );}
///////////////////////////////////////////////////////////
this.OnMouseDownDecr = function ( event, textboxId )
{
this.bIsArrowButtonClick = true;this.StartDecrementValue( event, textboxId );} 
///////////////////////////////////////////////////////////
this.OnMouseOver = function( event, oEl )
{
this.textbox = this.GetTextBox();this.ProcessOnMouseOver( oEl, event );}
///////////////////////////////////////////////////////////
this.OnMouseOut = function( event, oEl )
{
this.textbox = this.GetTextBox();this.ProcessOnMouseOut( oEl, event );}
///////////////////////////////////////////////////////////
this.OnDblClickIncr = function( event )
{
if( ETypeBrowser.IE == this.GetTypeBrowser() ||
ETypeBrowser.Opera == this.GetTypeBrowser() )
{
var sClientID = this.textbox.getAttribute("ClientID");this.StartIncrementValue( event , sClientID );this.InternalStopAutoChangeValue( true );}
}
///////////////////////////////////////////////////////////
this.OnDblClickDecr = function( event )
{
if( ETypeBrowser.IE == this.GetTypeBrowser() ||
ETypeBrowser.Opera == this.GetTypeBrowser())
{
var sClientID = this.textbox.getAttribute("ClientID");this.StartDecrementValue( event , sClientID );this.InternalStopAutoChangeValue( false );}
} 
///////////////////////////////////////////////////////////    
this.InternalStopAutoChangeValue = function( bIsUpDirect )
{
var c_nTimeOutInterval = 30;var m_sClientID = this.textbox.getAttribute("ClientID");var m_oEvent = this.keys.lastEvent;var m_oSelf = this;function StopIncrement()
{
m_oSelf.StopIncrementValue( m_oEvent , m_sClientID );}
function StopDecrement()
{
m_oSelf.StopDecrementValue( m_oEvent , m_sClientID );}
if( bIsUpDirect )
window.setTimeout( StopIncrement, c_nTimeOutInterval );else
window.setTimeout( StopDecrement, c_nTimeOutInterval );} 
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
this.ProcessSpecificKey = function()
{
var sClientID = this.textbox.getAttribute("ClientID");if( this.keys.DEF_UP == this.keys.lastEvent.keyCode )
{
this.StartIncrementValue( this.keys.lastEvent , sClientID );this.InternalStopAutoChangeValue( true );this.SaveDefaultValue();}
if( this.keys.DEF_DOWN == this.keys.lastEvent.keyCode )
{
this.StartDecrementValue( this.keys.lastEvent , sClientID );this.InternalStopAutoChangeValue( false );this.SaveDefaultValue();} 
if( this.keys.isMoveCaretKey() || 
this.keys.isTabKey() || 
this.keys.isAlphanumericKey()
)
{ 
return true;}
return this.ProcessKey();}
///////////////////////////////////////////////////////////
this.GetParentElement = function( oElement )
{
var oParentElement;if( ETypeBrowser.IE == this.GetTypeBrowser() )
{
oParentElement = oElement.parentElement;}
else 
{
oParentElement = oElement.parentNode;}
return oParentElement;}
///////////////////////////////////////////////////////////
this.CorrectStartSelection = function()
{
var oElement = this.textbox;if( oElement && "" == this.oInterval )
{
var sEditableText = this.RemoveMask( oElement.value );var nStartIndex = oElement.value.indexOf( sEditableText );var nLength = sEditableText.length;this.hlp.selectText( oElement, nStartIndex, nLength );}
}
//////////////////////////////////////////////////////////////
this.IsKeyDownEvent = function()
{
var bRes = ( "keydown" == this.keys.lastEvent.type );return bRes;}
//////////////////////////////////////////////////////////////
this.IsKeyPressEvent = function()
{
var bRes = ( "keypress" == this.keys.lastEvent.type );return bRes;}
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
this.ValidateAndSet = null;this.ProcessKey = null;this.IncrementValue = null;this.DecrementValue = null;this.StopAutoIncrement = null;this.GetText = null;this.GetValue = null;///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
this.Preparing = function(){ return null;}
///////////////////////////////////////////////////////////
this.Validate = this.base_Validate = function( value )
{
var strRegExp = this.textbox.getAttribute( "regExp" );var regExp = new RegExp( strRegExp );return regExp.test( value );}
///////////////////////////////////////////////////////////
function InvokeClientHandler( sFnOnItemSelect, oEl, oEv )
{
var bCont = true;if ( sFnOnItemSelect )
{
try
{
function fn()
{
eval( "bCont=(" + sFnOnItemSelect + ")" );}
var oData = SureGetItemData( oEl );oData.Event = oEv;fn.call( oData );if (null == bCont) bCont = true;}
catch(e){}
}
return bCont;}
///////////////////////////////////////////////////////////
this.ProcessOnValueChange = function( oEl, oEv )
{
var bRes = false;var bFocused = m_bFocused;var tb = this.GetTextBox();var posCaret = 0;var lenSelect = 0;if (bFocused)
{
posCaret = this.hlp.getCaretPos( tb );lenSelect = this.hlp.getSelectedLength( tb );}
var sOnValueChange = oEl.getAttribute( c_sOnValueChange );bRes = InvokeClientHandler( sOnValueChange, oEl, oEv );if (bFocused)
{
this.GetTextBox().focus();this.SetSelectionDelayed( posCaret, lenSelect );}
return bRes;}
///////////////////////////////////////////////////////////
function IsCompleteMouseOut_IE( oEl, oEv )
{
var bFromExternalEl = !oEl.contains( oEv.toElement );return bFromExternalEl;} 
function IsCompleteMouseOut_MOZ( oEl, oEv )
{
function GetElRelationship( oEl, oOther, nCode )
{
var bRes = false;var nRes = oEl.compareDocumentPosition( oOther );bRes = (0 != (nCode & nRes));return bRes;}
function IsElContaining( oEl, oOther )
{
return GetElRelationship( oEl, oOther, oEl.DOCUMENT_POSITION_CONTAINED_BY );}
var bFromExternalEl = !( IsElContaining( oEl, oEv.explicitOriginalTarget ) )
return bFromExternalEl;}
function IsCompleteMouseOut_MacOSSafari( oEl, oEv )
{
function IsElContaining( oEl, oCont )
{
var bContains = oEl == oCont;if( !bContains &&( null != oEl )&&( null != oCont )&&
( oEl.tagName != "HTML" )&&( oEl.tagName != "BODY" ) )
{
bContains = IsElContaining( oEl.parentNode, oCont );}
return bContains;}
var bFromExternalEl = ( null == oEv.toElement )||( oEl != oEv.toElement ) ||!( IsElContaining( oEv.toElement, oEl ) )
return bFromExternalEl;}
this.IsCompleteMouseOut = function( oEl, oEv )
{
var bRes = true;if( this.IsIE() )
{
bRes = IsCompleteMouseOut_IE( oEl, oEv );}
else if( this.IsSafari() )
{
if( this.IsMacOS() )
{
bRes = IsCompleteMouseOut_MacOSSafari( oEl, oEv );}
else
{
bRes = IsCompleteMouseOut_IE( oEl, oEv );}
}
else if( this.IsNetscape() )
{
bRes = IsCompleteMouseOut_MOZ( oEl, oEv );} 
return bRes;}
this.ProcessOnMouseOver = function( oEl, oEv )
{
if( !this.GetRoot().isMouseOver )
{
var sOnMouseOver = oEl.getAttribute( c_sOnMouseOver );InvokeClientHandler( sOnMouseOver, oEl, oEv );this.GetRoot().isMouseOver = true;}
}
///////////////////////////////////////////////////////////
this.ProcessOnMouseOut = function( oEl, oEv )
{
if( this.IsCompleteMouseOut( oEl, oEv ) )
{
var sOnMouseOut = oEl.getAttribute( c_sOnMouseOut );InvokeClientHandler( sOnMouseOut, oEl, oEv );this.GetRoot().isMouseOver = false;}
}
///////////////////////////////////////////////////////////	
this.ProcessOnFocusIn = function( oEl, oEv )
{
var sOnFocusIn = oEl.getAttribute( c_sOnFocusIn );InvokeClientHandler( sOnFocusIn, oEl, oEv );}
///////////////////////////////////////////////////////////
this.ProcessOnFocusOut = function( oEl, oEv )
{
var sOnFocusOut = oEl.getAttribute( c_sOnFocusOut );InvokeClientHandler( sOnFocusOut, oEl, oEv );}
///////////////////////////////////////////////////////////	
function SureGetItemData( oEl )
{
{
var sID = GetStrAttribute( oEl, c_sAttrClntID );var sTooltip = GetStrAttribute( oEl, c_sAttrClntTooltip );oEl.m_oSFData = 
{
ID : sID,
Text : m_oSelf.GetText(),
Tooltip : sTooltip,
Value : m_oSelf.GetValue(),
InstanceName : m_oSelf.GetClientInstanceName(),
Instance: m_oSelf,
HtmlID : oEl.id,
Element : oEl,
TextBox : m_oSelf.GetTextBox()
}
}
return oEl.m_oSFData;}
///////////////////////////////////////////////////////////
function GetStrAttribute( oEl, sAttr )
{
var sVal = oEl.getAttribute( sAttr );if (!sVal)
sVal = "";return sVal;}
///////////////////////////////////////////////////////////
this.IsXHTMLDocType = function()
{
var bRes = false;var sDocType = document.doctype;if( this.IsOpera() )
{
if( "QuirksMode" != document.compatMode )
{
bRes = true;}
}
else if( null != sDocType )
{
bRes = true;}
return bRes;}
function RegisterHiddenFieldsOnReset()
{ 
var oRootEl = m_oSelf.GetRoot();var oFormEl = GetParentForm( oRootEl );if( null != oFormEl )
{
if( oFormEl.addEventListener )
{
oFormEl.addEventListener( "reset", OnFormReset, false );}
else if( oFormEl.attachEvent )
{
oFormEl.attachEvent( "onreset", OnFormReset );}
}
}
function OnFormReset()
{
m_oSelf.SetHiddenData( m_sHiddenLoadData );m_oSelf.OnFormReset();}
this.OnFormReset = function( oEv )
{
}
function GetParentForm( oChildEl )
{
var oRes = null;if( ( null != oChildEl )&&( oChildEl.tagName != "HTML" )&&( oChildEl.tagName != "BODY" ) )
{
oRes = ( oChildEl.tagName == "FORM" )?
oChildEl : GetParentForm( oChildEl.parentNode );} 
return oRes;}
///////////////////////////////////////////////////////////
function SetButtonStyles( oParent )
{
if( null != oParent )
{
var aButtons = oParent.getElementsByTagName( "Button" );m_oSelf.ProcessSetButtonStyles( aButtons );var aImages = oParent.getElementsByTagName( "IMG" );m_oSelf.ProcessSetImageStyles( aImages );SetupTextElementStyle( oParent );}
}
///////////////////////////////////////////////////////////
function SetupTextElementStyle( oParent )
{
var arrTextEls = oParent.getElementsByTagName( "INPUT" );var oTextEl = arrTextEls[0];if( null != oTextEl )
{
SetInputWidth( oTextEl ) ;UpdateInputHeight( oTextEl );}
}
function UpdateInputHeight( oEl )
{
var oRootEl = m_oSelf.GetRoot();if( !oRootEl.getAttribute( "NoRecalculateWidth" ) )
{
var oParDiv = oEl.parentNode;var oParTd = oParDiv.parentNode;if( ( "DIV" == oParDiv.tagName )&&
( "TD" == oParTd.tagName )&&
( 0 < oParTd.offsetHeight ) )
{
var nDivHeight = oParTd.offsetHeight - GetElementExtHeight( oParTd ) - GetHeightDifference( oParDiv );if( 0 < nDivHeight )
{
oParDiv.style.height = nDivHeight + "px";var nInputHeight = oParDiv.offsetHeight - GetElementExtHeight( oParDiv ) - GetHeightDifference( oEl );if( m_oSelf.IsIE() )
{
nInputHeight -= 2;}
if( 0 < nInputHeight )
{
oEl.style.height = nInputHeight + "px";}
}
var oRootTbl = GetRootTbl();if( ( null != oRootTbl )&&( 0 < oRootTbl.offsetHeight ) )
{
oRootEl.style.height = oRootTbl.offsetHeight + "px";}
}
} 
}
function GetRootTbl()
{
var oRootEl = m_oSelf.GetRoot();var arrTables = oRootEl.getElementsByTagName("TABLE");var oRes = ( 0 <arrTables.length ) ? arrTables[0] : null;return oRes;}
function SetInputWidth( oInputEl )
{
function fnRun()
{
var oTextTd = oInputEl.parentElement;if( null == oTextTd )
{
oTextTd = oInputEl.parentNode;}
if(( null != oTextTd )&&( oTextTd.tagName != "SPAN" ))
{ 
if( oTextTd.offsetWidth == 0 )
{
m_hTimer = window.setTimeout( fnRun, 10 );} 
else
{
oInputEl.style.width = "1px";var nStyleWidth = oTextTd.offsetWidth - GetElementExtWidth( oTextTd ) - GetWidthDifference( oInputEl );oInputEl.style.width = Math.max( 0, nStyleWidth ) + "px";clearTimeout( m_hTimer );m_hTimer = null;}
}
else if( null != m_hTimer )
{
clearTimeout( m_hTimer );m_hTimer = null;}
}
var oRootEl = m_oSelf.GetRoot();if( !oRootEl.getAttribute( "NoRecalculateWidth" ) )
{
fnRun();}
}
function GetElementExtWidth( oEl )
{ 
var nEW = 0;var oElStl = GetRTStyle( oEl );if( null != oElStl )
{
var nBX = 0;nBX = GetBorderPixelWidth( oElStl.borderLeftStyle, oElStl.borderLeftWidth ) +
GetBorderPixelWidth( oElStl.borderRightStyle, oElStl.borderRightWidth );var nPX = parseInt( oElStl.paddingLeft, 10 ) + parseInt( oElStl.paddingRight, 10 );if( isNaN( nPX ) )
{
nPX = 0;}
nEW = nBX + nPX;}
return nEW;}
function GetElementExtHeight( oEl )
{ 
var nEW = 0;var oElStl = GetRTStyle( oEl );if( null != oElStl )
{
var nBX = 0;nBX = GetBorderPixelWidth( oElStl.borderTopStyle, oElStl.borderTopWidth ) +
GetBorderPixelWidth( oElStl.borderBottomStyle, oElStl.borderBottomWidth );var nPX = parseInt( oElStl.paddingTop, 10 ) + parseInt( oElStl.paddingBottom, 10 );if( isNaN( nPX ) )
{
nPX = 0;}
nEW = nBX + nPX;}
return nEW;}
function GetHeightDifference( oEl )
{
var nRes = GetSizeDifference( oEl, false );return nRes;}
function GetWidthDifference( oEl )
{
var nRes = GetSizeDifference( oEl, true );return nRes;}
function GetSizeDifference( oEl, bWidth )
{
var nRes = bWidth ? GetElementExtWidth( oEl ) : GetElementExtHeight( oEl );if( ( m_oSelf.IsIE() || m_oSelf.IsOpera() ) &&( document.compatMode != "CSS1Compat" ) )
{
nRes = 0;}
return nRes;}
this.GetRTStyle = function( oEl )
{
return GetRTStyle( oEl );}
function GetRTStyle( oEl )
{
var oRTStyle = oEl.style;if( m_oSelf.IsIE() )
{
oRTStyle = oEl.currentStyle;}
else if( m_oSelf.IsNetscape() )
{
if( window.getComputedStyle )
{
oRTStyle = getComputedStyle( oEl, "" );}
else if( document.defaultView && document.defaultView.getComputedStyle )
{
oRtStyle = document.defaultView.getComputedStyle( oEl, null);}
}
else if( m_oSelf.IsOpera() )
{
oRTStyle = getComputedStyle( oEl );}
return oRTStyle;}
function GetBorderPixelWidth( sStyle, sWidth )
{
var nW = 0;var sW = sWidth.toLowerCase();if( m_oSelf.IsIE() )
{
if ("none" != sStyle)
{
if ("thick" == sW)
{
nW = 6;}
else if ("thin" == sW)
{
nW = 2;}
else if ("" == sW || "medium" == sW)
{
nW = 4;}
else
{
nW = parseInt( sW, 10 );}
}
}
else
{
nW = parseInt( sW, 10 );}
if( isNaN( nW ) )
{
nW = 0;}
return nW;}
///////////////////////////////////////////////////////////
this.ProcessSetButtonStyles = function( oBtns )
{
for( var c=0;c<oBtns.length;++c )
{
var button = oBtns[ c ];if( m_oSelf.IsXHTMLDocType() && m_oSelf.IsOpera() )
{
var bSetDefStyle = true;var oRtStyle = getComputedStyle( button );if( oRtStyle &&( oRtStyle.borderBottomWidth == "0px" ) )
{
bSetDefStyle = false;} 
if( bSetDefStyle )
{ 
button.style.width = "11px";button.style.height = "6px";}
}
}
}
///////////////////////////////////////////////////////////	
this.ProcessSetImageStyles = function( oImgs )
{
for( var c=0;c< oImgs.length;++c )
{
var img = oImgs[ c ];if( m_oSelf.IsXHTMLDocType() && m_oSelf.IsOpera() )
{
img.style.marginTop = "1px";}
else if( m_oSelf.IsNetscape() && !m_oSelf.IsSafari() )
{
img.style.marginTop = "-2px";img.style.marginLeft = "-2px";}
}
}
///////////////////////////////////////////////////////////
function ctor()
{
var oRoot = m_oSelf.GetRoot();SetButtonStyles( oRoot );m_sHiddenLoadData = m_oSelf.GetHiddenData();RegisterHiddenFieldsOnReset();}
window.setTimeout( ctor, 1 );}

Common={
};

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();