/**
 * @package		YJ Module Engine
 * @author		Youjoomla LLC
 * @website     Youjoomla.com 
 * @copyright	Copyright (c) 2007 - 2011 Youjoomla LLC.
 * @license   PHP files are GNU/GPL V2. CSS / JS / IMAGES are Copyrighted Commercial
 */
window.addEvent("domready", function () {

  //  toggler
  var gotjoomla = $$('#cells_width_holder');
  // collect all items for toggler
  var get_yj_items = $$('.cells_width_value_yjme');
  // add items in toggler
  gotjoomla.adopt(get_yj_items);


  //	//toggle
  var selected = $('jform_params_cells_width').get("value");
  if (selected == 1) { // auto fit selected
    var mySlide1 = new Fx.Slide('cells_width_holder', {
      duration: 1000,
      transition: Fx.Transitions.Pow.easeOut
    }).hide();
  } else if (selected == 2) { //custom size selected
    var mySlide1 = new Fx.Slide('cells_width_holder', {
      duration: 1000,
      transition: Fx.Transitions.Pow.easeOut
    }).show();
  }

  $('jform_params_cells_width').addEvent('change', function (event) {

    event.stop();

    var selectedsource = this.get("value");
    if (selectedsource == 1) { ///joomla selected
      mySlide1.toggle();
   }

    if (selectedsource == 2) { ///k2 selected
      mySlide1.toggle();
    }


  });

});