if (!window.MNS) var MNS={};

MNS.Slider = function() {
 var pauseTime = 3000,
     tipWidth,
     totalWidth = 0,
     currentOffset = 0;

 function next(){  //show next tip
   update(tipWidth*-1);
 }

 function create(){
   var tipContent = $('tip_content'),
       firstLi = tipContent.getElementsByTagName("li")[0];

   tipWidth = firstLi.offsetWidth;
   totalWidth = getElWidth("tips");

   setInterval(next,pauseTime);
 }

 function update(num){
   //update the box contents
   if (num >0 && (currentOffset>-10)) return; //at begining of list, return

   currentOffset +=num;

   if (Math.abs(currentOffset) > totalWidth-10) {; //at end of list, return
     currentOffset = 0;
   }

    jQuery("#tip_content").animate(
        { left: (currentOffset).toPixels() },
        { duration: 1200 }
    );


 }
    return {
        create: create
    };
}();


