(function($){
 $.fn.extend({
 
     customStyle : function(options) {
      if(!$.browser.msie || ($.browser.msie&&$.browser.version>6)){
      return this.each(function() {
          
            if (!options) options = 'styled';
      
            var currentSelected = $(this).find(':selected');
            $(this).after('<span class="'+options+'SelectBox"><span class="'+options+'SelectBoxInner">'+currentSelected.text()+'</span></span>').css({position:'absolute', opacity:0,fontSize:$(this).next().css('font-size')});
            var selectBoxSpan = $(this).next();
            var selectBoxWidth = parseInt($(this).width()) - parseInt(selectBoxSpan.css('padding-left')) -parseInt(selectBoxSpan.css('padding-right'));            
            var selectBoxSpanInner = selectBoxSpan.find(':first-child');
            selectBoxSpan.css({display:'inline-block'});
            selectBoxSpanInner.css({width:selectBoxWidth, display:'inline-block'});
            var selectBoxHeight = parseInt(selectBoxSpan.height()) + parseInt(selectBoxSpan.css('padding-top')) + parseInt(selectBoxSpan.css('padding-bottom'));
            $(this).height(selectBoxHeight).change(function(){
                selectBoxSpanInner.text($(this).find(':selected').text()).parent().addClass('changed');
            });
            
      });
      }
    }
 });
})(jQuery);

var scrollInterval;

function iecompattest(){
    return (document.compatMode != "BackCompat") ? document.documentElement : document.body;
}

function scrollwindow(){
    document.all ? currentpos = iecompattest().scrollTop : currentpos = window.pageYOffset;
    currentpos = currentpos - (currentpos / 10);
    if(currentpos <= 0) clearInterval(scrollInterval);
    window.scroll(0,currentpos)
}

function startScroll(){
    document.all ? currentpos = iecompattest().scrollTop : currentpos = window.pageYOffset;
    scrollInterval = setInterval("scrollwindow()", 10)
    return false;
}

