//导航条切换
function qiehuan(num){
		for(var id = 0;id<=14;id++)
		{
			if(id==num)
			{
				document.getElementById("subnav"+id).style.display='block';
			}
			else
			{
				document.getElementById("subnav"+id).style.display='none';
			}
		}
	}


//商城选项卡切换
function showObj(name,num,m) {
   for(i=1;i<=m;i++) {
      document.getElementById(name+"_con"+i).style.display="none";
      document.getElementById(name+"_tit"+i).className="off";
}
      document.getElementById(name+"_con"+num).style.display="block";
      document.getElementById(name+"_tit"+num).className="on";
}

//评论检查
function Check()
   {  
    if (document.comment.Name.value=="")
    {     
     alert("请输入昵称！");
     document.comment.Name.focus(); 
     return false;   
    }   
    if (document.comment.Content.value=="")
    {    
     alert("请输入评论内容！"); 
     document.comment.Content.focus(); 
     return false;   
    }  
    return true; 
   }
   
//点击复制地址
CopyURL=function(){
try{
clipboardData.setData('text',location.href); 
alert("你已经复制了本页面地址!");
}catch(e){
}
}
//运行代码
function runEx(cod1)  {
 cod=document.all(cod1)
  var code=cod.value;
  if (code!=""){
  var newwin=window.open('','','');  //打开一个窗口并赋给变量newwin。
  newwin.opener = null // 防止代码对页面修改
  newwin.document.write(code);  //向这个打开的窗口中写入代码code，这样就实现了运行代码功能。
  newwin.document.close();
}
}

//复制文本域代码
function cycode(obj) {
	var rng = document.body.createTextRange();
	rng.moveToElementText(obj);
	rng.scrollIntoView();
	rng.select();
	rng.execCommand("Copy");
	window.status="高亮度包含的代码已被复制到剪贴板！Contents highlighted and copied to clipboard!"
	setTimeout("window.status=''",1800)
	rng.collapse(false);
}


//另存代码
function svcode(obj) {
	var winname = window.open('', '_blank', 'top=10000');
	winname.document.open('text/html', 'replace');
	winname.document.writeln(obj.value);
	winname.document.execCommand('saveas','','code.htm');
	winname.close();
}
