function confirmButton(msg) 
{
	var agree=confirm(msg);

	if (agree)
		return true;
	else
		return false;
}

function limitChars(textid, limit, infodiv, limitreached)
{

	var text = $('#'+textid).val(); 

	var textlength = text.length;
	
	if(textlength > limit) {
	        $('#' + infodiv).html(limitreached);
		$('#'+textid).val(text.substr(0,limit));
		return false;
	} else {
		$('#' + infodiv).html(textlength + ' / ' + limit);
		return true;
	}
}

function showhidelayer(layer) {

	if (document.getElementById){
		obj = document.getElementById(layer);
		if (obj.style.display == "none"){
			obj.style.display = "";
		} else {
			obj.style.display = "none";
		}
	} 
}

