function cms() {
  
  this.Search = function(url,dId,el) {
    var par = document.getElementById(el).value;
    if (par.length > 2) {
      var qs = encodeURIComponent(par) + "&drzava=" + dId;
      window.location.href = url + qs;
      }
    return false;
  }
  
  this.checkEnter = function(e){
		var cc_;
		if (e && e.which)
		  { e = e; cc_ = e.which; }
		else 
		  { e = event; cc_ = e.keyCode; }
		if(cc_ == 13) {
			return true;
			}
		else { return false; }
  }
  
  this.win = null;
  
  this.openCenteredPopup = function(mypage,myname,w,h,features) {
    if (features=='default')
      features = 'resizable=yes,scrollbars=yes';
    var winl = (screen.width-w)/2;
    var wint = (screen.height-h)/2;
    if (winl < 0) winl = 0;
    if (wint < 0) wint = 0;
    var settings = 'height=' + h + ',';
    settings += 'width=' + w + ',';
    settings += 'top=' + wint + ',';
    settings += 'left=' + winl + ',';
    settings += features;
    this.win = window.open(mypage,myname,settings);
    this.win.window.focus();
    return false;
  }
  
}

var $CMS = new cms();

