﻿/*
 * Global Scripts
 */
function toggleDisplay(item) {
	jQuery(item).toggle();
}

function targetBlank(url) {
	blankWin = window.open(url, '_blank', 'menubar=yes,toolbar=yes,location=yes,directories=yes,fullscreen=no,titlebar=yes,hotkeys=yes,status=yes,scrollbars=yes,resizable=yes');
}

function countFieldText(textarea, counter, max) {
	textarea = document.getElementById(textarea);
	counter = document.getElementById(counter);

	var content = textarea.value;
	if (content.length > max) {
		content = content.substring(0, (max));
		textarea.value = content;
	}

	var text = document.createTextNode(max - content.length);
	if (counter.hasChildNodes()) {
		counter.removeChild(counter.firstChild);
	}
	counter.appendChild(text);
}

