var tempHtml;
var lan="";
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;

var isDebugMode = false
var debugstr = ""
function trace(str) {
	debugstr += str + "\n" ;
}

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" bgcolor="#CC0000" id="topNav">';
	tempHtml += '	<tr>';
	tempHtml += '		<td width="50" height="22" class="topLink" style="padding-left:20px;"><strong></strong></td>';
	
	
	var obj = sectionArray[2];
	
// Top Navigation and Top Pulldown Starts Here
	
	for (var i=0; i<obj.length; i++) {
		tempHtml += '<td class="topLink" valign="top" style="padding-top:4px; padding-right:12px; padding-left:12px;" onMouseOver="topMenuOver('+i+', 1);" onMouseOut="topMenuOver('+i+', 0);" id="topNavText'+i+'">';
		
		
		var obj1 = obj[i].subSection;
		
		if (obj1) {
			if (i == (obj.length - 1))	tempStr1 = '192px';	else	tempStr1 = '200px';
			
			tempHtml += '<div style="position:absolute; z-index:200;">';
			tempHtml += '<div style="width:'+tempStr1+'; position:absolute; visibility:hidden; top:18px; left:-12px;" id="topNavMenu'+i+'" onMouseOver="topMenuOver('+i+', 1);" onMouseOut="topMenuOver('+i+', 0);">';
			tempHtml += '	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="navBg">';
			tempHtml += '		<tr>';
			tempHtml += '			<td><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="2"></td>';
			tempHtml += '		</tr>';
			tempHtml += '		<tr>';
			tempHtml += '			<td style="border:1px solid #DCDCDC; padding-top:4px; padding-bottom:4px;" bgcolor="#FFFFFF">';
			tempHtml += '				<table width="100%" cellpadding="4" cellspacing="0" border="0">';
			
			
			for (var j=0; j<obj1.length; j++) {
				tempHtml += '<tr>';
				tempHtml += '	<td width="11" valign="top" align="right" style="padding-top:12px; padding-right:0px;"><img src="'+path+'images/common/point_brown.gif" alt="" width="3" height="3" hspace="4"></td>';
				
				
				var obj2 = obj1[j].subSection;
				
				if (obj2) {
					tempHtml += '<td valign="top" onMouseOver="topSubMenuOver('+i+', '+j+', 1);" onMouseOut="topSubMenuOver('+i+', '+j+', 0);">';
					
					tempHtml += '<div style="position:absolute; z-index:200;">';
					
					if (i >= 5) {
						tempHtml += '<div style="width:224px; position:absolute; visibility:hidden; top:-10px; left:-222px;" id="topNavMenu'+i+j+'" onMouseOver="topSubMenuOver('+i+', '+j+', 1);" onMouseOut="topSubMenuOver('+i+', '+j+', 0);">';
						tempHtml += '	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="navBg">';
						tempHtml += '		<tr>';
					} else {
						tempHtml += '<div style="width:204px; position:absolute; visibility:hidden; top:-10px; left:178px;" id="topNavMenu'+i+j+'" onMouseOver="topSubMenuOver('+i+', '+j+', 1);" onMouseOut="topSubMenuOver('+i+', '+j+', 0);">';
						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="border:1px solid #DCDCDC; padding-top:4px; padding-bottom:4px;" bgcolor="#FFFFFF">';
					tempHtml += '				<table width="100%" cellpadding="4" cellspacing="0" border="0">';
					
					
					for (var k=0; k<obj2.length; k++) {
						tempHtml += '<tr>';
						tempHtml += '	<td width="3" valign="top" align="right" style="padding-top:12px; padding-right:0px;"><img src="'+path+'images/common/point_brown.gif" alt="" width="3" height="3" hspace="4"></td>';
						
						if (obj2[k].link != "") {
							tempHtml += '	<td valign="top"><a href="'+obj2[k].link+'" target="'+obj2[k].target+'" class="menuLink">'+obj2[k].name+'</a>';
						} else {
							tempHtml += '	<td valign="top" class="menuLink">'+obj2[k].name;
						}
						
						tempHtml += '</td>';
						
						tempHtml += '</tr>';
						tempHtml += '<tr>';
						tempHtml += '	<td colspan="2" style="padding:0px;" id="topMenuLine'+j+k+'"><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="1"></td>';
						tempHtml += '</tr>';
					}
					
					
					tempHtml += '				</table>';
					tempHtml += '			</td>';
					
					if (i >= 5)	tempHtml += '<td width="24"><img src="'+path+'images/common/spacer.gif" alt="" width="24" height="1"></td>';
					
					tempHtml += '		</tr>';
					tempHtml += '	</table>';
					tempHtml += '</div>';
					tempHtml += '</div>';
				} else {
					tempHtml += '<td valign="top">';
				}
				
				if (obj1[j].link != "") {
					tempHtml += '<a href="'+obj1[j].link+'" target="'+obj1[j].target+'" class="menuLink" id="topNavText'+i+j+'">'+obj1[j].name+'</a>';
				} else {
					tempHtml += '<span class="menuLink" id="topNavText'+i+j+'">' + obj1[j].name + '</span>';
				}
				
				tempHtml += '</td>';
				
				
				tempHtml += '</tr>';
				tempHtml += '<tr>';
				tempHtml += '	<td colspan="2" style="padding:0px;" id="topMenuLine'+i+j+'"><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="1"></td>';
				tempHtml += '</tr>';
			}
			
			
			tempHtml += '				</table>';
			tempHtml += '			</td>';
			tempHtml += '		</tr>';
			tempHtml += '	</table>';
			tempHtml += '</div>';
			tempHtml += '</div>';
		}
		
		
		if (obj[i].link != "") {
			tempHtml += '<img src="'+path+'images/common/arrow_white_r.gif" alt="" width="5" height="6" id="topNavBtn'+i+'"> <a href="'+obj[i].link+'" target="'+obj[i].target+'" class="topLink">'+obj[i].name+'</a>';
		} else {
			tempHtml += '<img src="'+path+'images/common/arrow_white_r.gif" alt="" width="5" height="6" id="topNavBtn'+i+'"> '+obj[i].name;
		}
		
		tempHtml += '</td>';
	}
	
// Top Navigation and Top Pulldown Ends Here
	
	tempHtml += '		<td width="1" style="padding-left:15px; padding-right:7px;"><img src="'+path+'images/common/line_v.gif" alt="" width="1" height="14"></td>';

// Below line with bug on frontpage print button
//	tempHtml += '		<td width="11" style="padding-left:5px;"><a href="javascript:Clickheretoprint();" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'icon_print\',\'\',\''+path+'images/common/icon_print_f2.gif\',1);"><img src="'+path+'images/common/icon_print.gif" name="icon_print" alt="打印" width="17" height="14" border="0"></a></td>';

// Frontpage print button bug fixed
	if (id1 == null)
		{
			tempHtml += '		<td width="0" style="padding-left:0px;"></td>';
		}
	else
		{
			tempHtml += '		<td width="11" style="padding-left:5px;"><a href="javascript:Clickheretoprint();" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'icon_print\',\'\',\''+path+'images/common/icon_print_f2.gif\',1);"><img src="'+path+'images/common/icon_print.gif" name="icon_print" alt="打印" width="17" height="14" border="0"></a></td>';
		}

	tempHtml += '		<td width="11" style="padding-left:5px; padding-right:13px;"><a href="javascript:emailAFriend();" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'icon_mail\',\'\',\''+path+'images/common/icon_mail_f2.gif\',1);"><img src="'+path+'images/common/icon_mail.gif" name="icon_mail" alt="介绍给朋友" width="17" height="14" border="0"></a></td>';
	tempHtml += '	</tr>';
	tempHtml += '</table>';
	
	document.write(tempHtml);
}

function genlanguage() {

	lan += '				<table cellpadding="0" cellspacing="0" border="0">';
	lan += '					<tr>';
	lan += '						<td class="menuLink"><a href="'+path+'../GuestBook/Guest_Write.asp" class="menuLink">我为黄埔发展提建议</a></td>';
	lan += '						<td><img src="'+path+'images/common/line_v_menu.gif" alt="" width="1" height="12" hspace="8"></td>';
	lan += '						<td class="menuLink"><a href="'+path+'other/contact.htm" class="menuLink">大学地图</a></td>';


	lan += '					</tr>';
	lan += '				</table>';
	document.write(lan);
}
function genLeft() {
	tempHtml = '<table width="100%" cellpadding="0" cellspacing="0" border="0">';
	tempHtml += '		<tr>';
	tempHtml += '			<td><a href="'+path+'index.htm"><img src="'+path+'images/common/logo_all.gif" alt="北京黄埔大学" width="246" height="67" border="0"></a></td>';
	tempHtml += '		</tr>';
	tempHtml += '		<tr>';
	tempHtml += '			<td align="center" height="24">';
	tempHtml += '				<table cellpadding="0" cellspacing="0" border="0">';
	tempHtml += '					<tr>';
	tempHtml += '						<td class="menuLink"><a href="'+path+'../GuestBook/Guest_Write.asp" class="menuLink">我为黄埔发展提建议</a></td>';
	tempHtml += '						<td><img src="'+path+'images/common/line_v_menu.gif" alt="" width="1" height="12" hspace="8"></td>';
	tempHtml += '						<td class="menuLink"><a href="'+path+'other/contact.htm" class="menuLink">大学地图</a></td>';


	tempHtml += '					</tr>';
	tempHtml += '				</table>';
	tempHtml += '			</td>';
	tempHtml += '		</tr>';
	tempHtml += '		<tr>';
	tempHtml += '			<td style="padding-left:4px; padding-right:4px;">';
	tempHtml += '				<div style="background:url('+path+'images/common/dash.gif) repeat-x;"><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="1"></div>';
	tempHtml += '			</td>';
	tempHtml += '		</tr>';
	tempHtml += '		<tr>';
	tempHtml += '			<td style="padding-left:18px; padding-right:10px; padding-top:5px; padding-bottom:5px;">';
	
	
	tempHtml += '<table width="100%" cellpadding="3" cellspacing="0" border="0">';
	
	var sect = 1;
	var obj = sectionArray[sect];
// Left Navigation and Left Pulldown Starts Here
	
	for (var i=0; i<obj.length; i++) {
		
		tempHtml += '<tr>';
		tempHtml += '	<td width="3" class="topLink" style="padding-left:1px;"><img src="'+path+'images/common/point_brown.gif" alt="" width="3" height="3"></td>';
		
		if (sect == section && id1 == i) {
			var isSect = ', 1';
		} else {
			var isSect = '';
		}
		tempHtml += '<td class="topLink" onMouseOver="mainMenuOver('+i+',1'+isSect+');" onMouseOut="mainMenuOver('+i+',0'+isSect+');">';
		
		var obj1 = obj[i].subSection;
		
		if (obj1 && !(sect == section && id1 == i)) {
		//	if (i == (obj.length - 1))	tempStr1 = '192px';	else	tempStr1 = '200px';
			
			tempHtml += '<div style="position:absolute;">';
			tempHtml += '<div style="width:215px; position:absolute; visibility:hidden; top:-11px; left:203px;" id="mainNavMenu'+i+'" onMouseOver="mainMenuOver('+i+', 1'+isSect+');" onMouseOut="mainMenuOver('+i+', 0'+isSect+');">';
			tempHtml += '	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="navBg">';
			tempHtml += '		<tr>';
			tempHtml += '			<td width="15"><img src="'+path+'images/common/spacer.gif" alt="" width="15" height="1"></td>';
			tempHtml += '			<td width="200" style="border:1px solid #DCDCDC; padding-top:4px; padding-bottom:4px;" bgcolor="#FFFFFF">';
			tempHtml += '				<table width="100%" cellpadding="4" cellspacing="0" border="0">';
			
			
			for (var j=0; j<obj1.length; j++) {
				tempHtml += '<tr>';
				tempHtml += '	<td width="11" valign="top" align="right" style="padding-top:12px; padding-right:0px;"><img src="'+path+'images/common/point_brown.gif" alt="" width="3" height="3" hspace="4"></td>';
				
				
				var obj2 = obj1[j].subSection;
				
				if (obj2) {
					if (sect == section && id2 == j) {
						var isSubSect = ', 1';
					} else {
						var isSubSect = '';
					}		
					tempHtml += '<td valign="top" onMouseOver="mainSubMenuOver('+i+', '+j+', 1'+isSubSect+');" onMouseOut="mainSubMenuOver('+i+', '+j+', 0'+isSubSect+');">';
					
					tempHtml += '<div style="position:absolute;">';
					
					
					tempHtml += '<div style="width:204px; position:absolute; visibility:hidden; top:-10px; left:178px;" id="mainNavMenu'+i+j+'" onMouseOver="mainSubMenuOver('+i+', '+j+', 1'+isSubSect+');" onMouseOut="mainSubMenuOver('+i+', '+j+', 0'+isSubSect+');">';
					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="border:1px solid #DCDCDC; padding-top:4px; padding-bottom:4px;" bgcolor="#FFFFFF">';
					tempHtml += '				<table width="100%" cellpadding="4" cellspacing="0" border="0">';
					
					
					for (var k=0; k<obj2.length; k++) {
						tempHtml += '<tr>';
						tempHtml += '	<td width="3" valign="top" align="right" style="padding-top:12px; padding-right:0px;"><img src="'+path+'images/common/point_brown.gif" alt="" width="3" height="3" hspace="4"></td>';
						
						if (id1 == i && id2 == j && id3 == k) {
							tempStr = 'menuLinkOff';
						} else {
							tempStr = 'menuLink';
						}
						if (obj2[k].link != "") {
							tempHtml += '<td valign="top"><a href="'+obj2[k].link+'" target="'+obj2[k].target+'" class="'+tempStr+'">'+obj2[k].name+'</a>';
						} else {
							tempHtml += '<td valign="top" class="'+tempStr+'">'+obj2[k].name;
						}
						
						tempHtml += '</td>';
						
						tempHtml += '</tr>';
						tempHtml += '<tr>';
						tempHtml += '	<td colspan="2" style="padding:0px;" id="mainMenuLine'+j+k+'"><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="1"></td>';
						tempHtml += '</tr>';
					}
					
					
					tempHtml += '				</table>';
					tempHtml += '			</td>';
					
					tempHtml += '		</tr>';
					tempHtml += '	</table>';
					tempHtml += '</div>';
					tempHtml += '</div>';
				} else {
					tempHtml += '<td valign="top">';
				}
				
				if (sect == section && id1 == i && id2 == j) {
					tempStr = 'menuLinkOff';
				} else {
					tempStr = 'menuLink';
				}
				
				if (obj1[j].color) {
					var tempName = '<span style=\'color:' + obj1[j].color + '\'>' + obj1[j].name + '</span>';
				} else {
					var tempName = obj1[j].name;
				}
				if (obj1[j].link != "") {
					tempHtml += '<a href="'+obj1[j].link+'" target="'+obj1[j].target+'" class="'+tempStr+'" id="mainNavText'+i+j+'">'+tempName+'</a>';
				} else {
					tempHtml += '<span class="'+tempStr+'" id="mainNavText'+i+j+'">'+tempName+'</span>';
				}
				
				tempHtml += '</td>';
				
				
				tempHtml += '</tr>';
				tempHtml += '<tr>';
				tempHtml += '	<td colspan="2" style="padding:0px;" id="mainMenuLine'+i+j+'"><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="1"></td>';
				tempHtml += '</tr>';
			}
			
			
			tempHtml += '				</table>';
			tempHtml += '			</td>';
			tempHtml += '		</tr>';
			tempHtml += '	</table>';
			tempHtml += '</div>';
			tempHtml += '</div>';
		}
		
		if (sect == section && id1 == i) {
			tempStr1 = 'menuLinkOff';
		} else {
			tempStr1 = 'menuLink';
		}
		if (obj[i].link != "") {
			tempHtml += '<a href="'+obj[i].link+'" target="'+obj[i].target+'" class="'+tempStr1+'" id="mainNavText'+i+'"><strong>'+obj[i].name+'</strong></a>';
		} else {
			tempHtml += '<strong>'+obj[i].name+'</strong>';
		}
		
		tempHtml += '</td>';
		
		tempHtml += '</tr>';
		tempHtml += '<tr>';
		tempHtml += '	<td colspan="2" style="padding:0px;" id="mainMenuLine'+i+'"><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="1"></td>';
		tempHtml += '</tr>';
		
		
// SubSection Navigation Starts Here
		
		if (section == 1) {
			var obj1 = obj[id1].subSection;
			
			if (sect == section && (obj1 && id1 == i)) {
				tempHtml += '<tr>';
				tempHtml += '	<td><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="1"></td>';
				tempHtml += '	<td style="padding:0px; padding-left:4px; padding-bottom:5px;">';
				tempHtml += '		<table width="100%" cellpadding="3" cellspacing="0" border="0">';
				
				for (var j=0; j<obj1.length; j++) {
					if (id2 == j) {
						tempStr1 = 'menuLinkOff';
						tempStr2 = '#DCB36D';
						var isSubSect = ', 1';
					} else {
						tempStr1 = 'menuLink';
						tempStr2 = '';
						var isSubSect = '';
					}
					tempHtml += '<tr id="insideMainBg'+i+j+'" onMouseOver="insideMainMenuOver('+i+', '+j+', 1'+isSubSect+');" onMouseOut="insideMainMenuOver('+i+', '+j+', 0'+isSubSect+');" bgcolor="'+tempStr2+'">';
					tempHtml += '<td width="3" class="'+tempStr1+'" style="padding-top:9px; padding-left:5px;" valign="top"><img src="'+path+'images/common/point_brown02.gif" alt="" width="3" height="3"></td>';
					tempHtml += '<td class="'+tempStr1+'">';
					
					
					var obj2 = obj1[j].subSection;
					
					if (obj2) {
						tempHtml += '<div style="position:absolute;">';
						tempHtml += '<div style="width:215px; position:absolute; visibility:hidden; top:-9px; left:188px;" id="insideMainMenu'+i+j+'" onMouseOver="insideMainMenuOver('+i+', '+j+', 1'+isSubSect+');" onMouseOut="insideMainMenuOver('+i+', '+j+', 0'+isSubSect+');">';
						tempHtml += '	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="navBg">';
						tempHtml += '		<tr>';
						tempHtml += '			<td width="15"><img src="'+path+'images/common/spacer.gif" alt="" width="15" height="1"></td>';
						
						tempHtml += '			<td width="200" style="border:1px solid #DCDCDC; padding-top:4px; padding-bottom:4px;" bgcolor="#FFFFFF">';
						tempHtml += '				<table width="100%" cellpadding="4" cellspacing="0" border="0">';
						
						
						for (var k=0; k<obj2.length; k++) {
							tempHtml += '<tr>';
							tempHtml += '	<td width="3" valign="top" align="right" style="padding-top:12px; padding-right:0px;"><img src="'+path+'images/common/point_brown.gif" alt="" width="3" height="3" hspace="4"></td>';
							
							if (id1 == i && id2 == j && id3 == k) {
								tempStr = 'menuLinkOff';
							} else {
								tempStr = 'menuLink';
							}
							if (obj2[k].link != "") {
								tempHtml += '	<td valign="top"><a href="'+obj2[k].link+'" target="'+obj2[k].target+'" class="'+tempStr+'">'+obj2[k].name+'</a>';
							} else {
								tempHtml += '	<td valign="top" class="'+tempStr+'">'+obj2[k].name;
							}
							
							tempHtml += '</td>';
							tempHtml += '</tr>';
							tempHtml += '<tr>';
							tempHtml += '	<td colspan="2" style="padding:0px;" id="mainMenuLine'+j+k+'"><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="1"></td>';
							tempHtml += '</tr>';
						}
						
						tempHtml += '				</table>';
						tempHtml += '			</td>';
						
						tempHtml += '		</tr>';
						tempHtml += '	</table>';
						tempHtml += '</div>';
						tempHtml += '</div>';
					}
					
					if (obj1[j].color) {
						var tempName = '<span style=\'color:' + obj1[j].color + '\'>' + obj1[j].name + '</span>';
					} else {
						var tempName = obj1[j].name;
					}
					
					if (obj1[j].link != "") {
						tempHtml += '<a href="'+obj1[j].link+'" target="'+obj1[j].target+'" class="'+tempStr1+'" id="insideMainText'+i+j+'">'+tempName+'</a>';
					} else {
						tempHtml += '<span class="'+tempStr1+'" id="insideMainText'+i+j+'">'+tempName+'</span>';
					}
					
					tempHtml += '</td>';
					tempHtml += '</tr><td style="padding:0px;"><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="1"></td><tr>';
					tempHtml += '</tr>';
					
				}
				
				
				tempHtml += '			<tr>';
				tempHtml += '				<td colspan="2" style="padding:0px;"><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="5"></td>';
				tempHtml += '			</tr>';
				tempHtml += '			<tr>';
				tempHtml += '				<td colspan="2" style="padding:0px;" bgcolor="#CAAB74"><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="1"></td>';
				tempHtml += '			</tr>';
				tempHtml += '		</table>';
				tempHtml += '	</td>';
				tempHtml += '</tr>';
			}
		}
		
// SubSection Navigation Ends Here
		
		
	}
	
// Left Navigation and Left Pulldown Ends Here
	
	tempHtml += '</table>';
	
	
	tempHtml += '	</td>';
	tempHtml += '</tr>';
	
	tempHtml += '<tr>';
	tempHtml += '	<td style="padding-left:4px; padding-right:4px;">';
	tempHtml += '		<div style="background:url('+path+'images/common/dash.gif) repeat-x;"><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="1"></div>';
	tempHtml += '	</td>';
	tempHtml += '</tr>';
	tempHtml += '<tr>';
	tempHtml += '	<td style="padding-left:18px; padding-top:10px;">';
	tempHtml += '		<table width="209" cellpadding="0" cellspacing="0" border="0">';
	
	
	// Quick Link Start Here
	
	tempHtml += '			<tr>';
	tempHtml += '				<td onClick="quickLinkMenuOver(1,1);" onMouseOut="quickLinkMenuOver(1,0);">';
	
	genQuickLink();
	
	tempHtml += '					<table width="100%" cellpadding="0" cellspacing="0" border="0">';
	tempHtml += '						<tr>';
	tempHtml += '						</tr>';
	tempHtml += '					</table>';
	tempHtml += '				</td>';
	tempHtml += '			</tr>';
	
	// Quick Link End Here
	
	
	tempHtml += '			<tr>';
	tempHtml += '				<td style="padding-top:5px;">';
	
	
	// Search Start Here
	
	tempHtml += '<table width="100%" cellpadding="0" cellspacing="0" border="0">';
	tempHtml += '	<tr>';
/*	tempHtml += '		<td width="113">';
	tempHtml += '			<input name="" type="text" class="inputfieldMain" value=" 搜寻" id="search" onFocus="searchOver(this, 1);" onBlur="searchOver(this, 0);">';
	tempHtml += '		</td>';
	tempHtml += '		<td><a href="javascript:;" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'btn_arrow_r\',\'\',\''+path+'images/common/btn_arrow_r.gif\',1);"><img src="'+path+'images/common/btn_arrow_r_f3.gif" name="btn_arrow_r" alt="" width="15" height="15" border="0"></a></td>';*/
	tempHtml += '		<td><a href="http://www.hpdx.cn/zs/application/index.html" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'btn_full_search\',\'\',\''+path+'images/common/btn_full_search.gif\',1);"><img src="'+path+'images/common/btn_full_search_f3.gif" name="btn_full_search" width="75" height="15" alt="在线报名" border="0"></a></td>';
	tempHtml += '	</tr>';
	tempHtml += '</table>';
	
	// Search End Here
	
	
	tempHtml += '				</td>';
	tempHtml += '			</tr>';
	tempHtml += '		</table>';
	tempHtml += '	</td>';
	tempHtml += '</tr>';
	tempHtml += '</table>';
	
	document.write(tempHtml);
}


function genBanner() {
	var obj = sectionArray[section];
	
	tempHtml = '<table width="100%" cellpadding="0" cellspacing="0" border="0" id="banner" style="height:177px;">';
	tempHtml += '	<tr>';
	
	if (obj[id1].subSection) {
		var obj1 = obj[id1].subSection;
		
		if (id2 != null) {
			tempHtml += '<td><img src="'+path+'images/banner/'+obj[id1].id+'_'+obj1[id2].id+'.jpg" width="970" height="177" alt="'+obj1[id2].name+'"></td>';
		} else {
			tempHtml += '<td><img src="'+path+'images/banner/'+obj[id1].id+'.jpg" width="970" height="177" alt="'+obj[id1].name+'"></td>';
		}
	} else {
		tempHtml += '<td><img src="'+path+'images/banner/'+obj[id1].id+'.jpg" width="970" height="177" alt="'+obj[id1].name+'"></td>';
	}
	
	tempHtml += '	</tr>';
	tempHtml += '</table>';
	
	document.write(tempHtml);
}


function genTreeLink() {
	tempHtml = '<table width="100%" cellpadding="0" cellspacing="0" border="0" id="treeLink">';
	tempHtml += '	<tr>';
	tempHtml += '		<td align="right" style="padding-top:7px; padding-bottom:6px; padding-right:15px; padding-left:10px;" class="treelink">';
	
	tempHtml += '<a href="'+path+'index.htm" class="treelink">主页</a>';
	
	tempHtml += ' > ';
	
	var obj = sectionArray[section];
	if (id2 == null) {
		tempHtml += '<b><a href="'+obj[id1].link+'" target="'+obj[id1].target+'" class="treelink">' + obj[id1].name + '</a></b>';
	} else {
		tempHtml += '<a href="'+obj[id1].link+'" target="'+obj[id1].target+'" class="treelink">' + obj[id1].name + '</a>';
		tempHtml += ' > ';
		
		var obj1 = obj[id1].subSection;
		if (id3 == null) {
			tempHtml += '<b><a href="'+obj1[id2].link+'" target="'+obj1[id2].target+'" class="treelink">' + obj1[id2].name + '</a></b>';
		} else {
			if (obj1[id2].subSection) {
				tempHtml += '<a href="'+obj1[id2].link+'" target="'+obj1[id2].target+'" class="treelink">' + obj1[id2].name + '</a>';
				tempHtml += ' > ';
				
				var obj2 = obj1[id2].subSection;
				tempHtml += '<b><a href="'+obj2[id3].link+'" target="'+obj2[id3].target+'" class="treelink">' + obj2[id3].name + '</a></b>';
			} else {
				tempHtml += '<b><a href="'+obj1[id2].link+'" target="'+obj1[id2].target+'" class="treelink">' + obj1[id2].name + '</a></b>';
			}
		}
	}
	
	//tempHtml += '		<a href="#" class="treelink">About HKUST</a> > <a href="#" class="treelink">Mission and Strategy</a> > <strong>Vision and Mission</strong>';
	tempHtml += '		</td>';
	tempHtml += '	</tr>';
	tempHtml += '	<tr>';
	tempHtml += '		<td style="padding-left:5px; padding-right:4px;">';
	tempHtml += '					<div style="background:url('+path+'images/common/dash.gif) repeat-x;"><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="1"></div>';
	tempHtml += '		</td>';
	tempHtml += '	</tr>';
	tempHtml += '</table>';
	
	document.write(tempHtml);
}


function genSubNav() {
	var obj = sectionArray[section];
	
	if (obj[id1].subSection) {
		var obj1 = obj[id1].subSection;
		var row = 3;
		
		if (id2 != null) {
		if (obj1[id2].subSection) {
			var obj2 = obj1[id2].subSection;
			
			tempHtml = '<table cellpadding="0" cellspacing="0" border="0" id="subNav">';
			tempHtml += '	<tr>';
			tempHtml += '		<td style="padding-top:6px; padding-bottom:15px; padding-right:15px;">';
			
			for (var k=0; k<obj2.length; k++) {
				if (k%row == 0) {
					tempHtml += '<table cellpadding="0" cellspacing="0" border="0">';
					tempHtml += '<tr style="padding-bottom:5px;">';
				}
				
				if (id3 == k) {
					tempStr = 'menuLinkOff';
				} else {
					tempStr = 'menuLink';
				}
				
				tempHtml += '<td class="menuLink" style="padding-left:15px; padding-right:5px;"><img src="'+path+'images/common/point_brown02.gif" alt="" width="3" height="3"></td>';
				tempHtml += '<td class="'+tempStr+'"><a href="'+obj2[k].link+'" target="'+obj2[k].target+'" class="'+tempStr+'">'+obj2[k].name+'</a></td>';
				
				
				if (k%row == (row-1) | k==(obj2.length-1)){
					tempHtml += '</tr>';
					tempHtml += '</table>';
				}
			}
			
			tempHtml += '		</td>';
			tempHtml += '	</tr>';
			
			tempHtml += '</table>';
		
			document.write(tempHtml);
		}
	}
	}
}


function genFooter() {
	tempHtml = '<table width="100%" cellpadding="0" cellspacing="0" border="0" id="footer">';
	
	tempHtml += '	<tr>';
	tempHtml += '		<td align="right" style="padding-right:20px;">';
	tempHtml += '<img src="'+path+'images/common/arrow_blue_t.gif" alt="" width="13" height="10" hspace="3"><a href="#top" class="menuLink">页首</a>';
	tempHtml += '</td>';
	tempHtml += '	</tr>';
	tempHtml += '	<tr>';
	tempHtml += '		<td align="right" style="padding-right:20px; padding-bottom:20px; padding-top:31px;" class="footer">&copy;2010 北京黄埔大学 版权所有<br> 地址：北京市大兴区榆垡榆祥路9号 电话：010-51497543  010-51497544  <br>电邮：carefuture@126.com  </td><div style="display:none;"><script src="http://s11.cnzz.com/stat.php?id=1188350&web_id=1188350&show=pic" language="JavaScript"></script></div>';
	tempHtml += '	</tr>';
	
	tempHtml += '</table>';
	
	document.write(tempHtml);
}


function genQuickLink(gen) {
	var obj = sectionArray[3];
	
	if (gen) {
		tempHtml = '<div style="position:absolute;">';
	} else {
		tempHtml += '<div style="position:absolute;">';
	}
	tempHtml += '<div style="width:209px; height:211px; position:absolute; visibility:hidden; top:0px; left:0px;" id="quickLinkMenu" onMouseOver="quickLinkMenuOver(1, 1);" onMouseOut="quickLinkMenuOver(1, 0);">';
	tempHtml += '	<table width="209" cellpadding="0" cellspacing="0" border="0">';
	tempHtml += '		<tr>';
	tempHtml += '			<td><img src="'+path+'images/common/spacer.gif" alt="" width="1" height="16"></td>';
	tempHtml += '		</tr>';
	tempHtml += '		<tr>';
	tempHtml += '			<td style="border:1px solid #DCDCDC; padding-top:4px; padding-bottom:4px;" bgcolor="#FFFFFF">';
	tempHtml += '				<table height="196" cellpadding="0" cellspacing="0" border="0">';
	tempHtml += '					<tr>';
	tempHtml += '						<td width="199" rowspan="2" valign="top" padding-right:10px;>';
	tempHtml += '							<div style="width:189px; height:185px; overflow:hidden; position:absolute" id="quickLinkContent">';
	tempHtml += '								<table width="100%" cellpadding="2" cellspacing="0" border="0">';
	
	for (var i=0; i<obj.length; i++) {
		tempHtml += '<tr valign="top">';
		tempHtml += '	<td width="3" align="right" style="padding-top:10px; padding-right:0px;"><img src="'+path+'images/common/point_brown.gif" alt="" width="3" height="3" hspace="4"></td>';
		tempHtml += '	<td class="menuLink"><a href="'+obj[i].link+'" class="menuLink" target='+obj[i].target+'>'+obj[i].name+'</a></td>';
		tempHtml += '</tr>';
	}
	
	tempHtml += '								</table>';
	tempHtml += '							</div>';
	tempHtml += '						</td>';
	tempHtml += '						<td valign="top" style="padding-top:1px;"><a href="javascript:;" onMouseDown="scrollStart(\'quickLinkContent\', -3);" onMouseOut="scrollStop();" onMouseUp="scrollStop();"><img src="'+path+'images/common/arrow_blue_t.gif" alt="" width="13" height="10" border="0"></a></td>';
	tempHtml += '					</tr>';
	tempHtml += '					<tr>';
	tempHtml += '						<td valign="bottom" style="padding-bottom:1px;"><a href="javascript:;" onMouseDown="scrollStart(\'quickLinkContent\', 3);" onMouseOut="scrollStop();" onMouseUp="scrollStop();"><img src="'+path+'images/common/arrow_blue_b.gif" alt="" width="13" height="10" border="0"></a></td>';
	tempHtml += '					</tr>';
	tempHtml += '				</table>';
	tempHtml += '			</td>';
	tempHtml += '		</tr>';
	tempHtml += '	</table>';
	tempHtml += '</div>';
	tempHtml += '</div>';
	
	if (gen)	document.write(tempHtml);
}

function genSitemap(sect, id, color, point) {
	var obj = sectionArray[sect];
	
	tempHtml = '<table width="100%" cellpadding="0" cellspacing="0" border="0">';
	tempHtml += '	<tr>';
	tempHtml += '		<td valign="top" class="'+color+'" colspan="2">';
	if (obj[(id-1)].link != "") {
		tempHtml += '			<a href="'+obj[(id-1)].link+'" target="'+obj[(id-1)].target+'" class="'+color+'"><strong>'+obj[(id-1)].name+'</strong></a>';
	} else {
		tempHtml += '			<strong>'+obj[(id-1)].name+'</strong>';
	}
	tempHtml += '		</td>';
	tempHtml += '	</tr>';
	
	if (obj[(id-1)].subSection) {
		var obj1 = obj[(id-1)].subSection;
		for (var i=0; i<obj1.length; i++) {
			tempHtml += '	<tr>';
			tempHtml += '		<td width="15" valign="top" align="center" class="title" style="padding-top:7px;"><img src="'+path+'images/common/point_'+point+'.gif" width="3" height="3" alt="" hspace="6"></td>';
			tempHtml += '		<td width="100%" valign="top" class="'+color+'">';
			
			if (obj1[i].color) {
				var tempName = '<span style=\'color:' + obj1[i].color + '\'>' + obj1[i].name + '</span>';
			} else {
				var tempName = obj1[i].name;
			}
			if (obj1[i].link != "") {
				tempHtml += '			<a href="'+obj1[i].link+'" target="'+obj1[i].target+'" class="'+color+'">'+tempName+'</a>';
			} else {
				tempHtml += '			'+tempName+'';
			}
			tempHtml += '		</td>';
			tempHtml += '	</tr>';
			
				if (obj1[i].subSection) {
					var obj2 = obj1[i].subSection;
					tempHtml += '	<tr>';
					tempHtml += '		<td width="15" valign="top" align="center" class="title" style="padding-top:7px;"><img src="'+path+'images/common/spacer.gif" width="1" height="1" alt=""></td>';
					tempHtml += '		<td valign="top" class="title" style="padding-bottom:8px;">';
					tempHtml += '			<table width="100%" cellpadding="0" cellspacing="0" border="0">';
					for (var j=0; j<obj2.length; j++) {
						tempHtml += '				<tr>';
						tempHtml += '					<td width="15" valign="top" align="center" class="content">-</td>';
						tempHtml += '					<td valign="top" class="content">';
						if (obj2[j].link != "") {
							tempHtml += '						<a href="'+obj2[j].link+'" target="'+obj2[j].target+'" class="content">'+obj2[j].name+'</a>';
						} else {
							tempHtml += '						'+obj2[j].name+'';
						}
						tempHtml += '					</td>';
						tempHtml += '				</tr>';
					}
					tempHtml += '			</table>';
					tempHtml += '		</td>';
					tempHtml += '	</tr>';
				}
		}
	}
	
	
	tempHtml += '</table>';
	
	document.write(tempHtml);
}



function genAlphabetMenu()
{
	var str = "";
	//var objs = new Object();
	var objs = new Object();
	var aList = new Array();
	
	for (var i=1; i<=3; i++)	// section 1 to 3.
		{
			var sect = sectionArray[i];
			for (var s=0; s<sect.length; s++)
				{
					var sSect = sect[s];
					if (!objs[sSect.name.charAt(0).toLowerCase()])
						{
							objs[sSect.name.charAt(0).toLowerCase()] = new Object();
							objs[sSect.name.charAt(0).toLowerCase()].strokes = sSect.strokes;
						}
					
					var subSubSection = sSect.subSection;
					if (!(subSubSection)) continue;
					for (var ss=0; ss<subSubSection.length; ss++)
						{
							var ssSect = subSubSection[ss];
							if (!objs[ssSect.name.charAt(0).toLowerCase()])
								{
									objs[ssSect.name.charAt(0).toLowerCase()] = new Object();
									objs[ssSect.name.charAt(0).toLowerCase()].strokes = ssSect.strokes;
								}
						
							var subSubSubSection = ssSect.subSection;
							if (!(subSubSubSection)) continue;
							for (var sss=0; sss<subSubSubSection.length; sss++)
								{
									var sssSect = subSubSubSection[sss];
									if (!objs[sssSect.name.charAt(0).toLowerCase()])
										{
											objs[sssSect.name.charAt(0).toLowerCase()] = new Object();
											objs[sssSect.name.charAt(0).toLowerCase()].strokes = sssSect.strokes;
										}
								}
								
						}
				}
		}
		
	function sortByStrokes(a, b) {
		var x,y;
		if ((a.strokes == 0) && (b.strokes == 0)) {
		    x = a.name.toLowerCase();
		    y = b.name.toLowerCase();
		} else {
		    x = parseInt(a.strokes);
		    y = parseInt(b.strokes);
		}
	    return ((x < y) ? -1 : ((x > y) ? 1 : 0));
	}
	
	for (var item in objs)
		{
			aList.push({name:item, strokes:objs[item].strokes});
			
		}
	aList.sort(sortByStrokes);
	

	
	for (var i=0; i<aList.length; i++)
		{
			var a = aList[i];
			str += '<a href="#'+a.name+'" class="title">'+a.name.toUpperCase()+'</a>';
			str += (i<(aList.length-1))?' <span class="content">|</span> ':"";
		}
		
	
	document.write(str);
}

function genAlphabetSitemap() {
	var str = "";
	//var objs = new Object();
	var objs = new Object();
	var aObj = new Object();
	var aList = new Array();
	
	//build full obj list
	for (var i=1; i<=3; i++)	// section 1 to 3.
		{
			var sect = sectionArray[i];
			for (var s=0; s<sect.length; s++)
				{
					var sSect = sect[s];
					var id = sSect.name.charAt(0).toLowerCase();
					if (!aObj[id])
						{
							aObj[id] = new Object();
							aObj[id].index = id;
							aObj[id].strokes = sSect.strokes;
						}
					objs[sSect.name] = sSect;
					
					var subSubSection = sSect.subSection;
					if (!(subSubSection)) continue;
					for (var ss=0; ss<subSubSection.length; ss++)
						{
							var ssSect = subSubSection[ss];
							var id = ssSect.name.charAt(0).toLowerCase();
							if (!aObj[id])
								{
									aObj[id] = new Object();
									aObj[id].index = id;
									aObj[id].strokes = ssSect.strokes;
								}
							objs[ssSect.name] = ssSect;
						
							var subSubSubSection = ssSect.subSection;
							if (!(subSubSubSection)) continue;
							for (var sss=0; sss<subSubSubSection.length; sss++)
								{
									var sssSect = subSubSubSection[sss];
									var id = sssSect.name.charAt(0).toLowerCase();
									if (!aObj[id])
										{
											aObj[id] = new Object();
											aObj[id].index = id;
											aObj[id].strokes = sssSect.strokes;
										}
									objs[sssSect.name] = sssSect;
								}
								
						}
				}
		}
	
	//rebuild list (group by alphabet)
	function sortByStrokes(a, b) {
	    var x = parseInt(a.strokes);
	    var y = parseInt(b.strokes);
	    return ((x < y) ? -1 : ((x > y) ? 1 : 0));
	}	
	function sortByName(a, b) {
	    var x = a.name.toLowerCase();
	    var y = b.name.toLowerCase();
	    return ((x < y) ? -1 : ((x > y) ? 1 : 0));
	}
	var alength = 0
	for (var item in aObj)
		{
			//aObj[item].sect = new Object();
			aObj[item].sect = new Array();
			var i=0;
			var length = 0
			for (var o in objs)
				{
					if (o.charAt(0).toLowerCase() == item )
						{
							length++;
							aObj[item].sect[i++] = objs[o];
						}
				}

			//aObj[item].sect.sort(sortByStrokes);
			aObj[item].sect.sort(sortByName);
			aList.push(aObj[item]);
			alength++
		}			
	aObj.length = alength

	//bubble sort
	for (var i=0; i<aList.length; i++)
		{
			for (var j=i+1; j<aList.length; j++)
				{					
					if ((aList[j].strokes) == 0 && ( aList[i].strokes == 0)) {
						// Comparing By Name
						if (aList[j].index < aList[i].index)	{
							// Swap By Name							
							var dummy = aList[i];
							aList[i] = aList[j];
							aList[j] = dummy;
						}						
					} else if (aList[j].strokes < aList[i].strokes)	{
							var dummy = aList[i];
							aList[i] = aList[j];
							aList[j] = dummy;
					}
					
				}
		}

	//build table
	str += '<tr>';
	str += '	<td valign="top" style="padding-bottom:15px;">\n';
	str += '		<table width="100%" cellpadding="0" cellspacing="0" border="0">\n';	
	
	for (var i=0; i<aList.length; i++)
		{		
			// alphabet index
			var id = aList[i].index;			

			str += '			<tr>';
			// this is English
			str += '				<td colspan="6" class="titleSitemap" style="padding-bottom:5px; padding-top:15px;"><a name="'+id+'"></a>'+  ((aList[i].strokes == 0)?id.toUpperCase():id)+'</td>\n';
			str += '			</tr>\n';
			
			// objs here
			var r = 0;
			
			for (var sect in aList[i].sect)
				{
					str += (r%3)?'':'<tr>';
					str += '<td width="15" valign="top" align="center" style="padding-top:7px;"><img src="'+path+'images/common/point_blue_02.gif" width="3" height="3" alt="" hspace="6"></td>\n';
					str += '<td width="33%" valign="top" class="title">\n';
					if (aList[i].sect[sect].link != "")
						{
							str += '<a href="'+aList[i].sect[sect].link+'" class="title">';
						}
					
					if (aList[i].sect[sect].color) {
						var tempName = '<span style=\'color:' + aList[i].sect[sect].color + '\'>' + aList[i].sect[sect].name + '</span>';
					} else {
						var tempName = aList[i].sect[sect].name;
					}
					
					str += tempName;
					str += (aList[i].sect[sect].link != "")?'</a>':'';
					str += '</td>\n';
					r++;
					str += (r%3)?'':'</tr>\n';

				}
			var remain = (3-r)%3;
			if (remain>0)
				{
					for (var e=0; e<remain; e++)
						{
							str += '<td></td>\n';
						}
				}
			str += '			</tr>';
			/*
				str += '			<tr>';
				str += '				<td colspan="6" style="padding-top:15px;">';
				str += '					<table width="100%" cellpadding="0" cellspacing="0" border="0">';
				str += '						<tr>';
				str += '							<td align="right"><img src="../images/common/arrow_blue_t.gif" alt="" width="13" height="10" hspace="3"></td>';
				str += '							<td width="1%" class="menuLink" align="right"><a href="#top" class="menuLink">Top</a></td>';
				str += '						</tr>';
				str += '					</table>';
				str += '				</td>';
				str += '			</tr>';
			*/
		}
	str += '		</table>\n';
	str += '	</td>\n';
	str += '</tr>\n';

	document.write(str);	
	if (isDebugMode) {alert(debugstr)}
}
