function _setText(sText,oElm) {
  var l = 0;
  var text = null;
  if (_userLang == 'zh-CN') { l = 1; }
  if (_userLang == 'zh-HK') { l = 2; }
  if (_userLang == 'ja') { l = 3; }
  for (var i = 0; i < _labels.length; i++) {
    if (_labels[i][0] == sText) {
      text = _labels[i][l];
    }
  }
  if (text == null) {
    text = sText;
  }
  if (oElm) {
    oElm.innerText = text;
  }
  return text;
}

function languagebaritem_mouseover(oElm) {
  if (oElm.getAttribute('class') != 'c-languagebaritem-current') {
    oElm.style.color = '#E60000';
  }
}

function languagebaritem_mouseout(oElm) {
  oElm.style.color = 'White';
}

function languagebaritem_click(oElm) {
  var href = oElm.getAttribute('href');
  if (href != null) {
    window.location.href = href;
  }
}

function setABHeight(eABa,eABb) {
	var colHeightNeed = this.document.getElementById(eABa);
	if (colHeightNeed)
	{
	  if (navigator.userAgent.toLowerCase().indexOf('opera') == -1) {
		  var colABaH = this.document.getElementById(eABa).scrollHeight;
		  var colABbH = this.document.getElementById(eABb).scrollHeight;
	  }else{
		  var colABaH = this.document.getElementById(eABa).offsetHeight;
		  var colABbH = this.document.getElementById(eABb).offsetHeight;
	  }
		//alert("LEFT: " + colABaH + " RIGHT: " + colABbH);
		if (colABaH > colABbH)
		{
			colABaH += 50;
		  this.document.getElementById(eABa).style.height = colABaH + "px";
			this.document.getElementById(eABb).style.height = colABaH + "px";
		}
		else if (colABbH > colABaH)
		{
		  colABbH += 50;
			this.document.getElementById(eABa).style.height = colABbH + "px";
			this.document.getElementById(eABb).style.height = colABbH + "px";
		}
	}
}

window.onload = function() {
  setABHeight("colABa","colABb");
  //alert(_currentPage);
  if ((_currentPage == 'default.aspx') || (_currentPage == 'Default.aspx')) {
    inislide();
    if ( _userLang == 'zh-CN'){
    setInterval('scroll()',150);
    };
  }else if (_currentPage == "Login.aspx") {
    login_checkBrowser();
  }else if (_currentPage == 'Error.aspx') {
    var action = 'window.location.href = "' + _path + '/' + _userLang + '/Default.aspx";'
    window.setTimeout(action,3000);
  }
}

function login_checkBrowser()
{
  var sUserAgent = navigator.userAgent;
  var isIE = (sUserAgent.indexOf("compatible") > -1) && (sUserAgent.indexOf("MSIE") > -1) && !(sUserAgent.indexOf("Opera") > -1);
  var isIE6 = false;
  if (isIE) {
    var re = new RegExp("MSIE (\\d+\\.\\d+);");
    re.test(sUserAgent);
    var fVersion = parseFloat(RegExp["$1"]);
    if (fVersion >= 6.0) {
      isIE6 = true;
    }
  }
  if (!isIE6) {
      var lc = document.getElementById('c_login_Username');
      if (lc) {
        lc.disabled='true';
      }
      lc = document.getElementById('c_login_Password');
      if (lc) {
        lc.disabled='true';
      }
      var lc = document.getElementById('c_login_RememberMe');
      if (lc) {
        lc.disabled='true';
      }
      lc = document.getElementById('c_login_Password');
      if (lc) {
        lc.disabled='true';
      }
      lc = document.getElementById('c_login_LoginButton');
      if (lc) {
        lc.disabled='true';
      }
      lc = document.getElementById('c_login_LoginButton');
      if (lc) {
        lc.disabled='true';
      }
      alert('The Web Application you are trying to log in\nonly supports Internet Explorer version 6 or higher.\nWe are sorry for the inconvenience.');
  }
}
function scrollMe() {
    clearTimeout(x)
    if(stopScroll==1) {
        return
    }
    $('highlights').scrollTop=$('highlights').scrollTop+1
    if($('highlights').scrollTop<=repeatHeight) {
        // keep on scrolin' 
        x = setTimeout("scrollMe()",40)
    }
    else { //we have hit the wrap point
        $('highlights').scrollTop=0
        x = setTimeout("scrollMe()",40)
    }
}


