function CIssuePriceControl( aControlName, aMainContainerId, aPriceContainerIdPrefix, aSubsLenghtParamsContainerIdPrefix,
                             aIssueFormatId, aIssueFormatIdName, aIssueFormatIdPrefix, aPriceIdPrefix, aSmsPriceIdPrefix, aPrice, aSmsPrice,
                             aSubsLengths, aSubsLenghtIdPrefix, aSubsPriceIdPrefix, aSubsNumOfIssuesPrefix )
    {
    // Subcontainers
    this.iControlName = aControlName;
    this.iMainContainerId = aMainContainerId;
    this.iPriceContainerIdPrefix = aPriceContainerIdPrefix;
    this.iSubsPriceContainerIdPrefix = aSubsLenghtParamsContainerIdPrefix;    
    // Issue format related members. (digital/printed)
    this.iIssueFormatId = aIssueFormatId;
    this.iIssueFormatIdName = aIssueFormatIdName;
    this.iIssueFormatIdIdPrefix = aIssueFormatIdPrefix;
    this.iPriceIdPrefix = aPriceIdPrefix;
    this.iSmsPriceIdPrefix = aSmsPriceIdPrefix;    
    this.iPrice = aPrice;
    this.iSmsPrice = aSmsPrice;    
    // Subscription related members.
    this.iSubsLengths = aSubsLengths;
    this.iSubsLenghtIdPrefix = aSubsLenghtIdPrefix;
    this.iSubsPriceIdPrefix = aSubsPriceIdPrefix;
    this.iSubsNumOfIssuesPrefix = aSubsNumOfIssuesPrefix;
    }

CIssuePriceControl.prototype.Display = function()
    {
    var html = '<input type=\"checkbox\" name=\"'+this.iIssueFormatIdIdPrefix+'_'+this.iIssueFormatId+'\" id=\"'+this.iIssueFormatIdIdPrefix+'_'+this.iIssueFormatId+'\" value=\"\" onclick=\"'+this.iControlName+'.SetVisibility( this, \''+this.iPriceContainerIdPrefix+'_'+this.iIssueFormatId+'\' )\" />'+this.iIssueFormatIdName+'<br/>\
                <div id=\"'+this.iPriceContainerIdPrefix+'_'+this.iIssueFormatId+'\"  style=\"padding:3px;display:none\"> <!-- id = container_issue_price_<formatid> -->\
                    Kiadvány ára: <input onkeypress=\"return isNumberKey(event)\" type=\"text\" name=\"'+this.iPriceIdPrefix+'_'+this.iIssueFormatId+'\" id=\"'+this.iPriceIdPrefix+'_'+this.iIssueFormatId+'\" class=\"textfield\" maxlength=\"5\" size=\"5\" /> Ft.<!-- id = price_<formatid>--> \
                    <br/><br/>Kiadvány sms ára: <input onkeypress=\"return isNumberKey(event)\" type=\"text\" name=\"'+this.iSmsPriceIdPrefix+'_'+this.iIssueFormatId+'\" id=\"'+this.iSmsPriceIdPrefix+'_'+this.iIssueFormatId+'\" class=\"textfield\" maxlength=\"5\" size=\"5\" /> Ft.<!-- id = price_<formatid>--> \
                    <div style=\"margin-top:10px;\">\
                        Előfizethető időtartamok:\
                    </div>';

    var item;
    for ( item in this.iSubsLengths )
        {
        html += '   <div style=\"border: 1px solid #cccccc; margin-top:3px;\">\
                        <input type=\"checkbox\" name=\"'+this.iSubsLenghtIdPrefix+'_'+this.iIssueFormatId+'_'+this.iSubsLengths[item][0]+'\" id=\"'+this.iSubsLenghtIdPrefix+'_'+this.iIssueFormatId+'_'+this.iSubsLengths[item][0]+'\" onclick=\"'+this.iControlName+'.SetVisibility( this, \''+this.iSubsPriceContainerIdPrefix+'_'+this.iIssueFormatId+'_'+this.iSubsLengths[item][1]+'\' )\" /> '+this.iSubsLengths[item][1]+' <!-- id = <prefix>_<formatid>_<subscriptionlengthid> -->\
                        <div id=\"'+this.iSubsPriceContainerIdPrefix+'_'+this.iIssueFormatId+'_'+this.iSubsLengths[item][1]+'\" style=\"padding:3px;display:none\"> <!-- id = subslength_params_container_<formatid>_<subscriptionlengthid> -->\
                            Az időtartamban megjelenő példanyok száma: <input onkeypress=\"return isNumberKey(event)\" class=\"textfield\" type=\"text\" name=\"'+this.iSubsNumOfIssuesPrefix+'_'+this.iIssueFormatId+'_'+this.iSubsLengths[item][0]+'\" maxlength=\"3\" size=\"3\" id=\"'+this.iSubsNumOfIssuesPrefix+'_'+this.iIssueFormatId+'_'+this.iSubsLengths[item][0]+'\" /> db. <!-- id = <prefix>_<formatid>_<subscriptionlengthid>  -->\
                            <br/>\
                            Az időtartam előfizetésének ára: <input onkeypress=\"return isNumberKey(event)\" class=\"textfield\" type=\"text\" name=\"'+this.iSubsPriceIdPrefix+'_'+this.iIssueFormatId+'_'+this.iSubsLengths[item][0]+'\" maxlength=\"5\" size=\"5\" id=\"'+this.iSubsPriceIdPrefix+'_'+this.iIssueFormatId+'_'+this.iSubsLengths[item][0]+'\" /> Ft.<!-- id = <prefix>_<formatid>_<subscriptionlengthid>  -->\
                        </div>\
                    </div>';
        }

    html += '</div>';
    document.getElementById( this.iMainContainerId ).innerHTML = html;
    this.Init();
    }

CIssuePriceControl.prototype.Init = function()
    {
    if ( this.iPrice )
        {
        // Format checkbox
        document.getElementById( this.iIssueFormatIdIdPrefix+'_'+this.iIssueFormatId ).checked = 'checked';
        // Price
        document.getElementById( this.iPriceIdPrefix+'_'+this.iIssueFormatId ).value = this.iPrice;
        // Sms price
        if ( this.iSmsPrice )
            {
            // Hide number 0  from form, just show empty
            document.getElementById( this.iSmsPriceIdPrefix+'_'+this.iIssueFormatId ).value = this.iSmsPrice;
            }
        // Display price container
        document.getElementById( this.iPriceContainerIdPrefix+'_'+this.iIssueFormatId ).style.display = 'block';
        }
    var item;
    for ( item in this.iSubsLengths )
        {
        if ( this.iSubsLengths[item][3] )  // subs price
            {
            // Format checkbox
            document.getElementById( this.iIssueFormatIdIdPrefix+'_'+this.iIssueFormatId ).checked = 'checked';
            // Subs checkbox
            document.getElementById( this.iSubsLenghtIdPrefix+'_'+this.iIssueFormatId+'_'+this.iSubsLengths[item][0] ).checked = 'checked';
            // Num off issues
            document.getElementById( this.iSubsNumOfIssuesPrefix+'_'+this.iIssueFormatId+'_'+this.iSubsLengths[item][0] ).value = this.iSubsLengths[item][2];
            // Subs price
            document.getElementById( this.iSubsPriceIdPrefix+'_'+this.iIssueFormatId+'_'+this.iSubsLengths[item][0] ).value = this.iSubsLengths[item][3];
            // Display subs price container
            document.getElementById( this.iSubsPriceContainerIdPrefix+'_'+this.iIssueFormatId+'_'+this.iSubsLengths[item][1] ).style.display = 'block';
            // Display price container
            document.getElementById( this.iPriceContainerIdPrefix+'_'+this.iIssueFormatId ).style.display = 'block';
            }
        }
    }

CIssuePriceControl.prototype.SetVisibility = function( aCheckBox, aPriceContainerId )
    {
    var visibility = '';
    if ( aCheckBox.checked )
        {
        visibility = 'block';
        }
    else
        {
        visibility = 'none';
        }
    document.getElementById( aPriceContainerId ).style.display = visibility;
    document.getElementById( 'smshelp' ).style.display = visibility;            
    }
// class CIssuePriceControl
