// JScript File
function SliderInit( sHolderID, sInfoElementID_1, sInfoElementID_2, sSliderType, arSliderParams, updateCallback ){

  this.objSlider = new cSlider();
  this.objSlider.parent = this;
  var arParams  = arSliderParams;
  this.OnSlideEndFunction = null;

  SetEvent(this, this.objSlider, "eventOnChange", "OnChange_Slider");

//  this.objSlider.attachOnChange( function() { this.parent.OnChange_Slider( this ); } );

  this.OnChange_Slider = function( )
  {
    if( sInfoElementID_1 != null && document.getElementById( sInfoElementID_1 ) != null ){
	    document.getElementById( sInfoElementID_1 ).innerHTML =  this.objSlider.getValue();
	  }
    if( sInfoElementID_2 != null && document.getElementById( sInfoElementID_2 ) != null ){
	    document.getElementById( sInfoElementID_2 ).innerHTML =  this.objSlider.getValue(2);
	  }
  }

  this.objSlider.attachOnSlideEnd(function() { updateCallback(this.getValue(), this.getValue(2)); });

  this.Init_Slider = function()
  {
    //debugger;ghbxjv yf dtcm l
	  this.objSlider.imgBasePath = '/img/';
	  this.objSlider.loadSkin( sSliderType );
  	
	  this.objSlider.width         = arParams[0];//171;
	  this.objSlider.minVal        = arParams[1];//5;
	  this.objSlider.maxVal        = arParams[2];//200;
	  this.objSlider.valueDefault  = arParams[3];//25;
	  this.objSlider.increment     = arParams[4];//5;

	  if( arParams.length > 5 ){
	    this.objSlider.minVal2 = arParams[5];
	  }
	  if( arParams.length > 6 ){
	    this.objSlider.maxVal2 = arParams[6];
	  }
	  if( arParams.length > 7 ){
	    this.objSlider.valueDefault2 = arParams[7];
	  }
	  if( arParams.length > 8 ){
	    this.objSlider.increment2 = arParams[8];
	  }
  	
	  this.objSlider.drawInto( sHolderID );
	  if( typeof( this.OnSlideEndFunction ) == "function" ){
	    SetEvent(this, this.objSlider, "slideEndCB", "OnSlideEndFunction");
	  }
	  this.OnChange_Slider();
  }
}
