//-- all site url
//
//snapURL = "/";

//SNAP should be a relative link (to accommodate LDAP users) unless on domains not supported by LDAP
if(location.host == 'go.snap-undp.org' || location.host == 'hq.snap-undp.org') {
	snapURL = "/";
}else{
	snapURL = "http://go.snap-undp.org/";
}


focusAreaURL = snapURL + "focusareas/";
coURL = snapURL + "co/";
crossRcURL = "http://asia-pacific.undp.org/";
intraURL = "http://intra.aprc.undp.org/";
searchURL = "http://intra.aprc.undp.org/searchcenter/";
logoutURL = "/_layouts/signout.aspx";
publicURL = "http://www.snap-undp.org/";
UNDPURL = "http://www.undp.org/";
helpURL = snapURL + "snapsupport/";
elibraryURL = "http://www.snap-undp.org/elibrary/";


//-- all text link
snapTEXT = "SNAP Home";
focusAreaTEXT = "Focus Areas";
coTEXT = "Country Offices";
crossRcTEXT = "Asia-Pacific Regional Centre";
intraTEXT = "Intranet";
searchTEXT = "Search";
logoutTEXT = "Logout";
publicTEXT = "SNAP Public site";
UNDPTEXT = "UNDP website";
helpTEXT = "Need Support?";
elibraryTEXT = "eLibrary";

url = window.location.href.toLowerCase();

function CreateTopnav()
{
	var url = window.location.href.toLowerCase();
	document.writeln("<TABLE id=nav cellSpacing=0 cellPadding=0 border=0>");
	document.writeln("<TR>");
	document.writeln("<TD class=first>&nbsp;</TD>");
	if(url.indexOf(publicURL) < 0)
		document.writeln("<TD><A href=\"" + focusAreaURL + "\">" + focusAreaTEXT + "</A></TD>");
	if(url.indexOf(coURL) >= 0)
		document.writeln("<TD><div onmouseover=\"popup('pCFmenu','CFmenu');\" onmouseout=\"popdown();\"><a href=\"" + coURL + "\" name=\"CFmenu\" id=\"CFmenu\">" + coTEXT + "</a></div></TD>");
	if(url.indexOf(publicURL) < 0)
		document.writeln("<TD><A href=\"" + crossRcURL + "\" >" + crossRcTEXT + "</A></TD>");
	if(url.indexOf(publicURL) < 0)
		document.writeln("<TD><A href=\"" + elibraryURL + "\" >" + elibraryTEXT + "</A></TD>");
	if(url.indexOf(publicURL) < 0)
		document.writeln("<TD><A href=\"" + intraURL + "\" >" + intraTEXT + "</A></TD>");
	document.writeln("<TD><A href=\"" + searchURL + "\">" + searchTEXT + "</A></TD>");
	if(url.indexOf(publicURL) < 0)
		document.writeln("<TD><A href=\"" + logoutURL + "\" id=\"Log_In_Out_Button\">" + logoutTEXT + "</A></TD>");
	if(url.indexOf(publicURL) < 0)
		document.writeln("<TD><A href=\"" + publicURL + "\">" + publicTEXT + "</A></TD>");
	if(url.indexOf(publicURL) >= 0)
		document.writeln("<TD><A href=\"" + UNDPURL + "\">" + UNDPTEXT + "</A></TD>");
	if(url.indexOf(coURL) >= 0 || url.indexOf(publicURL) >= 0)
		document.writeln("<TD style=\"width:100%; padding-right:80px; text-align:right;\"><A href=\"#\">Help</A></TD>");
	else
		document.writeln("<TD style=\"width:100%; padding-right:80px; text-align:right;\"><A href=\"" + helpURL + "\">" + helpTEXT + "</A></TD>");
	document.writeln("</TR>");
	document.writeln("</TABLE>");
}

function CreateLogo()
{
	document.writeln("<a href=\"" + snapURL + "\">");
	document.writeln("<img src=\"/_layouts/UNDP/images/snap_top.gif\" alt=\"SNAP\" border=0>");
	document.writeln("</a>");
}

function CreateRootBreadcrumb()
{
	if(url.indexOf(snapURL.toLowerCase()) >= 0 || url.indexOf(publicURL.toLowerCase()) >= 0 || url.indexOf(intraURL.toLowerCase()) >= 0)
	{
		document.writeln("<a class=\"ms-sitemapdirectional\" href=\"" + snapURL + "\">");
		document.writeln(snapTEXT);
		document.writeln("</a>");
	}
}


