//! ################################################################
//! Copyright (c) 2004 Amazon.com, Inc., and its Affiliates.
//! All rights reserved.
//! Not to be reused without permission
//! $Change: 258505 $
//! $Revision: #23 $
//! $DateTime: 2005/02/17 15:48:47 $
//! ################################################################
function n2SliderInitLibrary(){if(window.goN2LibMon){goN2LibMon.beginLoad('slider','n2XLibs');}
window.N2WidgetGroup=function(sGroupID,sID,sTemplate){N2DynUpObject.call(this,sGroupID);this.setTemplate(sID,sTemplate);this._aWidgets=[];}
N2WidgetGroup.prototype=new N2DynUpObject();N2WidgetGroup.prototype.setTemplate=function(sID,sTemplate){this._sTemplateID=sID;this._sTemplateHTML=sTemplate;};N2WidgetGroup.prototype.getFormFieldValue=function(sName){if(this.oForm){var nVal=this.oForm[sName].value;;return nVal}
return null;};


N2WidgetGroup.prototype.setFormFieldValue=function(sName,val)
{ 
  
	if(this.oForm)
	
	{
		
		this.oForm[sName].value=val;//@@@ convert to text?
	}
};

N2WidgetGroup.prototype.getFormFieldObject=function(sName){if(this.oForm){return this.oForm[sName];}
return null;};N2WidgetGroup.prototype.addWidget=function(oWidget){var nIdx=this._aWidgets.length
this._aWidgets[nIdx]=oWidget;oWidget._setGroup(this,nIdx);};N2WidgetGroup.prototype.initialize=function(){if(this._sTemplateID&&this._sTemplateHTML){var oE=goN2U.getRawObject(this._sID);if(oE){oE.innerHTML=this._sTemplateHTML;}}
var i,nLen=this._aWidgets.length;for(i=0;i<nLen;i++){this._aWidgets[i].initialize();}
N2ChainEventHandler('onresize',new Function(this.sObjectName+".displayOverlays(true);"),"WidgetGroup resize");};N2WidgetGroup.prototype._onWidgetGotFocus=function(oWidget){;this._clearTimer();if(this._onFocusChanged){this._onFocusChanged(oWidget);}};N2WidgetGroup.prototype._onWidgetValueChanging=function(oWidget){;this._clearTimer();if(this.onValueChanging){this.onValueChanging(oWidget);}};N2WidgetGroup.prototype._onWidgetValueChanged=function(oWidget){;if(this.onValueChanged){this.onValueChanged(oWidget);}
this._resetTimer();};N2WidgetGroup.prototype._resetTimer=function(){if(this._nTimer){clearTimeout(this._nTimer);}
var sF=this.sObjectName+".onTimer";this._nTimer=setTimeout(new Function(this.sObjectName+".onTimer()"),this._nTimerMs);};N2WidgetGroup.prototype.displayOverlays=function(b){var i,nLen=this._aWidgets.length;for(i=0;i<nLen;i++){if(this._aWidgets[i].displayOverlays){this._aWidgets[i].displayOverlays(b);}}}
N2WidgetGroup.prototype.onValueChanging=function(oWidget){;};N2WidgetGroup.prototype.onValueChanged=function(oWidget){;};
	
N2WidgetGroup.prototype.onTimer=function(){;if(this.sHandler){this.resubmitFormUpdate();}};N2WidgetGroup.prototype._clearTimer=function(){if(this._nTimer){clearTimeout(this._nTimer);this._nTimer=null;}};N2WidgetGroup.prototype._nTimerMs=3000;N2WidgetGroup.prototype.setDURequestDelay=function(nMS){this._nTimerMs=nMS;}
	
	
N2WidgetGroup.prototype.getValuesFromForm=function(){var i,nLen=this._aWidgets.length;for(i=0;i<nLen;i++){this._aWidgets[i].getValuesFromForm();}};window.N2Slider=function(sID){this._sID=sID;this._oDescriptor=null;this._aHandles=[];}
new N2Slider;N2Slider.prototype._sOrientation='horizontal';N2Slider.prototype._bBracketValues=false;N2Slider.prototype.addDescriptor=function(oD){this._oDescriptor=oD;};N2Slider.prototype.addHandle=function(oH,sFieldName){var i=this._aHandles.length;this._aHandles[i]=oH;oH._setOwner(this,i);if(sFieldName){oH.setFormFieldName(sFieldName);}
return oH;};N2Slider.prototype.setID=function(sID){this._sID=sID;};N2Slider.prototype.getID=function(sID){return this._sID;};N2Slider.prototype._setGroup=function(oG,nIdx){this._oGroup=oG;this._nIndex=nIdx;};N2Slider.prototype.setImageScaleOffsets=function(nBegin,nEnd){this._nScaleBeginOffset=nBegin;this._nScaleEndOffset=nEnd;};N2Slider.prototype.setImages=function(sBG,sFG,nW,nH){this._sBGImage=sBG;this._sFGImage=sFG;this._nBGImageW=nW;this._nBGImageH=nH;};N2Slider.prototype.bracketValues=function(b){this._bBracketValues=b;};N2Slider.prototype.setRange=function(nMin,nMax,nVals,nDecimals){this._nDecimalsShown=nDecimals;if(nVals){this._bDataIsNumeric=true;this._aValues=[];var i;var nInc=(nMax>nMin)?(nMax-nMin+1)/nVals:(nMax-nMin-1)/nVals
this._nStepPixels=this._calcStepPixels(nVals);for(i=0;i<nVals-1;i++){var n=Math.round(nMin+(nInc*i));if(nDecimals){n=n.toFixed(nDecimals);}else{n=Math.round(n);}
this._aValues[i]=n;}
this._aValues[i]=nMax;this._nRangeMin=0;this._nRangeMax=nVals;}else{this._nRangeMin=nMin;this._nRangeMax=nMax;this._aValues=null;}};
N2Slider.prototype.setNLRange=function(nMin,nMax,aSteps)
{
	;
	this._bDataIsNumeric=true;
	this._aValues=[nMin];
	var s,i=0,n=nMin,nS=aSteps.length;
	for(s=0;s<nS;s++)
	{
		var oS=aSteps[s];
		
		if(goN2U.isObject(oS))
		{
			var nLT=oS.lt;
			var nInc=oS.i;
			
			;
			;
			n+=nInc;
			while(n<nLT)
			{
				this._aValues[++i]=n;
				n+=nInc;
				
			}
			this._aValues[++i]=n=nLT;
		}
		else
		{
				this._aValues[++i]=n=oS;
		}
	}
		if(n!=nMax)
		{
			this._aValues[++i]=n=nMax;
		}
		this._nStepPixels=this._calcStepPixels(i-1);
		this._nRangeMin=0;
		this._nRangeMax=i;
};
N2Slider.prototype.setRangeValues=function(aVals){this._aValues=aVals;this._nRangeMin=0;this._nRangeMax=this._aValues.length;};
N2Slider.prototype._calcStepPixels=function(nSteps){;return(this._nBGImageW-this._nScaleBeginOffset-this._nScaleEndOffset)/nSteps;}


N2Slider.prototype.setHandleValue=function(nHandle,nVal,bValidateAndShift)
{
	;var oH=this._aHandles[nHandle];
	bValidateAndShift=goN2U.isUndefined(bValidateAndShift)?true:bValidateAndShift;
	if(bValidateAndShift)
	{
		nVal=this._validateHandleValue(nHandle,nVal);
		
	    this._shiftHandleToValue(oH,nVal);
		
		// alert('nindex=='+nIndex);
	//alert('nVal=='+this._aValues[nVal]);
	//var pvalue = this._aValues[nVal];
	//populateTextBox(nHandle,pvalue,this)
	}
	
oH.setValue(nVal);

this._setHandleMovementRegions();
this._adjustClipping();
this.putValuesIntoForm(oH);

this.syncToolTipToHandle(nHandle);
};

N2Slider.prototype.putValuesIntoForm=function(oH)
{
	var sName=oH._sFormFieldName;
	

	var nVal;
	if(sName)
	{
		var nHVal=oH.getValue();
		if(this._aValues)
		{
			if(oH._nIndex==1&&this._bBracketValues)
			{
				nHVal--;
			}
			nVal=this._aValues[nHVal];
			;
   		 }
		else
		{
			nVal=nHVal;;
		}

		this._oGroup.setFormFieldValue(sName,nVal);

	
	}
}

N2Slider.prototype.syncToolTipToHandle=function(n)
	{
	if(!this._aToolTips)
	{
		return;
	}
	var oH=this._aHandles[n];
	var oTT=this._aToolTips[n];
	if(oTT)
	{
		var val=oH.getValue();		
		if(this._aValues)
		{
			val=this._aValues[val];
		}
		if(oTT._bSeparators)
		{
			val=goN2U.addComma(val);
		}
		if(oTT._sFormat)
		{
			var sTmp=oTT._sFormat;
			val=sTmp.replace(/%s/g,val);
		}
		var oElem=oTT._oElement;
		oElem.innerHTML=val;
		
		var nW=goN2U.getObjectWidth(oTT._oElement);
		var nL=parseInt(oH.getLeft()+(oH.getWidth()-nW)/2);
		this._adjustToolTipLocations(n,oTT,oElem,nL,this._nToolTipTop,nW);
	}
}


N2Slider.prototype._adjustToolTipLocations=function(nIndex,oTT,oElem,nLeft,nTop,nWidth){var oTTOther=nIndex?this._aToolTips[0]:this._aToolTips[1];if(!oTTOther){goN2U.shiftTo(oTT._oElement,nLeft,nTop);return;}
var nHeight=goN2U.getObjectHeight(oElem);var oTTOElem=oTTOther._oElement
var nOTTAdj=oTTOther._nLAdjust;var nTTOLeft=goN2U.getObjectLeft(oTTOElem)-nOTTAdj;var nTTOTop=goN2U.getObjectTop(oTTOElem);var nTTOWidth=goN2U.getObjectWidth(oTTOElem);nLAdjust=oTT._nLAdjust;if(nIndex){var nGap=nLeft-(nTTOLeft+nTTOWidth);if(nGap<4){if(nGap<0){nGap=Math.abs(nGap)+4;}
if(nTop==nTTOTop){var nAdjust=parseInt(nGap/2);if((nTTOLeft+nOTTAdj-nAdjust)>this._nBGImageLeft){oTTOther._nLAdjust=-nAdjust;oTT._nLAdjust=nAdjust;goN2U.shiftTo(oTTOElem,nTTOLeft+oTTOther._nLAdjust,nTop);}else{if(nTop==nTTOTop){goN2U.shiftTo(oTTOElem,nTTOLeft,nTop+nHeight);}
oTT._nLAdjust=0;oTTOther._nLAdjust=0;}}}else{if(nTop<nTTOTop){goN2U.shiftTo(oTTOElem,nTTOLeft,nTop);}
if(nGap>=6){if(oTT._nLAdjust>0)oTT._nLAdjust--;if(oTTOther._nLAdjust<0)oTTOther._nLAdjust++;goN2U.shiftTo(oTTOElem,nTTOLeft+oTTOther._nLAdjust,nTop);}}}else{var nGap=nTTOLeft-nLeft-nWidth;if(nGap<4){if(nGap<0){nGap=Math.abs(nGap)+4;}
if(nTop==nTTOTop){var nAdjust=parseInt(nGap/2);if((nTTOLeft+nTTOWidth+nOTTAdj+nAdjust)<this._nBGImageRight){oTTOther._nLAdjust=nAdjust;oTT._nLAdjust=-nAdjust;goN2U.shiftTo(oTTOElem,nTTOLeft+oTTOther._nLAdjust,nTop);}else{if(nTop==nTTOTop){goN2U.shiftTo(oTTOElem,nTTOLeft,nTop+nHeight);}
oTT._nLAdjust=0;oTTOther._nLAdjust=0;}}}else{if(nTop<nTTOTop){goN2U.shiftTo(oTTOElem,nTTOLeft,nTop);}
if(nGap>=6){if(oTT._nLAdjust<0)oTT._nLAdjust++;if(oTTOther._nLAdjust>0)oTTOther._nLAdjust--;goN2U.shiftTo(oTTOElem,nTTOLeft+oTTOther._nLAdjust,nTop);}}}
goN2U.shiftTo(oElem,nLeft+oTT._nLAdjust,nTop);}
N2Slider.prototype._shiftHandleToValue=function(oH,nVal){var nLeft=this._calcScaleOffsetFromValue(nVal);var nHLeft=nLeft+oH._nAdjustLeft-oH._nAdjustZero;var nHTop=parseInt(this._nAbsScaleTop+oH._nAdjustTop);oH.shiftTo(nHLeft,nHTop);};N2Slider.prototype._calcScaleOffsetFromValue=function(nVal){return this._nAbsScaleLeft+(this._nScaleLength*(nVal-this._nRangeMin))/(this._nRangeMax-this._nRangeMin);}
N2Slider.prototype._calcValueFromPosition=function(nL,nT){var nVal=0;switch(this._sOrientation){case'horizontal':var nOffset=nL-this._nAbsScaleLeft;nVal=this._nRangeMin+(nOffset*(this._nRangeMax-this._nRangeMin))/this._nScaleLength;nVal=this._massageValue(nVal);break;default:;}
return nVal;}


N2Slider.prototype._validateHandleValue=function(nIndex,nVal)
{   
    var oH=this._aHandles[nIndex];
	var nMaxindex=this._aHandles.length-1;
	if(!goN2U.isNumber(nVal))
	{
		if(goN2U.isUndefOrNull(nVal)||nVal=="")
		{
			if(nIndex==0)
			{
			nVal=this._nRangeMin;
			}
			else
			{
				nVal=this._nRangeMax;
			}
		}
	}
	if(this._aValues)
	{
		return nVal;
	}
	else
	{
		nVal=Math.max(this._nRangeMin,Math.min(this._nRangeMax,nVal));
		if(!oH._bCanPassHandles)
		{
			var nLeftVal,nRightVal
			if(nIndex>0&&(nLeftVal=this._aHandles[nIndex-1].getValue()))
			{
				nVal=Math.max(nVal,Math.max(this._nRangeMin,nLeftVal));
			}
			if(nIndex<nMaxindex&&(nRightVal=this._aHandles[nIndex+1].getValue()))
			{
				nVal=Math.min(nVal,Math.min(this._nRangeMax,nRightVal));
			}
		}
	return nVal;
	}
}


N2Slider.prototype._massageValue=function(n){if(this._nDecimalsShown){n=n.toFixed(this._nDecimalsShown);}else{n=Math.round(n);}
return n;}
N2Slider.prototype._adjustClipping=function(){if(this._aHandles.length>1){if(!this._oOverlayImage){return;}
var nL=Math.round(this._calcScaleOffsetFromValue(this._aHandles[0].getValue()));var nR=Math.round(this._calcScaleOffsetFromValue(this._aHandles[1].getValue()));goN2U.clip(this._oOverlayImage,0,nR,this._nBGImageH,nL);}else{;}}
N2Slider.prototype._setHandleMovementRegions=function(){var oLH=this._aHandles[0];var oRH=this._aHandles[1];var oLHImage=oLH._oImage;var oRHImage=oRH._oImage;var nVal=oRH.getValue();if(this._bBracketValues&&this._aValues){nVal--;}
oLHImage._n2nMinLeft=this._nAbsScaleLeft+oLH._nAdjustLeft-oLH._nAdjustZero;oLHImage._n2nMaxLeft=this._calcScaleOffsetFromValue(nVal)+oLH._nAdjustLeft-oLH._nAdjustZero;nVal=oLH.getValue();if(this._bBracketValues&&this._aValues){nVal++;}
oRHImage._n2nMinLeft=this._calcScaleOffsetFromValue(nVal)+oRH._nAdjustLeft-oRH._nAdjustZero;oRHImage._n2nMaxLeft=this._nAbsScaleRight+oRH._nAdjustLeft-oRH._nAdjustZero;}
N2Slider.prototype.initialize=function(){this._renderHTML();this._initializeOffsets();this._adjustAbsoluteImages();this.getValuesFromForm();}
N2Slider.prototype._renderHTML=function(){var oE=goN2U.getRawObject(this._sID);;;if(oE){var oD=this._oDescriptor;var sHtml='<table id="'+this._sID+'_sliderTable" border="0" cellpadding="0" cellspacing="0" >'
+'<tr>'
+(oD?'<td class="'+oD._sBoxClass+'"><span class="'+oD._sTextClass+'" id="'+this._sID+'_descText">Desc</span></td>':'')
+'<td id="'+this._sID+'_sliderTD" nowrap >'
+'<div id="'+this._sID+'sliderBody" style="position:relative">'
+(this._sFGImage?'<img id="'+this._sID+'sliderFG" src="'+this._sFGImage+'" width="'+this._nBGImageW+'" height="'+this._nBGImageH+'" '
+' style="clip:rect(0px, '+this._nBGImageW+'px, '+this._nBGImageH+'px, 0px); position:absolute; z-index:1">':'')
+'<img id="'+this._sID+'sliderBG" src="'+this._sBGImage+'" width="'+this._nBGImageW+'" height="'+this._nBGImageH+'" align="top">';var i;for(i=0;i<this._aHandles.length;i++){var oH=this._aHandles[i];sHtml+='<img id="'+this._sID+'_handle'+i+'" src="'+oH._sImage+'" class="n2SliderHandle-'+this._sOrientation+'" style="z-index:10" >';}
if(this._aToolTips){for(i=0;i<this._aToolTips.length;i++){var oT=this._aToolTips[i];sHtml+='<span id="'+this._sID+'_ttip'+i+'" class="n2SliderToolTip-'+this._sOrientation+'" style="z-index:10">XXXX</span>';}}
sHtml+='</div></td></tr><tr>'
+((oD&&(oD._sHelpOpenText||oD._sHelpOpenImage))?'<td valign="top" nowrap class="'+oD._sHelpBoxClass+'">'
+(oD._sHelpOpenImage?'<img src="'+oD._sHelpOpenImage+'" width="'+oD._sHelpImageW+'" height="'+oD._sHelpImageH+'">':'')
+'<span class="'+oD._sHelpTextClass+'">'+oD._sHelpOpenText+'</span>'
+'</td>':'')
+'<td id="'+this.sID+'_rightInfo">&nbsp;</td>'
+'</tr>'
+'</table>'
+'';oE.innerHTML=sHtml;var oT=goN2U.getRawObject(this._sID+'_sliderTable');this._oElement=oT;for(i=0;i<this._aHandles.length;i++){var oH=this._aHandles[i];var oImage=goN2U.getRawObject(this._sID+'_handle'+i);;if(oImage){oImage._oN2=oH;oH._oImage=oImage;goN2Drag.makeDraggable(oImage);}}

if(this._aToolTips){for(i=0;i<this._aToolTips.length;i++){oT=this._aToolTips[i];oT._oElement=goN2U.getRawObject(this._sID+'_ttip'+i);}}
this._oBGImage=goN2U.getRawObject(this._sID+'sliderBG');if(this._sFGImage){this._oOverlayImage=goN2U.getRawObject(this._sID+'sliderFG');}}else{;}};

N2Slider.prototype.displayOverlays=function(b){if(b){this._initializeOffsets();this._adjustAbsoluteImages();this.getValuesFromForm();}
if(this._sFGImage){b?goN2U.display(this._oOverlayImage):goN2U.undisplay(this._oOverlayImage);}
for(i=0;i<this._aHandles.length;i++)
{
	var oH=this._aHandles[i];
	
	b?goN2U.display(oH._oImage):goN2U.undisplay(oH._oImage);
}
if(this._aToolTips)
{
	for(i=0;i<this._aToolTips.length;i++)
	{
		var oE=this._aToolTips[i]._oElement;
		
		if(b)
		{
			goN2U.display(oE);
			this.syncToolTipToHandle(i);
		}
		else
		{
			goN2U.undisplay(oE);
		}
	}
}
}

N2Slider.prototype.getElement=function(){return this._oElement;}
N2Slider.prototype.getTop=function(){return goN2U.getObjectTop(this._oElement);}
N2Slider.prototype._initializeOffsets=function(){this._nBGImageLeft=goN2U.getObjectLeft(this._oBGImage);this._nBGImageTop=goN2U.getObjectTop(this._oBGImage);this._nBGImageRight=this._nBGImageLeft+this._nBGImageW;switch(this._sOrientation){case'horizontal':this._nAbsScaleLeft=this._nScaleBeginOffset;this._nAbsScaleRight=this._nBGImageW-this._nScaleEndOffset;this._nAbsScaleTop=0;this._nAbsScaleBottom=this._nBGImageH;this._nScaleLength=this._nBGImageW-this._nScaleBeginOffset-this._nScaleEndOffset;this._nToolTipTop=this._nAbsScaleBottom+4;//@@@ FIXME: Kludge!
break;case'vertical':this._nAbsScaleTop=this._nScaleEndOffset;this._nAbsScaleBottom=this._nBGImageH-this._nScaleBeginOffset;this._nAbsScaleLeft=0;this._nScaleLength=this._nBGImageH-this._nScaleBeginOffset-this._nScaleEndOffset;break;default:;}
}
N2Slider.prototype._adjustAbsoluteImages=function(){var i;for(i=0;i<this._aHandles.length;i++){var oH=this._aHandles[i];var oImage=oH._oImage;var nL=this._nScaleBeginOffset+oH._nAdjustLeft;var nT=oH._nAdjustTop
goN2U.shiftTo(oImage,nL,nT);oImage._n2nMinTop=oImage._n2nMaxTop=nT;if(this._aToolTips&&this._aToolTips[i]){var oE=this._aToolTips[i]._oElement;var nTL=nL-10;var nTT=nT+oH._nHeight+6;goN2U.shiftTo(oE,nTL,nTT);}}}


N2Slider.prototype.getValuesFromForm=function()
{
		for(i=0;i<this._aHandles.length;i++)
			{
				var oH=this._aHandles[i];
				var sName=oH._sFormFieldName;
				if(sName)
			
				{
					var val=this._oGroup.getFormFieldValue(sName);
					//alert(oH.oForm.name);
					if(this._aValues)
					{
						if(goN2U.isUndefOrNull(val)||val=="")
						{
							if(i==0)
							{
								val=this._nRangeMin;
							}
					
							else
							{
								nVal=this._nRangeMax;
							}
						}
						val=this._valueToIndex(i,val);
					 }
			     	this.setHandleValue(i,val);
			       }
		      }
}

N2Slider.prototype._valueToIndex=function(nHandle,nVal){if(goN2U.isUndefOrNull(nVal)||nVal==""){;return nVal;}
var i,nLen=this._aValues.length;for(i=0;i<nLen;i++){if(this._aValues[i]==nVal){;if(nHandle==1&&this._bBracketValues){i++;}
return i;}};return 0;}
N2Slider.prototype._shiftToValue=function(nValue){}
N2Slider.prototype._handleHasFocus=function(oHandle,nL,nT){var nIndex=oHandle._nIndex;;this._oGroup._onWidgetGotFocus(this);return true;}
N2Slider.prototype._handleMoved=function(oHandle,nL,nT){var nIndex=oHandle._nIndex;var nVal=this._calcValueFromPosition(nL,nT);;this.setHandleValue(nIndex,nVal,false);this._oGroup._onWidgetValueChanging(this);return true;}

N2Slider.prototype._handleReleased=function(oHandle,nVal)
{
	var nIndex=oHandle._nIndex;
	
	this.setHandleValue(nIndex,nVal,true);
	
	this._oGroup._onWidgetValueChanged(this);
	
	//------------------------------mvh changes-------------------------->	
var pvalue = this._aValues[nVal];
	populateTextBox(nIndex,pvalue,this);
//------------------------------mvh changes-------------------------->		
	return true;
	}
	
N2Slider.prototype.addToolTip=function(sLocate,sClass,sFormat,bSeparators)
{
	if(!this._aToolTips)
	{
		this._aToolTips=[];
	}
return this._aToolTips[this._aToolTips.length]={_sLocate:sLocate,_sClass:sClass,_sFormat:sFormat,_bSeparators:bSeparators,_nLAdjust:0};

}
window.N2SliderHandle=function(sImage,nWidth,nHeight,nOrient,nZero,nX,nY,sFieldName){this._sImage=sImage;this._nWidth=nWidth;this._nHeight=nHeight;this._sOrientation=nOrient;this._nAdjustZero=nZero;this._nAdjustLeft=nX;this._nAdjustTop=nY;this._sFormFieldName=sFieldName;}
new N2SliderHandle();N2SliderHandle.prototype._bCanPassHandles=false;N2SliderHandle.prototype.getCanPassHandles=function(){return this._bCanPassHandles;};N2SliderHandle.prototype._setOwner=function(oO,nIndex){this._oOwner=oO;this._nIndex=nIndex;};

N2SliderHandle.prototype.setValue=function(nVal)
{
	this._nValue=nVal;
};


N2SliderHandle.prototype.getValue=function(){return this._nValue;};N2SliderHandle.prototype.setFormFieldName=function(sName){this._sFormFieldName=sName;};N2SliderHandle.prototype.shiftTo=function(nLeft,nTop){this._nLeft=nLeft;this._nTop=nTop;goN2U.shiftTo(this._oImage,nLeft,nTop);}
N2SliderHandle.prototype.getLeft=function(){return goN2U.getObjectLeft(this._oImage);}
N2SliderHandle.prototype.getTop=function(){return goN2U.getObjectTop(this._oImage);}
N2SliderHandle.prototype.getWidth=function(){return this._nWidth;};N2SliderHandle.prototype.getHeight=function(){return this._nHeight;};N2SliderHandle.prototype.onMouseDown=function(oEvent){return this._oOwner._handleHasFocus(this);};N2SliderHandle.prototype.onMoved=function(nL,nT){switch(this._oOwner._sOrientation){case'horizontal':nL+=this._nAdjustZero;break;case'vertical':nT+=this._nAdjustZero;break;default:;}
return this._oOwner._handleMoved(this,nL,nT);};



N2SliderHandle.prototype.onMouseUp=function()
{
	//alert("handlevalue on mouse up="+this._nValue);
	return this._oOwner._handleReleased(this,this._nValue);};
	
window.N2SliderDescriptor=function(sText,nWidth,sBoxClass,sTextClass){this._sText=sText;if(nWidth){this._nWidth=nWidth};if(sBoxClass){this._sBoxClass=sBoxClass};if(sTextClass){this._sTextClass=sTextClass};}
new N2SliderDescriptor();N2SliderDescriptor.prototype._nWidth=90;N2SliderDescriptor.prototype._sBoxClass='sliderDescriptorBox';N2SliderDescriptor.prototype._sTextClass='sliderDescriptorText';N2SliderDescriptor.prototype._sHelpBoxClass='sliderDescriptorHelpBox';N2SliderDescriptor.prototype._sHelpTextClass='sliderDescriptorHelpText';N2SliderDescriptor.prototype._sHelpOpenText=goN2Locale.getString('more-info_8559','More Info');N2SliderDescriptor.prototype._sHelpCloseText=goN2Locale.getString('less_info_36021','Less Info');N2SliderDescriptor.prototype._sHelpOpenImage='images/more-info';N2SliderDescriptor.prototype._sHelpCloseImage='images/less-info';N2SliderDescriptor.prototype._sHelpImageW=17;N2SliderDescriptor.prototype._sHelpImageH=11;N2SliderDescriptor.prototype.setHelp=function(sImage,sText,sHref,sName,sCloseText){this._sHelpImage=sImage;this._sHelpText=sText?sText:'';this._sHelpHref=sHref;this._sHelpName=sName;this.sHelpCloseText=sCloseText;}
var goN2Drag={obj:null,normalizeEvent:function(evt){evt=(evt)?evt:((window.event)?window.event:null);if(evt){if(!evt.target){evt.target=evt.srcElement;}}else{;}
return evt;},mouseDown:function(evt){evt=goN2Drag.normalizeEvent(evt);if(evt.preventDefault)evt.preventDefault();if(evt.stopPropagation)evt.stopPropagation();if(evt){var oE=goN2Drag.obj=evt.target;if(oE._n2bDraggable){oE._n2SavedMouseMove=document.onmousemove;oE._n2SavedMouseUp=document.onmouseup;document.onmousemove=goN2Drag.mouseMove;document.onmouseup=goN2Drag.mouseUp;if(document.body&&document.body.setCapture){document.body.setCapture();;}
var mouseDownX=(evt.clientX)?evt.clientX:evt.pageX;var mouseDownY=(evt.clientY)?evt.clientY:evt.pageY;oE.dragOffsetX=mouseDownX-((oE.offsetLeft)?oE.offsetLeft:oE.left);oE.dragOffsetY=mouseDownY-((oE.offsetTop)?oE.offsetTop:oE.top);oE.buttonIsDown=true;if(oE._oN2&&oE._oN2.mouseDown){oE._oN2.onMouseDown(evt)}}}},mouseMove:function(evt){evt=goN2Drag.normalizeEvent(evt);if(evt){var oE=goN2Drag.obj;if(oE.buttonIsDown){var nX=(evt.clientX)?evt.clientX:evt.pageX;nX-=oE.dragOffsetX;var nY=(evt.clientY)?evt.clientY:evt.pageY;nY-=oE.dragOffsetY;nX=Math.max(oE._n2nMinLeft,nX);nX=Math.min(oE._n2nMaxLeft,nX);nY=Math.max(oE._n2nMinTop,nY);nY=Math.min(oE._n2nMaxTop,nY);var bDoShift=true;if(oE._oN2&&oE._oN2.onMoved){bDoShift=oE._oN2.onMoved(nX,nY);}
if(bDoShift){goN2U.shiftTo(oE,nX,nY);}
}}},mouseUp:function(evt)
{
	
		evt=goN2Drag.normalizeEvent(evt);
	if(evt)
	{
		var oE=goN2Drag.obj;
		if(oE.buttonIsDown)
		{
			if(document.body&&document.body.releaseCapture)
			{
				document.body.releaseCapture();
				;
			}
			oE.buttonIsDown=false;
			if(oE._oN2&&oE._oN2.onMouseUp)
			{
				oE._oN2.onMouseUp();
			}
		}
document.onmousemove=oE._n2SavedMouseMove;document.onmouseup=oE._n2SavedMouseUp;}},makeDraggable:function(el){var oE=goN2U.getRawObject(el);if(oE){oE["onmousedown"]=goN2Drag.mouseDown;;}else{;}
oE._n2bDraggable=true;oE._n2nMinLeft=0;oE._n2nMaxLeft=10000;oE._n2nMinTop=0;oE._n2nMaxTop=10000;return oE;}}
if(window.goN2LibMon){goN2LibMon.endLoad('slider');}}
n2RunIfLoaded("dynupdate",n2SliderInitLibrary,"slider");
