<!--
	function previewImage(fileInfo) {
		var filename = "";
		if (fileInfo == null) {
			if (document.form1.file != "") {
				filename = "file:///" + document.form1.file.value;}
		} 
		else {
			filename = fileInfo;}
		if (filename == "") {
			document.fVC.tbxFile.focus();} 
		else {
			var fileExtension = filename.substring(filename.lastIndexOf(".")+1);
			if (fileExtension == "jpg" || fileExtension == "jpeg" || fileExtension == "gif" || fileExtension == "png")
				document.getElementById('ImageContainer').innerHTML = "<img  name='imgPhoto' id='imgPhoto' border='0' width='50' height='50' src='" + filename + "' />";
			else
				document.getElementById('ImageContainer').innerHTML = "<a href='" + filename + "'>" + filename + "</a>";}
	}
	
	function countCheck(frm)
	{
		var checkCount = 0;
		for (i=0; i<frm.length; i++){
			if (frm.elements[i].name.indexOf("chk") !=-1){
				if(frm.elements[i].checked){
					checkCount++;
				}
			}
		}
		if (checkCount>1){
			frm.rdo4.disabled = true;
			frm.rdo4.checked = false;
			if (checkCount>10){
				frm.rdo3.disabled = true;
				frm.rdo3.checked = false;
			}
			else{
				frm.rdo3.disabled = false;
			}
			
		}
		else{
			frm.rdo4.disabled = false;
		}
		// total consolation
		var totalConsolation = parseInt(frm.tbxConsolationTotal.value);
		if(frm.rdo3.checked&&((totalConsolation+checkCount)>10))
		{
			//DEBUG
			//alert(totalConsolation+checkCount);
			alert('Consolatin prize exceed limits (10)');
			frm.rdo3.checked = false;
		}
	} 
	
	function OpenWindow(img)
	{
		popup = window.open('', 'imagePreview', 'width=640,height=480,left=0,top=0,screenX=100,screenY=100,scrollbars,resizable=1');
		popup.document.writeln("<html><body bgcolor='#FFFFFF'>");
		popup.document.writeln("<img src='~imgdb/" + img + "'>");
		popup.document.writeln("</body></html>");
		popup.document.close();
		popup.focus();
		
	}
	
	function CheckWinner()
	{
		var grandPrizeCount = document.fVC.tbxGrandPrize.value;
		if (grandPrizeCount!=0&&document.fVC.rdo4.checked)
		{
			if(confirm("Grand prize winner already selected. Do you still want to replace?"))
			{
				document.fVC.submit();
			}
			else
			{
				document.fVC.tbxGrandPrize.value = "-1";
				return;
			}
		}
	}

function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=850,height=400,scrollbars=yes');
return false;
}

-->