<!--
var intTBCounter = 0;
var intBBCounter = 0;
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*Pop up*/
function PopupImage(strURL) { 
  window.open("popup.html?"+strURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}

/*Check submit message*/
function checkIMyaccountb5(objForm){
  var strMessage="", strDate=""; 


  if(objForm.lastName.value=="")
    strMessage = strMessage + "請輸入你的英文姓氏!\n";
  if(objForm.firstName.value=="")
    strMessage = strMessage + "請輸入你的英文名字!\n";
  if(objForm.userPassword.value=="")
    strMessage = strMessage + "請輸入你的密碼!\n" ;   
  if(objForm.userPassword.value!=objForm.cpassword.value)
    strMessage = strMessage + "密碼必須和確認密碼相同!\n" ;   
  //if(objForm.nickName.value=="")
  //  strMessage = strMessage + "請輸入你的暱稱!\n";  
  if(objForm.telephone.value=="")
    strMessage = strMessage + "請輸入你的電話號碼!\n";  
  if(objForm.address.value=="")
    strMessage = strMessage + "請輸入你的地址!\n";
  if(objForm.email.value=="")
    strMessage = strMessage + "請輸入你的電郵!\n";         
  if(objForm.typeId.value!="TY_09" && (objForm.HKId.value=="" || objForm.lastDigit.value==""))
    strMessage = strMessage + "請輸入你的身份證號碼!\n";         
  if(objForm.day.value!="" && objForm.month.value!="" && objForm.year.value!=""){ 
	strDate = objForm.year.value + "-" + objForm.month.value + "-" + objForm.day.value;
    strError = checkDate(8, strDate, "-");
	if(strError =="Date_error_length")
      strMessage = strMessage + "日期的長度不正確!\n";
	else if(strError =="Date_error_format")
      strMessage = strMessage + "日期的格式不正確!\n";
	else if(strError =="Date_error_day")
      strMessage = strMessage + "請輸入正確的日期日子!\n";
	else if(strError =="Date_error_month")
      strMessage = strMessage + "請輸入正確的日期月份!\n";
	else if(strError =="Date_error_year")
      strMessage = strMessage + "請輸入正確的日期年份!\n";
  }
    
  if(strMessage=="")
    return true;
  else{
    alert(strMessage);
    return false;
  }
}

/*Check submit message*/
function checkIMyaccountgb(objForm){
  var strMessage="", strDate=""; 


  if(objForm.lastName.value=="")
    strMessage = strMessage + "请输入你的英文姓氏!\n";
  if(objForm.firstName.value=="")
    strMessage = strMessage + "请输入你的英文名字!\n";
  if(objForm.userPassword.value=="")
    strMessage = strMessage + "请输入你的密码!\n" ;   
  if(objForm.userPassword.value!=objForm.cpassword.value)
    strMessage = strMessage + "密码必须和确认密码相同!\n" ;   
  //if(objForm.nickName.value=="")
  //  strMessage = strMessage + "请输入你的昵称!\n";  
  if(objForm.telephone.value=="")
    strMessage = strMessage + "请输入你的电话号码!\n";  
  if(objForm.address.value=="")
    strMessage = strMessage + "请输入你的地址!\n";
  if(objForm.email.value=="")
    strMessage = strMessage + "请输入你的电邮!\n";         
  if(objForm.typeId.value!="TY_09" && (objForm.HKId.value=="" || objForm.lastDigit.value==""))
    strMessage = strMessage + "请输入你的身份证号码!\n";         
  if(objForm.day.value!="" && objForm.month.value!="" && objForm.year.value!=""){ 
	strDate = objForm.year.value + "-" + objForm.month.value + "-" + objForm.day.value;
    strError = checkDate(8, strDate, "-");
	if(strError =="Date_error_length")
      strMessage = strMessage + "日期的长度不正确!\n";
	else if(strError =="Date_error_format")
      strMessage = strMessage + "日期的格式不正确!\n";
	else if(strError =="Date_error_day")
      strMessage = strMessage + "请输入正确的日期日子!\n";
	else if(strError =="Date_error_month")
      strMessage = strMessage + "请输入正确的日期月份!\n";
	else if(strError =="Date_error_year")
      strMessage = strMessage + "请输入正确的日期年份!\n";
  }
    
  if(strMessage=="")
    return true;
  else{
    alert(strMessage);
    return false;
  }
}


/*Check submit message*/
function checkOMyaccountb5(objForm){
  var strMessage="", strDate="", i=0, isnonProfitable=false; 

  if(objForm.isnonProfitable.checked)
  {
    if(objForm.certificate.value=="")
      objForm.certificate.value = objForm.englishName.value;
  }
  else
  {
    if(objForm.certificate.value=="")
      strMessage = strMessage + "請輸入你的商業登記證!\n";
  }
  if(objForm.chineseName.value=="")
    strMessage = strMessage + "請輸入你的中文名稱!\n";
  if(objForm.englishName.value=="")
    strMessage = strMessage + "請輸入你的英文名稱!\n";
  if(objForm.userPassword.value=="")
    strMessage = strMessage + "請輸入你的密碼!\n" ;   
  if(objForm.userPassword.value!=objForm.cpassword.value)
    strMessage = strMessage + "密碼必須和確認密碼相同!\n" ;   
  //if(objForm.nickName.value=="")
  //  strMessage = strMessage + "請輸入暱稱!\n";  
  if(objForm.contactPerson.value=="")
    strMessage = strMessage + "請輸入負責人姓名!\n";  
  if(objForm.telephone.value=="")
    strMessage = strMessage + "請輸入電話號碼!\n";  
  if(objForm.email.value=="")
    strMessage = strMessage + "請輸入電郵!\n";         
  if(objForm.chineseAddress.value=="")
    strMessage = strMessage + "請輸入中文地址!\n";
  if(objForm.englishAddress.value=="")
    strMessage = strMessage + "請輸入英文地址!\n";
    
  if(objForm.isnonProfitable.ischecked)
    objForm.fee.value = "0";
  else
    objForm.fee.value = "1000";


  if(strMessage=="")
    return true;
  else{
    alert(strMessage);
    return false;
  }
}

/*Check submit message*/
function checkOMyaccountgb(objForm){
  var strMessage="", strDate="", i=0, isnonProfitable=false; 

  if(objForm.isnonProfitable.checked)
  {
    if(objForm.certificate.value=="")
      objForm.certificate.value = objForm.englishName.value;
  }
  else
  {
    if(objForm.certificate.value=="")
      strMessage = strMessage + "请输入你的商业登记证!\n";
  }
  if(objForm.chineseName.value=="")
    strMessage = strMessage + "请输入你的中文名称!\n";
  if(objForm.englishName.value=="")
    strMessage = strMessage + "请输入你的英文名称!\n";
  if(objForm.userPassword.value=="")
    strMessage = strMessage + "请输入你的密码!\n" ;   
  if(objForm.userPassword.value!=objForm.cpassword.value)
    strMessage = strMessage + "密码必须和确认密码相同!\n" ;   
  //if(objForm.nickName.value=="")
  //  strMessage = strMessage + "请输入昵称!\n";  
  if(objForm.contactPerson.value=="")
    strMessage = strMessage + "请输入负责人姓名!\n";  
  if(objForm.telephone.value=="")
    strMessage = strMessage + "请输入电话号码!\n";  
  if(objForm.email.value=="")
    strMessage = strMessage + "请输入电邮!\n";         
  if(objForm.chineseAddress.value=="")
    strMessage = strMessage + "请输入中文地址!\n";
  if(objForm.englishAddress.value=="")
    strMessage = strMessage + "请输入英文地址!\n";
    
  if(objForm.isnonProfitable.ischecked)
    objForm.fee.value = "0";
  else
    objForm.fee.value = "1000";


  if(strMessage=="")
    return true;
  else{
    alert(strMessage);
    return false;
  }
}

/*Check submit message*/
function checkDonationb5(objForm){
  var strMessage="", strDate=""; 
  var i=0;


  if(objForm.name.value=="")
    strMessage = strMessage + "請輸入捐款人/團體名稱!\n";
  if(objForm.telephone.value=="")
    strMessage = strMessage + "請輸入電話!\n";  
  if(objForm.email.value=="")
    strMessage = strMessage + "請輸入電郵!\n";         
  if(objForm.address.value=="")
    strMessage = strMessage + "請輸入地址!\n";
    
  if(objForm.fee[4].checked==true)
  {
    if(objForm.fee2.value=="")
      strMessage = strMessage + "請輸入捐款數額!\n";	 
    else if(isNaN(objForm.fee2.value))
      strMessage = strMessage + "捐款數額必須是數字!\n";
    else
      objForm.fee[4].value = objForm.fee2.value;
  }

  if(strMessage=="")
    return true;
  else{
    alert(strMessage);
    return false;
  }
}

/*Check submit message*/
function checkDonationgb(objForm){
  var strMessage="", strDate=""; 
  var i=0;


  if(objForm.name.value=="")
    strMessage = strMessage + "请输入捐款人/团体名称!\n";
  if(objForm.telephone.value=="")
    strMessage = strMessage + "请输入电话!\n";  
  if(objForm.email.value=="")
    strMessage = strMessage + "请输入电邮!\n";         
  if(objForm.address.value=="")
    strMessage = strMessage + "请输入地址!\n";
    
  if(objForm.fee[4].checked==true)
  {
    if(objForm.fee2.value=="")
      strMessage = strMessage + "请输入捐款数额!\n";	 
    else if(isNaN(objForm.fee2.value))
      strMessage = strMessage + "捐款数额必须是数字!\n";
    else
      objForm.fee[4].value = objForm.fee2.value;
  }

  if(strMessage=="")
    return true;
  else{
    alert(strMessage);
    return false;
  }
}

function checkLoginb5(objForm){
  var strMessage=""; 

  if(objForm.email.value=="")
    strMessage = strMessage + "請輸入你的電郵!\n";
  if(objForm.password.value=="")
    strMessage = strMessage + "請輸入你的密碼!\n" ;   
  
  if(strMessage=="")
    return true;
  else{
    alert(strMessage);
    return false;
  }
}

function checkLogingb(objForm){
  var strMessage=""; 

  if(objForm.email.value=="")
    strMessage = strMessage + "请输入你的电邮!\n";
  if(objForm.password.value=="")
    strMessage = strMessage + "请输入你的密码!\n" ;   
  
  if(strMessage=="")
    return true;
  else{
    alert(strMessage);
    return false;
  }
}

/*Check submit message*/
function checkIMyaccounten(objForm){
  var strMessage="", strDate=""; 


  if(objForm.lastName.value=="")
    strMessage = strMessage + "Please input your english surname!\n";
  if(objForm.firstName.value=="")
    strMessage = strMessage + "Please input your english given name!\n";
  if(objForm.userPassword.value=="")
    strMessage = strMessage + "Please input your password!\n" ;   
  if(objForm.userPassword.value!=objForm.cpassword.value)
    strMessage = strMessage + "Password and confirm password should be same!\n" ;   
  //if(objForm.nickName.value=="")
  //  strMessage = strMessage + "Please input your nick name!\n";  
  if(objForm.telephone.value=="")
    strMessage = strMessage + "Please input your home tel!\n";  
  if(objForm.address.value=="")
    strMessage = strMessage + "Please input your address!\n";
  if(objForm.email.value=="")
    strMessage = strMessage + "Please input your e-mail!\n";         
  if(objForm.typeId.value!="TY_09" && (objForm.HKId.value=="" || objForm.lastDigit.value==""))
    strMessage = strMessage + "Please input your HK ID no!\n";         
  if(objForm.day.value!="" && objForm.month.value!="" && objForm.year.value!=""){ 
	strDate = objForm.year.value + "-" + objForm.month.value + "-" + objForm.day.value;
    strError = checkDate(8, strDate, "-");
	if(strError =="Date_error_length")
      strMessage = strMessage + "Date length is invalid\n";
	else if(strError =="Date_error_format")
      strMessage = strMessage + "Date format is invalid!\n";
	else if(strError =="Date_error_day")
      strMessage = strMessage + "Please input valid day!\n";
	else if(strError =="Date_error_month")
      strMessage = strMessage + "Please input valid month!\n";
	else if(strError =="Date_error_year")
      strMessage = strMessage + "Please input valid year!\n";
  }
    
  if(strMessage=="")
    return true;
  else{
    alert(strMessage);
    return false;
  }
}

/*Check submit message*/
function checkOMyaccounten(objForm){
  var strMessage="", strDate="", i=0, isnonProfitable=false; 

  if(objForm.isnonProfitable.checked)
  {
    if(objForm.certificate.value=="")
      objForm.certificate.value = objForm.englishName.value;
  }
  else
  {
    if(objForm.certificate.value=="")
      strMessage = strMessage + "Please input BR!\n";
  }
  if(objForm.chineseName.value=="")
    strMessage = strMessage + "Please input chinese name!\n";
  if(objForm.englishName.value=="")
    strMessage = strMessage + "Please input english name!\n";
  if(objForm.userPassword.value=="")
    strMessage = strMessage + "Please input password!\n" ;   
  if(objForm.userPassword.value!=objForm.cpassword.value)
    strMessage = strMessage + "Password and confirm password should be same!\n" ;   
  //if(objForm.nickName.value=="")
  //  strMessage = strMessage + "Please input nickname!\n";  
  if(objForm.contactPerson.value=="")
    strMessage = strMessage + "Please input name of responsible officer!\n";  
  if(objForm.telephone.value=="")
    strMessage = strMessage + "Please input your telephone!\n";  
  if(objForm.email.value=="")
    strMessage = strMessage + "Please input your email!\n";         
  if(objForm.chineseAddress.value=="")
    strMessage = strMessage + "Please input your chinese address!\n";
  if(objForm.englishAddress.value=="")
    strMessage = strMessage + "Please input your english address!\n";
    
  if(objForm.isnonProfitable.ischecked)
    objForm.fee.value = "0";
  else
    objForm.fee.value = "1000";


  if(strMessage=="")
    return true;
  else{
    alert(strMessage);
    return false;
  }
}

/*Check submit message*/
function checkDonationen(objForm){
  var strMessage="", strDate=""; 
  var i=0;


  if(objForm.name.value=="")
    strMessage = strMessage + "Please input donor!\n";
  if(objForm.telephone.value=="")
    strMessage = strMessage + "Please input your telephone!\n";  
  if(objForm.email.value=="")
    strMessage = strMessage + "Please input your email!\n";         
  if(objForm.address.value=="")
    strMessage = strMessage + "Please input your address!\n";
    
  if(objForm.fee[4].checked==true)
  {
    if(objForm.fee2.value=="")
      strMessage = strMessage + "Please input your amount!\n";	 
    else if(isNaN(objForm.fee2.value))
      strMessage = strMessage + "Amount should be number!\n";
    else
      objForm.fee[4].value = objForm.fee2.value;
  }

  if(strMessage=="")
    return true;
  else{
    alert(strMessage);
    return false;
  }
}

function checkLoginen(objForm){
  var strMessage=""; 

  if(objForm.email.value=="")
    strMessage = strMessage + "Please input your email!\n";
  if(objForm.password.value=="")
    strMessage = strMessage + "Please input your password!\n" ;   
  
  if(strMessage=="")
    return true;
  else{
    alert(strMessage);
    return false;
  }
}

function changeFormValue(formName, itemName, value){
  var str_action =  "document."+ formName + "." + itemName + "='"+ value + "';";   
  eval(str_action);  
}

function submitForm(strFormName){
  var strAction="";

  strAction = "document." + strFormName + ".submit()";
  eval(strAction);
}

/*Submit page link*/
function submitPageLink(strFormName, strField, strValue){
  var strAction=""; 

  strAction = "document." + strFormName + "." + strField + "='" + strValue + "';";
  eval(strAction);
  strAction = "document." + strFormName + ".submit();";
  eval(strAction);
}

/*change banner*/
function changeTopBanner1(){
  var obj, i;
  if(intTBCounter > topBanners.length-1)
    intTBCounter = 0;
  for(i=0; i<topBanners.length; i++){
    obj = topBanners[i];
	//alert(intTBCounter + "=" + i + "=>" + obj + "---" + document.getElementById(obj).style.display);

    if(i==intTBCounter) {
      switchBanner(obj, "block");
	}
	else
      switchBanner(obj, "none");	  
  }
  intTBCounter = intTBCounter + 1;
   setTimeout("changeTopBanner1()", 12000);
}

function changeBottomBanner1(){
  var obj, i;
  if(intBBCounter > bottomBanners.length-1)
    intBBCounter = 0;
  for(i=0; i<bottomBanners.length; i++){
    obj = bottomBanners[i];
	//alert(intTBCounter + "=" + i + "=>" + obj + "---" + document.getElementById(obj).style.display);

    if(i==intBBCounter) {
      switchBanner(obj, "block");
	}
	else
      switchBanner(obj, "none");	  
  }
  intBBCounter = intBBCounter + 1;
   setTimeout("changeBottomBanner1()", 12000);
}

function switchBanner(obj, strDisplay)
{
  var el = document.getElementById(obj);
  el.style.display = strDisplay;
}
//-->