/*
Cogumelo v0.2 - INNOTO
Copyright (C) 2009 Innoto Gestión para el Desarrollo Social S.L. <mapinfo@innoto.es>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
USA.


*/

var tabla;
var sections

//
//	Page events
//

// page init
//en public_homepage.tpl


//
//	init table
//
function initPublicTest()
{

  //
  //	Table
  //


  var todos = {'id': '99', 'name': 'Todos los resultados','commands':
			[  				
			 	 {'id': 'searchreset', 'name': '[c]', 'command': 'none'}
	  		]
  };
  
  var supplier1 = {'id': '1', 'name': 'Telefonica','commands':
		[  				
		 	 {'id': 'searchreset', 'name': '[c]', 'command': 'none'}
		]
  };
  
  var supplier2 = {'id': '2', 'name': 'Vodafone','commands':
		[  				
		 	 {'id': 'searchreset', 'name': '[c]', 'command': 'none'}
		]
  };
  
  var supplier3 = {'id': '3', 'name': 'Orange','commands':
		[  				
		 	 {'id': 'searchreset', 'name': '[c]', 'command': 'none'}
		]
  };
  
  var supplier4 = {'id': '4', 'name': 'Tele2','commands':
		[  				
		 	 {'id': 'searchreset', 'name': '[c]', 'command': 'none'}
		]
  };
  var supplier5 = {'id': '5', 'name': 'Ya.com','commands':
		[  				
		 	 {'id': 'searchreset', 'name': '[c]', 'command': 'none'}
		]
  };
  var supplier6 = {'id': '6', 'name': 'Jazztel','commands':
		[  				
		 	 {'id': 'searchreset', 'name': '[c]', 'command': 'none'}
		]
  };
  
  sections = [supplier1, supplier2, supplier3, supplier4, supplier5, supplier6, todos];


  tabla = new Table("testpublic", {
 							url: "index.php?q=table&table=testpublic" , 
 							formUrl: "",  
 							multiselect: false, 
 							find: true,
 							findText: "Buscar por nombre o ciudad...",
	  						showID: false,
	  						nested: true,
 							tabs: sections,
 							execute: ResetObserve,
 							executecmd: 'searchreset'
 						});

}

 function ResetObserve()
 {
	 $('next').innerHTML="&nbsp;&nbsp;&nbsp;";
	 $('prev').innerHTML="&nbsp;&nbsp;&nbsp;";
	 if(Prototype.Browser.IE) {
		 $('command_searchreset').innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
	 }
	 $('command_searchreset').observe('click', function(event) {
		  $('testpublicFind').value = "";
		});
 }


