   function ResetActiveSection()
{		

	var IE = document.all?true:false;
	if (IE)
        { 
		if (event.clientY < 0 && event.clientX > document.body.offsetWidth-30) 
		{		
			writeCWSCookie(ActiveSectionButton, "");
		}
	}
	else 
	{
		writeCWSCookie(ActiveSectionButton, "");
	}
}
   
   function MetaInfo()
	{
        /* Declare a variable for the 3 types of metainfo and get the corresponding container for each type */
  		var objMetaInfoIndustry = getCWSObj('MetaInfoIndustry'); 
		var objMetaInfoSubject =  getCWSObj('MetaInfoSubject');
		var objMetaInfoGeography = getCWSObj('MetaInfoGeography');
	
	    /* objMetaInfoIndustry must be not equal to null */
	    if (objMetaInfoIndustry!=null) 
		{
   			/* Call function DisplayMetaInfo */
			DisplayMetaInfo(objMetaInfoIndustry,stringIndustry,stringIndustryLabel);
		}

		/* objMetaInfoSubject must be not equal to null */
		if (objMetaInfoSubject!=null) 
		{
			/* Call function DisplayMetaInfo */
			DisplayMetaInfo(objMetaInfoSubject,stringSubject,stringSubjectLabel);
		}

		/* objMetaInfoGeography must be not equal to null */
		if (objMetaInfoGeography!=null) 
		{
			/* Call function DisplayMetaInfo */
			DisplayMetaInfo(objMetaInfoGeography,stringGeography,stringGeographyLabel);
		}

}

/* Funtion for finding HTML Control */
function getCWSObj(id) 
{
	if (document.getElementById) {
		return document.getElementById(id);
		}
	else if (document.all) {
		getCWSObj = document.all[id];
		}
}


/* Funtion for Setting the initial state of the page */
function setInitialPageState()
{
	var IE = document.all?true:false;
	try
	{
		SetActiveSection(getCWSObj(readCWSCookie(ActiveSectionButton)));
	}
	catch(Err)
	{
	}
	MetaInfo();
	
	if(!IE) ResetActiveSection();
}

/* Funtion for processing the raw data of metainfo */
function DisplayMetaInfo(objMetaInfo,MetaInfoDelimitedText,MetaInfoDisplayText)
{
/* Create Temporary variable */
var strTemp = ''

/* Create metaInfoTemplate variable */
var metaInfoTemplate = '';

/* Split the raw data */
var arrayText = MetaInfoDelimitedText.split('|');


/* Iterate to array content */
for (var i=0; i <= (arrayText.length - 1); i++)
{
 
    /* Test if current iteration position mod 2 is equal to 1 */
    if ((i+1) % 2==1)
	 {
	    /* Code for Anchor Text */
	 	metaInfoTemplate = '<a href="@URL">@Text</a>';
	 	metaInfoTemplate = metaInfoTemplate.replace('@Text',CWSTrim(arrayText[i]));
	 }
	 else
	 {
	   /* Code for URL */
	   if (CWSTrim(arrayText[i]).length != 0) {
	   /* With URL */
   	   metaInfoTemplate = metaInfoTemplate.replace('@URL',CWSTrim(arrayText[i]));
   	   }
   	   else
   	   {
   		/* Without URL */
   		metaInfoTemplate = metaInfoTemplate.replace('<a href="@URL">','');
   		metaInfoTemplate = metaInfoTemplate.replace('</a>','');
   	   }
		
	 }
	 
	 /* Code for String concatenation of metainfo multi value */
	 if (arrayText.length >2 && (i+1) % 2==0)
	 {
		 if (strTemp!='')
		 {
		 strTemp=strTemp + '<span class="eleven">;</span>&nbsp;' + metaInfoTemplate;  
		 }
		 else
		 {
		 strTemp=metaInfoTemplate;  
		 }
	 }
}
     /* Display Multi value MetaInfo*/
     if (arrayText.length > 2)
     {
		objMetaInfo.innerHTML = '<strong>' + MetaInfoDisplayText + ':&nbsp;' +  '</strong>' + strTemp;
	 }
	 else
	 {	
		/* Single MetaInfo Value */
		objMetaInfo.innerHTML = '<strong>' + MetaInfoDisplayText + ':&nbsp;' +  '</strong>' + metaInfoTemplate;
	 }
}


/* function for setting the active buttons */
function SetActiveSection(obj)
{


/* Declare Section state value */
var Hide='none';
var Show='';
var maxNoOfButtons = 100;

/* Check if container for section buttons and content are already exist on html body */
if(getCWSObj('SectionButtons')==null || getCWSObj('SectionContent')==null) return;


	if (obj==null) obj = getCWSObj('SectionButton1');

	for (var i = 1;i<=maxNoOfButtons;i++)
	{
			//Pre-terminate Loop if SectionButton# is equal to null
			if (getCWSObj("SectionButton" + i)==null) return;

			if ('SectionButton' + i !=obj.id) 
			{
				getCWSObj("SectionButton" + i).className = ''; 
				getCWSObj("Section" + i).style.display  = Hide;
			}
			else
			{
				obj.className = 'bodload';
				getCWSObj("Section" + i).style.display  = Show;
				writeCWSCookie(ActiveSectionButton, "SectionButton" + i);
			}
	}
	
}

/* function for reading cookies */
function readCWSCookie(name)
{
  var cookieValue = '';
  var search = name + '=';
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(';', offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}

/* function for creating cookies */
function writeCWSCookie(name, value)
{
  try
  {
	document.cookie = name + '=' + escape(value);
  }
  catch(Err)
  {}
}

function CWSTrim(inputString) 
{
    var removeChar = ' ';
	var returnString = inputString;
	if (removeChar.length)
	{
	  while(''+returnString.charAt(0)==removeChar)
		{
		  returnString=returnString.substring(1,returnString.length);
		}
		while(''+returnString.charAt(returnString.length-1)==removeChar)
	  {
	    returnString=returnString.substring(0,returnString.length-1);
	  }
	}
	return returnString;
}