﻿function ReturnValue(flag,input)
{
	input.value = flag;
	return;
}
function SelectColor(obj1,obj2){
	var arr = showModalDialog("selcolor.html",window,"dialogWidth:280px;dialogHeight:250px;help:no;scroll:no;status:no");
	if (arr&&(arr!="#NaNNaNNaN")) {
		obj2.value=arr;
		document.all.selcolor.style.backgroundColor=arr;
		obj1.style.color=arr;
	}
}
function SetContents(obj)
{
	var oEditor = FCKeditorAPI.GetInstance('Content') ;
	oEditor.SetHTML(obj.value) ;
}
function SetProContents(obj)
{
	objarr = obj.split("|");
	for(i = 0;i<objarr.length;i++)
	{
		var oEditor = FCKeditorAPI.GetInstance(objarr[i]);
		oEditor.SetHTML(document.getElementById(objarr[i]).value) ;
	}
}
function conDel()
{
	if(confirm("确定要批量删除吗？"))
	{
		document.listitem.submit();
	}
	else
	{
		return false;
	}
}
function show(obj)
{
	obj.style.display == "none"?obj.style.display = "block":obj.style.display = "none"
}
function CheckAll(form) {
	 for (var i=0;i<form.elements.length;i++)
	 {
		 var e = form.elements[i];
		 if (e.type == "checkbox" && e.name != 'chkall' && e.name != 'chkitem')
		 {
			 e.checked = form.chkall.checked; 
			 if(e.checked)
			 {
			    form.elements[i].parentNode.parentNode.style.backgroundColor='#d9e4eb';
			 }
			 else
			 {
			    form.elements[i].parentNode.parentNode.style.backgroundColor='#f0f3f5';
			 }
            
		 }
	 }
}
//是否改变颜色
function ChangeColor(obj,isChange)
{
	var elem=obj.getElementsByTagName('input');
    for(var i = 0; i < elem.length; i ++)
    {
        if(elem[i].type=="checkbox" && elem[i].name != 'chkall')
        {
            if(!elem[i].checked)
            {
                isChange?obj.style.background = '#d9e4eb':obj.style.background = '#f0f3f5';
            }
        }
    }
}
//是否改变颜色
function ChangeCheck(obj)
{
    var elem=obj.getElementsByTagName('input');
    for(var i = 0; i < elem.length; i ++)
    {
        if(elem[i].type=="checkbox" && elem[i].name != 'chkall')
        {
            elem[i].checked?elem[i].checked = false:elem[i].checked = true;
        }
    }
}
function ChkState(form) {
	l = 0;
	z = 0;
	 for (var i=0;i<form.elements.length;i++)
	 {
		 var e = form.elements[i];
		 if (e.type == "checkbox" && e.name != "chkall")
		 {
			z++;
			if(e.checked == true)
			{
				form.Submit.disabled = false;
			}
			else
			{
				l++;
			}
		 }
	 }
	 if(z == l)
	 {
	 	form.Submit.disabled = true;
	 }
}
