//-----------------------------------------------------------------------------

function echo( value )
{
    document.write( value );
}

//-----------------------------------------------------------------------------

function decor_form1_open( width, height )
{
    echo( decor_form1_open_string( width, height ) );
}

function decor_form1_close()
{
    echo( decor_form1_close_string() );
}

function decor_form2_open( width, height )
{
    echo( decor_form2_open_string( width, height ) );
}

function decor_form2_close()
{
    echo( decor_form2_close_string() );
}

function decor_form3_open( width, height )
{
    echo( decor_form3_open_string( width, height ) );
}


function decor_form3_close()
{
    echo( decor_form3_close_string() );
}

//-----------------------------------------------------------------------------

function decor_form1_open_string( width, height )
{
    var str = '';

    echo_width = width ? ' width="' + width + '" ' : ' width="206" ';
    echo_height = height ? ' height="' + height + '" ' : '';
    
    str += '<table cellspacing="0" ' + ' ' + echo_width + ' ' + echo_height + '>';
    str += '<tr>';
    str += '    <td class="f1c1">&nbsp;</td>';
    str += '    <td class="f1c2"><table cellspacing="0" width="100%"><tr><td class="f1dh1">&nbsp;</td><td class="f1dh2">&nbsp;</td></tr></table></td>';
    str += '    <td class="f1c3">&nbsp;</td>';
    str += '</tr>';
    str += '<tr>';
    str += '    <td class="f1c4"><div align="right" style="height:100%"><table cellspacing="0" height="100%"><tr><td class="f1dv1">&nbsp;</td></tr></table></div></td>';
    str += '    <td class="f1c5">';
    
    return str;
}

function decor_form1_close_string()
{
    var str = '';

    str += '</td>';
    str += '    <td class="f1c6"><div align="left" style="height:100%"><table cellspacing="0" height="100%"><tr><td class="f1dv1">&nbsp;</td></tr></table></div></td>';
    str += '</tr>';
    str += '<tr>';
    str += '    <td class="f1c7">&nbsp;</td>';
    str += '    <td class="f1c8"><table cellspacing="0" width="100%"><tr><td class="f1dh1">&nbsp;</td><td class="f1dh2">&nbsp;</td></tr></table></td>';
    str += '    <td class="f1c9">&nbsp;</td>';
    str += '</tr>';
    str += '</table>';
    
    return str;
}

function decor_form2_open_string( width, height )
{
    var str = '';

    echo_width = width ? ' width="' + width + '" ' : '';
    echo_height = height ? ' height="' + height + '" ' : '';

    str += '<table cellspacing="0" ' + ' ' + echo_width + ' ' + echo_height + '>';
    str += '<tr>';
    str += '    <td class="f2c1">&nbsp;</td>';
    str += '    <td class="f2c2">&nbsp;</td>';
    str += '    <td class="f2c3">&nbsp;</td>';
    str += '</tr>';
    str += '<tr>';
    str += '    <td class="f2c4">&nbsp;</td>';
    str += '    <td class="f2c5">';
    
    return str;
}

function decor_form2_close_string()
{
    var str = '';

    str += '</td>';
    str += '    <td class="f2c6">&nbsp;</td>';
    str += '</tr>';
    str += '<tr>';
    str += '    <td class="f2c7">&nbsp;</td>';
    str += '    <td class="f2c8">&nbsp;</td>';
    str += '    <td class="f2c9">&nbsp;</td>';
    str += '</tr>';
    str += '</table>';
    
    return str;
}

function decor_form3_open_string( width, height )
{
    var str = '';

    echo_width = width ? ' width="' + width + '" ' : '';
    echo_height = height ? ' height="' + height + '" ' : '';

    str += '<table cellspacing="0" ' + ' ' + echo_width + ' ' + echo_height + '>';
    str += '<tr>';
    str += '    <td class="f3c1">&nbsp;</td>';
    str += '    <td class="f3c2">&nbsp;</td>';
    str += '    <td class="f3c3">&nbsp;</td>';
    str += '</tr>';
    str += '<tr>';
    str += '    <td class="f3c4">&nbsp;</td>';
    str += '    <td class="f3c5">';
    
    return str;
}

function decor_form3_close_string()
{
    var str = '';

    str += '</td>';
    str += '    <td class="f3c6">&nbsp;</td>';
    str += '</tr>';
    str += '<tr>';
    str += '    <td class="f3c7">&nbsp;</td>';
    str += '    <td class="f3c8">&nbsp;</td>';
    str += '    <td class="f3c9">&nbsp;</td>';
    str += '</tr>';
    str += '</table>';
    
    return str;
}

function menuitem_clicked( menuitem_id )
{
    var menuobj = document.getElementById( menuitem_id );

    switch( menuobj.style.display )
    {
        case 'inline':
        {
            menuobj.style.display = 'none';
            break;
        }

        case 'none':
        {
            menuobj.style.display = 'inline';
            break;
        }
    }

    return true;    
}

function menuitem_over( menuitem_id )
{
    var menuobj = document.getElementById( menuitem_id );

    menuobj.style.display = 'inline';

    return true;    
}

function menuitem_out( menuitem_id )
{
    var menuobj = document.getElementById( menuitem_id );

    menuobj.style.display = 'none';

    return true;    
}

function menuitem_highlight( menuiten_obj, status )
{
    switch( status )
    {
        case 'over':
        {
            menuiten_obj.className = 'menuitem_over';
            break;
        }
        
        case 'out':
        {
            menuiten_obj.className = 'menuitem';
            break;
        }
    }
    
    return true;
}

var apply_play_pc__is_showed = false;

function apply_play_pc( url )
{
    if( apply_play_pc__is_showed === true )
    {
        return true;
    }

    document.getElementById('cell_play_pc').className = 'visible';
    document.getElementById('container_play_pc').innerHTML =
        decor_form1_open_string( 0, '100%' ) + 
        '<iframe src="'+url+'" style="width: 100%; height: 340px" frameborder="no"></iframe>' +
        decor_form1_close_string();

    apply_play_pc__is_showed = true;
    
    return true;
}
