/*window.onbeforeunload = function() {
	if (event.clientY < 0)  
	{  
		window.open(domain_url+'/form_tc.html', 'page1','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,pageXOffset=0,pageYOffset=0,top=0,left=232,width=620,height=500');
	}
}*/

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
//alert('MM_swapImgRestore');
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  
  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function StyleSheet(){
	if (document.URL.toString().search('/en/') != -1) {
		document.writeln('<link href="'+domain_url+'/css/css.css" rel="stylesheet" type="text/css" />');
	}else{
		document.writeln('<link href="'+domain_url+'/css/css_tc.css" rel="stylesheet" type="text/css" />');
	}
}
function hiddenAllLayer(layer){
	buffer='';
	for (i=1;i<=sublink.length;i++){
		//if (i!=layer) 
		buffer=buffer+' MM_showHideLayers(\'Layer'+i+'\',\'\',\'hide\'); ';
	}
	return buffer;
}

var leftMenuName="menuImage";
var leftMenuSectionImageOut=".jpg";
var leftMenuSectionImageOver="_over.jpg";
function doShowMenu(imgName){
	document.images[leftMenuName+imgName].src=document.images[leftMenuName+imgName].src.replace(leftMenuSectionImageOut, leftMenuSectionImageOver)
}

function doHideMenu(imgName){
	document.images[leftMenuName+imgName].src=document.images[leftMenuName+imgName].src.replace(leftMenuSectionImageOver, leftMenuSectionImageOut)
}
//check broswer width
N=window.navigator.appName.substring(0,8);
//alert(N);
function init(){
	if(N=="Microsof"){
		w = document.documentElement.clientWidth;
		//h = document.documentElement.clientHeight;
	}
	if(N=="Netscape"){
		w=window.innerWidth;
		//h=window.innerHeight;
	}
	w=(w/2)-400+170;
	//alert("browser width="+w);
	//alert("browser height="+h);
	return(w);
}
//check broswer width
function calhpos(){
	if(N=="Microsof"){
		if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
			var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
			if (ieversion>=8)
				hpos=25;
			else
				hpos=0;
		}
	}else{
		hpos=15;
	}
	return(hpos);
}
//check broswer height

var hide  = true;

function showhide(obj)
{
	var x = document.getElementById('testP');
	hide = !hide;
	x.style.visibility = (hide) ? 'hidden' : 'visible';
	setLyr(obj,'testP');
}

function setLyr(obj,lyr)
{
	var coors = findPos(obj);
	if (lyr == 'testP') coors[1] -= 50;
	var x = document.getElementById(lyr);
	var layer = parseInt(lyr.substr(5));
	var spec=0;
	if (layer == 4)
	{
		if(N=="Microsof"){
		if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
			var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
			if (ieversion>=8)
				spec = 15;
			else
				spec = 0;
		}
		}else{
			spec = 15;
		}
	}
	
	x.style.top = coors[1] -calhpos() -spec + 'px';
	x.style.left = coors[0] + 150 + 'px';
}

function findPos(obj)
{
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function defaultlayer(){
	w=init();
	//alert("return browser width="+w);
	
	document.writeln('<style type="text/css">');
	document.writeln('<!--');
	for (var i in mainlink){
		//document.writeln('                  <li><a href="'+mainlink[i]+'">'+alt[i]+'</a><br><br>');
		document.writeln('#Layer'+i+' {');
		document.writeln('	position:absolute;');
		document.writeln('	left:'+w+'px;');
		document.writeln('	top:135px;');
		document.writeln('	width:145px;');
		document.writeln('	z-index:1;');
		document.writeln('	visibility: hidden;');
		document.writeln('}');

	}
	document.writeln('-->');
	document.writeln('</style>');
}

function getTitle() {
	var scriptBuffer='';
	var scriptBuffer2='';
	
	scriptBuffer2+=sitetitle+' - '+alt[Selected_ID];
	if(SectionId!=0&&SectionId!='') {
		scriptBuffer2+= ' - ' + subalt[Selected_ID][SectionId]
		/*
		if(selectedSubSection>0&&selectedSubSection!='') {
			scriptBuffer2+= ' - ' + subSubalt[Selected_ID+1][SectionId][selectedSubSection]
		}
		*/
	}
	
	scriptBuffer+='<title>'+scriptBuffer2+'</title>\n';
	scriptBuffer+='<meta name="Keywords" content="'+scriptBuffer2+'">\n';
	scriptBuffer+='<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\n';
	//scriptBuffer+='<meta http-equiv="Content-Type" content="text/html; charset=big5-HKSCS">\n';
	
	document.writeln(scriptBuffer);
	defaultlayer();

	//alert(scriptBuffer);
	//return scriptBuffer;	
}

function langSwitch(lang) {
	var currentPath=location.href.toString();
	var switchTc='/tc/';
	var switchEn='/en/';
	var switchSc='/sc/';
	var TempCurrpath = currentPath.split("#");
	currentPath = TempCurrpath[0];

	if(lang=="graphic"){
		currentPath=currentPath.replace('/text', "");
	}else if(lang=="textonly"){
		currentPath=currentPath.replace(switchEn, '/text'+switchEn);
		currentPath=currentPath.replace(switchTc, '/text'+switchTc);
		currentPath=currentPath.replace(switchSc, '/text'+switchSc);
	}else if(lang=="tc"){
		currentPath=currentPath.replace(switchEn, switchTc);
		currentPath=currentPath.replace(switchSc, switchTc);
		//currentPath=currentPath.replace(gb_urlPath, "");
	}else if(lang=="sc"){
		currentPath=currentPath.replace(switchTc, switchSc);
		currentPath=currentPath.replace(switchEn, switchSc);
	}else if(lang=="en"){
		currentPath=currentPath.replace(switchTc, switchEn);
		currentPath=currentPath.replace(switchSc, switchEn);
		//currentPath=currentPath.replace(gb_urlPath, "");
	}
	location.href=currentPath;
}

function TopMenu(){
	document.writeln('<table cellpadding="0" cellspacing="0" border="0">');

	document.writeln('<tr><td><a href="#" onclick="langSwitch(\'en\');" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image10\',\'\',\''+domain_url+'/images/common/btn_inside_en_over.jpg\',0)"><img src="'+domain_url+'/images/common/btn_inside_en.jpg" name="Image10" width="49" height="44" border="0" id="Image10" title="English" alt="English"/></a></td>');
	document.writeln('<td><a href="#" onclick="langSwitch(\'tc\');" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image11\',\'\',\''+domain_url+'/images/common/btn_inside_tc_over.jpg\',1)"><img src="'+domain_url+'/images/common/btn_inside_tc.jpg" name="Image11" width="62" height="44" border="0" id="Image11" title="&#32321;&#39636;&#20013;&#25991;" alt="&#32321;&#39636;&#20013;&#25991;"/></a></td>');
	document.writeln('<td><a href="#" onclick="langSwitch(\'sc\');" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image12\',\'\',\''+domain_url+'/images/common/btn_inside_sc_over.jpg\',1)"><img src="'+domain_url+'/images/common/btn_inside_sc.jpg" name="Image12" width="62" height="44" border="0" id="Image12" title="&#31616;&#20307;&#20013;&#25991;" alt="&#31616;&#20307;&#20013;&#25991;"/></a></td>');

	document.writeln('<td><a href="'+langPath+'contact/index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image13\',\'\',\''+ImgPath+'btn_inside_content_us_over.jpg\',1)"><img src="'+ImgPath+'btn_inside_content_us.jpg" name="Image13" width="62" height="44" border="0" id="Image13" title="'+alt_contactus+'" alt="'+alt_contactus+'"/></a></td>');
	document.writeln('<td><img src="'+domain_url+'/images/common/main_v3.jpg" width="294" height="44" /></td></tr>');
	document.writeln('</table>');
	/*
	document.writeln('    <table width="89%" border="0" cellspacing="0" cellpadding="0">');
	document.writeln('      <tr>');
	document.writeln('        <td><img src="../images/sepal_in_001.jpg" width="316" height="32" /></td>');
	document.writeln('        <td><a href="'+langPath+'sitemap/index.html" onmouseover="MM_swapImage(\'ImageHead1\',\'\',\''+domain_url+'/images/sepal_in_btn1_f2.jpg\',1)" onmouseout="MM_swapImgRestore()"><img src="'+domain_url+'/images/sepal_in_btn1.jpg" width="95" height="32" id="ImageHead1" border="0" alt="'+alt[0]+'" title="'+alt[0]+'"></a></td>');
	
	if(document.URL.toString().search('/sc/')!=-1){
		document.writeln('        <td><a onclick="langSwitch(\'en\');" onmouseover="MM_swapImage(\'ImageHead2\',\'\',\''+domain_url+'/images/sepal_in_btn2_f2.jpg\',1)" onmouseout="MM_swapImgRestore()"><img src="'+domain_url+'/images/sepal_in_btn2.jpg" height="32" id="ImageHead2" border="0" alt="'+alt_changelang2+'" title="'+alt_changelang2+'" ></a></td>');
		document.writeln('        <td><a onclick="langSwitch(\'tc\');" onmouseover="MM_swapImage(\'ImageHead3\',\'\',\''+domain_url+'/images/sepal_in_btn3_f2.jpg\',1)" onmouseout="MM_swapImgRestore()"><img src="'+domain_url+'/images/sepal_in_btn3.jpg" height="32" id="ImageHead3" border="0" alt="'+alt_changelang1+'" title="'+alt_changelang1+'"></a></td>');
	}else if(document.URL.toString().search('/tc/')!=-1){
		document.writeln('        <td><a onclick="langSwitch(\'en\');" onmouseover="MM_swapImage(\'ImageHead2\',\'\',\''+domain_url+'/images/sepal_in_btn2_f2.jpg\',1)" onmouseout="MM_swapImgRestore()"><img src="'+domain_url+'/images/sepal_in_btn2.jpg" width="81" height="32" id="ImageHead2" border="0" alt="'+alt_changelang1+'" title="'+alt_changelang1+'" ></a></td>');
		document.writeln('        <td><a onclick="langSwitch(\'sc\');" onmouseover="MM_swapImage(\'ImageHead3\',\'\',\''+domain_url+'/images/sepal_in_btn3_f2.jpg\',1)" onmouseout="MM_swapImgRestore()"><img src="'+domain_url+'/images/sepal_in_btn3.jpg" width="100" height="32" id="ImageHead3" border="0" alt="'+alt_changelang2+'" title="'+alt_changelang2+'"></a></td>');
	}else{
		document.writeln('        <td><a onclick="langSwitch(\'tc\');" onmouseover="MM_swapImage(\'ImageHead2\',\'\',\''+domain_url+'/images/sepal_in_btn2_f2.jpg\',1)" onmouseout="MM_swapImgRestore()"><img src="'+domain_url+'/images/sepal_in_btn2.jpg" width="81" height="32" id="ImageHead2" border="0" alt="'+alt_changelang1+'" title="'+alt_changelang1+'" ></a></td>');
		document.writeln('        <td><a onclick="langSwitch(\'sc\');" onmouseover="MM_swapImage(\'ImageHead3\',\'\',\''+domain_url+'/images/sepal_in_btn3_f2.jpg\',1)" onmouseout="MM_swapImgRestore()"><img src="'+domain_url+'/images/sepal_in_btn3.jpg" width="100" height="32" id="ImageHead3" border="0" alt="'+alt_changelang2+'" title="'+alt_changelang2+'"></a></td>');
	}
	
	
	document.writeln('      </tr>');
	document.writeln('      <tr><td colspan="4"><img src="../images/sepal_in_002.jpg" width="592" height="77" alt="Support and Empower your PAL" title="Support and Empower your PAL" /></td></tr>');
	document.writeln('    </table>');
	*/
}

function LeftMenu(){
	document.writeln('                  <table width="157" border="0" cellpadding="0" cellspacing="0">');
	for (var i in linkOrder){
		if (linkOrder[i]==Selected_ID){
			document.writeln('<tr><td><a href="'+mainlink[linkOrder[i]]+'"  onmouseout="MM_swapImgRestore(); '+ hiddenAllLayer(linkOrder[i]) +'" onmouseover="setLyr(this,\'Layer'+linkOrder[i]+'\');MM_showHideLayers(\'Layer'+linkOrder[i]+'\',\'\',\'show\');"><img src="'+ImgPath+'btn0'+linkOrder[i]+'_over.jpg" name="menuImage'+linkOrder[i]+'" border="0" id="menuImage'+linkOrder[i]+'" alt="'+alt[linkOrder[i]]+'" title="'+alt[linkOrder[i]]+'"/></a></td></tr>');
		}else{
			document.writeln('<tr><td><a href="'+mainlink[linkOrder[i]]+'"  onmouseout="MM_swapImgRestore(); '+ hiddenAllLayer(linkOrder[i]) +'" onmouseover="setLyr(this,\'Layer'+linkOrder[i]+'\');MM_showHideLayers(\'Layer'+linkOrder[i]+'\',\'\',\'show\');MM_swapImage(\'menuImage'+linkOrder[i]+'\',\'\',\''+ImgPath+'btn0'+linkOrder[i]+'_over.jpg\',1);"><img src="'+ImgPath+'btn0'+linkOrder[i]+'.jpg" name="menuImage'+linkOrder[i]+'" border="0" id="menuImage'+linkOrder[i]+'" alt="'+alt[linkOrder[i]]+'" title="'+alt[linkOrder[i]]+'"/></a></td></tr>');
		}
	}
	
	document.writeln('<tr><td><img src="'+domain_url+'/images/common/spacer.gif" width="100" height="80" /></td></tr>');
	document.writeln('<tr><td><img src="'+ImgPath+'inside_search.jpg" width="157" height="24" alt="Search" title="Search" /></td></tr>');
	document.writeln('                  </table>');
	document.writeln('                  <table width="157" border="0" cellpadding="0" cellspacing="0">');
	document.writeln('                    <form name="search" action="../../search.php" method="POST"><input type="hidden" name="col" value="1"><tr>');
	document.writeln('                      <td width="11" align="left" valign="middle"><img src="'+domain_url+'/images/common/spacer.gif" width="10" height="10" /></td>');
	document.writeln('                      <td width="82" align="left" valign="middle"><input type="Text" value="" name="query" size="20" class="search_boxCopy"></td>');
	document.writeln('                      <td width="64" align="left"><!--input type="submit" value="Go"--><a href="javascript:document.forms.search.submit();" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image26\',\'\',\''+ImgPath+'btn_go_over.jpg\',1)"><img src="'+ImgPath+'btn_go.jpg" name="Image26" width="23" height="16" border="0" id="Image26" alt="Go" title="Go"/></a></td>');
	document.writeln('                    </tr></form>');
	document.writeln('                  </table>');
	document.writeln('                  <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image26\',\'\',\''+domain_url+'/images/common/btn_go_over.jpg\',1)"></a>');
}

function getSection(){

	document.writeln('              <tr>');
	if (Selected_ID<10){
		document.writeln('                <td height="43" colspan="2" align="left" valign="bottom"><img src="'+ImgPath+'hd_0'+Selected_ID+'.jpg" border="0" alt="'+alt[Selected_ID]+'" title="'+alt[Selected_ID]+'"/></td>');
	}else{
		document.writeln('                <td height="43" colspan="2" align="left" valign="bottom"><img src="'+ImgPath+'hd_'+Selected_ID+'.jpg" border="0" alt="'+alt[Selected_ID]+'" title="'+alt[Selected_ID]+'"/></td>');
	}
	document.writeln('              </tr>');
	/*
	document.writeln('        <tr>');
	document.writeln('          <td><img src="../images/sepal_in_table1.jpg" width="15" height="64" /></td>');
	document.writeln('          <td><img src="../images/sepal_in_title'+Selected_ID+'.jpg" width="550" height="64" alt="'+alt[Selected_ID]+'" title="'+alt[Selected_ID]+'" /></td>');
	document.writeln('          <td><img src="../images/sepal_in_table3.jpg" width="27" height="64" /></td>');
	document.writeln('        </tr>');
	*/
}

function HeaderHtml(){
	document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.writeln('  <tr>');
	document.writeln('    <td align="center"><table width="751" height="485" border="0" cellpadding="0" cellspacing="0">');
	document.writeln('      <tr>');
	document.writeln('        <td width="13" height="18"><img src="'+domain_url+'/images/common/s_top_left.jpg" width="13" height="18" /></td>');
	document.writeln('        <td width="725" height="18" background="'+domain_url+'/images/common/s_top.jpg"><img src="'+domain_url+'/images/common/spacer.gif" width="1" height="1" /></td>');
	document.writeln('        <td width="13" height="18"><img src="'+domain_url+'/images/common/s_top_right.jpg" width="13" height="18" /></td>');
	document.writeln('      </tr>');
	document.writeln('      <tr>');
	document.writeln('        <td background="'+domain_url+'/images/common/s_left.jpg">&nbsp;</td>');
	document.writeln('        <td valign="top"><table width="725" border="0" cellspacing="0" cellpadding="0">');
	document.writeln('          <tr>');
	document.writeln('            <td><map name="map"><area title="'+sitetitle+'" alt="'+sitetitle+'" coords="0,0,212,62" href="'+domain_url+'/index.html"></map><img src="'+domain_url+'/images/common/main_v.jpg" width="725" height="119"  border="0" title="'+sitetitle+'" alt="'+sitetitle+'" usemap="#map"/></td>');
	document.writeln('          </tr>');
	document.writeln('          <tr>');
	if(document.URL.toString().search('/searchblox/')==-1){ 
		document.writeln('            <td background="'+domain_url+'/images/common/bg.jpg"><table width="725" border="0" cellspacing="0" cellpadding="0">');
		document.writeln('              <tr>');
		document.writeln('                <td width="157" rowspan="3" valign="top">');
		LeftMenu();
		document.writeln('                </td>');
		document.writeln('                <td width="39" rowspan="3" align="left" valign="top"><img src="'+domain_url+'/images/common/main_v2.jpg" width="39" height="112" /></td>');
		document.writeln('                <td colspan="2" valign="top">');
		TopMenu();
		document.writeln('                </td>');
		document.writeln('              </tr>');
		getSection();
		document.writeln('              <tr>');
		document.writeln('                <td width="499" align="left" valign="top">');
		if (SectionId!=0){
			document.writeln('                <p align="left" class="title">'+subalt[Selected_ID][SectionId]+'</p>');
		}else{
			document.writeln('                <p align="left">&nbsp;</p>');
		}
	}else{
		document.writeln('                <td>');
	}
}
function FooterHtmlDisclaimer(){
	if(document.URL.toString().search('/sc/')!=-1){
		foottext='&copy;2007 青山医院精神健康学院 | <a href="'+langPath+'disclaimer/index.html">版权及免责声明</a> <br />本网站以800 x 600解像度浏览效果最佳，并应以IE 5.0 或 Netscape 4.7 或以上浏览器阅读';
	}else if(document.URL.toString().search('/tc/')!=-1){
		foottext='&copy;2007 青山醫院精神健康學院 | <a href="'+langPath+'disclaimer/index.html">版權及免責聲明</a> <br />本網站以800 x 600解像度瀏覽效果最佳，並應以IE 5.0 或 Netscape 4.7 或以上瀏覽器閱讀';
	}else{
		foottext='&copy; 2007 Institute of Mental Health. All rights reserved.  |  <a href="'+langPath+'disclaimer/index.html">Copyright & Disclaimer</a><br />Best viewed with Internet Explorer 5.0 and Netscape 4.7 or above with 800 X 600 resolution.';
	}
	return(foottext);
}
function FooterHtml(){
	if(document.URL.toString().search('/searchblox/')==-1){ 
		gotoTop();
		document.writeln('                </td>');
		document.writeln('                <td width="30" valign="top"><img src="'+domain_url+'/images/common/spacer.gif" width="30" height="300" /></td>');
		document.writeln('              </tr>');
		document.writeln('            </table></td>');
		document.writeln('          </tr>');
		document.writeln('          <tr>');
		document.writeln('            <td width="725" height="103" align="right" valign="top" background="'+domain_url+'/images/common/inside_base.jpg"><table width="529" border="0" cellspacing="0" cellpadding="0">');
		document.writeln('              <tr>');
		document.writeln('                <td align="left"><span class="footer">'+FooterHtmlDisclaimer()+'</span></td>');
		document.writeln('              </tr>');
		document.writeln('            </table></td>');
	}else{
		document.writeln('            </td>');
	}
	document.writeln('          </tr>');
	document.writeln('        </table></td>');
	document.writeln('        <td background="'+domain_url+'/images/common/s_right.jpg">&nbsp;</td>');
	document.writeln('      </tr>');
	document.writeln('      <tr>');
	document.writeln('        <td width="13" height="18"><img src="'+domain_url+'/images/common/s_bottom_left.jpg" width="13" height="18" /></td>');
	document.writeln('        <td width="725" height="18" background="'+domain_url+'/images/common/s_bottom.jpg"><img src="'+domain_url+'/images/common/spacer.gif" width="1" height="1" /></td>');
	document.writeln('        <td width="13" height="18"><img src="'+domain_url+'/images/common/s_bottom_right.jpg" width="13" height="18" /></td>');
	document.writeln('      </tr>');
	document.writeln('    </table></td>');
	document.writeln('  </tr>');
	document.writeln('</table>');
	//document.writeln('<p>&nbsp;</p>');
	if(document.URL.toString().search('/searchblox/')==-1){ 
		genlayer();
	}
}

function SiteMap(){
	//if(document.URL.toString().search('/sitemap/')!=-1){
		document.writeln('<p><ul>');
		for (var i in linkOrder){
			document.writeln('                  <li><a href="'+mainlink[linkOrder[i]]+'">'+alt[linkOrder[i]]+'</a><br><br>');
		}
		document.writeln('</ul></p>');
			
	//}
}

function gotoTop(){
	//document.writeln('                  <p align="left">&nbsp;</p>');
	document.writeln('                  <p align="left"><br /></p>');
	document.writeln('                  <table width="499" border="0" cellspacing="0" cellpadding="0">');
	document.writeln('                    <tr>');
	document.writeln('                      <td align="right"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'Image31\',\'\',\''+ImgPath+'btn_inside_top_over.jpg\',1)"><img src="'+ImgPath+'btn_inside_top.jpg" name="Image31" border="0" id="Image31" title="'+alt_top+'" alt="'+alt_top+'"/></a></td>');
	document.writeln('                    </tr>');
	document.writeln('                    <tr>');
	document.writeln('                      <td background="'+domain_url+'/images/common/inside_line.jpg"><img src="'+domain_url+'/images/common/spacer.gif" width="8" height="6" /></td>');
	document.writeln('                    </tr>');
	document.writeln('                  </table>');
	document.writeln('                  <p class="title">&nbsp;</p>');
}

function PopWinVideo(url){
	if(document.URL.toString().search('/sc/')!=-1){
		desc = '<font size="2">关闭视窗</font>';
		wintitle = '青山医院精神健康学院';
	}else if(document.URL.toString().search('/tc/')!=-1){
		desc = '<font size="2">關閉視窗</font>';
		wintitle = '青山醫院精神健康學院';
	}else{
		desc = '<font face="Arial, Helvetica, sans-serif" size="2">Close Window</font>';
		wintitle = 'Institute of Mental Health';
	}
	content = '<html><head><title>'+ wintitle +'</title><meta http-equiv="Content-Type" content="text/html; charset=big5-HKSCS"><link rel="stylesheet" type="text/css" href="../css/main.css"></head><body bgcolor="#FFFFFF" topmargin="0" marginheight="0" marginwidth="0" leftmargin="0"><table border=0 cellspacing=0 cellpadding=0 width=100%><tr valign=top>	</td><OBJECT ID="MediaPlayer" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" width="330" height="300" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"><PARAM NAME="FileName" VALUE="../../images/media/'+ url +'"><PARAM NAME="AutoStart" Value="True"><PARAM NAME="ShowControls" Value="true"><EMBED TYPE="application/x-mplayer2" PLUGINSPAGE="http://www.microsoft.com/Windows/MediaPlayer/" SRC="../../download/media/'+ url +'" name="MediaPlayer" width="250" height="230" AUTOSTART="1" SHOWCONTROLS="0"></EMBED></OBJECT>	</td></tr><tr valign=top>	<td align=center><br><a href="javascript:window.close();">'+ desc +'</a></td></tr></table></body></html>';
	eval("nw = window.open('', 'page','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,pageXOffset=0,pageYOffset=0,top=0,left=232,width=350,height=340')");
	nw.focus();
	nw.document.write(content);
	nw.document.close();
}


function subindex(){
	document.write('<ul>');
	for (var i in sublink[Selected_ID]){
		document.write('<li><a href="'+sublink[Selected_ID][i]+'">'+subalt[Selected_ID][i]+'</a></li>');
	}
	document.write('</ul>');
}

function genlayer(){
	for (var i in sublink){	
	
		if(Selected_ID==i){//check layer in same section - h't doShowMenu function & doHideMenu function
			document.writeln('<div id="Layer'+i+'" onmouseover="MM_showHideLayers(\'Layer'+i+'\',\'\',\'show\');" onmouseout="MM_showHideLayers(\'Layer'+i+'\',\'\',\'hide\');">');
		}else{//check layer not in same section
			document.writeln('<div id="Layer'+i+'" onmouseover="doShowMenu('+i+'); MM_showHideLayers(\'Layer'+i+'\',\'\',\'show\');" onmouseout="doHideMenu('+i+'); MM_showHideLayers(\'Layer'+i+'\',\'\',\'hide\');">');
		}//end check layer not in same section
		
		//document.writeln('<div id="Layer'+i+'" onmouseover="MM_showHideLayers(\'Layer'+i+'\',\'\',\'show\');MM_swapImage(\'menuImage'+i+'\',\'\',\''+ImgPath+'btn0'+i+'_over.jpg\',1);" onmouseout=" MM_showHideLayers(\'Layer'+i+'\',\'\',\'hide\');">');
		if (typeof(sublink[i]) != "undefined"){
			document.writeln('  <table width="145px" border="0" cellspacing="0" cellpadding="0" onmouseover="MM_showHideLayers(\'Layer'+i+'\',\'\',\'show\');" onmouseout="MM_showHideLayers(\'Layer'+i+'\',\'\',\'hide\');" >');
			//document.writeln('  <table width="145px" border="0" cellspacing="0" cellpadding="0" onmouseover="MM_showHideLayers(\'Layer'+i+'\',\'\',\'show\');MM_swapImage(\'menuImage'+i+'\',\'\',\''+ImgPath+'btn0'+i+'_over.jpg\',1);" onmouseout="MM_showHideLayers(\'Layer'+i+'\',\'\',\'hide\');" >');
			//document.writeln('  <table width="145px" border="0" cellspacing="0" cellpadding="0" onmouseover="MM_showHideLayers(\'Layer'+i+'\',\'\',\'show\');MM_swapImage(\'menuImage'+i+'\',\'\',\''+ImgPath+'btn0'+i+'_over.jpg\',1);" onmouseout="MM_swapImgRestore();MM_showHideLayers(\'Layer'+i+'\',\'\',\'hide\');" bgcolor="#6DC748" bordercolor="#ffffff" >');
			for (var j in sublink[i]){
				document.write('<tr><td><a href="'+sublink[i][j]+'" class="submenu" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'menuImage'+i+'_'+j+'\',\'\',\''+ImgPath+'menu2nd/btn0'+i+'_0'+j+'_over.jpg\',1);"><img src="'+ImgPath+'menu2nd/btn0'+i+'_0'+j+'.jpg" border="0" id="menuImage'+i+'_'+j+'" alt="'+subalt[i][j]+'" title="'+subalt[i][j]+'"/></a></td></tr>');
			}
			document.writeln('  </table>');
		}
		document.writeln('</div>');
	}	
}


function externalLink(url)
{eval("nw = window.open(url, 'external','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,pageXOffset=0,pageYOffset=0,top=0,left=0,width=760,height=580')");
	if ( nw.focus != null)
	{nw.focus();}
}

function externalLink2(url)
{eval("nw = window.open(url, 'external','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,pageXOffset=0,pageYOffset=0,top=0,left=0,width=618,height=520')");
	if ( nw.focus != null)
	{nw.focus();}
}
