var bV=parseInt(navigator.appVersion);
NS4=(document.layers)?true:false;
IE4=(document.all)?true:false;
ver4=(NS4 || IE4)?true:false;
firstInd = 0;

if (document.images) {
	arImLoad=new Array ("/eminutes/images/expandup.gif");
	arImList=new Array ();
	for (counter in arImLoad) {
		arImList[counter]=new Image();
		arImList[counter].src=arImLoad[counter] + ".gif";
	}
}

function expandIt(){return}
function expandAll(){return}






isExpanded=false;

function reDo(){window.location.reload()}

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.getElementsByTagName("DIV")[0].style.top + document.getElementsByTagName("DIV")[0].style.top-10;

	for (i=firstInd+1; i<document.getElementsByTagName("DIV").length; i++) {
		whichEl=document.getElementsByTagName("DIV")[i];
		if (whichEl.visibility != "hide") {
			whichEl.style.top=nextY;
			nextY += whichEl.style.top-10;
		}
	}
	
}

function initIt(){
	if (NS4){
		scrollTo(0,pageYOffset-30)
	
		for (i=0; i<document.layers.length; i++) {
			whichEl=document.layers[i];
			if (whichEl.id.indexOf("Child") != -1) {
				var statevalue;
				statevalue = getCookie(whichEl.id);
				//alert(tempColl[i].id + ":" + statevalue);
				if (statevalue == null){
					setCookie(whichEl.id,"0");
					statevalue = "0";
				}
				if (statevalue == "1") {
					whichEl.style.display="block";
					whichEl.visibility="show";
					whichEl.isExpanded=true;
				}
				else {
					whichEl.style.display="none";
					whichEl.visibility="hide";
					whichEl.isExpanded=false;
				}
			
			
			
			
				
				
				
				
				
				
				
				
			}
		}
		arrange();
		setTimeout("window.onresize=reDo",1000)
	}else{

		var tempColl;
		if (IE4){tempColl=document.all.tags("DIV");}else{tempColl=document.getElementsByTagName("DIV");}
		for (i=0; i<tempColl.length; i++) {
			if (tempColl[i].className == "child") {
				var statevalue;
				statevalue = getCookie(tempColl[i].id);
				//alert(tempColl[i].id + ":" + statevalue);
				if (statevalue == null){
					setCookie(tempColl[i].id,"0");
					statevalue = "0";
				}
				if (statevalue == "1") {
					tempColl[i].style.display="block";
					tempColl[i].isExpanded=true;
					
				}
				else {
					tempColl[i].style.display="none";
					tempColl[i].isExpanded=false;
				}
			}
		}
	}
}

function expandIt(el) {

	//if (!ver4) return;
	
	if (IE4) {expandIE(el)} else {expandNS(el)}

}

function expandIE(el) {
	whichEl=eval(el + "Child");
	whichIm=event.srcElement;
	//alert(whichEl.id);
	if (whichEl.style.display == "none") {
		whichEl.style.display="block";
		whichEl.isExpanded=true;
		whichIm.src="/eminutes/images/expandup.gif";
		setCookie(whichEl.id,"1");
	}else{
		whichEl.style.display="none";
		whichEl.isExpanded=false;
		whichIm.src="/eminutes/images/expand.gif";
		setCookie(whichEl.id,"0");
	}
}

function expandNS(el) {
	whichEl=eval("document.getElementById('" + el + "Child')");
	//whichIm=eval("document.getElementById('" + el + "').document.images['imEx']");
	if (whichEl.visibility == "hide") {
		whichEl.style.display="block";
		whichEl.visibility="show";
		whichEl.isExpanded=true;
		setCookie(whichEl.id,"1");
		//whichIm.src="/eminutes/images/expandup.gif";
	}else{
		whichEl.style.display="none";
		whichEl.visibility="hide";
		whichEl.isExpanded=false;
		setCookie(whichEl.id,"0");
		//whichIm.src="/eminutes/images/expand.gif";
	}
	arrange();
}

function showAll() {
	for (i=firstInd; i<document.layers.length; i++) {
		whichEl=document.layers[i];
		whichEl.visibility="show";
	}
}

function expandAll(isBot) {
	newSrc=(isExpanded)?"/eminutes/images/expand.gif":"/eminutes/images/expandup.gif";
	if (NS4) {
		document.images["imEx"].src=newSrc;
		for (i=firstInd; i<document.layers.length; i++) {
			whichEl=document.layers[i];
			if (whichEl.id.indexOf("Parent") != -1) {
				whichEl.document.images["imEx"].src=newSrc;
			}
			if (whichEl.id.indexOf("Child") != -1) {
				whichEl.visibility=(isExpanded)?"hide":"show";
				whichEl.isExpanded=(isExpanded)?false:true;
			}
		}
		arrange();
		if (isBot && isExpanded) scrollTo(0,document.layers[firstInd].pageY);
	}else {
		var divColl;
		if (IE4){divColl=document.all.tags("DIV");}else{divColl=document.getElementsByTagName("DIV");}
		for (i=0; i<divColl.length; i++) {
			if (divColl[i].className == "child") {
				divColl[i].style.display=(isExpanded)?"none":"block";
				divColl[i].isExpanded=(isExpanded)?false:true;
			}
		}
		imColl=document.images.item("imEx");
		for (i=0; i<imColl.length; i++) {
			imColl[i].src=newSrc;
		}
	}
	isExpanded=!isExpanded;
}

with (document) {
	write("<STYLE TYPE='text/css'>");
	write(".parent {");
	if (NS4) {write("left:0px; position:absolute; top:0px; visibility:hidden; z-index:0")};
	if (IE4) {write("margin-top:-10;")};
	write("margin-left:35;");
	write("color:#006");
	write("}");
	write(".child {");
	if (NS4) {write("left:0px; position:absolute; top:0px; visibility:hidden; z-index:0")};
	if (IE4) {write("display:none;")};
	write("margin-left:0;");
	write("}");
	write(".other {");
	if (NS4) {write("left:0px; position:absolute; top:0px; visibility:hidden; z-index:0")};
	write("margin-left:25;");
	write("}");
	write("</STYLE>");
}

function linkIt(whichEl, whichHref) {
	lay=(NS4)?eval("document."+whichEl+"Child"):eval(whichEl+"Child");
	if (!lay.isExpanded) expandIt(whichEl);
	nlay=(NS4)?lay.document.images[whichHref]:document.images[whichHref];
	if (NS4){
		sY=nlay.y+lay.pageY-20
		window.scrollTo(0,sY);
	}else{
		nlay.scrollIntoView();scroll(0,document.body.scrollTop-20);

	//alert(nlay.parentElement.tagName);
	nlay.parentElement.style.backgroundColor="#FF99FF";setTimeout("nlay.parentElement.style.backgroundColor='white'",1000);}
}

window.onload=initIt;


/*
   name - name of the cookie
   value - value of the cookie
   [expires] - expiration date of the cookie
     (defaults to end of current session)
   [path] - path for which the cookie is valid
     (defaults to path of calling document)
   [domain] - domain for which the cookie is valid
     (defaults to domain of calling document)
   [secure] - Boolean value indicating if the cookie transmission requires
     a secure transmission
   * an argument defaults when it is assigned null as a placeholder
   * a null placeholder is not required for trailing omitted arguments
*/

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}


/*
  name - name of the desired cookie
  return string containing value of specified cookie or null
  if cookie does not exist
*/

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}


/*
   name - name of the cookie
   [path] - path of the cookie (must be same as path used to create cookie)
   [domain] - domain of the cookie (must be same as domain used to
     create cookie)
   path and domain default if assigned null or omitted if no explicit
     argument proceeds
*/

function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"

function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

