 function ofotert_popup(URL,popW, popH, scroll) {
  var winleft = (screen.width - popW) / 2;
  var winUp = (screen.height - popH) / 2;
  winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+'';
  return window.open(URL,'', winProp);
 }

 function ofotert_kerdoiv() {
  var popup_kerdoiv = ofotert_popup('http://adlin.fotex-optika.hu/scripts/wgate/zkerdoiv001_46/!',780,600,'yes');
  if (!popup_kerdoiv) { alert('Kérjük kapcsolja ki a felugró ablakok szűrését.'); }
 }

 var icfsmax=14;
 var icfsmin=11;
 var cevents=0;

 var search = 0;
 function chmenu(num){  t1 = new Tween(afmenu.style,'top',Tween.regularEaseInOut,initpos,-23*num,1,'px');  initpos=-23*num;  t1.start(); }
 function toggle_search(){  if (search==0) { t2 = new Tween(headersearch.style,'top',Tween.regularEaseInOut,-35,35,1,'px');  t2.start(); search=1; } else { t3 = new Tween(headersearch.style,'top',Tween.regularEaseInOut,35,-35,1,'px');  t3.start(); search=0;  } }


 function icfs(d){
  if ((d=='m') & (icfss>icfsmin)) { icfss--; }
  if ((d=='p') & (icfss<icfsmax)) { icfss++; }
  ic.className='icfs'+icfss;
  cevents++;
  ictsave=setTimeout("ofotert_setting_icfs()",2500);
 }

 function ofotert_setting_icfs(){
  cevents--;
  if (cevents==0){
   ofotert_setting_save('ICFS',icfss);
  }
  clearTimeout(ictsave);
 }

 function ofotert_setting_save(parname,parvalue){
    var ajaxRequest;
        try{
                ajaxRequest = new XMLHttpRequest();
        } catch (e){
                try{
                        ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
                } catch (e) {
                        try{
                                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
                        } catch (e){
                                alert("AJAX error");
                                return false;
                        }
                }
        }
        ajaxRequest.open("GET", "index.php?ajax_save="+parname+"&value="+parvalue, true);
        ajaxRequest.send(null);
 }

