/*function loadPrice(name,id,integral){
  if(integral==undefined)integral=0;
  jQuery("#"+name+id).load("ajax/showjanjie.aspx");
}
function loadBtn(name,id){
  jQuery("#"+name+id).load("ajax/showjanjie.aspx");
}*/
var timeout=0;
var lastId=0;
function showLayer(id){
  timeout=window.setTimeout(function(){
    showFunc(id);
  },250);
}
function notShow(){
  window.clearTimeout(timeout);
  document.getElementById("pic_layer").style.display="none";
}

function showFunc(id){
  if(id!=lastId){
    var el=document.getElementById("imgbox_"+id);
    var layerWidth=319;
    var top=0,left=0;
    var width=el.offsetWidth;
    while(el){
      top+=el.offsetTop;
      left+=el.offsetLeft;
      el=el.offsetParent;
    }
    if(layerWidth>(document.body.offsetWidth-(left+width))){
      left=left-layerWidth+2+"px";
    }else{
      left=left+width-2+"px";
    }
    jQuery("#layer_content").html("");
    jQuery("#layer_content").load("ajax/showjanjie.aspx",{id:id});
    jQuery("#pic_layer").css({top:top,left:left,display:""});
    lastId=id;
  }else{
    document.getElementById("pic_layer").style.display="";
  }
}
function hideLayer(){
  jQuery("#pic_layer").css("display","none");
}
function loadViewHistory(){
  jQuery("#viewHistory").load("ajax/showjanjie.aspx");
}
function clearHistory(){
  var strCookie=document.cookie;
  if(strCookie!=null){
    var hasView=false,temp=false;
    var expires = new Date();
    expires.setDate(expires.getDate() - 1);
    var arrCookie=strCookie.split(";");
    for(var i=0;i<arrCookie.length;i++){
      var arr=arrCookie[i].split("=");
      if(arr[0].indexOf("ViewHistory")>0){
        temp=true;
        hasView=hasView||temp?true:false;
        document.cookie="ViewHistory"+arr[1]+"=;expires="+expires.toGMTString()+";path="+(frontPath==""?"/":frontPath);
      }
    }
  }
  if(!hasView){
    return false;
  }
  loadViewHistory();
  return true;
}
function showSortLayer(id){
  var block_l=document.getElementById("li_block_l"+id);
  var block_r=document.getElementById("li_block_r"+id);
  var block_rb=document.getElementById("li_block_r_bg"+id);
  var block_lb=document.getElementById("li_block_l_bg"+id);
  block_l.style.display="block";
  block_r.style.marginLeft=block_l.offsetWidth-1+"px";
  block_lb.style.width=block_l.offsetWidth+"px";
  block_rb.style.marginLeft=block_l.offsetWidth+2+"px";
  block_r.style.display="block";
  block_rb.style.height=block_r.offsetHeight+3+"px";
  block_rb.style.display="block";
  block_lb.style.display="block";
}
function hideSortLayer(id){
  document.getElementById("li_block_l"+id).style.display="none";
  document.getElementById("li_block_r"+id).style.display="none";
  document.getElementById("li_block_r_bg"+id).style.display="none";
  document.getElementById("li_block_l_bg"+id).style.display="none";
}
