﻿function isNumberKey(evt)
{
    var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57)) return false;
	return true;
}

function dropdowndoboz(ez) { 
  var status = document.getElementById(ez).style.display; 
  if (status == 'none') { document.getElementById(ez).style.display = "block"; } 
                   else { document.getElementById(ez).style.display = 'none'; } 
} 


function markaClick(ez, az) {

if (document.getElementById('Markak').value=="Kattintson ide, ha csak bizonyos márkák érdeklik!")
{
document.getElementById('Markak').value="";
};

  if (document.getElementById("mcb_"+ez).checked==true){
  document.getElementById('Markak').value=document.getElementById('Markak').value+az+", ";
  dropdowndoboz("TipusDoboz_"+ez);
  };
  
  if (document.getElementById("mcb_"+ez).checked==false){
  str=document.getElementById('Markak').value;
  document.getElementById('Markak').value=str.replace(az+", ", "");
  dropdowndoboz("TipusDoboz_"+ez);
  };  
} 


function tipusSelect(ez) {
 document.getElementById(ez).checked=true;
} 

function tipusDeselect(ez) {
 document.getElementById(ez).checked=false;
} 




function almenu(ez, ekkora)
{
 if (document.getElementById(ez).style.height=="1px") { document.getElementById(ez).style.height=ekkora+"px"; document.getElementById(ez).style.visibility="visible";}
 else                                                 { document.getElementById(ez).style.height=1+"px";      document.getElementById(ez).style.visibility="hidden"; }; 
};






function sendmail(ez, jarm)
{
	if (jarm=="auto") {path="jarm_auto";};
	if (jarm=="motor"){path="jarm_motor";};
	var load = window.open(path+'/send_mail.php?id='+ez+'&jarm='+jarm,'','scrollbars=yes,menubar=no,height=700,width=600,resizable=no,toolbar=no,location=no,status=no');
};











function galeria_pic(ez)
{
 document.getElementById('galfokep').src=ez;
};

function galeria_popup(ez, jarm)
{
	if (jarm=="auto") {path="jarm_auto";};
	if (jarm=="motor"){path="jarm_motor";};
	var load = window.open(path+'/gal_popup.php?id='+ez,'','scrollbars=yes,menubar=no,height=750,width=900,resizable=no,toolbar=no,location=no,status=no');
};

function showpic(ez,x,y)
{
var load = window.open(ez,'','scrollbars=yes,menubar=no,width='+x+',height='+y+',resizable=no,toolbar=no,location=no,status=no');
};



function galeria_popup_pic(ez, dimenzio)
{

	 document.getElementById('galfokep').src=ez;
	 
	 if (dimenzio=="allo")
	 {
		 document.getElementById('galfokep').style.height='95%';
		 document.getElementById('galfokep').style.width ='auto';
	 }
	 else
	 {
		 document.getElementById('galfokep').style.height='auto';
		 document.getElementById('galfokep').style.width ='95%';
	 }; 
};




function show_map(jarm, cim)
{
var load = window.open('map.php?jarm='+jarm+'&cim='+cim,'','scrollbars=yes,menubar=no,height=500,width=500,resizable=no,toolbar=no,location=no,status=no');
};



function terkepload(ez, cim)
{
 document.getElementById(ez).src=cim;
};


function setpass()
{
var load = window.open('setpass.php','','scrollbars=yes,menubar=no,height=270,width=500,resizable=no,toolbar=no,location=no,status=no');
};


function help(ez)
{
tooltip_show();
};

function show_text(id, oldal)
{
var load = window.open('show_text.php?id='+id+'&oldal='+oldal,'','scrollbars=yes,menubar=no,height=700,width=900,resizable=no,toolbar=no,location=no,status=no');
};

function tooltip_show()
{
   document.getElementById('tooltip_text').style.visibility="visible";
   document.getElementById('tooltip_lany').style.visibility="visible";
   document.getElementById('tooltip_show').style.visibility="hidden";
};


function tooltip_hide()
{
   document.getElementById('tooltip_text').style.visibility="hidden";
   document.getElementById('tooltip_lany').style.visibility="hidden";
   document.getElementById('tooltip_show').style.visibility="visible";  
};



function megye(ez)
{
 if (document.getElementById(ez).checked==false){
 document.getElementById(ez+'pic').src='pic/terkep/'+ez+'2.png';
 document.getElementById(ez).checked=true;}
 else{
 document.getElementById(ez+'pic').src='pic/terkep/'+ez+'1.png';
 document.getElementById(ez).checked=false;}; 
};



function megye2()
{
 var chb = document.getElementsByTagName('input'); 
 for(i=0;i<chb.length;i++){

   if (chb[i].className=='terkepchb'){
	   if (chb[i].checked==true) {  document.getElementById(chb[i].id+'pic').src='pic/terkep/'+chb[i].id+'2.png';	 }
	   else                      {  document.getElementById(chb[i].id+'pic').src='pic/terkep/'+chb[i].id+'1.png';	 };
	 };
 }; 
};


function megye3(lista)
{
 var megyelista = lista.split(","); 
 var chb = document.getElementsByTagName('input');
 
 for(i=0;i<chb.length;i++){
   if (chb[i].className=='terkepchb'){
    chb[i].checked=false;
	document.getElementById(chb[i].id+'pic').src='pic/terkep/'+chb[i].id+'1.png';
   };
 };

 for(i=0;i<megyelista.length;i++){
    document.getElementById(megyelista[i]).checked=true;
	document.getElementById(megyelista[i]+'pic').src='pic/terkep/'+megyelista[i]+'2.png';
 };
 
};


