
function showMoreInfoReg(button) {
	$('MoreInfo').style.display = 'block';
	$('SubmitShortForm').style.display = 'none';
	$('fullview').value = 1;
	if (button) button.style.display = 'none'; 
	return false;
}

function showCommunicatorFileds() {
	var x = $('c_2_name').value;
	if (x != '') {
		$('c_2_name').style.display = 'inline';
		$('c_2_slash').style.display = 'inline';
		$('c_2_id').style.display = 'inline';
		$('c_2_button').style.display = 'inline';
	}		
	x = $('c_3_name').value;
	if (x != '') {
		$('c_3_name').style.display = 'inline';
		$('c_3_slash').style.display = 'inline';
		$('c_3_id').style.display = 'inline';
		$('c_3_button').style.display = 'inline';
	}		
	x = $('c_4_name').value;
	if (x != '') {
		$('c_4_name').style.display = 'inline';
		$('c_4_slash').style.display = 'inline';
		$('c_4_id').style.display = 'inline';
		$('c_4_button').style.display = 'inline';
	}
}

function addNextCommunicator(button) {
	
	var showed = false;
	
	var x = $('c_2_name').style.display;
	var y = $('c_3_name').style.display;
	var z = $('c_4_name').style.display;
	
	if (x == 'none' || x == '') {
		$('c_2_name').style.display = 'inline';
		$('c_2_slash').style.display = 'inline';
		$('c_2_id').style.display = 'inline';
		$('c_2_button').style.display = 'inline';	
		showed = true;
	}	
	
	if ((y == 'none' || y == '') && !showed ) {
		$('c_3_name').style.display = 'inline';
		$('c_3_slash').style.display = 'inline';
		$('c_3_id').style.display = 'inline';
		$('c_3_button').style.display = 'inline';
		showed = true;		
	}	
	
	if ((z == 'none' || z == '') && !showed ) {
		$('c_4_name').style.display = 'inline';
		$('c_4_slash').style.display = 'inline';
		$('c_4_id').style.display = 'inline';
		$('c_4_button').style.display = 'inline';	
		showed = true;	
	}
	
	x = $('c_2_name').style.display;
	y = $('c_3_name').style.display;
	z = $('c_4_name').style.display;
	
	if (x == 'inline' && y == 'inline' && z == 'inline') button.style.display = 'none';	
	return false;
}

function deleteCommunicator(n) {
		$('c_'+n+'_name').style.display = 'none';
		$('c_'+n+'_slash').style.display = 'none';
		$('c_'+n+'_id').style.display = 'none';

		$('c_'+n+'_name').value = '';
		$('c_'+n+'_slash').value = '';
		$('c_'+n+'_id').value = '';
		
		$('c_'+n+'_button').style.display = 'none';
		
		$('addNextComm').style.display = 'inline';
		return false;
}
/* standard small functions */
function $m(quem){
 return document.getElementById(quem)
}
function remove(quem){
 quem.parentNode.removeChild(quem);
}
function addEvent(obj, evType, fn){
 // elcio.com.br/crossbrowser
    if (obj.addEventListener)
        obj.addEventListener(evType, fn, true)
    if (obj.attachEvent)
        obj.attachEvent("on"+evType, fn)
}
function removeEvent( obj, type, fn ) {
  if ( obj.detachEvent ) {
    obj.detachEvent( 'on'+type, fn );
  } else {
    obj.removeEventListener( type, fn, false ); }
} 

function submitRegForm(formId, action) {
	$(formId).action = action; 
	$(formId).target = '';
	$(formId).submit();	
}
