<!-- Hidden
  var newWin;
  var javascript_version=1.0;
  var x=0;
  var y=0;
  var osx=0;
  var osy=0;
  var modformX=0;
  var modformY=0;
  var activeformX=0;
  var activeformY=0;
  var activemodform=new Array();
  var lastKeyFieldId="";
  var lastLevel="00";
  
  function hideModifyForm(level)
  {
	  var element;
	  for (var idx=activemodform.length;idx>=level;idx--)
      {
        element=getElement(activemodform[idx]); 
		if (element != null)
		  element.style.display="none";
		activemodform.length=idx;
      }
  }

  function getMouseXY(e)
  {
    x=event.clientX +document.body.scrollLeft;
	y=event.clientY +document.body.scrollTop;
    osx=event.clientX;
	osy=event.clientY;
	return true;
  }

  function handleMouseClick(e)
  {
    var txt=event.srcElement.type;
    var src=event.srcElement.src;
 
    if ((src!=null)&&(txt!="file"))
      return;

    if ((txt!="text")&&(txt!="submit")&&(txt!="select-one")&&(txt!="file"))
    {
      hideModifyForm(0);
	  //window.scrollTo(0,0);
    }
    else
	  {
	    event.srcElement.scrollIntoView(false);
		window.scrollBy(-150,150);
	  }
  }

  function handleKeys(e)
  {
	var modform;
	var amf="";
	

	/*
	 * If escape char is selected, hide the active modify form
	 * and remove it from the activemodform queue.
	 */
    if (event.keyCode==27)
    {

	  if (activemodform.length>0)
      {
        amf=activemodform[activemodform.length-1];
	    activemodform.length=activemodform.length-1;
        if (amf!="")
		{
	      modform=getElement(amf);
	      if (modform != null)
          {
            modform.style.display="none";
	        window.scrollTo(0,0);
          }
        }
      }

    }

        
	return true;
  }

  function getElement(id)
  {
	var element;

    if (is_ie4)
    {
	  if (document.all[id])
        element=document.all[id];
    }
    else
    {
	  if (document.getElementById(id))
        element=document.getElementById(id);
    }
    return element;
  }

  function setElementValue(id,value)
  {
    var element;
	element=getElement(id);
	if (element != null)
          element.value=value;			  
/*          if (element.value)
          {
            alert("element.value: "+element.value+"value: "+value);
  	  }
	}*/
    return element;
  }

  function openSelected(selectObj)
  {
    var urlref;
	
	urlref=selectObj.options[selectObj.selectedIndex].value;
	if (urlref != "prompt")
	  openWindow(urlref,'JumpTo',800,600,4);
  }

  function setElementChecked(id,value)
  {
    var element;
	element=getElement(id);
	if (element != null)
	  if (element.value)
        element.checked=value;			  
    return element;
  }
  
  function replaceURLFile(Obj,file)
  {
    var idx1=null;
	var tmp=null;
	var idx2=-1;
	var minIdx=0;
	var maxIdx=0;
	
	minIdx=Obj.value.indexOf("<");
	if (minIdx < 0)
      minIdx=1; 
	else
	{
      maxIdx=Obj.value.indexOf(">");
	  if (maxIdx < 0)
	    maxIdx=Obj.value.length;
    }

    idx1=Obj.value.lastIndexOf("/",maxIdx);
	
	if (idx1 >= 0)
    {
      idx2=Obj.value.indexOf("?",idx1);
	  if (idx2 < 0)
        idx2=Obj.value.indexOf(">",idx1)-1;
	  if (idx2 < 0)
        tmp=Obj.value.substring(0,idx1)+"/"+file;
	  else
        tmp=Obj.value.substring(0,idx1)+"/"+file+Obj.value.substring(idx2);
	  Obj.value=tmp;
    }
  }

  function replaceURLParam(Obj,param,value)
  {
    var idx1=null;
	var tmp=null;
	var idx2=-1;

    idx1=Obj.value.indexOf(param+"=");
	
	if (idx1 >= 0)
    {
      idx2=Obj.value.indexOf("&",idx1);
	  if (idx2 < 0)
        idx2=Obj.value.indexOf(">",idx1)-1;
	  if (idx2 < 0)
        tmp=Obj.value.substring(0,idx1)+param+"="+value;
	  else
        tmp=Obj.value.substring(0,idx1)+param+"="+value+Obj.value.substring(idx2);
	  Obj.value=tmp;
    }
  }

  /*
   * If value is null then just return text between strings.
   * If value not null, then replace text between string, return old text.
   */
  function betweenStrings(Obj,value,string1,string2)
  {
    var idx1=null;
	var tmp=null;
	var was=null;
	var idx2=-1;

    idx1=Obj.value.indexOf(string1);
	
	if (idx1 >= 0)
    {
      idx1+=string1.length;
      idx2=Obj.value.indexOf(string2,idx1);
	  if (idx2 < 0)
	  {
        tmp=Obj.value.substring(0,idx1)+value;
		idx2=Obj.value.length;
	  }
	  else
        tmp=Obj.value.substring(0,idx1)+value+Obj.value.substring(idx2);
	  was=Obj.value.substring(idx1,idx2);
	  if (value != null)
	    Obj.value=tmp;
    }
	return was;
  }

  function replaceBetweenTags(Obj,value)
  {
    betweenStrings(Obj,value,">","<");
  }

  function getHref(Obj,value)
  {
    return betweenStrings(Obj,null,"href=\"","\"");
  }

  function getSrc(Obj,value)
  {
    return betweenStrings(Obj,null,"src=\"","\"");
  }

  function isDigits(obj)
  {
	var result;
    regexp=/\D/
	result = regexp.test(obj.value);
	if (result)
	{
	  alert("Please enter digits only, ie 0..9");
	  obj.value=obj.value.replace(/\D/,"");
	}

	return !(result);
  }

  function mycontains(textObj,value,caseSensitiveFlag)
  {
	
	var regex = null;
    var foundit = false;

    if (!textObj.name)
      textObj=getElement(textObj);
			
	if (caseSensitiveFlag)
	  regex=new RegExp(value,"g");
	else
	  regex=new RegExp(value,"gi");

    if (textObj != null)
    {
      if (regex.test(textObj.value))  
        return true;
    }
	return false;
  }

  function selectOption(selectObj,value,caseSensitiveFlag)
  {
	var regex = null;
    var foundit = false;
    if (!selectObj.id)
      selectObj=getElement(selectObj);
			
    if (selectObj != null)
    {
      for (var i=0; i<selectObj.options.length; i++)
      {
	if (caseSensitiveFlag)
	  regex=new RegExp(value,"g");
	else
	  regex=new RegExp(value,"gi");
	  
        if (regex.test(selectObj.options[i].value) && 
			 (selectObj.options[i].value.length == value.length))
        {
          selectObj.options[i].selected = true;
	  foundit=true;
        }
        else
        {
          selectObj.options[i].selected = false;
        }
      }
    }
    return foundit;
  }

  function loadKeyValue(textbox)
  {
	var keyElement=getElement("keyvalue");

    if ((textbox.value=='')||(lastKeyFieldId != keyElement.id))
    {
        textbox.value=keyElement.value;
		lastKeyFieldId=keyElement.id;
    }
  }

  function setKeyField(textbox)
  {
    var myopt = document.createElement("OPTION");
    var keyField=getElement("keyfield");
	keyField.options.add(myopt,0);
	myopt.selected=true;
	myopt.innerText=textbox.value;
	myopt.value=textbox.value;
  }
  
  function setKeyValue(textbox)
  {
    var keyValue=getElement("keyvalue");

	if (textbox.value.indexOf("!--#include")==0)
      keyValue.value="<"+textbox.value+">";
	else
      keyValue.value=textbox.value;

	textbox.value='';
  }
  
  function set1box(ref,box1,box2,box3)
  {
    ref.value=box1.value+box2.value+box3.value;
  }

  function resetTextboxes()
  {
    var LL="01";
	var NN="01";
	var el=null;

	for (var ll=1;ll<4;ll++)
	{
      LL="0"+ll;
      if (LL.length > 2)
        LL=LL.substring(LL.length-2);
	  for (var nn=1;nn<20;nn++)
	  {
		NN="0"+nn;
  	    if (NN.length > 2)
          NN=NN.substring(NN.length-2);
	    if ((el=getElement("textbox"+LL+NN))!=null)
	    {
          el.value="";
        }
	  }
	}
  }
  function set3boxes(ref,box1,box2,box3)
  {
    var a=ref.value.indexOf("<a");
    var az=-1;
	var img=ref.value.indexOf("<img");
	var imgz=-1;
	var txt=-1;
	var txtz=-1;
    var a2=ref.value.indexOf("</a");
    var a2z=-1;
	var mybox1="";

    if ((a>=0) && (a2>=0))
    {
      az=ref.value.indexOf(">",a)
	  
	  if (img>=0)
        imgz=ref.value.indexOf(">",img)

      a2z=ref.value.indexOf(">",a2)
     
      if (az>a)	
        mybox1=ref.value.substring(a,az+1);

      if (imgz>a)	
        box2.value=ref.value.substring(img,imgz+1);

      if ((a2!=imgz+1)&&(a2!=az+1))	
	  {
        if (imgz>=0)
          box3.value=ref.value.substring(imgz+1,a2z+1);
      }
	  if ((img==-1)&&(a2!=az+1))
        box3.value=ref.value.substring(az+1,a2z+1);
	}
	else
	{
	  mybox1.value="";
	  box2.value="";
	  box3.value="";
	}

	if (box1.options)
	{
      for (var i=0; i<box1.options.length; i++)
      {
        if (mybox1 == box1.options[i].value)
          box1.options[i].selected = true;
		else
          box1.options[i].selected = false;
      }
    }
	else
	{
	 // if (mybox1=="")
     //   box1.value="<a href=\"www.example.com\">";
     // else
        box1.value=mybox1;
	}

	//if (box2.value=="")
    //  box2.value="<img src=\"YOURIMG.gif\">";
	if (box3.value=="")
      box3.value="</a>";
  }

  function setModifyForm(fieldname,id,width,lineheight)
  {
    /*
     * This script will simply make the template Modify Form visible
	 * and update a few elements of the template modify form
	 */
	var field;
	var modform;
    var keyfield=getElement("keyfield");
    var prevkeyfield=getElement("prevkeyfield");
    var keyvalue=getElement("keyvalue");
    var templateFilename=getElement("templateFilename");

	activemodform[activemodform.length]=id;
	field=getElement(fieldname);
	modform=getElement(id);

    if (field)
    {
	  if (keyfield != null)
        for (var i=0; i<keyfield.options.length; i++)
        {
          if (field.id == keyfield.options[i].value)
            keyfield.options[i].selected = true;
		  else
            keyfield.options[i].selected = false;
        }
        //keyfield.value=field.id;
	  if (keyvalue != null)
        keyvalue.value=field.value;
	  lastKeyFieldId=field.id;
	  if (prevkeyfield != null)
	    prevkeyfield.value=field.id;
    }

	document.onmousemove=getMouseXY;
	getMouseXY();
	document.onmousedown=handleMouseClick;
	document.onkeydown=handleKeys;

//	alert(Math.floor(osx/100)*100+" " +Math.floor(osy/50)*50);



	if (id=="modifyform")
    {
	  modform.style.top=y;
	  modform.style.left=x;
	  if (templateFilename!=null)
	  {
	    var pathname=location.pathname;
	    var idx=pathname.lastIndexOf("/");

	    if ((idx > 0) && (idx < pathname.length-1))
	      pathname=pathname.substr(idx+1);
		else
		  pathname=""
		//  pathname="index.shtm"
	    templateFilename.value=pathname;
  	  }
	  modformY=modform.style.top;
	  modformX=modform.style.left;
	  hideModifyForm(0);
	  resetTextboxes();
	  activemodform[activemodform.length]=id;
	  modform.style.display="inline";
	  if (((y+modform.clientHeight)>(document.body.offsetHeight*1+document.body.bottomMargin*1+document.body.topMargin*1)))
	  {
	    modform.scrollIntoView(false);
   	    window.scrollBy(-150,0);
      }
// 	alert(Math.floor(osx/200)*200+" " +Math.floor(osy/200)*400);
    }
	else
    {
	  /*
	   * the submenus of modifyform, have a naming
	   * convention  <submenuname><LL><NN>,
	   * where,
	   *   
	   *   <submenuname> - any id text for submenu
	   *   <LL>          - submenu level
	   *   <NN>          - submenu item number
	   *
	   * this will determine the x,y placement of the
	   * submenu relative to the modifyform.
	   * As LL increases the submenu box is placed further to the right.
	   * As NN increases the submenu box is placed further down.
	   */
	  var linknums=id.substring(id.length-4);
  	  var LL=linknums.substring(0,2);
	  var NN=linknums.substring(2);
	  var inputtype=id.substring(0,id.length-4)
	  var mfsx=modformX.substring(0,modformX.length-2);
	  //var mfsy=modformY.substring(0,modformY.length-2);
	  var mfsy=y;
      var mfx=mfsx*1;
	  var mfy=mfsy*1;
	  var activeinput;
	  var box1;
	  var box2;
	  var box3;

	  box1=getElement("box1"+LL+NN);
	  box2=getElement("box2"+LL+NN);
	  box3=getElement("box3"+LL+NN);

	  if ((activeinput=getElement("textbox"+LL+NN)) != null)
      {
        loadKeyValue(activeinput);
	    if ((box1!=null) && (box2!=null) && (box3!=null))
          set3boxes(activeinput,box1,box2,box3);
      }
      
      mfx=mfx+(width*LL);
      //mfy=mfy+(lineheight*(NN-1));
      mfy=mfy-(lineheight/2);
	  mfsx=mfx+"px";
	  mfsy=mfy+"px";
	  
	  modform.style.top=mfsy;
	  modform.style.left=mfsx;
	  hideModifyForm(LL*1);
	  activemodform[activemodform.length]=id;
	  modform.style.display="inline";
	  //alert ((y+modform.clientHeight)+" "+(document.body.offsetHeight*1+document.body.bottomMargin*1+document.body.topMargin*1));
	  /*
	   * once for each level
	   *
	  if (((y+modform.clientHeight)>(document.body.offsetHeight*1+document.body.bottomMargin*1+document.body.topMargin*1))&&(lastLevel!=LL)&&(LL=="01"))
      {
	    modform.scrollIntoView(true);
      }*/
	  lastLevel=LL;
    }
      //window.scrollTo((Math.floor(osx/200))*200,200);//Math.floor(osy/200)*400);
  }

  function openWindow(file,name,width,height,level)
  {
	var attr;

	if (level)
	{
	  if (level==1)
        attr="dependent=0,resizable=1,scrollbars=1,menubar=0,location=0,toolbar=0,width="+width+",height="+height;
	  if (level==2)
        attr="dependent=0,resizable=1,scrollbars=1,menubar=1,location=0,toolbar=0,width="+width+",height="+height;
	  if (level==3)
        attr="dependent=0,resizable=1,scrollbars=1,menubar=1,location=1,toolbar=0,width="+width+",height="+height;
	  if (level==4)
        attr="dependent=0,resizable=1,scrollbars=1,menubar=1,location=1,toolbar=1,width="+width+",height="+height;
	}
	else
      attr="dependent=0,resizable=1,scrollbars=0,menubar=0,location=0,toolbar=0,width="+width+",height="+height;

    newWin = window.open("javascript:void(0);",name,attr);
    newWin.close();
    newWin = window.open(file,name,attr);

  	/*if (javascript_version > 1.0)
    { 
      newWin.focus();
	  if (window.focus)
	    setTimeout('newWin.focus();',3000);
    }*/
	return newWin;
  }
  
  function waitWindow(theForm,prompt,winname,width,height)
  {
    var mywin;
    mywin=openWindow('',winname,width,height);
    mywin.document.writeln(prompt);
    theForm.target=winname;
    theForm.submit();
	return true;
  }
  
  function loadinparent(url, closeSelf)
  {
    self.opener.location = url;
    if (closeSelf) 
      self.close();
  }

  function confirmButton(theForm)
  {
    if (theForm.areYouSure.checked)
       theForm.elements[0].disabled=false;
    else
       theForm.elements[0].disabled=true;
  }  

  function loadFilenames(form)
  {
    var count = 0;    
    var x = 0;
//  var newWin = open('','myDoc','')
//  newWin.document.writeln("<html><head><body>");  
    
    rExp = /currImageRef_/g;
    for (x=0; x<form.elements.length; x++)
    {
      if (form.elements[x].name.search(rExp) != -1)
      {   
        if (form.elements[x-1].value != "")
          form.elements[x].value = form.elements[x-1].value;
//      newWin.document.writeln("<P>"+form.elements[x].name +"="+form.elements[x].value+"</P>");
      }
    }    
  
//  newWin.document.writeln("</html></head></body>");  
  
  }
  function showInline(theId)
  {
    if (is_ie4)
    {
      document.all[theId].style.display="inline";
    }
    else
    {
      document.getElementById(theId).style.display="inline";
    }
  }
  function show(theId)
  {
    if (is_ie4)
    {
      document.all[theId].style.display="block";
    }
    else
    {
      document.getElementById(theId).style.display="block";
    }
  }

  function hide(theId)
  {
    if (is_ie4)
    {
	  if (document.all[theid])
        document.all[theId].style.display="none";
    }
    else
    {
	  if (document.getElementById(theId))
        document.getElementById(theId).style.display="none";
    }
  }


// --->

