// -----------------------------------------------------------
// netmemberMaintenanceStatus Variable:
// 0 = Not in maintenance (Normal)
// 1 = In Maintenance (Maintenance page will be popped

var netmemberMaintenanceStatus = 0;
var giftcardMaintenanceStatus  = 0;

// -----------------------------------------------------------


function getHost(thisURL)
{
	//var currURL = document.location.href;
	var aryURL;
	var strOutput = "";

	if (thisURL.substring(0,4) == "http")
	{
		aryURL = thisURL.split("/");
		return aryURL[2];
	}
	else
	{
		return false;
	}
}

function getWCMRoot()
{
  var strWCMRoot    = "/wps/wcm/myconnect/aeonweb";
  return strWCMRoot;
}

function getCurrLang()
{
	var currURL  = document.location.href;
	var currLang = false;
	
	var rootTC = "aeonweb/TC/";
	var rootEN = "aeonweb/EN/";
	var rootJP = "aeonweb/JP/";

	if (currURL.indexOf(rootTC) != -1) {  currLang = "TC"; }
	if (currURL.indexOf(rootEN) != -1) {  currLang = "EN"; }
	if (currURL.indexOf(rootJP) != -1) {  currLang = "JP"; }
	
	return currLang;
}

function getContentID()
{
	var currURL = document.location.href;
	var strKey  = "?id=";

	if (currURL.indexOf(strKey) != -1)
	{
		var aryURL = currURL.split(strKey);
		if (aryURL.length > 0)
		{
			var contentID = aryURL[aryURL.length - 1];
			return contentID;
		}
	}
	else
	{
		return false;
	}
}

function switchLanguage(strTargetLangCode)
{
	var currURL  = document.location.href;
	if (strTargetLangCode != "")
	{
		//window.location = getWCMRoot() + "/" + strTargetLangCode + "/";
		//window.location = "../" + strTargetLangCode + "/";
		window.location = currURL.replace("/"+getCurrLang()+"/","/"+strTargetLangCode+"/");
	}
}


function goRelativeLink(strDestination)
{
	window.location = strDestination;
}
function popRelativeLink(strDestination,strWinName,strWinParam)
{	
	var win_pop = window.open(strDestination,strWinName,strWinParam);
	win_pop.focus();
}



function goAbsoluteLink(strDestination)
{
	if (strDestination != "#")
    {
    	var strWCMRoot = getWCMRoot() + "/" +  getCurrLang();
    	window.location = strWCMRoot + strDestination;
    }
	else
    {
    	goRelativeLink(strDestination);
    }  
}
function popAbsoluteLink(strDestination,strWinName,strWinParam)
{
    var strWCMRoot = getWCMRoot() + "/" +  getCurrLang();
    var win_pop = window.open(strWCMRoot + strDestination,strWinName,strWinParam);
    win_pop.focus();
}

function popLoanCalculator()
{
	popAbsoluteLink('/others/loan_calculator/','win_loancalculator','width=480,height=444,scrollbars=0,resizable=0')
}

function getPdfDownloadPath()
{
   var strPDFRoot = "/wps/wcm/jsp/aeonweb/pdf_form/";
   return strPDFRoot;
}

function downloadPDF(strRelativePath)
{
    var strPDFRoot = getPdfDownloadPath();
    var win_pop = window.open(strPDFRoot + strRelativePath);
    win_pop.focus();
}




// Index Search Pull-down
function updateOptionList(firstObjectID,secObjectID)
{
	//'index_search_sec_option'
	
	var firstOptionList      = getElement(firstObjectID);
	var   secOptionList      = getElement(  secObjectID);
	
	var firstOptionListValue = firstOptionList.options[firstOptionList.options.selectedIndex].value
	if (firstOptionListValue == "CREDITCARD")
	{
		secOptionList.disabled = false;
		clearOptionList(secObjectID);
		indexSearch_mapCreditcardOption(secObjectID);
	}
	else if (firstOptionListValue == "LOAN")
	{
		secOptionList.disabled = false;
		clearOptionList(secObjectID);
		indexSearch_mapLoanOption(secObjectID);
	}
	else if (firstOptionListValue == "INSURANCE")
	{
		secOptionList.disabled = false;
		clearOptionList(secObjectID);
		indexSearch_mapInsuranceOption(secObjectID);
	}
	else
	{
		secOptionList.disabled = true;
		clearOptionList(secObjectID);
	}
	
}

function clearOptionList(targetObjID)
{
	var objSecOption = getElement(targetObjID);
	if (objSecOption.options.length > 0)
	{
		var objSecOptionLength = objSecOption.options.length;
		for (i=objSecOptionLength; i >= 0 ; --i)
		{
			objSecOption.options[i] = null;
		}
	}
}

// -----------------------------------------------------------------------------

function showBranchMap(mapImage)
{
	var currLang  = getCurrLang();
	var strOutput = '';
	
	if (mapImage.length > 0)
	{
		strOutput += '<table style="font-size:9pt; font-family:arial" border="0" cellspacing="1" cellpadding="0" bgcolor="7ddadc">';
		strOutput += '<tr><td>';
		strOutput += '	<table style="font-size:9pt; font-family:arial" width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">';
		strOutput += '	<tr> ';
		strOutput += '		<td><img src="/wps/wcm/jsp/aeonweb/images.branchdetail_' + currLang.toLowerCase() + '/map_header.jpg" width="491" height="20"></td>';
		strOutput += '		<td align="right"><a href="javascript:print();"><img src="/wps/wcm/jsp/aeonweb/images.branchdetail_' + currLang.toLowerCase() + '/btn_print.gif" width="59" height="20" border="0"></a></td>';
		strOutput += '	</tr>';
		strOutput += '	</table>';
		strOutput += '</td></tr>';
		strOutput += '<tr><td HEIGHT=300 ALIGN=CENTER>'+ mapImage +'</td></tr>';
		strOutput += '</table>';
	}
	else
	{
		strOutput += '<BR><BR>';
	}

	return strOutput;
}




// ------------------------------------------------------------------------------

function popAeonNetMemberRegistration()
{
	popAeonNetmemberRegistration();
}
function popAeonNetmemberRegistration()
{
	var currURL  = document.location.href;
	var currLang = getCurrLang();
	var  appLang = (currLang == "TC")? "ZH" : currLang.toUpperCase();
	var  appURL  = "/aeon_awip/registration.do?language=" + appLang +"#popped";
	//var  appURL  = "/AeonNetmemberApp/registration.do?lang=" + appLang;
	
	if (netmemberMaintenanceStatus == 0)
	{
		// If it's on the Production Server, add HTTPS
		if (currURL.indexOf('www2.aeon.com.hk') != -1 || currURL.indexOf('www.aeon.com.hk') != -1)
		{
			appURL = "https://" + getHost(currURL) + appURL;
		}
		else
		{
			appURL = "http://" + getHost(currURL) + appURL;
		}
    	
		// Convert the PORT from 9081 to 9080
		//if (currURL.indexOf(':9081') != -1)
		//{
		//	appURL = appURL.replace(':9081',':9080');
		//}
	}
	else
	{
		appURL = "http://www.aeon.com.hk/index_maintenance.html";
	}

	// Pop Windows
	var win_pop = window.open(appURL,'aeon_netmember_reg','width=975, height=596, top=5, left=5, scrollbars=1, resizable=1,status=1');
	win_pop.focus();
	//win_pop.win_pop.resizeTo(975+40,596+70);
}

function popAeonNetMemberLogon()
{
	popAeonNetmemberLogon();
}

function popAeonNetmemberLogon()
{
	var currURL  = document.location.href;
	var currLang = getCurrLang();
	var  appLang = (currLang == "TC")? "ZH" : currLang.toUpperCase();
	var  appURL  = "/aeon_awip/logon.do?language=" + appLang +"#popped";
	//var  appURL  = "/AeonNetmemberApp/logon.do?lang=" + appLang;
	
	if (netmemberMaintenanceStatus == 0)
	{
		// If it's on the Production Server, add HTTPS
		if (currURL.indexOf('www2.aeon.com.hk') != -1 || currURL.indexOf('www.aeon.com.hk') != -1)
		{
			appURL = "https://" + getHost(currURL) + appURL;
		}
		else
		{
			appURL = "http://" + getHost(currURL) + appURL;
		}
    	
		// Convert the PORT from 9081 to 9080
		//if (currURL.indexOf(':9081') != -1)
		//{
		//	appURL = appURL.replace(':9081',':9080');
		//}
	}
	else
	{
		appURL = "http://www.aeon.com.hk/index_maintenance.html";
	}

	// Pop Windows
	var win_pop = window.open(appURL,'aeon_netmember_win','width=975, height=580, top=15, left=15, scrollbars=1, resizable=1,status=1');
	win_pop.focus();
	//win_pop.resizeTo(975+40,580+70);
}


function popAeonNetmemberStaticPage(dest)
{
	var currURL  = document.location.href;
	var currLang = getCurrLang();
	var  appLang = (currLang == "TC")? "ZH" : currLang.toUpperCase();
	var  appURL  = "/aeon_awip/" +dest+ "&language=" + appLang;
	//var  appURL  = "/AeonNetmemberApp/logon.do?lang=" + appLang;
	
	if (netmemberMaintenanceStatus == 0)
	{
		// If it's on the Production Server, add HTTPS
		if (currURL.indexOf('www2.aeon.com.hk') != -1 || currURL.indexOf('www.aeon.com.hk') != -1)
		{
			appURL = "https://" + getHost(currURL) + appURL;
		}
		else
		{
			appURL = "http://" + getHost(currURL) + appURL;
		}
    	
		// Convert the PORT from 9081 to 9080
		//if (currURL.indexOf(':9081') != -1)
		//{
		//	appURL = appURL.replace(':9081',':9080');
		//}
	}
	else
	{
		appURL = "http://www.aeon.com.hk/index_maintenance.html";
	}

	// Pop Windows
	var win_pop = window.open(appURL,'aeon_netmember_win','width=975, height=580, top=15, left=15, scrollbars=1, resizable=1,status=1');
	win_pop.focus();
	//win_pop.resizeTo(975+40,580+70);
}

function popNetmemberMemberIntroWithReg()
{
	var currURL  = document.location.href;
	var currLang = getCurrLang();
	var  appLang = (currLang == "TC")? "ZH" : currLang.toUpperCase();
	var  appURL  = "/aeon_awip/footer.do?method=displayMemberIntro&popup=true&showreg=true&language=" + appLang +"#popped";
	//var  appURL  = "/AeonNetmemberApp/registration.do?lang=" + appLang;
	
	if (netmemberMaintenanceStatus == 0)
	{
		// If it's on the Production Server, add HTTPS
		if (currURL.indexOf('www2.aeon.com.hk') != -1 || currURL.indexOf('www.aeon.com.hk') != -1)
		{
			appURL = "https://" + getHost(currURL) + appURL;
		}
		else
		{
			appURL = "http://" + getHost(currURL) + appURL;
		}
    	
		// Convert the PORT from 9081 to 9080
		//if (currURL.indexOf(':9081') != -1)
		//{
		//	appURL = appURL.replace(':9081',':9080');
		//}
	}
	else
	{
		appURL = "http://www.aeon.com.hk/index_maintenance.html";
	}

	// Pop Windows
	var win_pop = window.open(appURL,'aeon_netmember_reg','width=975, height=596, top=5, left=5, scrollbars=1, resizable=1,status=1');
	win_pop.focus();
	//win_pop.win_pop.resizeTo(975+40,596+70);
}
function popNetmemberRegGuideWithReg()
{
	var currURL  = document.location.href;
	var currLang = getCurrLang();
	var  appLang = (currLang == "TC")? "ZH" : currLang.toUpperCase();
	var  appURL  = "/aeon_awip/footer.do?method=displayRegGuideFlash&popup=true&showreg=true&language=" + appLang +"#popped";
	//var  appURL  = "/AeonNetmemberApp/registration.do?lang=" + appLang;
	
	if (netmemberMaintenanceStatus == 0)
	{
		// If it's on the Production Server, add HTTPS
		if (currURL.indexOf('www2.aeon.com.hk') != -1 || currURL.indexOf('www.aeon.com.hk') != -1)
		{
			appURL = "https://" + getHost(currURL) + appURL;
		}
		else
		{
			appURL = "http://" + getHost(currURL) + appURL;
		}
    	
		// Convert the PORT from 9081 to 9080
		//if (currURL.indexOf(':9081') != -1)
		//{
		//	appURL = appURL.replace(':9081',':9080');
		//}
	}
	else
	{
		appURL = "http://www.aeon.com.hk/index_maintenance.html";
	}

	// Pop Windows
	var win_pop = window.open(appURL,'aeon_netmember_reg','width=975, height=596, top=5, left=5, scrollbars=1, resizable=1,status=1');
	win_pop.focus();
	//win_pop.win_pop.resizeTo(975+40,596+70);
}

function popAeonOssHome()
{
	var currURL  = document.location.href;
	var currLang = getCurrLang();
	var  appLang = (currLang == "TC")? "ZH" : currLang.toUpperCase();
	var  appURL  = "/aeon_awip/osg/customer/index.do#popped";//?language=" + appLang;
	appURL = "https://" + getHost(currURL) + appURL;
	
	if (appLang == "EN") { appURL += "#swEN"; }
	
	// Pop Windows
	var win_pop = window.open(appURL,'aeon_netmember_win','width=975, height=740, top=15, left=15, scrollbars=1, resizable=1,status=1');
	win_pop.focus();
	//win_pop.resizeTo(975+40,740+70);
}

function popAeonOSSHome()
{
	return popAeonOssHome();
}







function popAeonOceanParkPopup()
{
	var currURL  = document.location.href;
	var currLang = getCurrLang();
	var  appLang = (currLang == "TC")? "ZH" : currLang.toUpperCase();
	var  appURL  = "/aeon_awip/ecampaignPopup.jsp?lang=" + appLang;
	//var  appURL  = "/AeonNetmemberApp/logon.do?lang=" + appLang;
	
	if (netmemberMaintenanceStatus == 0)
	{
		// If it's on the Production Server, add HTTPS
		if (currURL.indexOf('www2.aeon.com.hk') != -1 || currURL.indexOf('www.aeon.com.hk') != -1)
		{
			appURL = "https://" + getHost(currURL) + appURL;
		}
		else
		{
			appURL = "http://" + getHost(currURL) + appURL;
		}
    	
		// Convert the PORT from 9081 to 9080
		//if (currURL.indexOf(':9081') != -1)
		//{
		//	appURL = appURL.replace(':9081',':9080');
		//}
	}
	else
	{
		appURL = "http://www.aeon.com.hk/index_maintenance.html";
	}

	// Pop Windows
	var win_pop = window.open(appURL,'aeon_op_popup','width=621, height=550, top=15, left=15, scrollbars=1, resizable=0,status=1');
	win_pop.focus();
}


// ------------------------------------------------------------------------------

function popAeonGiftCardHome()
{
	var currURL  = document.location.href;
	var currLang = getCurrLang();
	var  appLang = (currLang == "TC")? "ZH" : currLang.toUpperCase();
	var  appURL  = (isIE()) ? "/aeon_giftcard/?lang=" + appLang : "/aeon_giftcard/";
	
	if (giftcardMaintenanceStatus == 0)
	{
		// If it's on the Production Server, add HTTPS
		if (currURL.indexOf('www2.aeon.com.hk') != -1 || currURL.indexOf('www.aeon.com.hk') != -1)
		{
			appURL = "https://" + getHost(currURL) + appURL;
		}
		else
		{
			appURL = "http://" + getHost(currURL) + appURL;
		}
    	
		// Convert the PORT from 9081 to 9080
		if (currURL.indexOf(':9081') != -1)
		{
			appURL = appURL.replace(':9081',':9080');
		}
	}
	else
	{
		appURL = "http://www.aeon.com.hk/index_maintenance.html";
	}

	// Pop Windows
	//var win_pop = window.open(appURL);
	var win_pop = window.open(appURL,'aeon_giftcard_win','width=975, height=580, top=30, left=30, scrollbars=1, resizable=1,status=1');
	win_pop.focus();
}

// ------------------------------------------------------------------------------

function popCardApplication(cardID)
{
	var currURL  = document.location.href;
	var currLang = getCurrLang();
	var  appLang = (currLang == "TC")? "zh" : currLang.toLowerCase();
	var  appURL  = "/AeonApplication/AeonCard.do?method=display&lang=" + appLang;
	
	// If CardID variable is available
	if (cardID != "" && cardID != false)
	{
		appURL += "&cardType=" + cardID;
	}
	
	// If it's on the Production Server, add HTTPS
	if (currURL.indexOf('www2.aeon.com.hk') != -1 || currURL.indexOf('www.aeon.com.hk') != -1)
	{
		appURL = "https://" + getHost(currURL) + appURL;
	}
	
	// Pop Windows
	var win_pop = window.open(appURL,'card_app_form','width=651, height=550, scrollbars=1, resizable=1,status=1');
	win_pop.focus();
}
function popLoanApplication()
{
	var currURL  = document.location.href;
	var currLang = getCurrLang();
	var  appLang = (currLang == "TC")? "zh" : currLang.toLowerCase();
	var  appURL  = '/AeonApplication/AeonLoan.do?method=display&lang=' + appLang;
	
	// If it's on the Production Server, add HTTPS
	if (currURL.indexOf('www2.aeon.com.hk') != -1 || currURL.indexOf('www.aeon.com.hk') != -1)
	{
		appURL = "https://" + getHost(currURL) + appURL;
	}
	
	var win_pop = window.open(appURL,'loan_app_form','width=651, height=550, scrollbars=1, resizable=1,status=1');
	win_pop.focus();
}

function popRebateLoanApplication()
{
	var currURL  = document.location.href;
	var currLang = getCurrLang();
	var  appLang = (currLang == "TC")? "zh" : currLang.toLowerCase();
	var  appURL  = '/AeonApplication/AeonRebateLoan.do?method=display&lang=' + appLang;
	
	// If it's on the Production Server, add HTTPS
	if (currURL.indexOf('www2.aeon.com.hk') != -1 || currURL.indexOf('www.aeon.com.hk') != -1)
	{
		appURL = "https://" + getHost(currURL) + appURL;
	}
	
	var win_pop = window.open(appURL,'rebateloan_app_form','width=651, height=550, scrollbars=1, resizable=1,status=1');
	win_pop.focus();
}

function popTaxLoanApplication()
{
	var currURL  = document.location.href;
	var currLang = getCurrLang();
	var  appLang = (currLang == "TC")? "zh" : currLang.toLowerCase();
	var  appURL  = '/AeonApplication/AeonTaxLoan.do?method=display&lang=' + appLang;
	
	// If it's on the Production Server, add HTTPS
	if (currURL.indexOf('www2.aeon.com.hk') != -1 || currURL.indexOf('www.aeon.com.hk') != -1)
	{
		appURL = "https://" + getHost(currURL) + appURL;
	}
	
	var win_pop = window.open(appURL,'taxloan_app_form','width=651, height=550, scrollbars=1, resizable=1,status=1');
	win_pop.focus();
}

function popCashAdvanceApplication()
{
	var win_pop = window.open('https://www2.aeon.com.hk/cashing/form.html');
	win_pop.focus();
}
function popBonusPointRedemption()
{
	/*
	var currLang = getCurrLang();
	if (currLang == "TC")
	{
		// TC (Trad Chinese Version)
		var win_pop = window.open('http://www2.aeon.com.hk/web/awip/bonus_point.htm');
	}
	else
	{
		// EN (English Version)
		var win_pop = window.open('https://www2.aeon.com.hk/web/chinese/card/bonus_point/e_monthly.php');
		//var win_pop = window.open('http://www2.aeon.com.hk/web/card/bonus_point/gift_home_electric.htm');
	}
	win_pop.focus();
	*/
	goAbsoluteLink('/main_creditcard/bonus_pt/');
}
function popInsuranceGetQuote()
{
	var win_pop = window.open('https://www2.aeon.com.hk/insurance/ace_travel_ins.php3');
	win_pop.focus();
}
function popInsuranceSite()
{
	var aibUrlZh = "http://www.aeonbrokers.com.hk/web/guest/home?p_p_id=82&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&p_p_col_count=1&_82_struts_action=%2Flanguage%2Fview&languageId=zh_TW";
	var aibUrlEn = "http://www.aeonbrokers.com.hk/web/guest/home?p_p_id=82&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&p_p_col_count=1&_82_struts_action=%2Flanguage%2Fview&languageId=en_US";
	
	var destURL  = (getCurrLang() == "TC") ? aibUrlZh : aibUrlEn;
	var win_pop = window.open(destURL,'','width=1000,height=700,scrollbars=1,resizable=1,menubar=1,toolbar=1,location=1,status=1');
	win_pop.focus();
}





// -------------------------------------------------------------------------------------------------------------------
// Apply now layer for PL REBATE LOAN
//


function showRebateLoanApplyNowLayer()
{
	adjLayerLocation('applyNowLayerBg',940,250);
	adjLayerLocation('applyNowLayerContent',940,250);
	MM_showHideLayers('applyNowLayerBg','','show');
	MM_showHideLayers('applyNowLayerContent','','show');
}
function hideRebateLoanApplyNowLayer()
{
	MM_showHideLayers('applyNowLayerBg','','hide');
	MM_showHideLayers('applyNowLayerContent','','hide');
}


function makeRebateLoanApplyNowLayer(imgPath)
{
	if (imgPath == undefined)
	{
		imgPath = './images/';
	}
	
	var currLang = getCurrLang();
	var leftMargin = (currLang == "TC") ? 105 : 50;
	
	document.write('<div id="applyNowLayerBg" style="position:absolute; top: 230px; visibility: hidden;">');
	document.write('<table width="382" height="203" border="0" cellspacing="10" bgcolor="#848484">');
	document.write('<tr>');
	document.write('	<td valign="top"><table width="100" border="0" cellpadding="0" cellspacing="0">');
	document.write('		<tr>');
	document.write('			<td><img src="'+ imgPath +'rebateloan.layer.header.jpg" width="452" height="44" /></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td height="206" valign="top" background="'+ imgPath +'rebateloan.layer.bg.jpg">');
	document.write('			<table width="445" height="160" border="0" cellpadding="0" cellspacing="0">');
	document.write('				<tr>');
	document.write('					<td><img src="'+ imgPath +'rebateloan.layer.bg.jpg" /></td>');
	document.write('				</tr>');
	document.write('			</table></td>');
	document.write('		</tr>');
	document.write('	</table></td>');
	document.write('</tr>');
	document.write('</table>');
	document.write('</div>');
	document.write('<div id="applyNowLayerContent" style="position:absolute; top: 230px; visibility: hidden;">');
	document.write('<table width="382" height="203" border="0" cellspacing="10">');
	document.write('<tr>');
	document.write('	<td valign="top"><table width="100" border="0" cellpadding="0" cellspacing="0">');
	document.write('		<tr>');
	document.write('			<td height="44"><img src="'+ imgPath +'spacer.gif" width="1" height="1" /></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td height="206" valign="top"><table width="445" height="160" border="0" cellpadding="0" cellspacing="0">');
	document.write('				<tr>');
	document.write('					<td width="'+leftMargin+'" height="51"><img src="'+ imgPath +'spacer.gif" width="'+leftMargin+'" height="66" /></td>');
	document.write('					<td width="66">&nbsp;</td>');
	document.write('					<td width="274">&nbsp;</td>');
	document.write('				</tr>');
	document.write('				<tr>');
	document.write('					<td>&nbsp;</td>');
	document.write('					<td><a href="javascript:blank();" onClick="popAeonNetmemberLogon();" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'layer_btn_login\',\'\',\''+ imgPath +'layer.btn_login_r.jpg\',1)"><img src="'+ imgPath +'layer.btn_login.jpg" name="layer_btn_login" border="0" id="layer_btn_login" /></a></td>');
	document.write('					<td>&nbsp;</td>');
	document.write('				</tr>');
	document.write('				<tr>');
	document.write('					<td height="39"><img src="'+ imgPath +'spacer.gif" width="'+leftMargin+'" height="1" /></td>');
	document.write('					<td>&nbsp;</td>');
	document.write('					<td>&nbsp;</td>');
	document.write('				</tr>');
	document.write('				<tr>');
	document.write('					<td>&nbsp;</td>');
	document.write('					<td><a href="javascript:blank();" onClick="popRebateLoanApplication();" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'layer_btn_apply\',\'\',\''+ imgPath +'rebateloan.layer.btn_apply_r.jpg\',1)"><img src="'+ imgPath +'rebateloan.layer.btn_apply.jpg" name="layer_btn_apply" border="0" id="layer_btn_apply" /></a></td>');
	document.write('					<td>&nbsp;</td>');
	document.write('				</tr>');
	document.write('				<tr>');
	document.write('					<td><img src="'+ imgPath +'spacer.gif" width="'+leftMargin+'" height="10" /></td>');
	document.write('					<td></td>');
	document.write('					<td></td>');
	document.write('				</tr>');
	document.write('				<tr>');
	document.write('					<td>&nbsp;</td>');
	document.write('					<td>&nbsp;</td>');
	document.write('					<td align="right"><a href="javascript:hideApplyNowLayer();"><img src="'+ imgPath +'layer.btn_close.jpg" width="15" height="15" vspace="2" border="0" /></a></td>');
	document.write('				</tr>');
	document.write('			</table></td>');
	document.write('		</tr>');
	document.write('	</table></td>');
	document.write('</tr>');
	document.write('</table>');
	document.write('</div>');
}

// -------------------------------------------------------------------------------------------------------------------
// Apply now layer for TAX LOAN
//


function showTaxLoanApplyNowLayer()
{
	adjLayerLocation('applyNowLayerBg',940,250);
	adjLayerLocation('applyNowLayerContent',940,250);
	MM_showHideLayers('applyNowLayerBg','','show');
	MM_showHideLayers('applyNowLayerContent','','show');
}
function hideTaxLoanApplyNowLayer()
{
	MM_showHideLayers('applyNowLayerBg','','hide');
	MM_showHideLayers('applyNowLayerContent','','hide');
}


function makeTaxLoanApplyNowLayer(imgPath)
{
	if (imgPath == undefined)
	{
		imgPath = './images/';
	}
	
	var currLang = getCurrLang();
	var leftMargin = (currLang == "TC") ? 105 : 50;
	
	document.write('<div id="applyNowLayerBg" style="position:absolute; top: 230px; visibility: hidden;">');
	document.write('<table width="382" height="203" border="0" cellspacing="10" bgcolor="#848484">');
	document.write('<tr>');
	document.write('	<td valign="top"><table width="100" border="0" cellpadding="0" cellspacing="0">');
	document.write('		<tr>');
	document.write('			<td><img src="'+ imgPath +'taxloan.layer.header.jpg" width="452" height="44" /></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td height="206" valign="top" background="'+ imgPath +'taxloan.layer.bg.jpg">');
	document.write('			<table width="445" height="160" border="0" cellpadding="0" cellspacing="0">');
	document.write('				<tr>');
	document.write('					<td><img src="'+ imgPath +'taxloan.layer.bg.jpg" /></td>');
	document.write('				</tr>');
	document.write('			</table></td>');
	document.write('		</tr>');
	document.write('	</table></td>');
	document.write('</tr>');
	document.write('</table>');
	document.write('</div>');
	document.write('<div id="applyNowLayerContent" style="position:absolute; top: 230px; visibility: hidden;">');
	document.write('<table width="382" height="203" border="0" cellspacing="10">');
	document.write('<tr>');
	document.write('	<td valign="top"><table width="100" border="0" cellpadding="0" cellspacing="0">');
	document.write('		<tr>');
	document.write('			<td height="44"><img src="'+ imgPath +'spacer.gif" width="1" height="1" /></td>');
	document.write('		</tr>');
	document.write('		<tr>');
	document.write('			<td height="206" valign="top"><table width="445" height="160" border="0" cellpadding="0" cellspacing="0">');
	document.write('				<tr>');
	document.write('					<td width="'+leftMargin+'" height="51"><img src="'+ imgPath +'spacer.gif" width="'+leftMargin+'" height="66" /></td>');
	document.write('					<td width="66">&nbsp;</td>');
	document.write('					<td width="274">&nbsp;</td>');
	document.write('				</tr>');
	document.write('				<tr>');
	document.write('					<td>&nbsp;</td>');
	document.write('					<td><a href="javascript:blank();" onClick="popAeonNetmemberLogon();" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'layer_btn_login\',\'\',\''+ imgPath +'layer.btn_login_r.jpg\',1)"><img src="'+ imgPath +'layer.btn_login.jpg" name="layer_btn_login" border="0" id="layer_btn_login" /></a></td>');
	document.write('					<td>&nbsp;</td>');
	document.write('				</tr>');
	document.write('				<tr>');
	document.write('					<td height="39"><img src="'+ imgPath +'spacer.gif" width="'+leftMargin+'" height="1" /></td>');
	document.write('					<td>&nbsp;</td>');
	document.write('					<td>&nbsp;</td>');
	document.write('				</tr>');
	document.write('				<tr>');
	document.write('					<td>&nbsp;</td>');
	document.write('					<td><a href="javascript:blank();" onClick="popTaxLoanApplication();" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'layer_btn_apply\',\'\',\''+ imgPath +'taxloan.layer.btn_apply_r.jpg\',1)"><img src="'+ imgPath +'taxloan.layer.btn_apply.jpg" name="layer_btn_apply" border="0" id="layer_btn_apply" /></a></td>');
	document.write('					<td>&nbsp;</td>');
	document.write('				</tr>');
	document.write('				<tr>');
	document.write('					<td><img src="'+ imgPath +'spacer.gif" width="'+leftMargin+'" height="10" /></td>');
	document.write('					<td></td>');
	document.write('					<td></td>');
	document.write('				</tr>');
	document.write('				<tr>');
	document.write('					<td>&nbsp;</td>');
	document.write('					<td>&nbsp;</td>');
	document.write('					<td align="right"><a href="javascript:hideApplyNowLayer();"><img src="'+ imgPath +'layer.btn_close.jpg" width="15" height="15" vspace="2" border="0" /></a></td>');
	document.write('				</tr>');
	document.write('			</table></td>');
	document.write('		</tr>');
	document.write('	</table></td>');
	document.write('</tr>');
	document.write('</table>');
	document.write('</div>');
}
