";
return (t);
}
function forming_title_main_window_sp(type_proc)
{
var t="";
switch (type_proc)
{
case ("premium"):t+="Премиум размещение";break;
case ("vip"):t+="VIP размещение";break;
case ("picked"):t+="Выделить объявление";break;
case ("up"):t+="Поднять объявление";break;
case ("makegood"):t+="Платное размещение";break;
}
return (t);
}
function write_box_info_sp_adv()
{
var use_balance_site = true;
var obj_box = document.getElementById("box_info_sp_adv");
var t = "";
if ( use_balance_site )
{
t += write_box_info_sp_adv_use_balance();
}else{
t += write_box_info_sp_adv_not_balance();
}
obj_box.innerHTML = t;
}
function write_box_info_sp_adv_use_balance()
{
var t = "";
var num_elm = num_element_sp_adv;
var type_proc = type_proc_sp_adv;
if(init_sp_adv.length > 0)
{
for ( var i = 0; i< init_sp_adv.length; i++ )
{
t+= "";
t+=mas_init_sp[init_sp_adv[i]].name_sp();
//t+= " "+get_cost(type_proc)+"руб.";
t+="";
}
}
t += forming_html_payment_balance_site_sp_adv(type_proc, num_elm);
return ( t );
}
function write_box_info_sp_adv_not_balance()
{
var t = "";
if(init_sp_adv.length == 1)
{
t+=mas_init_sp[init_sp_adv[0]].forming_html_view_info_sp(num_element_sp_adv,type_proc_sp_adv);
}
else if ( init_sp_adv.length > 1 )
{
t+="
Выберите способ оплаты
";
for( var i = 0; i< init_sp_adv.length; i++ )
{
t+="";
t+=mas_init_sp[init_sp_adv[i]].name_sp();
t+="";
}
}else{
t+="
Система оплаты не подключена...
";
}
return ( t );
}
function write_box_info_choose_sp_adv(num_elm)
{
var t = "";
var obj_box = document.getElementById("box_info_sp_adv");
t += "";
t += mas_init_sp[init_sp_adv[num_elm]].forming_html_view_info_sp(num_element_sp_adv,type_proc_sp_adv);
obj_box.innerHTML = t;
}
function get_descript_service_box_info_sp_adv( type_proc )
{
var t="";
switch (type_proc)
{
case ("premium"):t+=mas_config_sp_adv["DESCRIPTION_PREMIUM_ADD_ADV"];break;
case ("vip"):t+=mas_config_sp_adv["DESCRIPTION_VIP_ADD_ADV"];break;
case ("picked"):t+=mas_config_sp_adv["DESCRIPTION_PICKED_ADD_ADV"];break;
case ("up"):t+=mas_config_sp_adv["DESCRIPTION_UP_ADD_ADV"];break;
case ("makegood"):t+=mas_config_sp_adv["DESCRIPTION_MAKEGOOD_ADD_ADV"];break;
}
return (t);
}
function get_cost( type_proc )
{
var t="";
switch (type_proc)
{
case ("premium"):t+=mas_config_sp_adv["COST_PREMIUM_ADD_ADV"];break;
case ("vip"):t+=mas_config_sp_adv["COST_VIP_ADD_ADV"];break;
case ("picked"):t+=mas_config_sp_adv["COST_PICKED_ADD_ADV"];break;
case ("up"):t+=mas_config_sp_adv["COST_UP_ADD_ADV"];break;
case ("makegood"):t+=mas_config_sp_adv["COST_MAKEGOOD_ADD_ADV"];break;
}
return (t);
}
// Оплата с баланса аккаунта
function forming_html_payment_balance_site_sp_adv(type_proc, num_elm)
{
var t = "";
if( on_user_authorize_site )
{
var e = document.getElementById("kol_day");
t += "Оплатить c баланса аккаунта";
t += "";
}
//alert(kol_day);
return ( t );
}
// Меняем динамически значение input id='kolday'
function changeKolday(selectObject){
var days = selectObject.value; // Сколько дней
var option = selectObject.options[selectObject.selectedIndex];
// цена без скидки
var sale = option.getAttribute("data-sale");
// цена со скидкой
var real = option.getAttribute("data-cost");
//alert(val);
document.getElementById("init_paym").value = "doska:"+num_element_sp_adv+":"+type_proc_sp_adv+":"+days+"";
document.getElementById("cost_usl").value = real;
if(sale >0)
document.getElementById("real_cost").innerHTML = ""+sale+"руб."+real+"руб.";
else
document.getElementById("real_cost").innerHTML = ""+real+"руб.";
}
var yookassa_sp =
{
open_num_element : 0,
type_proc_element : "",
forming_html_view_info_sp : function(num_element,type_proc)
{
var t="";
this.open_num_element = num_element;
this.type_proc_element = type_proc;
var mas_text=this.forming_mas_text_sp(num_element,type_proc);
var kol_day = 7;
var real = mas_text[0];
// только если Премиум
if(type_proc=='premium'){
//Количество дней
var e = document.getElementById("kol_day");
kol_day = e.value;
// Цена
var option = e.options[e.selectedIndex];
real = option.getAttribute("data-cost");
}
//alert(real);
t+="