(function(a,b){
	try{
		var winSize = {width: 0, height: 0};
		if(typeof(window.innerWidth)=='number') {	//Non-IE
			winSize.width = window.innerWidth;
			winSize.height = window.innerHeight;
		}else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){	//IE 6+ in 'standards compliant mode'
			winSize.width = document.documentElement.clientWidth;
			winSize.height = document.documentElement.clientHeight;
		} else if(document.body && (document.body.clientWidth || document.body.clientHeight)){	//IE 4 compatible
			winSize.width = document.body.clientWidth;
			winSize.height = document.body.clientHeight;
		}

		if(/android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile|o2|opera m(ob|in)i|palm( os)?|p(ixi|re)\/|plucker|pocket|psp|smartphone|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce; (iemobile|ppc)|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))
			window.open(b, '_self');
	}catch(e){
		window.open(b, '_self');
	}
})(navigator.userAgent||navigator.vendor||window.opera, 'http://m.mobilenet.internal');

var IE = document.all?true:false;
var langs = ['en', 'tc', 'sc'];

/*var translateServerList = [
	{domain:'a',translateDomain:'b/'},
];*/
var translateServer = true;
var translateLangID = 2;
var translateLangID_ref = 1;
var currentDomainID = 0;
var currentLang = 0;


var ui_lang = 'en';
var ui_charset = 'utf-8';
var gp0 = 'mobilenet_home';
var gp1 = 'mobilenet_home';
var tpl_id = 'mobilenet';
var web = 'this';



function getPath(){
	/*var currentLang = 0;
	for(x in langs){
		if(location.href.search("/"+langs[x]+"/")!=-1)	currentLang = x;
	}*/
	
/*	if(translateServer){
	for(x in translateServerList){
		if(location.href.search(translateServerList[x].domain)!=-1){
			currentDomainID = x;
		}
		if(location.href.search(translateServerList[x].translateDomain)!=-1&&location.href.search(translateServerList[x].domain)!=-1){
			var tags = document.getElementsByTagName("html");
			tags[0].setAttribute("lang", "zh-CN");
			tags[0].setAttribute("xml:lang", "zh-CN");
			loca=location.href.substr(0, location.href.search('/chi/')+1);
				currentLang = translateLangID_ref;
				currentLang = translateLangID;
				break;
		}else{
			for(y in langs){
				if(location.href.search('/'+langs[y]+'/')!=-1){
					currentLang = y;
			loca=location.href.substr(0, location.href.search('/'+langs[currentLang]+'/')+1);
				currentLang=y;
				}
			}
		}
	}
}else{*/
	for(x in langs){
		if(location.href.search('/'+langs[x]+'/')!=-1){
			currentLang = x;
			loca=location.href.substr(0, location.href.search('/'+langs[currentLang]+'/')+1);
			/*langID = x;
			found = true;*/
		}
	}
//}
	return [loca, currentLang];
}

var pathArr = getPath();
var langIndex = pathArr[1];
var currentLang = langs[langIndex];
var currentPath = pathArr[0];
var currentPathLang = currentPath  + currentLang + '/';
var isTextMode = (location.href.search('_t.html')!=-1);
var isPrintMode = !(location.href.indexOf("?print=1")==-1 && location.href.indexOf("&print=1")==-1);

document.writeln('');
//document.writeln('<kanhanbypass>');
document.writeln('<link href="'+currentPath+'filemanager/template/'+langs[langIndex]+'/css/style_index.css" rel="stylesheet" type="text/css" media="screen" />');
document.writeln('<link href="'+currentPath+'filemanager/template/'+langs[langIndex]+'/css/style_index_print.css" rel="stylesheet" type="text/css" media="print" />\n');
//document.writeln('</kanhanbypass>');
document.writeln('<script type="text/javascript" src="'+currentPath+'filemanager/template/common/js/swfobject.js"></script>');
document.writeln('<script type="text/javascript" src="'+currentPath+'filemanager/template/common/js/index.js"></script>');
document.writeln('<script type="text/javascript" src="'+currentPath+'filemanager/template/common/js/jquery-1.4.1.min.js"></script>');
document.writeln('<script type="text/javascript" src="'+currentPath+'filemanager/template/common/js/jcombox-1.0b.packed.js"></script>');
document.writeln('<script type="text/javascript" src="'+currentPath+'filemanager/template/common/js/jquery.easing.1.3.js"></script>');
document.writeln('<script type="text/javascript" src="'+currentPath+'filemanager/template/common/js/common.js"></script>');
document.writeln('<script type="text/javascript" src="'+currentPath+'filemanager/template/common/js/jq_control.js"></script>');
document.writeln('<script type="text/javascript" src="'+currentPath+'filemanager/template/common/js/iepngfix_tilebg.js"></script>');
document.writeln('<script type="text/javascript" src="'+currentPath+'filemanager/template/common/js/generate_menu.js"></script>');

function ShowHeader(){
document.writeln('<div id="wrapper_outer">');
document.writeln('	<div id="wrapper">');
document.writeln('		<div id="index_flash"><div>');
	document.writeln('			<div id="nav_zone">');
	document.writeln('<script type="text/javascript">');
	document.writeln('<!--');
	document.writeln('if (\'function\' == typeof generateMenu){	generateMenu(rootMenu,1,"index");	}');
	document.writeln('//-->');
	document.writeln('</script>');
	document.writeln('			</div>');
document.writeln('				<a href="javascript:jumpIconNav(\'1\')" class="games" title="Online Games" alt="Online Games"></a>');
document.writeln('				<a href="javascript:jumpIconNav(\'2\')" class="guide" title="Guide to Mobile Internet Services" alt="Guide to Mobile Internet Services"></a>');
document.writeln('				<a href="javascript:jumpIconNav(\'3\')" class="tips" title="Consumer Tips" alt="Consumer Tips"></a>');
document.writeln('				<a href="javascript:jumpIconNav(\'4\')" class="security" title="Security Issues" alt="Security Issues"></a>');
document.writeln('				<a href="javascript:jumpIconNav(\'5\')" class="talks" title="Public Talks" alt="Public Talks"></a>');
document.writeln('		</div></div>');
document.writeln('		<script type="text/javascript">');
document.writeln('				var flash = new SWFObject("'+currentPath+'filemanager/template/'+langs[langIndex]+'/images/index.swf", "index", "100%", "600", "10", "#FFFFFF");');
document.writeln('				flash.addParam("quality", "high");');
document.writeln('				flash.addParam("wmode", "transparent");');
document.writeln('				flash.addParam("allowScriptAccess", "sameDomain");');
document.writeln('				flash.addParam("menu", "false");');
document.writeln('				flash.addParam("align", "middle");');
document.writeln('				flash.addParam("play", "true");');
document.writeln('				flash.addParam("loop", "true");');
document.writeln('				flash.addParam("scale", "showall");');
document.writeln('				flash.addVariable("iconPath1", getBannerData("image", 0));');
document.writeln('				flash.addVariable("iconPath2", getBannerData("image", 1));');
document.writeln('				flash.write("index_flash");');
document.writeln('				</script>');
document.writeln('		<div id="top_zone">');
document.writeln('		<table cellspacing="0" cellpadding="0" border="0">');
document.writeln('		<tr>');
document.writeln('			<td><div id="logo">');
document.writeln('				<a href="#"><img src="'+currentPath+'filemanager/template/common/images/logo_ofta.gif" title="OFTA, Office of the Telecommunications Authority, Hong Kong" alt="OFTA, Office of the Telecommunications Authority, Hong Kong" /></a><br />');
document.writeln('			</div>');
document.writeln('			</td>');
document.writeln('			<td>');
document.writeln('			<div id="shortcuts">');
document.writeln('				<ul id="lang_nav">');
	document.writeln('					<li><a href="#" class="en selected"><span>English</span></a></li>');
	document.writeln('					<li><a class="tc" href="javascript:SwitchLang(2)"><span>繁體中文</span></a></li>');
	document.writeln('						<li ><a href="javascript:SwitchLang(3)" class="sc"><span>简体中文</span></a></li>');
document.writeln('				</ul>');
	document.writeln('				<ul id="view_control">');
	document.writeln('				<li><a href="'+getMobilelink()+'"><span>Mobile Version</span></a></li>');
	document.writeln('				</ul>');

	document.writeln('				<div id="search_field">');
	document.writeln('					<form name="mobilesearchform" id="mobilesearchform" action="http://search.gov.hk/search.html" method="get">');
	document.writeln('					<input type="hidden" name="tpl_id" value="'+tpl_id+'" />');
	document.writeln('					<input type="hidden" name="gp0" value="'+gp0+'" />');
	document.writeln('					<input type="hidden" name="gp1" value="'+gp1+'" />');
	document.writeln('					<input type="hidden" name="web" value="'+web+'" />');
	document.writeln('					<input type="hidden" name="ui_lang" value="'+ui_lang+'" />');
	document.writeln('					<input type="hidden" name="ui_charset" value="'+ui_charset+'" />');
	document.writeln('				 	<img src="'+currentPath+'filemanager/template/'+langs[langIndex]+'/images/title_search.gif" alt="Search" />');
	document.writeln('				 	<div style="display: none;"><label for="txtSearch">Search</label></div>');
	document.writeln('				 	<input type="text" name="query" id="txtSearch" />');
	document.writeln('				 	<a class="search" href="javascript:document.mobilesearchform.submit();">Search</a>');
	document.writeln('					</form>');
	document.writeln('				</div>');
document.writeln('			</div>');
document.writeln('			</td>');
document.writeln('			</tr>');
document.writeln('			</table>');
document.writeln('			<table cellspacing="0" cellpadding="0" border="0">');
document.writeln('			<tr>');
document.writeln('			<td>');
document.writeln('			<ul id="left_shortcuts">');
	document.writeln('				<li><a href="'+currentPathLang+'objectives/index.html" class="aim">Objectives</a></li>');
	document.writeln('				<li ><a href="'+currentPathLang+'sitemap/index.html" class="sitemap">Sitemap</a></li>');
	document.writeln('				<li ><a href="'+currentPathLang+'contact_us/index.html" class="contact">Contact Us</a></li>');
document.writeln('			</ul>');
document.writeln('			</td>');
document.writeln('			<td></td>');
document.writeln('			</tr>');
document.writeln('			</table>');
document.writeln('		</div>');
document.writeln('		<div id="bottom_zone_outer">');
document.writeln('		<div id="bottom_zone">');
document.writeln('			<!-- Footer start -->');
document.writeln('			<ul id="copyright"><li>2010 © Office of the Telecommunications Authority</li><li>|<a href="'+currentPathLang+'important_notice/index.html">Disclaimer</a></li><li>|<a href="'+currentPathLang+'privacy_policy/index.html">Privacy Policy</a></li></ul>');
document.writeln('			<ul id="share_area"><li>Share To</li><li><a href="javascript:sharingURL(\'facebook\')" class="facebook">Facebook</a></li><li><a href="javascript:sharingURL(\'twitter\')" class="twitter">Twitter</a></li></ul>');
document.writeln('			<!-- Footer end -->');
document.writeln('		</div>');
document.writeln('		</div>');
document.writeln('	</div>');
}

function ShowFooter(){
}



