﻿var isTextMode = (location.href.search(/(_t\.)(.+)$/)!=-1 || (location.href.search('.php') != -1 && location.href.search('istext=1') != -1));

if(isTextMode){
	document.writeln(' <link media="screen" type="text/css" rel="stylesheet" href="/pe2/filemanager/template/en/css/style_text.css" /> ');
}else{
	document.writeln(' <link media="screen" type="text/css" rel="stylesheet" href="/pe2/filemanager/template/en/css/style.css" /> ');
	document.writeln(' <link media="print" type="text/css" rel="stylesheet" href="/pe2/filemanager/template/en/css/style_print.css" /> ');
}
document.writeln(' <script type="text/javascript" src="/pe2/filemanager/template/common/js/jquery-1.4.2.min.js"></script> ');
document.writeln(' <script type="text/javascript" src="/pe2/filemanager/template/common/js/common.js"></script> ');
document.writeln(' <script type="text/javascript" src="/pe2/filemanager/template/common/js/swfobject.js"></script> ');
document.writeln(' <script type="text/javascript" src="/pe2/filemanager/template/common/js/jq_control.js"></script> ');

document.writeln(' <script type="text/javascript" src="/pe2/filemanager/template/common/js/generate_menu.js"></script> ');
document.writeln('<script type="text/javascript" src="/pe2/filemanager/template/common/js/prototype.js"></script>');
document.writeln('<script type="text/javascript" src="/pe2/filemanager/template/common/js/scriptaculous.js?load=effects,builder"></script>');
document.writeln('<script type="text/javascript" src="/pe2/filemanager/template/common/js/lightbox.js"></script>');
var pop = false;

function ShowHeader(){
	
	document.writeln(' ');
	
	if(isTextMode){
		document.writeln(' <div id="wrap_outer"> ');
		document.writeln(' <div id="wrap"> ');
		document.writeln(' <div id="top_zone"> ');
		document.writeln(' <div id="wrap_logo_lang_nav"> ');
		document.writeln(' <div id="wrap_logo"> ');
		document.writeln(' <p>West Kowloon Cultural District Authority</p> ');
		document.writeln(' </div> ');
		document.writeln(' <div id="wrap_lang_nav" class="clearfix"> ');
		document.writeln(' <ul>');
		document.writeln(' <li id="lang_text"><a href="'+((location.href.search('.php')!=-1)?location.href.replace('&istext=1',''):location.href.replace(/(_t\.)(\w+)$/,'.$2'))+'">[Graphic Version]</a></li> ');
		document.writeln(' <li id="lang_tc"><a href="'+((location.href.search('.php')!=-1)?location.href.replace('langid=1','langid=2'):location.href.replace('/en/','/tc/'))+'">[繁體]</a></li> ');
		document.writeln(' <li id="lang_sc"><a href="'+((location.href.search('.php')!=-1)?location.href.replace('langid=1','langid=3'):location.href.replace('/en/','/sc/'))+'">[简体]</a></li> ');
		document.writeln(' </ul>');
		document.writeln(' </div> ');
		document.writeln(' <hr/> ');
		document.writeln(' </div> ');
		document.writeln(' </div> ');
		/*
		document.writeln(' <div id="nav"> ');
		document.writeln('<script type="text/javascript">generate_menu(rootMenu);</script>');
		document.writeln(' <div id="left_bottom_box"> ');
		document.writeln(' Stage 2 Public Encasement Exercise Online Questionnaire ');
		document.writeln(' </div> ');
		document.writeln(' </div> ');
		*/
		document.writeln(' <div id="top_nav" class="clearfix"> ');
		document.writeln(' <ul> ');
		document.writeln(' ');
		document.writeln(' <li class="top_nav_twitter"><a href="https://twitter.com/WKCDA" target="_blank">Twitter</a> |</li> ');
		document.writeln(' <li class="top_nav_facebook"><a href="http://www.facebook.com/group.php?gid=119278886163&v=info&ref=ts" target="_blank">Facebook</a> |</li> ');
		document.writeln(' <li class="top_nav_youtube"><a href="http://www.youtube.com/user/wkcda?feature=mhum" target="_blank">Youtube</a> |</li> ');
		document.writeln(' <li class="top_nav_flickr"><a href="http://www.flickr.com/photos/westkowloon/" target="_blank">Flickr</a> |</li> ');
		document.writeln(' <li class="top_nav_rss"><a href="/en/what_s_new/rss/index_t.html" target="_blank">RRS</a> |</li> ');
		document.writeln(' <li class="top_nav_enews"><a href="/en/publications/e_newsletters/index_t.html" target="_blank">e-Newsletters</a> |</li> ');
		document.writeln(' <li class="top_nav_contactus"><a href="/en/contact_us/index_t.html" target="_blank">Contact Us</a> |</li> ');		
		document.writeln(' <li class="top_nav_sitemap"><a href="/pe2/en/sitemap/index_t.html" target="_blank">Sitemap</a> |</li> ');
		document.writeln(' </ul> ');
		document.writeln(' </div> ');
		document.writeln(' <hr/> ');
		document.writeln(' <div id="content_area">');
	}else{
		document.writeln(' <body id="bodyTag"> ');
		document.writeln(' <div id="wrap_outer"> ');
		document.writeln(' <div id="wrap"'+(pop==true?' style="width:795px;"':'')+'> ');
		document.writeln(' <div id="top_zone"'+(pop==true?' style="width:795px;"':'')+'> ');
		document.writeln(' <div id="wrap_logo_lang_nav"'+(pop==true?' style="display:none;"':'')+'> ');
		document.writeln(' <div id="wrap_logo"> ');
		document.writeln(' <a href="/en/what_s_new/index.html"><img src="/pe2/filemanager/template/common/images/logo_wkcda.jpg" /></a> ');
		document.writeln(' </div> ');
		document.writeln(' <div id="wrap_lang_nav"> ');
		document.writeln(' <div id="bg_top_left"></div> ');
		document.writeln(' <div id="lang_text"><a href="'+((location.href.search('.php')!=-1)? location.href.replace('langid=1','langid=1&istext=1'):location.href.replace(/(\.)(\w+)$/,'_t.$2'))+'"></a></div> ');
		document.writeln(' <div class="lang_sep"></div> ');
		document.writeln(' <div id="lang_tc"><a href="'+((location.href.search('.php')!=-1)?location.href.replace('langid=1','langid=2'):location.href.replace('/en/','/tc/'))+'"></a></div> ');
		document.writeln(' <div class="lang_sep"></div> ');
		document.writeln(' <div id="lang_sc"><a href="'+((location.href.search('.php')!=-1)?location.href.replace('langid=1','langid=3'):location.href.replace('/en/','/sc/'))+'"></a></div> ');
		document.writeln(' </div> ');
		document.writeln(' <div id="bg_top_leftbtm"></div> ');
		document.writeln(' </div> ');
		document.writeln(' <div id="top_banner"></div> ');
		document.writeln(' </div> ');
		document.writeln(' <div id="nav"'+(pop==true?' style="display:none;"':'')+'> ');
		document.writeln('<script type="text/javascript">generate_menu(rootMenu);</script>');
		document.writeln(' <div id="left_bottom_box"> ');
		document.writeln(' <a href="/pe2/en/questionnaire/index.html"><img src="/pe2/filemanager/template/common/images/stage2p_question_banner.jpg" /></a> ');
		document.writeln(' </div> ');
		document.writeln(' </div> ');
		document.writeln(' <div id="top_nav"'+(pop==true?' style="display:none;"':'')+'> ');
		document.writeln(' <ul> ');
		document.writeln(' ');
		document.writeln(' <li class="top_nav_sitemap"><a href="/pe2/en/sitemap/index.html" target="_blank"></a></li> ');
		document.writeln(' <li class="top_nav_contactus"><a href="/en/contact_us/index.html" target="_blank"></a></li> ');
		document.writeln(' <li class="top_nav_enews"><a href="/en/publications/e_newsletters/index.html" target="_blank"></a></li> ');
		document.writeln(' <li class="top_nav_rss"><a href="/en/what_s_new/rss/index.html" target="_blank"></a></li> ');
		document.writeln(' <li class="top_nav_flickr"><a href="http://www.flickr.com/photos/westkowloon/" target="_blank"></a></li> ');
		document.writeln(' <li class="top_nav_youtube"><a href="http://www.youtube.com/user/wkcda?feature=mhum" target="_blank"></a></li> ');
		document.writeln(' <li class="top_nav_facebook"><a href="http://www.facebook.com/group.php?gid=119278886163&v=info&ref=ts" target="_blank"></a></li> ');
		document.writeln(' <li class="top_nav_twitter"><a href="https://twitter.com/WKCDA" target="_blank"></a></li> ');
		document.writeln(' </ul> ');
		document.writeln(' </div> ');
		document.writeln(' <div id="content_area">');
	}
}

function ShowFooter(){
	if(isTextMode){
		document.writeln('</div> ');
		document.writeln('<div id="last_rev"><a href="http://www.wkcda.hk/en/important_notices/index_t.html" target="_blank">Important Notices</a><br />Last Revision Date: '+(last_revision_date==''?gbl_last_revision_date:last_revision_date)+'</div>');
		document.writeln('<hr/> ');
		document.writeln(' <div id="nav"> ');
		document.writeln('<script type="text/javascript">generate_menu(rootMenu);</script>');
		document.writeln(' <div id="left_bottom_box"> ');
		//document.writeln(' Stage 2 Public Encasement Exercise Online Questionnaire ');
		document.writeln(' </div> ');
		document.writeln(' </div> ');
		document.writeln(' </div> ');
		document.writeln(' </div> ');
		
	}else{
		
		document.writeln('</div> ');
		
		document.writeln('<div id="last_rev"><div style="margin-right:200px;float:left;"><a href="http://www.wkcda.hk/en/important_notices/index.html" target="_blank">Important Notices</a></div><div style="float:left;">Last Revision Date: '+(last_revision_date==''?gbl_last_revision_date:last_revision_date)+'</div></div>');
		
		document.writeln(' </div> ');
		document.writeln(' </div> ');
		document.writeln(' </body> ');
	}
}

function goBack()
{
	window.history.back()
}

function RemoveContent(d) {
	document.getElementById(d).style.display = "none";
}

function InsertContent(d) {
	document.getElementById(d).style.display = "";
}
