( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
$(document).ready(function()
{
function loadingIn()
{
$('.dialog-background').css('display','block') ;
}
function loadingOut()
{
$('.dialog-background').css('display','none') ;
}
// Load More
$('.more').live("click",function()
{
var ID = $(this).attr("id");
if(ID)
{
var myaccount = localStorage.getItem('myaccount');
/*var catalogid5 = $("#catalogid5").val();
var me = $("#me").val();*/
var catalogid5 = myaccount;
var me = myaccount;
$.ajax({
type: "POST",
url: mimiServer+"service/social/loadFriend.php?catalogid5="+catalogid5+"&me="+me+"&action=friend_one",
data: "&lastid="+ ID,
cache: false,
beforeSend: function(){
loadingIn();
},
success: function(html){
$("div#liveupdate").append(html);
$("#more"+ID).remove();loadingOut();
}
});
}
else
{
$("#more").html('The End');// no results
}
return false;
});
// Load More
$('.more2').live("click",function()
{
var ID = $(this).attr("id");
if(ID)
{
var myaccount = localStorage.getItem('myaccount');
/*var catalogid5 = $("#catalogid5").val();
var me = $("#me").val();*/
var catalogid5 = myaccount;
var me = myaccount;
$.ajax({
type: "POST",
url: mimiServer+"service/social/loadFriend.php?catalogid5="+catalogid5+"&me="+me+"&action=friend_one",
data: "&lastid="+ ID,
cache: false,
beforeSend: function(){
loadingIn();
},
success: function(html){
$("div#liveupdate").append(html);
$("#more2"+ID).remove();loadingOut();
}
});
}
else
{
$("#more2").html('The End');// no results
}
return false;
});
// commentopen
$('.searchopen').live("click",function()
{
var ID = $(this).attr("id");
$("#searchbox"+ID).slideToggle('fast');
$("#searcharea"+ID).focus();
$('.header-contX3').css('display', 'block');
$('.header-contX2').css('margin-top', '-100px');
/* $('.header-contX').css('margin-top', '-100px');*/
$('#nav2').css('margin-bottom', '-45px');
$('#slide-menu').css('left', '-100px');
return false;
});
$("#searcharea1").keyup(function()
{
var searchbox = $(this).val();
var dataString = 'searchword='+ searchbox;
var myaccount = localStorage.getItem('myaccount');
if(searchbox.length>2)
{
$.ajax({
type: "POST",
url: mimiServer+"service/social/search_ajax.php?myaccount="+myaccount+"",
data: dataString,
cache: false,
success: function(html)
{
$("#searchme").html(html).show();
}
});
}return false;
});
$("#searchme").mouseup(function()
{
return false
});
$(document).mouseup(function()
{
$('#searchme').hide();
$('#searcharea1').val("");
});
// Add button
$('.addbutton').live('click',function()
{
var vid = $(this).attr("id");
var sid=vid.split("add");
var ID=sid[1];
var dataString = 'fid='+ ID ;
var myaccount = localStorage.getItem('myaccount');
$.ajax({
type: "POST",
url: mimiServer+"service/social/friendadd_ajax.php?myaccount="+myaccount+"",
data: dataString,
cache: false,
beforeSend: function(){$("#friendstatus").html('<img src="service/social/icons/ajaxloader.gif" />'); },
success: function(html)
{
if(html)
{
$("#friendstatus").html('');
$("#add"+ID).hide();
$("#remove"+ID).show();
}
}
});
return false;
});
// Remove Friend
$('.removebutton').live('click',function()
{
var vid = $(this).attr("id");
var sid=vid.split("remove");
var ID=sid[1];
var dataString = 'fid='+ ID ;
var myaccount = localStorage.getItem('myaccount');
$.ajax({
type: "POST",
url: mimiServer+"service/social/friendremove_ajax.php?myaccount="+myaccount+"",
data: dataString,
cache: false,
beforeSend: function(){$("#friendstatus").html('<img src="icons/ajaxloader.gif" />'); },
success: function(html)
{
if(html)
{
$("#remove"+ID).hide();
$("#add"+ID).show();
$("#cfollow-"+ID).slideUp('slow');
$("#cfollow-"+ID).fadeOut(300,function(){$("#stcommentbody"+ID).remove();});
}
}
});
return false;
});
});