// A function which dims the label of a text input field so that the user 
// sees that he can start typing
function fDimLabels() {
	var sLabelID = fGetLabelID(this.get('id'));
	$(sLabelID).setStyle('color', '#e2dfe3');
}


// A function which completely hides the label of a text input field,
// when a user starts typing in the field
function fHideLabels() {
	if ((this.get('value')).length > 0) {		// Hide the labels
		$(this.get('id')).setStyle('z-index', '67');

		var sLabelID = fGetLabelID(this.get('id'));
		$(sLabelID).setStyle('z-index', '66');
	} else {		// Show the labels
		$(this.get('id')).setStyle('z-index', '66');

		var sLabelID = fGetLabelID(this.get('id'));
		$(sLabelID).setStyle('color', '#e2dfe3');
		$(sLabelID).setStyle('z-index', '67');
	}

	// Check if all input text fields have values
	//fDisplaySubmitBtn();
}


// A function which displays the labels of text input fields on top of them
// when the focus is lost, if the text field has no value
function fShowLabels() {
	if ((this.get('value')).length < 1) {
		$(this.get('id')).setStyle('z-index', '66');
		
		var sLabelID = fGetLabelID(this.get('id'));
		$(sLabelID).setStyle('color', '#bcb9bd');
		$(sLabelID).setStyle('z-index', '67');
	}
}


// A function which returns the ID of the label for a form element
//
// Arguments:
// @sElemID - the ID of an element which shares a label ID save for the prefix
function fGetLabelID(sElemID) {
	return sElemID.replace(/txt/, 'lbl');
}


// A function which checks all of the input text fields and if they
// all have values, displays the submit button; otherwise, it is hidden
//function fDisplaySubmitBtn() {
	//var iCntValues = 0;
//	var oInputFields = $$('input.textbox');
	//for (var iCnt = 0; iCnt < oInputFields.length; iCnt++) {
		//if (oInputFields[iCnt].value != "") { iCntValues++; }
	//}

	// Only if all of the input text fields had values and therefore
	// incremented the counter value to 4, display the submit button
//	if (iCntValues == 4) {
	
	//	$('butSend').setStyle('display', 'inline');
	//} else {
	
	//	$('butSend').setStyle('display', 'none');
//	}
//}

function fShowPageBlogArchive(value1, value2) {
	
	$(value1).setStyle('display', 'block');
	$(value2).setStyle('display', 'none');
	
	$('link_'+value1).className = 'active';
	$('link_'+value2).className = '';
	
}

