// JavaScript Document

// Turn on image caching for IE6 - stops annoying flicker when we fade in / out
try { 
	document.execCommand('BackgroundImageCache', false, true); 
} catch(e) {} 

function limitText(element, limit) {
	if(element.value.length >= limit) {
		element.value = element.value.substring(0, element.value.length - 1);
	}
}

function openPopup(url, name) {
	window.open('popup.html?image=' + url, name,'scrollbars=no,width=480,height=450');
}

function openPreview(element) {
	var text = document.getElementById(element).value
	window.open('preview.html?text=' + text, 'Preview','scrollbars=no,width=480,height=475');
}

