// JavaScript Document
//	======================================================================
//
//
//	jsfunctions.js
//
//
//	project:	findhaveplanter.dk
//
//	author:		SP3 A/S, Michael Stigaard Sørensen	ms [at] sp3 . dk
//	version:	1.0
//	
//	language:	javascript
//	requires:	nothing
//
//	tested on:	Safari 4.0 / FF 3.0.11 Mac & PC / Opera 9 PC / IE8
//
//	history:	03.07.2009	-	created
//
//	======================================================================

function change(that, fgcolor, bgcolor){
	that.style.color = fgcolor;
	that.style.backgroundColor = bgcolor;
}

function nextObject(o)
{
                      var n = o;
                      do n = n.nextSibling;
                      while (n && n.nodeType != 1);
                      return n;
}
function previousObject(o)
{
                      var p = o;
                      do p = p.previousSibling;
                      while (p && p.nodeType != 1);
                      return p;
}
function passwordSwitch(field)
{
                      if (field.getAttribute('type') == 'text')
                      {
                                            field.style.display="none";
                                            var next = nextObject(field);
                                            next.style.display="inline";
                                            next.focus();
                      }
                      else
                      {
                                            field.style.display="none";
                                            var prev = previousObject(field)
                                            prev.style.display="inline";
                      }
}
