﻿// JScript 文件

document.onclick=function()
{
    if(chkdiv("xialastr")){document.getElementById("xialastr").style.display="none";}
    
       if(document.activeElement.id!='svv'){document.getElementById('seachstr').style.display = 'none';}
}
function $(obj)
{
	return document.getElementById(obj).value;
}
function isDigit(s)
{
	var patrn=/^[0-9]{1,20}$/;
	if (!patrn.exec(s)) return false
	return true
}
function isEmail(emailStr)
{
	var reg=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	return reg.test(emailStr)
}
function fTrim(str)
{
	return str.replace(/(^\s*)|(\s*$)/g, "");
}

function print_content()  
{
  var code="<body onload=window.print()>"
  code+=document.getElementById("content2").innerHTML;
  var newwin=window.open('','','');
  newwin.opener = null;
  newwin.document.write(code);
  newwin.document.close();
}
function chkdiv(divid)
{
    var chkid=document.getElementById(divid);
    if(chkid != null)
    {
        return true;
    }
    else 
    {
        return false;
    }
}
function setHome(title, url) {    
    if(!title) {    
        var title = window.document.title;    
    }    
    if(!url) {    
        var url = window.document.location;    
    }    
    try{    
        if (document.all){     
            window.external.addFavorite(url,title);     
        } else if (window.sidebar) {     
            window.sidebar.addPanel(title, url,"");     
        }     
    }catch(e){};    
} 
function copyToClipBoard()
{    
    var clipBoardContent="";      
    clipBoardContent+=this.location.href;    
    window.clipboardData.setData("Text",clipBoardContent);    
    alert("复制成功，请粘贴到你的QQ/MSN上告送给你的好友");
}

function SelectcopyToClipBoard(obj,value)
{   
    obj.select(); 
    var clipBoardContent="";      
    clipBoardContent+=value;    
    window.clipboardData.setData("Text",clipBoardContent);    
    alert("复制成功，您可以将代码粘贴到您的博客和网页");
}
function len(s) 
{ 
	var l = 0; 
	var a = s.split(""); 
	for (var i=0;i<a.length;i++)
	{ 
		if (a[i].charCodeAt(0)<299) 
		{ 
			l++; 
		} 
		else 
		{ 
			l+=2; 
		} 
	} 
	return l; 
} 

function ChangPid(obj)
{
    var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("cidstr");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("cidstr");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("cidstr");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
    as.PostData ="type=1&value="+escape(obj);
	as.send();
	as=null;
}
function CheckReg()
{
    var email=$("email");
    if(len(email)<3||len(email)>100)
    {
        alert("邮箱长度必须是3-100个字符之间！");
        return false;
    }
    if(!isEmail(email))
    {
        alert("电子邮件格式错误！");
        return false;   
    }
    else
    {
        var haveemail=$("haveemail");
        if(haveemail=="1")
        {
            alert("您输入的EMAIL已经存在！");
            return false;
        }
    }
    var username=$("username");
    
     var reg=/^[A-Za-z0-9\u4e00-\u9fa5]+$/;  
var result=reg.test(username);

    if(len(username)<3||len(username)>12)
    {
        alert("用户名长度必须是3-12个字符之间！");
        return false;
    }
    else if(result==false )
    {
        alert("用户名只能包含字母，数字和汉字！");
        return false;
    }
    
    else
    {
        var haveusername=$("haveusername");
        if(haveusername=="1")
        {
            alert("您输入的用户名已经存在！");
            return false;
        }
    }
    var password=$("password");
    if(len(password)<6)
    {
        alert("密码长度不要为汉字，且长度不能少于6个字符！");
        return false;
    }
    var password2=$("password2");
    if(password!=password2)
    {
        alert("两次输入的密码不一样！");
        return false;
    }
    var isread=document.getElementById("isread");
    if(isread.checked==false)
    {
        alert("您必须同意我们的协议！");
        return false;
    }
}
function CheckEmail(obj,str)
{
    if(obj=="")
    {
        document.getElementById(str).innerHTML="电子邮件不能为空！";
    }
    else if(!isEmail(obj))
    {
        document.getElementById(str).innerHTML="电子邮件格式错误！"; 
    }
    else
    {
        var as=new Ajax();
	    //指定错误容器
	    as.OnErrorOBJ 	= document.getElementById(str);
	    //指定状态容器
	    as.OnStateOBJ 	= document.getElementById(str);
	    //指定完成容器
	    as.OnDownloadEndOBJ 	= document.getElementById(str);
	    as.method 	= "post";
	    as.URL	= "/inc/Ajax.aspx"
	    as.Sync	= true;
	    as.Charset	= "utf-8";
        as.PostData ="type=2&value="+escape(obj);
	    as.send();
	    as=null;
	}
}
function CheckUserName(obj,str)
{
     var reg=/^[A-Za-z0-9\u4e00-\u9fa5]+$/;  
var result=reg.test(obj);

 
    if(obj=="")
    {
        document.getElementById(str).innerHTML="用户名不能为空！"; 
    }
    else if(len(obj)<3||len(obj)>20)
    {
        document.getElementById(str).innerHTML="用户名长度必须是3-20个字符之间！"; 
    }
    else if(result==false )
    {
        document.getElementById(str).innerHTML="用户名只能含有字母，数字，汉字！"; 
    }
   else
    {
        var as=new Ajax();
	    //指定错误容器
	    as.OnErrorOBJ 	= document.getElementById(str);
	    //指定状态容器
	    as.OnStateOBJ 	= document.getElementById(str);
	    //指定完成容器
	    as.OnDownloadEndOBJ 	= document.getElementById(str);
	    as.method 	= "post";
	    as.URL	= "/inc/Ajax.aspx"
	    as.Sync	= true;
	    as.Charset	= "utf-8";
        as.PostData ="type=3&value="+escape(obj);
	    as.send();
	    as=null;
	}
}
function CheckLogin()
{
    var email=$("email");
    if(len(email)<3||len(email)>100)
    {
        alert("EMAIL长度必须是3-100个字符之间！");
        return false;
    }
    if(!isEmail(email))
    {
        alert("EMAIL格式不正确！");
        return false;
    }
    var password=$("password");
    if(len(password)<6)
    {
        alert("密码长度不要为汉字，且长度不能少于6个字符！");
        return false;
    }
    var code=$("code");
    if(len(code)!=4||!isDigit(code))
    {
        alert("验证码必须是4位的数字！");
        return false;
    }
}
function CheckTo()
{
    var email=$("email");
    if(len(email)<3||len(email)>100)
    {
        alert("EMAIL长度必须是3-100个字符之间！");
        return false;
    }
    if(!isEmail(email))
    {
        alert("EMAIL格式不正确！");
        return false;
    }
    var password=$("password");
    if(len(password)<6)
    {
        alert("密码长度不要为汉字，且长度不能少于6个字符！");
        return false;
    }
}
function CheckGetPass()
{
    var email=$("email");
    if(len(email)<3||len(email)>100)
    {
        alert("邮箱长度必须是3-100个字符之间！");
        return false;
    }
    if(!isEmail(email))
    {
        alert("邮箱格式不正确！");
        return false;
    }
}
///上传视频需要用的JS
function OnCompleted(fileName)
{
    alert(fileName);
}
function OnCompleted2(fileName)
{
    alert(fileName);
}
function getObj(objName)
{
    return(document.getElementById(objName));
}
function callExternal()
{
    me = getObj("videoupload");
    me.UpLoad();
}
function jsAlert(str)
{
    alert(str);
}

///判断视频填写信息
function CheckUpload()
{
    var callback=parent.document.getElementById("callback").value;
    if(callback!="")
    {
        alert(callback);
        return false;
    }
    var title=$("title");
    if(len(title)<3||len(title)>100)
    {
        alert("视频标题的填写在3-100个字符之间！");
        return false;
    }
    var summary=$("summary")
    {
        if(len(summary)<10||len(summary)>600)
        {
            alert("视频描述信息在10-600个字符之间！");
            return false;
        }
    }
    var A_Classid=$("A_Classid");
    if(A_Classid=="")
    {
        alert("必须选择一个视频所属的一级类别！");
        return false;
    }
    var B_Classid=$("B_Classid");
    if(B_Classid=="")
    {
        alert("必须选择一个视频所属的二级类别！");
        return false;
    }
    var temp=document.getElementsByName("ispay");
    var ispay;
    var price=$("price");
    for (i=0;i<temp.length;i++)
    {
        if(temp[i].checked)
        {
            ispay=temp[i].value;
        }
    }
    if(ispay=="1")
    {
        if(CheckAccout(price)==false)
        {
            alert("价格填写错误！");
            return false;
        }
    }
    //parent.up.callExternal();
}
///判断视频填写信息
function CheckUpload1()
{
//    var callback=parent.document.getElementById("callback").value;
//    if(callback!="")
//    {
//        alert(callback);
//        return false;
//    }
    var title=$("title");
    if(len(title)<3||len(title)>100)
    {
        alert("视频标题的填写在3-100个字符之间！");
        return false;
    }
    var summary=$("summary")
    {
        if(len(summary)<10||len(summary)>600)
        {
            alert("视频描述信息在10-600个字符之间！");
            return false;
        }
    }
    
    
    var A_Classid=$("A_Classid");
    if(A_Classid=="")
    {
        alert("必须选择一个视频所属的一级类别！");
        return false;
    }
    var B_Classid=$("B_Classid");
    if(B_Classid=="")
    {
        alert("必须选择一个视频所属的二级类别！");
        return false;
    }
    //parent.up.callExternal();
}

///多级栏目选择
function Change_Catalog(obj,c,size)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=4&value="+escape(obj)+"&typestr="+escape(c)+"&size="+escape(size);
	as.send();
	document.getElementById(c).style.display="";
	as=null;
	if(c=="B")
	{
	    document.getElementById("C").innerHTML="<select name=\"C_Classid\" size=\"5\" id=\"C_Classid\"></select>";
	}
}
///多级栏目选择
function Select_A_Catalog(obj,c,size)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=40&value="+escape(obj)+"&typestr="+escape(c)+"&size="+escape(size);
	as.send();
	as=null;
}
function ChangeCity(obj,c)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=5&value="+escape(obj);
	as.send();
	as=null;
}
function ChangeSchool(obj,c)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=6&value="+escape(obj);
	as.send();
	as=null;
}
function CheckModiPass()
{
    var oldpass=$("oldpass");
    if(len(oldpass)<3||len(oldpass)>20)
    {
        alert("旧密码必须在3-20位之间！");
        return false;
    }
    var newpass=$("newpass");
    if(len(newpass)<3||len(newpass)>20)
    {
        alert("新密码必须在3-20位之间！");
        return false;
    }
    var newpass1=$("newpass1");
    if(newpass!=newpass1)
    {
        alert("两次输入的密码不相同！");
        return false;
    }
}
function ShowFirst(c)
{
    if(document.getElementById(c).style.display=="none")
    {
        document.getElementById(c).style.display="block";
    }
    else
    {
        document.getElementById(c).style.display="none";
    }
}
function isIdCardNo(num) {            
    num = num.toUpperCase();           //身份证号码为15位或者18位，15位时全为数字，18位前17位为数字，最后一位是校验位，可能为数字或字符X。        
    if (!(/(^\d{15}$)|(^\d{17}([0-9]|X)$)/.test(num))) {     
        alert('输入的身份证号长度不对，或者号码不符合规定！\n15位号码应全为数字，18位号码末位可以为数字或X。');              
        return false;         
    } //校验位按照ISO 7064:1983.MOD 11-2的规定生成，X可以认为是数字10。 
    //下面分别分析出生日期和校验位 
    var len, re; len = num.length; if (len == 15) { 
        re = new RegExp(/^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/); 
        var arrSplit = num.match(re);  //检查生日日期是否正确
        var dtmBirth = new Date('19' + arrSplit[2] + '/' + arrSplit[3] + '/' + arrSplit[4]); 
        var bGoodDay; bGoodDay = (dtmBirth.getYear() == Number(arrSplit[2])) && ((dtmBirth.getMonth() + 1) == Number(arrSplit[3])) && (dtmBirth.getDate() == Number(arrSplit[4]));
        if (!bGoodDay) {         
            alert('输入的身份证号里出生日期不对！');            
            return false;
        } else { //将15位身份证转成18位 //校验位按照ISO 7064:1983.MOD 11-2的规定生成，X可以认为是数字10。        
            var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);         
            var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');      
            var nTemp = 0, i;            
            num = num.substr(0, 6) + '19' + num.substr(6, num.length - 6);           
            for(i = 0; i < 17; i ++) {                 
                nTemp += num.substr(i, 1) * arrInt[i];        
            }
            num += arrCh[nTemp % 11]; 
            return true;
        }
    }
    if (len == 18) {
        re = new RegExp(/^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/); 
        var arrSplit = num.match(re);  //检查生日日期是否正确 
        var dtmBirth = new Date(arrSplit[2] + "/" + arrSplit[3] + "/" + arrSplit[4]); 
        var bGoodDay; bGoodDay = (dtmBirth.getFullYear() == Number(arrSplit[2])) && ((dtmBirth.getMonth() + 1) == Number(arrSplit[3])) && (dtmBirth.getDate() == Number(arrSplit[4])); 
        if (!bGoodDay) { 
            alert(dtmBirth.getYear()); 
            alert(arrSplit[2]); 
            alert('输入的身份证号里出生日期不对！'); 
            return false; 
        }
        else { //检验18位身份证的校验码是否正确。 //校验位按照ISO 7064:1983.MOD 11-2的规定生成，X可以认为是数字10。 
            var valnum; 
            var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2); 
            var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'); 
            var nTemp = 0, i; 
            for(i = 0; i < 17; i ++) { 
                nTemp += num.substr(i, 1) * arrInt[i];
            } 
            valnum = arrCh[nTemp % 11]; 
            if (valnum != num.substr(17, 1)) { 
                alert('第18位身份证的校验码不正确！应该为：' + valnum); 
                return false; 
            } 
            return true; 
        } 
    } return false;
}
function regBank(obj) 
{ 
    var regex=/^(\d{4}[\s\-]?){4,5}\d{3}$/g; 
    var result = regex.test(obj); 
    return result;
}
function CheckRegM()
{
    var truename=$("truename");
    if(len(truename)<3||len(truename)>20)
    {
        alert("真实姓名必须在3-20个字符之间！");
        return false;
    }
    var cardno=$("cardno");
    if(isIdCardNo(cardno)==false)
    {
        return false;
    }
    var address=$("address");
    if(len(address)<10||len(address)>200)
    {
        alert("地址必须在10-200个字符之间！");
        return false;
    }
    var Bank=$("Bank");
    if( Bank.indexOf("银行")<=-1||len(Bank)<10||len(Bank)>100)
    {
                alert("请检查银行帐户开户行格式，并且必须在10-100个字符之间！");

        return false;
    }
    var name=$("name");
    if(len(name)<2||len(name)>50)
    {
        alert("开户名必须在2-50个字符之间！");
        return false;
    }
    var bankAccount=$("bankAccount");
    //if(regBank(bankAccount)==false)
    //{
        //alert("银行帐号错误！");
        //return false;
    //}
    if(len(bankAccount)<8||len(bankAccount)>25)
    {
        alert("银行帐号必须在8-25个字符之间！");
        return false;
    }
}
function CheckRegVip()
{
    var truename=$("truename");
    if(len(truename)<3||len(truename)>40)
    {
        alert("企业名称必须在3-40个字符之间！");
        return false;
    }
    var Bank=$("Bank");
    if( Bank.indexOf("银行")<=-1||len(Bank)<10||len(Bank)>100)
    {
                alert("请检查银行帐户开户行格式，并且必须在10-100个字符之间！");

        return false;
    }
    var name=$("name");
    if(len(name)<2||len(name)>50)
    {
        alert("开户名必须在2-50个字符之间！");
        return false;
    }
    var bankAccount=$("bankAccount");
    //if(regBank(bankAccount)==false)
    //{
        //alert("银行帐号错误！");
        //return false;
    //}
    if(len(bankAccount)<8||len(bankAccount)>25)
    {
        alert("银行帐号必须在8-25个字符之间！");
        return false;
    }
}
function CheckRegM1()
{
    var cardno=$("cardno");
    if(isIdCardNo(cardno)==false)
    {
        return false;
    }
    var address=$("address");
    if(len(address)<10||len(address)>200)
    {
        alert("地址必须在10-200个字符之间！");
        return false;
    }
    var Bank=$("Bank");
    if(Bank.indexOf("银行")<=-1||len(Bank)<10||len(Bank)>100)
    {
                alert("请检查银行帐户开户行格式，并且必须在10-100个字符之间！");

        return false;
    }
}
function CheckSpecial()
{
    var title=$("title");
    
    if(len(title)<2||len(title)>50)
    {
        alert("专辑名称必须在2-50个字符之间！");
        return false;
    }
}

function showfriends(objstr)
{
    if(document.getElementById(objstr).style.display=="none")
    {
        document.getElementById(objstr).style.display="block";
    }
    else
    {
        document.getElementById(objstr).style.display="none";
    }
}
function CheckSend()
{
    var friendids=$("friendids");
    if(friendids=="")
    {
        alert("请选择您要发送消息的好友！");
        return false;
    }
    var content=$("content");
    if(len(content)<8||len(content)>500)
    {
        alert("发送的消息必须在8-500个字符之间！");
        return false;
    }
}
function CheckF(obj,fid,fname)
{
    if(obj==true)
    {
        document.getElementById("friendnames").value=document.getElementById("friendnames").value+fname+",";
        document.getElementById("friendids").value=document.getElementById("friendids").value+fid+",";
    }
    else
    {
        document.getElementById("friendnames").value=document.getElementById("friendnames").value.replace(fname+",","");
        document.getElementById("friendids").value=document.getElementById("friendids").value.replace(fid+",","");
    }
}
function DelShortMess(id,userid,typestr,typeid,isop)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("c");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("c");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("c");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=7&value="+escape(id)+"&userid="+escape(userid)+"&typestr="+escape(typestr)+"&typeid="+typeid+"&isop="+isop;
	as.send();
	as=null;
}
function CheckPlayLists()
{
    var title=$("title");
    if(len(title)<3||len(title)>20)
    {
        alert("标题必须在3-20个字符之间！");
        return false;
    }
}
function DelPL(userid,id)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("c");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("c");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("c");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=8&value="+escape(id)+"&userid="+escape(userid);
	as.send();
	as=null;
}
function DelV(userid,state,orderby,page,id,stateNow)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("c");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("c");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("c");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	
	as.PostData ="type=9&value="+escape(id)+"&userid="+escape(userid)+"&state="+escape(state)+"&orderby="+escape(orderby)+"&page="+escape(page)+"&stateNow="+escape(stateNow);
	as.send();
	as=null;
}
function CommV(userid,state,orderby,page,id)
{
	var as=new Ajax();
		//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("c");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("c");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("c");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=42&value="+escape(id)+"&userid="+escape(userid)+"&state="+escape(state)+"&orderby="+escape(orderby)+"&page="+escape(page);
	as.send();
	as=null;
}
function DelPV(userid,issucc,page,id)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("c");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("c");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("c");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=10&value="+escape(id)+"&userid="+escape(userid)+"&issucc="+escape(issucc)+"&page="+escape(page);
	as.send();
	as=null;
}
function SelectStr(obj,num,userid)
{
    if(obj==true)
    {
        if(num=="1"||num=="3")
        {
            document.getElementById("PC").innerHTML="<input type='hidden' name='a_classid' id='a_classid' value='0' /><input type='hidden' name='b_classid' id='b_classid' value='0' />";
			var bgcolor=$("bgcolor");
			var fgcolor=$("fgcolor");
			var as=new Ajax();
			//指定错误容器
			as.OnErrorOBJ 	= document.getElementById("pstr");
			//指定状态容器
			as.OnStateOBJ 	= document.getElementById("pstr");
			//指定完成容器
			as.OnDownloadEndOBJ 	= document.getElementById("pstr");
			as.method 	= "post";
			as.URL	= "/inc/Ajax.aspx"
			as.Sync	= true;
			as.Charset	= "utf-8";
			as.PostData ="type=39&value="+escape(num)+"&bgcolor="+escape(bgcolor)+"&fgcolor="+escape(fgcolor);
			as.send();
			as=null;

        }
        else
        {
			var as=new Ajax();
			//指定错误容器
			as.OnErrorOBJ 	= document.getElementById("PC");
			//指定状态容器
			as.OnStateOBJ 	= document.getElementById("PC");
			//指定完成容器
			as.OnDownloadEndOBJ 	= document.getElementById("PC");
			as.method 	= "post";
			as.URL	= "/inc/Ajax.aspx"
			as.Sync	= true;
			as.Charset	= "utf-8";
			as.PostData ="type=11&value="+escape(num)+"&userid="+escape(userid);
			as.send();
			as=null;
        }
    }
}
function ChangColor(bg,fg)
{
    document.getElementById("bgcolor").value=bg;
    document.getElementById("bgcolor").style.backgroundColor=bg
    document.getElementById("fgcolor").value=fg;
    document.getElementById("fgcolor").style.backgroundColor=fg;
}
function CheckPlayer()
{
    var title=$("title");
    if(len(title)<3||len(title)>100)
    {
        alert("标题应该在3-100个字符之间！");
        return false;
    }
    var a_classid=$("a_classid");
    var b_classid=$("b_classid");
    var vlistid=GetRadioValue("vlistid");
    if(vlistid=="1"||vlistid=="3")
    {}
    else
    {
        if(vlistid=="2")
        {
			if(a_classid=="0")
			{
				alert("请选择一个类别!");
				return false;
			}
        }
        else
        {
			if(a_classid=="0")
			{
				alert("请选择一个大类别!");
				return false;
			}
			if(b_classid=="0")
			{
				alert("请选择一个小类别!");
				return false;
			}
        }
    }
    var bgcolor=$("bgcolor");
    var fgcolor=$("fgcolor");
    if(bgcolor==""||fgcolor=="")
    {
        alert("前景色和背景色都必须选择！");
        return false;
    }
}
function DelPLA(userid,id)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("c");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("c");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("c");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=12&value="+escape(id)+"&userid="+escape(userid);
	as.send();
	as=null;
}
function OKPrice(webprice,userid,videoid,id)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("c");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("c");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("c");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=13&value="+escape(id)+"&userid="+escape(userid)+"&videoid="+escape(videoid)+"&webprice="+escape(webprice);
	as.send();
	as=null;
}
function SearchV(key,c)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=14&value="+escape(key);
	as.send();
	as=null;
}
function WriteV(vid,title)
{
    document.getElementById("nowvid").value=vid;
    document.getElementById("keys").value=title;
    document.getElementById("searchstr").style.display="none";
}
function AddPVLists(pid,c)
{
    var nowvid=document.getElementById("nowvid").value;
    if(nowvid=="0")
    {
        alert("请选择一个需要添加的视频名称！");
        return false;
    }
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=15&value="+escape(pid)+"&nowvid="+escape(nowvid);
	as.send();
	as=null;
	document.getElementById("nowvid").value="0";
}
function ShowS(obj,c)
{
    document.getElementById("lastclassid").value=document.getElementById("lastclassid").value+",s|"+obj;
    //alert(document.getElementById("lastclassid").value);
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=16&value="+escape(obj);
	as.send();
	as=null;
	var preid=$("preid");
    document.getElementById(preid).className="";
    document.getElementById("preid").value=obj;
    document.getElementById(obj).className="one";
    
	as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("t");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("t");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("t");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=17&value="+escape(obj);
	as.send();
	as=null;
}
function goback()
{
    var lastclassid=document.getElementById("lastclassid").value;
    var _lastclassid=lastclassid.split(",");
    if(_lastclassid.length>=2)
    {
        var last=_lastclassid[_lastclassid.length-2];
        var _last=last.split("|");
        if(_last[0]=="s")
        {
            ShowS(_last[1],"s");
        }
        else if(_last[0]=="t")
        {
            ShowT(_last[1],"t");
        }
    }
    var lastall="";
    for(var i=0;i<_lastclassid.length-1;i++)
    {
        lastall=lastall+","+_lastclassid[i];
    }
    document.getElementById("lastclassid").value=lastall;
}
function ShowT(obj,c)
{
    document.getElementById("lastclassid").value=document.getElementById("lastclassid").value+",t|"+obj;
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=17&value="+escape(obj);
	as.send();
	as=null;
}

function ShowP(obj,obj2)
{
    if(obj==true)
    {
        if(obj2=="0")
        {
            document.getElementById("pstr").style.display="none";
        }
        else
        {
            document.getElementById("pstr").style.display="block";
        }
    }
}


function ShowLatestDevelopment(c,page,cls)
{
//alert("type=53&page="+escape(page) +"&cls="+escape(cls));
if(cls=="weibo")
{document.getElementById("topic_top").className="topic_top_1";}
else
{document.getElementById("topic_top").className="topic_top_2";}

	var as=new Ajax();
	
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=53&page="+escape(page) +"&cls="+escape(cls);
	as.send();
	as=null;
}


function CheckAccout(v)//判断是否是金额
{
	var a=/^[0-9]*(\.[0-9]{1,2})?$/;
	if(!a.test(v))
	{
		return false;
	}
	else
	{
		return true;
	}
}
function Vote(obj,c,state)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=18&value="+escape(obj)+"&state="+escape(state);
	as.send();
	as=null;
}
function Selectthispic(now,pic,num)
{
    for(var i=0;i<num;i++)
    {
        document.getElementById(i).className="";
    }
    document.getElementById(now).className="one";
    document.getElementById("pic").value=pic;
}
function Comm(obj,userid,typeid,code)
{
    var c="commstr";
    var content=$("content");
     var acceptId=document.getElementById('acceptId').title;
   if(len(content)<10||len(content)>500 || content =='请勿刷评论，并注意语言文明，否则将删除评论并扣除10个果果！' )
    {
        alert("评论不能小于10个字符，大于500个字符！");
        return false;
    }
	var ifAnoy,username,pwd;
    if(document.getElementById("vlogin_anony").checked)
    {
ifAnoy='1';
         alert("对不起，暂时不能匿名评论！");
        return false;

  }
    else
    {    
    
ifAnoy='0';

}

if(ifAnoy=='0' && userid=="0")
{

username=document.getElementById('vlogin_name').value;
pwd=document.getElementById('vlogin_pwd').value;
   if(len(username)==0)
    {
        alert("用户名不能为空！");
        return false;
    }
   if(len(pwd)==0)
    {
        alert("密码不能为空！");
        return false;
    }
}
   if(len(code)!=4)
    {
        alert("验证码错误！");
        return false;
    }
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
//	alert("type=20&value="+escape(obj)+"&userid="+escape(userid)+"&content="+escape(content)+"&acceptId="+escape(acceptId)+"&typeid="+escape(typeid)+"&code="+escape(code)+"&ifAnoy="+escape(ifAnoy)+"&username="+escape(username)+"&pwd="+escape(pwd));
	as.PostData ="type=20&value="+escape(obj)+"&userid="+escape(userid)+"&content="+escape(content)+"&acceptId="+escape(acceptId)+"&typeid="+escape(typeid)+"&code="+escape(code)+"&ifAnoy="+escape(ifAnoy)+"&username="+escape(username)+"&pwd="+escape(pwd);
	as.send();
	as=null;
}
function ShowPL(videoid,obj)
{
    var c="otherstr";
    for(var i=0;i<=5;i++)
    {
       document.getElementById("bar"+i).className=""; 
    }
    document.getElementById("bar"+obj).className="one";
    //document.getElementById("otherstr").style.display="block";
    document.getElementById("sstr").style.display="none";
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=21&value="+escape(videoid);
	as.send();
	as=null;
}
function addmypl(obj)
{
    //获取下拉框中的值
    var c="otherstr";
    var playlists=document.getElementById("playlists");
    var pvalue=playlists.options[playlists.selectedIndex].value;
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	//alert("type=22&value="+escape(obj)+"&select="+playlists.options[playlists.selectedIndex].value);
	as.PostData ="type=22&value="+escape(obj)+"&select="+playlists.options[playlists.selectedIndex].value;
	as.send();
	as=null;
}
function AddFav(videoid,obj)
{
    var c="otherstr";
    for(var i=0;i<=5;i++)
    {
       document.getElementById("bar"+i).className=""; 
    }
    document.getElementById("bar"+obj).className="one";
    document.getElementById("sstr").style.display="none";
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=23&value="+escape(videoid);
	as.send();
	as=null;
}
function AddSpecial(userid,state,orderby,page,videoid,specialId)
{
    var c="c";
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=54&videoid="+escape(videoid) +"&userid="+escape(userid) +"&state="+escape(state) +"&orderby="+escape(orderby) +"&page="+escape(page) +"&specialId="+escape(specialId);
	as.send();
	as=null;
}

function DelVideo_special(userid , specialId,  page,videoId)
{
    var c="c";
    
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=55&userid="+escape(userid) +"&page="+escape(page) +"&specialId="+escape(specialId) +"&videoId="+escape(videoId);
	as.send();
	as=null;
}
function Report(videoid,obj)
{
    var c="otherstr";
    for(var i=0;i<=5;i++)
    {
       document.getElementById("bar"+i).className=""; 
    }
    document.getElementById("bar"+obj).className="one";
    document.getElementById("sstr").style.display="none";
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=24&value="+escape(videoid);
	as.send();
	as=null;
}
function GetRadioValue(RadioName){
    var obj;    
    obj=document.getElementsByName(RadioName);
    if(obj!=null){
        var i;
        for(i=0;i<obj.length;i++){
            if(obj[i].checked){
                return obj[i].value;            
            }
        }
    }
    return null;
}
function AddReport(obj,userid)
{
    var c="otherstr";
    var content=$("content");
    if(len(content)<10||len(content)>500)
    {
        alert("举报理由不能小于10个字符，大于500个字符！");
        return false;
    }
	var typeid=GetRadioValue("typeid");
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=25&value="+escape(obj)+"&userid="+escape(userid)+"&content="+escape(content)+"&typeid="+escape(typeid);
	as.send();
	as=null;
}
function SendEmail(url)
{
    var c="emailstr_";
    var to=$("to");
    //var from=$("from");
    if(!isEmail(to))
    {
        alert("收件人邮箱格式错误！");
        return false;
    }
    //if(!isEmail(from))
    //{
    //    alert("发件人邮箱格式错误！");
    //    return false;
    //}
    //var password=$("password");
    //if(len(password)<1)
    //{
    //    alert("密码不能为空！");
    //    return false;
    //}
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	//as.PostData ="type=26&url="+escape(url)+"&to="+escape(to)+"&from="+escape(from)+"&password="+escape(password);
	as.PostData ="type=26&url="+escape(url)+"&to="+escape(to);
	as.send();
	as=null;
	//document.getElementById("from").value="";
	document.getElementById("to").value="";
	//document.getElementById("password").value="";
}

function AgainPrice(userid,videoid)
{
    var c="c";
    var price=$("price");
	if(len(price)<1||CheckAccout(price)==false)
	{
		alert("价格填写错误！");
		return false;
	}
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=27&userid="+escape(userid)+"&videoid="+escape(videoid)+"&price="+escape(price);
	as.send();
	as=null;
}
function OKPrice(webprice,userid,videoid,id)
{
    var c="c";
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=28&userid="+escape(userid)+"&videoid="+escape(videoid)+"&webprice="+escape(webprice)+"&pid="+escape(id);
	as.send();
	as=null;
}
function DelFav(userid,state,orderby,page,id)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("c");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("c");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("c");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=29&value="+escape(id)+"&userid="+escape(userid)+"&state="+escape(state)+"&orderby="+escape(orderby)+"&page="+escape(page);
	as.send();
	as=null;
}
function DelComm(userid,state,orderby,page,id)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("c");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("c");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("c");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=30&value="+escape(id)+"&userid="+escape(userid)+"&state="+escape(state)+"&orderby="+escape(orderby)+"&page="+escape(page);
	as.send();
	as=null;
}
function ChangeColor(bgcolor,fgcolor)
{
    var firstflvid=$("firstflvid");
    var action=$("action");
    var vlistid=GetRadioValue("vlistid");
    var a_classid,b_classid;
    if(chkdiv(a_classid))
    {
        a_classid=$("a_classid");
    }
    else
    {
        a_classid="0";
    } 
    if(chkdiv(a_classid))
    {
        b_classid=$("b_classid");
    }
    else
    {
        b_classid="0";
    }    
	document.getElementById("bgcolor_b").style.backgroundColor=bgcolor;
	document.getElementById("fgcolor_b").style.backgroundColor=fgcolor;
	document.getElementById("fgcolor").value=fgcolor;
	document.getElementById("bgcolor").value=bgcolor;
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("pstr");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("pstr");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("pstr");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=31&fgcolor="+escape(fgcolor)+"&bgcolor="+escape(bgcolor)+"&value="+escape(firstflvid)+"&action="+escape(action)+"&typeid="+escape(vlistid)+"&a_classid="+escape(a_classid)+"&b_classid="+escape(b_classid);
	as.send();
	as=null;
}
function doclick(color,obj)
{
    document.getElementById(obj).value=color;
    var modelid=$("modelid");
    var bgcolor=$("bgcolor");
    var bordercolor=$("bordercolor");
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("mstr");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("mstr");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("mstr");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	//document.write("type=32&value="+escape(modelid)+"&bgcolor="+escape(bgcolor)+"&bordercolor="+escape(bordercolor));
	as.PostData ="type=32&value="+escape(modelid)+"&bgcolor="+escape(bgcolor)+"&bordercolor="+escape(bordercolor);
	as.send();
	as=null;
}

function addf(userid)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("callbackstr");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("callbackstr");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("callbackstr");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=33&value="+escape(userid);
	as.send();
	as=null;
}
function pass(id,userid,obj)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("c");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("c");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("c");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=34&value="+escape(id)+"&userid="+escape(userid)+"&typestr="+escape(obj);
	as.send();
	as=null;
}
function passandadd(id,userid,obj)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("c");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("c");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("c");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=35&value="+escape(id)+"&userid="+escape(userid)+"&typestr="+escape(obj);
	as.send();
	as=null;
}
function SendContent(userid)
{
    var content=$("content");
    if(len(content)<3||len(content)>300)
    {
        alert("留言必须在3-300个字符之间！");
        return false;
    }
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("c");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("c");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("c");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=36&userid="+escape(userid)+"&typestr="+escape(content);
	as.send();
	as=null;
}
function AddSub(typeid,userid)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("substr");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("substr");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("substr");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=37&typeid="+escape(typeid)+"&userid="+escape(userid);
	as.send();
	as=null;
}
function SelectAClassid(obj)
{
    var bgcolor=$("bgcolor");
    var fgcolor=$("fgcolor");
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("pstr");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("pstr");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("pstr");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=38&value="+escape(obj)+"&bgcolor="+escape(bgcolor)+"&fgcolor="+escape(fgcolor);
	as.send();
	as=null;
}
function Select_B_Catalog(obj)
{
    var bgcolor=$("bgcolor");
    var fgcolor=$("fgcolor");
    var a_classid=$("a_classid");
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("pstr");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("pstr");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("pstr");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=41&value="+escape(obj)+"&bgcolor="+escape(bgcolor)+"&fgcolor="+escape(fgcolor)+"&typeid="+escape(a_classid);
	as.send();
	as=null;
}

function showshare(obj)
{
    if(document.getElementById("share_"+obj).style.display=="none")
    {
       document.getElementById("share_"+obj).style.display="block"; 
    }
    else
    {
        document.getElementById("share_"+obj).style.display="none"
    }
}

function SendEmailShare(id,url)
{
    var c="share_"+id;
    var to=$("to"+id);
    var from=$("from"+id);
    if(!isEmail(to))
    {
        alert("收件人邮箱格式错误！");
        return false;
    }
    if(!isEmail(from+id))
    {
        alert("发件人邮箱格式错误！");
        return false;
    }
    var password=$("password"+id);
    if(len(password)<1)
    {
        alert("密码不能为空！");
        return false;
    }
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=26&url="+escape(url)+"&to="+escape(to)+"&from="+escape(from)+"&password="+escape(password);
	as.send();
	as=null;
}
function showcount(obj)
{
    if(document.getElementById("count_"+obj).style.display=="none")
    {
       document.getElementById("count_"+obj).style.display="block"; 
    }
    else
    {
        document.getElementById("count_"+obj).style.display="none"
    }
}
function ShowIn(obj)
{
    document.getElementById(obj).style.display="block";
}
function ShowOut(obj)
{
    document.getElementById(obj).style.display="none";
}
function searchvv()
{
    var key=$("key1").replace(/(^\s*)|(\s*$)/g, "");
    
    var typeid=$("typeid");
    if(len(key)<1||len(key)>100||key=="关键词用空格分开")
    {
       alert("关键字必须在1-100个字符之间！");
        //return false;
    }
    else
    {
        window.open("/Search/"+escape(typeid)+"/"+encodeURI(key)+"/0/0/0/");
    }
    //return true;
}
function searchvv2()
{
    var key=$("fkey").replace(/(^\s*)|(\s*$)/g, "");
    
    if(len(key)<1||len(key)>100||key=="关键词用空格分开")
    {
       alert("关键字必须在1-100个字符之间！");
        //return false;
    }
    else
    {
        window.open("/Search/2/"+encodeURI(key)+"/0/0/0/");
    }
    //return true;
}

function searchvv1()
{
    var key=$("key1").replace(/(^\s*)|(\s*$)/g, "");
    var typeid=$("typeid1");
    if(len(key)<1||len(key)>100)
    {
        alert("关键字必须在1-100个字符之间！");
        //return false;
    }
    else
    {
        window.open("/Search/"+escape(typeid)+"/"+encodeURI(key)+"/0/0/0/");
    }
    //return true;
}

function showxiala(obj)
{
    if(document.getElementById(obj).style.display=="none")
    {
        document.getElementById(obj).style.display="block";
    }
    else
    {
        document.getElementById(obj).style.display="none";
    }
}
function showname(obj,objname)
{
    document.getElementById("typeid").value=obj;
    document.getElementById("namestr").innerHTML=objname;
    document.getElementById("xialastr").style.display="none";
}
function showname1(obj,objname)
{
    document.getElementById("typeid1").value=obj;
    document.getElementById("namestr1").innerHTML=objname;
    document.getElementById("xialastr1").style.display="none";
}

function CheckResetPass()
{
    var password=$("password");
    if(len(password)<6)
    {
        alert("密码长度不要为汉字，且长度不能少于6个字符！");
        return false;
    }
    var password2=$("password2");
    if(password!=password2)
    {
        alert("两次输入的密码不一样！");
        return false;
    }
}
function DELPLV(playlistid,id)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("c");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("c");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("c");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=43&value="+escape(playlistid)+"&typeid="+escape(id);
	as.send();
	as=null;
}

function CommVote(commid,typeid,c)
{
    c=c+"_"+commid;
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=44&value="+escape(commid)+"&typeid="+escape(typeid);
	as.send();
	as=null;
}
function ChangeSub(typeid,obj)
{
    location.href="/Users/My/Sub/"+typeid+"/"+obj+"/";
}
function DelSub(id,userid,typeid,orderby)
{
    var c="c";
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=45&value="+escape(id)+"&userid="+escape(userid)+"&typeid="+escape(typeid)+"&orderby="+escape(orderby);
	as.send();
	as=null;
}
function checkAll()
{
		var actID=document.getElementsByName("email");
		if(document.getElementById("checkall").checked==false){
			for(i=0;i<actID.length;i++){
				actID[i].checked=false;
			}
		}else{
			for(i=0;i<actID.length;i++){
				actID[i].checked=true;
			}
		}
}
function WebPrice(userid,priceid,videoid,price,ispay)
{
    var c="c";
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=46&userid="+escape(userid)+"&priceid="+escape(priceid)+"&videoid="+escape(videoid)+"&price="+escape(price)+"&ispay="+escape(ispay);
	as.send();
	as=null;
}
function VoteShow(obj)
{   
    var c="votestr";
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	//alert("type=47&value="+escape(obj));
	as.PostData ="type=47&value="+escape(obj);
	as.send();
	as=null;
	
}
function SearchLists(key,c,cls)
{
    if(fTrim(key)!="")
    {
        key=key.replace(":"," ");
	    var as=new Ajax();
	    //指定错误容器
	    as.OnErrorOBJ 	= document.getElementById(c);
	    //指定状态容器
	    as.OnStateOBJ 	= document.getElementById(c);
	    //指定完成容器
	    as.OnDownloadEndOBJ 	= document.getElementById(c);
	    as.method 	= "post";
	    as.URL	= "/inc/Ajax.aspx"
	    as.Sync	= true;
	    as.Charset	= "utf-8";
	    as.PostData ="type=48&value="+fTrim(escape(key)) +"&cls=" + fTrim(escape(cls));
	    as.send();
	    as=null;
    }
}

function DelSpecial(specialId,userId,page)
{
        var c="c";
	    var as=new Ajax();
	    //指定错误容器
	    as.OnErrorOBJ 	= document.getElementById(c);
	    //指定状态容器
	    as.OnStateOBJ 	= document.getElementById(c);
	    //指定完成容器
	    as.OnDownloadEndOBJ 	= document.getElementById(c);
	    
	    as.method 	= "post";
	    as.URL	= "/inc/Ajax.aspx"
	    as.Sync	= true;
	    as.Charset	= "utf-8";
	    as.PostData ="type=56&specialId="+fTrim(escape(specialId)) +"&userId=" + fTrim(escape(userId))+"&page=" + fTrim(escape(page));
	    as.send();
	    as=null;
}
function UpSpecial(videoId,userId,page,specialId)
{
        var c="c";
	    var as=new Ajax();
	    //指定错误容器
	    as.OnErrorOBJ 	= document.getElementById(c);
	    //指定状态容器
	    as.OnStateOBJ 	= document.getElementById(c);
	    //指定完成容器
	    as.OnDownloadEndOBJ 	= document.getElementById(c);
	    as.method 	= "post";
	    as.URL	= "/inc/Ajax.aspx"
	    as.Sync	= true;
	    as.Charset	= "utf-8";
	    as.PostData ="type=57&specialId="+fTrim(escape(specialId)) +"&userId=" + fTrim(escape(userId))+"&page=" + fTrim(escape(page))+"&videoid=" + fTrim(escape(videoId));
	    as.send();
	    as=null;
}
function DownSpecial(videoId,userId,page,specialId)
{
        var c="c";
	    var as=new Ajax();
	    //指定错误容器
	    as.OnErrorOBJ 	= document.getElementById(c);
	    //指定状态容器
	    as.OnStateOBJ 	= document.getElementById(c);
	    //指定完成容器
	    as.OnDownloadEndOBJ 	= document.getElementById(c);
	    as.method 	= "post";
	    as.URL	= "/inc/Ajax.aspx"
	    as.Sync	= true;
	    as.Charset	= "utf-8";
	    as.PostData ="type=58&specialId="+fTrim(escape(specialId)) +"&userId=" + fTrim(escape(userId))+"&page=" + fTrim(escape(page))+"&videoid=" + fTrim(escape(videoId));
	    as.send();
	    as=null;
}
function SetSepcialPic(videoId,userId,page,specialId,pic)
{
        var c="c";
	    var as=new Ajax();
	    //指定错误容器
	    as.OnErrorOBJ 	= document.getElementById(c);
	    //指定状态容器
	    as.OnStateOBJ 	= document.getElementById(c);
	    //指定完成容器
	    as.OnDownloadEndOBJ 	= document.getElementById(c);
	    as.method 	= "post";
	    as.URL	= "/inc/Ajax.aspx"
	    as.Sync	= true;
	    as.Charset	= "utf-8";
	    as.PostData ="type=70&specialId="+fTrim(escape(specialId)) +"&userId=" + fTrim(escape(userId))+"&page=" + fTrim(escape(page))+"&videoid=" + fTrim(escape(videoId))+"&pic=" + fTrim(escape(pic));
	    as.send();
	    as=null;
}

function AddFavSpecial(userid,specialId,page,videoid)
{
    var c="c";
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=59&videoid="+escape(videoid) +"&userid="+escape(userid) +"&page="+escape(page) +"&specialId="+escape(specialId);
	as.send();
	as=null;
}
function showplay(typeid,page)
{
    var c="cc";
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=60&typeid="+escape(typeid)   +"&page="+escape(page) ;
	
	as.send();
	as=null;
}

function showMyWarReport(typeid,userid,page)
{
    var c="cc";
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
//alert(typeid);
	as.PostData ="type=61&typeid="+escape(typeid)   +"&page="+escape(page) +"&userid="+escape(userid);
	as.send();
	as=null;
}

function sendTz(friendids,playId,gameId,userid,scores)
{
document.getElementById('selectfriend').style.visibility='hidden';
document.getElementById("playId").title="0";
    var c="cc";
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=63&playId="+escape(playId)  +"&userid="+escape(userid)+"&friendids="+escape(friendids)+"&gameId="+escape(gameId)+"&scores="+escape(scores);
	as.send();
	as=null;
	
	

}
function toPage(videoid,page,  specialId   )
{
    var c="pl_cc";
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=64&videoid="+escape(videoid)  +"&page="+escape(page) +"&specialId="+escape(specialId);
	as.send();
	as=null;
}
function getStrByWeiboCls(userid,page,cls)
{
    var c="c";
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById(c);
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById(c);
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById(c);
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=65&userid="+escape(userid)  +"&page="+escape(page) +"&cls="+escape(cls);
	as.send();
	as=null;
}

function DelCollect(userid,state,orderby,page,id,stateNow)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("c");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("c");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("c");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=67&value="+escape(id)+"&userid="+escape(userid)+"&state="+escape(state)+"&orderby="+escape(orderby)+"&page="+escape(page)+"&stateNow="+escape(stateNow);
	as.send();
	as=null;
}
function DelCollectText(userid,state,page,id)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("c");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("c");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("c");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=69&value="+escape(id)+"&userid="+escape(userid)+"&state="+escape(state)+"&page="+escape(page);
	as.send();
	as=null;
}
function BestCollect(videoid,page,collectid,type)
{
	var as=new Ajax();
	//指定错误容器
	as.OnErrorOBJ 	= document.getElementById("c");
	//指定状态容器
	as.OnStateOBJ 	= document.getElementById("c");
	//指定完成容器
	as.OnDownloadEndOBJ 	= document.getElementById("c");
	as.method 	= "post";
	as.URL	= "/inc/Ajax.aspx"
	as.Sync	= true;
	as.Charset	= "utf-8";
	as.PostData ="type=68&videoid="+escape(videoid)+"&page="+escape(page)+"&collectid="+escape(collectid)+"&cls="+escape(type);
	as.send();
	as=null;
}

