﻿function DisplayTable(id)
{
	var obj = document.getElementById(id);
	var imgObj = document.getElementById("img" + id);	

	if ( imgObj == null ) return;
	if  (obj.style.display == '' )
	{
		obj.style.display = 'none';
		if ( imgObj != null ) 	
			imgObj.src = "/images/Plus.gif";				
	}
	else
	{
		obj.style.display ='';	
 		if ( imgObj != null ) 	imgObj.src = "/images/Minus.gif";		
	}		
}


function ShowTable(id,img)
{
	
	var obj = document.getElementById(id);
	if  (obj.style.display=='')
	{
		obj.style.display = 'none';
		img.src = "/images/Plus.gif";
		img.alt = "Click to Expand";
	}
	else
	{
		obj.style.display ='';
		img.src = "/images/Minus.gif";
		img.alt = "Click to Collapse" ;
		
	}
	
}

  var query = window.location.search;
  // Skip the leading ?, which should always be there, 
  // but be careful anyway
  var arrIDs = null ;
  if (query.substring(0, 1) == '?') {
    query = query.substring(1);
  } 
  else
  {
  // in case if # is included in query string it return null in upper case so mannually have to get query string..
  	var sAddress = window.location.href;
	query = sAddress.substring(sAddress.indexOf('?') + 1);	  
  }
  
  	arrIDs = query.split(':');  

  	  
  if ( arrIDs != null &&  arrIDs.length > 0 )
  {

  	for ( var i =0 ; i < arrIDs.length ; i++ )
	{
		DisplayTable(arrIDs[i]);
	}
  }

  
//  if ( query != '' )  ShowTable(query);



