function NW(mypage, myname, w, h) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes';
win = window.open(mypage, myname, winprops);
win.window.focus();
}




function Window_Open(windowName, URL, targetName, windowWidth, windowHeight, windowFeatures)	{
	str = 'width=' + windowWidth + ',height=' + windowHeight;
	str = str + ",";
	str = str + "left=" + (screen.width / 2 - windowWidth / 2) + ",top=" + (screen.height / 2 - windowHeight / 2 - 40);
	if (windowFeatures != null)
		str = str + ",";
	windowFeatures = str + ", status=yes";
	//windowFeatures = str + windowFeatures;
	eval(windowName + "=window.open('" + URL + "','" + targetName + "','" + windowFeatures + "')");
//	eval(windowName + "=window.open('" + URL + "','" + targetName + "')");
}





  function check_city(){

    var cities = new Array (-1, 68134, 56784, 10135, 63427, 10447);
    var objSelect = document.getElementById('rest_city_list');
    var objDiv = document.getElementById('kriterii');
    var objBel = document.getElementById('belejka');
    var formS = document.getElementById('search_by_cities');
    
    var f = false;
    
    for (i=0; i<cities.length; i++) {
      if (objSelect.value == cities[i]) {
        f = true;
        break;
      }
    }

    if (f == true) { 
      objDiv.style.display="inline"; 
      objBel.style.display="none";
//      alert ('tuk e')
      formS.target  = "_self";
      formS.action  = "";
      formS.submit();
    }
    else { objDiv.style.display="none"; objBel.style.display="inline";}
    return true;
  }

  

  function search(form_name){
    var formS = document.getElementById(form_name);
    formS.action  = "";
    formS.target  = "_top";
    formS.submit();
  }

  
  
  function tab_move (tab_sel, tab_move) {
    otab_sel = document.getElementById (tab_sel);
    otab_move = document.getElementById (tab_move);
    
    otab_sel.style.display = 'none';
    otab_move.style.display = 'inline';
  }
  
  
  
  function send_data () {
    var f = document.getElementById("Form1");
    var op = window.opener;
    f.submit();
    op.setTimeout("reload()", 2000);
    window.close();
  }
  
  function reload (){
    //var url = "default.aspx?op=profile";
    var url = document.location.href;
    //alert (url);
    window.location = url;
  }
  
  function fnTrapKD(btn, event){
	var c = document.getElementById(btn);
		if (document.all){
			if (event.keyCode == 13){
				event.returnValue=false;
				event.cancel = true;
				c.click();
			}
		}
		else if (document.getElementById){
			if (event.which == 13){
				event.returnValue=false;
				event.cancel = true;
				c.click();
			}
		}
		else if(document.layers){
			if(event.which == 13){
				event.returnValue=false;
				event.cancel = true;
				c.click();
			}
		}
	}
