var removeFriendOnShow = function(hash){
	removeFriendDialogResult = false;
	hash.w.show();
}
var removeFriendOnHide = function(hash){
	hash.w.hide();
	hash.o.remove();
	if(removeFriendDialogResult == true)
      document.location.href=removeFriendURL;
}

$(document).ready(function(){
	var lHeight = $('div.basicdatabox')
	var rHeight = $('div.optionsbox')
	if(lHeight.length > 0 && rHeight.length > 0)
	{
		if(lHeight[0].offsetHeight > rHeight[0].offsetHeight)
		{
			$('div.optionsbox').css('height', (lHeight[0].offsetHeight-20)+'px')
		}
		else if(lHeight[0].offsetHeight < rHeight[0].offsetHeight)
		{
			$('div.basicdatabox').css('height', (rHeight[0].offsetHeight-20)+'px')
		}
	}
	$('#webpages_roller').toggle(
		function(){
			$(this).attr('src', $(this).attr('src').replace(/arrow_4/gi, 'arrow_5'))
			$('#webpages').hide('slow')
		},
		function(){
			$(this).attr('src', $(this).attr('src').replace(/arrow_5/gi, 'arrow_4'))
			$('#webpages').show('slow')
		})
	$('#removeFriendDialog').jqm({modal:true,onShow:removeFriendOnShow,onHide:removeFriendOnHide});
	$('#removeFromFriendsLink').click(function() { $('#removeFriendDialog').jqmShow() });
	$('#removeYES').click(function(){ removeFriendDialogResult = true; });
	$('#removeNO').click(function(){ removeFriendDialogResult = false; });
})