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

function chkCheckBoxChs(objNam){
var obj = document.getElementsByName(objNam);
var objLen= obj.length;
var objYN;
var i;
objYN=false;
	for (i = 0;i< objLen;i++){
		if (obj [i].checked==true) {
			objYN= true;
		break;
		}
	}
return objYN;
}

function movietj(url,tdid){
	var ajax = new AJAXRequest();
	ajax.get("inc/movieajax.asp?"+url, tdid);
}

function addmovieurl(number,url,format,datalist)
{
var str='';
if(!document.getElementById(number).value)
document.getElementById(number).value=1;
for(i=1;i<=document.getElementById(number).value;i++)
{
if (str!="")
{
str+='\r';
}
if(document.getElementById(number).value<10)
{
str+=document.getElementById(url).value+'0'+i+''+document.getElementById(format).value;
}  
else if(document.getElementById(number).value<100)
{
	if(i<10)
	{
	str+=document.getElementById(url).value+''+'0'+i+''+document.getElementById(format).value;
	}
	else
	{
	str+=document.getElementById(url).value+''+i+''+document.getElementById(format).value;
	}
} 
else if(document.getElementById(number).value<1000)
{
	if(i<10)
	{
	str+=document.getElementById(url).value+''+'00'+i+''+document.getElementById(format).value;
 	} 
else if(i<100)
	{
	str+=document.getElementById(url).value+''+'0'+i+''+document.getElementById(format).value;
 	}
	else
	{
	str+=document.getElementById(url).value+''+i+''+document.getElementById(format).value;
	}
}
}
document.getElementById(datalist).value=''+str+'';
}

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 setday(type,movieid)
{ 
	var iWidth = document.documentElement.scrollWidth; 
	var iHeight = document.documentElement.scrollHeight; 
	var bgObj = document.createElement("div");
	bgObj.style.cssText = "position:absolute;left:0px;top:0px;width:"+iWidth+"px;height:"+Math.max(document.body.clientHeight, iHeight)+"px;filter:Alpha(Opacity=50);opacity:0.3;background-color:#ffffff;z-index:101;";
	bgObj.id="bgObj";
	document.body.appendChild(bgObj); 
	
	var divObj = document.createElement("div");
	divObj.style.cssText ="position: absolute;z-index:102;width:230px; height:20px;border:1px solid #ffbe8c;background: #fff1e7;padding:3px 0px 3px 4px;";
	divObj.id="divObj";
	document.body.appendChild(divObj);
	
	var obj = document.getElementById(type+movieid);
	var th = obj; 
	var ttop = obj.offsetTop;
    var tleft = obj.offsetLeft; 
    while (obj = obj.offsetParent){ttop+=obj.offsetTop; tleft+=obj.offsetLeft;}
    divObj.style.top = (ttop-1)+"px";
    divObj.style.left = (tleft-1)+"px"; 
	divObj.innerHTML="正在加载内容";
	
	var ajax = new AJAXRequest();
	ajax.get("inc/movieajax.asp?id="+movieid+"&show=1&action="+type, function(ajaxobj) {
	divObj.innerHTML=ajaxobj.responseText;
	});

function closeLayer() 
{
document.body.removeChild(bgObj);
document.body.removeChild(divObj);
}
}

	function ajaxsubmit(movieid,type){
	var ajaxcontent=document.getElementById("ajaxcontent").value;
	var ajax=new AJAXRequest({
	url: "inc/movieajax.asp?id="+movieid+"&show=2&ajaxcontent="+ajaxcontent+"&action="+type,
	method: "GET",
	oncomplete: oncompletecontent,
	charset: "GB2312"
	});
	ajax.get();
	}
	
	function ajaxdivdel(movieid,type){
	var ajax=new AJAXRequest({
	url: "inc/movieajax.asp?id="+movieid+"&show=3&action="+type,
	method: "GET",
	oncomplete: oncompletecontent,
	charset: "GB2312"
	});
	ajax.get();
	}

	
	function closew(){
		document.body.removeChild(document.getElementById("bgObj"));
		document.body.removeChild(document.getElementById("divObj"));
	}
	
function oncompletecontent(ajaxobj){
	if(ajaxobj.responseText){
		var fhajax = ajaxobj.responseText;
		fhajax=fhajax.split('$');
		document.getElementById(fhajax[0]).innerHTML=fhajax[1];
		closew(); 
	}
}

function vurls(){
var r_url=document.getElementById("r_url").value;
var r_select=document.getElementById("r_select").value;
if(!r_url){document.getElementById("r_urlzt").innerHTML="填写分析地址";return ;}
document.getElementById("r_urlzt").innerHTML='<img src="images/loadings.gif" width="16" height="16">分析数据中';
var ajax = new AJAXRequest();
	ajax.post("inc/vassistant.asp",r_url, function(ajaxobj) {
	if(ajaxobj.responseText=="False"){document.getElementById("r_urlzt").innerHTML="分析地址无效";return;}
	var plist=document.getElementById("playertype"+r_select);
	var datalistajax = ajaxobj.responseText.split("|");
	if(document.getElementById("url_zj").checked==true){
		document.getElementById("datalist"+r_select).value+='\r'+datalistajax[0];
	}else{
		for (i=0;i<plist.length;i++)
		{
			if(plist[i].value==datalistajax[1]){
				plist[i].selected=true;
			}
		}
		document.getElementById("datalist"+r_select).value=datalistajax[0];
	}
	document.getElementById("r_urlzt").innerHTML="";
	});
}