
if(!window.Question) var Question = {}; 
var cash_result = new Array();
var obj;
var obj2;

Question.getdiv = function () {		
//------------------------------------//
//    функция создающая div           //
//------------------------------------//
    var anchs = document.getElementsByTagName("script");
    for (i=0;i<anchs.length;i++) {
        var item = anchs[i];
        if (item.src.substring(item.src.length - 21) == '/sj_skype_question.js') {
            Question.widgetid = item.getAttribute('skype_question_main_id');
            var eah = document.getElementById('js_skype_question_widget');
            if (!eah) {
                var ah = document.createElement('div');
                ah.id = 'js_skype_question_widget';
                item.parentNode.appendChild(ah);
            }
            return item.src.substring(0, item.src.length - 8);
        }
    }
}
Question.q = function (url, callback) {
//------------------------------------------------//
//         функция трансфера данных               //
//------------------------------------------------//
    if (!cash_result[url]) {
        var qid = Math.random().toString();
        qid = qid.substr(3,5);
        var respname = 'Resp'+qid;
        var s = document.createElement('script');
        s.setAttribute('type', 'text/javascript');
        s.setAttribute('src', url+'&qid='+qid);
        var head = document.getElementsByTagName('head')[0];
        var container = (head) ? head : document.body;
        if (callback) {
            var interval = setInterval(function() {
                if (eval("typeof " + respname) != 'undefined') {
                    var response = eval(respname);
                    clearInterval(interval);
                    callback(decodeURIComponent(response.text));
                    cash_result[url] = decodeURIComponent(response.text);
                    container.removeChild(s);
                }
            }, 50);
        }
        container.appendChild(s);
    }else{
        callback(cash_result[url]);
    }
}
Question.linkCSS = function (file){
//--------------------------------------------------//
//           функция подключения стилей             //
//--------------------------------------------------//
    var link = document.createElement("link");
    link.type = "text/css";
    link.rel = "stylesheet";
    link.href = Question.server + file;
    document.getElementsByTagName('head')[0].appendChild(link);
}
Question.construct = function (state) {
//----------------------------------------------------//
//         функция построения страниц виджета         //
//----------------------------------------------------//
    if (state=='start') {
    //--------------------------------------//
    //     стартовые страницы виджета       //
    //--------------------------------------//
        if(typeof(Question.ah1)!='undefined' || Question.ah1) { Question.ah1.parentNode.removeChild(Question.ah1); Question.ah1=false}
        
        Question.q(Question.server+'?widgetid='+widgetid, function(result) {	
            obj = eval(result);	
            var str = '<div id="js_skype_question_box1">';
                str +='<a href="http://skype.privatbank.ua" style="display:block;height:18px;width:18px;position:absolute;top:5px;left:163px;text-decoration:none;z-index:1002;">&nbsp;</a>';
                str += '<div id="sj_skype_question_map2"><img src="'+Question.server+'/img/x.gif" style="border:0;" width="190" height="188" border="0" usemap="#skype_question_map10"></div>';
                str += '<map name="skype_question_map10" style="border:0;">';
                str += '<area shape="poly" coords="0,45,45,0,70,12,126,15,175,63,185,126,126,170,95,160,30,150" href="#" onclick="Question.construct(\'nextt\');return false;" alt="Далее">';
                str += '<area shape="poly" coords="40,159,90,159,120,177,85,180,40,165" href="#" onclick="Question.construct(\'more\');return false;" alt="Подробнее">';
                str += '<area shape="poly" coords="123,176,188,132,188,156,153,187,140,187" href="#" onclick="Question.construct(\'partner_up\');return false;" alt="Взять себе">';
                str += '</map>';
                str += '</div>';
            Question.ctr.innerHTML = str;																							
        });
    }
    else if (state=='nextt') {
    //----------------------------------------------------------------//
    //     стартовые страницы виджета (пока такиеже как и листы)      //
    //----------------------------------------------------------------//
        Question.q(Question.server+'?widgetid='+widgetid, function(result) {	
            obj = eval(result);												
           // Question.processing_operation('1');	
            // if (widgetid == '9999') {
                // Question.processing_operation('1');
            // }else{
                 Question.processing_operation('8');
            // }
            
            
            
        });
    }
    else if (state=='partner_up') {
    //-----------------------------------------------//
    //          страница стать партнером             //
    //-----------------------------------------------//
        var str = '<div id="js_skype_question_box2">';
        str +='<a href="http://skype.privatbank.ua" style="display:block;height:18px;width:18px;position:absolute;top:5px;left:163px;text-decoration:none;z-index:1002;">&nbsp;</a>';
        str += '<div id="js_skype_question_text_next2">Введите номер<br /> телефона:</div>';
        str += '<div id="js_skype_question_form_next" style="text-align:left;">';
        str += '<form action="#" id="js_skype_question_form1">';
        str += '<br /><br /><input style="width:100px;margin-top:5px;" type="text" name="ecvaring_fio" value="+380" class="js_ecvaring_form_input" />';
        str += '</form>';
        str += '</div>';
        str += '<div id="sj_skype_question_map1"><img src="'+Question.server+'/img/x.gif" style="border:0;" width="150" height="58" border="0" usemap="#skype_question_map20"></div>';
        str += '<map name="skype_question_map20" border="0">';
        str += '<area shape="poly" coords="0,29,50,29,80,43,45,50,0,35" href="#" onclick="Question.construct(\'start\');return false;" alt="Назад">';
        str += '<area shape="poly" coords="81,43,148,2,148,26,113,57,100,57" href="#" onclick="return Question.validation2(document.getElementById(\'js_skype_question_form1\'), 1, 45);" alt="Далее">';
        str += '</map>';
        str += '</div>';                         
        Question.ctr.innerHTML = str;																									
    }
    else if (state=='more') {
        var str = '<div id="js_skype_question_box1">';
        
        
        var str1 = '<a href="http://skype.privatbank.ua" style="display:block;height:18px;width:18px;position:absolute;top:5px;left:163px;text-decoration:none;z-index:1002;">&nbsp;</a>';
        str1 += '<div id="js_skype_question_popap"><div id="js_skype_question_popap3">';
        str1 += '<div id="js_skype_question_popap_head">';
        str1 += '<a href="#" onclick="Question.construct(\'start\');return false;" style="display:block;width:23px;height:23px;float:right;text-decoration:none;">&nbsp;</a>';
        str1 += '<div></div>';
        str1 += '</div>';
        str1 += '<div id="js_skype_question_popap_content">';
        str1 += '&nbsp;&nbsp;Для того, чтобы гарантированно получить ваучер с кодом пополнения на <b>0,30 Евро</b>, необходимо, ответить на несколько простых вопросов о возможностях Skype, ввести свой номер телефона, после чего код пополнения счета Skype будет отправлен в виде SMS.<br /><br />';
        str1 += '&nbsp;&nbsp;<b>Правила участие в Викторине Skype:</b><br /><br />';
        str1 += '&nbsp;&nbsp;1. Нажмите на специальную форму справа<br />';
        str1 += '&nbsp;&nbsp;2. Ответьте правильно на все вопросы о возможностях Skype<br />';
        str1 += '&nbsp;&nbsp;3. Введите свой номер телефона и получите код пополнения счета Skype в виде SMS<br />';
        str1 += '&nbsp;&nbsp;4. Для того, чтобы активировать ваучер, следуйте инструкциям на сайте http://skype.privatbank.ua или перейдите по ссылке https://secure.skype.com/store/voucher/redeem.html<br /><br />';
        str1 += '</div>';
        str1 += '<div id="js_skype_question_popap_footer"></div>';
        str1 += '</div></div>';                          
        
        if(typeof(Question.ah1)!='undefined' || Question.ah1) { Question.ah1.parentNode.removeChild(Question.ah1); Question.ah1=false}
        Question.ah1 = document.createElement('div');
        Question.ah1.id = 'js_skype_reel_pppppp1';
        Question.ah1.innerHTML=str1;
        document.body.appendChild(Question.ah1);
        
        str += '</div>';
        Question.ctr.innerHTML = str;	
    }
}
Question.processing_operation2 = function (form,n){
//-------------------------------------------------//
//    Обработка ответов на вопросы                 //
//-------------------------------------------------//

    for (var i = 0; i < form.length; i++) {
        var temp_el = form[i];
        if (temp_el.checked) asked = temp_el.value;
    }
    Question.q(Question.server+'/index.php?quest1='+n+'&asked='+asked, function(result) {
        obj = eval(result);
        if (obj[0]['quest1']){
            k = n+1;
            Question.processing_operation(k);
            return false;
        }else{
            alert('неправильно ответил');
            Question.construct('start');
            return false;
        }
    });

}
Question.otp = function(phone) {
//-----------------------------------------------------------//
//     функция обработки операции и общения с liqpay         //
//-----------------------------------------------------------// 
    
    var pattern = new RegExp('^\\+(380\\d{9})$');
    if (!pattern.test(phone)) {
        alert('Вы неправильно ввели телефонный номер.\r\nВ акции учавствуют только украинские номера.');
        return false;
    }
    
    phone1 = encodeURIComponent(phone);
    
    Question.q(Question.server+'/index.php?widgetid='+widgetid+'&phone='+phone1+'&otp1=1', function(result) {	
        obj = eval(result);
        if (obj[0]['test_phone']){
            var str  = '<div id="js_skype_question_box2">';
            str +='<a href="http://skype.privatbank.ua" style="display:block;height:18px;width:18px;position:absolute;top:5px;left:163px;text-decoration:none;z-index:1002;">&nbsp;</a>';
            str += '<div id="js_skype_question_text_next2">Введите пароль<br /> из смс:</div>';
            str += '<div id="js_skype_question_form_next" style="text-align:left;">';
            str += '<form action="#" id="js_skype_question_form2">';
            str += '<br /><br /><input style="width:100px;margin-top:5px;" type="text" name="" value="" class="js_ecvaring_form_input" />';
            str += '<input type="hidden" name="ky" value="'+phone1+'" />';
            str += '</form>';
            str += '</div>';
            str += '<div id="sj_skype_question_map1"><img src="'+Question.server+'/img/x.gif" width="150" height="58" style="border:0px solid #ffffff;" border="0" usemap="#skype_question_map30"></div>';
            str += '<map name="skype_question_map30">';
            str += '<area shape="poly" coords="0,29,50,29,80,43,45,50,0,35" href="#" onclick="Question.construct(\'start\');return false;" alt="Назад">';
            str += '<area shape="poly" coords="81,43,148,2,148,26,113,57,100,57" href="#"  onclick="return Question.validation3(document.getElementById(\'js_skype_question_form2\'));" alt="Далее">';
            str += '</map>';
            str += '</div>';
        }else{
            var str  = '<div id="js_skype_question_box1">';
            str +='<a href="http://skype.privatbank.ua" style="display:block;height:18px;width:18px;position:absolute;top:5px;left:163px;text-decoration:none;z-index:1002;">&nbsp;</a>';
            
            
            var str1 ='<div id="js_skype_question_popap"><div id="js_skype_question_popap3">';
            str1 +='<div id="js_skype_question_popap_head">';
            str1 +='<div></div>';
            str1 +='</div>';
            str1 +='<div id="js_skype_question_popap_content">';
            str1 += 'Ваш ваучер: '+obj[0]['code_2']+'<br /><br />';
            str1 +='<div style="height:27px;">';
            str1 +='<a href="#" id="js_skype_question_popap_but1"';
            str1 +=' onclick="return Question.construct(\'start\');" alt="Далее">&nbsp;</a>';
            str1 +='</div>';
            str1 +='</div>';
            str1 +='<div id="js_skype_question_popap_footer"></div>';
            str1 +='</div></div>';
            
            if(typeof(Question.ah1)!='undefined' || Question.ah1) { Question.ah1.parentNode.removeChild(Question.ah1); Question.ah1=false}
            Question.ah1 = document.createElement('div');
            Question.ah1.id = 'js_skype_reel_pppppp1';
            Question.ah1.innerHTML=str1;
            document.body.appendChild(Question.ah1);
            
        }
        str += '</div>';
        Question.ctr.innerHTML = str;																							
    });
}
Question.validation3 = function(form) {
//-----------------------------------------------------------//
//     функция обработки операции и общения с liqpay         //
//-----------------------------------------------------------// 
    var el0 = form[0];
    var el1 = form[1];
    pass = el0.value;
    phone = el1.value;
    url_site = window.location.href;
    Question.q(Question.server+'?widgetid='+widgetid+'&phone='+phone+'&pass='+pass+'&otp2=1&url_site='+encodeURIComponent(url_site), function(result) {	
        obj = eval(result);												
        if (obj[0]['otp_status']){
            Question.order = obj[0]['order'];
            var str = '<div id="js_skype_question_box1">';
            
            
            var str1 ='<div id="js_skype_question_popap"><div id="js_skype_question_popap3">';
            str1 +='<div id="js_skype_question_popap_head">';
            str1 += '<a href="#" onclick="Question.construct(\'start\');return false;" style="display:block;width:23px;height:23px;float:right;text-decoration:none;">&nbsp;</a>';
            str1 +='<div></div>';
            str1 +='</div>';
            str1 +='<div id="js_skype_question_popap_content">';
            if (obj[0]['p24_status']){
                str1 +='Поздравляем!!<br />Вы правильно ответили на вопросы.<br />Ваш ваучер: '+obj[0]['code']+'<br /><br />';
            }else{
                str1 +='Произошла ошибка. Обратитесь пожалуйста в службу поддержки.<br /><br />';
            }
            str1 +='</div>';
            str1 +='<div id="js_skype_question_popap_footer"></div>';
            str1 +='</div></div>';
            
            //if(typeof(Question.ah1)!='undefined') Question.ah1.parentNode.removeChild(Question.ah1);
            Question.ah1 = document.createElement('div');
            Question.ah1.id = 'js_skype_reel_pppppp1';
            Question.ah1.innerHTML=str1;
            document.body.appendChild(Question.ah1);
            
            str += '</div>';
            Question.ctr.innerHTML = str;
            return false;
        }else{
            alert('неверный пароль');
            Question.construct('start');
            return false;
        }																						
    });
    return false;
}
Question.processing_operation = function(param) {
//-----------------------------------------------------------//
//     функция обработки операции и общения с liqpay         //
//-----------------------------------------------------------//   
    
    if (param == '1'){
        var str = '<div id="js_skype_question_box1">';
        
        var str1 ='<div id="js_skype_question_popap"><div id="js_skype_question_popap3">';
        str1 +='<div id="js_skype_question_popap_head">';
        str1 += '<a href="#" onclick="Question.construct(\'start\');return false;" style="display:block;width:23px;height:23px;float:right;text-decoration:none;">&nbsp;</a>';
        str1 +='<div></div>';
        str1 +='</div>';
        str1 +='<div id="js_skype_question_popap_content">';
        str1 +='<p style="font-family: Arial, Helvetica, sans-serif;font-size: 10pt;margin:0;text-indent:0px;text-align:left;color:#af8888;"><b>1. Сколько стоят звонки между абонентами Skype?</b></p>';
        str1 +='<form style="padding:5px 0;" id="js_skype_question_form3">';
        str1 +='<table class="js_skype_question_table1" width="100%" border="0" cellspacing="0" cellpadding="0">';
        str1 +='<tr>';
        str1 +='<td width="15"><input type="radio" name="question1" value="1" /></td>';
        str1 +='<td align="left">Услуга бесплатна</td>';
        str1 +='<tr>';
        str1 +='<tr>';
        str1 +='<td><input type="radio" name="question1" value="2" /></td>';
        str1 +='<td align="left">Стоимость зависит от расстояния</td>';
        str1 +='<tr>';
        str1 +='<tr>';
        str1 +='<td><input type="radio" name="question1" value="3" /></td>';
        str1 +='<td align="left">&#128; 0,99</td>';
        str1 +='<tr>';
        str1 +='</table>';
        str1 +='<div style="height:27px;">';
        str1 +='<a href="#" id="js_skype_question_popap_but1"';
        str1 +=' onclick="return Question.processing_operation2(document.getElementById(\'js_skype_question_form3\'),1);" alt="Далее">&nbsp;</a>';
        str1 +='</div>';
        str1 +='</form>';
        str1 +='</div>';
        str1 +='<div id="js_skype_question_popap_footer"></div>';
        str1 +='</div></div>';
        
        if(typeof(Question.ah1)!='undefined') Question.ah1.parentNode.removeChild(Question.ah1);
        Question.ah1 = document.createElement('div');
        Question.ah1.id = 'js_skype_reel_pppppp1';
        Question.ah1.innerHTML=str1;
        document.body.appendChild(Question.ah1);
        
        str += '</div>';
        Question.ctr.innerHTML = str;
    }
    if (param == '2'){
        var str = '<div id="js_skype_question_box1">';
        
        var str1 ='<div id="js_skype_question_popap"><div id="js_skype_question_popap3">';
        str1 +='<div id="js_skype_question_popap_head">';
        str1 += '<a href="#" onclick="Question.construct(\'start\');return false;" style="display:block;width:23px;height:23px;float:right;text-decoration:none;">&nbsp;</a>';
        str1 +='<div></div>';
        str1 +='</div>';
        str1 +='<div id="js_skype_question_popap_content">';
        str1 +='<p style="font-family: Arial, Helvetica, sans-serif;font-size: 10pt;margin:0;text-indent:0px;text-align:left;color:#af8888;"><b>2. Вы можете использовать Skype для звонков только абонентам Skype  или также для дешевых звонков на городские и мобильные номера?</b></p>';
        str1 +='<form style="padding:5px 0;" id="js_skype_question_form4">';
        str1 +='<table class="js_skype_question_table1" width="100%" border="0" cellspacing="0" cellpadding="0">';
        str1 +='<tr>';
        str1 +='<td width="15"><input type="radio" name="question1" value="3" /></td>';
        str1 +='<td align="left">Я могу использовать Skype как для бесплатных звонков абонентам Skype, так и для дешевых звонков на городские и мобильные номера</td>';
        str1 +='<tr>';
        str1 +='<tr>';
        str1 +='<td><input type="radio" name="question1" value="1" /></td>';
        str1 +='<td align="left">Я могу использовать Skype только для звонков абонентам Skype </td>';
        str1 +='<tr>';
        str1 +='</table>';
        str1 +='<div style="height:27px;">';
        str1 +='<a href="#" id="js_skype_question_popap_but1"';
        str1 +=' onclick="return Question.processing_operation2(document.getElementById(\'js_skype_question_form4\'),2);" alt="Далее">&nbsp;</a>';
        str1 +='</div>';
        str1 +='</form>';
        str1 +='</div>';
        str1 +='<div id="js_skype_question_popap_footer"></div>';
        str1 +='</div></div>';
        
        if(typeof(Question.ah1)!='undefined') Question.ah1.parentNode.removeChild(Question.ah1);
        Question.ah1 = document.createElement('div');
        Question.ah1.id = 'js_skype_reel_pppppp1';
        Question.ah1.innerHTML=str1;
        document.body.appendChild(Question.ah1);
        
        str += '</div>';
        Question.ctr.innerHTML = str;
    }
    if (param == '3'){
        var str = '<div id="js_skype_question_box1">';
        
        var str1 ='<div id="js_skype_question_popap"><div id="js_skype_question_popap3">';
        str1 +='<div id="js_skype_question_popap_head">';
        str1 += '<a href="#" onclick="Question.construct(\'start\');return false;" style="display:block;width:23px;height:23px;float:right;text-decoration:none;">&nbsp;</a>';
        str1 +='<div></div>';
        str1 +='</div>';
        str1 +='<div id="js_skype_question_popap_content">';
        str1 +='<p style="font-family: Arial, Helvetica, sans-serif;font-size: 10pt;margin:0;text-indent:0px;text-align:left;color:#af8888;"><b>3. Сколько стоит позвонить через Skype на городской номер в США?</b></p>';
        str1 +='<form style="padding:5px 0;" id="js_skype_question_form5">';
        str1 +='<table class="js_skype_question_table1" width="100%" border="0" cellspacing="0" cellpadding="0">';
        str1 +='<tr>';
        str1 +='<td width="15"><input type="radio" name="question1" value="2" /></td>';
        str1 +='<td align="left">€ 0.017</td>';
        str1 +='</tr>';
        str1 +='<tr>';
        str1 +='<td><input type="radio" name="question1" value="1" /></td>';
        str1 +='<td align="left">€ 0.99</td>';
        str1 +='</tr>';
        str1 +='</tr>';
        str1 +='<tr>';
        str1 +='<td><input type="radio" name="question1" value="1" /></td>';
        str1 +='<td align="left">€ 2.99</td>';
        str1 +='</tr>';
        str1 +='</table>';
        str1 +='<div style="height:27px;">';
        str1 +='<a href="#" id="js_skype_question_popap_but1"';
        str1 +=' onclick="return Question.processing_operation2(document.getElementById(\'js_skype_question_form5\'),3);" alt="Далее">&nbsp;</a>';
        str1 +='</div>';
        str1 +='</form>';
        str1 +='</div>';
        str1 +='<div id="js_skype_question_popap_footer"></div>';
        str1 +='</div></div>';
        
        if(typeof(Question.ah1)!='undefined') Question.ah1.parentNode.removeChild(Question.ah1);
        Question.ah1 = document.createElement('div');
        Question.ah1.id = 'js_skype_reel_pppppp1';
        Question.ah1.innerHTML=str1;
        document.body.appendChild(Question.ah1);
        
        str += '</div>';
        Question.ctr.innerHTML = str;
    }
    if (param == '4'){
        var str = '<div id="js_skype_question_box1">';
        
        var str1 ='<div id="js_skype_question_popap"><div id="js_skype_question_popap3">';
        str1 +='<div id="js_skype_question_popap_head">';
        str1 += '<a href="#" onclick="Question.construct(\'start\');return false;" style="display:block;width:23px;height:23px;float:right;text-decoration:none;">&nbsp;</a>';
        str1 +='<div></div>';
        str1 +='</div>';
        str1 +='<div id="js_skype_question_popap_content">';
        str1 +='<p style="font-family: Arial, Helvetica, sans-serif;font-size: 10pt;margin:0;text-indent:0px;text-align:left;color:#af8888;"><b>4. Для звонков на городские и мобильные телефоны Вам необходимо регулярно пополнять счет Skype – каким способом это удобней всего сделать?</b></p>';
        str1 +='<form style="padding:5px 0;" id="js_skype_question_form5">';
        str1 +='<table class="js_skype_question_table1" width="100%" border="0" cellspacing="0" cellpadding="0">';
        str1 +='<tr>';
        str1 +='<td width="15"><input type="radio" name="question1" value="1" /></td>';
        str1 +='<td align="left">Через портал PrivatBank</td>';
        str1 +='</tr>';
        str1 +='<tr>';
        str1 +='<td><input type="radio" name="question1" value="2" /></td>';
        str1 +='<td align="left">Через портал Skype.com</td>';
        str1 +='</tr>';
        str1 +='</tr>';
        str1 +='<tr>';
        str1 +='<td><input type="radio" name="question1" value="3" /></td>';
        str1 +='<td align="left">Как через портал PrivatBank, так и через Skype.com</td>';
        str1 +='</tr>';
        str1 +='</table>';
        str1 +='<div style="height:27px;">';
        str1 +='<a href="#" id="js_skype_question_popap_but1"';
        str1 +=' onclick="return Question.processing_operation2(document.getElementById(\'js_skype_question_form5\'),4);" alt="Далее">&nbsp;</a>';
        str1 +='</div>';
        str1 +='</form>';
        str1 +='</div>';
        str1 +='<div id="js_skype_question_popap_footer"></div>';
        str1 +='</div></div>';
        
        if(typeof(Question.ah1)!='undefined') Question.ah1.parentNode.removeChild(Question.ah1);
        Question.ah1 = document.createElement('div');
        Question.ah1.id = 'js_skype_reel_pppppp1';
        Question.ah1.innerHTML=str1;
        document.body.appendChild(Question.ah1);
        
        str += '</div>';
        Question.ctr.innerHTML = str;
    }
    if (param == '5'){
        var str = '<div id="js_skype_question_box1">';
        
        var str1 ='<div id="js_skype_question_popap"><div id="js_skype_question_popap3">';
        str1 +='<div id="js_skype_question_popap_head">';
        str1 += '<a href="#" onclick="Question.construct(\'start\');return false;" style="display:block;width:23px;height:23px;float:right;text-decoration:none;">&nbsp;</a>';
        str1 +='<div></div>';
        str1 +='</div>';
        str1 +='<div id="js_skype_question_popap_content">';
        str1 +='<p style="font-family: Arial, Helvetica, sans-serif;font-size: 10pt;margin:0;text-indent:0px;text-align:left;color:#af8888;"><b>5. Какое максимальное количество пользователей можно одновременно подключить к голосовой конференции Skype?</b></p>';
        str1 +='<form style="padding:5px 0;" id="js_skype_question_form5">';
        str1 +='<table class="js_skype_question_table1" width="100%" border="0" cellspacing="0" cellpadding="0">';
        str1 +='<tr>';
        str1 +='<td width="15"><input type="radio" name="question1" value="2" /></td>';
        str1 +='<td align="left">4</td>';
        str1 +='</tr>';
        str1 +='<tr>';
        str1 +='<td><input type="radio" name="question1" value="1" /></td>';
        str1 +='<td align="left">24 + 1</td>';
        str1 +='</tr>';
        str1 +='</tr>';
        str1 +='<tr>';
        str1 +='<td><input type="radio" name="question1" value="3" /></td>';
        str1 +='<td align="left">Бесконечное количество</td>';
        str1 +='</tr>';
        str1 +='</table>';
        str1 +='<div style="height:27px;">';
        str1 +='<a href="#" id="js_skype_question_popap_but1"';
        str1 +=' onclick="return Question.processing_operation2(document.getElementById(\'js_skype_question_form5\'),5);" alt="Далее">&nbsp;</a>';
        str1 +='</div>';
        str1 +='</form>';
        str1 +='</div>';
        str1 +='<div id="js_skype_question_popap_footer"></div>';
        str1 +='</div></div>';
        
        if(typeof(Question.ah1)!='undefined') Question.ah1.parentNode.removeChild(Question.ah1);
        Question.ah1 = document.createElement('div');
        Question.ah1.id = 'js_skype_reel_pppppp1';
        Question.ah1.innerHTML=str1;
        document.body.appendChild(Question.ah1);
        
        str += '</div>';
        Question.ctr.innerHTML = str;
    }
    if (param == '6'){
        //капча
        if(typeof(Question.ah1)!='undefined') Question.ah1.parentNode.removeChild(Question.ah1);
        
        Question.q(Question.server+'?widgetid='+widgetid+'&captcha=1', function(result) {	
            obj = eval(result);												
            var str = '<div id="js_skype_question_box2">';
            str += '<div style="padding:20px 0 0 5px;">';
            str += obj[0]['captcha'];
            str += '</div>';
            str += '<div id="sj_skype_question_map1" z-index:10;><img src="'+Question.server+'/img/x.gif" style="border:0;" width="150" height="58" border="0" usemap="#skype_question_map40"></div>';
            str += '<map name="skype_question_map40">';
            str += '<area shape="poly" coords="0,29,50,29,80,43,45,50,0,35" href="#" onclick="Question.construct(\'start\');return false;" alt="Назад">'; 
            str += '<area shape="poly" coords="81,43,148,2,148,26,113,57,100,57" href="#" onclick="return Question.validation4(document.getElementById(\'captca_rez\').value);" alt="Далее">';
            str += '</map>';
            str += '</div>';
            Question.ctr.innerHTML = str;																							
        });
    }   
    if (param == '7'){   
        var str = '<div id="js_skype_question_box2">';
        str +='<a href="http://skype.privatbank.ua" style="display:block;height:18px;width:18px;position:absolute;top:5px;left:163px;text-decoration:none;z-index:1002;">&nbsp;</a>';
        str += '<div id="js_skype_question_text_next2">Введите номер<br /> телефона:</div>';
        str += '<div id="js_skype_question_form_next" style="text-align:left;">';
        str += '<form action="#" id="js_skype_question_form1">';
        str += '<br /><br /><input style="width:100px;margin-top:5px;" type="text" name="" value="+380" class="js_ecvaring_form_input" id="23tytyiij348" />';
        str += '</form>';
        str += '</div>';
        str += '<div id="sj_skype_question_map1"><img src="'+Question.server+'/img/x.gif" style="border:0;" width="150" height="58" border="0" usemap="#skype_question_map50"></div>';
        str += '<map name="skype_question_map50" border="0">';
        str += '<area shape="poly" coords="0,29,50,29,80,43,45,50,0,35" href="#" onclick="Question.construct(\'start\');return false;" alt="Назад">';
        str += '<area shape="poly" coords="81,43,148,2,148,26,113,57,100,57" href="#" onclick="return Question.otp(document.getElementById(\'23tytyiij348\').value);" alt="Далее">';
        str += '</map>';
        str += '</div>';                         
        Question.ctr.innerHTML = str;	
    }
    if (param == '8'){
        var str = '<div id="js_skype_question_box1">';
        
        var str1 ='<div id="js_skype_question_popap"><div id="js_skype_question_popap3">';
        str1 +='<div id="js_skype_question_popap_head">';
        str1 += '<a href="#" onclick="Question.construct(\'start\');return false;" style="display:block;width:23px;height:23px;float:right;text-decoration:none;">&nbsp;</a>';
        str1 +='<div></div>';
        str1 +='</div>';
        str1 +='<div id="js_skype_question_popap_content">';
        str1 +='&nbsp;&nbsp;Акция "Викторина Skype" завершилась.<br /><br />';
        str1 +='</div>';
        str1 +='<div id="js_skype_question_popap_footer"></div>';
        str1 +='</div></div>';
        
        if(typeof(Question.ah1)!='undefined') Question.ah1.parentNode.removeChild(Question.ah1);
        Question.ah1 = document.createElement('div');
        Question.ah1.id = 'js_skype_reel_pppppp1';
        Question.ah1.innerHTML=str1;
        document.body.appendChild(Question.ah1);
        
        str += '</div>';
        Question.ctr.innerHTML = str;
    }
}
Question.validation4 = function(rezz) {
//-----------------------------------------------------------//
//        Проверка капчи                                     //
//-----------------------------------------------------------// 
    
    var str = '<div id="js_skype_question_box2">';
        str += '<div style="padding:50px 0 0 35px;">';
        str += '<span style="font-family: Arial, Helvetica, sans-serif;font-size: 10pt;color:white;">Загрузка</span>';
        str += '</div>';
        str += '</div>';
    Question.ctr.innerHTML = str;
    
    Question.q(Question.server+'?widgetid='+widgetid+'&captcha=2&rezz='+rezz, function(result) {
        obj = eval(result);												
        if (obj[0]['rez_captcha']){
            Question.processing_operation('7');
            return false;
        }else{
            alert('неверный пароль');
            Question.construct('start');
            return false;
        }																						
    });
    return false;
}
Question.validation2 = function (form, state, phone_user) {
//--------------------------------------------------------------------------//
//     функция проверки правильности введенных данных стать партнером       //
//--------------------------------------------------------------------------//
    var url = '/?';
    var temp_el = form[0];
    if (state == 1)
        var pattern = new RegExp('^\\+(380\\d{9})$');
    else
        var pattern = new RegExp('^\\d{8}$');
    if (!pattern.test(temp_el.value)) {
        return false;
    }else{
        if (state == 1)	{/*запрос на ввод пароля*/
            url += '&partner_phone='+encodeURIComponent(temp_el.value)+'&widgetid='+widgetid;
            Question.q(Question.server+url, function(result) {
                obj = eval(result);
                var str  = '<div id="js_skype_question_box2">';
                if (obj[0]['widget_id'] != '') {
                    
                    var str1 ='<div id="js_skype_question_popap"><div id="js_skype_question_popap3">';
                    str1 +='<div id="js_skype_question_popap_head">';
                    str1 +='<div></div>';
                    str1 +='</div>';
                    str1 +='<div id="js_skype_question_popap_content">';
                    str1 += 'Данный код вам необходимо вставить на ваш ресурс без изменений:<br /><br />';
                    str1 += obj[0]['result'];
                    str1 +='<div style="height:27px;">';
                    str1 +='<a href="#" id="js_skype_question_popap_but1"';
                    str1 +=' onclick="return Question.construct(\'start\');" alt="Далее">&nbsp;</a>';
                    str1 +='</div>';
                    str1 +='</div>';
                    str1 +='<div id="js_skype_question_popap_footer"></div>';
                    str1 +='</div></div>';
                    
                    if(typeof(Question.ah1)!='undefined') Question.ah1.parentNode.removeChild(Question.ah1);
                    Question.ah1 = document.createElement('div');
                    Question.ah1.id = 'js_skype_reel_pppppp1';
                    Question.ah1.innerHTML=str1;
                    document.body.appendChild(Question.ah1);
                    
                }else{
                   kk = obj[0]['result'];
                    if (kk) {
                        str +='<a href="http://skype.privatbank.ua" style="display:block;height:18px;width:18px;position:absolute;top:5px;left:163px;text-decoration:none;z-index:1002;">&nbsp;</a>';
                        str += '<div id="js_skype_question_text_next2">Введите пароль<br /> из смс:</div>';
                        str += '<div id="js_skype_question_form_next" style="text-align:left;">';
                        str += '<form action="#" id="js_skype_question_form2">';
                        str += '<br /><br /><input style="width:100px;margin-top:5px;" type="text" name="ecvaring_fio" value="" class="js_ecvaring_form_input" />';
                        str += '</form>';
                        str += '</div>'; 
                        str += '<div id="sj_skype_question_map1"><img src="'+Question.server+'/img/x.gif" width="150" height="58" border="0" usemap="#skype_question_map60"></div>';
                        str += '<map name="skype_question_map60">';
                        str += '<area shape="poly" coords="0,29,50,29,80,43,45,50,0,35" href="#" onclick="Question.construct(\'start\');return false;" alt="Назад">';
                        str += '<area shape="poly" coords="81,43,148,2,148,26,113,57,100,57" href="#" onclick="return Question.validation2(document.getElementById(\'js_skype_question_form2\'), 2, '+temp_el.value+');" alt="Далее">';
                        str += '</map>';
                        str += '</div>';
                    }else{
                        str += '<p>Неверный формат телефона</p>';
                    }
                }
                str += '</div>';
                Question.ctr.innerHTML = str;
            });
            return false;
        }
        else if (state == 2) {/*выдача html кода партнеру*/
            url += '&partner_pass='+temp_el.value+'&widgetid='+widgetid+'&phone_user='+encodeURIComponent('+'+phone_user);
            Question.q(Question.server+url, function(result) {
                obj = eval(result);
                var str  = '<div id="js_skype_question_box2">';
                if (obj[0]['err'] == 1) {
                    alert('Ошибка:\n'+obj[0]['result']);
                }else{
                    
                    var str1 ='<div id="js_skype_question_popap"><div id="js_skype_question_popap3">';
                    str1 +='<div id="js_skype_question_popap_head">';
                    str1 +='<div></div>';
                    str1 +='</div>';
                    str1 +='<div id="js_skype_question_popap_content">';
                    str1 += 'Данный код вам необходимо вставить на ваш ресурс без изменений:<br /><br />';
                    str1 += obj[0]['result'];
                    str1 +='<div style="height:27px;">';
                    str1 +='<a href="#" id="js_skype_question_popap_but1"';
                    str1 +=' onclick="return Question.construct(\'start\');" alt="Далее">&nbsp;</a>';
                    str1 +='</div>';
                    str1 +='</div>';
                    str1 +='<div id="js_skype_question_popap_footer"></div>';
                    str1 +='</div></div>';

                    if(typeof(Question.ah1)!='undefined') Question.ah1.parentNode.removeChild(Question.ah1);
                    Question.ah1 = document.createElement('div');
                    Question.ah1.id = 'js_skype_reel_pppppp1';
                    Question.ah1.innerHTML=str1;
                    document.body.appendChild(Question.ah1);
                    
                } 
                str += '</div>';
                Question.ctr.innerHTML = str;
            });
            return false;
        }
    }
}

//---------------------------------------------------------//
//           Исполняемая часть                             //
//---------------------------------------------------------//		
    Question.getdiv();

    var serverrts = document.location.href.split('/',3);
    var serverrts2 = serverrts[2].split(':',2);
    if (serverrts2[0] == '10.1.206.100' || serverrts2[0] == '10.1.100.120'){
        Question.server = 'http://10.1.206.100:8806/skype_question/processor';
    }else{
        Question.server = 'http://partner.privatbank.ru/skype_question/processor';
    }
    
   // Question.server = 'http://partner.privatbank.ru/skype_question/processor';
    Question.ctr = document.getElementById('js_skype_question_widget');
    var widgetid = Question.widgetid;
    Question.linkCSS("/css/js_skype_question_main_css.css");
    Question.order = '';
    Question.construct('start'); 
 


