﻿/* inclueded in registration_form */
/* <script language="javascript" type="text/javascript" src="registraton_form_customzied.js"></script> */

/* Customized Sub Category */
function CustomizeMain(exhibition_id, language) {

	// change applied to VOR
    var cMandStr = " <font color=red class=compulsory>*</font>";

    // please add the exhibition ID in the list if that exhibition need tailor made
    var exhibitionIds = new Array(809, 927, 940, 941, 942, 943, 791, 419, 394, 448, 483, 429, 532, 520, 541, 408, 567, 452, 526, 540, 569, 715, 714, 625, 925);

	if (language == "en") {
		$('#ltlRegFormNewRegisterUsername').html('Username: ' + cMandStr);
		$('#ltlRegFormUsernameSpec').html('In order to simplify future seminar sign up process, it is recommended to register using your personal email address or mobile phone number.');

		$('#hdnCheckUsernameDefaultMsg').val('Please enter your username');
        $('#hdnVORUserHasProfileMsg').val('This username has been registered in our system, please click <a href="javascript:requestPassword();">here</a> to get your password to logon');
		$('#hdnVORUserHasProfileAlert').val('This username has been registered in our system, please use it to logon at left side');
		$('#valTxtRegFormUsername').val('The username should more than 4 digitals or 4 characters');
		$('#regValTxtRegFormUsername').val('The format of username is not correct');
		$('#regValTxtRegFormUsernameLength').val('The length of the username cannot more than 128 characters');
		$("#spnCheckEmailFeedback").html($("#hdnCheckUsernameDefaultMsg").val());
		$('#ltlPreviewEmail').html('Username : ');
		$('#ltlVisitorUsername').html('Username : ');
	} else if (language == "zh-hk") {
		$('#ltlRegFormNewRegisterUsername').html('登入帳號﹕' + cMandStr);
		$('#hdnErrorInvalidUsernameMsg').val('登入帳號的格式不正確');
		$('#hdnUsernamePassMsg').val('登入帳號正確');
		$('#ltlRegFormUsernameSpec').html('建議您設定個人電子信箱或手機號碼為登入帳號，以便後續登入研討會系統報名。');
		$('#hdnErrorUserJoinedMsg').val('該登入帳號已在本系統注冊過，請使用其他的登入帳號或點擊”忘記密碼”重新獲取本系統的密碼');
		$('#hdnErrorInvalidUsernameMsg').val('登入帳號的格式不正確');
		$('#hdnCheckUsernameDefaultMsg').val('您的登入帳號');
		$('#hdnVORUserHasProfileMsg').val('該登入帳號已在本系統中註冊過，請點<a href="javascript:requestPassword();">擊此</a>處獲取密碼後登錄');
		$('#hdnVORUserHasProfileAlert').val('該登入帳號已在本系統中註冊過，請在畫面左方使用它來登入');
		$('#valTxtRegFormUsername').val('登入帳號必須由4個或以上的數字或英文組成');
		$('#regValTxtRegFormUsername').val('登入帳號的格式不正確');
		$('#regValTxtRegFormUsernameLength').val('登入帳號的長度不得超過 128 個字符');
		$("#spnCheckEmailFeedback").html($("#hdnCheckUsernameDefaultMsg").val());
		$('#ltlPreviewEmail').html('登入帳號 : ');
		$('#ltlVisitorUsername').html('登入帳號 : ');
	} else if (language == "zh-cn") {
		$('#ltlRegFormNewRegisterUsername').html('登入帐号﹕' + cMandStr);
		$('#hdnErrorInvalidUsernameMsg').val('登入帐号的格式不正确');
		$('#hdnUsernamePassMsg').val('登入帐号正确');
		$('#ltlRegFormUsernameSpec').html('建议您设定个人电子信箱或手机号码为登入帐号，以便后续登入研讨会系统报名。');
		$('#hdnErrorUserJoinedMsg').val('该登入帐号已在本系统注册过，请使用其他的登入帐号或点击”忘记密码”重新获取本系统的密码');
		$('#hdnErrorInvalidUsernameMsg').val('登入帐号的格式不正确');
		$('#hdnCheckUsernameDefaultMsg').val('您的登入帐号');
		$('#hdnVORUserHasProfileMsg').val('该登入帐号已在本系统中注册过，请点<a href="javascript:requestPassword();">击此</a>处获取密码后登录');
		$('#hdnVORUserHasProfileAlert').val('该登入帐号已在本系统中注册过，请在画面左方使用它来登入');
		$('#valTxtRegFormUsername').val('登入帐号必须由4个或以上的数字或英文组成');
		$('#regValTxtRegFormUsername').val('登入帐号的格式不正确');
		$('#regValTxtRegFormUsernameLength').val('登入帐号的长度不得超过 128 个字符');
		$("#spnCheckEmailFeedback").html($("#hdnCheckUsernameDefaultMsg").val());
		$('#ltlPreviewEmail').html('登入帐号 : ');
		$('#ltlVisitorUsername').html('登入帐号 : ');
	}

	for (var i = 0; i < exhibitionIds.length; i++) {
	    if (exhibition_id == exhibitionIds[i]) {
	        var funcCall = "Customize" + exhibitionIds[i] + " ('" + language + "');";
	        eval(funcCall);
	        break;
	    }
	}
	
	if (language == "zh-hk" || language == "zh-cn") 
	{
			$("#ltlRegFormNewRegisterGivenName").html("<font color='red'>(Given)</font>");
			$("#ltlRegFormNewRegisterMiddleName").html("<font color='red'>(Middle)</font>");
			$("#ltlRegFormNewRegisterFamilyName").html("<font color='red'>(Family)</font>");
	}
}


function Customize809(language) {
    var cMandStr = " <font color=red class=compulsory>*</font>";
    var pathinfo = location.pathname.split("/");
    var pnlPrefix = "RegForm";

    if (pathinfo[pathinfo.length - 1] == "preview_form.aspx" || pathinfo[pathinfo.length - 1] == "preview_form_chi.aspx") {
        pnlPrefix = "Preview";
    }
    
    //pnlRegFormBusinessNature
    //pnlRegFormNumOfEmployer
    //pnlRegFormMainInterest
    //pnlRegFormJobFunction
    //pnlRegFormPurchasingAuthority
    //pnlRegFormVisitPurpose

    var pnlBusinessNatureContainer = $('#pnl' + pnlPrefix + 'BusinessNature')[0].outerHTML;
    var pnlNumOfEmployeeContainer = $('#pnl' + pnlPrefix + 'NumOfEmployer')[0].outerHTML;
    var pnlMainInterestContainer = $('#pnl' + pnlPrefix + 'MainInterest')[0].outerHTML;
    var pnlJobFunctionContainer = $('#pnl' + pnlPrefix + 'JobFunction')[0].outerHTML;
    var pnlPurchasingAuthorityContainer = $('#pnl' + pnlPrefix + 'PurchasingAuthority')[0].outerHTML;
    var pnlVisitPurposeContainer = $('#pnl' + pnlPrefix + 'VisitPurpose')[0].outerHTML;

    $('#pnl' + pnlPrefix + 'BusinessNature').remove();
    $('#pnl' + pnlPrefix + 'JobFunction').remove();
    $('#pnl' + pnlPrefix + 'NumOfEmployer').remove();
    $('#pnl' + pnlPrefix + 'MainInterest').remove();
    $('#pnl' + pnlPrefix + 'PurchasingAuthority').remove();
    $('#pnl' + pnlPrefix + 'VisitPurpose').remove();

    var pnlAddBeforeElement = $("#chkVorRegFormReceiveNewsletter").parent().parent().parent().parent().parent().parent().parent().parent(); //找到在form中位置不需要變動的節點（vor中”Subscribe to our news updates(uncheck to cancel subscription”  table )）

    var site = $(pnlAddBeforeElement[0].previousSibling);

    site.before(pnlBusinessNatureContainer); //把臨時存儲的節點加入到位置不需要變動的節點之前
    site.before(pnlJobFunctionContainer); //把臨時存儲的節點加入到位置不需要變動的節點之前
    site.before(pnlNumOfEmployeeContainer); //把臨時存儲的節點加入到位置不需要變動的節點之前
    site.before(pnlMainInterestContainer); //把臨時存儲的節點加入到位置不需要變動的節點之前
    site.before(pnlPurchasingAuthorityContainer); //把臨時存儲的節點加入到位置不需要變動的節點之前
    site.before(pnlVisitPurposeContainer); //把臨時存儲的節點加入到位置不需要變動的節點之前
    
    if (language == "en") {
        $("#tblRegFormPurchasingAuthorityHeader tr td:eq(0)").html("Main area of interest (by product end-use) :" + cMandStr);
        $("#tblRegFormVisitPurposeHeader tr td:eq(0)").html("Purpose(s) of visiting :" + cMandStr);
        $("#tblRegFormNumOfEmployer tr td:eq(0)").html("Brands :" + cMandStr);
        $("#custValTxtRegFormNumOfEmployer").val("Please specific your own brand(s)");
        $("#custValTxtRegFormPurchasingAuthority").val("Please specific your main area of interest (by product end-use) ");
    } else if (language == "zh-hk") {
        $("#tblRegFormPurchasingAuthorityHeader tr td:eq(0)").html("有興趣產品 (按最終用途選擇)" + cMandStr);
        $("#tblRegFormVisitPurposeHeader tr td:eq(0)").html("參加是次展覽會的原因：" + cMandStr);
        $("#tblRegFormNumOfEmployer tr td:eq(0)").html("品牌：" + cMandStr);
        $("#custValTxtRegFormNumOfEmployer").val("請註明你所經營或代理的服裝品牌名稱");
        $("#custValTxtRegFormPurchasingAuthority").val("請註明你有興趣產品 (按最終用途選擇)");
    } else if (language == "zh-cn") {
        $("#tblRegFormPurchasingAuthorityHeader tr td:eq(0)").html("有兴趣产品 (按最终用途选择)" + cMandStr);
        $("#tblRegFormVisitPurposeHeader tr td:eq(0)").html("参加是次展览会的原因：" + cMandStr);
        $("#tblRegFormNumOfEmployer tr td:eq(0)").html("品牌：" + cMandStr);
        $("#custValTxtRegFormNumOfEmployer").val("请注明你所经营或代理的服装品牌名称");
        $("#custValTxtRegFormPurchasingAuthority").val("请注明你有兴趣产品 (按最终用途选择)");
    }

}

function Customize927(language) {
    var cMandStr = " <font color=red class=compulsory>*</font>";
    var pathinfo = location.pathname.split("/");
    var pnlPrefix = "RegForm";

    if (pathinfo[pathinfo.length - 1] == "preview_form.aspx" || pathinfo[pathinfo.length - 1] == "preview_form_chi.aspx") {
        pnlPrefix = "Preview";
    }

    var pnlBusinessProfileContainer = $('#pnl' + pnlPrefix + 'BusinessProfile')[0].outerHTML;
    var pnlBusinessNatureContainer = $('#pnl' + pnlPrefix + 'BusinessNature')[0].outerHTML;
    var pnlNumOfEmployeeContainer = $('#pnl' + pnlPrefix + 'NumOfEmployer')[0].outerHTML;
    var pnlRegionSourcingContainer = $('#pnl' + pnlPrefix + 'RegionSourcing')[0].outerHTML;
    var pnlJobFunctionContainer = $('#pnl' + pnlPrefix + 'JobFunction')[0].outerHTML;
    var pnlPurchasingAuthorityContainer = $('#pnl' + pnlPrefix + 'PurchasingAuthority')[0].outerHTML;    
    var pnlVisitPurposeContainer = $('#pnl' + pnlPrefix + 'VisitPurpose')[0].outerHTML;
    var pnlRegisterForContainer = $('#pnl' + pnlPrefix + 'RegisterFor')[0].outerHTML;
    var pnlMainInterestContainer = $('#pnl' + pnlPrefix + 'MainInterest')[0].outerHTML;
    var pnlHowToKnowContainer = $('#pnl' + pnlPrefix + 'HowToKnow')[0].outerHTML;
    var pnlLuckyDrawContainer = $('#pnl' + pnlPrefix + 'LuckyDraw')[0].outerHTML;

    $('#pnl' + pnlPrefix + 'BusinessProfile').remove();
    $('#pnl' + pnlPrefix + 'BusinessNature').remove();
    $('#pnl' + pnlPrefix + 'NumOfEmployer').remove();
    $('#pnl' + pnlPrefix + 'RegionSourcing').remove();
    $('#pnl' + pnlPrefix + 'JobFunction').remove();
    $('#pnl' + pnlPrefix + 'PurchasingAuthority').remove();
    $('#pnl' + pnlPrefix + 'VisitPurpose').remove();
    $('#pnl' + pnlPrefix + 'RegisterFor').remove();
    $('#pnl' + pnlPrefix + 'MainInterest').remove();
    $('#pnl' + pnlPrefix + 'HowToKnow').remove();
    $('#pnl' + pnlPrefix + 'LuckyDraw').remove();

    var pnlAddBeforeElement = $("#chkVorRegFormReceiveNewsletter").parent().parent().parent().parent().parent().parent().parent().parent(); //找到在form中位置不需要變動的節點（vor中”Subscribe to our news updates(uncheck to cancel subscription”  table )）
    var site = $(pnlAddBeforeElement[0].previousSibling);

    site.before(pnlBusinessProfileContainer);
    site.before(pnlBusinessNatureContainer);
    site.before(pnlNumOfEmployeeContainer);
    site.before(pnlRegionSourcingContainer);
    site.before(pnlJobFunctionContainer);
    site.before(pnlPurchasingAuthorityContainer);
    site.before(pnlVisitPurposeContainer);
    site.before(pnlRegisterForContainer);
    site.before(pnlMainInterestContainer);
    site.before(pnlHowToKnowContainer);
    site.before(pnlLuckyDrawContainer);

	if (language == "en") {
	    $("#tblRegFormBusinessProfile tr td:eq(0)").html("Type of Company:" + cMandStr);
		$("#tblRegFormRegisterForHeader tr td:eq(0)").html("What is the budge for your company to purchase security, fire & safety products in 2012? " + cMandStr);
		$("#tblRegFormRegionSourcing tr td:eq(0)").html("Management Level" + cMandStr);
		$("#tblRegFormLuckyDrawHeader tr td:eq(0)").html("Is this your first time to visit Secutech Thailand?" + cMandStr);

		$("#custValTxtRegFormBusinessProfile").val("Please select type of company");
		$("#custValTxtRegFormRegionSourcing").val("Please select your management level");
		$("#custValTxtRegFormLuckyDraw").val("Is this your first time to visit Secutech Thailand?");
		
		$("#tblRegFormBusinessNature input:checkbox").removeAttr("onclick");
		$("#tblRegFormBusinessNature input:checkbox:lt(11)").click(function() {
			$("#tblRegFormBusinessNature input:checkbox:gt(10)").attr("checked", false);
		});
		$("#tblRegFormBusinessNature input:checkbox:gt(10)").click(function() {
			$("#tblRegFormBusinessNature input:checkbox:lt(11)").attr("checked", false);
		});

		$("#tblRegFormBusinessProfile input:checkbox").click(function() {
		    if ($(this).attr("checked")) {
		        $("#tblRegFormBusinessProfile  input:checkbox").not(this).attr("checked", false);
		    }
		});
	}
}

function Customize941(language) {
	if (language == "zh-cn") {
		window.location = "registration_form_chi.aspx?exhibition_id=941&language=zh-hk";
	}
	Customize940(language);
}

function Customize942(language) {
	if (language == "zh-cn") {
		window.location = "registration_form_chi.aspx?exhibition_id=942&language=zh-hk";
	}
	Customize940(language);
}

function Customize943(language) {
	if (language == "zh-cn") {
		window.location = "registration_form_chi.aspx?exhibition_id=943&language=zh-hk";
	}
	Customize940(language);
}


function Customize940(language) {
	var cMandStr = " <font color=red class=compulsory>*</font>";

	if (language == "zh-cn") {
		window.location = "registration_form_chi.aspx?exhibition_id=940&language=zh-hk";
	}
	
	$(document).ready(function() {
			
		if (language == "en") {
			$("#tblRegFormBusinessProfile tr td:eq(0)").html("1. The show you want to attend (Multiple Ticks)" + cMandStr);
			$("#tblRegFormBusinessCategory tr td:eq(0)").html("2. Your business nature " + cMandStr);
			$("#tblRegFormBusinessNature tr td:eq(0)").html("3. For security industry player, is your company involved in the IT or networking Industry?  (Single Tick)" + cMandStr);
			$("#tblRegFormNumOfEmployer tr td:eq(0)").html("4. Employee number of your company (Single Tick)" + cMandStr);
			$("#tblRegFormMainInterestHeader tr td:eq(0)").html("5. Your department & management level (Single Tick) " + cMandStr);
			$("#tblJobFunctionHeader tr td:eq(0)").html("6. Your purchasing authority (Single Tick)" + cMandStr);
			$("#tblRegFormPurchasingAuthorityHeader tr td:eq(0)").html("7. Purposes of visiting Secutech (Multiple Ticks)" + cMandStr);
			$("#tblRegFormRegionSourcing tr td:eq(0)").html("8. What is the budget for your company to purchase security products in 2012? (Single Tick)" + cMandStr);
			$("#tblRegFormVisitPurposeHeader tr td:eq(0)").html("9. Products to source or survey  (Multiple Ticks)" + cMandStr);
			$("#tblRegFormHowToKnowHeader tr td:eq(0)").html("10. How many times have you visited Secutech? (Single Tick)" + cMandStr);
			$("#ltlVorRegFormPasswordDescription").html("Please set up your personal passwords for proceeding visitors' registration and receiving services further. Your password should be more than 6 digits or 6 English characters.");
			$("#ltlRegFormNewRegisterPosition").html("Job Title: " + cMandStr);
			$("#valTxtRegFormPositionNonEnglish").val("Please enter your job title in English");
			$("#ltlVisitorPositionChiFormat").html("<font color='red'>(Please fill in Department &amp; Job Title (EX: Marketing / Manager))</font>");
			$("regValTxtRegFormChinesePositionLength").val("The length of the job title cannot longer than 128 characters");

			$("#ltlRegFormVisitorContactTel").html("Tel:  <font class='compulsory'>*</font>");
			$("#ltlRegFormVisitorContactFax").html("Fax:  <font class='compulsory'>*</font>");
			$("#ltlRegFormCompanyContactAddress").html("Address: <font class='compulsory'>*</font>");
			
			$("#custValTxtRegFormBusinessProfile").val("Please answer question 1");
			$("#custValTxtRegFormBusinessCategory").val("Please answer question 2");
			$("#custValTxtRegFormBusinessNature").val("Please answer question 3");
			$("#custValTxtRegFormNumOfEmployer").val("Please answer question 4");
			$("#custValTxtRegFormMainInterest").val("Please answer question 5");
			$("#custValTxtRegFormJobFunction").val("Please answer question 6");
			$("#custValTxtRegFormPurchasingAuthority").val("Please answer question 7");
			$("#custValTxtRegFormRegionSourcing").val("Please answer question 8");
			$("#custValTxtRegFormVisitPurpose").val("Please answer question 9");
			$("#custValTxtRegFormHowToKnow").val("Please answer question 10");
			
			$("#tblRegFormBusinessCategory table tr td font:empty").parent().parent().parent().parent().parent().hide();
			$("#tblRegFormBusinessCategory table tr td font:contains('Not available for English')").each(function() {
				if ($(this).parent().parent().parent().parent().parent().html().substring(0, 6) == "<TABLE") {
					$(this).parent().parent().parent().parent().parent().hide();
				}
				else {
					$(this).parent().parent().parent().hide();
				}
			});
			
			$("#btnRegFormNext").removeAttr("onclick");
			$("#btnRegFormNext").click(function() {
				jsSubmit940En('save', language);
			});
		}

		if (language == "zh-hk") {
			$("#tblRegFormBusinessProfile tr td:eq(0)").html("1. 您同時想參觀的展覽別 （可複選）" + cMandStr);
			$("#custValTxtRegFormBusinessProfile").val("請選擇題目 1");
			$("#tblRegFormBusinessCategory tr td:eq(0)").html("2. 貴公司產業別 &amp; 營業形態 " + cMandStr);
			$("#custValTxtRegFormBusinessCategory").val("請選擇題目 2");
			$("#tblRegFormBusinessNature tr td:eq(0)").html("3. 若是「廠商通路業者」，貴公司是否近三年內由其他產業，如IT、網通產業，跨足安全監控產業？(單選)");
			$("#custValTxtRegFormBusinessNature").val("請選擇題目 3");
			$("#tblRegFormNumOfEmployer tr td:eq(0)").html("4. 貴公司 ( 單位 ) 員工人數 （單選）" + cMandStr);
			$("#custValTxtRegFormNumOfEmployer").val("請選擇題目 4");
			$("#tblRegFormMainInterestHeader tr td:eq(0)").html("5. 您主要的職務與權責（單選） " + cMandStr);
			$("#custValTxtRegFormMainInterest").val("請選擇題目 5");
			$("#tblJobFunctionHeader tr td:eq(0)").html("6. 請問您是否參與公司的產品採購決策 （單選）" + cMandStr);
			$("#custValTxtRegFormJobFunction").val("請選擇題目 6");
			$("#tblRegFormPurchasingAuthorityHeader tr td:eq(0)").html("7. 此次參觀展覽活動之目的 ? （可複選）" + cMandStr);
			$("#custValTxtRegFormPurchasingAuthority").val("請選擇題目 7");
			$("#tblRegFormRegionSourcing tr td:eq(0)").html("8. 貴公司2012年投注的安控/消防防災/工業安全/資訊安全產品採購預算 (新台幣) 約為 （單選）" + cMandStr);
			$("#custValTxtRegFormRegionSourcing").val("請選擇題目 8");
			$("#tblRegFormVisitPurposeHeader tr td:eq(0)").html("9. 預計採購產品或需求之產品資訊 （可複選）" + cMandStr);
			$("#custValTxtRegFormVisitPurpose").val("請選擇題目 9");
			$("#tblRegFormHowToKnowHeader tr td:eq(0)").html("10. 請問這是您第幾次參加 （單選）" + cMandStr);
			$("#custValTxtRegFormHowToKnow").val("請選擇題目 10");
			
			$("#ltlVorRegFormPasswordDescription").html("(請設置個人密碼，將來您可以使用該密碼登入參觀者專區，獲得各項專屬服務)");
			
			
			//$("#ltlRegFormNewRegisterEmail").html("電子信箱： <font class='compulsory'>*</font>");
			//$("#hdnErrorUserJoinedMsg").val("該電子信箱已在本系統注冊過，請使用其他的電子信箱或點擊”忘記密碼”重新獲取本系統的密碼");
			//$("#hdnCheckUsernameDefaultMsg").val("該電子信箱將作為您的用戶名");
			//$("#spnCheckEmailFeedback").html($("#hdnCheckUsernameDefaultMsg").val());
			//$("#hdnVORUserHasProfileMsg").val("該電子信箱已在本系統中註冊過，請點<a href='javascript:requestPassword();'>擊此</a>處獲取密碼後登錄");
			//$("#hdnVORUserHasProfileAlert").val("該電子信箱已在本系統中註冊過，請在畫面左方使用它來登入");
			$("#valTxtRegFormEmail").val("請輸入電子信箱");
			$("#regValTxtRegFormEmail").val("電子信箱的格式不正確");
			$("#regValTxtRegFormEmailLength").val("電子信箱的長度不得超過 128 個字符");
			
			$("#ltlRegFormNewRegisterPositionChi").html("職稱： " + cMandStr);
			$("regValTxtRegFormChinesePositionLength").val("職稱的長度不得超過 128 個字符");
			
			$("#ltlRegFormNewRegisterMobile").html("手機：");
			$("#ltlVorRegFormMobileDescription").html("（請確認您已輸入正確的手機號碼，以便展前寄發報到通知簡訊）");
			$("#regValTxtRegFormMobileCountryCodeLength").val("手機 (國家碼) 的長度不得超過 4 個字符");
			$("#custValTxtRegFormMobileNumberOnly").val("手機必須為數字");
			$("#custValTxtRegFormMobileInputAll").val("手機的國家碼和移動電話號碼都必須填寫");
			$("#regValTxtRegFormMobileLength").val("手機 (本地碼) 的長度不得超過 32 個字符");
			
			$("#ltlRegFormNewRegisterPersonalInfoSection").html("個人基本資料");
			$("#ltlCompanyInfoHeader").html("公司基本資料");
			$("#ltlRegFormCompanyName").html("公司名稱： <font class='compulsory'>*</font>");
			$("#regValTxtRegFormChineseCompanyLocalNameLength").val("公司名稱的長度不得超過 128 個字符");
			$("#valTxtRegFormChineseCompanyLocalName").val("請輸入公司名稱");
			
			$("#ltlRegFormVisitorContactTel").html("聯絡電話： <font class='compulsory'>*</font>");
			$("#valTxtRegFormTelLocalNo").val("請輸入聯絡電話 (本地碼)");
			$("#custValTxtRegFormTelNumberOnly").val("聯絡電話必須為數字");

			$("#ltlRegFormVisitorContactFax").html("傳真電話： <font class='compulsory'>*</font>");
			$("#valVorTxtRegFormFaxLocalNo").val("請輸入傳真電話 (本地碼)");
			$("#regValTxtRegFormFaxCountryCodeLength").val("傳真電話 (國家碼) 的長度不得超過 4 個字符");
			$("#regValTxtRegFormFaxAreaCodeLength").val("傳真電話 (地區碼) 的長度不得超過 4 個字符");
			$("#regValTxtRegFormFaxLocalNoLength").val("傳真電話 (本地碼) 的長度不得超過 32 個字符");
			$("#custValTxtRegFormFaxNumberOnly").val("傳真電話必須為數字");
			
			$("#ltlRegFormCompanyContactAddressZip").html("郵遞區號： <font class='compulsory'>*</font>");
			$("#custValTxtZip").val("請填寫郵遞區號 (如不適用, 請輸入NA)");
			
			$("#ltlVorRegFormNewRegisterWebsite").html("公司網址： ");
			$("#regValVorTxtRegFormWebsiteLength").val("公司網址的長度不得超過 128 個字符");
			
			//if ($(location).attr('href') == 'registration_form_chi.aspx') {
			//$("#ltlRegFormNewRegisterName").parent().parent().hide();
			$("#ltlRegFormNewRegisterPosition").parent().parent().hide();
			$("#ltlRegFormCompanyLocalNameEng").parent().parent().hide();
			$("#ltlRegFormCompanyLocalNameEngDesc").parent().parent().hide();
			//}
			
			//start ST 2012 VOR測試回覆-1  20111011.pdf
			$("#ltlVisitorPasswordFormat").html("<font color='red'>(密碼設定規則: 請輸入6個字元以上的數字或英文字母)</font>");
			$("#ltlVisitorPositionChiFormat").html("<font color='red'>(請同時填寫部門/職稱 例如:採購部/部長)</font>");
			$("#ltlVisitorMobileFormat").html("<font color='red'>(例如: 886-9XXXXXXXX)</font>");
			$("#ltlCompanyTelFormat").html("<font color='red'>(國碼/區碼/電話號碼/分機 例如:XXX-X-XXXXXXXX-XXX)</font>");
			$("#ltlCompanyFaxFormat").html("<font color='red'>(國碼/區碼/傳真號碼 例如:XXX-X-XXXXXXXX)</font>");
			$("#ltlServiceBeforeShowEmailAlert").html("開展前一周發送郵件提醒我");
			$("#ltlServiceSMS").html("開展前一周發送手機簡訊提醒我（請確保您已輸入正確的手機號碼）");
			$("#ltlServiceNewsletter").html("展會最新訊息");
			$("#ltlServiceShowPreview").html("展會預覽");
			$("#ltlServiceShowOtherInfo").html("參展商訊息");
			$("#ltlCompanyName").parent().parent().hide();
			$("#btnRegFormNext").removeAttr("onclick");
			$("#btnRegFormNext").click(function() {
				jsSubmit940ZhHK('save', language);
			});
			//end
		}

		//alert(location.pathname);
		var pathinfo = location.pathname.split("/");
		if (pathinfo[pathinfo.length-1] != "preview_form.aspx" && pathinfo[pathinfo.length-1] != "preview_form_chi.aspx") {
			FunctionUpdate_940_Q2(language);
			FunctionUpdate_940_Q5(language);
		}
	});
}

function FunctionUpdate_940_Q2(language)
{
	// allow multi selection for first section
	$("#tblRegFormBusinessCategory input:checkbox:lt(10)").removeAttr("onclick");
	$("#tblRegFormBusinessCategory input:checkbox:lt(10)").click(function() {
		$("#tblRegFormBusinessCategory input:checkbox:gt(9)").attr("checked", false);
	});
}

function FunctionUpdate_940_Q5(language)
{
	var msg = "";
	
	// limit single selection for each section in question 5
	$("#tblRegFormMainInterestHeader input:checkbox").removeAttr("onclick");
	$("#tblRegFormMainInterestHeader input:checkbox").slice(0, 10).click(function() {
		$("#tblRegFormMainInterestHeader input:checkbox").slice(0, 10).not(this).attr("checked", false);
		//this.checked = true;
	});
	
	// limit single selection for each section in question 5
	$("#tblRegFormMainInterestHeader input:checkbox").slice(10, 15).click(function() {
		$("#tblRegFormMainInterestHeader input:checkbox").slice(10, 15).not(this).attr("checked", false);
		//this.checked = true;
	});
	
	// limit single selection for each section in question 5
	$("#tblRegFormMainInterestHeader input:checkbox").slice(15, 23).click(function() {
		$("#tblRegFormMainInterestHeader input:checkbox").slice(15, 23).not(this).attr("checked", false);
		//this.checked = true;
	});
	
	// if professional is checked, alert select 5.3 section as well
	$("#tblRegFormMainInterestHeader input:checkbox").slice(13, 14).click(function() {
		if (this.checked) {
			if (language == "zh-hk") {
				msg = "請務必續勾選第5.3題";
			}
			else
			{
				msg = "Please answer question 5.3";
			}
			alert(msg);
		}
	});
}

function jsSubmit940En(task, language){
	var errMessage = ""
	var serverhost = window.location.host		
	
	if(task == "save"){
		//2011-12-12
		if(document.getElementById("txtRegFormUsername").value.length <= 3) {
			errMessage += document.getElementById("valTxtRegFormUsername").value + "\n";
		} //else if (!/^[A-Za-z0-9]*$/.test(document.getElementById("txtRegFormUsername").value)) {
			//errMessage += "Please use digitals and English only in your username\n";
		//}
		//else if(!GenericValidator.isEmail(document.getElementById("txtRegFormUsername").value)){
//			errMessage += document.getElementById("regValTxtRegFormUsername").value + "\n";
		//}
		
		if(document.getElementById("txtRegFormEmail").value.length == 0){
			errMessage += document.getElementById("valTxtRegFormEmail").value + "\n";
		}else if(!GenericValidator.isEmail(document.getElementById("txtRegFormEmail").value)){
			errMessage += document.getElementById("regValTxtRegFormEmail").value + "\n";
		}
		
		if(document.getElementById("txtRegFormPassword").value.length == 0){
			errMessage += document.getElementById("valTxtRegFormPassword").value + "\n";
		}else if(document.getElementById("txtRegFormPassword").value.length > 10){
			errMessage += document.getElementById("regValTxtRegFormPasswordLength").value + "\n";
		}

        if (document.getElementById("txtRegFormPromotionCode") != null)
        {
            if(document.getElementById("txtRegFormPromotionCode").value.length > 0){
			    //errMessage += document.getElementById("valTxtRegFormPromotionCode").value + "\n";
			    errMessage += checkPromotionInput();
		    }
		}

		if(!checkPrefix()){
			errMessage += document.getElementById("custValDdlRegFormPrefix").value + "\n";
		}

		
		if(!checkName()){
			errMessage += document.getElementById("custValTxtName").value +"\n"
		}else if(document.getElementById("txtRegFormGivenName").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormGivenNameLength").value + "\n";
		}else if(document.getElementById("txtRegFormMiddleName").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormMiddleNameLength").value + "\n";
		}else if(document.getElementById("txtRegFormFamilyName").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormFamilyNameLength").value + "\n";
		}else if ((checkEnglishInput(document.getElementById("txtRegFormGivenName").value) && checkEnglishInput(document.getElementById("txtRegFormMiddleName").value) && checkEnglishInput(document.getElementById("txtRegFormFamilyName").value)) == false){
			errMessage += document.getElementById("valTxtRegFormNameNonEnglish").value + "\n";
		}

		if(GenericValidator.isBlankOrNull(document.getElementById("txtRegFormPosition").value)){
			errMessage += "Please enter your job title\n";
		} else if(document.getElementById("txtRegFormPosition").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormPositionLength").value + "\n";
		}else if (checkEnglishInput(document.getElementById("txtRegFormPosition").value) == false){
			errMessage += document.getElementById("valTxtRegFormPositionNonEnglish").value + "\n";
		}
		
		if(document.getElementById("txtRegFormMobileCountryCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormMobileCountryCodeLength").value + "\n";
		}

		if(!checkComplusoryMobile()){
			errMessage += document.getElementById("custValTxtRegFormMobileInputAll").value + "\n";
		}
		
		if(!checkMobile()){
			errMessage += document.getElementById("custValTxtRegFormMobileNumberOnly").value + "\n";
		}
		
		if(!checkMobileInputAll()){
			errMessage += document.getElementById("custValTxtRegFormMobileInputAll").value + "\n";
		}
		
		if(document.getElementById("txtRegFormMobile").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormMobileLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyLocalName").value.length == 0){
			errMessage += document.getElementById("valTxtRegFormCompanyLocalName").value + "\n";
		}else if(document.getElementById("txtRegFormCompanyLocalName").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyLocalNameLength").value + "\n";
		}else if (checkEnglishInput(document.getElementById("txtRegFormCompanyLocalName").value) == false){
			errMessage += document.getElementById("valTxtRegFormCompanyNonEnglish").value + "\n";
		}
		
		if(!checkAddress()){
			errMessage += document.getElementById("custValTxtContactAddress").value + "\n";
		}

		if (serverhost != "crm-ae1.messefrankfurt.com")		
		{
			if(document.getElementById("txtRegFormCompanyAddressZip").value.length == 0){
				errMessage += document.getElementById("custValTxtZip").value + "\n";
			}
		}
		if (serverhost == "crm-ae1.messefrankfurt.com")		
		{
			if(document.getElementById("txtRegFormCompanyAddressCity").value.length == 0){
				errMessage += document.getElementById("custValTxtCity").value + "\n";
			}
		}
		
		if(document.getElementById("txtRegFormCompanyAddressRoom").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressRoomLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressFloor").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressFloorLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressBuilding").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressBuildingLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressRoad").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressRoadLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressDistrict").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressDistrictLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressCity").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressCityLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressZip").value.length > 16){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressZipLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressStateAndProvince").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressStateAndProvinceLength").value + "\n";
		}
		
		if(!checkCountry()){
			errMessage += document.getElementById("custValDdlRegFormCompanyAddressCountry").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelCountryCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormTelCountryCodeLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelAreaCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormTelAreaCodeLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelLocalNo").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormTelLocalNoLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelExt").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormTelExtLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelLocalNo").value.length == 0){
			errMessage += document.getElementById("valTxtRegFormTelLocalNo").value + "\n";
		}
		
		if(document.getElementById("txtRegFormFaxLocalNo").value.length == 0){
			errMessage += document.getElementById("valVorTxtRegFormFaxLocalNo").value + "\n";
		}
		
		if(document.getElementById("txtRegFormFaxCountryCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormFaxCountryCodeLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormFaxAreaCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormFaxAreaCodeLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormFaxLocalNo").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormFaxLocalNoLength").value + "\n";
		}
		
		if(document.getElementById("txtVorRegFormWebsite").value.length > 128){
			errMessage += document.getElementById("regValVorTxtRegFormWebsiteLength").value + "\n";
		}
		
		if(!checkTel()){
			errMessage += document.getElementById("custValTxtRegFormTelNumberOnly").value + "\n";
		}
		
		if(!checkFax()){
			errMessage += document.getElementById("custValTxtRegFormFaxNumberOnly").value + "\n";
		}
		
		if(document.getElementById("hdnCustValTxtRegFormBusinessProfile").value == "Y"){
			if(!checkBusinessProfile()){
				errMessage += document.getElementById("custValTxtRegFormBusinessProfile").value + "\n";
			}
		}


		if(document.getElementById("hdnCustValTxtRegFormBusinessCategory").value == "Y"){
			if(!checkBusinessCategory()){
				errMessage += document.getElementById("custValTxtRegFormBusinessCategory").value + "\n";
			}
		}

		
		if(document.getElementById("hdnCustValTxtRegFormBusinessNature").value == "Y"){
			for (var iBusinessCategory = 0; iBusinessCategory < 10; iBusinessCategory++) {
				if ($("#tblRegFormBusinessCategory input:checkbox")[iBusinessCategory].checked) {
					if(!checkBusinessNature()){
						errMessage += document.getElementById("custValTxtRegFormBusinessNature").value + "\n";
						break;
					}
				}
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormNumOfEmployer").value == "Y"){
			if(!checkNumOfEmployer()){
				errMessage += document.getElementById("custValTxtRegFormNumOfEmployer").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormMainInterest").value == "Y"){
			if(!checkMainInterest()){
				errMessage += document.getElementById("custValTxtRegFormMainInterest").value + "\n";
			} else {
			
				var miPass = false;
				
				for (var iMainInterest = 0; iMainInterest < 10; iMainInterest++) {
					if ($("#tblRegFormMainInterestHeader input:checkbox")[iMainInterest].checked) {
						miPass = true;
						break;
					}
				}

				if (!miPass) {
					if (language == "zh-hk") {
						errMessage += "請選擇題目第5.1題\n";
					} else {
						errMessage += "Please answer question 5.1\n";
					}
				}
				
				
				miPass = false;
				for (var iMainInterest = 10; iMainInterest < 15; iMainInterest++) {
					if ($("#tblRegFormMainInterestHeader input:checkbox")[iMainInterest].checked) {
						miPass = true;
						break;
					}
				}
				if (!miPass) {
					if (language == "zh-hk") {
						errMessage += "請選擇題目第5.2題\n";
					} else {
						errMessage += "Please answer question 5.2\n";
					}
				}			
				
				miPass = false;
				if ($("#tblRegFormMainInterestHeader input:checkbox").slice(13).attr("checked"))
				{
					for (var iMainInterest = 15; iMainInterest < 23; iMainInterest++) {
						if ($("#tblRegFormMainInterestHeader input:checkbox")[iMainInterest].checked) {
							miPass = true;
							break;
						}
					}
					if (!miPass) {
						if (language == "zh-hk") {
							errMessage += "請選擇題目第5.3題\n";
						} else {
							errMessage += "Please answer question 5.3\n";
						}
					}
				}
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormJobFunction").value == "Y"){
			if(!checkJobFunction()){
				errMessage += document.getElementById("custValTxtRegFormJobFunction").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormPurchasingAuthority").value == "Y"){
			if(!checkPurchasingAuthority()){
				errMessage += document.getElementById("custValTxtRegFormPurchasingAuthority").value + "\n";
			}
		}

		if(document.getElementById("hdnCustValTxtRegFormRegionSourcing").value == "Y"){
			if(!checkRegionSourcing()){
				errMessage += document.getElementById("custValTxtRegFormRegionSourcing").value + "\n";
			}
		}
		

		
		if(document.getElementById("hdnCustValTxtRegFormVisitPurpose").value == "Y"){
			if(!checkVisitPurpose()){
				errMessage += document.getElementById("custValTxtRegFormVisitPurpose").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormHowToKnow").value == "Y"){
			if(!checkHowToKnow()){
				errMessage += document.getElementById("custValTxtRegFormHowToKnow").value + "\n";
			}
		}

		if(document.getElementById("hdnCustValTxtRegFormLuckyDraw").value == "Y"){
			if(!checkLuckyDraw()){
				errMessage += document.getElementById("custValTxtRegFormLuckyDraw").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormTermsAndCondition").value == "Y"){
			if(!checkTermsAndCondition()){
				errMessage += document.getElementById("custValTxtRegFormTermsAndCondition").value + "\n";
			}
		}
	
	// newly added checking to user must provide both username and password
	} else if (task == "logon") {
		if (GenericValidator.isBlankOrNull(document.getElementById("txtVisitorUsername").value) || GenericValidator.isBlankOrNull(document.getElementById("txtVisitorPassword").value)) {
			return false;
		}
	}
	
	if(errMessage != ""){
		alert(errMessage)
		return false;
	}else{
		document.getElementById("hdnTask").value = task;
		if(task == "save"){
			//save
			document.frm.submit();
		}else{
			//logon
			document.frm.submit();
		}
		return true;
	}
}

function jsSubmit940ZhHK(task, language)
{
	var errMessage = ""
	var serverhost = window.location.host		
	
	if(task == "save"){
		//2011-12-12
		if(document.getElementById("txtRegFormUsername").value.length <= 3){
			errMessage += document.getElementById("valTxtRegFormUsername").value + "\n";
		} //else if (!/^[A-Za-z0-9]*$/.test(document.getElementById("txtRegFormUsername").value)) {
			//errMessage += "請只使用數字及英文來組成您的登入帳號\n";
		//}
		
		//else if(!GenericValidator.isEmail(document.getElementById("txtRegFormUsername").value)){
//			errMesseage += document.getElementById("regValTxtRegFormUsername").value + "\n";
	//	}
		
		if(document.getElementById("txtRegFormEmail").value.length == 0){
			errMessage += document.getElementById("valTxtRegFormEmail").value + "\n";
		}else if(!GenericValidator.isEmail(document.getElementById("txtRegFormEmail").value)){
			errMessage += document.getElementById("regValTxtRegFormEmail").value + "\n";
		}
		
		if(document.getElementById("txtRegFormPassword").value.length == 0){
			errMessage += document.getElementById("valTxtRegFormPassword").value + "\n";
		}else if(document.getElementById("txtRegFormPassword").value.length > 10){
			errMessage += document.getElementById("regValTxtRegFormPasswordLength").value + "\n";
		}

		if(!checkPrefix()){
			errMessage += document.getElementById("custValDdlRegFormPrefix").value + "\n";
		}
		
		if(!checkChineseName()){
			errMessage += document.getElementById("custValTxtChineseName").value +"\n"
		}else if(document.getElementById("txtRegFormChineseName").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormChineseNameLength").value + "\n";
		} 
		
		if(!checkEnglishName()){
			errMessage += document.getElementById("custValTxtName").value +"\n"
		}else if(document.getElementById("txtRegFormGivenName").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormGivenNameLength").value + "\n";
		}else if (checkEnglishInput(document.getElementById("txtRegFormGivenName").value) == false){
			errMessage += document.getElementById("valTxtRegFormNameNonEnglish").value + "\n";
		}
		
		if(document.getElementById("txtRegFormChinesePosition").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormChinesePositionLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormPosition").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormPositionLength").value + "\n";
		}else if (checkEnglishInput(document.getElementById("txtRegFormPosition").value) == false){
			errMessage += document.getElementById("valTxtRegFormPositionNonEnglish").value + "\n";
		}
		
		if (GenericValidator.isBlankOrNull($("#txtRegFormChinesePosition").val())) {
			if (language == "zh-hk") {
				errMessage += "請輸入職稱\n";
			}
			else {
				errMessage += "Please enter your job title\n";
			}
		}
		
		if(document.getElementById("txtRegFormMobileCountryCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormMobileCountryCodeLength").value + "\n";
		}

		if(!checkComplusoryMobile()){
			errMessage += document.getElementById("custValTxtRegFormMobileInputAll").value + "\n";
		}
	
		
		if(!checkMobile()){
			errMessage += document.getElementById("custValTxtRegFormMobileNumberOnly").value + "\n";
		}
		
		if(!checkMobileInputAll()){
			errMessage += document.getElementById("custValTxtRegFormMobileInputAll").value + "\n";
		}
		
		if(document.getElementById("txtRegFormMobile").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormMobileLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormChineseCompanyLocalName").value.length == 0){
			errMessage += document.getElementById("valTxtRegFormChineseCompanyLocalName").value + "\n";
		}else if(document.getElementById("txtRegFormChineseCompanyLocalName").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormChineseCompanyLocalNameLength").value + "\n";
		}
		
		if(!checkEnglishCompanyName()){
			errMessage += document.getElementById("valTxtRegFormCompanyLocalName").value + "\n";
		}else if(document.getElementById("txtRegFormCompanyLocalName").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyLocalNameLength").value + "\n";
		}else if (checkEnglishInput(document.getElementById("txtRegFormCompanyLocalName").value) == false){
			errMessage += document.getElementById("valTxtRegFormCompanyNonEnglish").value + "\n";
		}
		
		if(!checkAddress()){
			errMessage += document.getElementById("custValTxtContactAddress").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressZip").value.length == 0){
			errMessage += document.getElementById("custValTxtZip").value + "\n";
		}
		if(document.getElementById("txtRegFormCompanyAddressRoom").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressRoomLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressFloor").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressFloorLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressBuilding").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressBuildingLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressRoad").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressRoadLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressDistrict").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressDistrictLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressCity").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressCityLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressZip").value.length > 16){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressZipLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressStateAndProvince").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressStateAndProvinceLength").value + "\n";
		}
		
		if(!checkCountry()){
			errMessage += document.getElementById("custValDdlRegFormCompanyAddressCountry").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelCountryCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormTelCountryCodeLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelAreaCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormTelAreaCodeLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelLocalNo").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormTelLocalNoLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelExt").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormTelExtLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelLocalNo").value.length == 0){
			errMessage += document.getElementById("valTxtRegFormTelLocalNo").value + "\n";
		}
		
		if(document.getElementById("txtRegFormFaxLocalNo").value.length == 0){
			errMessage += document.getElementById("valVorTxtRegFormFaxLocalNo").value + "\n";
		}
		
		if(document.getElementById("txtRegFormFaxCountryCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormFaxCountryCodeLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormFaxAreaCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormFaxAreaCodeLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormFaxLocalNo").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormFaxLocalNoLength").value + "\n";
		}
		
		if(document.getElementById("txtVorRegFormWebsite").value.length > 128){
			errMessage += document.getElementById("regValVorTxtRegFormWebsiteLength").value + "\n";
		}
		
		if(!checkTel()){
			errMessage += document.getElementById("custValTxtRegFormTelNumberOnly").value + "\n";
		}
		
		if(!checkFax()){
			errMessage += document.getElementById("custValTxtRegFormFaxNumberOnly").value + "\n";
		}
		
		if(document.getElementById("hdnCustValTxtRegFormBusinessProfile").value == "Y"){
			if(!checkBusinessProfile()){
				errMessage += document.getElementById("custValTxtRegFormBusinessProfile").value + "\n";
			}
		}

		if(document.getElementById("hdnCustValTxtRegFormBusinessCategory").value == "Y"){
			if(!checkBusinessCategory()){
				errMessage += document.getElementById("custValTxtRegFormBusinessCategory").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormBusinessNature").value == "Y"){
			for (var iBusinessCategory = 0; iBusinessCategory < 10; iBusinessCategory++) {
				if ($("#tblRegFormBusinessCategory input:checkbox")[iBusinessCategory].checked) {
					if(!checkBusinessNature()){
						errMessage += document.getElementById("custValTxtRegFormBusinessNature").value + "\n";
						break;
					}
				}
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormNumOfEmployer").value == "Y"){
			if(!checkNumOfEmployer()){
				errMessage += document.getElementById("custValTxtRegFormNumOfEmployer").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormMainInterest").value == "Y"){
			if(!checkMainInterest()){
				errMessage += document.getElementById("custValTxtRegFormMainInterest").value + "\n";
			}
			else
			{
				var miPass = false;
				
				for (var iMainInterest = 0; iMainInterest < 10; iMainInterest++) {
					if ($("#tblRegFormMainInterestHeader input:checkbox")[iMainInterest].checked) {
						miPass = true;
						break;
					}
				}

				if (!miPass) {
					if (language == "zh-hk") {
						errMessage += "請選擇題目第5.1題\n";
					} else {
						errMessage += "Please answer question 5.1\n";
					}
				}
				
				
				miPass = false;
				for (var iMainInterest = 10; iMainInterest < 15; iMainInterest++) {
					if ($("#tblRegFormMainInterestHeader input:checkbox")[iMainInterest].checked) {
						miPass = true;
						break;
					}
				}
				if (!miPass) {
					if (language == "zh-hk") {
						errMessage += "請選擇題目第5.2題\n";
					} else {
						errMessage += "Please answer question 5.2\n";
					}
				}			
				
				miPass = false;
				if ($("#tblRegFormMainInterestHeader input:checkbox").slice(13).attr("checked"))
				{
					for (var iMainInterest = 15; iMainInterest < 23; iMainInterest++) {
						if ($("#tblRegFormMainInterestHeader input:checkbox")[iMainInterest].checked) {
							miPass = true;
							break;
						}
					}
					if (!miPass) {
						if (language == "zh-hk") {
							errMessage += "請選擇題目第5.3題\n";
						} else {
							errMessage += "Please answer question 5.3";
						}
					}
				}
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormJobFunction").value == "Y"){
			if(!checkJobFunction()){
				errMessage += document.getElementById("custValTxtRegFormJobFunction").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormPurchasingAuthority").value == "Y"){
			if(!checkPurchasingAuthority()){
				errMessage += document.getElementById("custValTxtRegFormPurchasingAuthority").value + "\n";
			}
		}


		if(document.getElementById("hdnCustValTxtRegFormRegionSourcing").value == "Y"){
			if(!checkRegionSourcing()){
				errMessage += document.getElementById("custValTxtRegFormRegionSourcing").value + "\n";
			}
		}

		
		if(document.getElementById("hdnCustValTxtRegFormVisitPurpose").value == "Y"){
			if(!checkVisitPurpose()){
				errMessage += document.getElementById("custValTxtRegFormVisitPurpose").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormHowToKnow").value == "Y"){
			if(!checkHowToKnow()){
				errMessage += document.getElementById("custValTxtRegFormHowToKnow").value + "\n";
			}
		}

		if(document.getElementById("hdnCustValTxtRegFormLuckyDraw").value == "Y"){
			if(!checkLuckyDraw()){
				errMessage += document.getElementById("custValTxtRegFormLuckyDraw").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormTermsAndCondition").value == "Y"){
			if(!checkTermsAndCondition()){
				errMessage += document.getElementById("custValTxtRegFormTermsAndCondition").value + "\n";
			}
		}

	// newly added checking to user must provide both username and password
	} else if (task == "logon") {
		if (GenericValidator.isBlankOrNull(document.getElementById("txtVisitorUsername").value) || GenericValidator.isBlankOrNull(document.getElementById("txtVisitorPassword").value)) {
			return false;
		}
	}
	
	if(errMessage != ""){
		alert(errMessage)
		return false;
	}else{
		document.getElementById("hdnTask").value = task;
		if(task == "save"){
			//save
			document.frm.submit();
		}else{
			//logon
			document.frm.submit();
		}
		return true;
	}
}

/* For Intersec China Main Area of Interest */
function Customize419(language) {	
	var x,y;

	if (language == "en") {
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong>1 Security</strong>"

		x = document.getElementById("datListMainInterests").insertRow(6);
		y = x.insertCell(0);
		y.innerHTML = "<strong>2 Natural Disasters</strong>"

		x = document.getElementById("datListMainInterests").insertRow(10);
		y = x.insertCell(0);
		y.innerHTML = "<strong>3 National Security</strong>"

		x = document.getElementById("datListMainInterests").insertRow(15);
		y = x.insertCell(0);
		y.innerHTML = "<strong>4 Public Safety</strong>"

		x = document.getElementById("datListMainInterests").insertRow(20);
		y = x.insertCell(0);
		y.innerHTML = "<strong>5 Information Technology Security</strong>"

		x = document.getElementById("datListMainInterests").insertRow(23);
		y = x.insertCell(0);
		y.innerHTML = "<strong>6 Occupational and Personal Safety</strong>"

		x = document.getElementById("datListMainInterests").insertRow(26);
		y = x.insertCell(0);
		y.innerHTML = "<strong>7 Home & Building Automation</strong>"

		x = document.getElementById("datListMainInterests").insertRow(28);
		y = x.insertCell(0);
		y.innerHTML = "<strong>8 Others</strong>"
	}


	if (language == "zh-hk") {
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong>1 安防</strong>"

		x = document.getElementById("datListMainInterests").insertRow(6);
		y = x.insertCell(0);
		y.innerHTML = "<strong>2 自然災難</strong>"

		x = document.getElementById("datListMainInterests").insertRow(10);
		y = x.insertCell(0);
		y.innerHTML = "<strong>3 國家安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(15);
		y = x.insertCell(0);
		y.innerHTML = "<strong>4 城市公共安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(20);
		y = x.insertCell(0);
		y.innerHTML = "<strong>5 信息技術安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(23);
		y = x.insertCell(0);
		y.innerHTML = "<strong>6 職業及個人防護</strong>"

		x = document.getElementById("datListMainInterests").insertRow(26);
		y = x.insertCell(0);
		y.innerHTML = "<strong>7 智能家居及樓宇自動化</strong>"

		x = document.getElementById("datListMainInterests").insertRow(28);
		y = x.insertCell(0);
		y.innerHTML = "<strong>8 其他</strong>"
	}


	if (language == "zh-cn") {
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong>1 安防</strong>"

		x = document.getElementById("datListMainInterests").insertRow(6);
		y = x.insertCell(0);
		y.innerHTML = "<strong>2 自然灾难</strong>"

		x = document.getElementById("datListMainInterests").insertRow(10);
		y = x.insertCell(0);
		y.innerHTML = "<strong>3 国家安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(15);
		y = x.insertCell(0);
		y.innerHTML = "<strong>4 城市公共安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(20);
		y = x.insertCell(0);
		y.innerHTML = "<strong>5 信息技术安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(23);
		y = x.insertCell(0);
		y.innerHTML = "<strong>6 职业及个人防护</strong>"

		x = document.getElementById("datListMainInterests").insertRow(26);
		y = x.insertCell(0);
		y.innerHTML = "<strong>7 智能家居及楼宇自动化</strong>"

		x = document.getElementById("datListMainInterests").insertRow(28);
		y = x.insertCell(0);
		y.innerHTML = "<strong>8 其他</strong>"
	}


}

function Customize394(language) {


	var x,y;

	if (language == "en") {
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong>1 Security</strong>"

		x = document.getElementById("datListMainInterests").insertRow(6);
		y = x.insertCell(0);
		y.innerHTML = "<strong>2 Natural Disasters</strong>"

		x = document.getElementById("datListMainInterests").insertRow(10);
		y = x.insertCell(0);
		y.innerHTML = "<strong>3 National Security</strong>"

		x = document.getElementById("datListMainInterests").insertRow(15);
		y = x.insertCell(0);
		y.innerHTML = "<strong>4 Public Safety</strong>"

		x = document.getElementById("datListMainInterests").insertRow(20);
		y = x.insertCell(0);
		y.innerHTML = "<strong>5 Information Technology Security</strong>"

		x = document.getElementById("datListMainInterests").insertRow(23);
		y = x.insertCell(0);
		y.innerHTML = "<strong>6 Occupational and Personal Safety</strong>"

		x = document.getElementById("datListMainInterests").insertRow(26);
		y = x.insertCell(0);
		y.innerHTML = "<strong>7 Others</strong>"
	}


	if (language == "zh-hk") {
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong>1 安防</strong>"

		x = document.getElementById("datListMainInterests").insertRow(6);
		y = x.insertCell(0);
		y.innerHTML = "<strong>2 自然災難</strong>"

		x = document.getElementById("datListMainInterests").insertRow(10);
		y = x.insertCell(0);
		y.innerHTML = "<strong>3 國家安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(15);
		y = x.insertCell(0);
		y.innerHTML = "<strong>4 城市公共安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(20);
		y = x.insertCell(0);
		y.innerHTML = "<strong>5 信息技術安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(23);
		y = x.insertCell(0);
		y.innerHTML = "<strong>6 職業及個人防護</strong>"

		x = document.getElementById("datListMainInterests").insertRow(26);
		y = x.insertCell(0);
		y.innerHTML = "<strong>7 其他</strong>"
	}


	if (language == "zh-cn") {
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong>1 安防</strong>"

		x = document.getElementById("datListMainInterests").insertRow(6);
		y = x.insertCell(0);
		y.innerHTML = "<strong>2 自然灾难</strong>"

		x = document.getElementById("datListMainInterests").insertRow(10);
		y = x.insertCell(0);
		y.innerHTML = "<strong>3 国家安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(15);
		y = x.insertCell(0);
		y.innerHTML = "<strong>4 城市公共安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(20);
		y = x.insertCell(0);
		y.innerHTML = "<strong>5 信息技术安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(23);
		y = x.insertCell(0);
		y.innerHTML = "<strong>6 职业及个人防护</strong>"

		x = document.getElementById("datListMainInterests").insertRow(26);
		y = x.insertCell(0);
		y.innerHTML = "<strong>7 其他</strong>"
	}

}


function Customize448(language) {
	var x,y;

	if (language == "en") {
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong><font color=\"ffbb00\">Guangzhou International Lighting Exhibition</font></strong>"
		x = document.getElementById("datListMainInterests").insertRow(6);
		y = x.insertCell(0);
		y.innerHTML = "<strong><font color=\"2a85cc\">Electrical Building Technology Guangzhou</font></strong>"
		x = document.getElementById("datListMainInterests").insertRow(7);
		y = x.insertCell(0);
		y.innerHTML = "<i>Electrical engineering</i>"
		x = document.getElementById("datListMainInterests").insertRow(10);
		y = x.insertCell(0);
		y.innerHTML = "<i>Intelligent building and building automation</i>"
		x = document.getElementById("datListMainInterests").insertRow(14);
		y = x.insertCell(0);
		y.innerHTML = "<i>Others</i>"
	}

	if (language == "zh-cn") {
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"ffbb00\">广州国际照明展览会</font></strong>"
			
		x = document.getElementById("datListMainInterests").insertRow(6);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"2a85cc\">广州国际建筑电气技术展览会</font></strong>"
			
		x = document.getElementById("datListMainInterests").insertRow(7);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>建筑电工电气</i>"
			
		x = document.getElementById("datListMainInterests").insertRow(10);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>智能建筑、楼宇自动化设备</i>"
			
		x = document.getElementById("datListMainInterests").insertRow(14);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>其它</i>"
			
	}


	if(language == "zh-hk") {
		x = document.getElementById("datListMainInterests").insertRow(0);

		y = x.insertCell(0);

		y.innerHTML = "<strong><font color=\"ffbb00\">廣州國際照明展覽會</font></strong>";

		x = document.getElementById("datListMainInterests").insertRow(6);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"2a85cc\">廣州國際建築電氣技術展覽會</font></strong>";
			
		x = document.getElementById("datListMainInterests").insertRow(7);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>建築電工電氣</i>";
			
		x = document.getElementById("datListMainInterests").insertRow(10);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>智能建築、樓宇自動化設備</i>";
			
		x = document.getElementById("datListMainInterests").insertRow(14);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>其他</i>";
			
	}

}



function Customize483(language) {

	var x,y;

	if (language == "en") {
			
			
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong><font color=\"2a85cc\">Electrical Building Technology Guangzhou</font></strong>";
		x = document.getElementById("datListMainInterests").insertRow(1);
		y = x.insertCell(0);
		y.innerHTML = "<i>Electrical engineering</i>";
		x = document.getElementById("datListMainInterests").insertRow(4);
		y = x.insertCell(0);
		y.innerHTML = "<i>Intelligent building and building automation</i>";
		x = document.getElementById("datListMainInterests").insertRow(8);
		y = x.insertCell(0);
		y.innerHTML = "<i>Others</i>";
		x = document.getElementById("datListMainInterests").insertRow(10);
		y = x.insertCell(0);
		y.innerHTML = "<strong><font color=\"ffbb00\">Guangzhou International Lighting Exhibition</font></strong>";
	}

	if (language == "zh-cn") {
			
			
		x = document.getElementById("datListMainInterests").insertRow(0);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"2a85cc\">广州国际建筑电气技术展览会</font></strong>";
			
		x = document.getElementById("datListMainInterests").insertRow(1);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>建筑电工电气</i>";
			
		x = document.getElementById("datListMainInterests").insertRow(4);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>智能建筑、楼宇自动化设备</i>";
			
		x = document.getElementById("datListMainInterests").insertRow(8);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>其它</i>";
			
		x = document.getElementById("datListMainInterests").insertRow(10);
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"ffbb00\">广州国际照明展览会</font></strong>";
			
	}
			
			

	if(language == "zh-hk") {
		x = document.getElementById("datListMainInterests").insertRow(0);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"2a85cc\">廣州國際建築電氣技術展覽會</font></strong>";
			
		x = document.getElementById("datListMainInterests").insertRow(1);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>建築電工電氣</i>";
		x = document.getElementById("datListMainInterests").insertRow(4);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>智能建築、樓宇自動化設備</i>";
		x = document.getElementById("datListMainInterests").insertRow(8);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>其他</i>";
		x = document.getElementById("datListMainInterests").insertRow(10);
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"ffbb00\">廣州國際照明展覽會</font></strong>";
	}

}







function Customize429(language) {
	var x,y;

	if (language == "en") {
		x = document.getElementById("tblRegFormMainInterestHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "Product interest&nbsp;:<font class='compulsory'>*</font>";	

		x = document.getElementById("tblRegFormPurchasingAuthorityHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "Main area of interest - by product end-use&nbsp;:<font class='compulsory'>*</font>";		
	}

	if (language == "zh-cn") {
		x = document.getElementById("tblRegFormMainInterestHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "有兴趣产品&nbsp;:<font class='compulsory'>*</font>";	

		x = document.getElementById("tblRegFormPurchasingAuthorityHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "感兴趣的产品 - 按最终用途选择&nbsp;:<font class='compulsory'>*</font>";				
	}


	if(language == "zh-hk") {
		x = document.getElementById("tblRegFormMainInterestHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "有興趣產品&nbsp;:<font class='compulsory'>*</font>";	

		x = document.getElementById("tblRegFormPurchasingAuthorityHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "感興趣的產品 - 按最終用途選擇&nbsp;:<font class='compulsory'>*</font>";			
	}

}



function Customize532(language) {
	var x,y;

	if (language == "en") {
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong>Dining:</strong>";

		x = document.getElementById("datListMainInterests").insertRow(6);
		y = x.insertCell(0);
		y.innerHTML = "<strong>Giving:</strong>";

		x = document.getElementById("datListMainInterests").insertRow(11);
		y = x.insertCell(0);
		y.innerHTML = "<strong>Living:</strong>";

	}

	if (language == "zh-cn") {
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong>餐具厨具类:</strong>";

		x = document.getElementById("datListMainInterests").insertRow(6);
		y = x.insertCell(0);
		y.innerHTML = "<strong>礼品摆设类:</strong>";

		x = document.getElementById("datListMainInterests").insertRow(11);
		y = x.insertCell(0);
		y.innerHTML = "<strong>居家艺术类:</strong>";


	}


	if(language == "zh-hk") {
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong>餐具廚具類:</strong>";

		x = document.getElementById("datListMainInterests").insertRow(6);
		y = x.insertCell(0);
		y.innerHTML = "<strong>禮品擺設類:</strong>";

		x = document.getElementById("datListMainInterests").insertRow(11);
		y = x.insertCell(0);
		y.innerHTML = "<strong>居家藝術類:</strong>";
	}

}



function Customize520(language) {
	var x,y;

	if (language == "en") {
		x = document.getElementById("tblJobFunctionHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "Main area of interest (by product end-use)&nbsp;:<font class='compulsory'>*</font>";		
	}

	if (language == "zh-cn") {

		x = document.getElementById("tblJobFunctionHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "感兴趣的产品(按最终用途选择)&nbsp;:<font class='compulsory'>*</font>";				
	}


	if(language == "zh-hk") {

		x = document.getElementById("tblJobFunctionHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "感興趣的產品(按最終用途選擇)&nbsp;:<font class='compulsory'>*</font>";			
	}

}


function Customize541(language) {
	var x,y;

	if (language == "en") {
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong>01 Fibres</strong>";
		
		x = document.getElementById("datListMainInterests").insertRow(1);
		y = x.insertCell(0);
		y.innerHTML = "<strong>1.1 Natural Fibres</strong>";
		
		x = document.getElementById("datListMainInterests").insertRow(5);
		y = x.insertCell(0);
		y.innerHTML = "<strong>1.2 Man-made Fibres</strong>";
		
		x = document.getElementById("datListMainInterests").insertRow(8);
		y = x.insertCell(0);
		y.innerHTML = "<br /><strong>02 Yarns</strong>";
		
		x = document.getElementById("datListMainInterests").insertRow(9);
		y = x.insertCell(0);
		y.innerHTML = "<strong>2.1 Natural & blends yarns</strong>";
		
		x = document.getElementById("datListMainInterests").insertRow(13);
		y = x.insertCell(0);
		y.innerHTML = "<strong>2.2 Man-made & blends yarns</strong>";

	}

	if (language == "zh-cn") {
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong>01 纤维类</strong>";
		
		x = document.getElementById("datListMainInterests").insertRow(1);
		y = x.insertCell(0);
		y.innerHTML = "<strong>1.1 天然纤维</strong>";
		
		x = document.getElementById("datListMainInterests").insertRow(5);
		y = x.insertCell(0);
		y.innerHTML = "<strong>1.2 人造纤维</strong>";
		
		x = document.getElementById("datListMainInterests").insertRow(8);
		y = x.insertCell(0);
		y.innerHTML = "<br /><strong>02 纱线类</strong>";
		
		x = document.getElementById("datListMainInterests").insertRow(9);
		y = x.insertCell(0);
		y.innerHTML = "<strong>2.1 天然及混纺纱线</strong>";
		
		x = document.getElementById("datListMainInterests").insertRow(13);
		y = x.insertCell(0);
		y.innerHTML = "<strong>2.2 人造及混纺纱线</strong>";
			
	}


	if(language == "zh-hk") {
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong>01 纖維類</strong>";
		
		x = document.getElementById("datListMainInterests").insertRow(1);
		y = x.insertCell(0);
		y.innerHTML = "<strong>1.1 天然纖維</strong>";
		
		x = document.getElementById("datListMainInterests").insertRow(5);
		y = x.insertCell(0);
		y.innerHTML = "<strong>1.2 人造纖維</strong>";
		
		x = document.getElementById("datListMainInterests").insertRow(8);
		y = x.insertCell(0);
		y.innerHTML = "<br /><strong>02 紗線類</strong>";
		
		x = document.getElementById("datListMainInterests").insertRow(9);
		y = x.insertCell(0);
		y.innerHTML = "<strong>2.1 天然及混紡紗線</strong>";
		
		x = document.getElementById("datListMainInterests").insertRow(13);
		y = x.insertCell(0);
		y.innerHTML = "<strong>2.2 人造及混紡紗線</strong>";
			
	}

}



function Customize408(language) {
	var x,y;
		
	if (language == "en") {
		try {

		x = document.getElementById("tblRegFormPurchasingAuthorityHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "Main area of interest (by product end-use)&nbsp;:<font class='compulsory'>*</font>";	

		x = document.getElementById("tblRegFormRegisterForHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "Free shuttle bus service:";	
		
		x = document.getElementById("tblRegFormRegisterForHeader").insertRow(2);
		y = x.insertCell(0);
		y.innerHTML = "I would like to apply for the <blink>free shuttle bus service</blink> for";
		



		x = document.getElementById("tblRegFormRegisterForHeader").insertRow(4);
		y = x.insertCell(0);
//		y.innerHTML = "Organiser will contact you for final confirmation.  Only buyers pre-register online before 31 Aug 2009 are entitled to enjoy this service.";
		y.innerHTML = "<font color=#666666>The deadline of Free Shuttle Bus Service had already passed on 31 Aug 2009.</font>";
 		
		x = document.getElementById("ltlRegFormExhibitionDescription1");
		x.innerHTML = "The Home of Cutting-Edge Textiles";


		} catch(err) {
		}
		
	}

	if (language == "zh-cn") {

		try {

		x = document.getElementById("tblRegFormPurchasingAuthorityHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "有兴趣产品(按最终用途选择)&nbsp;:<font class='compulsory'>*</font>";			

		x = document.getElementById("tblRegFormRegisterForHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "免费穿梭巴士服务:";
		
		x = document.getElementById("tblRegFormRegisterForHeader").insertRow(2);
		y = x.insertCell(0);
		y.innerHTML = "我想申请<blink>免费穿梭巴士服务</blink>，以来往";


		
		x = document.getElementById("tblRegFormRegisterForHeader").insertRow(4);
		y = x.insertCell(0);
		//y.innerHTML = "主办机构将与您联络以作最后确认。 买家必须于2009年8月31日前于网上作买家登记，方可免费享受此服务。";
		y.innerHTML = "<font color=#666666>免费穿梭巴士服务已经截止申请。</font>";
		
		x = document.getElementById("ltlRegFormExhibitionDescription1");
		x.innerHTML = "2009 香港国际秋季成衣及时装材料展";


		} catch(err) {
		}

	}


	if(language == "zh-hk") {

		try {

		x = document.getElementById("tblRegFormPurchasingAuthorityHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "有興趣產品(按最終用途選擇)&nbsp;:<font class='compulsory'>*</font>";			
		
		x = document.getElementById("tblRegFormRegisterForHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "免費穿梭巴士服務:";	
		
		x = document.getElementById("tblRegFormRegisterForHeader").insertRow(2);
		y = x.insertCell(0);
		y.innerHTML = "我想申請<blink>免費穿梭巴士服務</blink>，以來往";



		
		x = document.getElementById("tblRegFormRegisterForHeader").insertRow(4);
		y = x.insertCell(0);
		//y.innerHTML = "主辦機構將與您聯絡以作最後確認。 買家必須於2009年8月31日前於網上作買家登記，方可免費享受此服務。";
		y.innerHTML = "<font color=#666666>免費穿梭巴士服務已經截止申請。</font>";


		x = document.getElementById("ltlRegFormExhibitionDescription1");
		x.innerHTML = "2009 香港國際秋季成衣及時裝材料展";



		} catch(err) {
		}


	}


	try {

		document.getElementById("datListRegisterFors_ctl00_chkRegisterForId").disabled = true;
		document.getElementById("datListRegisterFors_ctl01_chkRegisterForId").disabled = true;


	} catch(err) {
	}


}


function Customize567(language) {
	var x,y;

try {

	if (language == "en") {
		x = document.getElementById("tblRegFormPurchasingAuthorityHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "Purchasing Authority (Single selection only) : <font class='compulsory'>*</font>";
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong><font color=\"ffbb00\">Guangzhou International Lighting Exhibition</font></strong>"
		x = document.getElementById("datListMainInterests").insertRow(6);
		y = x.insertCell(0);
		y.innerHTML = "<strong><font color=\"2a85cc\">Electrical Building Technology Guangzhou</font></strong>"
		x = document.getElementById("datListMainInterests").insertRow(7);
		y = x.insertCell(0);
		y.innerHTML = "<i>Electrical engineering</i>"
		x = document.getElementById("datListMainInterests").insertRow(11);
		y = x.insertCell(0);
		y.innerHTML = "<i>Intelligent building and building automation</i>"
		x = document.getElementById("datListMainInterests").insertRow(15);
		y = x.insertCell(0);
		y.innerHTML = "<i>Others</i>"
		
		x = document.getElementById("tblJobFunctionHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "Main job function&nbsp;(single selection only)&nbsp;: <font class='compulsory'>*</font>";
		
		
		x = document.getElementById("datListBusinessNatures").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<i>Industry related</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(5);
		y = x.insertCell(0);
		y.innerHTML = "<i>Trade Related</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(12);
		y = x.insertCell(0);
		y.innerHTML = "<i>Authorities</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(14);
		y = x.insertCell(0);
		y.innerHTML = "<i>Others</i>"
	}

	if (language == "zh-cn") {
	
		x = document.getElementById("tblRegFormPurchasingAuthorityHeader").rows[0].cells;
		y = x[0];
		//y.innerHTML = "阁下在   贵司采购决定权的影响力（只能选择一项）∶ <font class='compulsory'>*</font> ";
		y.innerHTML = "采购决定权（只能选择一项）∶ <font class='compulsory'>*</font> ";
		
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"ffbb00\">广州国际照明展览会</font></strong>"
			
		x = document.getElementById("datListMainInterests").insertRow(6);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"2a85cc\">广州国际建筑电气技术展览会</font></strong>"
			
		x = document.getElementById("datListMainInterests").insertRow(7);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>建筑电工电气</i>"
			
		x = document.getElementById("datListMainInterests").insertRow(11);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>智能建筑、楼宇自动化设备</i>"
			
		x = document.getElementById("datListMainInterests").insertRow(15);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>其它</i>"		
		
		x = document.getElementById("tblJobFunctionHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "阁下主要职务性质&nbsp;(只能选择一项)：<font class='compulsory'>*</font>";
		
		x = document.getElementById("tblRegFormHowToKnowHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "阁下从何得知本展会：<font class='compulsory'>*</font>";
			
		
		x = document.getElementById("datListBusinessNatures").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<i>行业相关</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(5);
		y = x.insertCell(0);
		y.innerHTML = "<i>贸易相关</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(12);
		y = x.insertCell(0);
		y.innerHTML = "<i>政府部门</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(14);
		y = x.insertCell(0);
		y.innerHTML = "<i>其他</i>"
	}


 	if (language == "zh-hk") {
		
		x = document.getElementById("tblRegFormPurchasingAuthorityHeader").rows[0].cells;
		y = x[0];
		//y.innerHTML = "閣下在   貴司採購決定權的影響力﹙只能選擇一項﹚︰ <font class='compulsory'>*</font>";
		y.innerHTML = "採購決定權﹙只能選擇一項﹚︰ <font class='compulsory'>*</font>";
		
		x = document.getElementById("datListMainInterests").insertRow(0);

		y = x.insertCell(0);

		y.innerHTML = "<strong><font color=\"ffbb00\">廣州國際照明展覽會</font></strong>";

		x = document.getElementById("datListMainInterests").insertRow(6);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"2a85cc\">廣州國際建築電氣技術展覽會</font></strong>";
			
		x = document.getElementById("datListMainInterests").insertRow(7);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>建築電工電氣</i>";
			
		x = document.getElementById("datListMainInterests").insertRow(11);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>智能建築、樓宇自動化設備</i>";
			
		x = document.getElementById("datListMainInterests").insertRow(15);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>其他</i>";
		
		x = document.getElementById("tblJobFunctionHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "閣下主要職務性質&nbsp;(只能選擇一項)：<font class='compulsory'>*</font>";
		
		x = document.getElementById("tblRegFormHowToKnowHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "閣下從何得知本展會：<font class='compulsory'>*</font>";
			
		
		x = document.getElementById("datListBusinessNatures").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<i>行業相關</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(5);
		y = x.insertCell(0);
		y.innerHTML = "<i>貿易相關</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(12);
		y = x.insertCell(0);
		y.innerHTML = "<i>政府部門</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(14);
		y = x.insertCell(0);
		y.innerHTML = "<i>其他</i>"
	} 

		} catch(err) {
		}


}






function Customize452(language) {
	var x,y;
		
	if (language == "en") {
		try {

		x = document.getElementById("tblRegFormVisitPurposeHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "Please select your interested events of our fringe programme&nbsp;:<font class='compulsory'>*</font>";	


		} catch(err) {
		}
		
	}

	if (language == "zh-cn") {

		try {

		x = document.getElementById("tblRegFormVisitPurposeHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "您想参加的同期活动有&nbsp;:<font class='compulsory'>*</font>";	



		} catch(err) {
		}

	}


	if(language == "zh-hk") {

		try {

		x = document.getElementById("tblRegFormVisitPurposeHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "您想參加的同期活動有&nbsp;:<font class='compulsory'>*</font>";	



		} catch(err) {
		}


	}
}


function Customize526(language) {
	var x,y;
		
	if (language == "en") {
		try {

		x = document.getElementById("tblRegFormPurchasingAuthorityHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "Main area of interest (by product end-use)&nbsp;:<font class='compulsory'>*</font>";	
	
		} catch(err) {
		}
		
	}

	if (language == "zh-cn") {

		try {

		x = document.getElementById("tblRegFormPurchasingAuthorityHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "有兴趣产品(按最终用途选择)&nbsp;:<font class='compulsory'>*</font>";				

		} catch(err) {
		}

	}


	if(language == "zh-hk") {

		try {

		x = document.getElementById("tblRegFormPurchasingAuthorityHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "有興趣產品(按最終用途選擇)&nbsp;:<font class='compulsory'>*</font>";					

		} catch(err) {
		}

	}

}




function Customize540(language) {
	var x,y;
		
	if (language == "en") {
		try {

		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong>1 Commercial and Residential Security</strong>"

		x = document.getElementById("datListMainInterests").insertRow(7);
		y = x.insertCell(0);
		y.innerHTML = "<strong>2 Natural Disasters</strong>"


		x = document.getElementById("datListMainInterests").insertRow(11);
		y = x.insertCell(0);
		y.innerHTML = "<strong>3 Homeland Security</strong>"

		x = document.getElementById("datListMainInterests").insertRow(16);
		y = x.insertCell(0);
		y.innerHTML = "<strong>4 Public Safety</strong>"


		x = document.getElementById("datListMainInterests").insertRow(22);
		y = x.insertCell(0);
		y.innerHTML = "<strong>5 Information Technology Security</strong>"

		x = document.getElementById("datListMainInterests").insertRow(25);
		y = x.insertCell(0);
		y.innerHTML = "<strong>6 Occupational and Personal Safety</strong>"

		x = document.getElementById("datListMainInterests").insertRow(28);
		y = x.insertCell(0);
		y.innerHTML = "<strong>7 Others</strong>"

	
		} catch(err) {
		}
		
	}

	if (language == "zh-cn") {

		try {

		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong>1 商业及住宅安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(7);
		y = x.insertCell(0);
		y.innerHTML = "<strong>2 自然灾难预防及救援</strong>"


		x = document.getElementById("datListMainInterests").insertRow(11);
		y = x.insertCell(0);
		y.innerHTML = "<strong>3 国家安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(16);
		y = x.insertCell(0);
		y.innerHTML = "<strong>4 城市公共安全</strong>"


		x = document.getElementById("datListMainInterests").insertRow(22);
		y = x.insertCell(0);
		y.innerHTML = "<strong>5 资讯技术安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(25);
		y = x.insertCell(0);
		y.innerHTML = "<strong>6 职业及个人防护</strong>"

		x = document.getElementById("datListMainInterests").insertRow(28);
		y = x.insertCell(0);
		y.innerHTML = "<strong>7 其他</strong>"

	

		} catch(err) {
		}

	}


	if(language == "zh-hk") {

		try {

		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong>1 商業及住宅安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(7);
		y = x.insertCell(0);
		y.innerHTML = "<strong>2 自然災難預防及救援</strong>"


		x = document.getElementById("datListMainInterests").insertRow(11);
		y = x.insertCell(0);
		y.innerHTML = "<strong>3 國家安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(16);
		y = x.insertCell(0);
		y.innerHTML = "<strong>4 城市公共安全</strong>"


		x = document.getElementById("datListMainInterests").insertRow(22);
		y = x.insertCell(0);
		y.innerHTML = "<strong>5 資訊技術安全</strong>"

		x = document.getElementById("datListMainInterests").insertRow(25);
		y = x.insertCell(0);
		y.innerHTML = "<strong>6 職業及個人防護</strong>"

		x = document.getElementById("datListMainInterests").insertRow(28);
		y = x.insertCell(0);
		y.innerHTML = "<strong>7 其他</strong>"

	

		} catch(err) {
		}

	}
}


function Customize569(language) {
	var x,y;

try {

	if (language == "en") {
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong><font color=\"2a85cc\">Electrical Building Technology Guangzhou</font></strong>"
		x = document.getElementById("datListMainInterests").insertRow(1);
		y = x.insertCell(0);
		y.innerHTML = "<i>Electrical engineering</i>"
		x = document.getElementById("datListMainInterests").insertRow(5);
		y = x.insertCell(0);
		y.innerHTML = "<i>Intelligent building and building automation</i>"
		x = document.getElementById("datListMainInterests").insertRow(9);
		y = x.insertCell(0);
		y.innerHTML = "<i>Others</i>"
				
		x = document.getElementById("datListMainInterests").insertRow(11);
		y = x.insertCell(0);
		y.innerHTML = "<strong><font color=\"ffbb00\">Guangzhou International Lighting Exhibition</font></strong>"
		x = document.getElementById("datListBusinessNatures").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<i>Industry related</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(5);
		y = x.insertCell(0);
		y.innerHTML = "<i>Trade Related</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(12);
		y = x.insertCell(0);
		y.innerHTML = "<i>Authorities</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(14);
		y = x.insertCell(0);
		y.innerHTML = "<i>Others</i>"
	}

	if (language == "zh-cn") {
	
		x = document.getElementById("datListMainInterests").insertRow(0);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"2a85cc\">广州国际建筑电气技术展览会</font></strong>"
			
		x = document.getElementById("datListMainInterests").insertRow(1);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>建筑电工电气</i>"
			
		x = document.getElementById("datListMainInterests").insertRow(5);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>智能建筑、楼宇自动化设备</i>"
			
		x = document.getElementById("datListMainInterests").insertRow(9);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>其它</i>"		

		x = document.getElementById("datListMainInterests").insertRow(11);
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"ffbb00\">广州国际照明展览会</font></strong>"
			
		
		
		x = document.getElementById("datListBusinessNatures").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<i>行业相关</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(5);
		y = x.insertCell(0);
		y.innerHTML = "<i>贸易相关</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(12);
		y = x.insertCell(0);
		y.innerHTML = "<i>政府部门</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(14);
		y = x.insertCell(0);
		y.innerHTML = "<i>其他</i>"
	}


 	if (language == "zh-hk") {
		
		x = document.getElementById("datListMainInterests").insertRow(0);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"2a85cc\">廣州國際建築電氣技術展覽會</font></strong>";
			
		x = document.getElementById("datListMainInterests").insertRow(1);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>建築電工電氣</i>";
			
		x = document.getElementById("datListMainInterests").insertRow(5);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>智能建築、樓宇自動化設備</i>";
			
		x = document.getElementById("datListMainInterests").insertRow(9);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>其他</i>";

		x = document.getElementById("datListMainInterests").insertRow(11);

		y = x.insertCell(0);

		y.innerHTML = "<strong><font color=\"ffbb00\">廣州國際照明展覽會</font></strong>";

		
		
		x = document.getElementById("datListBusinessNatures").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<i>行業相關</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(5);
		y = x.insertCell(0);
		y.innerHTML = "<i>貿易相關</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(12);
		y = x.insertCell(0);
		y.innerHTML = "<i>政府部門</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(14);
		y = x.insertCell(0);
		y.innerHTML = "<i>其他</i>"
	} 

		} catch(err) {
		}
}

function Customize715(language) {
	var x,y;

try {

	if (language == "en") {
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong><font color=\"2a85cc\">Electrical Building Technology Guangzhou</font></strong>"
		x = document.getElementById("datListMainInterests").insertRow(1);
		y = x.insertCell(0);
		y.innerHTML = "<i>Electrical engineering</i>"
		x = document.getElementById("datListMainInterests").insertRow(6);
		y = x.insertCell(0);
		y.innerHTML = "<i>Building and home automation</i>"
		x = document.getElementById("datListMainInterests").insertRow(11);
		y = x.insertCell(0);
		y.innerHTML = "<i>Others</i>"
				
		x = document.getElementById("datListMainInterests").insertRow(13);
		y = x.insertCell(0);
		y.innerHTML = "<strong><font color=\"ffbb00\">Guangzhou International Lighting Exhibition</font></strong>"
		x = document.getElementById("datListBusinessNatures").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<i>Industry Related</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(5);
		y = x.insertCell(0);
		y.innerHTML = "<i>Trade Related</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(12);
		y = x.insertCell(0);
		y.innerHTML = "<i>Authorities</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(14);
		y = x.insertCell(0);
		y.innerHTML = "<i>Others</i>"
		
		x = document.getElementById("tblRegFormHowToKnowHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "How did you find out about this exhibition ?&nbsp;<font class='compulsory'>*</font>";
	}

	if (language == "zh-cn") {
	
		x = document.getElementById("datListMainInterests").insertRow(0);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"2a85cc\">广州国际建筑电气技术展览会</font></strong>"
			
		x = document.getElementById("datListMainInterests").insertRow(1);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>建筑电工电气</i>"
			
		x = document.getElementById("datListMainInterests").insertRow(6);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>楼宇自动化及智能家居</i>"
			
		x = document.getElementById("datListMainInterests").insertRow(11);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>其它</i>"		

		x = document.getElementById("datListMainInterests").insertRow(13);
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"ffbb00\">广州国际照明展览会</font></strong>"
			
		
		
		x = document.getElementById("datListBusinessNatures").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<i>行业相关</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(5);
		y = x.insertCell(0);
		y.innerHTML = "<i>贸易相关</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(12);
		y = x.insertCell(0);
		y.innerHTML = "<i>政府部门</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(14);
		y = x.insertCell(0);
		y.innerHTML = "<i>其他</i>"
	}


 	if (language == "zh-hk") {
		
		x = document.getElementById("datListMainInterests").insertRow(0);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"2a85cc\">廣州國際建築電氣技術展覽會</font></strong>";
			
		x = document.getElementById("datListMainInterests").insertRow(1);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>建築電工電氣</i>";
			
		x = document.getElementById("datListMainInterests").insertRow(6);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>樓宇自動化及智能家居</i>";
			
		x = document.getElementById("datListMainInterests").insertRow(11);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>其他</i>";

		x = document.getElementById("datListMainInterests").insertRow(13);

		y = x.insertCell(0);

		y.innerHTML = "<strong><font color=\"ffbb00\">廣州國際照明展覽會</font></strong>";

		
		
		x = document.getElementById("datListBusinessNatures").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<i>行業相關</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(5);
		y = x.insertCell(0);
		y.innerHTML = "<i>貿易相關</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(12);
		y = x.insertCell(0);
		y.innerHTML = "<i>政府部門</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(14);
		y = x.insertCell(0);
		y.innerHTML = "<i>其他</i>"
	} 

		} catch(err) {
		}
}



function Customize714(language) {
	var x,y;

try {

	if (language == "en") {
		x = document.getElementById("tblRegFormPurchasingAuthorityHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "Purchasing Authority (Single selection only) : <font class='compulsory'>*</font>";
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<strong><font color=\"ffbb00\">Guangzhou International Lighting Exhibition</font></strong>"
		x = document.getElementById("datListMainInterests").insertRow(6);
		y = x.insertCell(0);
		y.innerHTML = "<strong><font color=\"2a85cc\">Electrical Building Technology Guangzhou</font></strong>"
		x = document.getElementById("datListMainInterests").insertRow(7);
		y = x.insertCell(0);
		y.innerHTML = "<i>Electrical engineering</i>"
		x = document.getElementById("datListMainInterests").insertRow(12);
		y = x.insertCell(0);
		y.innerHTML = "<i>Building and home automation</i>"
		x = document.getElementById("datListMainInterests").insertRow(17);
		y = x.insertCell(0);
		y.innerHTML = "<i>Others</i>"
		
		x = document.getElementById("tblJobFunctionHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "Main job function&nbsp;(single selection only)&nbsp;: <font class='compulsory'>*</font>";
		
		
		x = document.getElementById("datListBusinessNatures").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<i>Industry Related</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(5);
		y = x.insertCell(0);
		y.innerHTML = "<i>Trade Related</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(12);
		y = x.insertCell(0);
		y.innerHTML = "<i>Authorities</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(14);
		y = x.insertCell(0);
		y.innerHTML = "<i>Others</i>"
		
		x = document.getElementById("tblRegFormHowToKnowHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "How did you find out about this exhibition ?&nbsp;<font class='compulsory'>*</font>";	
	}

	if (language == "zh-cn") {
	
		x = document.getElementById("tblRegFormPurchasingAuthorityHeader").rows[0].cells;
		y = x[0];
		//y.innerHTML = "阁下在   贵司采购决定权的影响力（只能选择一项）∶ <font class='compulsory'>*</font> ";
		y.innerHTML = "采购决定权（只能选择一项）∶ <font class='compulsory'>*</font> ";
		
		x = document.getElementById("datListMainInterests").insertRow(0);
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"ffbb00\">广州国际照明展览会</font></strong>"
			
		x = document.getElementById("datListMainInterests").insertRow(6);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"2a85cc\">广州国际建筑电气技术展览会</font></strong>"
			
		x = document.getElementById("datListMainInterests").insertRow(7);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>建筑电工电气</i>"
			
		x = document.getElementById("datListMainInterests").insertRow(12);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>楼宇自动化及智能家居</i>"
			
		x = document.getElementById("datListMainInterests").insertRow(17);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>其它</i>"		
		
		x = document.getElementById("tblJobFunctionHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "阁下主要职务性质&nbsp;(只能选择一项)：<font class='compulsory'>*</font>";
		
		x = document.getElementById("tblRegFormHowToKnowHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "阁下从何得知本展会：<font class='compulsory'>*</font>";
			
		
		x = document.getElementById("datListBusinessNatures").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<i>行业相关</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(5);
		y = x.insertCell(0);
		y.innerHTML = "<i>贸易相关</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(12);
		y = x.insertCell(0);
		y.innerHTML = "<i>政府部门</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(14);
		y = x.insertCell(0);
		y.innerHTML = "<i>其他</i>"
	}


 	if (language == "zh-hk") {
		
		x = document.getElementById("tblRegFormPurchasingAuthorityHeader").rows[0].cells;
		y = x[0];
		//y.innerHTML = "閣下在   貴司採購決定權的影響力﹙只能選擇一項﹚︰ <font class='compulsory'>*</font>";
		y.innerHTML = "採購決定權﹙只能選擇一項﹚︰ <font class='compulsory'>*</font>";
		
		x = document.getElementById("datListMainInterests").insertRow(0);

		y = x.insertCell(0);

		y.innerHTML = "<strong><font color=\"ffbb00\">廣州國際照明展覽會</font></strong>";

		x = document.getElementById("datListMainInterests").insertRow(6);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<strong><font color=\"2a85cc\">廣州國際建築電氣技術展覽會</font></strong>";
			
		x = document.getElementById("datListMainInterests").insertRow(7);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>建築電工電氣</i>";
			
		x = document.getElementById("datListMainInterests").insertRow(12);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>樓宇自動化及智能家居</i>";
			
		x = document.getElementById("datListMainInterests").insertRow(17);
			
		y = x.insertCell(0);
			
		y.innerHTML = "<i>其他</i>";
		
		x = document.getElementById("tblJobFunctionHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "閣下主要職務性質&nbsp;(只能選擇一項)：<font class='compulsory'>*</font>";
		
		x = document.getElementById("tblRegFormHowToKnowHeader").rows[0].cells;
		y = x[0];
		y.innerHTML = "閣下從何得知本展會：<font class='compulsory'>*</font>";
			
		
		x = document.getElementById("datListBusinessNatures").insertRow(0);
		y = x.insertCell(0);
		y.innerHTML = "<i>行業相關</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(5);
		y = x.insertCell(0);
		y.innerHTML = "<i>貿易相關</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(12);
		y = x.insertCell(0);
		y.innerHTML = "<i>政府部門</i>"
		
		x = document.getElementById("datListBusinessNatures").insertRow(14);
		y = x.insertCell(0);
		y.innerHTML = "<i>其他</i>"
	} 

		} catch(err) {
		}


}
function Customize625(language) {
	if (language == "en") {
		if (document.getElementById("ltlRegFormBusinessCategoryHeader") != null) {
			document.getElementById("ltlRegFormBusinessCategoryHeader").innerHTML = document.getElementById("ltlRegFormBusinessCategoryHeader").innerText.replace("Business Category", "Brand");
		}
	} else if (language == "zh-hk") {
		if (document.getElementById("ltlRegFormBusinessCategoryHeader") != null) {
			document.getElementById("ltlRegFormBusinessCategoryHeader").innerText = document.getElementById("ltlRegFormBusinessCategoryHeader").innerText.replace("業務範圍", "品牌");
		}
	} else if (language == "zh-cn") {
		if (document.getElementById("ltlRegFormBusinessCategoryHeader") != null) {
			document.getElementById("ltlRegFormBusinessCategoryHeader").innerText = document.getElementById("ltlRegFormBusinessCategoryHeader").innerText.replace("业务范围", "品牌");
		}
	}
}

function Customize791(language) {

}

function Customize925(language) {
    var cMandStr = " <font color=red class=compulsory>*</font>";
    $(document).ready(function() {

        CheckedIsAmateur925($("#tblRegFormBusinessProfile input:checkbox:eq(1)").attr('checked'), language);

        if (language == "en") {
            $("#ltlRegFormNewRegisterPosition").html("Job Title : " + cMandStr);
            $('#ltlRegFormVisitorContactFax').html('Fax no. : ');
            $("#valTxtRegFormPositionNonEnglish").val("Please enter your job title in English");

            $("#custValTxtRegFormBusinessProfile").val("Please answer question visitor of Type");
            $("#custValTxtRegFormBusinessCategory").val("Please answer question A");
            $("#custValTxtRegFormBusinessNature").val("Please answer question B");
            $("#custValTxtRegFormNumOfEmployer").val("Please answer question C");
            $("#custValTxtRegFormMainInterest").val("Please answer question D");
            $("#custValTxtRegFormJobFunction").val("Please answer question E");
            $("#custValTxtRegFormPurchasingAuthority").val("Please answer question F");
            $("#custValTxtRegFormRegionSourcing").val("Please answer question G");
            $("#custValTxtRegFormVisitPurpose").val("Please answer question H");
            $("#custValTxtRegFormHowToKnow").val("Please answer question I");

            $("#btnRegFormNext").removeAttr("onclick");
            $("#btnRegFormNext").click(function() {
                jsSubmit925En('save', language);
            });
        }



        if (language == "zh-cn") {
            $("#custValTxtRegFormBusinessProfile").val("请选择参观者用户类型");
            $("#custValTxtRegFormBusinessCategory").val("请选择题目 A");
            $("#custValTxtRegFormBusinessNature").val("请选择题目 B");
            $("#custValTxtRegFormNumOfEmployer").val("请选择题目 C");
            $("#custValTxtRegFormMainInterest").val("请选择题目 D");
            $("#custValTxtRegFormJobFunction").val("请选择题目 E");
            $("#custValTxtRegFormPurchasingAuthority").val("请选择题目 F");
            $("#custValTxtRegFormRegionSourcing").val("请选择题目 G");
            $("#custValTxtRegFormVisitPurpose").val("请选择题目 H");
            $("#custValTxtRegFormHowToKnow").val("请选择题目 I");
            $("#ltlRegFormNewRegisterPositionChi").html("职称： " + cMandStr);
            $('#ltlRegFormVisitorContactFax').html('传真号码﹕');
            $("#regValTxtRegFormChinesePositionLength").val("职称的长度不得超过 128 个字符");

            $("#btnRegFormNext").removeAttr("onclick");
            $("#btnRegFormNext").click(function() {
                jsSubmit925ZhHK('save', language);
            });
        }

        if (language == "zh-hk") {
            $("#custValTxtRegFormBusinessProfile").val("請選擇參觀者用戶類型");
            $("#custValTxtRegFormBusinessCategory").val("請選擇題目 A");
            $("#custValTxtRegFormBusinessNature").val("請選擇題目 B");
            $("#custValTxtRegFormNumOfEmployer").val("請選擇題目 C");
            $("#custValTxtRegFormMainInterest").val("請選擇題目 D");
            $("#custValTxtRegFormJobFunction").val("請選擇題目 E");
            $("#custValTxtRegFormPurchasingAuthority").val("請選擇題目 F");
            $("#custValTxtRegFormRegionSourcing").val("請選擇題目 G");
            $("#custValTxtRegFormVisitPurpose").val("請選擇題目 H");
            $("#custValTxtRegFormHowToKnow").val("請選擇題目 I");
            $("#ltlRegFormNewRegisterPositionChi").html("職稱： " + cMandStr);
            $('#ltlRegFormVisitorContactFax').html('傳真號碼﹕');
            $("#regValTxtRegFormChinesePositionLength").val("職稱的長度不得超過 128 個字符");

            $("#btnRegFormNext").removeAttr("onclick");
            $("#btnRegFormNext").click(function() {
                jsSubmit925ZhHK('save', language);
            });
        }

        //alert(location.pathname);
        var pathinfo = location.pathname.split("/");
        if (pathinfo[pathinfo.length - 1] != "preview_form.aspx" && pathinfo[pathinfo.length - 1] != "preview_form_chi.aspx") {
            FunctionUpdate_925_Q2(language);
        }

    });
		
}

function CheckedIsAmateur925(is_checked, language) {
    //is_checked to control the question A-D is compulsory or not
    var cMandStr = " <font color=red class=compulsory>*</font>";

    var cCopyMandStr = cMandStr;

    if (language == "en") {
        if (is_checked) {
            cMandStr = '';
        }
        
        
        $("#tblRegFormBusinessCategory tr td:eq(0)").html("A. What is the nature of your Business? " + cMandStr);
        $("#tblRegFormBusinessNature tr td:eq(0)").html("B. Number of employee (single selection only) " + cMandStr);
        $("#tblRegFormNumOfEmployer tr td:eq(0)").html("C. Your job function " + cMandStr);
        $("#tblRegFormMainInterestHeader tr td:eq(0)").html("D. Intended purpose(s) of your visit " + cMandStr);
        
        cMandStr = cCopyMandStr;
        $("#tblRegFormBusinessProfile tr td:eq(0)").html("Industry Player Or Amateurs (single selection only) " + cMandStr);
        $("#tblJobFunctionHeader tr td:eq(0)").html("E. How did you find out about this event? " + cMandStr);
        $("#tblRegFormPurchasingAuthorityHeader tr td:eq(0)").html("F. Which products are most interesting to you? " + cMandStr);
        $("#tblRegFormRegionSourcing tr td:eq(0)").html("G. Your favorite outdoor products come from " + cMandStr);
        $("#tblRegFormVisitPurposeHeader tr td:eq(0)").html("H. Which outdoor sports are most interesting of you? " + cMandStr);
        $("#tblRegFormHowToKnowHeader tr td:eq(0)").html("I. Your favorite outdoor Brands:" + cMandStr);
    }

    if (language == "zh-hk") {
        if (is_checked) {
            cMandStr = '';
        }

        
        $("#tblRegFormBusinessCategory tr td:eq(0)").html("A. 貴公司的業務性質是 " + cMandStr);
        $("#tblRegFormBusinessNature tr td:eq(0)").html("B. 員工人數 (單選)" + cMandStr);
        $("#tblRegFormNumOfEmployer tr td:eq(0)").html("C. 職務性質:" + cMandStr);
        $("#tblRegFormMainInterestHeader tr td:eq(0)").html("D. 參觀展會目的 " + cMandStr);

        cMandStr = cCopyMandStr;
        $("#tblRegFormBusinessProfile tr td:eq(0)").html("業內人事或戶外運動愛好者 (單選)" + cMandStr);
        $("#tblJobFunctionHeader tr td:eq(0)").html("E. 你從何得知本展會 " + cMandStr);
        $("#tblRegFormPurchasingAuthorityHeader tr td:eq(0)").html("F. 你最感興趣的產品是 " + cMandStr);
        $("#tblRegFormRegionSourcing tr td:eq(0)").html("G. 你最喜愛個國家的戶外產品? " + cMandStr);
        $("#tblRegFormVisitPurposeHeader tr td:eq(0)").html("H. 你最感興趣的戶外運動是 " + cMandStr);
        $("#tblRegFormHowToKnowHeader tr td:eq(0)").html("I. 你最喜愛哪個戶外品牌? " + cMandStr);
		    
    }

    if (language == "zh-cn") {
        if (is_checked) {
            cMandStr = '';
        }
        
        $("#tblRegFormBusinessCategory tr td:eq(0)").html("A. 贵公司的业务性质是 " + cMandStr);
        $("#tblRegFormBusinessNature tr td:eq(0)").html("B. 员工人数 (單選)" + cMandStr);
        $("#tblRegFormNumOfEmployer tr td:eq(0)").html("C. 职务性质:" + cMandStr);
        $("#tblRegFormMainInterestHeader tr td:eq(0)").html("D. 参观展会目的 " + cMandStr);
        
        cMandStr = cCopyMandStr;
        $("#tblRegFormBusinessProfile tr td:eq(0)").html("业内人事或户外运动爱好者 (單選)" + cMandStr);
        $("#tblJobFunctionHeader tr td:eq(0)").html("E. 你从何得知本展会 " + cMandStr);
        $("#tblRegFormPurchasingAuthorityHeader tr td:eq(0)").html("F. 你最感兴趣的产品是 " + cMandStr);
        $("#tblRegFormRegionSourcing tr td:eq(0)").html("G. 你最喜爱个国家的户外产品? " + cMandStr);
        $("#tblRegFormVisitPurposeHeader tr td:eq(0)").html("H. 你最感兴趣的户外运动是 " + cMandStr);
        $("#tblRegFormHowToKnowHeader tr td:eq(0)").html("I. 你最喜爱哪个户外品牌? " + cMandStr);    

    } 
}

function FunctionUpdate_925_Q2(language) {
    $("#tblRegFormBusinessProfile input:checkbox:eq(1)").click(function() {
        if ($(this).attr("checked")) {
            $("#tblJobFunctionHeader input:checkbox:eq(0)").focus();
            CheckedIsAmateur925(true, language);
        } else {
            CheckedIsAmateur925(false, language);
        }
    });

    $("#tblRegFormBusinessProfile input:checkbox:eq(0)").click(function(){
        CheckedIsAmateur925(false, language);
    });

	$("#tblRegFormBusinessProfile input:checkbox").click(function() {
	if ($(this).attr("checked"))
	 {
	   $("#tblRegFormBusinessProfile  input:checkbox").not(this).attr("checked", false);
	}
   });

	$("#tblRegFormBusinessNature input:checkbox").click(function() {
	if ($(this).attr("checked"))
	 {
	   $("#tblRegFormBusinessNature input:checkbox").not(this).attr("checked", false);
	}   
	});
	 
	$("#tblRegFormBusinessCategory  input:checkbox:lt(20)").removeAttr("onclick");
	$("#tblRegFormBusinessCategory input:checkbox:lt(20)").click(function() {
		$("#tblRegFormBusinessCategory input:checkbox:gt(19)").attr("checked", false);
	});
	
	$("#tblRegFormNumOfEmployer  input:checkbox:lt(20)").removeAttr("onclick");
	$("#tblRegFormNumOfEmployer input:checkbox:lt(20)").click(function() {
		$("#tblRegFormNumOfEmployer input:checkbox:gt(19)").attr("checked", false);
	});
	
	$("#tblRegFormMainInterestHeader  input:checkbox:lt(20)").removeAttr("onclick");
	$("#tblRegFormMainInterestHeader input:checkbox:lt(20)").click(function() {
		$("#tblRegFormMainInterestHeader input:checkbox:gt(19)").attr("checked", false);
	});

	
  $("#tblJobFunctionHeader  input:checkbox:lt(20)").removeAttr("onclick");
	$("#tblJobFunctionHeader input:checkbox:lt(20)").click(function() {
		$("#tblJobFunctionHeader input:checkbox:gt(19)").attr("checked", false);
	});
	
    $("#tblRegFormPurchasingAuthorityHeader  input:checkbox:lt(20)").removeAttr("onclick");
	$("#tblRegFormPurchasingAuthorityHeader input:checkbox:lt(20)").click(function() {
		$("#tblRegFormPurchasingAuthorityHeader input:checkbox:gt(19)").attr("checked", false);
	});
	
	$("#tblRegFormRegionSourcing  input:checkbox:lt(20)").removeAttr("onclick");
	$("#tblRegFormRegionSourcing input:checkbox:lt(20)").click(function() {
		$("#tblRegFormRegionSourcing input:checkbox:gt(9)").attr("checked", false);
	});
	
	
	$("#tblRegFormVisitPurposeHeader  input:checkbox:lt(20)").removeAttr("onclick");
	$("#tblRegFormVisitPurposeHeader input:checkbox:lt(20)").click(function() {
		$("#tblRegFormVisitPurposeHeader input:checkbox:gt(19)").attr("checked", false);
	});
	
	
	$("#tblRegFormHowToKnowHeader  input:checkbox:lt(20)").removeAttr("onclick");
	$("#tblRegFormHowToKnowHeader input:checkbox:lt(20)").click(function() {
		$("#tblRegFormHowToKnowHeader input:checkbox:gt(19)").attr("checked", false);
	});
}

function jsSubmit925En(task, language){
	var errMessage = ""
	var serverhost = window.location.host		
	
	if(task == "save"){
		//2011-12-12
		if(document.getElementById("txtRegFormUsername").value.length <= 3) {
			errMessage += document.getElementById("valTxtRegFormUsername").value + "\n";
		} 
		
		if(document.getElementById("txtRegFormEmail").value.length == 0){
			errMessage += document.getElementById("valTxtRegFormEmail").value + "\n";
		}else if(!GenericValidator.isEmail(document.getElementById("txtRegFormEmail").value)){
			errMessage += document.getElementById("regValTxtRegFormEmail").value + "\n";
		}
		
		if(document.getElementById("txtRegFormPassword").value.length == 0){
			errMessage += document.getElementById("valTxtRegFormPassword").value + "\n";
		}else if(document.getElementById("txtRegFormPassword").value.length > 10){
			errMessage += document.getElementById("regValTxtRegFormPasswordLength").value + "\n";
		}

        if (document.getElementById("txtRegFormPromotionCode") != null)
        {
            if(document.getElementById("txtRegFormPromotionCode").value.length > 0){
			    errMessage += checkPromotionInput();
		    }
		}

		if(!checkPrefix()){
			errMessage += document.getElementById("custValDdlRegFormPrefix").value + "\n";
		}

		
		if(!checkName()){
			errMessage += document.getElementById("custValTxtName").value +"\n"
		}else if(document.getElementById("txtRegFormGivenName").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormGivenNameLength").value + "\n";
		}else if(document.getElementById("txtRegFormMiddleName").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormMiddleNameLength").value + "\n";
		}else if(document.getElementById("txtRegFormFamilyName").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormFamilyNameLength").value + "\n";
		}else if ((checkEnglishInput(document.getElementById("txtRegFormGivenName").value) && checkEnglishInput(document.getElementById("txtRegFormMiddleName").value) && checkEnglishInput(document.getElementById("txtRegFormFamilyName").value)) == false){
			errMessage += document.getElementById("valTxtRegFormNameNonEnglish").value + "\n";
		}

		if(GenericValidator.isBlankOrNull(document.getElementById("txtRegFormPosition").value)){
			errMessage += "Please enter your job title\n";
		} else if(document.getElementById("txtRegFormPosition").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormPositionLength").value + "\n";
		}else if (checkEnglishInput(document.getElementById("txtRegFormPosition").value) == false){
			errMessage += document.getElementById("valTxtRegFormPositionNonEnglish").value + "\n";
		}
		
		if(document.getElementById("txtRegFormMobileCountryCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormMobileCountryCodeLength").value + "\n";
		}

		if(!checkComplusoryMobile()){
			errMessage += document.getElementById("custValTxtRegFormMobileInputAll").value + "\n";
		}
		
		if(!checkMobile()){
			errMessage += document.getElementById("custValTxtRegFormMobileNumberOnly").value + "\n";
		}
		
		if(!checkMobileInputAll()){
			errMessage += document.getElementById("custValTxtRegFormMobileInputAll").value + "\n";
		}
		
		if(document.getElementById("txtRegFormMobile").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormMobileLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyLocalName").value.length == 0){
			errMessage += document.getElementById("valTxtRegFormCompanyLocalName").value + "\n";
		}else if(document.getElementById("txtRegFormCompanyLocalName").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyLocalNameLength").value + "\n";
		}else if (checkEnglishInput(document.getElementById("txtRegFormCompanyLocalName").value) == false){
			errMessage += document.getElementById("valTxtRegFormCompanyNonEnglish").value + "\n";
		}
		
		if(!checkAddress()){
			errMessage += document.getElementById("custValTxtContactAddress").value + "\n";
		}

		if (serverhost != "crm-ae1.messefrankfurt.com")		
		{
			if(document.getElementById("txtRegFormCompanyAddressZip").value.length == 0){
				errMessage += document.getElementById("custValTxtZip").value + "\n";
			}
		}
		if (serverhost == "crm-ae1.messefrankfurt.com")		
		{
			if(document.getElementById("txtRegFormCompanyAddressCity").value.length == 0){
				errMessage += document.getElementById("custValTxtCity").value + "\n";
			}
		}
		
		if(document.getElementById("txtRegFormCompanyAddressRoom").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressRoomLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressFloor").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressFloorLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressBuilding").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressBuildingLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressRoad").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressRoadLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressDistrict").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressDistrictLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressCity").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressCityLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressZip").value.length > 16){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressZipLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressStateAndProvince").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressStateAndProvinceLength").value + "\n";
		}
		
		if(!checkCountry()){
			errMessage += document.getElementById("custValDdlRegFormCompanyAddressCountry").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelCountryCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormTelCountryCodeLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelAreaCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormTelAreaCodeLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelLocalNo").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormTelLocalNoLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelExt").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormTelExtLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelLocalNo").value.length == 0){
			errMessage += document.getElementById("valTxtRegFormTelLocalNo").value + "\n";
		}
		
		//if(document.getElementById("txtRegFormFaxLocalNo").value.length == 0){
		//	errMessage += document.getElementById("valVorTxtRegFormFaxLocalNo").value + "\n";
		//}
		
		if(document.getElementById("txtRegFormFaxCountryCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormFaxCountryCodeLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormFaxAreaCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormFaxAreaCodeLength").value + "\n";
		}
		
		//if(document.getElementById("txtRegFormFaxLocalNo").value.length > 32){
		//	errMessage += document.getElementById("regValTxtRegFormFaxLocalNoLength").value + "\n";
		//}
		
		if(document.getElementById("txtVorRegFormWebsite").value.length > 128){
			errMessage += document.getElementById("regValVorTxtRegFormWebsiteLength").value + "\n";
		}
		
		if(!checkTel()){
			errMessage += document.getElementById("custValTxtRegFormTelNumberOnly").value + "\n";
		}
		
		if(!checkFax()){
			errMessage += document.getElementById("custValTxtRegFormFaxNumberOnly").value + "\n";
		}

		if (document.getElementById("hdnCustValTxtRegFormBusinessProfile").value == "Y") {
		    if (!checkBusinessProfile()) {
		        errMessage += document.getElementById("custValTxtRegFormBusinessProfile").value + "\n";
		    }
		}

       if($("#tblRegFormBusinessProfile input:checkbox:eq(0)").attr("checked")) {
		if(document.getElementById("hdnCustValTxtRegFormBusinessCategory").value == "Y"){
			if(!checkBusinessCategory()){
				errMessage += document.getElementById("custValTxtRegFormBusinessCategory").value + "\n";
			}
		}

		
		if(document.getElementById("hdnCustValTxtRegFormBusinessNature").value == "Y"){
	    if(!checkBusinessNature()){
						errMessage += document.getElementById("custValTxtRegFormBusinessNature").value + "\n";
						}
			
		}
		
		if(document.getElementById("hdnCustValTxtRegFormNumOfEmployer").value == "Y"){
			if(!checkNumOfEmployer()){
				errMessage += document.getElementById("custValTxtRegFormNumOfEmployer").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormMainInterest").value == "Y"){
			if(!checkMainInterest()){
				errMessage += document.getElementById("custValTxtRegFormMainInterest").value + "\n";
			} 
			}
	}
		
		if(document.getElementById("hdnCustValTxtRegFormJobFunction").value == "Y"){
			if(!checkJobFunction()){
				errMessage += document.getElementById("custValTxtRegFormJobFunction").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormPurchasingAuthority").value == "Y"){
			if(!checkPurchasingAuthority()){
				errMessage += document.getElementById("custValTxtRegFormPurchasingAuthority").value + "\n";
			}
		}

		if(document.getElementById("hdnCustValTxtRegFormRegionSourcing").value == "Y"){
			if(!checkRegionSourcing()){
				errMessage += document.getElementById("custValTxtRegFormRegionSourcing").value + "\n";
			}
		}
		

		
		if(document.getElementById("hdnCustValTxtRegFormVisitPurpose").value == "Y"){
			if(!checkVisitPurpose()){
				errMessage += document.getElementById("custValTxtRegFormVisitPurpose").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormHowToKnow").value == "Y"){
			if(!checkHowToKnow()){
				errMessage += document.getElementById("custValTxtRegFormHowToKnow").value + "\n";
			}
		}

		if(document.getElementById("hdnCustValTxtRegFormLuckyDraw").value == "Y"){
			if(!checkLuckyDraw()){
				errMessage += document.getElementById("custValTxtRegFormLuckyDraw").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormTermsAndCondition").value == "Y"){
			if(!checkTermsAndCondition()){
				errMessage += document.getElementById("custValTxtRegFormTermsAndCondition").value + "\n";
			}
		}
	
	// newly added checking to user must provide both username and password
	} else if (task == "logon") {
		if (GenericValidator.isBlankOrNull(document.getElementById("txtVisitorUsername").value) || GenericValidator.isBlankOrNull(document.getElementById("txtVisitorPassword").value)) {
			return false;
		}
	}
	
	if(errMessage != ""){
		alert(errMessage)
		return false;
	}else{
		document.getElementById("hdnTask").value = task;
		if(task == "save"){
			//save
			document.frm.submit();
		}else{
			//logon
			document.frm.submit();
		}
		return true;
	}
}

function jsSubmit925ZhHK(task, language)
{
	var errMessage = ""
	var serverhost = window.location.host		
	
	if(task == "save"){
		//2011-12-12
		if(document.getElementById("txtRegFormUsername").value.length <= 3){
			errMessage += document.getElementById("valTxtRegFormUsername").value + "\n";
		} 
		
		if(document.getElementById("txtRegFormEmail").value.length == 0){
			errMessage += document.getElementById("valTxtRegFormEmail").value + "\n";
		}else if(!GenericValidator.isEmail(document.getElementById("txtRegFormEmail").value)){
			errMessage += document.getElementById("regValTxtRegFormEmail").value + "\n";
		}
		
		if(document.getElementById("txtRegFormPassword").value.length == 0){
			errMessage += document.getElementById("valTxtRegFormPassword").value + "\n";
		}else if(document.getElementById("txtRegFormPassword").value.length > 10){
			errMessage += document.getElementById("regValTxtRegFormPasswordLength").value + "\n";
		}

		if(!checkPrefix()){
			errMessage += document.getElementById("custValDdlRegFormPrefix").value + "\n";
		}
		
		if(!checkChineseName()){
			errMessage += document.getElementById("custValTxtChineseName").value +"\n"
		}else if(document.getElementById("txtRegFormChineseName").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormChineseNameLength").value + "\n";
		} 
		
		if(!checkEnglishName()){
			errMessage += document.getElementById("custValTxtName").value +"\n"
		}else if(document.getElementById("txtRegFormGivenName").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormGivenNameLength").value + "\n";
		}else if (checkEnglishInput(document.getElementById("txtRegFormGivenName").value) == false){
			errMessage += document.getElementById("valTxtRegFormNameNonEnglish").value + "\n";
		}
		
		if(document.getElementById("txtRegFormChinesePosition").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormChinesePositionLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormPosition").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormPositionLength").value + "\n";
		}else if (checkEnglishInput(document.getElementById("txtRegFormPosition").value) == false){
			errMessage += document.getElementById("valTxtRegFormPositionNonEnglish").value + "\n";
		}
		
		if (GenericValidator.isBlankOrNull($("#txtRegFormChinesePosition").val())) {
			if (language == "zh-hk") {
				errMessage += "請輸入職稱\n";
			}
			else {
				errMessage += "Please enter your job title\n";
			}
		}
		
		if(document.getElementById("txtRegFormMobileCountryCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormMobileCountryCodeLength").value + "\n";
		}

		if(!checkComplusoryMobile()){
			errMessage += document.getElementById("custValTxtRegFormMobileInputAll").value + "\n";
		}
	
		
		if(!checkMobile()){
			errMessage += document.getElementById("custValTxtRegFormMobileNumberOnly").value + "\n";
		}
		
		if(!checkMobileInputAll()){
			errMessage += document.getElementById("custValTxtRegFormMobileInputAll").value + "\n";
		}
		
		if(document.getElementById("txtRegFormMobile").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormMobileLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormChineseCompanyLocalName").value.length == 0){
			errMessage += document.getElementById("valTxtRegFormChineseCompanyLocalName").value + "\n";
		}else if(document.getElementById("txtRegFormChineseCompanyLocalName").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormChineseCompanyLocalNameLength").value + "\n";
		}
		
		if(!checkEnglishCompanyName()){
			errMessage += document.getElementById("valTxtRegFormCompanyLocalName").value + "\n";
		}else if(document.getElementById("txtRegFormCompanyLocalName").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyLocalNameLength").value + "\n";
		}else if (checkEnglishInput(document.getElementById("txtRegFormCompanyLocalName").value) == false){
			errMessage += document.getElementById("valTxtRegFormCompanyNonEnglish").value + "\n";
		}
		
		if(!checkAddress()){
			errMessage += document.getElementById("custValTxtContactAddress").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressZip").value.length == 0){
			errMessage += document.getElementById("custValTxtZip").value + "\n";
		}
		if(document.getElementById("txtRegFormCompanyAddressRoom").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressRoomLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressFloor").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressFloorLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressBuilding").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressBuildingLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressRoad").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressRoadLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressDistrict").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressDistrictLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressCity").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressCityLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressZip").value.length > 16){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressZipLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormCompanyAddressStateAndProvince").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormCompanyContactAddressStateAndProvinceLength").value + "\n";
		}
		
		if(!checkCountry()){
			errMessage += document.getElementById("custValDdlRegFormCompanyAddressCountry").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelCountryCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormTelCountryCodeLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelAreaCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormTelAreaCodeLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelLocalNo").value.length > 128){
			errMessage += document.getElementById("regValTxtRegFormTelLocalNoLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelExt").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormTelExtLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormTelLocalNo").value.length == 0){
			errMessage += document.getElementById("valTxtRegFormTelLocalNo").value + "\n";
		}
		
		//if(document.getElementById("txtRegFormFaxLocalNo").value.length == 0){
		//	errMessage += document.getElementById("valVorTxtRegFormFaxLocalNo").value + "\n";
		//}
		
		if(document.getElementById("txtRegFormFaxCountryCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormFaxCountryCodeLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormFaxAreaCode").value.length > 4){
			errMessage += document.getElementById("regValTxtRegFormFaxAreaCodeLength").value + "\n";
		}
		
		if(document.getElementById("txtRegFormFaxLocalNo").value.length > 32){
			errMessage += document.getElementById("regValTxtRegFormFaxLocalNoLength").value + "\n";
		}
		
		if(document.getElementById("txtVorRegFormWebsite").value.length > 128){
			errMessage += document.getElementById("regValVorTxtRegFormWebsiteLength").value + "\n";
		}
		
		if(!checkTel()){
			errMessage += document.getElementById("custValTxtRegFormTelNumberOnly").value + "\n";
		}
		
		if(!checkFax()){
			errMessage += document.getElementById("custValTxtRegFormFaxNumberOnly").value + "\n";
		}
		
		if(document.getElementById("hdnCustValTxtRegFormBusinessProfile").value == "Y"){
			if(!checkBusinessProfile()){
				errMessage += document.getElementById("custValTxtRegFormBusinessProfile").value + "\n";
			}
          }

       if($("#tblRegFormBusinessProfile input:checkbox:eq(0)").attr("checked")) {
           if (document.getElementById("hdnCustValTxtRegFormBusinessCategory").value == "Y")
		   {
			if(!checkBusinessCategory()){
				errMessage += document.getElementById("custValTxtRegFormBusinessCategory").value + "\n";
			}
		  }
		
		if(document.getElementById("hdnCustValTxtRegFormBusinessNature").value == "Y"){
		if(!checkBusinessNature()){
			errMessage += document.getElementById("custValTxtRegFormBusinessNature").value + "\n";
				
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormNumOfEmployer").value == "Y"){
			if(!checkNumOfEmployer()){
				errMessage += document.getElementById("custValTxtRegFormNumOfEmployer").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormMainInterest").value == "Y"){
			if(!checkMainInterest()){
				errMessage += document.getElementById("custValTxtRegFormMainInterest").value + "\n";
			}
			}
			
		}
		
		if(document.getElementById("hdnCustValTxtRegFormJobFunction").value == "Y"){
			if(!checkJobFunction()){
				errMessage += document.getElementById("custValTxtRegFormJobFunction").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormPurchasingAuthority").value == "Y"){
			if(!checkPurchasingAuthority()){
				errMessage += document.getElementById("custValTxtRegFormPurchasingAuthority").value + "\n";
			}
		}


		if(document.getElementById("hdnCustValTxtRegFormRegionSourcing").value == "Y"){
			if(!checkRegionSourcing()){
				errMessage += document.getElementById("custValTxtRegFormRegionSourcing").value + "\n";
			}
		}

		
		if(document.getElementById("hdnCustValTxtRegFormVisitPurpose").value == "Y"){
			if(!checkVisitPurpose()){
				errMessage += document.getElementById("custValTxtRegFormVisitPurpose").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormHowToKnow").value == "Y"){
			if(!checkHowToKnow()){
				errMessage += document.getElementById("custValTxtRegFormHowToKnow").value + "\n";
			}
		}

		if(document.getElementById("hdnCustValTxtRegFormLuckyDraw").value == "Y"){
			if(!checkLuckyDraw()){
				errMessage += document.getElementById("custValTxtRegFormLuckyDraw").value + "\n";
			}
		}
		
		if(document.getElementById("hdnCustValTxtRegFormTermsAndCondition").value == "Y"){
			if(!checkTermsAndCondition()){
				errMessage += document.getElementById("custValTxtRegFormTermsAndCondition").value + "\n";
			}
		}

	// newly added checking to user must provide both username and password
	} else if (task == "logon") {
		if (GenericValidator.isBlankOrNull(document.getElementById("txtVisitorUsername").value) || GenericValidator.isBlankOrNull(document.getElementById("txtVisitorPassword").value)) {
			return false;
		}
	}
	
	if(errMessage != ""){
		alert(errMessage)
		return false;
	}else{
		document.getElementById("hdnTask").value = task;
		if(task == "save"){
			//save
			document.frm.submit();
		}else{
			//logon
			document.frm.submit();
		}
		return true;
	}
}

