function picksel(oField, sMatch)
  {
    for (i = 0; i < oField.options.length; i++)
    {
      if (oField.options[i].value == sMatch)
        oField.options[i].selected = true;
    }

  } // End function picksel.

function setFlashWidth(divid, newW){
document.getElementById(divid).style.width = newW+"px";
}

function setFlashHeight(divid, newH){
document.getElementById(divid).style.height = newH+"px";  
}

function setFlashSize(divid, newW, newH){
setFlashWidth(divid, newW);
setFlashHeight(divid, newH);
}

function scaleTo(w,h)
	{
		w=w+"px";
		h=h+"px";
		document.getElementById('adpeel').style.width = w;
		document.getElementById('adpeel').style.height = h;
	}
	
  //Author:		Randy Rinehart
  //Description:	DHTML MENU System
  //Compatability:	Netscape 5+, Internet Explorer 5+, Mozilla, Camino, Safari
  //Copyright:		Townnews.com 2002,2003 
  
  sWidth = screen.width;
  tn_rgLayers=new Array();
  tn_rgLayers[0] = "droplayer1";
  tn_rgLayers[1] = "droplayer2";
  tn_rgLayers[2] = "droplayer3";
  tn_rgLayers[3] = "droplayer4";
  tn_rgLayers[4] = "droplayer5";
  tn_rgLayers[5] = "droplayer6";
  tn_rgLayers[6] = "droplayer7";
  
  
  tn_explorer = (document.all)?1:0
  tn_ns4 = (document.images && !document.all && !document.getElementById)?1:0
  tn_ns6 = (document.getElementById && !document.all)?1:0	

  /**
    * function:         tn_showdrop(droplayer)
    * description:      shows the dropdown menus
  **/

  function tn_show_drop(strLayer)
  {
    tn_save=strLayer;
    tn_hide_all();
    tn_showit = 1;
    tn_show(strLayer);
  }

  function tn_show(strLayer)
  { 
    var sLayer = tn_rgLayers[strLayer];
    if (tn_explorer)
    {
      eval(tn_rgLayers[strLayer]+ '.style.visibility="visible"');
    }
    else if(tn_ns4)
    {
      eval('document.'+tn_rgLayers[strLayer]+ '.visibility="show"');
    }
    else if(tn_ns6)
    {
      document.getElementById(sLayer).style.visibility="visible";
    }
    
  }

  function tn_hide_drop()
  {
    tn_save=-1;
    setTimeout('tn_hide_all()',500)
  }

  function tn_hide_all()
  {
    document
    var i;
    for (i=0; i < tn_rgLayers.length; i++)
    {
      tn_hide = 0;
      tn_checkmousepos(i);
      if (tn_explorer && tn_save != i)
      {
        if(tn_hide)
        {
          eval(tn_rgLayers[i]+'.style.visibility="hidden"');
        }
      }

      if(tn_ns4 && tn_save!=i)
      {
        if(tn_hide)
        {
          eval('document.'+tn_rgLayers[i]+'.visibility="hide"');
        }
      }
      if(tn_ns6 && tn_save!=i)
      {
        if(tn_hide)
        {
          var sLayer = tn_rgLayers[i];
          document.getElementById(sLayer).style.visibility="hidden";
        }
      }
    }
  }

  document.onmousemove = tn_getmousepos;
  if (tn_ns4)
  {
    document.captureEvents(Event.MOUSEMOVE)
  }

  function tn_getmousepos(e)
  {
    if(tn_ns4 || tn_ns6)
    {
      tn_mousex=e.pageX;
      tn_mousey=e.pageY;
    }
    if(tn_explorer)
    {
      tn_mousex=event.clientX;
      tn_mousey=event.clientY;
    }
  }

  function tn_checkmousepos(i)
  {
    if(tn_ns4)
    {
      tn_x_min=eval('document.'+tn_rgLayers[i]+'.left')
      tn_x_max=tn_x_min+eval('document.'+ tn_rgLayers[i]+ '.clip.width')
      tn_y_min=eval('document.'+tn_rgLayers[i]+'.top')
      tn_y_max=tn_y_min+eval('document.'+ tn_rgLayers[i]+ '.clip.height')
    }
    if(tn_explorer)
    {
      tn_x_min=eval(tn_rgLayers[i]+'.style.pixelLeft')
      tn_x_max=tn_x_min+eval(tn_rgLayers[i]+ '.style.pixelWidth')
      tn_y_min=eval(tn_rgLayers[i]+'.style.pixelTop')
      tn_y_max=tn_y_min+eval(tn_rgLayers[i]+ '.style.pixelHeight')
    }
    if(tn_ns6)
    {
      var sLayer = tn_rgLayers[i];
      tn_x_min=document.getElementById(sLayer).style.pixelLeft;
      tn_x_max=tn_x_min+document.getElementById(sLayer).style.pixelWidth;
      tn_y_min=document.getElementById(sLayer).style.pixelTop;
      tn_y_max=tn_y_min+document.getElementById(sLayer).style.pixelHeight;
    }
    if (tn_mousex>=tn_x_min && tn_mousex<=tn_x_max && tn_mousey>=tn_y_min && tn_mousey<=tn_y_max)
    {
      tn_hide=0; 
      setTimeout('tn_hideall()',500)
    }
    else
    {
      tn_hide=1
    }
    return tn_hide;
  }


