includeCommonVars();

function buildComponentNavigation(linkArr)
{
	var page = "", buildBack = true, url;
	switch(currentPage)
	{
		case "Home":
		case "MyCourses":
		case "Store":
		case "Community":
		case "MyProfile":
		case "LogIn":
		case "myPage":   
		case "Support":
			buildBack = false;
			url = "#";
			break;	
		case "babylonAdd":
		case "Forum":
		case "Magazine":
		case "InSite":
		case "TalkingIdioms":
		case "WordZone":
		case "WebPal":
		case "WebChallenge":
			url = Root + "Runtime/MidScreens/Community.asp";
			break;	
		case "course": 
			url = "myPage.asp"
			if (FromTMS)
				buildBack = false;
			break;
		case "unit": 
			url = "Course.asp?courseId=" + getCompositeCookie("Course", "CourseId") + "&FromTMS=" + FromTMS 
			break;
		case "component":   
		case "viewComponent": 
			page = "Unit.asp?unitId=" + getCompositeCookie("Unit", "UnitId") + "&FromTMS=" + FromTMS + "&SID=" + getCompositeCookie("Student", "SID")
			url = 'javaScript:SavePage(&quot;'+ page +'&quot;,&quot;'+ appName +'&quot;,' + obj.Id + ',&quot;' + appletMode + '&quot;)'	   
			break;		
		case "customComponent":
		case "viewCustomComponent":
			page = "Unit.asp?unitId=" + getCompositeCookie("Unit", "UnitId") + "&FromTMS=" + FromTMS + "&SID=" + getCompositeCookie("Student", "SID")
			url = 'javaScript:saveCCData(&quot;'+ page +'&quot;)'	   
			break;		
	}
	
	w('<div style="text-align:center">')
	w('<div style="text-align:left;width:780px;padding-top:5px;margin-bottom:7px" class="bgchange">')

	w('<table  border="0" cellspacing="0" cellpadding="0" class="BgChange" >')
	w('<tr> ')

  if (buildBack)
  {
		w('<td id="buildBack1" width="30" align="middle" valign="top"><A href="'+url+'"><IMG id=IMG1 border=0 height=15 src=' + Root + 'Runtime/Context/common/BackLink.gif width=30></a></td>')
		w('<td style="padding-right:30px" id="buildBack2" align="left" valign="top" nowrap ><A class="unitLink eptOut OpenWindowBarTitleD" style="background-color:transparent;padding:0px;border:0px solid"  href="'+url+'">'+getTranslate("cxtNv00NtBackToMenu")+'</a></td>')
  }
  else
  {
		w('<td align="left" valign="top" nowrap ><IMG height=20 src="' + Root + 'Runtime/Context/common/transparent.gif" width=140></td>')
  }
	var subPages, names, links, linkNames;
	switch (currentPage)
	{
		case "Magazine":
			subPages = new Array("Current Issue", "Archive");
			names = new Array("currentissue", "archive");
			links = linkArr;
			linkNames = new Array(getTranslate("cxt24100MaPmNtCurrentIssue"), getTranslate("cxt24100MaPmNtArchive"));
			break;		
		case "InSite":
			subPages = new Array("CurrentReview", "PastReviews");
			names = new Array("currentreview", "pastreviews");
			links = new Array("InSite.asp", "InSiteArchive.asp");
			linkNames = new Array(getTranslate("cxtIs00NvNtCurrent"), getTranslate("cxtIs00NvNtPast"));
			break;		
		case "TalkingIdioms":
			subPages = new Array("Idioms", "Archive");
			names = new Array("idioms", "archive");
			links = new Array("IdiomsF.asp", "IdiomsArchive.asp");
			linkNames = new Array(getTranslate("cxtTi0000NvIdioms"), getTranslate("cxtTi0000NvArchive"));
			break;		
		case "WebPal":
			subPages = new Array("Inbox", "Pals", "Search Pals", "Sent Items");
			names = new Array("inbox", "pals", "search", "sent");
			links = new Array("NWP_Inbox.asp", "NWP_Pals.asp", "NWP_SearchSwitch.asp", "NWP_Sent.asp");
			linkNames = new Array(getTranslate("cxtWp0000NvInbox"), getTranslate("cxtWp0000NvPals"), getTranslate("cxtWp0000NvSearchPals"), getTranslate("cxtWp0000NvSent"));
			break;
		case "Support":
			subPages = new Array("Inbox", "Teachers", "Sent");
			names = new Array("inbox", "teachers", "sent");
			links = new Array("Inbox.asp", "Teachers.asp", "Sent.asp");
			linkNames = new Array(getTranslate("cxtTsNv00NtInbox"), getTranslate("cxtTsNv00NtWrite"), getTranslate("cxtTsNv00NtSentItems"));
			break;		
	}
	var idName;
	switch (currentPage)
	{
		case "component":
		case "viewComponent":  
			for (var i = 0; i < subCompNameArr.length; i++)
			{
				idName = subCompNameArr[i].toLowerCase()
				do {
					idName = idName.replace(" ","_")
		    } while (idName.indexOf(" ") > -1)	
				do {
					idName = idName.replace("-","_")
		    } while (idName.indexOf("-") > -1)	
			  
				if (subCompNameArr[i] == obj.SubComponent)
				{
					w('<td width="10" height="20" align="center" valign="middle"><IMG height=20 src="' + Root + 'Runtime/Context/newLook/common/eptCornerL.gif" width=10 name="i'+idName+'"></td>')
					w('<td align="center" valign="middle" class="ept0bg0highlight" nowrap id="'+ idName +'"><span class="sinput">&nbsp;</span><A class=ept0links href="#">&nbsp;'+getEPTTranslate(subCompNameArr[i])+'&nbsp;</A></td>')
					w('<td width="10" height="20" align="center" valign="middle"><IMG height=20 src="' + Root + 'Runtime/Context/newLook/common/eptCornerR.gif" width=10 name="i'+idName+'R"></td>')
				}
				else
				{    
					var sSubCompName = subCompNameArr[i]  
				  if (subCompNameArr[i] != "Test")
						var sSubCompName = skill + sSubCompName
				  w('<td width="10" height="20" align="center" valign="middle"><IMG height=20 src="' + Root + 'Runtime/Context/common/transparent.gif" width=10 name="i'+ idName +'"></td>')
				  w('<td height="20" align="center" valign="middle" nowrap id="'+ idName +'" class="ept0bg" onMouseOver="EPTOver(this,&quot;i' + idName + '&quot;)" onMouseOut="EPTOut(this,&quot;i' + idName + '&quot;)"><A id="i'+ idName +'L" class="unitLink eptOut OpenWindowBarTitleD" style="padding:0px;background-color:transparent;border:0px solid" href="javascript:getSubComp('+itemIdArr[i]+',&quot;'+sSubCompName+'&quot;,'+subCompIdArr[i]+')">&nbsp;'+getEPTTranslate(subCompNameArr[i])+'&nbsp;</A></td>')
					w('<td width="10" height="20" align="center" valign="middle"><IMG height=20 src="' + Root + 'Runtime/Context/common/transparent.gif" width=10 name="i'+ idName +'R"></td>')
				}    
			} 
			break;
		case "customComponent":
		case "viewCustomComponent":
			for (var i = 0; i < subCompNameArr.length; i++)
			{
				idName = subCompNameArr[i].toLowerCase()
				do {
					idName = idName.replace(" ","_")
		    } while (idName.indexOf(" ") > -1)	
				do {
					idName = idName.replace("-","_")
		    } while (idName.indexOf("-") > -1)	

				if (subCompIdArr[i] == getCompositeCookie("Component", "ItemId"))
				{
					w('<td width="10" height="20" align="center" valign="middle"><IMG height=20 src="' + Root + 'Runtime/Context/newLook/common/eptCornerL.gif" width=10 name="i'+idName+'"></td>')
					w('<td align="center" valign="middle" class="ept0bg0highlight" nowrap id="'+ idName +'"><span class="sinput">&nbsp;</span><A class=ept0links href="#">&nbsp;'+getEPTTranslate(subCompNameArr[i])+'&nbsp;</A></td>')
					w('<td width="10" height="20" align="center" valign="middle"><IMG height=20 src="' + Root + 'Runtime/Context/newLook/common/eptCornerR.gif" width=10 name="i'+idName+'R"></td>')
				}
				else
				{
				  w('<td width="10" height="20" align="center" valign="middle"><IMG height=20 src="' + Root + 'Runtime/Context/common/transparent.gif" width=10 name="i'+ idName +'"></td>')
				  w('<td height="20" align="center" valign="middle" nowrap  id="'+ idName +'" class="ept0bg" onMouseOver= "EPTOver(this,&quot;i' + idName + '&quot;)" onMouseOut= "EPTOut(this,&quot;i' + idName + '&quot;)"><A id="i'+ idName +'L" class="unitLink eptOut OpenWindowBarTitleD" style="padding:0px;background-color:transparent;border:0px solid" href="javascript:getCustSubComp('+subCompIdArr[i]+')">&nbsp;'+getEPTTranslate(subCompNameArr[i])+'&nbsp;</A></td>')
					w('<td width="10" height="20" align="center" valign="middle"><IMG height=20 src="' + Root + 'Runtime/Context/common/transparent.gif" width=10 name="i'+ idName +'R"></td>')
				}    
			} 
			break;
		case "InSite":
		case "TalkingIdioms":
		case "WebPal":
		case "Support":
		case "Magazine":
			for (var i = 0; i < subPages.length; i++)
			{
				w('<td align="center" valign="middle" width="10">');
				var strImg = (subPages[i] == subPage) ? "Runtime/Context/newLook/common/eptCornerL.gif" : "Runtime/Context/common/transparent.gif";
				w('<img src=' + Root + strImg +' width=10 height=20 name=' + names[i] + '></td>');
				if (subPages[i] == subPage)
				{
					w('<td align="center" valign="middle" class="ept0bg0highlight" nowrap>');
					w('<a href="#" class=ept0links>' + linkNames[i] + '</a></td><td  style="padding-right:1px" height="20"  align="middle" valign="center" width="10"><IMG height=20 src="' + Root + 'Runtime/Context/newLook/common/eptCornerR.gif" width=10 ></td>');
				}
				else
				{
					w('<td  id=' + names[i] + ' height="20" align="center" valign="middle" nowrap class="ept0bg" onMouseOver="EPTOver(this,&quot;' + names[i] + '&quot;)" onMouseOut="EPTOut(this,&quot;' + names[i] + '&quot;)" >');
			    w('<a href=' + links[i] + ' class="unitLink eptOut OpenWindowBarTitleD" id=' + names[i] + 'L style="padding:0px;background-color:transparent;border:0px solid;">' + linkNames[i] + '</a></td><td style="padding-right:1px"><IMG height=20 src="' + Root + 'Runtime/Context/newLook/common/transparent.gif" width=10 id="' + names[i] + 'R" ></td>');
				}
			}
			break;
		default:
			w('<td height="20" align="right" width="20"><IMG height=20 src=' + Root + 'Runtime/Context/common/transparent.gif width=20 name=iexplore></td>')
			w('<td height="20" align="middle" width="60" class="ept0bg" id="explore"><IMG id=IMG1 height=10 src=' + Root + 'Runtime/Context/common/transparent.gif width=60 ></td>')
			w('<td height="20" align="right" width="21"><IMG height=20 src=' + Root + 'Runtime/Context/common/transparent.gif width=20 name=ipractice></td>')
			w('<td height="20" align="middle" width="60" id= "practice" class="ept0bg"><IMG id=IMG1 height=10 src=' + Root + 'Runtime/Context/common/transparent.gif width=60 ></td>')
			w('<td height="20" align="right" width="20"><IMG height=20 src=' + Root + 'Runtime/Context/common/transparent.gif width=20 name=itest></td>')
			w('<td height="20" align="middle" width="60" id="test"><IMG id=IMG1 height=10 src=' + Root + 'Runtime/Context/common/transparent.gif width=60></td>')
      break;   		  
	}
	w('</tr>')
  w('</table>')
	w('</div></div>') 
}

function EPTOver(obj, tdID)
{
	obj.className = "ept0bg0highlight"; 
	document.getElementById(tdID).src = Root + "Runtime/Context/newLook/common/eptCornerL.gif";
	document.getElementById(tdID+"R").src = Root + "Runtime/Context/newLook/common/eptCornerR.gif";
	document.getElementById(tdID+"L").className = "ept0links" 
}

function EPTOut(obj, tdID)
{
	obj.className = "ept0bg"; 
	document.getElementById(tdID).src = Root + "Runtime/Context/newLook/common/transparent.gif";
	document.getElementById(tdID+"R").src = Root + "Runtime/Context/newLook/common/transparent.gif";
	document.getElementById(tdID+"L").className = "unitLink eptOut OpenWindowBarTitleD" 
}

function buildSkillIcon() {}

function buildLogo()
{
	var urlCourse = "#", courseTitle = "&nbsp;", url = "", page = "";
	switch (currentPage)
	{
		case "Home":
		case "MyCourses":
		case "Store":
		case "Magazine":
		case "Community":
		case "MyProfile":
		case "WebChallenge":
		case "WordZone":
		case "WebPal":
		case "Support":
		case "TalkingIdioms":
		case "InSite":
    case "LogIn":
    case "myPage":
    case "course": 
			break;
		case "unit": 
			courseTitle = courseName
			urlCourse="Course.asp?courseId=" + getCompositeCookie("Course","CourseId") + "&FromTMS=" + FromTMS 
			break;
		case "component":
		case "viewComponent": 
			page = "Course.asp?courseId=" + getCompositeCookie("Course","CourseId") + "&FromTMS=" + FromTMS 
			courseTitle = courseName
			urlCourse = 'javaScript:SavePage(&quot;'+ page +'&quot;,&quot;'+ appName +'&quot;,' + obj.Id + ',&quot;' + appletMode + '&quot;)'	   
      break; 
		case "customComponent":
		case "viewCustomComponent":
			page = "Course.asp?courseId=" + getCompositeCookie("Course","CourseId") + "&FromTMS=" + FromTMS 
			courseTitle = courseName
			urlCourse = 'javaScript:saveCCData(&quot;'+ page +'&quot;)'	   
      break; 
	} 
	w('<div style="background-color:#ffffff;padding-bottom:10px;">')
	if (currentPage != "Home")
		w('<img src="' + Root + 'Runtime/Context/newLook/common/pLogo.gif" width="110" height="76" style="margin-bottom:5px">')	
	w('<div id="leftTitleCon" style="display:none;padding-bottom:10px;background-color:#ffffff">')
		w('<table width="110" border="0" cellspacing="0" cellpadding="0">')
			w('<tr>') 
				w('<td width="110"><img src="' + Root + 'Runtime/Context/newLook/common/infoTop.gif" width="110" height="4"></td>')						
			w('</tr>') 
			w('<tr>') 
				w('<td style="background-image:url(' + Root + 'Runtime/Context/newLook/common/infoBg.gif)"><div style="text-align:center;">')
					w('<a style="font-weight:normal;color:#000000" class="UnitLink" href="' + urlCourse + '">' + courseTitle + '</a>')			
					switch(currentPage)
					{
						case "component":
						case "viewComponent":
							page = "Unit.asp?unitId=" + getCompositeCookie("Unit", "UnitId") + "&FromTMS=" + FromTMS + "&SID=" + getCompositeCookie("Student", "SID");
	    				url = 'javaScript:SavePage(\"'+ page +'\",\"'+ appName +'\",' + obj.Id + ',\"' + appletMode + '\")';
							w('<div style="padding-top:5px;display:none" id="tempLinkConDiv"><a style="color:#000000" id="tempLinkCon" class="UnitLink" href=' + url + '>' + unitName + '</a></div>');
							break;
						case "customComponent":
						case "viewCustomComponent":
							page = "Unit.asp?unitId=" + getCompositeCookie("Unit", "UnitId") + "&FromTMS=" + FromTMS + "&SID=" + getCompositeCookie("Student", "SID")
							url = 'javaScript:saveCCData(\"'+ page +'\")';
							w('<div style="padding-top:5px;display:none" id="tempLinkConDiv"><a style="color:#000000" id="tempLinkCon" class="UnitLink" href=' + url + '>' + unitName + '</a></div>');
							break;
						default:
							w('<div style="padding-top:5px;display:none" id="tempLinkConDiv"><a style="color:#000000" id="tempLinkCon" class="UnitLink" href="#">&nbsp;</a></div>');
							break;
					}
				w('</div></td>')
			w('</tr>')
			w('<tr>') 
				w('<td width="110"><img src="' + Root + 'Runtime/Context/newLook/common/infoBottom.gif" width="110" height="4"></td>')
			w('</tr>')
		w('</table>')
	w('</div>')
  var sideimagesFolder;
	switch(currentPage)
	{
		case "Home":
			sideimagesFolder = "home"
      break; 
		case "Forum":
			sideimagesFolder = "forum"
			break;	
		case "Magazine":
			sideimagesFolder = "magazine"
      break;      
		case "Community":
			sideimagesFolder = "community"
      break;      
		case "MyProfile":
			sideimagesFolder = "myProfile"
      break;       
		case "WordZone":
			sideimagesFolder = "wordZone"
      break;   
		case "WebPal":
			sideimagesFolder = "webPals"
      break;      
		case "Support":
			sideimagesFolder = "support"
      break;      
		case "TalkingIdioms":
			sideimagesFolder = "talkingIdioms"
      break;      
		case "InSite":
			sideimagesFolder = "insite"
      break;      
		case "WebChallenge":
			sideimagesFolder = "webchallenge"
			w('<span class="UnitLink"><img height=5 src=' + Root + 'Runtime/Context/common/transparent.gif width=20><br>Web Challenge</span>') 
      break;      
		case "myPage":
			sideimagesFolder = "myPage"
      break;
    case "course":
			sideimagesFolder = "courses"
      break;           
    case "unit":
			sideimagesFolder = unitFolderName
			document.getElementById("leftTitleCon").style.display = "block" 
      break;           
		case "component": 
    case "viewComponent":
			sideimagesFolder = unitFolderName;
			document.getElementById("leftTitleCon").style.display = "block";
			document.getElementById("tempLinkConDiv").style.display = "block"; 
      break;
		case "customComponent":
		case "viewCustomComponent":
			sideimagesFolder = "default";
			document.getElementById("leftTitleCon").style.display="block";
			document.getElementById("tempLinkConDiv").style.display="block";
      break;
	}
	w('<table style="background-image:url(' + Root + 'Runtime/Context/leftSideImages/'+sideimagesFolder+'/left.jpg)" width="110" border="0" cellspacing="0" cellpadding="0">')
		w('<tr>') 
			w('<td width="110"><img src="' + Root + 'Runtime/Context/newLook/common/sideImageTop.gif" width="110" height="6"></td>') 
		w('</tr>') 
		w('<tr>') 
			w('<td width="110"><img src="' + Root + 'Runtime/Context/newLook/common/sideImageBg.gif" width="110" height="268"></td>') 
		w('</tr>')
		w('<tr>') 
			w('<td width="110"><img src="' + Root + 'Runtime/Context/newLook/common/sideImageBottom.gif" width="110" height="6"></td>') 
		w('</tr>')
	w('</table>')
  w('</div>')
	w('<table  width="110" border="0" cellspacing="0" cellpadding="0">')	
		w('<tr>') 
			w('<td width="4"><img src="' + Root + 'Runtime/Context/newLook/common/bgCornerLeft.gif" width="4" height="4"></td>')		
			w('<td width="102"><img src="' + Root + 'Runtime/Context/newLook/common/transparent.gif" width="102" height="4"></td>')						
			w('<td width="4"><img src="' + Root + 'Runtime/Context/newLook/common/bgCornerRight.gif" width="4" height="4"></td>')										
		w('</tr>') 					
	w('</table>')
}

function buildNavigationBar()
{
	var isUserReg, navRights, rights, length, navModule = "";
	if (GetCookie("Student") != null && getCompositeCookie("Student", "SID") != -1)
	{
		if (FromTMS)
		{
			isUserReg = true;
		}
		else
		{
			isUserReg = true;
			navRights = getCompositeCookie("Student", "Rights");
			rights = navRights.split("|");
			length = rights.length;
		}
	}
	else if(getCompositeCookie("Community", "Rights") != null)
	{
		isUserReg = false;
		navRights = getCompositeCookie("Community", "Rights");
		rights = navRights.split("|");
		length = rights.length;
	}
	else
	{
		isUserReg = false;
		navRights = "1|1|0|0|1|1|1|1|0";
		rights = navRights.split("|");
		length = rights.length;
	}
	
	switch (currentPage)
	{
		case "Home":
			navModule = "Home";
			break;
	  case "myPage":
		case "MyCourses":
	  case "course":
	  case "unit":
	  case "component":
		case "viewComponent":
		case "customComponent":
		case "viewCustomComponent":
			navModule = "MyCourses";
			break;
		case "Store":
			navModule = "Store";
			break;
		case "Community":
		case "Forum":
		case "Magazine":
		case "WebPal":
		case "WordZone":
		case "TalkingIdioms":
		case "InSite":
		case "WebChallenge":
			navModule = "Community";
			break;
		case "MyProfile":
			navModule = "MyProfile";
			break;
		case "Support":
			navModule = "Support";
			break;
	}

	var links, linkCommunity;
	var navModules = new Array("Home", "MyCourses", "Store", "Magazine", "Community", "MyProfile", "Teachers Corner", "Support") 
	if (isUserReg)
		links = new Array("Runtime/Home/Home.asp", "Runtime/myPage.asp", "#", "Runtime/MidScreens/Magazine.asp", "Runtime/MidScreens/Community.asp", "Runtime/MyProfile/MyProfile.asp", "javascript:gotoTMS()", "javascript:getSupport()", "javascript:LogOut()", "javascript:register()") 
	else if (currentPage == "Home")
	{
		if (CDUser)
			links = new Array("Runtime/Home/Home.asp", "#", "#", "javascript:loginAlert()", "javascript:loginAlert()", "javascript:loginAlert()", "javascript:loginAlert()", "javascript:loginAlert()", "#", "javascript:register()") 
		else
		{
			if (getCompositeCookie("Community", "Entry") == "Free")
				linkCommunity = "Runtime/MidScreens/Community.asp";
			else	
				linkCommunity = "javascript:loginAlert()";
	
			links = new Array("Runtime/Home/Home.asp", "javascript:loginAlert()", "#", "Runtime/MidScreens/Magazine.asp", linkCommunity, "javascript:loginAlert()", "javascript:loginAlert()", "javascript:loginAlert()", "#", "javascript:register()") 
		}	
	}	
	else
		links = new Array("Runtime/Home/Home.asp", "javascript:openLoginWindow('MyCourses', '')", "#", "Runtime/MidScreens/Magazine.asp", "Runtime/MidScreens/Community.asp", "javascript:openLoginWindow('MyProfile', '')", "javascript:openLoginWindow('Teachers Corner', '')", "javascript:openLoginWindow('Support', '')", "#", "javascript:register()")

	var linkNames = new Array(getTranslate("cxt00NbBtHome"), getTranslate("cxt00NbBtMyCourses"), getTranslate("cxt00NbBtStore"), getTranslate("cxt00NbBtMagazine"), getTranslate("cxt00NbBtCommunity"), getTranslate("cxt00NbBtMyProfile"), getTranslate("cxt00NbBtTeacherCorner"), getTranslate("cxt00NbBtSupport"), getTranslate("cxt00NbBtLogOut"), getTranslate("cxtSgOw00NtRegister"))
	var link = "", url = "", borderStyle;

	w('<table onClick="window.open(&quot;' + bannerLink + '&quot;,&quot;BL&quot;)" title="' + bannerText + '" align="center" width="780" cellpadding="0" cellspacing="0" border="0" style="cursor:pointer;margin:10px 0px 6px 0px;background-image:url('+ resPath + '/banner.gif)">')
	w('<tr>')
	w('<td width="8"><img src="' + Root + 'Runtime/Context/newLook/common/left.gif"></td>')
	w('<td style="background-image:url(' + Root + 'Runtime/Context/newLook/common/bannerShadowBg.gif);background-repeat:repeat-x">&nbsp;</td>')
	w('<td width="8"><img src="' + Root + 'Runtime/Context/newLook/common/right.gif"></td>')
	w('</tr>')
	w('</table>')
	
	w('<table align="center" width="780" border="0" cellspacing="0" cellpadding="2" height="25" id=TABLE1>')
		w('<tr align="center" valign="middle">')
			if (!FromTMS)
			{
				for (var i = 0; i < length; i++)
				{
					if (i == 0)
						borderStyle = "border:1px solid #5D5D5D;"
					else
						borderStyle = "border:1px solid;border-color:#5D5D5D #5D5D5D #5D5D5D #ffffff;"
							
					if (rights[i] == 1)
					{
						link = links[i];
						if (link != "#" && link.indexOf("javascript") == -1)
							link = Root + link;
						if (currentPage == "component")
							url = 'javaScript:SavePage(&quot;' + link + '&quot;, &quot;' + appName + '&quot;, ' + obj.Id + ', &quot;' + appletMode + '&quot;)';	   
						else if (currentPage == "customComponent")
							url = 'javaScript:saveCCData(&quot;'+ link +'&quot;)';	   
						else
							url = link;														
						if (navModules[i] == navModule)
							w('<td class="navbarBgSelected" style="'+borderStyle+'" nowrap><a href="'+ url + '" class="NavLinksSelected" style="text-decoration:none">' + linkNames[i] + '</a></td>')
						else
							w('<td class="navbarBg" style="'+borderStyle+'" nowrap><a href="'+ url + '" class="NavLinks" style="text-decoration:none">' + linkNames[i] + '</a></td>')
					}        
				}
			}
		w('</tr>')
	w('</table>')
		
}

function gotoTMS(From)
{
	if (typeof From == "undefined")
		From = "";
  window.open(Root + "Runtime/gotoTMS.asp?From=" + From, 'TMS', 'width=800,height=600,left=0,top=0,toolbar=yes,scrollbars=yes,resizable,menubar=yes')
}

function buildTools()
{
	if (currentPage != "Home")
	{
		w('<div style="background-color:#ffffff;padding-bottom:5px;">')
	}

	var link = "", isUserReg;
		
	if (isNaN(parseInt(studentId)))
		isUserReg = false;
	else
		isUserReg = true;

	if (isUserReg)
		link = "javascript:OnDicClick(1)";
	else if (currentPage == "Home" && CDUser)
		link = "javascript:loginAlert()";
	else
		link = "javascript:OnDicClick(1)";
						
	w('<table class="toolsTable" border="0" cellspacing="0" cellpadding="0" >')				
		w('<tr>')
			w('<td class="toolsTop"><img src="' + Root + 'Runtime/Context/newLook/common/transparent.gif" width="3" height="3" ></td>')
		w('</tr>')
		w('<tr>')
			w('<td class="DictionayTitle toolsTitle">'+getTranslate("cxt00ToBtDictionary")+'</td>')
		w('</tr>')
		w('<tr>')
			w('<td class="toolsBody">')
				w('<div style="height:60px;padding-top:5px;">')
				w('<form style="padding:0px;margin:0px;" name="DicForm" action="' + link + '">')
					w('<input type="text" name="WDQString" size="10" class="sInput toolsInput">')
					w('<table align="center" style="margin-top:6px" class="toolsInput" border="0" cellspacing="0" cellpadding="0">')				
						w('<tr>')
							w('<td align="left" style="cursor:pointer" title="About Kernerman Dictionaries">')
								w('<img src="' + Root + 'Runtime/Context/newLook/common/kernemanLogo.gif" width="16" height="15" onClick=window.open("'+Root+'Runtime/Window.asp?Width=290&Height=345&Title=cxt00ToBtDictionary&Feature=cxt00ToBtDictionary&Source='+Root+'Runtime/Dictionary/kerneman_page.htm","Dictionary","width=300,height=400,left=200,top=200,resizable=no,scrollbars=no")>')	
							w('</td>')
							if (isUserReg) {
								w('<td width="100%" align="center" style="cursor:pointer" title="Language Tools Settings">')
									w('<img src="' + Root + 'Runtime/Context/newLook/common/langToolsSmall.gif" width="16" height="15" onClick="setLangTools()">')	
								w('</td>')
							}							
							w('<td align="right">')
								w('<table style="cursor:pointer" onclick="' + link + '" border="0" cellspacing="0" cellpadding="0" >')				
									w('<tr>')
										w('<td width="5">')
											w('<img src="' + Root + 'Runtime/Context/newLook/common/goLeft.gif" width="5" height="18" >')	
										w('</td>')
										w('<td background="' + Root + 'Runtime/Context/newLook/common/goBg.gif" width="16" class="DictionayTitle toolsGo">')
											w('GO')	
										w('</td>')
										w('<td width="5">')
											w('<img src="' + Root + 'Runtime/Context/newLook/common/goRight.gif" width="5" height="18" >')	
										w('</td>')
									w('</tr>')
								w('</table>')
							w('</td>')
						w('</tr>')
					w('</table>')
				w('</form>')
				w('</div>')
			w('</td>')
		w('</tr>')
		w('<tr>')
			w('<td class="toolsBottom"><img src="' + Root + 'Runtime/Context/newLook/common/transparent.gif" width="3" height="3" ></td>')
		w('</tr>')
	w('</table>')

	if (isUserReg)
	{
		link = "javascript:openYouWho();setMsgState(0)";
	}
	else if (currentPage == "Home")
		link = "javascript:loginAlert()";
	else
		link = "javascript:openLoginWindow('YouWho', '')";

	w('<table style="cursor:pointer" onClick="' + link + '" class="toolsTable" border="0" cellspacing="0" cellpadding="0" >')				
		w('<tr>')
			w('<td class="toolsTop"><img src="' + Root + 'Runtime/Context/newLook/common/transparent.gif" width="3" height="3" ></td>')
		w('</tr>')
		w('<tr>')
			w('<td class="DictionayTitle toolsTitle">You! Who?</td>')
		w('</tr>')
		w('<tr>')
			w('<td class="toolsBody">')
				w('<div style="height:60px;padding-top:5px;">')
					w('<img id="msgFrYW" src=' + Root + 'Runtime/Context/Tools/toheb0_YouWho.gif width="34" height="28" border="0">')
					w('<div id="divInstMsgr" style="padding:2;line-height:1.4em;color:#000000;" class="sText"> Instant Messenger </div>');
					w('<div>')
						if (isUserReg)
						{
							w('<marquee id="RunningLine" scrolldelay="250" style="visibility:hidden;display:none">')
							w('<table border="0" height="20"><tr><td class="toolsLinks" nowrap valign="middle">');
							w('Now online:' + '&nbsp;<b><span id="NOLUCount"></span></b>' + '</a>');
							w('</td>');
							w('</tr></table>');
							w('</marquee>')

							var wmGLT = getCompositeCookie("Student", "CMode");
							wmGLT = wmGLT == null ? "l" : wmGLT.toLowerCase();
							if (wmGLT == "l" || FromTMS || studentId == "")
							{
								w('<applet id="YWCounter" name="YWCounter" code="YWCounter.class"  codebase=' + Root + 'Runtime/FriendsOnline/ width="0" height="0" archive="YWCounter.zip" viewastext mayscript>')
								w('<param NAME="RefreshDelay" VALUE="30000">')
								w('<param NAME="background" VALUE="15000804">')
								w('<param NAME="foreground" VALUE="4868940">')
								w('<param NAME="StudentId" VALUE="' + studentId + '">')
								w('</applet>')
							}
							else
							{
								w('<iframe style="display:none" src=' + Root + 'Runtime/FriendsOnline/YWCPage.asp name="YWCounterFR" width="0" height="0" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>')
								w('<applet id="YWCounterLU" name="YWCounterLU" code="YWCounter.class"  codebase=' + Root + 'Runtime/FriendsOnline/ width="0" height="0" archive="YWCounter.zip" viewastext mayscript>')
								w('<param NAME="RefreshDelay" VALUE="30000">')
								w('<param NAME="background" VALUE="15000804">')
								w('<param NAME="foreground" VALUE="4868940">')
								w('<param NAME="StudentId" VALUE="' + studentId + '">')
								w('<param NAME="LocalUpdate" VALUE="1">')
								w('</applet>')
							}
						}
					w('</div>')
				w('</div>')
			w('</td>')
		w('</tr>')
		w('<tr>')
			w('<td class="toolsBottom"><img src="' + Root + 'Runtime/Context/newLook/common/transparent.gif" width="3" height="3" ></td>')
		w('</tr>')
	w('</table>')
						
	if (isUserReg)
		link = "javascript:openGrammarBook()";
	else if (currentPage == "Home")
		link = "javascript:loginAlert()";
	else
		link = "javascript:openLoginWindow('', '')";

	if (!isUserReg || (isUserReg && getCompositeCookie("Student", "GB") == "1"))
	{							
		w('<table style="cursor:pointer" onClick="' + link + '" class="toolsTable" border="0" cellspacing="0" cellpadding="0" >')				
			w('<tr>')
				w('<td class="toolsTop"><img src="' + Root + 'Runtime/Context/newLook/common/transparent.gif" width="3" height="3" ></td>')
			w('</tr>')
			w('<tr>')
				w('<td class="DictionayTitle toolsTitle">Grammar Book</td>')
			w('</tr>')
			w('<tr>')
				w('<td class="toolsBody">')
				w('<div style="height:35px;padding-top:5px;">')
					w('<img src=' + Root + 'Runtime/Context/Tools/toheb0_GrammarBook.gif width="47" height="28" border="0">')			
				w('</td>')
			w('</tr>')
			w('<tr>')
				w('<td class="toolsBottom"><img src="' + Root + 'Runtime/Context/newLook/common/transparent.gif" width="3" height="3" ></td>')
			w('</tr>')
		w('</table>')
	}	
							
	w('<table style="cursor:pointer"  onclick="getHelp()" class="toolsTable" border="0" cellspacing="0" cellpadding="0" >')				
		w('<tr>')
			w('<td class="toolsTop"><img src="' + Root + 'Runtime/Context/newLook/common/transparent.gif" width="3" height="3" ></td>')
		w('</tr>')
		w('<tr>')
			w('<td class="DictionayTitle toolsTitle">'+getTranslate("cxt00ToBtHelp")+'</td>')
		w('</tr>')
		w('<tr>')
			w('<td class="toolsBody">')
			w('<div style="height:35px;padding-top:5px;">')
				w('<img src=' + Root + 'Runtime/Context/Tools/toheb0_help.gif width="35" height="26" border="0">')			
			w('</td>')
		w('</tr>')
		w('<tr>')
			w('<td class="toolsBottom"><img src="' + Root + 'Runtime/Context/newLook/common/transparent.gif" width="3" height="3" ></td>')
		w('</tr>')
	w('</table>')

	if (!CDUser)
	{
		if (isUserReg)
			link = "javascript:MM_openBrWindow('" + Root + "Runtime/MyProgress/MyProgress.asp?Type=Unit','MyProgress','width=700,height=460,left=" + (screen.width-700)/2 + ",top=" + (screen.height-460)/2 +",scrollbars=no,resizable=no')";
		else if (currentPage == "Home")
			link = "javascript:loginAlert()";
		else
			link = "javascript:openLoginWindow('MyProgress', '')";

		var Courses = getCompositeCookie("Student", "Courses")
		if (!isUserReg || (isUserReg && Courses == "1"))
		{
			w('<table style="cursor:pointer"  onclick="' + link + '" class="toolsTable" border="0" cellspacing="0" cellpadding="0" >')				
				w('<tr>')
					w('<td class="toolsTop"><img src="' + Root + 'Runtime/Context/newLook/common/transparent.gif" width="3" height="3" ></td>')
				w('</tr>')
				w('<tr>')
					w('<td class="DictionayTitle toolsTitle">'+getTranslate("cxt00ToBtMyProgress")+'</td>')
				w('</tr>')
				w('<tr>')
					w('<td class="toolsBody">')
					w('<div style="height:35px;padding-top:5px;">')
						w('<img src=' + Root + 'Runtime/Context/Tools/toheb0_myProgress.gif width="35" height="26" border="0">')			
					w('</td>')
				w('</tr>')
				w('<tr>')
					w('<td class="toolsBottom"><img src="' + Root + 'Runtime/Context/newLook/common/transparent.gif" width="3" height="3" ></td>')
				w('</tr>')
			w('</table>')
		}
	}
							
	w('<table style="cursor:pointer" onclick="downloads()" class="toolsTable" border="0" cellspacing="0" cellpadding="0">')				
		w('<tr>')
			w('<td class="toolsTop"><img src="' + Root + 'Runtime/Context/newLook/common/transparent.gif" width="3" height="3"></td>')
		w('</tr>')
		w('<tr>')
			w('<td class="DictionayTitle toolsTitle">'+getTranslate("cxtCoOwStDownloads")+'</td>')
		w('</tr>')
		w('<tr>')
			w('<td class="toolsBody">')
				w('<div style="height:35px;padding-top:5px;">')
					w('<img src=' + Root + 'Runtime/Context/Tools/toheb0_Downloads.gif width="41" height="27" border="0">')			
			w('</td>')
		w('</tr>')
		w('<tr>')
			w('<td class="toolsBottom"><img src="' + Root + 'Runtime/Context/newLook/common/transparent.gif" width="3" height="3" ></td>')
		w('</tr>')
	w('</table>')	
									
	if (currentPage != "Home")
	{
		w('</div>')
		w('<table  width="110" border="0" cellspacing="0" cellpadding="0">')	
			w('<tr>') 
				w('<td width="4"><img src="' + Root + 'Runtime/Context/newLook/common/bgCornerLeft.gif" width="4" height="4"></td>')		
				w('<td width="102"><img src="' + Root + 'Runtime/Context/newLook/common/transparent.gif" width="102" height="4"></td>')						
				w('<td width="4"><img src="' + Root + 'Runtime/Context/newLook/common/bgCornerRight.gif" width="4" height="4"></td>')										
			w('</tr>') 					
		w('</table><br><br>')
	}
}

function buildFooter()
{  
	var linkNav = "", page;
	var urlmyPage, urlCourse, urlUnit;  
	switch(currentPage)
	{
		case "myPage":
			linkNav = "&nbsp;"
	    break;
	  case "course":
			if (FromTMS)
				linkNav = "&nbsp;"
			else	
				linkNav = '<A class=breadCrambs href="myPage.asp">'+getTranslate("cxt00NbBtMyCourses")+'</a>'
	    break;
	  case "unit":
			if (FromTMS)
				linkNav = '<A class=breadCrambs href="Course.asp?courseId=' + getCompositeCookie("Course", "CourseId") + "&FromTMS=" + FromTMS +'">' + courseName + '</a>'
			else	
				linkNav = '<A class=breadCrambs href="myPage.asp">'+getTranslate("cxt00NbBtMyCourses")+'</a>&gt;&gt;<A class=breadCrambs href="Course.asp?courseId=' + getCompositeCookie("Course", "CourseId") + "&FromTMS=" + FromTMS +'">' + courseName + '</a>'
	    break;
	  case "component":
		case "viewComponent":
      page = "myPage.asp";
	    urlmyPage = 'javaScript:SavePage(&quot;'+ page +'&quot;,&quot;'+ appName +'&quot;,' + obj.Id + ',&quot;' + appletMode + '&quot;)';	          
	    page = "Course.asp?courseId=" + getCompositeCookie("Course", "CourseId") + "&FromTMS=" + FromTMS;
	    urlCourse = 'javaScript:SavePage(&quot;'+ page +'&quot;,&quot;'+ appName +'&quot;,' + obj.Id + ',&quot;' + appletMode + '&quot;)';	          
	    page = "Unit.asp?unitId=" +  getCompositeCookie("Unit", "UnitId") + "&FromTMS=" + FromTMS + "&SID=" + getCompositeCookie("Student", "SID");
	    urlUnit = 'javaScript:SavePage(&quot;'+ page +'&quot;,&quot;'+ appName +'&quot;,' + obj.Id + ',&quot;' + appletMode + '&quot;)';	          
			if (FromTMS)
				linkNav = '<A class=breadCrambs href="'+urlCourse+'">' + courseName + '</a>&gt;&gt;<A class=breadCrambs href="'+urlUnit+'">' + unitName + '</a>'
			else	
				linkNav = '<A class=breadCrambs href="'+urlmyPage+'">'+getTranslate("cxt00NbBtMyCourses")+'</a>&gt;&gt;<A class=breadCrambs href="'+urlCourse+'">' + courseName + '</a>&gt;&gt;<A class=breadCrambs href="'+urlUnit+'">' + unitName + '</a>'
	    break;
		case "customComponent":
		case "viewCustomComponent":
	    page = "myPage.asp";
	    urlmyPage = 'javaScript:saveCCData(&quot;'+ page +'&quot;)';	   
	    page = "Course.asp?courseId=" + getCompositeCookie("Course", "CourseId") + "&FromTMS=" + FromTMS
	    urlCourse = 'javaScript:saveCCData(&quot;'+ page +'&quot;)';	   
	    page = "Unit.asp?unitId=" +  getCompositeCookie("Unit", "UnitId") + "&FromTMS=" + FromTMS + "&SID=" + getCompositeCookie("Student", "SID")
	    urlUnit = 'javaScript:saveCCData(&quot;'+ page +'&quot;)';	   
			if (FromTMS)
				linkNav = '<A class=breadCrambs href="'+urlCourse+'">' + courseName + '</a>&gt;&gt;<A class=breadCrambs href="'+urlUnit+'">' + unitName + '</a>'
			else	
				linkNav = '<A class=breadCrambs href="'+urlmyPage+'">'+getTranslate("cxt00NbBtMyCourses")+'</a>&gt;&gt;<A class=breadCrambs href="'+urlCourse+'">' + courseName + '</a>&gt;&gt;<A class=breadCrambs href="'+urlUnit+'">' + unitName + '</a>'
	    break;
	}  
	
	var privacyURL = Root + "Runtime/Window.asp?Width=790&Height=545&Title=cxt00FoBtPrivacy&Feature=cxt00FoBtPrivacy&Source="+Root+"Runtime/Localization/PrivacyStatement/" + instLang + "/PrivacyStatement.asp";	
	var legalURL = Root + "Runtime/Window.asp?Width=790&Height=545&Title=cxt00FoBtLegal&Feature=cxt00FoBtLegal&Source="+Root+"Runtime/Localization/LegalNotices/" + instLang + "/LegalNotices.asp";	
	var aboutURL = "http://" + companyHost;
	
	if (currentPage != "Home")
	{    
		w('<table width="780" border="0" cellspacing="0" cellpadding="0" align="center" id=TABLE1 class="upper0footer0bg">')
			w('<tr>')
				w('<td class="layout0thin0line" width="1"><IMG height=1 src="' + Root + 'Runtime/Context/common/transparent.gif" width=1></td>')
		    w('<td width="110" class="BgChange" ><IMG height=1 src="' + Root + 'Runtime/Context/common/transparent.gif" width=110></td>')
		    w('<td width="556" >')
					w('<table  align="center" width="558" class="upper0footer0bg" border="0" cellspacing="0" cellpadding="0">')	
						w('<tr>') 
							w('<td width="8" valign="bottom">')
								w('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" WIDTH="8" HEIGHT="8" id="ShockwaveFlash2" VIEWASTEXT>')
									w('<param NAME="movie" VALUE="' + Root + 'Runtime/Context/newLook/common/doubleCorner.swf?myVarsRoot='+resPath+'/myColors.txt&myCorner=bottomLeft">')
									w('<param NAME="quality" VALUE="high">')
									w('<param NAME="bgcolor" VALUE="#FFFFFF">')
								w('</object>')
							w('</td>')		
							w('<td width="542" class="breadCrambs" style="padding:2px 2px 4px 2px">&nbsp;'+linkNav+'&nbsp;</td>')						
							w('<td width="8" valign="bottom">')
								w('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" WIDTH="8" HEIGHT="8" id="ShockwaveFlash2" VIEWASTEXT>')
								w('<param NAME="movie" VALUE="' + Root + 'Runtime/Context/newLook/common/doubleCorner.swf?myVarsRoot='+resPath+'/myColors.txt&myCorner=bottomRight">')
								w('<param NAME="quality" VALUE="high">')
								w('<param NAME="bgcolor" VALUE="#FFFFFF">')
								w('</object>')
							w('</td>')											
						w('</tr>') 					
					w('</table>')
		    w('</td>')
		    w('<td width="110" class="toolsDark" ><IMG height=1 src="' + Root + 'Runtime/Context/common/transparent.gif" width=110></td>')
		    w('<td class="layout0thin0line" width="1"><IMG height=1 src="' + Root + 'Runtime/Context/common/transparent.gif" width=1></td>')
		  w('</tr>')
		  w('<tr>')
		    w('<td class="layout0thin0line" width="1"><IMG height=20 src="' + Root + 'Runtime/Context/common/transparent.gif" width=1></td>')
		    w('<td width="110" class="bgChange" >&nbsp;</td>')
				w('<td width="556" class="bgChange"  align="middle" valign="center">&nbsp;</td>')
		    w('<td width="110" class="bgChange" style="font-size:52px">&nbsp;</td>')
		    w('<td class="layout0thin0line" width="1"><IMG height=20 src="' + Root + 'Runtime/Context/common/transparent.gif" width=1></td>')
		  w('</tr>')
		w('</table>')
		w('<table  align="center" width="780" class="bgChange" border="0" cellspacing="0" cellpadding="0">')	
			w('<tr>') 
				w('<td width="6"><img src="' + Root + 'Runtime/Context/newLook/common/cornerBL.gif" width="6" height="6"></td>')		
				w('<td width="768"><img src="' + Root + 'Runtime/Context/newLook/common/transparent.gif" width="768" height="4"></td>')						
				w('<td width="6"><img src="' + Root + 'Runtime/Context/newLook/common/cornerBR.gif" width="6" height="6"></td>')										
			w('</tr>') 					
		w('</table><br>')
	}
	w('<div style="text-align:center">')
	if (ins == "989")
		w('<span class="stext" style="color:#999999" >'+getTranslate("cxt00FoBtEdusoft")+'</span><br><a class="stext" style="color:#999999" href="' + contactLink + '" target="_blank">'+getTranslate("cxt00FoBtContact")+'</a>&nbsp;<span class="stext" style="font-size:14px;color:666666">I</span>&nbsp;<A class="stext" style="color:#999999" href="mailto:?Subject=Putting%20the%20E%20in%20English%20Learning">'+getTranslate("cxt00FoBtTell")+'</A>&nbsp;<span class="stext" style="font-size:14px;color:666666">I</span>&nbsp; <a href="' + aboutURL + '" target="_blank" class="stext" style="color:#999999">'+getTranslate("cxt00FoBtAbout")+'</a> &nbsp;<span class="stext" style="font-size:14px;color:666666">I</span>&nbsp; <A href="#Anchor" class="stext" style="color:#999999" onClick=window.open("'+legalURL+'","LegalNotices","width=800,height=600,left=0,top=0,resizable=no,scrollbars=no")>'+getTranslate("cxt00FoBtLegal")+'</a>&nbsp;<span class="stext" style="font-size:14px;color:666666">I</span>&nbsp; <a href="#Anchor" class="stext" style="color:#999999" onClick=window.open("'+privacyURL+'","PrivacyStatement","width=800,height=600,left=0,top=0,resizable=no,scrollbars=no")>'+getTranslate("cxt00FoBtPrivacy")+'</a>')
	else if (ins == "2")
		w('<span class="stext" style="color:#999999">'+getTranslate("cxt00FoBtEdusoft")+'</span><br><A class="stext" style="color:#999999" href="mailto:?Subject=Putting%20the%20E%20in%20English%20Learning">'+getTranslate("cxt00FoBtTell")+'</A>&nbsp;<span class="stext" style="font-size:14px;color:666666">I</span>&nbsp; <A href="#" class="stext" style="color:#999999" >'+getTranslate("cxt00FoBtLegal")+'</a>&nbsp;<span class="stext" style="font-size:14px;color:666666">I</span>&nbsp; <a href="#" class="stext" style="color:#999999" >'+getTranslate("cxt00FoBtPrivacy")+'</a>')
	w('</div>')
	w('<br>')
}

function buildDevider(last)
{
	if (last == true)
		w('<td width="1" id="vdevider" class="layout0thin0line"><img height="20" src="' + Root + 'Runtime/Context/common/transparent.gif" width="1"></td>')
	else
		w('<td width="1" id="vdevider" class="BgChange"><img height="20" src="' + Root + 'Runtime/Context/common/transparent.gif" width="1"></td>')
}

function setMsgState(iCount)
{
	var el = document.getElementById('msgFrYW');
	if (el)
		el.src = Root + 'Runtime/Context/Tools/toheb0_YouWho' + (iCount > 0 ? 'Message' : '') + '.gif' ;
}

function setMarqMode(iCount)
{
	var bVisible = iCount > 10;
	var spEl;
	var el = document.getElementById('RunningLine');
	if(el){
		var vsb = el.style.visibility;
		if(vsb == "" || (bVisible && vsb == "hidden") ||(!bVisible && vsb == "visible")){
			el.style.visibility = bVisible ? "visible" : "hidden" ;
			eval("el." + (bVisible ? "start()" : "stop()"));
		}
		vsb = el.style.visibility;
		if(vsb != "hidden"){
			if(el.all && (spEl = el.all.item('NOLUCount'))){
				var strIT = spEl.innerText;
				if(strIT != iCount)
					spEl.innerText = iCount;
			}
		}
		el.style.display = bVisible ? "block" : "none" ;
		var dIMr = document.getElementById('divInstMsgr');
		if(dIMr)
			dIMr.style.display = (vsb != "hidden") ? "none" : "block";
	}
}

function resetOLUC()
{
	var dbCFr = document.getElementById('LDBChecker');
	if(dbCFr && dbCFr.tagName == 'IFRAME')
		dbCFr.src = Root + "Runtime/FriendsOnline/Script/YWUserCount.asp?StudentId=" + getCompositeCookie("Student", "StudentID") + "&dtRND=" + new Date().getTime();
}
