﻿//_spBodyOnLoadFunctionNames.push("IsAuthenticatedUser('s4-ribbonrow')");

function IsAuthenticatedUser(obj)
{
	var ele = document.getElementById(obj);
	if(typeof _spUserId == "undefined")
	{
		ele.style.display='none';
	}
	else

	{
		ele.style.display='';
	}	
}

function toggle(obj)
{
	var ele = document.getElementById(obj);
	if(ele.style.display !='none')
	{
		ele.style.display='none';
	}
	else
	{
		ele.style.display='';
	}	
}

 function HighlightMyCurrentpageUrl()
   {
   		try
   		{
   			var myanchors = document.getElementsByTagName("a");   		 
   			var ancLen = myanchors.length-1;
   			var loc = window.location.pathname.toLowerCase();   			 
   			for(var cnt=0;cnt<=ancLen ;cnt++ )
   			{
   			   try
   			   {
   			   	   if(loc.indexOf("default.aspx")<0) 
   			   	   {		
		   			   if(typeof(myanchors[ancLen-cnt].href) != "undefined"  || myanchors[ancLen-cnt].href != null)
		   			   {
		   			    	if(myanchors[ancLen-cnt].href.toLowerCase().indexOf(loc)>0)
			   				{
			   					myanchors[ancLen-cnt].focus();
			   					myanchors[ancLen-cnt].style.backgroundColor = "#000000"; 
			   					myanchors[ancLen-cnt].style.color = "#ff7e00"; 
								myanchors[ancLen-cnt].blur();	
								break;
			   				}
		   				}
	   				}
   				}
   				catch(e)
   				{
   				}
   			} 
   		}
   		catch(e)
   		{
   		//alert(e.message);
   		}
   }
