function append_identity_url(url){$('#id_identity_url').val(url);return false;}
function __open_google_apps(){$('a.openid-server').hide();$('a#google-apps').show();
$('div.own-openid:visible').hide();$('#id_chosen_endpoint').val('google-apps');
$('a#all-options').show();$('#openid-domain:hidden').show();
$('#more-options-toggle').hide();if(!$('#id_domain').val()){$('#id_domain')[0].focus();}}
function __open_own_openid(){$('a.openid-server').hide();$('#openid-domain:visible').hide();
$('a#own-openid').show();$('div.own-openid:hidden').show();
$('div.own-openid input.openid-identifier').focus();$('#id_chosen_endpoint').val('own-openid');
$('a#all-options').show();}
$(function(){$('a.openid-server').not('.default').hide();$('a.openid-username-server').each(function(i,e) {$(this).click(function(){$('#id_identity_url').val($(this).attr('href'));$(this).parents('form').trigger('submit');
return false;});});$('a#all-options').click(function(){$(this).hide();$('div.own-openid:visible').hide();
$('a.openid-server:hidden').show();$('#id_chosen_endpoint').val('');
return false;});
$('a#own-openid').click(function(){__open_own_openid();return false;});
$('a#google-apps').click(function(){__open_google_apps();return false;});if($('.default').size() && $('.default').attr('id')=='google-apps'){__open_google_apps();}
$('#openid-form').submit(function(){if($('#openid-domain:visible').size()){if(!$('#id_domain').val()) {alert("Please enter your Google Apps domain name");$('#id_domain')[0].focus();
return false;}}if($('.own-openid:visible').size()){if(!$('#id_identity_url').val()) {alert("Please enter your OpenID URL");$('#id_identity_url').focus();
return false;}}
return true;});   
$('#more-options-toggle').click(function(){$(this).hide();$('.manual-openid').show();
$('a.openid-server, a.openid-username-server').not('.default').show();$('#openid-domain').hide();
return false;});});
