//
// functions to set current location
//

function CheckForCurrentPage()
{

for (var i= 0; i < document.links.length; i++)
	{

 
	if (window.document.links[i].className == "LeftNav")
	{
	if (window.location.href == window.document.links[i])
		{window.document.links[i].className = "LeftNavCurrent"
		}
	}
	{ // special case for home page
	if (window.location.href + "index.htm" == window.document.links[i])
		{window.document.links[i].className = "LeftNavCurrent"
		// alert(window.location.href)
		//alert(window.document.links[i].className)
		}
	}
	if (window.document.links[i].className == "LeftNavAssgn") 
		{
		var sLocation = GetSector(window.location.href)
		if (sLocation == GetSector(window.document.links[i].href))	
			{window.document.links[i].className = "LeftNavCurrent"
			}
		}

	}

return 
}

function GetSector(sUrl)
{

var i = 0;
var j = 0;
var ASSIGNMENTS = "/assignments/";
var sSector = "";

i = sUrl.indexOf(ASSIGNMENTS);
sSector = sUrl.substring(i + ASSIGNMENTS.length);

i = sSector.indexOf("/");
sSector = sSector.substring(0,i);

return sSector
}



   // This function returns Internet Explorer's major version number,
   // or 0 for others. It works by finding the "MSIE " string and
   // extracting the version number following the space, up to the decimal
   // point, ignoring the minor version number

   function msieversion()
   {
      var ua = window.navigator.userAgent
      var msie = ua.indexOf ( "MSIE " )

      if ( msie > 0 )      // If IE, return version number
         return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
      else                 // If another browser, return 0
         return 0
   }

// Javascript function to generate Mailto tags


function InsertMailToTag( userName, domainName)
{
var EmailId;
var atSign = "&#64;"
var fullStop = "&#46";

EmailId = userName;
EmailId = "" + EmailId + atSign; 
EmailId = EmailId + domainName;

document.write( "<a href='mail" + "to:" + EmailId + "'>" + EmailId +"</A>" );
}
