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
  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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function load_nav(section_id)
{
	document.write("<table border='0' cellpadding='0' cellspacing='0' width='" + nav_width + "'>");
	show_logo();
	show_login();
	build_nav(section_id);
	subscription();
	document.write("</table>");
}

function show_logo()
{
	document.write("<tr>");
	document.write("<td><a href='/pcguard/pcguard/home_c.jsp'><img src='/pcguard/images/pcGuard_logo.gif' border='0' alt=''></a></td>");
	document.write("</tr>");
}

function build_nav(section_id)
{
	for (var i=0; i<nav_len; i++)
	{
		document.write("<tr>");
		if (nav_id_list[i] != section_id)
		{
			document.write("<td><a href=\"" + nav_link_list[i] + "\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('" + nav_id_list[i] + "','','" + nav_rollover_img_list[i] + "',1)\"><img name=\"" + nav_id_list[i] + "\" src=\"" + nav_img_list[i] + "\" border=\"0\" width=\"" + nav_width + "\" alt=\"" + nav_img_alt_list[i] + "\"/></a></td>");
		}
		else
		{
			document.write("<td><img src='" + nav_inact_img_list[i] + "' width='" + nav_width + "' border='0' alt='" + nav_img_alt_list[i] + "'/></td>");
		}
		document.write("</tr>");
	}	
}

function show_login()
{
	var loginBtnHref = "javascript:document.loginForm.submit();";
	var forgetPasswordUrl = "http://www2.netvigator.com/services/netcs/bb_contact_iframe_c.html";
		
	if (showLogin)
	{
		document.write("<tr>");
		document.write("<td align='left'><table width='189' height='182' border='0' cellpadding='0' cellspacing='0' background='/pcguard/images/bg_color.gif'>");
		document.write("<form name='loginForm' action='https://netpass.netvigator.com/netpass/servlet/NPLogin' method='POST'>");
		document.write("  <tr>");
		document.write("    <td width='189' height='30'><img src='/pcguard/images/pic01.gif' width='189' height='30'></td>");
		document.write("  </tr>");
		document.write("  <tr>");
		document.write("    <td width='189' height='19'><img src='/pcguard/images/pic02.gif' width='189' height='19'></td>");
		document.write("  </tr>");
		document.write("  <tr>");
		document.write("    <td width='189' height='26'><table width='189' border='0' cellspacing='0' cellpadding='0'>");
		document.write("      <tr>");
		document.write("        <td width='14' height='26'><img src='/pcguard/images/pic05.gif' width='14' height='26'></td>");
		document.write("        <td width='175' height='26'><input name='loginid' class='loginTextBox' type='text' id='login' size='15'></td>");
		document.write("      </tr>");
		document.write("    </table></td>");
		document.write("  </tr>");
		document.write("  <tr>");
		document.write("    <td width='189' height='26'><table width='189' border='0' cellspacing='0' cellpadding='0'>");
		document.write("      <tr>");
		document.write("        <td width='14' height='26'><img src='/pcguard/images/pic05.gif' width='14' height='26'></td>");
		document.write("        <td width='175' height='26'><select name='domain' class='loginPullDown' id='domain'>");
		document.write("		<option value='netvigator'>@netvigator.com</option><option value='hkstar'>@hkstar.com</option>");
		document.write("        </select></td>");
		document.write("      </tr>");
		document.write("    </table></td>");
		document.write("  </tr>");
		document.write("  <tr>");
		document.write("    <td width='189' height='16'><img src='/pcguard/images/pic03.gif' width='189' height='16'></td>");
		document.write("  </tr>");
		document.write("  <tr>");
		document.write("    <td width='189' height='25'><table width='189' border='0' cellspacing='0' cellpadding='0'>");
		document.write("      <tr>");
		document.write("        <td width='14' height='26'><img src='/pcguard/images/pic05.gif' width='14' height='26'></td>");
		document.write("        <td width='121' height='26'><input name='password' class='loginTextBox' type='password' id='password' size='15'></td>");
		document.write("        <td width='54' height='26'><a href='" + loginBtnHref + "'><img src='/pcguard/images/pic04.gif' width='54' height='26' border='0'></a></td>");
		document.write("      </tr>");
		document.write("    </table></td>");
		document.write("  </tr>");
		document.write("  <tr>");
		document.write("    <td width='189'><table width='189' border='0' cellspacing='0' cellpadding='0'>");
		document.write("      <tr>");
		document.write("        <td width='14' height='26'><img src='/pcguard/images/pic05.gif' width='14' height='26'></td>");
		document.write("        <td height='26'><a href='"+forgetPasswordUrl+"'><span class='lhsText'>忘記密碼</span></a></td>");
		document.write("      </tr>");
		document.write("    </table></td>");
		document.write("  </tr>");
		document.write("  <tr>");
		document.write("    <td width='189' height='35'><img src='/pcguard/images/pic06.gif' width='189' height='35'></td>");
		document.write("  </tr>");
document.write("<input type='hidden' name='successurl' value='https://enquiry.netvigator.com/pcguard/user_service/home_c.jsp'>");
document.write("<input type='hidden' name='failurl' value='http://pcguard.netvigator.com/pcguard/pcguard/home_c.jsp'>");
document.write("<input type='hidden' name='loginurl' value='http://pcguard.netvigator.com/pcguard/pcguard/home_c.jsp'>");
document.write("<input type='hidden' name='session s' value=''>");
document.write("<input type='hidden' name='session f' value=''>");
document.write("<input type='hidden' name='i success' value=''>");
		document.write("</form>");
		document.write("</table></td>");
		document.write("</tr>");
	}
	else if (showWelcome)
	{
		document.write("<tr>");
		document.write("<td align='left'><table width='189' height='182' border='0' cellpadding='0' cellspacing='0' background='/pcguard/images/bg_color.gif'>");
		document.write("  <tr>");
		document.write("    <td height='30'><img src='/pcguard/images/spacer.gif' width='189' height='30'></td>");
		document.write("  </tr>");
		document.write("  <tr>");
		document.write("    <td valign='top'><table width='189' border='0' cellspacing='0' cellpadding='0'>");
		document.write("      <tr>");
		document.write("        <td width='14' rowspan='2' valign='top'><img src='/pcguard/images/pic05.gif' width='14' height='26'></td>");
		document.write("        <td><span class='welcomeText'>歡迎！" + userDisplayName + "<br><br></span></td>");
		document.write("      </tr>");
		document.write("      <tr>");
		if (userPlans.length > 0)
		{
			document.write("        <td><span class='welcomeText'>你現有的網上保安增值服務<br>計劃包括：<br>" + userPlans + "</span></td>");
		}
		else
		{
			document.write("        <td><span class='welcomeText'>你沒有申請任何網上保安<br>增值服務。</span></td>");
		}
		document.write("      </tr>");
		document.write("    </table></td>");
		document.write("  </tr>");
		document.write("  <tr>");
		document.write("    <td height='35'><img src='/pcguard/images/pic06.gif' width='189' height='35'></td>");
		document.write("  </tr>"); 
		document.write("</table></td>");
		document.write("</tr>");
	}
}

function subscription()
{
	var subscribeBtnHref = "https://enquiry.netvigator.com/pcguard/pcguard/service_plan/apply/subscript_c.jsp";
	
	document.write("<tr height='50'>");
	document.write("<td align='center'><a href='" + subscribeBtnHref + "'><img src='/pcguard/images/btn_subscribe.jpg' border='0'></a></td>");
	document.write("</tr>");
}
