var FAQ_TEST = false;

function PULL_DOWN_MENU() {
	this.strItem= '';
	this.strItemArr = '';
	this.strItemTextStyle = '';
	this.strItem2= '';
	this.strSubItem= '';
    this.BasePath= '';
	this.counter=0;
	this.Started=false;
	this.ICON='';

	this.Title='';
	this.SubTitle='';
	this.SubTitleStyle='';
	this.SubTitleDesc='';
	this.SubTitleDescStyle='';
	this.TitleStyle='';
	this.Content='';
	this.aNodes = new Array();
}
function PULL_DOWN_MENU_Node(title, subtitle, subtitledesc, content) {
	this.Title = title;
	this.SubTitle = subtitle;
	this.SubTitleDesc = subtitledesc;
	this.Content = content;
}

PULL_DOWN_MENU.prototype.HKMC_BasePath = function(inPar){
	this.BasePath = inPar;
}
PULL_DOWN_MENU.prototype.HKMC_TitleStyle = function(inPar){
	this.TitleStyle=inPar;
}
PULL_DOWN_MENU.prototype.HKMC_SubTitleStyle = function(inPar){
	this.SubTitleStyle=inPar;
}

PULL_DOWN_MENU.prototype.HKMC_AddTitle = function(inPar){
	this.Title = inPar;
	if (!FAQ_TEST) document.writeln('<tr><td '+this.TitleStyle+'>'+inPar+'</td><td></td><td></td></tr>');
}

PULL_DOWN_MENU.prototype.HKMC_AddSubTitle = function(inPar){
	this.aNodes[this.aNodes.length] = new PULL_DOWN_MENU_Node(this.Title, inPar, '', '');
	this.SubTitle = inPar;
	this.counter++;
}
PULL_DOWN_MENU.prototype.HKMC_AddSubTitleDesc = function(inPar){
	this.aNodes[this.aNodes.length - 1].SubTitleDesc = inPar;
	this.SubTitleDesc = inPar;
	if (!FAQ_TEST) this.HKMC_DisplaySubTitle();
}
PULL_DOWN_MENU.prototype.HKMC_DisplaySubTitle = function(){
	this.SubTitleDescTDStyle = 'style="background-image:url('+this.BasePath+'image/common/dots-full.gif)"';
	//this.SubTitleDescTextStyle = 'style="text-decoration:none;background-color:white"';
	this.ICON='<a href="javascript:var linkrecord='+this.counter+';"><img onclick=\'javascript:HKMC_MS_Switch(document.all.par'+ this.counter+',1);\' border="0" src="'+this.BasePath+'image/common/i_view.gif" /></a>';

	if (window.location.href.indexOf('/chi/') == -1) {
		this.CLOSETAB ='<a href="javascript:;"><div style="text-decoration:none" align=\"right\" onClick=\'javascript:HKMC_MS_Switch(document.all.par'+this.counter+',0)\'><font color=\"#C0C0C0\"><b>close</b></font></div></a>';
	} else {
		this.CLOSETAB ='<a href="javascript:;"><div style="text-decoration:none" align=\"right\" onClick=\'javascript:HKMC_MS_Switch(document.all.par'+this.counter+',0)\'><font color=\"#C0C0C0\"><b>Ãö³¬</b></font></div></a>';
	}


	//spacing
/*
	document.writeln('<tr><td '+this.SubTitleStyle+'" width="1">'+this.SubTitle+'</td>');
        document.writeln('<td width="380"'+this.SubTitleDescTDStyle +'>'+'<span href="javascript:var linkrecord='+this.counter+';" ><span style="cursor:hand;text-decoration:none;background-color:white" onclick=\'javascript:HKMC_MS_Switch(document.all.par'+ this.counter+',1);\'>'+this.SubTitleDesc+'</span></span></td> <td style="vertical-align:top" width="10">'+this.ICON+'</td> </tr>');
*/
	document.writeln('<tr><td width="1" '+this.SubTitleStyle+'>'+this.SubTitle+'</td>');

    document.writeln('<td width="540"'+this.SubTitleDescTDStyle +'><a href="javascript:;" onclick="HKMC_MS_Switch(document.all.par'+ this.counter+',1);var linkrecord='+this.counter+';" class="faq">'+this.SubTitleDesc+'</a></td>');
    //document.writeln('<td width="540"'+this.SubTitleDescTDStyle +'>'+'<span href="javascript:var linkrecord='+this.counter+';" ><span style="cursor:hand;text-decoration:none;background-color:white" onclick=\'javascript:HKMC_MS_Switch(document.all.par'+ this.counter+',1);\'>'+this.SubTitleDesc+'</span></a></td>');
    document.writeln('<td style="vertical-align:top" width="10">'+this.ICON+'</td></tr>');

	document.writeln('<tr> <td colspan="3">&nbsp;</td> </tr>');
}

PULL_DOWN_MENU.prototype.HKMC_AddContent = function(inPar){
	var e = this.aNodes[this.aNodes.length - 1];
	if (e.Content == '') {
		e.Content = inPar;
	} else {
		e.Content += '<br />&nbsp;<br />' + inPar;
	}
	this.Content += inPar + '<br />&nbsp;<br />';
}
PULL_DOWN_MENU.prototype.HKMC_DisplayContent = function(){
	if (!FAQ_TEST) document.writeln('<tr><td></td><td width="80%"><div style="a-style:red;text-align:justify;" id="par'+this.counter+'">'+this.Content+this.CLOSETAB+'<br>&nbsp;</div></td><td></td></tr>');
	this.Content='';
}
PULL_DOWN_MENU.prototype.HKMC_DisplayTable = function(){
	if (!FAQ_TEST) document.writeln('<table width="100" border="0" cellspacing="10" cellpadding="0" height="0">');
}
PULL_DOWN_MENU.prototype.HKMC_EndTable = function(){
	//document.writeln('</table>');
	//document.writeln('</table>');
}