var footer = ' \
<div id="Footer"> \
  <div align="right"> \
  	<div id="Footerlinks"> \
<a href="mailto:webmaster@overseassingaporean.sg">Contact Us</a> |  \
<a target="_blank" href="/privacy.html">Portal Privacy Statement</a> | \
<a target="_blank" href="/about.html">About OS Portal</a> | \
<a target="_blank" href="/terms.html">Terms of Use</a> \
| <a href="/sitemap.html">Sitemap</a> \
<!-- | <a href="#">Help</a> --> \
</div> \
  	<div id="Footerlinks2">Copyright &copy; 2006 Overseas Singaporean Portal</div> \
  </div> \
</div> \
';

if (document.getElementById("loginLine1"))
{
	document.write(footer);
}

if (document.location.href.indexOf("act=Reg") > 0 || document.location.href.indexOf("act=Login") > 0 ||
	document.title == "Registration Form")
{
	//  Hide navigation in registration page.
	if (document.getElementById("navstrip"))
		document.getElementById("navstrip").style.display = "none";
	if (document.getElementById("userlinks"))
		document.getElementById("userlinks").style.display = "none";
	if (document.getElementById("loading-layer"))
		document.getElementById("loading-layer").style.display = "none";
}

if (document.location.href.indexOf("act=UserCP") > 0 || document.location.href.indexOf("act=Login") > 0 ||
	document.location.href.indexOf("act=Reg") > 0 || document.title == "Registration Form")
{
	//  Change update profile and registration POST URL to https.
	for(i=0;i<document.forms.length;i++)
	{
		var url = document.forms[i].action;
		if (url.indexOf("http://") == 0)
		{
			url = url.replace("http://", "https://");
			document.forms[i].action = url;
		}
	}	
	//  Change all update profile URLs to https.
	var anchors=document.body.getElementsByTagName("A"); 
	for(i=0;i<anchors.length;i++)
	{ 
		var url = anchors[i].href;
		if (url.indexOf("http://") == 0 && url.indexOf("act=UserCP") > 0)
		{ 
			url = url.replace("http://", "https://");
			anchors[i].href = url;
		}
	}
}
