var activeinput;
function showNewQuestionForm(){
	var link;
	var form;
	link = document.getElementById('acreateq');
	link.id = 'hide';
	form = document.getElementById('hide_form');
	form.id = 'show_form';
}
function changeInputStyle(id){
	var input;
	input = document.getElementById(id);
	if(input.value == "*"){		
		input.value = "";
		input.style.color = "";
	}
	input.style.borderBottom = '1px solid #2F2F2F';
	input.style.borderRight = '1px solid #2F2F2F';
	if(activeinput){
		if(activeinput != input){
			activeinput.style.borderBottom = '';
			activeinput.style.borderRight = '';
		}
	}
	activeinput = input;
}
function markUnfilledFields(id){
	document.getElementById(id).style.color = "#BF4747";
	document.getElementById(id).value = "*";
}
function checkSubmitInfo(fieldsIds){
	var fieldid = fieldsIds.split(";");
	var filled = true;
	for(i=0; i< fieldid.length; i++){	
		if(fieldid[i].search("email") > -1){
			if(document.getElementById(fieldid[i]).value.length < 7){
				markUnfilledFields(fieldid[i]);
				filled = false;
			}			
		}
		if(fieldid[i].search("name") > -1){
			if(document.getElementById(fieldid[i]).value.length < 2){
				markUnfilledFields(fieldid[i]);
				filled = false;
			}			
		}
		if(fieldid[i].search("question") > -1){
			if(document.getElementById(fieldid[i]).value.length < 10){
				markUnfilledFields(fieldid[i]);
				filled = false;
			}			
		}
	}
	if(filled){
		return true;
	}
	document.getElementById("forum_error").style.display = "block";
	return false;
}
