<!--
//modify by junru
var LANGS = new Array();
LANGS['gb'] = new Array();
LANGS['gb'][0]="Android";
LANGS['gb'][1]="iOS";
LANGS['gb'][2]="&#21453;&#30149;&#27602;";
LANGS['gb'][3]="&#21453;&#22403;&#22334;";
LANGS['gb'][4]="&#21319;&#32423;&#26085;&#24535";
LANGS['gb'][5]="&#27426;&#36814;&#20351;&#29992;";
LANGS['gb'][6]="&#37038;&#31665;&#21517;";
LANGS['gb'][7]="&#23494;&#12288;&#30721;";
LANGS['gb'][8]="&#35821;&#12288;&#35328;";
LANGS['gb'][9]="&#x624B;&#x673A;&#x90AE;&#x7BB1;";
LANGS['gb']['check']="&#x8BB0;&#x4F4F;&#x6211;&#x7684;&#x5BC6;&#x7801;";
LANGS['gb']['forgotpwd']='请联系邮箱管理员索要密码!';

//LANGS['gb']['Code']="&#x9A8C;&#x8BC1;&#x7801;";
LANGS['gb']['Note']="&#x529F;&#x80FD;&#x63D0;&#x793A;";
LANGS['gb']['Note3']="&#x5728;&#x624B;&#x673A;&#x6D4F;&#x89C8;&#x5668;&#x8F93;&#x5165;";
LANGS['gb']['Note4']="&nbsp;&nbsp;&#x5373;&#x53EF;&#x767B;&#x5F55;&#x624B;&#x673A;&#x90AE;&#x7BB1;";
LANGS['gb']['Login']="&#30331;&#12288;&#24405;";
LANGS['gb']['InputMess']="&#35831;&#36755;&#20837;";
LANGS['gb']['FORGET']="&#24536;&#35760;&#23494;&#30721;&#65311;";
LANGS['gb']['FORGET_NOTE']="&#24536;&#35760;&#23494;&#30721;&#35831;&#32852;&#31995;&#37038;&#23616;&#31649;&#29702;&#21592;&#37325;&#26032;&#20462;&#25913;&#12290;";
LANGS['big'] = new Array();
LANGS['big'][0]="Android";
LANGS['big'][1]="iOS";
LANGS['big'][2]="&#21453;&#30149;&#27602;";
LANGS['big'][3]="&#21453;&#22403;&#22334;";
LANGS['big'][4]="&#21319;&#32026;&#26085;&#24535";
LANGS['big'][5]="&#27489;&#36814;&#20351;&#29992;";
LANGS['big'][6]="&#37109;&#31665;&#21517;";
LANGS['big'][7]="&#23494;&#12288;&#30908;";
LANGS['big'][8]="&#35486;&#12288;&#35328;";
LANGS['big'][9]="&#x624B;&#x6A5F;&#x90F5;&#x7BB1;";
LANGS['big']['check']="&#35352;&#20303;&#25105;&#30340;&#23494;&#30908;"
LANGS['big']['forgotpwd']="請聯係郵箱琯理員索要密碼!";
//LANGS['big']['Code']="&#x9A57;&#x8B49;&#x78BC;";
LANGS['big']['Note']="&#x529F;&#x80FD;&#x63D0;&#x793A;";
LANGS['big']['Note3']="&#x5728;&#x624B;&#x6A5F;&#x700F;&#x89BD;&#x5668;&#x8F38;&#x5165;";
LANGS['big']['Note4']="&#x5373;&#x53EF;&#x767B;&#x9304;&#x624B;&#x6A5F;&#x90F5;&#x7BB1;";
LANGS['big']['Login']="&#30331;&#12288;&#37636;";
LANGS['big']['InputMess']="&#35531;&#36664;&#20837;";
LANGS['big']['FORGET']="&#24536;&#35352;&#23494;&#30908;&#65311;";
LANGS['big']['FORGET_NOTE']="&#24536;&#35352;&#23494;&#30908;&#35531;&#32879;&#31995;&#37109;&#23616;&#31649;&#29702;&#21729;&#37325;&#26032;&#20462;&#25913;&#12290;";
LANGS['en'] = new Array();

LANGS['en'][0]="Android";
LANGS['en'][1]="iOS";
LANGS['en'][2]="Anti-Virus";
LANGS['en'][3]="Anti-Spam";
LANGS['en'][4]="Update-Log";
LANGS['en'][5]="Welcome to";
LANGS['en'][6]="E-Mail";
LANGS['en'][7]="Password";
LANGS['en'][8]="Language";
LANGS['en'][9]="Mobile-Email";
//LANGS['en']['Code']="Code";
LANGS['en']['Note']="Notice";
LANGS['en']['Note3']="You can log in by inputting ";
LANGS['en']['Note4']="&nbsp;in the cell phone browser";
LANGS['en']['Login']="- Log In -";
LANGS['en']['InputMess']="Please input";
LANGS['en']['FORGET']="Forget password?";
LANGS['en']['FORGET_NOTE']="If forget password, please contact to administrator.";
LANGS['en']['check']="Remember my password";
LANGS['en']['forgotpwd']="Please contact the mail administrator to ask for the password!";
function Login(form){
	var language = form.Lang.value;
	if(language=="default") language="gb";
	var mesg = "";
	if(form.name.value == "") mesg += Unicode2oStr(LANGS[language][6])+",";
	if(form.passwd.value == "") mesg += Unicode2oStr(LANGS[language][7])+"\n";
	if(mesg != ""){
		var AlertInput = Unicode2oStr(LANGS[language]['InputMess'])+":";	
		mesg = AlertInput + mesg;
		alert(mesg);
		return false;
	}
	if (form.language.value !="-") form.Lang.value = form.language.value;
	form.action += "?Cmd=login";
	return true;
}
var forgetnote = null;
function SelectLang(form){
	var language = form.language.value;
	if(language=="default") language="gb";
	if(language == "-") return false;
	form.Lang.value = language;
	var langspan =document.getElementsByName("LangSpan"); //eval("document.all.LangSpan");
	for(var i=0; i<langspan.length; i++){
		langspan[i].innerHTML = LANGS[language][i];
	}
	//langcode = document.getElementById("LangCode");
	//if(langcode!=null)	langcode.innerHTML = LANGS[language]['Code'];
	document.getElementById("FORGET").innerHTML = LANGS[language]['FORGET'];
	document.getElementById("forgotpwd").href= "javascript:alert('"+LANGS[language]['forgotpwd']+"');"
	forgetnote = Unicode2oStr(LANGS[language]['FORGET_NOTE']);
	//langnote = document.getElementById("LangNote");
	//langnote.innerHTML = LANGS[language]['Note'];
	langnote3 = document.getElementById("LangNote3");
	langnote3.innerHTML = LANGS[language]['Note3'];
	langnote4 = document.getElementById("LangNote4");
	langnote4.innerHTML = LANGS[language]['Note4'];
	document.getElementById("check").innerHTML=LANGS[language]['check'];
	var Company = document.getElementsByName("Company");//eval("document.all.Company");
	if(Company && Company.length){
		for(var i=0; i<Company.length; i++){
			Company[i].innerHTML = LANGS[language]['Company'];
		}
	}
	else if(Company) Company.innerHTML = LANGS[language]['Company'];
	if(language!="en") form.login.value = Unicode2oStr(LANGS[language]['Login']);
	else form.login.value = LANGS[language]['Login'];
	//document.all.LangSpan.innerHTML = LANGS[language][0];
	//form.action = "login.php?Lang=" + language;
	//form.submit();
}
function Unicode2oStr(str){
	var re=/&#[\da-fA-F]{1,5};/ig;
	var arr=str.match(re);
	if(arr==null)return str;
	for(var i=0;i<arr.length;i++){
		arr[i]=String.fromCharCode(arr[i].replace(/[&#;]/g,""));
	}
	return(arr.toString().replace(/,/g,""))
}
window.onload=function(){
	var lang = document.getElementById("Lang").value;
	var language = document.getElementById("language");
	//alert(language.length);
	for(var i=0; i<language.length; i++){
		if(language[i].value == lang) {
			language[i].selected = "true"; break;
		}
	}
	SelectLang(document.getElementById("LoginForm"));
}

var color='rgb(200,200,200)';
var i
function change(i){
	var a=Math.random()*255;
	var b=Math.random()*255;
	var c=Math.random()*255;
	color="rgb("+a+","+b+","+c+")";
	var source=event.srcElement;
	try{
		if (source.tagName=="IMG")source.style.border="1px solid "+i+"";
	}catch(e){}
}


var DD_belatedPNG = {

	ns: 'DD_belatedPNG',
	imgSize: {},
	
	createVmlNameSpace: function() {
		if (document.namespaces && !document.namespaces[this.ns]) {
		  document.namespaces.add(this.ns, 'urn:schemas-microsoft-com:vml');
		}
		if (window.attachEvent) {
			window.attachEvent('onbeforeunload', function() {
				DD_belatedPNG = null;
			});
		}
	},
	
	createVmlStyleSheet: function() {
		var style = document.createElement('style');
		document.documentElement.firstChild.insertBefore(style, document.documentElement.firstChild.firstChild);
		var styleSheet = style.styleSheet;
		styleSheet.addRule(this.ns + '\\:*', '{behavior:url(#default#VML)}');
		styleSheet.addRule(this.ns + '\\:shape', 'position:absolute;');
		styleSheet.addRule('img.' + this.ns + '_sizeFinder', 'behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;');
		this.styleSheet = styleSheet;
	},
	
	readPropertyChange: function() {
		var el = event.srcElement;
		if (event.propertyName.search('background') != -1 || event.propertyName.search('border') != -1) {
			DD_belatedPNG.applyVML(el);
		}
		if (event.propertyName == 'style.display') {
			var display = (el.currentStyle.display == 'none') ? 'none' : 'block';
			for (var v in el.vml) {
				el.vml[v].shape.style.display = display;
			}
		}
		if (event.propertyName.search('filter') != -1) {
			DD_belatedPNG.vmlOpacity(el);
		}
	},
	
	vmlOpacity: function(el) {
		if (el.currentStyle.filter.search('lpha') != -1) {
			var trans = el.currentStyle.filter;
			trans = parseInt(trans.substring(trans.lastIndexOf('=')+1, trans.lastIndexOf(')')), 10)/100;
			el.vml.color.shape.style.filter = el.currentStyle.filter;
			el.vml.image.fill.opacity = trans;
		}
	},
	
	handlePseudoHover: function(el) {
		setTimeout(function() { 
			DD_belatedPNG.applyVML(el);
		}, 1);
	},
	
	fix: function(selector) {
		var selectors = selector.split(',');
		for (var i=0; i<selectors.length; i++) {
			this.styleSheet.addRule(selectors[i], 'behavior:expression(DD_belatedPNG.fixPng(this))');
		}
	},
	
	applyVML: function(el) {
		el.runtimeStyle.cssText = '';
		this.vmlFill(el);
		this.vmlOffsets(el);
		this.vmlOpacity(el);
		if (el.isImg) {
			this.copyImageBorders(el);
		}
	},
	
	attachHandlers: function(el) {
		var self = this;
		var handlers = {resize: 'vmlOffsets', move: 'vmlOffsets'};
		if (el.nodeName == 'A') {
			var moreForAs = {mouseleave: 'handlePseudoHover', mouseenter: 'handlePseudoHover', focus: 'handlePseudoHover', blur: 'handlePseudoHover'};
			for (var a in moreForAs) {
				handlers[a] = moreForAs[a];
			}
		}
		for (var h in handlers) {
			el.attachEvent('on' + h, function() {
				self[handlers[h]](el);
			});
		}
		el.attachEvent('onpropertychange', this.readPropertyChange);
	},
	
	giveLayout: function(el) {
		el.style.zoom = 1;
		if (el.currentStyle.position == 'static') {
			el.style.position = 'relative';
		}
	},
	
	copyImageBorders: function(el) {
		var styles = {'borderStyle':true, 'borderWidth':true, 'borderColor':true};
		for (var s in styles) {
			el.vml.color.shape.style[s] = el.currentStyle[s];
		}
	},
	
	vmlFill: function(el) {
		if (!el.currentStyle) {
			return;
		} else {
			var elStyle = el.currentStyle;
		}
		for (var v in el.vml) {
			el.vml[v].shape.style.zIndex = elStyle.zIndex;
		}
		el.runtimeStyle.backgroundColor = '';
		el.runtimeStyle.backgroundImage = '';
		var noColor = (elStyle.backgroundColor == 'transparent');
		var noImg = true;
		if (elStyle.backgroundImage != 'none' || el.isImg) {
			if (!el.isImg) {
				el.vmlBg = elStyle.backgroundImage;
				el.vmlBg = el.vmlBg.substr(5, el.vmlBg.lastIndexOf('")')-5);
			}
			else {
				el.vmlBg = el.src;
			}
			var lib = this;
			if (!lib.imgSize[el.vmlBg]) {
				var img = document.createElement('img');
				lib.imgSize[el.vmlBg] = img;
				img.className = lib.ns + '_sizeFinder';
				img.runtimeStyle.cssText = 'behavior:none; position:absolute; left:-10000px; top:-10000px; border:none;'; 
				img.attachEvent('onload', function() {
					this.width = this.offsetWidth;
					this.height = this.offsetHeight;
					lib.vmlOffsets(el);
				});
				img.src = el.vmlBg;
				img.removeAttribute('width');
				img.removeAttribute('height');
				document.body.insertBefore(img, document.body.firstChild);
			}
			el.vml.image.fill.src = el.vmlBg;
			noImg = false;
		}
		el.vml.image.fill.on = !noImg;
		el.vml.image.fill.color = 'none';
		el.vml.color.shape.style.backgroundColor = elStyle.backgroundColor;
		el.runtimeStyle.backgroundImage = 'none';
		el.runtimeStyle.backgroundColor = 'transparent';
	},
	vmlOffsets: function(el) {
		var thisStyle = el.currentStyle;
		var size = {'W':el.clientWidth+1, 'H':el.clientHeight+1, 'w':this.imgSize[el.vmlBg].width, 'h':this.imgSize[el.vmlBg].height, 'L':el.offsetLeft, 'T':el.offsetTop, 'bLW':el.clientLeft, 'bTW':el.clientTop};
		var fudge = (size.L + size.bLW == 1) ? 1 : 0;
		var makeVisible = function(vml, l, t, w, h, o) {
			vml.coordsize = w+','+h;
			vml.coordorigin = o+','+o;
			vml.path = 'm0,0l'+w+',0l'+w+','+h+'l0,'+h+' xe';
			vml.style.width = w + 'px';
			vml.style.height = h + 'px';
			vml.style.left = l + 'px';
			vml.style.top = t + 'px';
		};
		makeVisible(el.vml.color.shape, (size.L + (el.isImg ? 0 : size.bLW)), (size.T + (el.isImg ? 0 : size.bTW)), (size.W-1), (size.H-1), 0);
		makeVisible(el.vml.image.shape, (size.L + size.bLW), (size.T + size.bTW), (size.W), (size.H), 1);
		
		var bg = {'X':0, 'Y':0};
		var figurePercentage = function(axis, position) {
			var fraction = true;
			switch(position) {
				case 'left':
				case 'top':
					bg[axis] = 0;
					break;
				case 'center':
					bg[axis] = .5;
					break;
				case 'right':
				case 'bottom':
					bg[axis] = 1;
					break;
				default:
					if (position.search('%') != -1) {
						bg[axis] = parseInt(position)*.01;
					}
					else {
						fraction = false;
					}
			}
			var horz = (axis == 'X');
			bg[axis] = Math.ceil(fraction ? ( (size[horz?'W': 'H'] * bg[axis]) - (size[horz?'w': 'h'] * bg[axis]) ) : parseInt(position));
			if (bg[axis] == 0) {
				bg[axis]++;
			}
		};
		for (var b in bg) {
			figurePercentage(b, thisStyle['backgroundPosition'+b]);
		}
		
		el.vml.image.fill.position = (bg.X/size.W) + ',' + (bg.Y/size.H);
		
		var bgR = thisStyle.backgroundRepeat;
		var dC = {'T':1, 'R':size.W+fudge, 'B':size.H, 'L':1+fudge};
		var altC = { 'X': {'b1': 'L', 'b2': 'R', 'd': 'W'}, 'Y': {'b1': 'T', 'b2': 'B', 'd': 'H'} };
		if (bgR != 'repeat') {
			var c = {'T':(bg.Y), 'R':(bg.X+size.w), 'B':(bg.Y+size.h), 'L':(bg.X)};
			if (bgR.search('repeat-') != -1) {
				var v = bgR.split('repeat-')[1].toUpperCase();
				c[altC[v].b1] = 1;
				c[altC[v].b2] = size[altC[v].d];
			}
			if (c.B > size.H) {
				c.B = size.H;
			}
			el.vml.image.shape.style.clip = 'rect('+c.T+'px '+(c.R+fudge)+'px '+c.B+'px '+(c.L+fudge)+'px)';
		}
		else {
			el.vml.image.shape.style.clip = 'rect('+dC.T+'px '+dC.R+'px '+dC.B+'px '+dC.L+'px)';
		}
	},
	
	fixPng: function(el) {
		el.style.behavior = 'none';
		if (el.nodeName == 'BODY' || el.nodeName == 'TD' || el.nodeName == 'TR') { /* elements not supported yet */
			return;
		}
		el.isImg = false;
		if (el.nodeName == 'IMG') {
			if(el.src.toLowerCase().search(/\.png$/) != -1) {
				el.isImg = true;
				el.style.visibility = 'hidden';
			}
			else {
				return;
			}
		}
		else if (el.currentStyle.backgroundImage.toLowerCase().search('.png') == -1) {
			return;
		}
		var lib = DD_belatedPNG;
		el.vml = {color: {}, image: {}};
		var els = {shape: {}, fill: {}};
		for (var r in el.vml) {
			for (var e in els) {
				var nodeStr = lib.ns + ':' + e;
				el.vml[r][e] = document.createElement(nodeStr);
			}
			el.vml[r].shape.stroked = false;
			el.vml[r].shape.appendChild(el.vml[r].fill);
			el.parentNode.insertBefore(el.vml[r].shape, el);
		}
		el.vml.image.shape.fillcolor = 'none';
		el.vml.image.fill.type = 'tile';
		el.vml.color.fill.on = false;
		
		lib.attachHandlers(el);
		
		lib.giveLayout(el);
		lib.giveLayout(el.offsetParent);
		
		lib.applyVML(el);
	}
	
};
if(navigator.appName == "Microsoft Internet Explorer") 
{ 
	 V=navigator.appVersion;   
	 X=parseFloat(V.substring(V.indexOf("MSIE")+5,V.lastIndexOf("Windows")));
	 if(X<=6.0){
		   try {
				document.execCommand("BackgroundImageCache", false, true);
			} catch(r) {}
			DD_belatedPNG.createVmlNameSpace();
			DD_belatedPNG.createVmlStyleSheet();
	 }
}


window.onload = function(){
							var minh = 510;
							var minw = 920;
							document.getElementById("top").style.width = document.body.offsetWidth < minw ? minw+"px" : "100%";
							document.getElementById("footer").style.width = document.body.offsetWidth < minw ? minw+"px" : "100%";
							document.getElementById("divPage").style.height = document.body.offsetHeight < minh ? minh+"px" : document.body.offsetHeight+"px";
				}
