var utils = new TapUtils();

// Simple getElementById macro function
function $( id ) {
	return document.getElementById( id );
}


function TapUtils() {

		// Helper utils class definition
}

TapUtils.prototype.toggle = function( elA, elB ) { // close elA, open elB

	var _elA = $(elA);
	var _elB = $(elB);

	if ( _elA ) {
		_elA.style.display = "none";
		if ( _elB ) {
				_elB.style.display = "block";
		}
	}
}

TapUtils.prototype.slowClose = function( elid ) { // animate close an object

	var el = $( elid );
	if ( el ) {
		var h = parseInt( el.style.height ); 
		var step = h / 10;
		setTimeout( "animClose('" + elid + "', " + h + "," + step + ")", 10 );
	}
}

function animClose( elid, h, step ) {

	var el = $( elid );
	el.style.height = h + "px";
	if ( h > 0 ) {
		el.style.height = h + "px";
		h -= step;
		setTimeout( "animClose('" + elid + "', " + h + "," + step + ")", 10 );
	}
	else {
		el.style.height = "0px";
	}
}


function getEmail( docid ) {

	var total = document.total;
	$( "form" ).style.display = "block";
	$( "docid" ).value = docid;
	if ( $( "email" ).value != "" ) {
		document.forms.details.submit();
	}


}
