/**
 *  足跡ページ用関数群
 *
 *  Copyright (c) 2005 RedCruise Corporation. All rights reserved.
 */

function getCloseButton(el_name)
{
    return '<div id="closebutton"><a href="javascript:void(0);" onClick="closePopup(\'' + el_name + '\');"><img src="/loglog/img/closebutton.gif" alt="[閉じる]"></a></div>';
}
function previewSwitchSeal(event, from, to, from_image, to_image)
{
    var y = document.all ? document.body.scrollTop : self.pageYOffset;
    y += 200;
    $('switch_block').style.top = y + 'px';
    $('switch_block').style.display = 'block';
    $('switch').innerHTML = getCloseButton('switch_block')
                            + '<div id="switchseal"><img src="' + from_image + '" alt=""><br>↓<br><img src="' + to_image + '" alt="">'
                            + '<input id="changeseal" type="button" onClick="setSwitchSeal(' + from + ', ' + to + ');" value="このシールにチェンジ！"></div>';
}
function closePopup(el_name)
{
    $(el_name).style.display = 'none';
}
function setSwitchSeal(from, to)
{
    var myAjax = new Ajax.Request('/loglog/_setSwitch.php', {method: 'post', postBody: 'from=' + from + '&to=' + to, onComplete: finish});
}
function finish(originalRequest)
{
    $('switch').innerHTML = getCloseButton('switch_block') + originalRequest.responseText;
}
function getMoreAshiato(url)
{
    var myAjax = new Ajax.Request('/loglog/_getMoreAshiato.php', {method: 'get', parameters: 'url=' + url, onComplete: showMoreAshiato});
}
function showMoreAshiato(originalRequest)
{
    $('moreashiato_block').style.display = 'block';
    $('moreashiato').innerHTML = getCloseButton('moreashiato_block') + originalRequest.responseText;
}

