/*
*隐藏一个div
*/
function closeDiv(divObj){
	$(divObj).css('display','none');
	}

function closepicker(){
	$('.picker-box').css('display','none');

	}
/*
*商品列表页筛选
*/
$(function(){
	  $('#m360BtnClass').click(function(){
		  $('.content').css('overflow','hidden');
		  $('#m360_leftNav').show();
		  $('#m360_leftNav_t').show().animate({'right':0},200,function(){
			  setNavHeight();
		  });
		  return false;
	  });
	  $('#m360_leftNavBg').click(function(){
		  $('.content').css('overflow','auto');
		  $('#m360_leftNav_t').animate({'right':-280},200,function(){
			  $('#m360_leftNav').hide();
		  });
		  return false;
	  });
	  $('#m360_leftNav_list > li').click(function(event){
		  var _this = $(this);
		  var ul = $(this).find('ul');
		  if( _this.hasClass('hover'))
		  {
			  ul.slideUp( 200,function(){
				  _this.removeClass('hover');
			  });
		  }else{
			  _this.addClass('hover');
			  ul.slideDown( 200);
		  }
		  //需要判断高度
		  setNavHeight();
		  event.stopPropagation();
	  });
	  //m360_pages_select
	  $('select.m360_pages_select').change(function(){
		  var x = $(this).val();
		  window.location.href = x;
	  });
	  /*筛选的收缩伸展*/
		$(".click").click(function(){
			var t_class=$(this).attr('class');
			if(t_class == "click icon-down_arrow"){
				$(this).addClass("cur");
				$(this).parent().next().addClass("hAuto");
			}else{
				$(this).removeClass("cur");
				$(this).parent().next().removeClass("hAuto");
				}
		})
  });
  function setNavHeight()
  {
	  var h_top=document.documentElement.clientHeight - $('header').height();
	  $('#m360_leftNav').css("height",h_top)

  }
  //格式化价格
function foramtmoney(num,len) {
    len = len > 0 && len <= 20 ? len : 2;
    var result = parseFloat(num);
    num=isNaN(result)?0:result;
    var numpow=Math.pow(10,len);
    result = Math.round(num * numpow) / numpow;//round四舍五入 ceil进一 floor舍去
    var s_x = result.toString();
    var pos_decimal = s_x.indexOf('.');
    if (pos_decimal < 0) {
       pos_decimal = s_x.length;
       s_x += '.';
    }
    while (s_x.length <= pos_decimal + len) {s_x += '0';}
    return s_x;
}