/*************************************/
function in_CheckFrmLogin(){
	var cookieEnabled=(navigator.cookieEnabled)? true : false
	if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled)
	{ 
		document.cookie="testcookie";
		cookieEnabled=(document.cookie=="testcookie")? true : false
		document.cookie="";
	};
	
	if (!cookieEnabled){
		alert('您的浏览器不能使用cookie,或者您禁止了cookie.\n\n本系统必须使用cookie技术,要使用本系统,请打开cookie!!')
		return false;
	};
	
	var oThe = document.In_frmLogin;
	oThe.isJavascript.value='ok';
	
	if (oThe.txtUserName.value==''){
		alert('请输入登陆帐号！');
		oThe.txtUserName.focus();
		return false;
	};
	
	if (oThe.txtUserPass.value==''){
		alert('请输入登陆密码！');
		oThe.txtUserPass.focus();
		return false;
	};
	
	if (oThe.txtUserCode.value.length!=4){
		alert('请输入验证码！');
		oThe.txtUserCode.focus();
		return false;
	};
};

function in_ShowLoginCode(){
	if (document.getElementById("in_LoginCode")){
		var oThe = document.getElementById("in_LoginCode");
		if(oThe.innerHTML==''){
			oThe.innerHTML = '<img src="/inc/GetVerifyImage.aspx?a=' + Math.random() + '" align="middle" class="verifycode" onClick="RefreshImgCode(this);" title="如果您无法识别验证码，请点击更换图片。">';
		};
	};
};

function RefreshImgCode(oThe){oThe.src = "/inc/GetVerifyImage.aspx?a=" + Math.random();};

/*************************************/
function GetNowTime()
{
	var now = new Date();
	var yy = (now.getFullYear());
	var mm = (now.getMonth()+1);
	var dd = (now.getDate());
 	var weekday=' 星期'+'日一二三四五六'.charAt(now.getDay());
	var str = yy+'年'+mm+'月'+dd+'日 '+weekday;
	document.write(str);
}; 
/*************************************
// Author    : July
// Date      : 2009-08-25
// Notes     : Marquee Left
*************************************/
function Show_Marquee_Left(key)
{
	if(!document.getElementById(key + "_m0")){return;};

	var oThe0 = document.getElementById(key + "_m0");
	var oThe1 = document.getElementById(key + "_m1");
	if(oThe1.innerHTML.length<50){return;};
	
	var speed = 100;
	var oWW = oThe1.offsetWidth;
	if(oWW>oThe0.offsetWidth){
		oThe1.innerHTML = (oThe1.innerHTML + oThe1.innerHTML);
		
		var MyMar=setInterval("Marquee_Left('"+key+"',"+oWW+")",speed);
		oThe0.onmouseover=function() {clearInterval(MyMar)};
		oThe0.onmouseout=function() {MyMar=setInterval("Marquee_Left('"+key+"',"+oWW+")",speed)};
	};
};

function Marquee_Left(key,oWW)
{
	var oThe0 = document.getElementById(key + "_m0");
	
	if(oWW<=oThe0.scrollLeft){oThe0.scrollLeft-=oWW;}
	else{oThe0.scrollLeft++;};
};


/*************************************
// Author    : July
// Date      : 2009-05-04
// Notes     : Ag3 Ver: Mini
// jAgFun.Write_AgHtml('ag_A1','xxx.jpg','http://xxx',980,80);
*************************************/
var jAgFun={
	$:function(v){return document.getElementById(v)},
	
	Get_FileHtml:function(src,url,width,height){
		var ss ='',ww='',hh='';
		if(width>0){ww='width="'+width+'"';};
		if(height>0){hh='height="'+height+'"';};
		
	    if(src.match(/\.(jpg|gif|png|jpeg|bmp)?$/i)){
			if( url=="" || url=="#"){return '<img border="0" src="'+src+'" '+ww+' '+hh+' />';}else{return '<a href="'+url+'" target="_blank"><img border="0" src="'+src+'" '+ww+' '+hh+'/></a>';};
			
		}else if(src.match(/\.(swf)?$/i)){
			ss+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '+ww+' '+hh+'>';
			ss+='<param name="movie" value="'+src+'" /><param name="quality" value="high" />';
			ss+='<param name="wmode" value="transparent"><param name="allowscriptaccess" value="always" />';
			ss+='<embed src="'+src+'" quality="high" type="application/x-shockwave-flash" '+ww+' '+hh+' wmode="transparent" allowscriptaccess="always" type="application/x-shockwave-flash"></embed>';
			ss+='</object>';
			return ss;
		}else{
			if( url=="" || url=="#"){return src;}else{return '<a href="'+url+'" target="_blank">'+src+'</a>';};
		};
	},
	
	Write_AgHtml:function(AgID,ImgUrl,OpenUrl,ImgWidth,ImgHeight){
		if(this.$(AgID)){
			this.$(AgID).innerHTML = this.Get_FileHtml(ImgUrl,OpenUrl,ImgWidth,ImgHeight);
		};
	}
};


