//alert('page is here');

/*
Part of the code for the article "Use Ajax and PHP to Build Your Mailing List"
by Aarron Walter (aarron@aarronwalter.com)
http://www.sitepoint.com/article/use-ajax-php-build-mailing-list
*/

// Attach handler to window load event
Event.observe(window, 'load', init, false);

function init() 
{
	
  // Attach handler to form's submit event
  Event.observe('regUpdate', 'submit', regUpdate);
}
function regUpdate(e) 
{
zip = escape($F('zip'))	 ;
//alert('zip is' +zip);



var pars ='email='+escape($F('email'))+'&password='+ escape($F('password')) +'&address='+ escape($F('address'))+'&city='+ escape($F('city'))+'&state='+ escape($F('state'))+'&player_zip=' + escape($F('zip'))+'&phone=' + escape($F('phone'))+'&e_name='+ escape($F('e_name'))+'&e_phone='+ escape($F('e_phone'))+'&player_residency='+ escape($F('player_residency')) +'&player_id='+ escape($F('player_id')) ;


$('response').innerHTML = '<img src=\"../images/loading.gif\"  />';
//alert('store signup '+pars);
var myAjax = new Ajax.Updater('response', 'put_regUpdate.php', {method: 'get', parameters: pars});
Event.stop(e);

var myAjax = new Ajax.Updater('response', 'put_UpdateTeam.php', {method: 'get', parameters: pars});
Event.stop(e);

}//


/*
function storeOptional(e) 
{


var pars = 'first_name=' + escape($F('first_name')) + '&last_name=' + escape($F('last_name')) + '&address=' + escape($F('address')) + '&city=' + escape($F('city')) + '&state=' + escape($F('state')) + '&zip=' + escape($F('zip')) + '&best_time=' + escape($F('best_time')) + '&how_soon=' + escape($F('how_soon')) + '&phone=' + escape($F('phone')) + '&last_id=' + escape($F('last_id'));
alert('store Optional');
$('response').innerHTML = 'Submitting message ..';

var myAjax = new Ajax.Updater('response', 'put_SignUpFormOptional.php', {method: 'get', parameters: pars});
Event.stop(e);
}
*///