

function changeCol(BAR_id, col) {
	if (!DHTML) return;
	var x = new getObj(BAR_id);
	x.style.backgroundColor = col;
}

function reload_by_bg_uploader() {
	document.frmESZKOZTAR.fromUPLOADER.value = '1';	
    document.frmESZKOZTAR.submit();
}

function mmssend(klid) {
	window.open("copy_before_send.php?kl_id="+klid,"mmssenderwin","width=640,height=330, resizeable=yes, scrollbars=yes, status=no,toolbar=no,menubar=no,scroll=auto");
}

function elveszik(){
	if (confirm('Ezzel a funkcióval a jelenlegi képeslap elveszik!\nFolytatja?')) {
	document.location.href="fnc_new.php";
	}
}

function bgimageuploadwindow() {
    window.open("upload_bgimage.php","uplwin","width=450,height=200, resizeable=yes, scrollbars=yes, status=no,toolbar=no,menubar=no,scroll=auto");
}
    
function setHatterkep(kep) {
	document.frmESZKOZTAR.kl_bgimage.value = kep;
	document.frmESZKOZTAR.submit();
}

function tovabbClick(){
	if ($("#korzetszam").val().length < 4) {
		$("#korzetszam").css('border', 'solid 1px red');
		$("#korzetszam").effect("pulsate", { times:7 }, 120);
	} else $("#korzetszam").css('border', 'solid 1px green');
	
	if ($("#telefonszam").val().length < 7) {
		$("#telefonszam").css('border', 'solid 1px red');
		$("#telefonszam").effect("pulsate", { times:7 }, 120);
	} else $("#telefonszam").css('border', 'solid 1px green');
	
	if ( ($("#telefonszam").val().length == 7) && ($("#korzetszam").val().length == 4) ) {
		$("#tovabb_button").colorbox({width:"780px", height:"490px", iframe:true, href:"smssender.php?korzetszam="+$("#korzetszam").val()+"&telefonszam="+$("#telefonszam").val()+"&uzenet="+$("#uzenet").val()});
	}
}

function numbersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("0123456789").indexOf(keychar) > -1))
   return true;

// decimal point jump
else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   return false;
   }
else
   return false;
}


function textCounter(field,cntfield,maxlimit) {
	if (field.value.length > maxlimit) 
		field.value = field.value.substring(0, maxlimit);
	else
	cntfield.value = maxlimit - field.value.length;
}
