//This JavaScript contains the code for the style of the Resources control and the code for placing divider lines on the News module on the home page

function showContent(id,audienceTab)
  {
	     //Getting the zone where checkboxes has to be unchecked	
	     var item = document.getElementById('divContent'); 
	     //Retreiving the div list 
	     var divPanels = item.getElementsByTagName('div');
	     for(var i=0; i<divPanels.length; i++) 
	     {
	         var elem = divPanels[i];
	         if(elem.id != id)
	         {
		         elem.style.visibility = "hidden";
		 	  }
		 }
		 
		 //Getting the zone where checkboxes has to be unchecked	
	     var mainDiv = document.getElementById('example'); 
	     //Retreiving the anchor list 
	     var maindivPanels = mainDiv.getElementsByTagName('a');
	     for(var i=0; i<maindivPanels.length; i++) 
	     {
	         var elem = maindivPanels[i];
	         if(elem.id != id)
	         {
				 elem.className ="Res-Back";
		 	 }
		 }
		 //Getting the zone where checkboxes has to be unchecked	
	     var activeTab = document.getElementById(audienceTab); 
	  	   activeTab.className ="Res-Selected";
	}
  
  function HoverBackground(audienceTab,type)
  {
  		//Getting the zone where checkboxes has to be unchecked	
	    var activeTab = document.getElementById(audienceTab); 
		
		if(type == 1)	
		{ 
			if(activeTab.className != "Res-Selected")
			{
				  activeTab.className ="Res-Hover";
			}
		}
		else
		{	
	  		if(activeTab.className != "Res-Selected")
	        {
			      activeTab.className ="Res-Back";
            }
		}
  }

//This function places divider line between the News module on the homa page
function PlaceDividerLine()
{
    //Retrieving the div in which the news link are placed.
    var newsDiv = document.getElementById("WebPartWPQ2"); 
    //var newsDiv = document.getElementById("WebPartWPQ3"); 
    var newsLink = null;
    if(newsDiv != null)
    {
        //Retrieving the indivial divs in which the news links are placed.
        var newsLinkDiv = newsDiv.getElementsByTagName('div');
        //Retrieving the div in which the first news link is placed
        
        for(var i=0; i<newsLinkDiv.length-2; i++) 
	    {
	       newsLink = newsLinkDiv[i];    
	       if(newsLink != null)
	       {
	            if(newsLink.id == "linkitem")
	                newsLink.className = "CPS_news_bottom";
	       }
	    }
	    newsLink = newsLinkDiv[newsLinkDiv.length - 2];
	    if(newsLink != null)
	        newsLink.className = "CPS_newsbottomlink";
    }
}