﻿var HZW_xmlHttp = false;
try {
  HZW_xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    HZW_xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    HZW_xmlHttp = false;
  }
}
if (!HZW_xmlHttp && typeof HZW_XMLHttpRequest != 'undefined') {
  HZW_xmlHttp = new HZW_XMLHttpRequest();
}
function HZW_callServer(url,obj)//加载对象
{
  HZW_xmlHttp.open("post", url, true);
  HZW_xmlHttp.onreadystatechange = function (){HZW_updatePage(obj);};
  HZW_xmlHttp.send(null);  
}
function HZW_updatePage(obj) {
  if (HZW_xmlHttp.readyState < 4) {
	document.getElementById(obj).innerHTML="系统获取新上传作品中,请稍后....";
  }
  if (HZW_xmlHttp.readyState == 4) {
  
    var response = HZW_xmlHttp.responseText;
		document.getElementById(obj).innerHTML=response;
  }
}



function ISI_check()
{
if (document.getElementById('checkbox').checked==false){alert('对不起,你没有同意注册条款,请同意~!');return false;}
else
{ISAshow('ISI_Regin02');ISAhidden('ISI_Regin01');}
}
function ISAshow(obj)
{
document.getElementById(obj).style.display='block';
}
function ISAhidden(obj)
{
document.getElementById(obj).style.display='none';
}
function ISI_Regcheck()
{ISI_UserName=document.form1.ISI_UserName;
ISI_Password01=document.form1.ISI_Password01;
ISI_Password02=document.form1.ISI_Password02;
code=document.form1.code;
ISI_Email=document.form1.ISI_Email;
ISI_Tel=document.form1.ISI_Tel;
if (ISI_UserName.value==""){alert('对不起,你还没输入用户名(昵称)');ISI_UserName.focus();return false;}
if (ISI_Password01.value==""){alert('对不起,你还没输入密码)');ISI_Password01.focus();return false;}
if (ISI_Password02.value==""){alert('对不起,你还没输确认密码');ISI_Password02.focus();return false;}
if (code.value==""){alert('对不起,你还没输验证码');code.focus();return false;}
if (ISI_Password01.value!=ISI_Password02.value){alert('对不起,你输入的密码和确认密码不匹配,请认真填写~!');ISI_Password01.value="";ISI_Password01.focus();ISI_Password02.value="";return false;}
if (ISI_Email.value==""){alert('对不起,你还没输入邮箱,请认真填写~!');ISI_Email.focus();return false;}
if(ISI_Tel.value==""){alert('对不起,你还没输入联系电话,请认真填写~!');ISI_Tel.focus();return false;}
	}
function ISI_LOGcheck()
{ISI_UserName=document.ISIform.ISI_UserName;
ISI_Password=document.ISIform.ISI_Password;
if (ISI_UserName.value==""){alert('对不起,你还没输入用户名(昵称)');ISI_UserName.focus();return false;}
if (ISI_Password.value==""){alert('对不起,你还没输密码');ISI_Password.focus();return false;}
document.ISIform.submit();
}
function ISI_upchec()
{ch=confirm("确定要退出上传作品吗?")
if(ch==true){window.close();}else{return false;}
}
function ISI_Upcheck()
{ISI_FileUrl=document.form1.ISI_FileUrl;
ISI_UpfileRtype_01=document.getElementById("ISI_UpfileRtype_01");//作品类型
ISI_UpfileRtype_02=document.getElementById("ISI_UpfileRtype_02");//作品类型

ISI_UpfileName=document.form1.ISI_UpfileName;
ISI_Remark=document.form1.ISI_Remark;
ISI_User_FileRtype=document.form1.ISI_User_FileRtype;

ISI_SoundRtype=document.form1.ISI_SoundRtype//作品分类
ISI_UpfilePlyRtype_So=document.form1.ISI_UpfilePlyRtype_So//作品格式
ISI_UpfilePlyRtype_Dv=document.form1.ISI_UpfilePlyRtype_Dv//作品格式
if (ISI_User_FileRtype.value==0){
	if(ISI_SoundRtype.value==0){alert('对不起,你还没选择作品分类~!');return false;}
	if(document.form1.ISI_User_File_Rtype_Lay.value==1)
	      {if(document.form1.ISI_SoundRtype_Layer.value==""){alert('对不起,你还没选择作品子级分类');document.form1.ISI_SoundRtype_Layer.focus();return false;}
		  }
	}

if(ISI_UpfileRtype_01.checked==true){if(ISI_UpfilePlyRtype_So.selectedIndex=='0'){alert('对不起,你还没选择音频作品格式~!');return false;}}
if(ISI_UpfileRtype_02.checked==true){if(ISI_UpfilePlyRtype_Dv.selectedIndex=='0'){alert('对不起,你还没选择视频作品格式~!');return false;}}
if(ISI_UpfileName.value==""){alert('对不起,你还没有给作品起名,请填写~!');ISI_UpfileName.focus();return false;}
if(ISI_Remark.value==""){alert('对不起,你还没给作品作介绍~!');ISI_Remark.focus();return false;}




if(ISI_FileUrl.value==""){alert('对不起,你还没有上传作品~!');return false;}
document.getElementById('ISI_UpfileRtype_01').disabled=false;
document.getElementById('ISI_UpfileRtype_02').disabled=false;
	}
	
	
	
function ISIimgmcheck()
{if(document.form1.file1.value==""){alert('对不起,你还没选择要上传的图片');return false;}
if(document.form1.ISIimgsrc.value=="images/nopic.png"){alert('对不起,你上传的图片不存在或者格式不正确');return false;}
esave.style.visibility="visible";
}
function ISImodiFile()
{
if(document.getElementById('ISI_UpfileState_0').checked==true){if (document.form1.ISI_UpfileStateBrod.value==""){alert('对不起,你还没填写审核失败的原因');return false;}}
document.form1.submit();
}
function ISI_Change()
{ISI_UpfileRtype_01=document.getElementById("ISI_UpfileRtype_01");
ISI_UpfileRtype_02=document.getElementById("ISI_UpfileRtype_02");

if(ISI_UpfileRtype_01.checked==true){ISAhidden('ISI_UpfilePlyRtype_02');ISAshow('ISI_UpfilePlyRtype_01');ISAshow('ISI_Up_01');ISAhidden('ISI_Up_02');}
if(ISI_UpfileRtype_02.checked==true){ISAshow('ISI_UpfilePlyRtype_02');ISAhidden('ISI_UpfilePlyRtype_01');ISAshow('ISI_Up_02');ISAhidden('ISI_Up_01');}
}
function ISI_DelChange()
{ISI_Up_ShowFile.innerHTML="";
document.form1.ISI_FileUrl.value="";
ISI_UpfileRtype_01=document.getElementById("ISI_UpfileRtype_01");
ISI_UpfileRtype_02=document.getElementById("ISI_UpfileRtype_02");
document.getElementById('ISI_Up_03').style.display='none';
if(ISI_UpfileRtype_01.checked==true){ISAshow('ISI_Up_01');ISAhidden('ISI_Up_02');}
if(ISI_UpfileRtype_02.checked==true){ISAshow('ISI_Up_02');ISAhidden('ISI_Up_01');}
document.getElementById('ISI_UpfileRtype_01').disabled=false;
document.getElementById('ISI_UpfileRtype_02').disabled=false;
}



function ISI_IMG_Del_01()
{document.getElementById('ISI_bord_Img_01').style.display='block';
document.getElementById('ISI_bord_ImgDel_01').style.display='none';
}
function ISI_IMG_Del_02()
{document.getElementById('ISI_bord_Img_02').style.display='block';
document.getElementById('ISI_bord_ImgDel_02').style.display='none';
	}
function ISI_IMG_Del_03()
{document.getElementById('ISI_bord_Img_03').style.display='block';
document.getElementById('ISI_bord_ImgDel_03').style.display='none';}


function ISI_Reg_Change01()
{ISAhidden('ISI_Pk_Url');
	}
function ISI_Reg_Change02()
{ISAshow('ISI_Pk_Url');
	}
function PmSearch()
{ISI_HZW_PM_Date_TrueName=document.form1.ISI_HZW_PM_Date_TrueName;
ISI_HZW_PM_Date_Card=document.form1.ISI_HZW_PM_Date_Card;
if(ISI_HZW_PM_Date_TrueName.value==""){alert('对不起，你还没填写姓名');ISI_HZW_PM_Date_TrueName.focus();return false;}
if(ISI_HZW_PM_Date_Card.value==""){alert('对不起，你还没填写身份证号');ISI_HZW_PM_Date_Card.focus();return false;}
 }

function ISI_Pm_UpFileChange(strv)
{if(strv==""){alert('对不起,你还没选择要上传的文件路径~!');}
else
{UpFileRtype=document.getElementById("UpFileRtype").value;
UpFile_SoundRtype=document.getElementById("UpFile_SoundRtype").value;
   if (UpFileRtype==0){document.getElementById('ISI_FileShow').innerHTML="<img src='"+strv+"' width='150' height='150'>";}
   else
     {HZW_callServer('PmSound_Rtype.asp?ISI_SoundRtypeID='+UpFile_SoundRtype+'&Url='+strv,'ISI_FileShow')}
   }
}
function ISI_UpChange(strv)
{if (strv==0){ISAhidden('UpFile_SoundRtype');document.form1.filelx.value='jpg';}
if(strv==1){ISAshow('UpFile_SoundRtype');document.form1.filelx.value='Sound';}
}
function ISI_PmUpFile_Check()
{ISI_FileUrl=document.getElementById("ISI_FileUrl").value;
if(ISI_FileUrl==""){alert('对不起,你还没输入文件上传的地址');return false;}
else
{document.getElementById("ISI_Pm_submit").disabled=true;document.getElementById("ISI_Pm_Canel").disabled=false;document.getElementById("upfhi").style.display='block';window.dialogArguments.document.getElementById('ISI_HZW_PM_Date_Proje_Rtype').value=document.getElementById('UpFileRtype').value;window.dialogArguments.document.getElementById('ISI_HZW_PM_Date_Proje_SoRtype').value=document.getElementById('UpFile_SoundRtype').value;document.form1.submit();setInterval('proccess();',400)}
	
	}
	
			var p=0,j=0;
			var bar = 0 ;
			var c=new Array("lightskyblue","white")
			function proccess(){
				bar= bar + RandomNumber(9) ;
				if (bar >= 99)
				{
					document.all.percent.value = '由于您上传的文件体积较大,正在整理上传数据......' ;
				}
				else
				{
					document.all.percent.value = bar + "%" ;
				}
				document.forms.proccess.elements[p].style.background=c[j];
				p+=1;
				if(p==30){p=0;j=1-j;}}
				function RandomNumber(max)
				{var today = new Date();
				var num= Math.round((Math.abs(Math.sin(today.getTime()))*10))%max+1;
				return num;
				}








