//=======================================================
//函数名称：getObject(objectId)
//          参数objectId:控件的ID值
//函数功能：获得控件的ID值
//返 回 值：ture(获得ID值) false(获取ID失败)
//=======================================================
function getObject(objectId) {
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId);
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId);
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
}
function $(objectId){
	return getObject(objectId);
}
function isUndefined(variable) {
	return typeof variable == 'undefined' ? true : false;
}
function isNumber(object) {
return typeof object == "number"?true:false;
}
//=======================================================
//函数名称：killErrors()
//函数功能：JavaScript容错
//返 回 值：(true)
//=======================================================
function killErrors() {
	return true;
}
window.onerror = killErrors;

//=======================================================
//函数名称：logout()
//函数功能：点击链接（注销登陆）时页面变成黑白，并出现确认框
//返 回 值：ture(退出) false(取消)
//=======================================================
function logout(){
	ht = document.getElementsByTagName("body");
	ht[0].style.filter = "progid:DXimageTransform.Microsoft.Basicimage(grayscale=1)";
	if (confirm("退出这次登陆？")){
		return true;
	}
	else{
		ht[0].style.filter = "";
		return false;
	}
}

//=======================================================
//函数名称：newWin(url,width,height)
//参数url:要打开的网址
//参数width:窗口宽度
//参数height:窗口高度
//函数功能：打开净窗口
//返 回 值：(无)
//=======================================================
function newWin(url,width,height)
	{
	window.open(url,'','height='+height+', width='+width+', top=100, left=200, toolbar=no, menubar=no, scrollbars=no,resizable=no,location=no, status=no') 
	}

//=======================================================
//函数名称：winconfirm(confirmMSG,confirmURL)
//参数confirmMSG：确认提示语句
//参数confirmURL：确认后要转到的网址
//函数功能：确认后跳转
//返 回 值：(无)
//=======================================================
function winconfirm(confirmMSG,confirmURL)
{
	question = confirm(confirmMSG);
	if (question != "0")
	{
		window.location=confirmURL;
	}
}

//=======================================================
//函数名称：isemail(obj)
//参数obj：填写Email的文本框
//函数功能：验证E-MAIL格式函数
//返 回 值：true false
//=======================================================
function isemail(obj)
{
  	var s=obj.value;  
	while (s.length)
	{
        if (s.length > 100)
        {
                window.alert("email地址长度不能超过100位!");
				obj.value="";
                return false;
        }
        var regu = "^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*[0-9a-zA-Z]+))@([a-zA-Z0-9-]+[.])+([a-zA-Z]{2}|net|NET|com|COM|gov|GOV|mil|MIL|org|ORG|edu|EDU|int|INT)$"
        var re = new RegExp(regu);
        if (s.search(re) != -1) {
            return true;
        } else {
			window.alert ("请输入有效合法的E-mail地址 ！");
			obj.value="";
			obj.focus();
			return false;
         }
	}
}

function resetDefaultValue(obj){
	var v=obj.value;
	SetCookie("asdsd",v);
	obj.value="";
	obj.onblur=function(){
		if (this.value=="")
		{
			this.value=getCookie("asdsd");
		}
	}
}
function SetCookie(name,value)//两个参数，一个是cookie的名子，一个是值 
{ 
	var Days = 30; //此 cookie 将被保存 30 天 
	var exp = new Date(); //new Date("December 31, 9998"); 
	exp.setTime(exp.getTime() + Days*24*60*60*1000); 
	document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString(); 
}
function getCookie(name)//取cookies函数 
{
	var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
    if(arr != null) return unescape(arr[2]); return null;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);




//////////////------------------闪烁变色文字
//range of glowing
var from = 5;
var to = 11;
//speed of pulsing
var delay = 55;
//color of glow, name or RGB value (example:'#00ff00')
//NO MORE EDITING!!!
var i = to;
var j = 0;
//can be called here or whenever you want the text to start pulsing
function textPulseUp(textId,glowColor)
{
	var theText = document.getElementById(textId);
	if (!document.all)
		return
	if (i < to)
	{
		theText.style.filter = "Glow(Color=" + glowColor + ", Strength=" + i + ")";
		i++;
		theTimeout = setTimeout("textPulseUp('"+textId+"','"+glowColor+"')",delay);
		return 0;
	}
	if (i = to)
	{
	theTimeout = setTimeout("textPulseDown('"+textId+"','"+glowColor+"')",delay);
	return 0;
	}
}

function textPulseDown(textId,glowColor)
{
	var theText = document.getElementById(textId);
	if (!document.all)
	return
	if (i > from)
	{
		theText.style.filter = "Glow(Color=" + glowColor + ", Strength=" + i + ")";
		i--;
		theTimeout = setTimeout("textPulseDown('"+textId+"','"+glowColor+"')",delay);
		return 0;
	}
	if (i = from)
	{
		theTimeout = setTimeout("textPulseUp('"+textId+"','"+glowColor+"')",delay);
		return 0;
	}
}
//////////////------------------闪烁变色文字
