// JavaScript Document
function filter_num(e)
{
	
	ev=window.event || e;
	kc=ev.keyCode;
	if((kc>47 && kc<58) ||(kc>95 && kc<106) || kc==8 || kc==9 || kc==37 || kc==46 || kc==190 ){
		retval=true;
	}else{
		retval=false;
	}
	
	return retval ;
}

function textCounter(fieldid, maxlimit,use_counter) {
	temp=document.getElementById("optiontext_" + fieldid);
	if(use_counter==false){
		if(temp.value.length==maxlimit){
			grabthumb(fieldid,temp.value);
		}else if(temp.value.length<maxlimit){
			document.getElementById('th_option_'+fieldid).src='';
		}
	}else{
	//alert(document.form1.elements["optiontext_" + fieldid].value);
		if (temp.value.length > maxlimit) { // if too long...trim it!
			temp.value = temp.value.substring(0, maxlimit); // otherwise, update 'characters left' counter
		}else{
			document.getElementById("countfield_" + fieldid).innerHTML = (maxlimit - temp.value.length) +"&nbsp;Chars&nbsp;left";
		}
	}
}

function grabthumb(fid,value){
	document.getElementById('th_option_'+fid).src="http://www.dakotacollectibles.com/images/items_th/"+value+'.jpg';
}

