init_sp_adv = ['interkassa'];
/* основной файл js системы оплаты */
var obj_black_pole_sp;
var padding_block_main_window=0;
var width_block_base_main_window_sp=600;
var height_block_base_main_window_sp=400;
//var url_img_close_main_window="/moduls/doska/images/cancl_24.png";
var url_img_close_main_window=dir_http_template+"/moduls/doska/images/delete_24x24.png";
var num_element_sp_adv = 0;
var type_proc_sp_adv = "";
var mas_init_sp = {};
function showMainWindowSP(num_element,type_proc)
{
//alert(num_element+" , "+type_proc);
if ( typeof(on_config_sp_adv) == "undefined" )
on_config_sp_adv = false;
obj_div_base_main_window_sp = obj_processing_block.write_up_block("block_black_pole_sp","block_base_main_window_sp",
width_block_base_main_window_sp,height_block_base_main_window_sp,"#B8CEAC","50",close_view_main_window_sp,"transparent");
obj_div_base_main_window_sp.innerHTML=forming_html_base_main_window_sp(num_element,type_proc);
num_element_sp_adv = num_element;
type_proc_sp_adv = type_proc;
write_box_info_sp_adv();
}
function close_view_main_window_sp()
{
//alert(123);
obj_processing_block.close_up_block( "block_black_pole_sp","block_base_main_window_sp" );
/*
if (obj_div_base_main_window_sp)
obj_div_base_main_window_sp.style.display="none";
if (obj_black_pole_sp)
obj_black_pole_sp.style.display="none";
*/
}
function forming_html_base_main_window_sp(num_element,type_proc)
{
var t="";
t+="
";
t+="
"+forming_title_main_window_sp(type_proc)
+" | "
+""
+" |
";
t+="
"+get_descript_service_box_info_sp_adv( type_proc )+"
";
t+="
";
//t+=mas_init_sp["a1sms_api"].forming_html_view_info_sp(num_element,type_proc);//forming_html_view_main_window_sp(num_element,type_proc);
t+="
";
t+="
";
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;
//case ("vimages"):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()
{
//num_element_sp_adv,type_proc_sp_adv
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 */
var num_elm = num_element_sp_adv;
var type_proc = type_proc_sp_adv;
t += forming_html_payment_balance_site_sp_adv(type_proc, num_elm);
if ( init_sp_adv.length > 0 )
{
var td = "";
if ( on_user_authorize_site )
td = "Вам доступны также другие способ оплаты";
else
td = "Способы оплаты без регистрации на сайте";
t+=""+td+"
";
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_sp_adv_not_balance()
{
//var obj_box = document.getElementById("box_info_sp_adv");
//num_element_sp_adv,type_proc_sp_adv
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+="Система оплаты не подключена...
";
}
//obj_box.innerHTML = 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;
//case ("vimages"):t+="Отобразить изображения";break;
}
return (t);
}
function forming_html_payment_balance_site_sp_adv(type_proc, num_elm)
{
var t = "";
t += "";
if ( on_user_authorize_site )
{
t += "Вы можете ";
t += "
оплатить со своего баланса на сайте";
t += "
";
}
else
{
t += "Оплатить со своего баланса на сайте: нужно
зарегистрироваться и
авторизоваться.";
}
t += "
";
return ( t );
}
var interkassa_sp =
{
forming_html_view_info_sp : function(num_element,type_proc)
{
var t="";
t+="";
var mas_text=this.forming_mas_text_sp(num_element,type_proc);
//t+="
"+mas_text[0]+"
";
//t+="
"+mas_text[1]+"
";
//t+="
"+mas_text[2]+"
";
t+=
'
';
//t+="
"+mas_text[2]+"
";
t+="
Стоимость услуги: "+mas_text[0]+" "+name_base_currency //"руб."
+(mas_text[3] !== false ? ", время действия услуги: "+mas_text[3]+" дней." : "")
+"
";
//t+="
название услуги: "+mas_text[1]+"
";
t+="
";
return (t);
},
forming_mas_text_sp : function(num_element,type_proc)
{
var rez_mas=new Array();
var t="";
var cost="";
var cost_service="";
var name="";
var t_help="";
var num_day = false;
var sign = "";
if (on_config_sp_adv)
{
switch (type_proc)
{
case("premium"):
cost = mas_config_sp_adv["COST_PREMIUM_ADD_ADV"];
cost_service = mas_config_sp_adv["COST_PREMIUM_ADD_ADV_SMSCOIN"];
name = mas_config_sp_adv["DESC_PAYMENT_PREMIUM_ADD_ADV"];
t_help = mas_config_sp_adv["DESCRIPTION_PREMIUM_ADD_ADV"];
num_day = mas_config_sp_adv["NUM_DAY_PREMIUM_ADD_ADV"];
sign = mas_config_sp_adv["SIGN_SMSCOIN_PREMIUM_ADV"];
break;
case("vip"):
cost = mas_config_sp_adv["COST_VIP_ADD_ADV"];
cost_service = mas_config_sp_adv["COST_VIP_ADD_ADV_SMSCOIN"];
name = mas_config_sp_adv["DESC_PAYMENT_VIP_ADD_ADV"];
t_help = mas_config_sp_adv["DESCRIPTION_VIP_ADD_ADV"];
num_day = mas_config_sp_adv["NUM_DAY_VIP_ADD_ADV"];
sign = mas_config_sp_adv["SIGN_SMSCOIN_VIP_ADV"];
break;
case("picked"):
cost = mas_config_sp_adv["COST_PICKED_ADD_ADV"];
cost_service = mas_config_sp_adv["COST_PICKED_ADD_ADV_SMSCOIN"];
name = mas_config_sp_adv["DESC_PAYMENT_PICKED_ADD_ADV"];
t_help = mas_config_sp_adv["DESCRIPTION_PICKED_ADD_ADV"];
num_day = mas_config_sp_adv["NUM_DAY_PICKED_ADD_ADV"];
sign = mas_config_sp_adv["SIGN_SMSCOIN_PICKED_ADV"];
break;
case("up"):
cost = mas_config_sp_adv["COST_UP_ADD_ADV"];
cost_service = mas_config_sp_adv["COST_UP_ADD_ADV_SMSCOIN"];
name = mas_config_sp_adv["DESC_PAYMENT_UP_ADD_ADV"];
t_help = mas_config_sp_adv["DESCRIPTION_UP_ADD_ADV"];
sign = mas_config_sp_adv["SIGN_SMSCOIN_UP_ADV"];
break;
case("makegood"):
cost = mas_config_sp_adv["COST_MAKEGOOD_ADD_ADV"];
cost_service = mas_config_sp_adv["COST_MAKEGOOD_ADD_ADV_SMSCOIN"];
name = mas_config_sp_adv["DESC_PAYMENT_MAKEGOOD_ADD_ADV"];
t_help = mas_config_sp_adv["DESCRIPTION_MAKEGOOD_ADD_ADV"];
sign = mas_config_sp_adv["SIGN_SMSCOIN_MAKEGOOD_ADV"];
break;
case("vimages"):
cost = mas_config_sp_adv["COST_VIMAGES_ADD_ADV"];
name = "Оплата услуги отображения изображений объявления";
t_help = mas_config_sp_adv["DESCRIPTION_VIMAGES_ADD_ADV"];
num_day = mas_config_sp_adv["NUM_DAY_VIMAGES_ADD_ADV"];
break;
}
}
else
{
t+="на данный момент услуга не доступна";
}
rez_mas[0]=cost;
rez_mas[1]=name;
rez_mas[2]=t_help;
rez_mas[3]=num_day;
rez_mas[4]=sign;
rez_mas[5]=cost_service;
return (rez_mas);
},
name_sp : function()
{
return (mas_config_sp_adv["USE_NAME_INTERKASSA_ADV"]);
}
}
mas_init_sp["interkassa"] = interkassa_sp;