DC = document;

// ------------------------------------
function hl_menu( id, id2, on, tid ) {
	o1 = DC.getElementById( id );
	o2 = DC.getElementById( id2 );
	if ( !o1 || !o2 ) { return false; }

	if ( tid ) {
		ot = DC.getElementById( tid );
	}

	if ( on == 1 ) {
		o1.style.display = "block";
		o2.style.display = "none";
		if ( tid ) { ot.style.color = "#72706f"; }
	}
	else {
		o1.style.display = "none";
		o2.style.display = "block";
		if ( tid ) { ot.style.color = "#ac371e"; }
	}
}

// ------------------------------------
function hl_bt( id, id2, on ) {
	o1 = DC.getElementById( id );
	o2 = DC.getElementById( id2 );
	if ( !o1 || !o2 ) { return false; }

	if ( on == 1 ) {
		o2.style.display = "none";
		o1.style.display = "block";
	}
	else {
		o1.style.display = "none";
		o2.style.display = "block";
	}
}

// ------------------------------------
function hl( id ) {
	o1 = DC.getElementById(id);
	o2 = DC.getElementById(id+"a");
	if ( !o1 || !o2 ) { return false; }

	o1.style.display = "none";
	o2.style.display = "block";
}

// ------------------------------------
function dhl( id ) {
	o1 = DC.getElementById(id);
	o2 = DC.getElementById(id+"a");
	if ( !o1 || !o2 ) { return false; }

	o1.style.display = "block";
	o2.style.display = "none";
}

// ------------------------------------
function go( url ) {
	if ( url ) {
		window.location.href = url;
	}
}

// ------------------------------------
function replace( obj ) {
	var r1 = /^( )+/g;
	var r2 = /( )+$/g;
	var r3 = /( {2})+/;

	obj.value = obj.value.replace( r1, '' );
	obj.value = obj.value.replace( r2, '' );
	obj.value = obj.value.replace( r3, ' ' );
}

// ------------------------------------
function em_ch( obj ) {
	if ( !obj ) { return false; }

	var ch = /^[._a-z0-9-]+@[.a-z0-9-]+\.[a-z]{2,4}$/i;

	if ( !ch.test( obj.value ) ) { return false; }

	return true;
}