/*
  - $Id: error.js,v $
  - $Revision: 1.00 $
  - $Date: 2004/02/23 $
  -
  - Copyright (C) 2004 PCCW-Cascade. All rights reserved.
*/

/* This js aims to centralize the system error handling.
*  All the system error is defined as an errorObj.
*  And the error should be synchronized with application error.
*  Also, the function related to error should be located in this js.
*/



var errorList = new Array();
var errCount = 0;
// Type 001 -- General Error
errorList[errCount] = new errObj('001001', '電郵格式錯誤，請重新輸入。\nInvalid email address, please input again.', 'alertmsg', ''); errCount++;

// Type 002 -- Avatar Error
errorList[errCount] = new errObj('002001', '你不能購買與你性別不同的物品。\nYou cannot buy items that are different from your sex.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002002', '相片未能成功刪除\nCannot delete photo.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002003', '已經超過40個儲存限額﹐請先刪除部份相片\nExceed 40 Avatar storage limit.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002004', '此形象已存在於你的私相簿\nThis avatar is already existed in the album.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002005', '不能記錄相片\nCannot save photo.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002006', '請登入\nPlease login.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002007', '相片已成功刪除\nPhoto is deleted successfully', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002008', '相片已儲存成功\nPhoto is saved successfully', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002009', '網頁未能完全顯示﹐請按主頁重試\nIncomplete page, please retry at Avatar Mall.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002010', '請先選擇要購買的物品.\nPlease select item you want to buy.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002011', '會員資料未能確認﹐請重新輸入資料再試。\nMember cannot be found. Please input again.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002012', '沒有此會員\nMember cannot be found。', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002013', '此乃有效會員\nMember is valid.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002014', '未能成功刪除物品。\nItem delete failure.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002015', '未能讀取記錄。\nData failure.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002016', '回復舊Look 完成。', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002017', '資料發生問題﹐不能發送禮物\nSend gift failure.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002018', '此物品不可作禮物送出。\nThis item cannot send as gift.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002019', '以下物品是不能轉送給朋友: 穿在身上的物品﹐用獎券購買的物品\nIf in this case as below you cannot send as gift.  Gift received item, items that were bought by the event coupon, administrator supplied items, currently worn items.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002020', '資料發生問題﹐不能購買或發送禮品.\nBuy item or send gift failure.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002021', '沒有存款.\nNo coin.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002022', '資料發生問題﹐不能購買物品.\nBuy item failure.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002023', '造型未能成功更新\nCannot update Avatar status', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002024', '造型未能成功更新\nCannot update Avatar status', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002025', '造型未能成功更新\nCannot update Avatar status', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002026', '造型未能成功更新\nCannot update Avatar status', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002027', '造型未能成功更新\nCannot update Avatar status', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002028', '造型未能成功更新\nCannot update Avatar status', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002029', '造型未能成功更新\nCannot update Avatar status', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002030', '造型未能成功更新\nCannot update Avatar status', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002031', '造型未能成功更新\nCannot update Avatar status', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002032', '造型未能成功更新\nCannot update Avatar status', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002033', '造型未能成功更新\nCannot update Avatar status', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002034', '沒有此會員﹐ 請重新輸入.\nMember cannot be found. Please input again.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002035', '接收者不是有效會員﹐發送禮物未能成功\.\nMember cannot be found, send gift failure.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002036', '你的代幣結餘不足, 請重新確定交易項目.\nNot enough hancoin, please try again.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002037', '最多只能儲存12個願望物品﹐ 前往 "心水清單" ?\nYou can put maxium 12 items on the Wish List, go to Wish List ?', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002038', '物品已被刪除.\nItem has been deleted.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002039', '已加入"心水清單"﹐前往"心水清單"?\nItem added.  Go to Wish List ?', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002040', '超過 80 個英文字母 / 40 個中文字限額\nExceed 80 english characters or 40 chinese characters limit.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002041', '以下物件是不能轉售的: 基本物件﹐遊戲﹐禮物﹐用獎券購買的物件﹐ 獎品及穿在身上的物品\nIf in this case as below you cannot resell item.  Gift received item, items that were bought by the event coupon, administrator supplied items, currently worn items.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002042', '穿在身上的物品是不能扔掉的.\nCannot delete wearing item.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002043', '以下物品是不能轉送給朋友: 穿在身上的物品﹐用獎券購買的物品\nIf in this case as below you cannot send as gift.  Items that were bought by the event coupon or currently worn items.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002044', '返回基本面孔 [按此按扭後﹐面孔及化妝造型將會消失並不能再使用].', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002045', '面孔造型只可用一次﹐ 當你確認\"確定新 Look\" 後﹐此物品將會消失.\nFace shapes are 1 time use items. [finish wear] If you click on this then the item will disappear', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002046', '化妝造型只可用一次﹐ 當你確認\"確定新 Look\" 後﹐此物品將會消失.\nMake up items are for 1 time use. [finish wear] after you click on this the item will disappear.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002047', '*面孔造型使用中﹐如欲更換其他面孔﹐請先按‘基本 Look’.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002048', '你不能穿上與你性別不同的物品.\nYou cannot wear those items that are of different sex.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002049', '請先選擇物品.\nPlease select item.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002050', '記錄已被刪除\nRecord Deleted.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002051', '物品已被扔掉\nItem is deleted successfully.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002052', '進行中.\nSystem in progress.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002053', '網頁未能完全顯示﹐請按主頁重試.\nIncomplete page, please retry at Avatar Mall.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002054', '你不能試穿與你性別不同的物品.\nYou cannot try on those clothes that are of different sex to you.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002055', '沒有此物品。\nItem cannot be found!', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002056', '請輸入會員號碼.\nPlease input ID.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002057', '接收禮物者不能是你本人﹐請返回 Avatar Mall, 並直接按購買.\nYou cannot send a gift item to yourself. Please buy item at Avatar Mall.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002058', '確定要送出此物品給"XXXX" ?\nConfirm send this item to "XXXX" ?', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002059', '要刪除所有記錄 ?\nAll items will be deleted.  Will you continue ?', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002060', '請選擇要刪除的物品\nPlease select item you want to delete', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002061', '網頁未能完全顯示﹐請按主頁重試.\nIncomplete page, please retry at Avatar Mall.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002062', '你不能送出與接受者性別不同的物品\nYou cannot send those items that are different sex to receiver.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002063', '資料發生問題，請與客戶服務部聯絡\nData error, please contact our Customer Services.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002064', '資料發生問題，造型未能成功更新\nCannot update Avatar status', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002065', '想刪除相片嗎?\nDo you want to delete photo from album?', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002066', '確定刪除?\nDo you want to delete item from Wish List?', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002067', '收到重複的購買要求﹐請前往‘\'我的衣帽間’\'確認要購買的物品.\nDouble purchase request received. Please go to My Room confirm your purchase.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002068', '此禮物不可作禮物再送出\nGift Item cannot be send to others as gift.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002069', 'Invalid NPID', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002070', 'Error in updating database', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002071', 'Missing Avatar ID', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002072', 'Unknown return in updating Netpass', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002073', 'No return or invalid return in updating Netpass', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002074', 'Error in updating NetPass', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002075', 'Invalid Parameter in update NetPass Transaction', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002076', 'Error in update NetPass Transaction', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002077', 'Error in update NetPass Transaction', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002078', 'Error in update NetPass Transaction Status', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002079', '你不能使用"基本Look"參加選舉\nCannot join contest with basic look', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002080', '請輸入"我的參選標題"\nPlease input Title', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002081', '請輸入"我的參選內容"\nPlease input Description', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002082', '你想參加"AVATAR@NOW 選舉"嗎?', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002083', '你要編輯"我的參選內容"嗎?', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002084', '這已是"首頁"\nThis is first page', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002085', '這已是"尾頁"\nThis is last page', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002086', '請以英文輸入\nPlease input English character', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002087', '你不能加入自己的啦啦隊\nYou cannot be your \'Cheering Team\' member', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002088', '你要退出選舉嗎？\nDo you want to withdraw the contest?', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002089', '你不能給自己評分\nYou cannot give mark to yourself', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002090', '請選擇分數\nPlease select mark', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002091', '請輸入留言內容\nPlease input comments', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002092', '沒有物件可供售賣\nNo item able to buy', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002093', '顯示啦啦隊隊長', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002094', '現時沒有啦啦隊隊長', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002095', '你現時的Avatar Look已於dd/mm/yyyy被其他參賽者選用﹐ 請更換新Look再試。\nYour avatar look is using by other participant.  Please change and rejoin.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002096', '你已經參選"AVATAR@NOW 選舉"﹐不能再次登記。\nYou already joined \'AVATAR@NOW\' contest', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002097', '資料發生問題﹐請重試。\nData transfer failure, please try again.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002098', '資料發生問題﹐請重試。\nData transfer failure, please try again.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002099', '你只能刪除你自己輸入的資料\nYou cannot delete contest record of other participant.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002100', '你已經是啦啦隊成員\nYou are member of \'Cheering Team\' already', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002101', '你只可給同一參賽者評分一次\nYou can give score to identical participant once only', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002102', '你只可以遞交評語一次\nYou can submit comment to identical participant once only', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002103', '資料發生問題﹐不能選取此啦啦隊隊長。Data problem, you cannot select this member as \'Cheering Team\' leader', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002104', '你已成功參加"AVATAR@NOW"選舉\nYou have registered \'AVATAR@NOW\' contest successfully', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002105', '你的"參選內容"已更改成功\nYour record is updated', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002106', '你已成功退出"AVATAR@NOW"選舉\nYour contest record is deleted', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002107', '你已成功登記為xxx的啦啦隊成員\nYou are registered as member of \'Cheering Team\' successfully', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002108', '你給xxx的評分已成功記錄\nYour score to xxx is recorded', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002109', '你已成功選取xxx為啦啦隊隊長\nLeader of your \'Cheering Team\' is selected successfully.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002110', '已成功刪除啦啦隊隊長\nLeader of your \'Cheering Team\' is cancelled.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002111', '參選標題超過 xxx 個英文字母 / xxx 個中文字限額\nTitle exceed xxx english characters or xxx chinese characters limit.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002112', '參選內容超過 xxx 個英文字母 / xxx 個中文字限額\nTitle exceed xxx english characters or xxx chinese characters limit.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002113', '請輸入"鼓勵說話"\nPlease input Cheering message', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002114', '參選內容超過 xxx 個英文字母 / xxx 個中文字限額\nDescription exceed xxx english characters or xxx chinese characters limit.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002115', '你沒有穿著指定服飾,所以不能參加是次選舉,詳情請參閱選舉網頁.\nCannot join this contest without wearing specific item.  Please refer to contest event page for details.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002116', '收到重複的登記﹐請前往選舉網頁確定登記是否已被接納。\nDouble request received, please go to AVATAR@NOW contest page to confirm your registration.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002117', '現時沒有選舉進行，請留意有關網頁公佈。\nNo contest in progress. Please try later.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002118', '收到重複的購買要求﹐請前往‘\'我的衣帽間’\'確認要購買的物品.\nDouble purchase request received. Please go to My Room confirm your purchase.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002119', '密碼不正確，請重新輸入.\nInvalid password, please input again.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002120', '密碼錯誤﹐請重新輸入。\nWrong password, please try again.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002121', '測試戶口不可以進行是項交易﹐ 請使用其他戶口。\nTest account not allow to checkout this item, please use another account.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002122', '對不起！此服務只供「網上行」寬頻上網或撥號連線服務之會員使用，請先登記有關服務。\nYou are not currently our Netvigator users, please register IMS Broadband / 56K Services.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002123', '你本月的總消費已超越限額，是次收費未被確認。請聯絡我們的客戶服務部。\nYour monthly spending limit has exceeded, the payment will not be effective.  Please contact our customer services.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002124', '系統偵測到你在短時間內重覆購買同一款物品。為免賬目混亂，系統已經拒絕重覆的購買要求。請查看交易紀錄以確定該項交易是否完成。\nThe system detected you have ordered the same item twice.  To avoid account confusion, the payment will not be effective.  Please check the transaction record for confirmation', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002125', '對不起，資料傳送發生錯誤，項目並未收費，請稍後再試。\nData transmission error.  The payment will not be effective, please try again later.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002126', '對不起，資料傳送發生錯誤，項目並未收費，請稍後再試。\nData transmission error.  The payment will not be effective, please try again later.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002127', '對不起，資料傳送發生錯誤，項目並未收費，請稍後再試。\nData transmission error.  The payment will not be effective, please try again later.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002128', '你本月的總消費已超越限額，是次收費未被確認。請聯絡我們的客戶服務部。\nYour monthly spending limit has exceeded, the payment will not be effective.  Please contact our customer services.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002129', '對不起，資料傳送發生錯誤，項目並未收費，請稍後再試。\nData transmission error.  The payment will not be effective, please try again later.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002130', '對不起，你所選擇的物品已經售罄。\nSorry, the item you selected has been sold out.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002131', '此物品不能購買或作禮物送出。\nThis item cannot be buy or send as gift.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('002132', '你的特價品限額已滿。\nYour discounted item quota is full.', 'alertmsg', ''); errCount++;

// Type 003 -- My Home Error
errorList[errCount] = new errObj('003001', '請輸入題目。\nPlease input subject.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('003002', '請輸入內容。\nPlease input message content.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('003003', '請輸入你的個人資料。\nPlease input your personal information.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('003004', '出生日期不正確，請重新輸入!\nInvalid Date of Birth, please input again.', 'alertmsg', ''); errCount++;

// Type 004 -- Smart Bar Error
errorList[errCount] = new errObj('004001', '你必須登入和成為Game.now.com.hk會員才可使用『朋友搜尋』。\nThis function is for Game.now.com.hk members only, please login.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('004002', '你必須登入和成為Game.now.com.hk會員才可使用『個人留言板』。\nThis function is for Game.now.com.hk members only, please login.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('004003', '你輸入的用戶登入名稱 / 別名並不存在，請重新輸入。\nNo record found, please input again.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('004004', '請輸入要搜尋GAME ID / 別名。\nPlease input GAME ID / Nickname.', 'alertmsg', ''); errCount++;

// Type 005 -- Registration Error
errorList[errCount] = new errObj('005001', '對不起！由於你選擇的GAME ID已被使用，所以你未能成功登記此服務，請重新選擇你的GAME ID然後再嘗試。','systemerror',''); errCount++;
// errorList[errCount] = new errObj('005002', '對不起！由於你使用的「網上行」戶口已被暫停，所以你未能成功申請或使用此服務。','systemerror',''); errCount++;
errorList[errCount] = new errObj('005002', '對不起！此服務只供「網上行」寬頻上網或撥號連線上網之客戶使用，如你的網上行登入帳戶已暫停，便無法成功使用此服務。','systemerror',''); errCount++;
errorList[errCount] = new errObj('005003', '對不起！此服務只供「網上行」寬頻上網或撥號連線服務之會員使用，請先<a href=\"http://www.netvigator.com/netvigator2003/frameset.html?top=http://www.netvigator.com/netbar/netbar2003/bar3/mega_c.html&content=serviceplans/service_plan_c.html\">登記</a>有關服務。','systemerror',''); errCount++;
errorList[errCount] = new errObj('005004', '你已經登記成為now.com.hk免費基本服務用戶，請即享用此服務。','systemerror',''); errCount++;
errorList[errCount] = new errObj('005005', '對不起！由於資料傳送發生錯誤，所以未能成功登記此服務，請重新登記或電郵至<a href="mailto:gamecs@netvigator.com">gamecs@netvigator.com</a>查詢。','systemerror',''); errCount++;
errorList[errCount] = new errObj('005015', '對不起！你的now.com.hk免費基本服務已經被終止，如要重新使用此服務，請連同你的姓名和聯絡電話電郵至<a href="mailto:gamecs@netvigator.com">gamecs@netvigator.com</a>，到時將有專人與你聯絡重新使用此服務的安排。','systemerror',''); errCount++;

// Type 006 -- Bug Report Error
errorList[errCount] = new errObj('006001', '請輸入題目。\nPlease input subject.','alertmsg',''); errCount++;
errorList[errCount] = new errObj('006002', '題目字數超過限制，請重新輸入。\nThe subject is exceeded limit, please input again.','alertmsg',''); errCount++;
errorList[errCount] = new errObj('006003', '請輸入Game Bug之詳情。\nPlease input game bug details.','alertmsg',''); errCount++;
errorList[errCount] = new errObj('006004', 'Game Bug詳情字數超過限制，請重新輸入。\nThe game bug details is exceeded limit, please input again.','alertmsg',''); errCount++;
errorList[errCount] = new errObj('006005', '請輸入回覆之電郵。\nPlease input your contact email address.','alertmsg',''); errCount++;
errorList[errCount] = new errObj('006006', '個人簡介最多只可輸入500個字','alertmsg',''); errCount++;

// Type 007 -- Game Item Error
errorList[errCount] = new errObj('007001', '請輸入接收者ID。','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007002', '系統偵測到錯誤﹐請稍後再嘗試。','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007003', '你輸入的接收者ID並不存在 ﹐請重新輸入。','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007004', '請先選擇遊戲。\nPlease select game.','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007005', '系統偵測到錯誤﹐請稍後再嘗試。','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007006', '密碼錯誤，請重新輸入。','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007007', '代幣不足。','systemerror',''); errCount++;
errorList[errCount] = new errObj('007008', '系統偵測到錯誤﹐請稍後再嘗試。','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007009', '系統偵測到錯誤﹐請稍後再嘗試。','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007010', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007011', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007012', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007013', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007014', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007015', '系統偵測到錯誤﹐請稍後再嘗試。','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007016', '此道具正在使用中﹐請往[我的道具箱] 查詢詳情。','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007017', '系統偵測到錯誤﹐請稍後再嘗試。','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007018', '系統偵測到錯誤﹐請稍後再嘗試。','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007019', '並沒有此遊戲的記錄。','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007020', '請登入。\nPlease login.','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007021', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007022', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007023', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007024', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007025', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007026', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007027', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007028', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007029', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007030', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007031', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007032', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007033', '','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007099', '系統偵測到錯誤﹐請稍後再嘗試。','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007101', '接收道具者不能是你本人﹐請返回 Game Item Mall選擇購買。\nYou cannot send a game item to yourself, please purchase at Game Item Mall.','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007102', '此乃有效會員  \nMember is valid','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007103', '沒有此會員  \nMember cannot be found','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007104', '請輸入會員號碼.\nPlease input ID.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('007105', '訊息不能超過30個字 \nThe maximum size of this message is 30 characters.','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007106', '你的要求現在處理中﹐請稍後片刻 \nYour transaction is submitted, please wait.','alertmsg',''); errCount++;
errorList[errCount] = new errObj('007107', '請先輸入密碼\nPlease enter password','alertmsg',''); errCount++;

// Type 008 -- General
errorList[errCount] = new errObj('008001', '請先登入NETPass\nPlease login NETpass.', 'alertmsg', ''); errCount++;
errorList[errCount] = new errObj('008002', '此賬號已參加了Game超聯﹐是次登記不被接納。\nRegistration failed, you have joined now.com.hk Premier League.','alertmsg',''); errCount++;
errorList[errCount] = new errObj('008003', '系統偵測錯誤﹐請稍後再嘗試\nSystem error, please try again later','alertmsg',''); errCount++;
errorList[errCount] = new errObj('008004', '系統偵測錯誤﹐請稍後再嘗試\nSystem error, please try again later','alertmsg',''); errCount++;
errorList[errCount] = new errObj('008005', '系統偵測錯誤﹐請稍後再嘗試\nSystem error, please try again later','alertmsg',''); errCount++;
errorList[errCount] = new errObj('008006', '請輸入聯絡電話\nPlease enter phone no.','alertmsg',''); errCount++;
errorList[errCount] = new errObj('008007', '請選擇隊伍\nPlease select team','alertmsg',''); errCount++;
errorList[errCount] = new errObj('008008', '請輸入聯絡電郵\nPlease enter email address','alertmsg',''); errCount++;
errorList[errCount] = new errObj('008009', '請輸入參加者名稱\nPlease enter player name','alertmsg',''); errCount++;
errorList[errCount] = new errObj('008010', 'Emaill address too long','alertmsg',''); errCount++;

// Type 009 -- Board Error
errorList[errCount] = new errObj('009001', '留言板最多只可儲存50個留言!\nMaximum storage is 50 messages','alertmsg',''); errCount++;

//errorList[errCount] = new errObj('007001', '中文error message1','systemerror',''); errCount++;
//errorList[errCount] = new errObj('007002', '中文error message2','systemerror',''); errCount++;
//errorList[errCount] = new errObj('007003', '中文error message3','systemerror','http://hk.yahoo.com'); errCount++;
errorList[errCount] = new errObj('008001', '中文error message4','systemerror','http://www.msn.com.hk'); errCount++;
errorList[errCount] = new errObj('008003', '中文error message5','systemerror',''); errCount++;
errorList[errCount] = new errObj('008003', '中文error message6','systemerror','http://now.com.hk'); errCount++;

/********************************************************
* Common error function
*********************************************************/

function errObj(errCode, msg, action, actionURL) {
	// errCode must be an 6 digit integer (but in String)
	// first 3 digit represent error type
	// last 3 digit represent message number
	this.errCode = errCode;
	// Error message
	this.msg = msg;
	// define the action need to perform for this error
	// e.g. alertmsg, popupurl, redirect, systemerr and may have more in the future.
	this.action = action;
	// define the URL (if necessary) to handle this error.
	this.actionURL = actionURL;
}

function errActionHandler(eObj, eAct) {
	switch(eAct) {
		case "alertmsg":
			var msgprompt = '[' + eObj.errCode + ']' + '\n' + eObj.msg;
			alert(msgprompt);
			break;
		case "popupurl":
			openWin(eObj.actionURL, "errPopup", 400, 400, "auto"); // this case must be used with hkcommon.js
			break;
		case "redirect":
			top.location.href = eObj.actionURL;
			break;
		case "systemerror":
			top.location.href = "http://game.netvigator.com/hg/main/jsp/function/error/errorindex.jsp?errCode=" + eObj.errCode;
			break;
	}
}

function getErrType(eObj) {
	var eCode = eObj.errCode;
	var eType = eCode.substr(0, 3);
	return eType;
}

function getErrMsgNum(eObj) {
	var eCode = eObj.errCode;
	var eNum = eCode.substr(3, 3);
	return eNum;
}

function getErrObj(eCode) {
	for (i=0;i<errorList.length;i++) {
		var eObj = errorList[i];
		if (eObj.errCode==eCode) {
			return eObj;
		}
	}
}

function showErr(eCode) {
	var eObj = getErrObj(eCode);
	var eAct = eObj.action;
	errActionHandler(eObj, eAct);
}
