
Drupal.user_relationships_ui={};if(Drupal.jsEnabled){$(document).ready(function(){$('a.user_relationships_popup_link').click(function(e){var buttoncode=e.which?e.which:e.button;position=Drupal.settings.user_relationships_ui.position.position;left=Drupal.settings.user_relationships_ui.position.left;xtop=Drupal.settings.user_relationships_ui.position.top;if(position=="fixed"){if(left<=1){left=Math.round(($(window).width()*left)-($("#user_relationships_popup_form").width()/2));}
if(xtop<=1){xtop=Math.round(($(window).height()*xtop));}}else{left=(e.pageX?e.pageX:e.clientX)+Number(left);if(left+$("#user_relationships_popup_form").width()>$(window).width()){left=(e.pageX?e.pageX:e.clientX)-$("#user_relationships_popup_form").width();}
xtop=(e.pageY?e.pageY:e.clientY)+Number(xtop);}
var href=$(this).attr('href');Drupal.user_relationships_ui.showForm(href,position,left,xtop);return false;});});}
Drupal.user_relationships_ui.showForm=function(href,position,left,top){Drupal.user_relationships_ui.hidePopup();$('#user_relationships_popup_form').css({top:top+'px',left:left+'px',position:position}).html(Drupal.user_relationships_ui.loadingAnimation()).slideDown();if(href.indexOf('?')==-1){href+='?';};href+='&ajax=1';$.get(href,function(result){$('#user_relationships_popup_form').html(result).slideDown();$('#user_relationships_popup_form a').click(function(){Drupal.user_relationships_ui.hidePopup();return false;});Drupal.user_relationships_ui.formCheck();});};Drupal.user_relationships_ui.loadingAnimation=function(){var html='<div>';html+='<div style="text-align: center; font-weight: bold;">';html+=Drupal.t('Form Loading');html+='</div>';html+='<img src="'+Drupal.settings.user_relationships_ui['loadingimage']+'" border="0" height="20" width="200" />';html+='</div>';return html;}
Drupal.user_relationships_ui.hidePopup=function(){$('#user_relationships_popup_form').slideUp();}
Drupal.user_relationships_ui.formCheck=function(){var forms=$("#user_relationships_popup_form #edit-submit");$('<div id="user_relationships_popup_form_saving"><p class="user_relationships_popup_form_saving">'+Drupal.t('Saving...')+'</p></div>').insertAfter(forms);forms.click(function(){$(this).siblings("input[type=submit]").hide();$(this).hide();$("#user_relationships_popup_form_saving").show();var notice=function(){$('<p id="user_relationships_popup_form_saving_notice">'+Drupal.t('Not saving? Please wait a few seconds, reload this page, and try again.')+'</p>').appendTo("#user_relationships_popup_form_saving").fadeIn();};setTimeout(notice,60000);});};$(document).ready(function(){$('#edit-is-oneway').click(function(){if($('#edit-is-oneway').attr('checked')){$('#edit-is-reciprocal-wrapper').slideDown('slow');}
else{$('#edit-is-reciprocal-wrapper').slideUp('slow');}});if(!$('#edit-is-oneway').attr('checked')){$('#edit-is-reciprocal-wrapper').hide();}});