﻿function nTabs(thisObj,Num){
      if(thisObj.className == "active")return;
      var tabObj = thisObj.parentNode.id;
      var tabList = document.getElementById(tabObj).getElementsByTagName("li");
      for(i=0; i <tabList.length; i++)
      {
      if (i == Num)
      {
         thisObj.className = "active"; 
            document.getElementById(tabObj+"_Content"+i).style.display = "block";
      }else{
         tabList[i].className = "normal"; 
         document.getElementById(tabObj+"_Content"+i).style.display = "none";
      }
      } 
      }
      
function navTabs(thisObj,Num){
  if(thisObj.className == "nava")return;
  var tabList = document.getElementsByTagName("DIV");
  for(i=0; i < 5; i++){
    if (i == Num){
       thisObj.className = "nava"; 
       document.getElementById("nav_"+i).style.display = "block";
    }else{
       tabList[i].className = "navb"; 
       document.getElementById("nav_"+i).style.display = "none";
    }
  } 
}

function cc(N,bool){  
  var aa = document.getElementById(N).getElementsByTagName("input");
  for (var i=0; i<aa.length; i++){
	  if (aa[i].type=="checkbox")
		aa[i].checked = bool==1 ? true : (bool==0 ? false : !aa[i].checked);
  }  
}
function listen(){
	var thisCount =2;
	if (thisCount==0){
		alert("你没有选择要试听有声读物！");
		return;
	}	
	var lnWork_plan_List="";
	var loCollection_select = document.all("chbox_Select");
	if (thisCount==1){
		if (loCollection_select.checked)lnWork_plan_List=loCollection_select.plan_id;
	}else{
		for (var i = 0;i<loCollection_select.length;i++){
			if (loCollection_select[i].checked){
				if (lnWork_plan_List!="")lnWork_plan_List +=",";
				lnWork_plan_List +=loCollection_select[i].plan_id;
			}
		}
	}
	if (lnWork_plan_List==""){
		alert("请选择您要试听的有声读物！");
		return;
	}
	//window.navigate("sound.php?soundID="+lnWork_plan_List);
	showModelessDialog('sound.php?soundID='+lnWork_plan_List,'example05','dialogWidth:600px;dialogHeight:530px;dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes');
}

function downfile(id){
	var thisCount =2;
	if (thisCount==0){
		alert("你没有选择要下载有声读物！");
		return;
	}	
	var lnWork_plan_List="";
	var loCollection_select = document.getElementsByName("chbox_Select");
	if (thisCount==1){
		if (loCollection_select.checked)lnWork_plan_List=loCollection_select.value;
	}else{
		for (var i = 0;i<loCollection_select.length;i++){
			if (loCollection_select[i].checked){
				if (lnWork_plan_List!="")lnWork_plan_List +=",";
				lnWork_plan_List +=loCollection_select[i].value;
			}
		}
	}
	if (lnWork_plan_List==""){
		alert("请选择您要下载的有声读物！");
		return;
	}
	window.navigate("down.php?id="+id+"&soundID="+lnWork_plan_List);
}
function oprate(uid){
	showModelessDialog('manage.user.oprate.php?id='+uid,'example05','dialogWidth:300px;dialogHeight:360px;dialogLeft:615px;dialogTop:300px;center:yes;help:yes;resizable:yes;status:yes');
}
function reply(fid){
	showModelessDialog('manage.feedback.reply.php?id='+fid,'example05','dialogWidth:300px;dialogHeight:360px;dialogLeft:615px;dialogTop:300px;center:yes;help:yes;resizable:yes;status:yes');
}
function pay(){
	showModelessDialog('manage.pay.add.php','example05','dialogWidth:300px;dialogHeight:360px;dialogLeft:615px;dialogTop:300px;center:yes;help:yes;resizable:yes;status:yes');
}
function message(mid){
	showModelessDialog('view.message.php?id='+mid,'example05','dialogWidth:400px;dialogHeight:360px;dialogLeft:615px;dialogTop:300px;center:yes;help:yes;resizable:yes;status:yes');
}
function comment(cid){
	showModelessDialog('manage.comment.reply.php?id='+cid,'example05','dialogWidth:300px;dialogHeight:360px;dialogLeft:615px;dialogTop:300px;center:yes;help:yes;resizable:yes;status:yes');
}
function affix(cid){
	showModelessDialog('manage.affix.modify.php?id='+cid,'example05','dialogWidth:300px;dialogHeight:360px;dialogLeft:615px;dialogTop:300px;center:yes;help:yes;resizable:yes;status:yes');
}
