
function openWindow (dcname,url,width,height,blueribbon) {
	height1 = height;
	dcname = window.open('','popupimg','width='+width+',height='+height1+',menubar=no,toolbar=no,nostatus');
	dcname.document.open();
	dcname.document.write('<html><head><title>'+blueribbon+'</title><script language="javascript">function printPage() { print(document); }</script><style type="text/css"><!--body,td,th {font-family: MS Sans Serif, Microsoft Sans Serif, Verdana, Arial;font-size: 12px;color: #FFFFFF;}--></style></head><body marginwidth=0 marginheight=0 topmargin=0 leftmargin=0 bgcolor="#FDF7E4"><a href="JavaScript:void(0);" onClick="window.close();"><img src="'+url+'" border=0 galleryimg="no"></a></body></html>');
	dcname.document.close();
}

function OW(kep) {

	window.open("keret.php?kep="+kep,"","width=300,height=400,screenX=1,screenY=1,top=1,left=1,scrollbars=yes,resizable=yes,menubar=no,toolbar=no,nostatus");

}

function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' nem valós cím.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' nincs kitöltve.\n'; }
    } if (errors) alert('Hiba (ák):\n'+errors);
    document.MM_returnValue = (errors == '');
} }

 function dontes(var2) {
  if (confirm('Kereskedelmi mennyiség ! Kérem vegye fel a kapcsolatot az ügyfélszolgálattal!'))
  {
  	location.href = "index.php";
  	}
  	 else 
	{
   	var2.value = 0;
   }}

function mezoell(var1,var2,var3,var4)
{
	if(var1=="maxnum")
	{
		if(parseInt(var2.value) > var4)
		{
		dontes(var2,var4);
		}
		
		}		
	
}

function osszead(){
	
	var resz_1 = parseFloat(document.getElementById('term_1').value); 
	
	var eredmeny_ossz= resz_1 ;
	
	document.getElementById('eredmeny').innerHTML = "<b>"+eredmeny_ossz+"</b>";
	document.getElementById('eredmeny_inp').value = eredmeny_ossz;
	
	var resz_1_ar = (parseFloat(document.getElementById('term_1_ar').value)*resz_1); 
	
	var eredmeny_forint= resz_1_ar;
	
	document.getElementById('eredmenyforint').innerHTML = "<b>"+eredmeny_forint+"</b>";
	document.getElementById('eredmenyforint_inp').value = eredmeny_forint;
	
	}


