function toggleBlock(expandBlock) {
    var expand = document.getElementById(expandBlock);
    if(expand.style.display == '')
        expand.style.display = 'none';
    else
        expand.style.display = '';
}

function toggleBlockControl(expandBlock, dispFlag) {
    var expand = document.getElementById(expandBlock);
    
    if( dispFlag == 1 || dispFlag == true ) {
      expand.style.display = 'block';
    } else 
    	if( dispFlag == 0 || dispFlag == false ) {
        expand.style.display = 'none';
      }
}

function toggleBlockDisplay( selectValue ) {
	if( selectValue != '' ) { 
		if ( selectValue == '1' ) {
			toggleBlockControl('contact_me_details', 1);
		} else
			if ( selectValue == '0' ) {
				toggleBlockControl('contact_me_details', 0);
				
				document.getElementById('contactme_phone_countrycode').value = "";
				document.getElementById('contactme_phone_areacode').value = "";
				document.getElementById('contactme_phone_number').value = "";
				document.getElementById('contactme_time_from').selectedIndex = 0;
				document.getElementById('contactme_time_to').selectedIndex = 0;
			}
	}
}

function toggleBlockCollapse(expandBlock, collapseBlock) {
  var expand = document.getElementById(expandBlock);
  var collapse = document.getElementById(collapseBlock);
  
  expand.style.display = '';
 	collapse.style.display = 'none';
}


function toggleContactMeDisplay( selectValue ) {
	if( selectValue != '' ) { 
		if ( selectValue == '1' ) {
			toggleBlockControl('contact_me_details', 1);
		} else
			if ( selectValue == '0' ) {
				toggleBlockControl('contact_me_details', 0);
				
				document.getElementById('contactme_time_from').selectedIndex = 0;
				document.getElementById('contactme_time_to').selectedIndex = 0;
			}
	}
}