<!--
var ie5 = (document.getElementById && document.all);
var ns6 = (document.getElementById && !document.all);
 
//确认对话框
/*
#用法:<a href=# onclick="return real('您真的要这样做吗?')">删除</a>
*/
function real(tMsg){
	if (confirm(tMsg))
	{
		return true;
	}
	return false;
}
 

//使输入框只能输入数字
/*
#用法:<input name="num_code" ONKEYPRESS="event.returnValue=IsNum();">
*/
function IsNum(e)
{
	return ((event.keyCode >= 48) && (event.keyCode <= 57)) || (event.keyCode == 46) || (event.keyCode == 43) || (event.keyCode == 45);
}
 

//打开新窗口
/*
#用法:nOpen('add.html',200,180,no)
*/
function nOpen(fileName, w, h, scr) 
{
	var left = (screen.availWidth - w) / 2;
	var top = (screen.availHeight - h) / 2;
	WindowStyle = 'dependent=no,scrollbars='+scr+',resizable=yes,menubar=no,toolbar=no,width='+w+',height='+h+',left=' + left + ',top=' + top;
	newWin = window.open(fileName, '', WindowStyle);
	newWin.focus();
	return false;
}
 
function upfile_box(url)
{
	return nOpen(url,320,140,0);
}
function select_box(url)
{
	return nOpen(url,520,400,0);
}
 
function checkLogin(fm)
{
	var login_username = fm.elements['user_name'].value;
	var login_pwd = fm.elements['password'].value;
	var login_verify = fm.elements['input_verify_code'].value;
	if(login_username.length < 1)
	{
		alert("请输入用户名");
		fm.elements['user_name'].focus();
		return false;
	}
	if(login_pwd.length < 1)
	{
		alert("请输入密码");
		fm.elements['password'].focus();
		return false;
	}
	if(login_verify.length < 4)
	{
		alert("请输入正确的验证码");
		fm.elements['input_verify_code'].focus();
		return false;
	}
	return true;
}

//////////////////////////////////////////////////////////
 
var d_obj = getObjId("_doScript");
 
function getObjId(obj)
{
	var element = null;
	if(document.getElementById)
	{
		element = document.getElementById(obj);
	}
	else if(document.all)
	{
		element = document.all[obj];
	}
	else if(document.layers)
	{
		element = document.layers[obj];
	} 
	return element;

} 
function doScript(s)
{
	d_obj.src = s;
}
function selectCatalog(s, v)
{
	var id = '999999999999'; 
	if(v) id = v;
	doScript(s + id) ;
}

function FillSelect(obj,text,value)
{
	obj.add(new Option(value, text));
}
function SetSelected(obj, id)
{
	obj.selectedIndex = id;
}
function ClearSelect(obj)
{
	for(var i = obj.length - 1; i >= 1; i--)
	{
		obj[i] = null;
	}
}
 
////////////////////////////////////////////////////////////
 
function out(str)
{
      for(i=0; i < str.length; ++i) {
        var obj = document.forms[i].elements[name];
        if (obj && obj.focus){obj.focus();} 
        if (obj && obj.select){obj.select();}
      }
}

/////////////////////////
 

 
function JM_fade(obj, t) {
	if(ie5){
		if (t == true) {
			if(obj.filters.alpha.opacity > 30) obj.filters.alpha.opacity -= 50;
		} else {
			if(obj.filters.alpha.opacity <  100) obj.filters.alpha.opacity += 50;
			}
	}
	else if(ns6)
	{ 
		obj.style.MozOpacity = 0.99;
		if (t == true) {
			if(obj.style.MozOpacity > 0.1) obj.style.MozOpacity = 0.50;
		} else {
			if(obj.style.MozOpacity < 1) obj.style.MozOpacity = 0.99;
			}
	}
}
 
//-->