function ge(id){return document.getElementById(id);}
function taketopwindow(){
	var s = self.location.toString();
	if(s.indexOf('login_flash.html')==-1&&s.indexOf('login_foot.html')==-1){
		if(self.location!=top.location){
			top.location = self.location;
		}
	}
}
taketopwindow();
function IsMaxthon()
{
    try{
        window.external.max_invoke("GetHotKey");
        return true;
    }catch(ex){
        return false;
    }
}
function getMHversion(){
		var isMaxthon1 ='';
		try{
			if(external.max_version.indexOf("1.")==0){
					 isMaxthon1 = 1;
			}else{
					 isMaxthon1 = 0;
			}
		}catch(e){
				 isMaxthon1 = 0;
		}
		return isMaxthon1;
}
function isFF(){
	return window.navigator.userAgent.indexOf("Firefox")>=1;
}
function isIe(){
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	var version=b_version.split(";"); 
	var trim_Version=version[1].replace(/[ ]/g,""); 
	if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE7.0") {return 7;} 
	else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE6.0"){return 6;}
	else{return true;}
}
var pic = {
		mclick:function(num){
			pic.auto = false;
			pic.p(num);
		},
		mclear:function(){
			pic.auto = true;
		},
		p:function(num){
			if(pic.runing||pic.last == num){
				return;	
			}
			pic.runing = true;
			ge('list'+pic.last).style.backgroundColor = '#ffffff';
			ge('banner'+num).style.opacity = 0;
			ge('banner'+num).style.filter = 'alpha(opacity=0)';
			ge('banner'+num).parentNode.appendChild(ge('banner'+num));
			pic.pbanner(num);
		},
		pbanner:function(num){
			if(pic.pos==11){
				pic.pos = 0;
				pic.last = num;
				pic.runing = false;
				if(pic.brun){
					pic.brun = false;
					pic.p(pic.bid);
				}
				return;
			}
			pic.pos++;
			ge('banner'+num).style.opacity = pic.pos/10;
			ge('banner'+num).style.filter = 'alpha(opacity='+ pic.pos*10 +')';
			ge('list'+num).style.backgroundColor = '#8cacc7';
			ge('list'+num).style.opacity = pic.pos/10;
			ge('list'+num).style.filter = 'alpha(opacity='+ pic.pos*10 +')';
			setTimeout("pic.pbanner("+num+")",50);
		},
		init:function(){
			var s = ge('picbanner').getElementsByTagName('img');
			pic.length = s.length;
			var dom = document.createElement('div');
			dom.id = 'piclist';
			ge('picbanner').parentNode.appendChild(dom);
			for(var i=0; i<s.length; i++){
				dom.innerHTML += '<div id="list'+(i+1)+'"></div>';
			}
			var dom2 = document.createElement('div');
			dom2.id = 'picimg';
			ge('picbanner').parentNode.appendChild(dom2);
			for(var i=0; i<s.length; i++){
				dom2.innerHTML += '<div><img onmouseout="pic.mclear()" onmousemove="pic.mclick('+(i+1)+')" src="'+s[i].src+'" alt="" /></div>';
			}
			pic.autoplay();
		},
		autoplay:function(){
			if(pic.length==0){
				return;	
			}
			if(pic.auto){
				var n = pic.last;
				n++;
				if(n>pic.length){
					n = 1;	
				}
				pic.p(n);
			}
			setTimeout("pic.autoplay()",5000);
		},
		length:0,
		auto:true,
		pos:0,
		brun:false,
		bid:1,
		last:1,
		runing:false
};
var playThe = {};
playThe.o = false;
playThe.id = '';
playThe.tatol  = 320;
playThe.index  = 0;
playThe.maxlen  = 950;
playThe.hz  = 20;
playThe.ht  = 10;
playThe.ty  = true;
playThe.funname  = "playThe";
playThe.p = function(num){
	if(this.runing)return;
	this.runing = true;
	if(num==1){
		this.next();
	}else{
		this.pre();
	}
};
playThe.runing = false;
playThe.nextfun = function(){
		return;
	};
playThe.next = function(){
	var bool = false;
	if(this.ty){
		if(this.index>=this.tatol||ge(this.id).scrollLeft>=this.maxlen||ge(this.id).scrollLeft+this.tatol >this.maxlen){
			bool = true;	
		}
	}else{
		if(this.index>=this.tatol||ge(this.id).scrollTop>=this.maxlen||ge(this.id).scrollTop+this.tatol >this.maxlen){
			bool = true;	
		}	
	}
	if(bool){
			this.o = true;
			this.runing = false;
			this.index = 0;
			this.nextfun();
			return;
	}
	if(this.ty){
		ge(this.id).scrollLeft += this.hz;
	}else{
		ge(this.id).scrollTop += this.hz;
	}
	this.index += this.hz;
	var kf = this;
	setTimeout(kf.funname+".next()",this.ht);
};
playThe.pre = function(){
	var bool = false;
	if(this.ty){
		if(this.index>=this.tatol||ge(this.id).scrollLeft==0){
			bool = true;	
		}
	}else{
		if(this.index>=this.tatol||ge(this.id).scrollTop==0){
			bool = true;	
		}	
	}
	if(bool){
			this.o = false;
			this.runing = false;
			this.index = 0;
			this.nextfun();
			return;
	}
	if(this.ty){
		ge(this.id).scrollLeft -= this.hz;
	}else{
		ge(this.id).scrollTop -= this.hz;	
	}
	this.index += this.hz;
	var kf = this;
	setTimeout(kf.funname+".pre()",this.ht);
};
var p_time1;
var p_thme2;
var playUL = {};
playUL.runing = false;
playUL.id = '';
playUL.hz = 10;
playUL.ht = 30;
playUL.timeout = 3000;
playUL.maxlen = 210;
playUL.tatol = 0;
playUL.ty = true;
playUL.autoplay = true;
playUL.funname = 'playUL';
playUL.auto = function(id,bool){
		this.id = id;
		this.ty = bool;
		if(this.autoplay){
			p_time1 = setTimeout(this.funname+".pt()",this.timeout);
		}
		return;
}
playUL.listtype = 'ul';
playUL.pt = function(){
	clearTimeout(p_time1);
	if(!this.autoplay)return;
	this.runing = true;
	if(this.tatol>=this.maxlen){
			if(this.ty){
				ge(this.id).scrollTop -= this.tatol;
			}else{
				ge(this.id).scrollLeft -= this.tatol;	
			}
			var ulnode = ge(this.id).getElementsByTagName(this.listtype)[0];
			ge(this.id).appendChild(ulnode);
			this.tatol = 0;
			this.runing = false;
			var ids = this.id;
			var tys = this.ty;
			this.auto(ids,tys);
			return;
	}
	this.tatol += this.hz;
	if(this.ty){
		ge(this.id).scrollTop += this.hz;
	}else{
		ge(this.id).scrollLeft += this.hz;
	}
	var pts = this;
	setTimeout(this.funname+".pt()",this.ht);
	return;
};
playUL.pl = function(){
	
};
var mydpic={};
mydpic.init = function(initer){
	if(typeof ge('mydpicbox')=='undefined'||ge('mydpicbox')==null){
		this.crebox();	
	}
	if(typeof ge('crebgbox')=='undefined'||ge('crebgbox')==null){
		this.crebgbox();
	}
	this.openwins(initer);
	return true;	
};
mydpic.geturl = function(s){
	return s.substring(0,s.lastIndexOf('.'))+'.jpg';
};
mydpic.openwins = function(initer){
	var url = initer.url;
	url = this.geturl(url);
	var left = this.getLeft()-initer.width/2;
	var top = 550-initer.height/2;
	ge('mydpicbox').style.border = '1px solid #eeeeee';
	ge('mydpicbox').style.width = initer.width+'px';
	ge('mydpicbox').style.height = initer.height+'px';
	ge('mydpicbox').style.left = left+'px';
	ge('mydpicbox').style.top = top+'px';
	ge('mydpicbox').innerHTML = '<img src="../images/close.gif" border="0" alt="" title="" style="position:absolute; right:5px; top:5px; cursor:pointer;" onclick="'+this.funname+'.coloses()" /><img src="'+url+'" alt="" title="" onclick="'+this.funname+'.coloses()" />';
	ge('crebgbox').style.display = 'block';
	ge('mydpicbox').style.opacity = 0;
	ge('mydpicbox').style.filter = 'alpha(opacity=0)';
	ge('mydpicbox').style.display = 'block';
	this.getAll();
};
mydpic.pos = 0;
mydpic.funname = 'mydpic';
mydpic.getAll = function(){
	this.pos++;
	if(this.pos==11){
		this.pos = 0;
		return;
	}
	ge('mydpicbox').style.opacity = this.pos/10;
	ge('mydpicbox').style.filter = 'alpha(opacity='+ this.pos*10 +')';
	setTimeout(this.funname+".getAll()",50);
};
mydpic.crebox = function(){
	var dom = document.createElement('div');
	dom.id = 'mydpicbox';
	document.body.appendChild(dom);
	dom.style.textAlign = 'center';
	dom.style.position = 'absolute';
	dom.style.left = '0';
	dom.style.width = '960px';
	dom.style.top = '0';
	dom.style.opacity = 0;
	dom.style.zIndex = 6000;
	dom.style.filter = 'alpha(opacity='+ 0 +')';
};
mydpic.getLeft = function(){
	return window.screen.width/2;
};
mydpic.crebgbox = function(){
	var dom = document.createElement('div');
	dom.id = 'crebgbox';
	document.body.appendChild(dom);
	dom.style.backgroundColor = '#000000';
	dom.style.display = 'none';
	dom.style.position = 'absolute';
	dom.style.left = '0px';
	dom.style.top = '0px';
	dom.style.width = '100%';
	dom.style.height ='1124px'; /*(window.screen.height+114)+'px';*/
	dom.style.opacity = 0.4;
	dom.style.filter = 'alpha(opacity='+ 40 +')';
	dom.style.zIndex = 5001;
	var $s = this;
	dom.onclick = function(){
		$s.coloses();
	};
};
mydpic.coloses = function(){
	ge('mydpicbox').style.display = 'none';
	ge('crebgbox').style.display = 'none';
};
function getx(){
	return 'xml';
}
function extend(pobj){
	var obj={};
	for(var k in pobj){
		obj[k] = pobj[k];
		if(typeof obj[k] == 'object'){
			obj[k] = extend(pobj[k]);
		}
	}
	return obj;
}
function Ajax(url,method,post){
	var time = new Date().getTime();
	if(url.indexOf('?')==-1){
		url = url+'?t='+time;
	}else{
		url = url+'&t='+time;
	}
	this.url = url;
	this.method = method;
	this.post = post;
	this.xmlHttp;
	if(window.ActiveXObject){
		this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	else if(window.XMLHttpRequest){
		this.xmlHttp=new XMLHttpRequest();
	}
	var $A = this;
	this.rsaction = function(){};
	this.notfound = function(){};
	this.webError = function(){};
	this.error = function(){};
	this.loading = function(){
		/*--document.body.innerHTML +='fuck GB2312!';--*/
	};
	this.stop = function(){};
}
Ajax.prototype.createLoad = function(){};
Ajax.prototype.start = function (){
	var XmlHttp = this.xmlHttp;
	var $A = this;
	$A.loading();
	if(this.method=="post"){
		XmlHttp.open("POST",this.url,true);
		XmlHttp.setRequestHeader("content-length",this.post.length);
		XmlHttp.setRequestHeader("content-type","application/x-www-form-urlencoded"); 
		XmlHttp.setRequestHeader("Cache-Control","no-cache");
		XmlHttp.send(this.post);
	}
	else{
		XmlHttp.open("GET",this.url,true);
		XmlHttp.setRequestHeader("Cache-Control","no-cache");
		XmlHttp.setRequestHeader("Content-Type","text/html; charset=UTF-8");
		XmlHttp.send(null);
	}
	XmlHttp.onreadystatechange = function(){
		//handleStateChange
		if(XmlHttp.readyState==4){
			$A.stop();
			if(XmlHttp.status==200){
				$A.rsaction(XmlHttp);
			}
			else if(XmlHttp.status==404){
				$A.notfound();
			}
			else if(XmlHttp.status==500){
				$A.webError();
			}
			else{
				$A.error();
			}
		}
	};
};
function readyload(func){ 
   if(!window.__load_events){ 
      var init = function (){ 
          if (arguments.callee.done) return; 
          arguments.callee.done = true; 
          if (window.__load_timer) { 
              clearInterval(window.__load_timer); 
              window.__load_timer = null; 
          } 
          for (var i=0;i < window.__load_events.length;i++) { 
              window.__load_events[i](); 
          } 
          window.__load_events = null; 
      }; 
   
      if (document.addEventListener) { 
          document.addEventListener("DOMContentLoaded", init, false); 
      }
      /*@if (@_win32) 
		  document.write("<scr"+"ipt id=__ie_onload defer src=//0><\/scr"+"ipt>"); 
          var script = document.getElementById("__ie_onload"); 
          script.onreadystatechange = function() { 
              if (this.readyState == "complete") { 
                  init(); // call the onload handler 
              } 
          }; 
      /*@end @*/ 
	if(window.attachEvent){
		document.write("<scr"+"ipt id=__ie_onload defer src=//0><\/scr"+"ipt>"); 
          var script = document.getElementById("__ie_onload"); 
          script.onreadystatechange = function() { 
              if (this.readyState == "complete") { 
                  init(); // call the onload handler 
              } 
          }; 
	  }
      if (/WebKit/i.test(navigator.userAgent)) { 
          window.__load_timer = setInterval(function() { 
              if (/loaded|complete/.test(document.readyState)) { 
                  init();
              } 
          }, 10); 
      } 
      window.onload = init; 
      window.__load_events = []; 
   }
   window.__load_events.push(func); 
}

