///////////////////////////////////////////////////////\\
///////////////////////////////////////////////////////\\
//***************************************************\\\\
//                  slidershow v1.0                  \\\\
//                  ExpBuilder.com                   \\\\
//                elkadrey@gmail.com                 \\\\
//              Auther: Ahmed Elkadrey               \\\\
//***************************************************\\\\
///////////////////////////////////////////////////////\\
///////////////////////////////////////////////////////\\

	var Interval ;
jQuery.fn.slidershow = function(options)
{
    var me       = this;
    $(me).find("*").hide();
    var selected = 1;
    var lefts    = 0;
    var Config   =   {
                      width       :   150,
                      height      :   250,
                      movingtime  : 5
                     };
    if(options)
    {
		jQuery.extend(Config, options);
	};
    Config.width = parseInt(Config.width);
    Config.height = parseInt(Config.height);
    function nextFrame()
    {
      if(jQuery(me).find('ul li').length < selected + 1)
      {
            selected = 0;
      }
      jQuery(me).find('ul').animate({'margin-top':'-' + ((Config.height) * selected) + 'px'});
      selected++;
    }

    
	function onEnterFrame()
    {
        Interval = window.setInterval(function()
        {
           nextFrame()
        }, Config.movingtime * 1000)
    }
    jQuery(document).ready(function()
    {
        jQuery(me).css({'direction': 'ltr','display': 'block', 'height': Config.height, 'width': Config.width, 'overflow': 'hidden', 'position': 'relative'});
        var founds = 0;
        jQuery(me).find('ul').css({'padding' : '5px', 'mragin':'0px', 'height':((Config.height) * jQuery(me).find('ul li').length) + 'px'});
        jQuery(me).find('ul li').css({'height':Config.height+'px', 'list-style': 'none'});
        $(me).find("*").show();
        onEnterFrame();
    });
}

	function StopShowNews(){
		window.clearInterval(Interval);
	}

