function makeWin(w, h, url, title)
{
	t = (screen.height) ? (screen.height - h) / 2 : 0;
	l = (screen.width) ? (screen.width - w) / 2 : 0;

	var fastWin = window.open('','img-preview','top='+t+',left='+l+',width='+w+',height='+h+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes');

	fastWin.document.write('<html>');
	fastWin.document.write('<head>');
	fastWin.document.write('<meta http-equiv="Content-Type" content="text/html; charset=utf-8">');
	fastWin.document.write('<title>'+title+'</title>');
	fastWin.document.write('</head>');
	fastWin.document.write('<body style="margin: 0; padding: 0; background-color: #fff;">');
	fastWin.document.write('<div>');
	fastWin.document.write('<img src="'+url+'" width="'+w+'" height="'+h+'">');
	fastWin.document.write('</div>');
	fastWin.document.write('</body>');
	fastWin.document.write('</html>');

	fastWin.document.close();
}

function toggleList(obj)
{
	if (document.getElementById)
	{
		var obj = document.getElementById(obj);

		obj.style.display = (obj.style.display == 'none') ? 'block' : 'none';
	}
}

function switchColour(id, val)
{
	var val = val ? val : document.getElementById('color'+id).value;

	document.getElementById('txt-color'+id).style.color = val;
	document.getElementById('chip'+id).style.backgroundColor = val;
}