﻿ 
// functions required by Cayman Island Law Reports
function changeIt(theItem){
    theItem.style.color="red";
    theItem.style.textDecoration="none";
  }

function changeItAgain(theItem){
    theItem.style.color="black";
    theItem.style.textDecoration="none";
   }
  
function seeML(){
	if (more.style.visibility=="visible")
	{more.style.visibility="hidden"}
	else {more.style.visibility="visible"}
	if (less.style.visibility=="hidden")
	{less.style.visibility="visible"}
	else {less.style.visibility="hidden"}
	}

function seeL(theItem){
  theItem.style.visibility="visible";
  }
  
theID0 = 0;
theID1 = 0;
theID2 = 0;
themID0 = 0;
themID1 = 0;
themID2 = 0;

function arriving()
{
var jjj = location.hash;
var fff = "D_"+jjj.substr(1);
var allDIV = document.all.tags("DIV");
var numDIV = allDIV.length;
var thisDIV = 0;
var pareDIV = 0;
var granDIV = 0;
var strID;

for (i=0; i<numDIV; i++)
	{
	thisDIV = allDIV(i);
	if (thisDIV.id == fff)
		{
		pareDIV = thisDIV.parentElement;
		strID = String(pareDIV.id);
		if (strID.length == 0)
			{
			show1(thisDIV);
			}
		else{
			granDIV = pareDIV.parentElement;
			strID = String(granDIV.id);
			if (strID.length == 0)
				{
				show2(thisDIV);
				}
			else{
				show3(thisDIV);
				}
			}
		break;
		}
	}
}

function show1(iii, mmm)
{
if (iii == theID0)
	iii = 0;
if (theID2 != 0)
	{
	theID2.style.display="none";
	theID2 = 0;
	changetext(themID2, " see more ...");
	}
if (theID1 != 0)
	{
	theID1.style.display="none";
	theID1 = 0;
	changetext(themID1, " see more ...");
	}
if (theID0 != 0)
	{
	theID0.style.display="none";
	changetext(themID0, " see more ...");
	}
if (iii != 0)
	{
	iii.style.display="";
	changetext(mmm, " see less ...");
	}
theID0 = iii;
themID0 = mmm;
window.event.cancelBubble = true;

}

function changetext(fff, sss)
{
var allSPAN = document.all.tags("SPAN");
var numSPAN = allSPAN.length;
for (i=0; i<numSPAN; i++)
	{
	thisSPAN = allSPAN(i);
	if (thisSPAN == fff)
		{
		thisSPAN.innerText = sss;
		break;
		}
	}
}

function show2(iii, mmm)
{
var ii0 = iii.parentElement;
if (iii == theID1)
	iii = 0;
if (theID2 != 0)
	{
	theID2.style.display="none";
	theID2 = 0;
	changetext(themID2, " see more ...");
	}
if (theID1 != 0)
	{
	theID1.style.display="none";
	changetext(themID1, " see more ...");
	}
if (iii != 0)
	{
	if (theID0 != ii0)
		{
		if (theID0 != 0)
			{
			theID0.style.display="none";
			changetext(themID0, " see more ...");
			}
		theID0 = ii0;
		theID0.style.display="";
		}
	iii.style.display="";
	changetext(mmm, " see less ...");
	}
theID1 = iii;
themID1 = mmm;
window.event.cancelBubble = true;
}


function show3(iii)
{
var ii1 = iii.parentElement;
var ii0 = ii1.parentElement;
if (iii == theID2)
	iii = 0;
if (theID2 != 0)
	{
	theID2.style.display="none";
	}
if (iii != 0)
	{
	if (theID0 != ii0)
		{
		if (theID0 != 0)
			theID0.style.display="none";
		theID0 = ii0;
		theID0.style.display="";
		}
	if (theID1 != ii1)
		{
		if (theID1 != 0)
			theID1.style.display="none";
		theID1 = ii1;
		theID1.style.display="";
		}
	iii.style.display="";
	}
theID2 = iii;
window.event.cancelBubble = true;
}

function highlightDiv() {
  // the div supplied after the # in the request we should highlight
 // var url = window.location.href;
 // var startIndex = url.indexOf( "#" );

  // nothing to do if there is no # in the request url
 // if ( startIndex == -1 )
  //  return;

  // now get the ID requested
  //var highlightDivID = url.substr( startIndex + 1, url.length );
  
  // call the changeIt function to show the requested target in red
  //changeIt(document.getElementById(highlightDivID));
}

//// functions required by Jersey Law Reports
//function changeIt(theItem){
//  theItem.style.color="red";
//  }

//function changeItAgain(theItem){
//  theItem.style.color="black";
//  }
//  
//function seeML(){
//	if (more.style.visibility=="visible")
//	{more.style.visibility="hidden"}
//	else {more.style.visibility="visible"}
//	if (less.style.visibility=="hidden")
//	{less.style.visibility="visible"}
//	else {less.style.visibility="hidden"}
//	}

//function seeL(theItem){
//  theItem.style.visibility="visible";
//  }
//  
//theID0 = 0;
//theID1 = 0;
//theID2 = 0;
//themID0 = 0;
//themID1 = 0;
//themID2 = 0;

//function arriving()
//{
//var jjj = location.hash;
//var fff = "D_"+jjj.substr(1);
//var allDIV = document.all.tags("DIV");
//var numDIV = allDIV.length;
//var thisDIV = 0;
//var pareDIV = 0;
//var granDIV = 0;
//var strID;

//for (i=0; i<numDIV; i++)
//	{
//	thisDIV = allDIV(i);
//	if (thisDIV.id == fff)
//		{
//		pareDIV = thisDIV.parentElement;
//		strID = String(pareDIV.id);
//		if (strID.length == 0)
//			{
//			show1(thisDIV);
//			}
//		else{
//			granDIV = pareDIV.parentElement;
//			strID = String(granDIV.id);
//			if (strID.length == 0)
//				{
//				show2(thisDIV);
//				}
//			else{
//				show3(thisDIV);
//				}
//			}
//		break;
//		}
//	}
//}

//function show1(iii, mmm)
//{
//if (iii == theID0)
//	iii = 0;
//if (theID2 != 0)
//	{
//	theID2.style.display="none";
//	theID2 = 0;
//	changetext(themID2, " see more ...");
//	}
//if (theID1 != 0)
//	{
//	theID1.style.display="none";
//	theID1 = 0;
//	changetext(themID1, " see more ...");
//	}
//if (theID0 != 0)
//	{
//	theID0.style.display="none";
//	changetext(themID0, " see more ...");
//	}
//if (iii != 0)
//	{
//	iii.style.display="";
//	changetext(mmm, " see less ...");
//	}
//theID0 = iii;
//themID0 = mmm;
//window.event.cancelBubble = true;

//}

//function changetext(fff, sss)
//{
//var allSPAN = document.all.tags("SPAN");
//var numSPAN = allSPAN.length;
//for (i=0; i<numSPAN; i++)
//	{
//	thisSPAN = allSPAN(i);
//	if (thisSPAN == fff)
//		{
//		thisSPAN.innerText = sss;
//		break;
//		}
//	}
//}

//function show2(iii, mmm)
//{
//var ii0 = iii.parentElement;
//if (iii == theID1)
//	iii = 0;
//if (theID2 != 0)
//	{
//	theID2.style.display="none";
//	theID2 = 0;
//	changetext(themID2, " see more ...");
//	}
//if (theID1 != 0)
//	{
//	theID1.style.display="none";
//	changetext(themID1, " see more ...");
//	}
//if (iii != 0)
//	{
//	if (theID0 != ii0)
//		{
//		if (theID0 != 0)
//			{
//			theID0.style.display="none";
//			changetext(themID0, " see more ...");
//			}
//		theID0 = ii0;
//		theID0.style.display="";
//		}
//	iii.style.display="";
//	changetext(mmm, " see less ...");
//	}
//theID1 = iii;
//themID1 = mmm;
//window.event.cancelBubble = true;
//}


//function show3(iii)
//{
//var ii1 = iii.parentElement;
//var ii0 = ii1.parentElement;
//if (iii == theID2)
//	iii = 0;
//if (theID2 != 0)
//	{
//	theID2.style.display="none";
//	}
//if (iii != 0)
//	{
//	if (theID0 != ii0)
//		{
//		if (theID0 != 0)
//			theID0.style.display="none";
//		theID0 = ii0;
//		theID0.style.display="";
//		}
//	if (theID1 != ii1)
//		{
//		if (theID1 != 0)
//			theID1.style.display="none";
//		theID1 = ii1;
//		theID1.style.display="";
//		}
//	iii.style.display="";
//	}
//theID2 = iii;
//window.event.cancelBubble = true;
//}

//function highlightDiv()
//{
//    alert("running");
//  // the div supplied after the # in the request we should highlight
//  var url = window.location.href;
//  var startIndex = url.indexOf( "#" );

//  // nothing to do if there is no # in the request url
//  if ( startIndex == -1 )
//    return;

//  // now get the ID requested
//  var highlightDivID = url.substr( startIndex + 1, url.length );

//  // call the changeIt function to show the requested target in red
//  changeIt( document.getElementById( highlightDivID ) );
//}

