var bV=parseInt(navigator.appVersion);
var myhash="";
NS4=(document.layers) ? true : false;
IE4=((document.all)&&(bV>=4))?true:false;
ver4 = (NS4 || IE4) ? true : false;

	//debugger
	if (window.location.hash.length > 0)	{
		myhash=window.location.hash;
	}

//function expandIt(){return}
//function expandAll(){return}

isExpanded = false;

function getIndex(el) {
    ind = null;
    for (i=0; i<document.layers.length; i++) {
        whichEl = document.layers[i];
        if (whichEl.id == el) {
            ind = i;
            break;
        }
    }
    return ind;
}

function arrange() {
    nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height;
    for (i=firstInd+1; i<document.layers.length; i++) {
        whichEl = document.layers[i];
        if (whichEl.visibility != "hide") {
            whichEl.pageY = nextY;
            nextY += whichEl.document.height;
        }
    }
}


function showAll() {
	for (i=firstInd; i<document.layers.length; i++) {
		whichEl = document.layers[i];	
        if (whichEl.id.length < 2 )
        {
			whichEl.visibility = "show";
        }			
	}
}
function expandIt(el) {
    if (!ver4) return;
    if (IE4) {expandIE(el)} else {expandNS(el)}
}
function initIt(){

    var strhash="";
    var lenhash;
    var shash;
    var bdoarray=false;
    var k;
    var strsofar;
        
    if (myhash.length>1)						//example myhash=#aabca
	{  
    	for (i=1; i<myhash.length; i++)			//example strhash=aabca 	
    	{					
			strhash=strhash + myhash.charAt(i);	
			if (i<myhash.length-1){
				shash=strhash;					//example strhash=aabc	
				}		
			}
			
		lenhash=strhash.length;
		alert ("A-" + lenhash + "  strhash:" + strhash + " shash:" + shash );
	
		if (lenhash>2)
		{
			bdoarray=true;				
			var hashstr = new Array(lenhash-2);		//if lenhash=3 we need a one dim. array						
		}
		if (bdoarray==true)
		{						
			strsofar="";
			for (k=0; k<lenhash-2; k++) {							
				strsofar=strsofar+strhash.charAt(k)
				hashstr[k]= strsofar
			}
		}			
	}
        
    if (NS4) 
    {        
        for (i=0; i<document.layers.length; i++) 
        {
            whichEl = document.layers[i];           
            if (lenhash==0)
            {				
				if (whichEl.id.length > 1) whichEl.visibility = "hide";
			}
            else
            {				
						
				if (bdoarray==true)
				{
					var sTmp;
					if (whichEl.id.length < lenhash)		//looking for aa, ab, ac etc if # is aba
					{
						//alert ("OK"+hashstr.length)
						for (k=0; k<hashstr.length; k++) 
						{
							sTmp=hashstr[k];
							if (whichEl.id.indexOf(sTmp)==0)	
							{
								if (whichEl.id.length==sTmp.length+1)
								{
									whichEl.visibility = "show";
								//alert ("show" + whichEl.id);
								}
							}
						}
					}
				}
				
				if (whichEl.id.length > 1)
				{						
					if (whichEl.id.indexOf(shash)==0)				
					{						
						if (whichEl.id.length<lenhash+2)
						{
							//alert (strhash + " " + whichEl.id);
							whichEl.visibility = "show";
						}
						else
						{
							whichEl.visibility = "hide";
						}
					}
					else
					{	
						if (bdoarray==false)
						{
							whichEl.visibility = "hide";
						}
					}
				
				}	
            }
        }
        arrange();
    }
    else 
    {

        tempColl = document.all.tags("DIV");
        for (i=0; i<tempColl.length; i++) {
			
			eachitem = tempColl(i);            
            if (lenhash==0)
            {				
				if (eachitem.id.length > 1) eachitem.style.display = "none";
			}
            else
            {		
						
				if (bdoarray==true)
				{
					var sTmp;
					if (eachitem.id.length < lenhash)		//looking for aa, ab, ac etc if # is aba
					{
						for (k=0; k<hashstr.length; k++) 
						{
							sTmp=hashstr[k];
							if (eachitem.id.indexOf(sTmp)==0)	
							{
								if (eachitem.id.length==sTmp.length+1)
								{
									eachitem.style.display = "block";
								}
							}
						}
					}
				}
				
				if (eachitem.id.length > 1)
				{						
					if (eachitem.id.indexOf(shash)==0)				
					{						
						if (eachitem.id.length<lenhash+2)
						{
							eachitem.style.display = "block";
						}
						else
						{
							eachitem.style.display = "none";
						}
					}
					else
					{	
						if (bdoarray==false)
						{
							eachitem.style.display = "none";
						}
					}
				
				}	
            }           
		
		}
    }
    scrollTo(0,0);
}
function expandAll(isBot) {
    if (NS4) {		
        for (i=firstInd; i<document.layers.length; i++) 
			{
            whichEl = document.layers[i];          
            whichEl.visibility = (isExpanded) ? "hide" : "show";
            if (whichEl.id.length < 2 )
            {
				whichEl.visibility = "show";
            }
        }
        arrange();
        if (isBot && isExpanded) scrollTo(0,document.layers[firstInd].pageY);
    }
    else {
        divColl = document.all.tags("DIV");
        for (i=0; i<divColl.length; i++) {
            if (divColl(i).className == "child") {
                divColl(i).style.display = (isExpanded) ? "none" : "block";
            }
        }
    }    
    isExpanded = !isExpanded;
}

function displayNS(el, IDvalue, NumofRows, iCurLen)
{
	var i;	
	var bdohide;
	var iLen;
	
	iLen = el.length;
	whichEl = eval("document." + IDvalue);
	
	if (whichEl.visibility=="show")
	{
		bdohide=true;
	}
		
    for (i=firstInd; i<document.layers.length; i++) 
		{
        whichEl = document.layers[i]; 
        //delete below if collapse iof existing is not required.
        if (whichEl.id.length > iLen)		
		{			
			whichEl.visibility = "hide";             
		}
        if (bdohide)                          
		{	
			if (whichEl.id.length  > iLen)
			{
				if (whichEl.id.indexOf(el)==0) 
				{
					whichEl.visibility = "hide";					
				}
			}
		}
        else 
		{
			if (whichEl.id.indexOf(el) == 0)
			{
				if (whichEl.id.length  == iLen+1)
				{
					whichEl.visibility = "show";	
				}
			}			
        }
        arrange();
    }
}
function displayMe(sLetter, IDvalue)
{
	if (!IE4) 
	{		
		//alert ("displayMe" + sLetter+ " " + IDvalue);
		displayNS(sLetter, IDvalue);
		return;
	} 	
	else
	{
		displayIE(sLetter, IDvalue);
	}	
}	
	
function displayIE(sLetter, IDvalue){
		
	var i;	
	var j;
	var s;
	var iLen;
	var bnownone=false;
	var sSngLetter='';
	var k;
	//debugger
	iLen = sLetter.length;
	if (document.all(IDvalue).style.display == "block")  
	{ 
		document.all(IDvalue).style.display = "none";
		bnownone=true;
	}
	
	divColl = document.all.tags("DIV");							
	for (k=0; k<divColl.length; k++) 
	{
		if (divColl(k).className == "child")
		{	
			if (divColl(k).id.length > iLen)		
			{			
				divColl(k).style.display = "none";           
			}
								
			if (divColl(k).id.indexOf(sLetter)==0)	//see if the id begins with sLetter
			{					
				if (!bnownone)		
				{
					if (divColl(k).id.length == iLen+1)
					{
						divColl(k).style.display = "block";
					}								
				}
			}
		}
	}
}

with (document) {
    write("<STYLE TYPE='text/css'>");
    if (NS4) 
    {
        write(".parent {position:absolute; visibility:hidden}");
        write(".child {position:absolute; visibility:hidden}"); 
        write(".regular {position:absolute; visibility:hidden}")
    }
    else 
    {
        write(".child {display:none}")

    }
    write("</STYLE>");
}

onload = initIt;

//tmtC_NNresizeFix
if (document.layers) {
origWidth = innerWidth;
origHeight = innerHeight;}
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();}
if (document.layers) onresize = reDo;
//tmtC_NNresizeFixEnd

function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() {
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImgRestore() {
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function MM_goToURL() {
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}