<!--

var inline_call_cb = {
    scope    : this,
    success  : call_succ,
    failure  : call_fail,
    argument : null
}

var calling_element; 

function call_succ(o){
    var argu = o.argument;
    for(i=0;i<calling_element.length;i++){
        calling_element[i].innerHTML = o.responseText;
    }

}

function call_fail(o){
    for(i=0;i<calling_element.length;i++){
        calling_element[i].innerHTML = '发送错误';
    }
}

function doInlineCall(e,type,para1,para2){
    calling_element = document.getElementsByName(e);
    var url;
    if (type == 'hi'){
        url = '/common/inlinecall.php?type=' + type + '&hi_user=' + para1;
    }else if (type == 'invite_group'){
        url = '/common/inlinecall.php?type=' + type + '&invite_user=' + para1 + '&gid=' + para2;
    }else if (type == 'iLove'){
        url = '/promo/travel/dingajax.php?divtype=' + e + "&photoid=" + para1;
    }else if (type == 'iLoveding'){
        url = '/promo/travel2/dingajax.php?divtype=' + e + "&photoid=" + para1;
    }else if (type == 'iLoveSweetie'){
        url = '/promo/sweetie/dingajax.php?divtype=' + e + "&photoid=" + para1;
    }else if (type == 'iLoveSweetie2010'){
        url = '/promo/sweetie2010/dingajax.php?divtype=' + e + "&photoid=" + para1;
    }else if (type == 'iLoveHairShow'){
        url = '/promo/hairshow/dingajax.php?divtype=' + e + "&photoid=" + para1;
    }else if (type == 'iLoveMD'){
        url = '/promo/mothersday/dingajax.php?divtype=' + e + "&photoid=" + para1;
    }else if (type == 'iLovestreetsnap'){
        url = '/promo/streetsnap/dingajax.php?divtype=' + e + "&photoid=" + para1;
    }else if (type == 'myphoto_setAsFace'){
        url = '/common/inlinecall.php?type=' + type + '&aid=' + para1 + '&pid=' + para2;
    }else if (type == 'groupphoto_setAsFace'){
        url = '/common/inlinecall.php?type=' + type + '&aid=' + para1 + '&pid=' + para2;
    }else if (type == "love"){
        url = '/common/inlinecall.php?type=' + type + '&did=' + para1 + '&action=' + para2;
    }else if (type == "grp_join"){
        url = '/common/inlinecall.php?type=' + type + '&gid=' + para1 + '&action=' + para2;
    }else if (type == "groupinvite"){
        url = '/common/inlinecall.php?type=' + type + '&gid=' + para1 + '&uid=' + para2;
    }else if(type == "user_again"){
        url = '/common/inlinecall.php?type=' + type + '&gid=' + para1;
    }else if(type == "group_again"){
        url = '/common/inlinecall.php?type=' + type + '&gid=' + para1;
    }else if (type == "user_join"){
        url = '/common/inlinecall.php?type=' + type + '&gid=' + para1 + '&action=' + para2;
    }else if (type == "verifyemail"){
        url = '/common/inlinecall.php?type=' + type;
    }else if (type == "will"){
        url = '/common/inlinecall.php?type=' + type + '&wid=' + para1 + '&action=' + para2;
    }else if (type == "replybook"){
        
        var now=new Date(); 

        var number = now.getSeconds()%43; 
        url = '/common/inlinecall.php?type=' + type + '&pid=' + para1+'&r='+number;
    }else if(type == "journal"){
        url = '/common/inlinecall.php?type='+ type + '&content=' +para1 +'&action=' + para2;
    }else if (type == "newsletter"){
        url = '/admin/newsletter.php?a='+para1+'&id='+para2;
    }else if (type == 'reply_hi'){
        url = '/common/inlinecall.php?type=' + type + '&pid=' + para1;
    }else if(type == 'editmvalbum') {
        url = '/common/inlinecall.php?type=' + type + 'aid=' +para1;
    }else if (type == "myfav_form"){
        url = '/common/inlinecall.php?type=' + type + '&item_user=' + para1 + '&action=' + para2;
    }else if (type=='share'){
        url = '/common/inlinecall.php?type='+type+'&kind=' + para1 + '&uid=' + para2;
    }else if (type == "home_share" || type == "home_reply" || type == "notice_and_reply" || type == "system_notice"){
        url = '/common/inlinecall.php?type=' + type + '&uid=' + para1 + '&pg=' + para2;
    }else if (type == "newlook"){
        url = '/common/inlinecall.php?type=' + type + '&c=' + para1 + '&d=' + para2;
    }else if (type == "fetchknowledge"){
        url = '/common/inlinecall.php?type=' + type + '&q=' + para1 + '&p=' + para2;
    }else if (type == "questionicon"){
        url = '/common/inlinecall.php?type=' + type + '&uid=' + para1 + '&p=' + para2;
    }else if (type == "calc_userstats"){
        url = '/admin/system_notice.php?view=calc&fc='+para1+'&rt='+para2;
    }else if (type == "huggies_egg" ){
        url = '/common/inlinecall.php?type=huggies_egg&uid='+para1;
    }else if (type =="privacy_set"){
        url = '/user/myphoto/inphotocall.php?type=' + type + '&aid=' + para1 + '&uid=' + para2;
    }
    url = url + '&rand=' + Math.round(Math.random()*2147483647);
    var conn = connectMgr.asyncRequest('GET',url, inline_call_cb, null);
    return false;

}

 function doPhotoList(e,type,para1,para2,para3){
    calling_element = document.getElementsByName(e);
    if (type =="video_list"){
        url = '/common/photolistcall.php?type=' + type + '&uid=' + para1 + '&start=' + para2 + '&vid=' + para3;
    }else if (type =="photo_list"){
        url = '/common/photolistcall.php?type=' + type + '&uid=' + para1 + '&start=' + para2 + '&pid=' + para3;
    }else if (type =="mv_list"){
        url = '/common/photolistcall.php?type=' + type + '&uid=' + para1 + '&start=' + para2 + '&mid=' + para3;
    }else if (type =="album_list"){
        url = '/common/photolistcall.php?type=' + type + '&uid=' + para1 + '&start=' + para2 + '&aid=' + para3;
    }

 
    url = url + '&rand=' + Math.round(Math.random()*2147483647);
    var conn = connectMgr.asyncRequest('GET',url, inline_call_cb, null);
    return false;

}
