//+---------------------------------------------------
//| 交换滑动门
//+---------------------------------------------------
var waitInterval2; 
var MDelayTime2=100;
function swapMenu(num){ 
clearTimeout(waitInterval2); 
waitInterval2=setTimeout("swapMenu2("+num+");",MDelayTime2); 
} 
function swapMenu2(num){ 
clearTimeout(waitInterval2); 
for(var id = 1;id<=11;id++) 
{ 
if(id==num) 
{ 
document.getElementById("fc"+id).style.display="block"; 
document.getElementById("f"+id).className="fon"; 
} 
else 
{ 
document.getElementById("fc"+id).style.display="none"; 
document.getElementById("f"+id).className="foff"; 
} 
} 
}

/*var waitInterval2;
function swapMenu(liName, tagName, tagCount, currentMenuId, an, bn){
    clearTimeout(waitInterval2);
    waitInterval2 = setTimeout("qiehuan("+liname+","+tagName+","+tagCount+","+currentMenuId+","+an+","+bn+")",300);
    }
function qiehuan(liName, tagName, tagCount, currentMenuId, an, bn){
    clearTimeout(waitInterval2);
    for(var i=1; i<=tagCount; i++){
        if (currentMenuId ==i){
            document.getElementById(tagName + currentMenuId).style.display = "block";
            document.getElementById(liName + currentMenuId).className = an;
        }else{
            document.getElementById(tagName + i).style.display = "none";
            document.getElementById(liName + i).className = bn;
       }
    }
}*/


//function clearT(){
//    clearTimeout(s);
//}
//+---------------------------------------------------
//| 简单的交换滑动门
//+---------------------------------------------------
function swapMenuSmip(tagName, tagCount, currentMenuId){
    for(var i=1; i<=tagCount; i++){
        if (currentMenuId ==i){
            document.getElementById(tagName + currentMenuId).style.display = "block";
        }else{
            document.getElementById(tagName + i).style.display = "none";
       }
    }
}

////
    count = 0;
    function addcomment(id)
    {
      if(count == 1){ alert("文本框已存在！"); return false;}
      var row,cell,str;
      row = document.getElementById(id).insertRow();
      if(row != null )
      {
          cell = row.insertCell();
          cell.innerHTML="<textarea cols=70 rows=10 id=\"St\" name=\"St\" onblur=\"len()\"   value=\"\"></textarea><input type=\"button\" value=\"取消\" onclick=\'deleteitem(this);\'> <input type=\"submit\" name=\"submit\" value=\"提交\"/>";
      }
      count = count + 1;
    }
    function countlen(form)
    {
      if(form.St.value.length <= 20)
      {
        alert("评论长度不能少于20个字！");
        return false;
      }
    }
    function len()
    {
      var ta = document.getElementById("St");
      if(ta.value.length <= 20)
      {
        alert("评论长度不能少于20个字！");
        return false;
      }
    }
    function deleteitem(obj)
    {
         count = 0;
         var curRow = obj.parentNode.parentNode;
         tb.deleteRow(curRow.rowIndex);
    }


    function reloadcode(){
       document.getElementById("image").src="/image/imagecode?"+ Math.random();
     }

         function myajax(type,uid,cid)
         {
           jQuery.ajax({
              type: "GET",
              url: "/book/ping",
              data: "uid="+uid+"&cid="+cid+"&type="+type,
              success: function(){
                alert( "谢谢评价" );
              }
           });
         }

      function ondigg(type,uid,cid,pid){
        if(pid == uid){
          alert("请勿顶踩自己的评论！");return false;
        }else{
        var ck = uid + cid
        var CookiesInfo = GetCookie(ck);
        if(CookiesInfo!=null){
             alert("改评论您已表态，请勿重复顶踩！");return false;
        }else{
          SetCookie(ck,cid,1);
          if(type=="good"){
                     var goodNum =document.getElementById("goodNum"+cid).innerText;
                     document.getElementById("goodNum"+cid).innerText = Number(goodNum) + 1;
          }else{
                   var badNum =document.getElementById("badNum"+cid).innerText;
                   document.getElementById("badNum"+cid).innerText = Number(badNum) + 1;
               }
           }
           myajax(type,uid,cid);
         }
       }

