
//--------------------------------
//********************************
//******** Class search_box ******
//********************************
//--------------------------------


//********************************
//********* Constructors *********
//********************************
function search_box()
{
  
}

function owk_search_box_create(i_parent,i_region,i_visible)
{   
   this.set_parent(i_parent);
   this.ancestor_create(i_region, i_visible, false, false);  
   i_parent.push_back_layer(this);
   this.m_text_box = new text_box();      
}

function owk_search_box_load_patterns(i_url, i_repeat_middle)
{
   var my_search_box = this;
   this.m_background_decorator = new pattern_decorator(); 
   this.m_background_decorator.create(my_search_box);
   this.m_background_decorator.load_hori(i_url,i_repeat_middle); 

   

   var left = this.m_background_decorator.left_size().width;     
   var right = (this.region().size.width - this.m_background_decorator.left_size().width - this.m_background_decorator.right_size().width);
   var top = 6;
   var bottom = this.region().size.height-10;
   
   var rect = new rectangle(left*1,top*1,(left*1+right*1), bottom*1);

   this.m_text_box.create(this, rect, true, "");
   //this.m_text_box.set_font(18);
   var my_searchbox = this;
   //this.m_text_box.on_cancel = function(){my_searchbox.m_text_box.text = ""; var title = my_searchbox.m_text_box.title; my_searchbox.m_text_box.invalidate();my_searchbox.m_text_box.title= title;};
}

function owk_search_box_text_box()
{
   return this.m_text_box;
}

function owk_search_box_on_search()
{

}

search_box.prototype = new layer_group;
search_box.prototype.load_patterns = owk_search_box_load_patterns;
search_box.prototype.create = owk_search_box_create;
search_box.prototype.ancestor_create = owk_layer_create;
search_box.prototype.text_box = owk_search_box_text_box;
