/*csak számokat fogad el - pl. irszám mező onkeyup eseményben*/
function onlyNumbers(mibe)
{
	x=mibe.value;
	ki="";
    for(i=0;i<x.length;i++)
	{
       	if (x.substr(i,1)>='0' && x.substr(i,1)<='9')
		{
			ki+=x.substr(i,1);
        }
    }
	mibe.value=ki;
};

/*integer and float mező ellenőr*/
function is_numeric(mezonev)
{   
   var data1 = document.getElementById(mezonev).value;
   if ((isNaN(data1)) || (data1.length == 0))
      return false;
   else
      return true;
};

/*mező hosszt ellenőriz*/
function  ellenor(mezo, hossz)
{
	var id = mezo;
	var h = hossz;
	if(document.getElementById(id).value.length<h)
	{
		return false;		 	
	}
	else
	{
		return true;		 
	}
};

/*checkbox ellenőr*/
function is_checkedCheckBox(cb) 
{
	var id = cb;
	if (document.getElementById(id).checked == false )
	{
		//alert ('You didn\'t choose any of the checkboxes!');
		return false;
	}
	else
	{
		return true;
	}
}


/*select ellenőr*/
function checkDropdown(choice) 
{			    
    if (choice == 0) 
	{
     	return false;  
    }
	else
	{
		return true;
	}			
};

/*email ellenőr*/
function checkEmail(emilcim) 
{
	var em = emilcim;
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById(em).value))
	{
		return true;
	}
	else
	{	
		return false;
	}
};


/* mező háttérszínét fehérre - pirosra változtatja*/
function bgcolorWhite(mezo)
{
	var id = mezo;
	document.getElementById(id).style.backgroundColor = "#ffffff";	
};
function bgcolorRed(mezo)
{
	var id = mezo;
	document.getElementById(id).style.backgroundColor = "#ff0000";	
};

function megerosit()
{
	return (confirm("Mentsem a változtatásokat? "));
};

function simplePopUp(file,name,window_width,window_height)
{
	window.open(''+file,name,'resizable,menubar=no,toolbar=no,statusbar=no,scrollbars,height='+window_height+',width='+window_width);
}


function buttonOver(own,imgPath)
{
	own.src = imgPath;
}
