var tempHtml;
var tempStr1;
var tempStr2;
if (section == null)	var section = 0;
if (level1 == null)	var level1 = "";
if (level2 == null)	var level2 = "";
if (level3 == null)	var level3 = "";
var id1 = null;
var id2 = null;
var id3 = null;



if (location.search != '')
{
	if (GetParam('level1'))	level1 = GetParam('level1');
	if (GetParam('level2'))	level2 = GetParam('level2');
	if (GetParam('level3'))	level3 = GetParam('level3');
}



genId();

function genId() {	
	var obj = sectionArray[section];
	
	if (level1 != "") {
		for (var i=0; i<obj.length; i++) {
			//alert(obj[i].id + "  " + level1);
			if (obj[i].id == level1) {
				id1 = i;
				
				if (level2 != "") {
					var obj1 = obj[i].subSection;
					for (var j=0; j<obj1.length; j++) {
						//alert(obj[i].id + "  " + level1);
						if (obj1[j].id == level2) {
							id2 = j;
							
							if (level3 != "") {
								var obj2 = obj1[j].subSection;
								for (var k=0; k<obj2.length; k++) {
									//alert(obj[i].id + "  " + level1);
									if (obj2[k].id == level3) {
										id3 = k;
										break;
									}
								}
							} else {
								break;
							}
						}
					}
				} else {
					break;
				}
			}
		}
	}
//alert("id1: "+id1+"   id2: "+id2+"   id3: "+id3);
}


function genTop() {
	tempHtml = '<table width="100%" cellpadding="0" cellspacing="0" border="0">';
	tempHtml += '<tr>';
	tempHtml += '	<td valign="top" height="72">';
	
	tempHtml += '<table width="100%" cellpadding="0" cellspacing="0" border="0">';
	tempHtml += '<tr valign="top">';
	tempHtml += '	<td width="197" style="padding-top:7px;"><a href="'+path+'index.htm"><img src="'+path+'images/common/logo.gif" border="0"></a></td>';
	//tempHtml += '	<td width="100%" align="right" valign="bottom" style="padding-top:7px; padding-right:73px;"><img src="'+path+'images/common/slogan.gif" width="214" height="20" border="0"></td>';
	tempHtml += '	<td width="100%" align="right" valign="bottom" style="padding-top:7px; padding-right:415px;"><img src="'+path+'images/common/award_logo.jpg" border="0"></td>';
	tempHtml += '	<td style="padding-top:4px;" align="right">';
	tempHtml += '		<table border="0" cellspacing="0" cellpadding="0">';
	tempHtml += '			<tr valign="top">';
	tempHtml += '				<td style="padding-top:5px;"><a href="mailto:nwmarketing@asw.com.hk" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'contact\',\'\',\''+path+'images/common/btn_contact_f2.gif\',1)"><img src="'+path+'images/common/btn_contact.gif" alt="Contact us" width="59" height="9" border="0" name="contact"></a></td>';
/*
	tempHtml += '				<td><img src="'+path+'images/common/line_v.gif" width="1" height="20" hspace="10"></td>';
	tempHtml += '				<td style="padding-top:5px;"><a href="#" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'sitemap\',\'\',\''+path+'images/common/btn_sitemap_f2.gif\',1)"><img src="'+path+'images/common/btn_sitemap.gif" alt="Site Map" width="51" height="12" border="0" name="sitemap"></a></td>';*/
	tempHtml += '				<td><img src="'+path+'images/common/line_v.gif" width="1" height="20" hspace="10"></td>';
	tempHtml += '				<td style="padding-top:5px;"><a href="javascript:changeLanguage(\'chi\');" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'big5\',\'\',\''+path+'images/common/btn_big5_f2.gif\',1)"><img src="'+path+'images/common/btn_big5.gif" alt="&#32321;&#39636;" width="22" height="10" border="0" name="big5"></a></td>';
	tempHtml += '				<td style="padding-top:5px;"><img src="'+path+'images/common/slash.gif" width="4" height="10" hspace="5"></td>';
	tempHtml += '				<td style="padding-top:5px;"><a href="javascript:changeLanguage(\'gb\');" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'gb\',\'\',\''+path+'images/common/btn_gb_f2.gif\',1)"><img src="'+path+'images/common/btn_gb.gif" alt="&#31616;&#20307;" width="22" height="11" border="0" name="gb"></a></td>';
	tempHtml += '			</tr>';
	tempHtml += '		</table>';
	tempHtml += '	</td>';
	tempHtml += '</tr>';
	tempHtml += '</table>';
	tempHtml += '	</td>';
	tempHtml += '</tr>';
	tempHtml += '</table>';
	
	document.write(tempHtml);
}
	

function genLeft() {
	tempHtml = '<div style="position:absolute; z-index:200;" id="leftNav">';
	
	if (section == 1)	tempStr = '72px';	else	tempStr = '72px';
	tempHtml += '<div style="width:175px; position:absolute; top:'+tempStr+'; left:0px; overflow:visible;">';
	
	if (section == 2)	tempStr = '180';	else	tempStr = '';
	tempHtml += '<table width="100%" height="'+tempStr+'" cellpadding="0" cellspacing="0" border="0" class="navBg">';
	
	var sect = 2;
	var obj = sectionArray[sect];
	
	if (section == sect) {
		var color = obj[id1].color;
		var color1 = obj[id1].color1;
		
		tempHtml += '<tr valign="top">';
		tempHtml += '<td bgcolor="'+color+'" style="padding-top:12px; padding-bottom:4px;" height="60">';
		
		tempHtml += '<table cellpadding="0" cellspacing="0" border="0">';
		tempHtml += '<tr>';
		
		var link = path+'location/index.htm?level1='+obj[id1].id;
		tempHtml += '	<td style="padding-left:17px; padding-bottom:5px;"><a href="'+link+'"><img src="'+path+'images/common/'+obj[id1].id+'_txt.gif" alt="'+obj[id1].name+'" border="0"></a></td>';
		tempHtml += '</tr>';
		tempHtml += '<tr>';
		tempHtml += '	<td style="padding-left:14px;">';
		
		tempHtml += '<select name="locationMenu" onChange="MM_jumpMenu(\'parent\',this,0)" class="selectTxt">';
		tempHtml += '<option value="javascript:;">Other Location</option>';
		
		for (var i=0; i<obj.length; i++) {
			if (i != id1)	tempHtml += '<option value="'+path+'location/index.htm?level1='+obj[i].id+'">'+obj[i].name+'</option>';
		}
		
		tempHtml += '</select>';
		
		tempHtml += '	</td>';
		tempHtml += '</tr>';
		tempHtml += '<tr>';
		tempHtml += '	<td><img src="'+path+'images/common/spacer.gif" width="1" height="10" alt=""></td>';
		tempHtml += '</tr>';
		tempHtml += '</table>';
		
		var obj1 = obj[id1].subSection;
		
		if (obj1) {
			tempHtml += '<table width="100%" cellpadding="0" cellspacing="0" border="0">';
			
			for (var j=0; j<obj1.length; j++) {
				
				var obj2 = obj1[j].subSection;
				
				if (obj2) {
					var isSect = 0;
					if (sect == section && id2 == j) {
						isSect = 1;
					}
					
					tempHtml += '<tr valign="top" onMouseOver="leftOver('+id1+', '+j+', 1, '+isSect+');" onMouseOut="leftOver('+id1+', '+j+', 0, '+isSect+');">';
					
					if (sect == section && id2 == j) {
						tempHtml += '<td width="9" style="padding-top:3px; padding-left:14px;" id="tdL'+j+'"><img src="'+path+'images/common/stroke.gif" alt="" width="3" height="8"></td>';
					} else {
						tempHtml += '<td width="9" style="padding-top:5px; padding-left:14px;" id="tdL'+j+'"><img src="'+path+'images/common/point_1.gif" alt="" width="3" height="3"></td>';
					}
					tempHtml += '<td style="padding-bottom:3px; padding-right:10px;" id="tdR'+j+'">';
					
					
					if (obj1[j].pulldown) {
						tempHtml += '<div style="position:absolute;">';
						
						tempHtml += '<div style="width:175px; position:absolute; visibility:hidden; top:0px; left:148px;" id="mainNavMenu'+j+'" onMouseOver="leftOver('+id1+', '+j+', 1, '+isSect+');" onMouseOut="leftOver('+id1+', '+j+', 0, '+isSect+');">';
						tempHtml += '	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="navBg">';
						tempHtml += '		<tr>';
						tempHtml += '			<td width="4"><img src="'+path+'images/common/spacer.gif" alt="" width="4" height="1"></td>';
						
						tempHtml += '			<td style="padding-top:5px; padding-bottom:5px;" bgcolor="'+color1+'">';
						tempHtml += '				<table width="100%" cellpadding="0" cellspacing="0" border="0">';
						
						
						for (var k=0; k<obj2.length; k++) {
							tempHtml += '<tr valign="top">';
							tempHtml += '<td width="9" style="padding-top:5px; padding-left:14px;"><img src="'+path+'images/common/point_1.gif" alt="" width="3" height="3"></td>';
							
							if (id2 == j && id3 == k) {
								tempStr = 'style="font-weight:bold;"';
							} else {
								tempStr = '';
							}
							
							var link = path+'location/details.htm?level1='+level1+'&level2='+obj1[j].id+'&level3='+obj2[k].id;
							tempHtml += '<td style="padding-bottom:3px; padding-right:10px;"><a href="'+link+'" '+tempStr+' class="leftMenu">'+obj2[k].name+'</a></td>';
							tempHtml += '</tr>';
						}
						
						
						tempHtml += '				</table>';
						tempHtml += '			</td>';
						
						tempHtml += '		</tr>';
						tempHtml += '	</table>';
						tempHtml += '</div>';
						tempHtml += '</div>';
					}
					
					
					if (obj1[j].goDetail) {
						var obj2 = obj1[j].subSection;
						var link = path+'location/details.htm?level1='+level1+'&level2='+obj1[j].id+'&level3='+obj2[0].id;
					} else {
						var link = path+'location/main.htm?level1='+level1+'&level2='+obj1[j].id;
					}
					
					if (!obj1[j].pulldown) {
						if (sect == section && id2 == j) {
							tempHtml += '<a href="'+link+'" class="leftMenu" style="font-weight:bold;" id="txt'+j+'">'+obj1[j].name+'</a></td>';
						} else {
							tempHtml += '<a href="'+link+'" class="leftMenu" id="txt'+j+'">'+obj1[j].name+'</a></td>';
						}
					} else {
						tempHtml += '<span class="leftMenu" id="txt'+j+'">'+obj1[j].name+'</span></td>';
					}
					
					tempHtml += '<tr>';
					tempHtml += '<td><img src="'+path+'images/common/spacer.gif" width="1" height="3" alt=""></td>';
					tempHtml += '</tr>';
					
				} else {
					tempHtml += '<tr valign="top">';
					tempHtml += '<td width="9" style="padding-top:5px;"><img src="'+path+'images/common/point_1.gif" alt="" width="3" height="3"></td>';
					
					var link = path+'location/index.htm?level1='+level1+'&level2='+obj1[j].id;
					tempHtml += '<td style="padding-bottom:3px; padding-right:10px;"><a href="'+link+'" class="leftMenu">'+obj1[j].name+'</a></td>';
					tempHtml += '</tr>';
				}
			}
			tempHtml += '</table>';
		}
		
		tempHtml += '</td>';
		tempHtml += '</tr>';
		
	} else {
		tempHtml += '<tr>';
		tempHtml += '<td bgcolor="#6A8CAF" style="padding:12px 0px 5px 14px;">';
		
		tempHtml += '<table cellpadding="0" cellspacing="0" border="0">';
		tempHtml += '<tr>';
		tempHtml += '<td style="padding-left:3px;"><img src="'+path+'images/common/location_txt.gif" alt="Stores by Location"></td>';
		tempHtml += '</tr>';
		tempHtml += '<tr>';
		tempHtml += '<td><img src="'+path+'images/common/spacer.gif" width="1" height="7" alt=""></td>';
		tempHtml += '</tr>';
		tempHtml += '</table>';
		
		tempHtml += '<table width="100%" cellpadding="0" cellspacing="0" border="0">';
		var obj = sectionArray[sect];
		for (var i=0; i<obj.length; i++) {
			tempHtml += '<tr valign="top">';
			
			if (sect == section && id1 == i) {
				tempHtml += '<td width="9" style="padding-top:3px; padding-left:1px;"><img src="'+path+'images/common/stroke.gif" alt="" width="3" height="8"></td>';
				tempStr1 = 'style="font-weight:bold;"';
			} else {
				tempHtml += '<td width="9" style="padding-top:5px;"><img src="'+path+'images/common/point_1.gif" alt="" width="3" height="3"></td>';
				tempStr1 = '';
			}
			
			var link = path+'location/index.htm?level1='+obj[i].id;
			tempHtml += '<td style="padding-bottom:3px; padding-right:10px;"><a href="'+link+'" class="leftMenu" '+tempStr1+'>'+obj[i].name+'</a></td>';
			
			tempHtml += '</tr>';
		}
		tempHtml += '</table>';
		
		tempHtml += '</td>';
		tempHtml += '</tr>';
	}
	
	tempHtml += '<tr>';
	tempHtml += '<td>';
	
	tempHtml += '<table width="100%" cellpadding="0" cellspacing="0" border="0">';
	tempHtml += '<tr>';
	tempHtml += '<td width="15" bgcolor="#C3D1DF"><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="1"></td>';
	tempHtml += '<td width="160" bgcolor="#C3D1DF"><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="1"></td>';
	tempHtml += '</tr>';
	tempHtml += '</table>';	
	
	tempHtml += '</td>';
	tempHtml += '</tr>';
	
	var sect = 1;
	var obj = sectionArray[sect];
	tempHtml += '<tr>';
	tempHtml += '<td bgcolor="#6A8CAF" style="padding:5px 0px 6px 14px;">';
	
	tempHtml += '<table width="90%" cellpadding="0" cellspacing="0" border="0">';
	var obj = sectionArray[sect];
	for (var i=0; i<obj.length; i++) {
		tempHtml += '<tr valign="top">';
		
		if (sect == section && id1 == i) {
			tempHtml += '<td width="9" style="padding-top:3px; padding-left:1px;"><img src="'+path+'images/common/stroke.gif" alt="" width="3" height="8"></td>';
			tempStr1 = 'style="font-weight:bold;"';
		} else {
			tempHtml += '<td width="9" style="padding-top:5px;"><img src="'+path+'images/common/point_1.gif" alt="" width="3" height="3"></td>';
			tempStr1 = '';
		}
		
		

		if(obj[i].id=='guesswhere'){
		
			var currentPageSpecialClass='';
			if (location.href.indexOf('/enrich/')>-1)
				currentPageSpecialClass=' currentPage';
		
			tempHtml += '<td style="padding-bottom:3px; padding-right:10px;" class="enrichclub"><div class="container"><div class="content'+currentPageSpecialClass+'"><a href="'+path+obj[i].link+'" target="'+obj[i].target+'" class="leftMenu" '+tempStr1+'>'+obj[i].name+'</a></div></div></td>';
		
		}else{
		
			tempHtml += '<td style="padding-bottom:3px; padding-right:10px;"><a href="'+path+obj[i].link+'" target="'+obj[i].target+'" class="leftMenu" '+tempStr1+'>'+obj[i].name+'</a></td>';
		
		}
		tempHtml += '</tr>';
	}
	tempHtml += '</table>';
	
	tempHtml += '</td>';
	tempHtml += '</tr>';
	
	
	tempHtml += '</table>';
	tempHtml += '</div>';
	tempHtml += '</div>';
	
	document.write(tempHtml);
}


function genFooter() {
	tempHtml = '<table width="100%" cellpadding="0" cellspacing="0" border="0">';
			tempHtml += '<tr>';
	tempHtml += '<td height=15>';
	tempHtml += '</td>';
	tempHtml += '</tr>';
	tempHtml += '<tr>';
	tempHtml += '<td height=1 bgcolor=e5e5e5>';
	tempHtml += '</td>';
	tempHtml += '</tr>';

	tempHtml += '<tr>';
	tempHtml += '	<td align="right" class="footer" style="padding-right:5px; padding-top:10px; padding-bottom:20px;">';
	tempHtml += '<a href="javascript:NewWindow(\''+path+'others/copyright.htm\',\'copyright\',\'500\',\'500\',\'yes\',\'no\');" class="footer">Copyright &copy; 2009</a>, Nuance-Watson (HK) Limited. All Rights Reserved. | <!--<a href="#" class="footer">Privacy Policy</a> |--> <a href="javascript:NewWindow(\''+path+'others/disclaimer.htm\',\'disclaimer\',\'500\',\'500\',\'yes\',\'no\');" class="footer">Disclaimer</a>';
	tempHtml += '	</td>';
	tempHtml += '</tr>';
	tempHtml += '</table>';
	
	document.write(tempHtml);
}


function genFooter2() {
	tempHtml = '<table width="100%" cellpadding="0" cellspacing="0" border="0">';
			
	tempHtml += '<tr>';
	tempHtml += '<td height=1 bgcolor=e5e5e5>';
	tempHtml += '</td>';
	tempHtml += '</tr>';

	tempHtml += '<tr>';
	tempHtml += '	<td align="right" class="footer" style="padding-right:5px; padding-top:10px; padding-bottom:20px;">';
	tempHtml += '<a href="javascript:NewWindow(\''+path+'others/copyright.htm\',\'copyright\',\'500\',\'500\',\'yes\',\'no\');" class="footer">Copyright &copy; 2009</a>, Nuance-Watson (HK) Limited. All Rights Reserved. | <!--<a href="#" class="footer">Privacy Policy</a> |--> <a href="javascript:NewWindow(\''+path+'others/disclaimer.htm\',\'disclaimer\',\'500\',\'500\',\'yes\',\'no\');" class="footer">Disclaimer</a>';
	tempHtml += '	</td>';
	tempHtml += '</tr>';
	tempHtml += '</table>';
	
	document.write(tempHtml);
}


function genPromo(isHome) {
	tempHtml = '<div style="position:absolute">';
	tempHtml += '	<div style="position:absolute; width:200px; height:570px; top:51px; left:770px;">';
	tempHtml += '		<table width="200" border="0" cellspacing="0" cellpadding="0">';
	tempHtml += '			<tr valign="top">';
	tempHtml += '				<td width="10"><img src="'+path+'images/common/bg_promo_l.gif" width="9" height="570"></td>';
//	tempHtml += '				<td><a href="#"><img src="'+path+'images/promotion/promo_v_1.jpg" alt="Lastest Promotion" width="180" height="570" border="0"></a></td>';
	tempHtml += '				<td>';
	
	tempHtml += '<table width="180" border="0" cellspacing="0" cellpadding="0">';
	
	var sect;
	if (section == 0)	sect = 0;	else	sect = 1;
	if (sect == 1) {
		var obj = promoArray[sect][level1];
	} else {
		var obj = promoArray[sect];
	}
	var tempStr1;
	
	if (obj.length == 1)	tempStr1 = 570;	else	tempStr1 = 140;
	
	if (section > 0)
	{
		for (var i=0; i<obj.length; i++) {
			tempHtml += '	<tr>';
			//tempHtml += '		<td><a href="'+obj[i].link+'" target="'+obj[i].target+'"><img src="'+path+obj[i].img+'" alt="'+obj[i].name+'" width="180" height="'+tempStr1+'" border="0"></a></td>';
			//tempHtml += '		<td><a href="'+obj[i].link+'" target="'+obj[i].target+'"><img src="'+path+obj[i].img+'" alt="'+obj[i].name+'" border="0"></a></td>';
			
			if (obj[i].img.indexOf('.swf') >= 0)
			{
				tempHtml += '<td>';
				innerFlash(path+obj[i].img, '180', '560', 'swfBanner');
				tempHtml += '</td>';
			}
			else
			{
				tempHtml += '<td><img src="'+path+obj[i].img+'" alt="'+obj[i].name+'" border="0" /></td>';
			}
			
			tempHtml += '	</tr>';
			
			if (i < (obj.length-1)) {
				tempHtml += '	<tr>';
				tempHtml += '		<td><img src="'+path+'images/common/spacer.gif" width="1" height="3"></a></td>';
				tempHtml += '	</tr>';
			}
		}
	}
	else
	{
		//Set Home Flash Banner
		var str = 'bannerStr=';
		for (var i=0; i<obj.length; i++)
		{
			str += obj[i].img + '|';
			str += obj[i].link + '|';
			str += obj[i].target;
			if (i < obj.length - 1)	str += '|';
		}
		var array = str.split('?');
		str = array.join('!');
		var array = str.split('&');
		str = array.join('*');
		//alert(str);
		
		innerFlash(path+'images/swf/home_banner.swf', '180', '570', 'swfBanner', str);
	}
	
	tempHtml += '</table>';
	
	tempHtml += '				</td>';
	tempHtml += '				<td width="10" align="right"><img src="'+path+'images/common/bg_promo_r.gif" width="9" height="570"></td>';
	tempHtml += '			</tr>';
	tempHtml += '		</table>';
	tempHtml += '	</div>';
	tempHtml += '</div>';
	
	document.write(tempHtml);
}


function genPromo2() {
	tempHtml = '<div style="position:absolute">';
	tempHtml += '	<div style="position:absolute; width:200px; height:380px; top:51px; left:770px;">';
	tempHtml += '		<table width="200" border="0" cellspacing="0" cellpadding="0">';
	tempHtml += '			<tr valign="top">';
	tempHtml += '				<td width="10"><img src="'+path+'images/common/bg_promo_l.gif" width="9" height="380"></td>';
//	tempHtml += '				<td><a href="#"><img src="'+path+'images/promotion/promo_v_1.jpg" alt="Lastest Promotion" width="180" height="570" border="0"></a></td>';
	tempHtml += '				<td>';
	
	tempHtml += '<table width="180" border="0" cellspacing="0" cellpadding="0">';
	
	var sect;
	if (section == 0)	sect = 0;	else	sect = 1;
	if (sect == 1) {
		var obj = promoArray[sect][level1];
	} else {
		var obj = promoArray[sect];
	}
	var tempStr1;
	
	/*if (obj.length == 1)	tempStr1 = 372;	else	tempStr1 = 372;*/
	
	if (obj.length == 1)	tempStr1 = 560;	else	tempStr1 = 560;
	
	i=0;
		tempHtml += '	<tr>';
		/*tempHtml += '		<td><a href="'+obj[i].link+'" target="'+obj[i].target+'"><img src="'+path+obj[i].img+'" alt="'+obj[i].name+'" width="180" height="'+tempStr1+'" border="0"></a></td>';*/
		tempHtml += '		<td><a href="images/promotion/promotional_form.html" target="'+obj[i].target+'"><img src="'+path+obj[i].img+'" alt="'+obj[i].name+'" width="180" height="'+tempStr1+'" border="0"></a></td>';
		tempHtml += '	</tr>';
		
		if (i < (obj.length-1)) {
			tempHtml += '	<tr>';
			tempHtml += '		<td><img src="'+path+'images/common/spacer.gif" width="1" height="3"></a></td>';
			tempHtml += '	</tr>';
		}
	
	
	
	tempHtml += '</table>';
	
	tempHtml += '				</td>';
	tempHtml += '				<td width="10" align="right"><img src="'+path+'images/common/bg_promo_r.gif" width="9" height="380"></td>';
	tempHtml += '			</tr>';
	tempHtml += '		</table>';
	tempHtml += '	</div>';
	tempHtml += '</div>';
	
	document.write(tempHtml);
}


function genPromo3() {
	tempHtml = '<div style="position:absolute">';
	tempHtml += '	<div style="position:absolute; width:200px; height:570px; top:51px; left:770px;">';
	tempHtml += '		<table width="200" border="0" cellspacing="0" cellpadding="0">';
	tempHtml += '			<tr valign="top">';
	tempHtml += '				<td width="10"><img src="'+path+'images/common/bg_promo_l.gif" width="9" height="570"></td>';
//	tempHtml += '				<td><a href="#"><img src="'+path+'images/promotion/promo_v_1.jpg" alt="Lastest Promotion" width="180" height="570" border="0"></a></td>';
	tempHtml += '				<td>';
	
	tempHtml += '<table width="180" border="0" cellspacing="0" cellpadding="0">';
	
	var sect;
	if (section == 0)	sect = 0;	else	sect = 1;
	if (sect == 1) {
		var obj = promoArray[sect][level1];
	} else {
		var obj = promoArray[sect];
	}
	var tempStr1;
	
	if (obj.length == 1)	tempStr1 = 570;	else	tempStr1 = 140;
	
	for (var i=0; i<obj.length; i++) {
		tempHtml += '	<tr>';
		tempHtml += '		<td><a href="'+obj[i].link+'" target="'+obj[i].target+'"><img src="'+path+obj[i].img+'" alt="'+obj[i].name+'" width="180" height="'+tempStr1+'" border="0"></a></td>';
		tempHtml += '	</tr>';
		
		if (i < (obj.length-1)) {
			tempHtml += '	<tr>';
			tempHtml += '		<td><img src="'+path+'images/common/spacer.gif" width="1" height="3"></td>';
			tempHtml += '	</tr>';
		}
	}
	
	
	tempHtml += '</table>';
	
	tempHtml += '				</td>';
	tempHtml += '				<td width="10" align="right"><img src="'+path+'images/common/bg_promo_r.gif" width="9" height="570"></td>';
	tempHtml += '			</tr>';
	tempHtml += '		</table>';
	tempHtml += '	</div>';
	tempHtml += '</div>';
	
	document.write(tempHtml);
}

/*
function genPromo3() {
	tempHtml = '<div style="position:absolute">';
	tempHtml += '	<div style="position:absolute; width:200px; height:570px; top:51px; left:770px;">';
	tempHtml += '		<table width="200" border="0" cellspacing="0" cellpadding="0">';
	tempHtml += '			<tr valign="top">';
//	tempHtml += '				<td width="10"><img src="'+path+'images/common/bg_promo_l.gif" width="9" height="570"></td>';
	tempHtml += '				<td><a href="#"><img src="'+path+'images/promotion/promo_v_1.jpg" alt="Lastest Promotion" width="180" height="570" border="0"></a></td>';
	tempHtml += '				<td>';
	
	tempHtml += '<table width="180" border="0" cellspacing="0" cellpadding="0">';
	
	var sect;
	if (section == 0)	sect = 0;	else	sect = 1;
	if (sect == 1) {
		var obj = promoArray[sect][level1];
	} else {
		var obj = promoArray[sect];
	}
	var tempStr1;
	
	if (obj.length == 1)	tempStr1 = 570;	else	tempStr1 = 560;
	
	i=1;
		tempHtml += '	<tr>';
		tempHtml += '		<td><a href="'+obj[i].link+'" target="'+obj[i].target+'"><img src="'+path+obj[i].img+'" alt="'+obj[i].name+'" width="180" height="'+tempStr1+'" border="0"></a></td>';
		tempHtml += '	</tr>';
		
		if (i < (obj.length-1)) {
			tempHtml += '	<tr>';
			tempHtml += '		<td><img src="'+path+'images/common/spacer.gif" width="1" height="3"></a></td>';
			tempHtml += '	</tr>';
		}
	
	
	
	tempHtml += '</table>';
	
	tempHtml += '				</td>';
	tempHtml += '				<td width="10" align="right"><img src="'+path+'images/common/bg_promo_r.gif" width="9" height="570"></td>';
	tempHtml += '			</tr>';
	tempHtml += '		</table>';
	tempHtml += '	</div>';
	tempHtml += '</div>';
	
	document.write(tempHtml);
}
*/

/*gen HKIA Macau Zhuhai banner*/
function genPromo4() {
	tempHtml = '<div style="position:absolute">';
	tempHtml += '	<div style="position:absolute; width:200px; height:570px; top:51px; left:770px;">';
	tempHtml += '		<table width="200" border="0" cellspacing="0" cellpadding="0">';
	tempHtml += '			<tr valign="top">';
	tempHtml += '				<td width="10"><img src="'+path+'images/common/bg_promo_l.gif" width="9" height="570"></td>';
//	tempHtml += '				<td><a href="#"><img src="'+path+'images/promotion/promo_v_1.jpg" alt="Lastest Promotion" width="180" height="570" border="0"></a></td>';
	tempHtml += '				<td>';
	
	tempHtml += '<table width="180" border="0" cellspacing="0" cellpadding="0">';
	
	var sect;
	if (section == 0)	sect = 0;	else	sect = 1;
	if (sect == 1) {
		var obj = promoArray[sect][level1];
	} else {
		var obj = promoArray[sect];
	}
	var tempStr1;
	
	if (obj.length == 1)	tempStr1 = 570;	else	tempStr1 = 140;
	
	if (section > 0)
	{
			//Set Home Flash Banner
		var str = 'bannerStr=';
		for (var i=0; i<obj.length; i++)
		{
			str += obj[i].img + '|';
			str += obj[i].link + '|';
			str += obj[i].target;
			if (i < obj.length - 1)	str += '|';
		}
		var array = str.split('?');
		str = array.join('!');
		var array = str.split('&');
		str = array.join('*');
		//alert(str);
		
		innerFlash(path+'images/swf/home_banner.swf', '180', '570', 'swfBanner', str);	
	}


	
	
	tempHtml += '</table>';
	
	tempHtml += '				</td>';
	tempHtml += '				<td width="10" align="right"><img src="'+path+'images/common/bg_promo_r.gif" width="9" height="570"></td>';
	tempHtml += '			</tr>';
	tempHtml += '		</table>';
	tempHtml += '	</div>';
	tempHtml += '</div>';
	
	document.write(tempHtml);
}


function genMap(file, width, height, id, vars) {
	tempHtml = '<div style="position:absolute">';
	tempHtml += '	<div style="position:absolute; width:200px; height:570px; top:51px; left:770px;">';
	tempHtml += '		<table width="200" border="0" cellspacing="0" cellpadding="0">';
	tempHtml += '			<tr valign="top">';
	tempHtml += '				<td width="10"><img src="'+path+'images/common/bg_promo_l.gif" width="9" height="570"></td>';
	tempHtml += '<td>';
	
	innerFlash(file, width, height, id, vars);
	
	tempHtml += '</td>';
	tempHtml += '				<td width="10" align="right"><img src="'+path+'images/common/bg_promo_r.gif" width="9" height="570"></td>';
	tempHtml += '			</tr>';
	tempHtml += '		</table>';
	tempHtml += '	</div>';
	tempHtml += '</div>';
	
	document.write(tempHtml);
}


function genBanner() {
	tempHtml = '<table width="100%" cellpadding="0" cellspacing="0" border="0">';
	tempHtml += '<tr>';
	tempHtml += '	<td>';
	tempHtml += '		<img src="'+path+'images/'+level1+'/enrich_inside_eng.jpg" border=0 style="display:block">';
	tempHtml += '	</td>';
	tempHtml += '</tr>';
	tempHtml += '</table>';
	
	document.write(tempHtml);
}


function genTitle(sub) {
	var obj = sectionArray[section][id1];
	
	tempHtml = '<table width="100%" cellpadding="0" cellspacing="0" border="0">';
	tempHtml += '<tr valign="top">';
	
	tempHtml += '<td style="padding:13px 10px 10px 10px;">';
	tempHtml += '<img src="'+path+'images/'+level1+'/title.gif" alt="'+obj.name+'">';
	tempHtml += '</td>';
	
	if (sub && obj.subSection) {
		var obj1 = obj.subSection;
		
		tempHtml += '<td valign="bottom" align="right" style="padding-bottom:6px;">';
		tempHtml += '<table cellpadding="0" cellspacing="0" border="0">';
		tempHtml += '<tr>';
		
		
		for (var j=0; j<obj1.length; j++) {
			if (id2 == j) {
				tempStr1 = "point_blue.gif";
				tempStr2 = "blue";
			} else {
				tempStr1 = "point_gray.gif";
				tempStr2 = "content";
			}
			
			tempHtml += '<td width="20" align="center" valign="top" style="padding-top:9px;"><img src="'+path+'images/common/'+tempStr1+'" width="3" height="3"></td>';
			tempHtml += '<td valign="top" style="padding-right:10px;"><strong><a href="'+path+obj1[j].link+'" target="'+obj1[j].target+'" class="'+tempStr2+'">'+obj1[j].name+'</a></strong></td>';
		}
		
		tempHtml += '</tr>';
		tempHtml += '</table>';
		tempHtml += '</td>';
	}
	
	tempHtml += '</tr>';
	tempHtml += '</table>';
	
	document.write(tempHtml);
}


function genSubTitle() {
	if (sectionArray[section][id1].subSection[id2]) {
		var obj = sectionArray[section][id1].subSection[id2];
		
		tempHtml = '<table cellpadding="0" cellspacing="0" border="0">';
		tempHtml += '<tr>';
		tempHtml += '<td class="content" colspan="2" style="padding:20px 0px 20px 0px;">';
		tempHtml += '<strong>'+obj.name+'</strong>';
		tempHtml += '</td>';
		tempHtml += '</tr>';
		tempHtml += '</table>';
		
		document.write(tempHtml);
	}
}