function checkEx(obj)
{		
	var allow_ext = new Array("avi","mpg","mpeg","wmv","asf","flv","mov","mp4","3gp","rm","rmvb");		
	if ((in_array(allow_ext, get_extname(obj.value)))>-1)
	{	
		document.form_up_movie.Submit.disabled = false;
		return true;
	}
	else
	{	
		alert(get_extname(obj.value)+" 不支持的格式，请重新选择！");
		document.form_up_movie.Submit.disabled = true;
		document.form_up_movie.reset();
		return false;
	}
}

function checkPicEx(obj)
{		
	var allow_ext = new Array("jpg","jpeg","gif");		
	if ((in_array(allow_ext, get_extname(obj.value)))>-1)
	{	
		document.modifyinfoForm.Submit.disabled = false;
		return true;
	}
	else
	{	
		alert(get_extname(obj.value)+" 不支持的格式，请重新选择！");
		document.modifyinfoForm.Submit.disabled = true;
		document.modifyinfoForm.reset();
		return false;
	}
}

function get_extname(s)
{
	var s = new String(s)
	s = s.toLowerCase();
	if ((s.lastIndexOf(".")>-1) &&((s.length-1)>s.lastIndexOf("."))) 
	{		
		return s.substring(s.lastIndexOf(".")+1);
	}
	else
	{
		return false;
	}	
}

function in_array(a, s)
{
	var s = new String(s);
	s = s.toLowerCase();
	var a = new String(a);	
	a = a.toLowerCase();
	return (","+a+",").indexOf(","+s+",");
}

function check()
{
	alert('用到check函数了');
	
	if(form_up_movie.Subject.value.length == 0)
	{
		alert("视频名称不能为空！!");
		form_up_movie.Subject.focus();
		return false;
	}
	//document.getElementById("a1").style.display = "none";
	//document.getElementById("a2").style.display = "block";
        document.all["but_upload_id"].disabled="disabled";
	var up = document.getElementById("flash_uploader");
	var upload_url = "v_upload_save.asp";
	up.SetVariable("upload_to", upload_url);
	
    return false;
	
}

function checkpic()
{
	if(modifyinfoForm.password.value != modifyinfoForm.surepassword.value)
    {
        alert("两次密码不符，请重新输入！");
	    modifyinfoForm.password.focus();
	    return false;
    }
    if(modifyinfoForm.email.value.indexOf("@") == -1)
    {
        alert("请输入正确的Email地址！");
	    modifyinfoForm.email.focus();
	    return false;
    }
    if(modifyinfoForm.nickname.value.length == 0)
    {
        alert("昵称不能为空！");
	    modifyinfoForm.nickname.focus();
	    return false;
    }
	if(uploadpic.userpic.value.length != 0)
	{
	    document.uploadpic.submit();
	    return false;
	}
}
function checkphoto()
{
	if(uploadphoto1.topic.value.length == 0)
    {
        alert("标题不能为空,请写相片标题！");
	    uploadphoto1.topic.focus();
	    return false;
    }
	if(uploadphoto.photosel.value.length != 0)
	{
	    document.uploadphoto.submit();
	    return false;
	}
}

function checkphotos()
{
	if(modifyinfoForm.topic.value.length == 0)
    {
        alert("标题不能为空,请写相片标题！");
	    modifyinfoForm.topic.focus();
	    return false;
    }
	if(uploadphoto.photosel.value.length != 0)
	{
	    document.uploadphoto.submit();
	    return false;
	}
}

function upload_complete()
{
	document.form_up_movie.submit();
}