function applet() {
	
};

applet.prototype.init	= function() { 
  this.getField("_btnSearch").on('click', function(e) { 
    try {
      e.preventDefault();
      var value = as.corex.getModule("applet").getField("_youtubeQuery").get("value");
      if (value) {
        value = value.replace(/ /gi, "-");
        value = value.replace(/\//gi, "");
        window.location.href = "/portfolio/youtube-search/"+value+".htm";
      };
    } catch(e) {
      as.logs.addError("applet.js", "Error on search. "+e);
    };
  });
  
  try {
    this.topPageObj = this.add(new pagination(), this.getField("_divTopPagination"), null, this, _pagination);
    this.topPageObj.handlePagination = this.handlePagination;
    this.topPageObj.setCSS("paginationCSS");
    this.topPageObj.render();
    
    this.botPageObj = this.add(new pagination(), this.getField("_divBottomPagination"), null, this, _pagination);
    this.botPageObj.handlePagination = this.handlePagination;
    this.botPageObj.setCSS("paginationCSS");
    this.botPageObj.render();
  } catch(e) {
    as.logs.addError(this.getFilename(), "'init' "+e);
  };  	
};

applet.prototype.handlePagination = function(params) {
  return "/portfolio/youtube/"+params.page+".htm";
};