function OpenWindow(Url,Width,Height,WindowObj)
{
	var ReturnStr=showModalDialog(Url,WindowObj,'dialogWidth:'+Width+'pt;dialogHeight:'+Height+'pt;status:no;help:no;scroll:no;');
	return ReturnStr;
}

function SelectSever()
{
	ReturnValue = OpenWindow('../Dialog/SelectSeverFrame.asp',400,300,window);
	if (ReturnValue.indexOf('***')!=-1)
	{
		TempArray = ReturnValue.split('***');
		document.all.SeverID.value=TempArray[0]
		document.all.SeverName.value=TempArray[1]
	}
}
function SelectClass()
{
	ReturnValue = OpenWindow('../Dialog/SelectClassFrame.asp',400,300,window);
	if (ReturnValue.indexOf('***')!=-1)
	{
		TempArray = ReturnValue.split('***');
		document.all.ClassID.value=TempArray[0]
		document.all.ClassName.value=TempArray[1]
	}
}
function SubmitMovie()
{
if (form.SeverName.value=="") { //名字为空就返回了 
alert("服务器不能为空请选择服务器") 
form.SeverName.focus();
return false; }
document.form.submit();
}

function SubmitXMovie()
{
if (form.SeverName.value=="") { 
alert("入库服务器不能为空请选择入库服务器") 
return false; }
if (form.MovieRegion.value=="") { 
alert("请选择影片出产地区") 
form.MovieRegion.focus();
return false; }
if (form.SynchronousType[1].checked)
{ 
if (form.SynchronousDate.value=="")
{
alert("请填写同步日期") 
form.SynchronousDate.focus();
return false; 
}
else
{
var byvDate = form.SynchronousDate.value
var   y   =   new   Date().getFullYear(); 
var   m   =   new   Date().getMonth()+1; 
var   d   =   new   Date().getDate()-1; 
var   today=y+'-'+m+'-'+d; 
var   d1   =   new   Date(today.replace("-",   "/"));       //主要是这句话起作用 
var   d2   =   new   Date(byvDate.replace("-",   "/"));     
if   (   d1     <   d2) 
{alert('选择日期必须小于今天!'); 
return  false; 
}

}
}
document.form.submit();
}

function showcheckbox(cname,dname)
{
if(document.getElementById(cname).checked==true)
{
showThumbnail_RateOrSize(1,dname)
}
else
{
showThumbnail_RateOrSize(0,dname)
}
}
function showThumbnail_RateOrSize(param,pname)
{
	if(param==1)
	{
		document.getElementById(pname).style.display="block"
	}else
	{
		document.getElementById(pname).style.display="none"
	}
}

function CheckAll(v)
	{
		var i;
		for (i=0;i<document.forms.elements.length;i++)
		{
			var e = document.forms.elements[i];
		        e.checked = v;
		}
}

function SelectFeature()
{
	ReturnValue = OpenWindow('../Dialog/SelectFeatureFrame.asp',400,300,window);
	if (ReturnValue.indexOf('***')!=-1)
	{
		TempArray = ReturnValue.split('***');
		document.all.FeatureID.value=TempArray[0]
		document.all.FeatureName.value=TempArray[1]
	}
}