var addOnclick = function ( element, func ) {
	element.onclick = func; 
}

var hideShowAnimate = function (elementID) { 
	var x = document.getElementById(elementID);;
	var b = x.style.height.replace("px", "");
	function down() {
		if (b < 20) {
			b = b + 5;
			x.style.height = b.toString() + 'px';
			setTimeout (down, 30);
		} else {
			x.styleheight = b;
		}
	};
	down();
}

function textSwap ( objectID, text ) { 
	var obj = document.getElementById(objectID) ;
	obj.innerHTML = text; 
}

function clearDefaultValue ( object, defaultText ) {
	if( object.value == defaultText ) {
		object.value = ' ';
	}
}

function addDefaultValue ( object, defaultText ) {
	if( object.value == ' ' ) {
		object.value = defaultText;
	}
}


<!--- hiding and showing stuff and adding and removing cookies  - I think? --->

function hideObject ( object ) { 
	object.style.display = 'none'; 
}


function set_cookie ( name, value, expires_year, expires_month, expires_day, path, domain, secure )
{
  var cookie_string = name + "=" + escape ( value );

  if ( expires_year )
  {
    var expires = new Date ( expires_year, expires_month, expires_day );
    cookie_string += "; expires=" + expires.toGMTString();
  }

  if ( path )
	cookie_string += "; path=" + escape ( path );

  if ( domain )
	cookie_string += "; domain=" + escape ( domain );

  if ( secure )
	cookie_string += "; secure";

  document.cookie = cookie_string;

}

function delete_cookie ( cookie_name )
{
  var cookie_date = new Date ( );  // current date & time
  cookie_date.setTime ( cookie_date.getTime() - 1 );
  document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}

function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );

  if ( results )
    return ( unescape ( results[2] ) );
  else
    return null;
}
