function ChangeProfPos($prof_id, $direction)
{
    global $session;
    session_start();
    $objResponse = new xajaxResponse();
    if ($prof_id2 = portfolio::ChangeProfOrder($_SESSION['uid'], intval($prof_id), intval($direction))) {
        $script = "can_move = 1;\n\t\twall=document.getElementById('sprof" . $prof_id . "');\n\t\twall2=document.getElementById('sprof" . $prof_id2 . "');\n\t\ticoup1=document.getElementById('icoup" . $prof_id . "');\n\t\ticoup2=document.getElementById('icoup" . $prof_id2 . "');\n\t\ticodn1=document.getElementById('icodn" . $prof_id . "');\n\t\ticodn2=document.getElementById('icodn" . $prof_id2 . "');\n\t\ttmp = icoup1.src;\n\t\ticoup1.src = icoup2.src;\n\t\ticoup2.src = tmp;\n\t\ttmp = icodn1.src;\n\t\ticodn1.src = icodn2.src;\n\t\ticodn2.src = tmp;\n\t\ttmp = wall.innerHTML;\n\t\ttmp2 = wall.className;\n\t\twall.innerHTML = wall2.innerHTML;\n\t\twall2.innerHTML = tmp;\n\t\twall.className = wall2.className;\n\t\twall2.className = tmp2;\n\t\ttmp = wall.id;\n\t\twall.id = wall2.id;\n\t\twall2.id = tmp;\n\t\t";
    } else {
        $script = 'can_move = 1;';
    }
    $objResponse->script($script);
    return $objResponse;
}