var Site=new Object();
Site.Cookie={
	_expires:24*3600*1000,
	_domain:'.2144.cn',
	set:function(name,value,expires,path,domain){
		expires=new Date(new Date().getTime()+(expires?expires:this._expires));
		document.cookie=name+"="+escape(value)+"; expires="+expires.toGMTString()+"; path="+(path?path:"/")+"; domain="+(domain?domain:this._domain);
	},
	get:function(name){
		var arr=document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
		if(arr!=null) return unescape(arr[2]);
		return null;
	},
	clear:function(name,path,domain){
		if(this.get(name)) document.cookie=name+"=; path="+(path?path:"/")+"; domain="+(domain?domain:this._domain)+"; expires=Fri, 02-Jan-1970 00:00:00 GMT";
	}
};
function checkLogin(obj){
	if (obj.username.value=="" || obj.password.value==""){
		alert('ΗλΚδΘλΥΚΊΕΊΝΓάΒλ');
		return false;
	}
	return true;
}
var islogin=Site.Cookie.get('user_auth');
var gy={};
(function(){
	var env={};
	gy.scriptLoad =function(url,func){
		var callback=func||function(){};
		if(env[url]){
			if(env[url]['status'] ==4){				
				callback();
			}else{
				env[url].fn.push(callback);
			}			
			return;
		}
		var script=document.createElement('script'),READY_STATE = script.readyState;
		script.setAttribute("type" ,"text/javascript");
		env[url]={fn:[],"status":1};
		env[url].fn.push(callback);
		if(READY_STATE){
			script.onreadystatechange = function () {
				var rs = script.readyState;
				if (rs === 'loaded' || rs === 'complete') {
					script.onreadystatechange = null;
					env[url].status=4;
					for(var i=0,len=env[url].fn.length;i<len;i++){
						env[url].fn.shift()();
					}
					env[url].fn=undefined;
				}
			};
		}else{
			script.addEventListener('load', function(){
				env[url].status=4;
				for(var i=0,len=env[url].fn.length;i<len;i++){
					env[url].fn.shift()();
				}
				env[url].fn=undefined;
			}, false);
		}
		script.src = url;
		document.getElementsByTagName("head")[0].appendChild(script);
	}
})();