jQuery(document).ready(function($) { $('a[rel*=facebox]').facebox(); /** autocompleters **/ $('#team_1').autocomplete('/ajax_responser.php?action=getTeamsMatch', { matchContains: true, minChars: 2, resultsClass: "ac_team_results", formatItem: function(row, i, max) { return '
' + row[0] + '
' + row[2] + '
'; } }); $('#team_1').result(function(event, data, formatted){ $('#team_id').attr('value',data[1]); document.location.href = '/photos.php?t='+ $('#team_id').attr('value'); return true; }); $('#team_1').ready(function(){ if( $('#team_id').attr('value')==0 ){ $('#team_id').attr('value',0); $('#team_1').addClass('team_blank'); $('#team_1').attr('value', 'Escriba una parte del nombre del equipo'); } }); $('#team_1').blur(function(){ if( $('#team_id').attr('value')==0 ){ $('#team_id').attr('value',0); $('#team_1').addClass('team_blank'); $('#team_1').attr('value', 'Escriba una parte del nombre del equipo'); } }); $('#team_1').focus(function(){ $('#team_id').attr('value',0); $('#team_1').removeClass('team_blank'); $('#team_1').attr('value', ''); }); $('.add').click(function(){ tid = $(this).attr('t'); document.location.href = "/add_photos.php?t=" + tid; }); })