var tmp = new Array(); // два вспомагательных var tmp2 = new Array(); // массива var param = new Array(); var get = location.search; // строка GET запроса if(get != '') { tmp = (get.substr(1)).split('&'); // разделяем переменные for(var i=0; i < tmp.length; i++) { tmp2 = tmp[i].split('='); // массив param будет содержать param[tmp2[0]] = tmp2[1]; // пары ключ(имя переменной)->значение } var obj = document.getElementById('greq'); // вывод на экран for (var key in param) { obj.innerHTML += key+" = "+param[key]+"
"; } } function limitText(limitField, limitCount, limitNum) { if (limitField.value.length > limitNum) { limitField.value = limitField.value.substring(0, limitNum); } else { limitCount.value = limitNum - limitField.value.length; } } function order() { met = document.getElementById("method"); if(met.options[0].selected == true) { form = document.getElementById("smsform"); form.submit(); }; if(met.options[1].selected == true) { am = document.getElementById("amount"); order = document.getElementById("order"); am.value = order.options[order.selectedIndex].value; frm = document.getElementById("frm_paypal"); frm.submit(); //frmpp = document.getElementById("frmpp"); //frmpp.submit(); }; } //-------------------------------------------------------------------- // CAPTCHA //-------------------------------------------------------------------- //Gets the browser specific XmlHttpRequest Object function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); //Mozilla, Safari ... } else if (window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); //IE } else { //Display our error message alert("Your browser doesn't support the XmlHttpRequest object."); } } //Our XmlHttpRequest object var receiveReq = getXmlHttpRequestObject(); //Initiate the AJAX request function makeRequest(url, param) { //If our readystate is either not started or finished, initiate a new request if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { //Set up the connection to captcha_test.html. True sets the request to asyncronous(default) receiveReq.open("POST", url, true); //Set the function that will be called when the XmlHttpRequest objects state changes receiveReq.onreadystatechange = updatePage; receiveReq.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); receiveReq.setRequestHeader("Content-length", param.length); receiveReq.setRequestHeader("Connection", "close"); //Make the request receiveReq.send(param); } } //Called every time our XmlHttpRequest objects state changes function updatePage() { //Check if our response is ready if (receiveReq.readyState == 4) { //Set the content of the DIV element with the response text document.getElementById('result').innerHTML = receiveReq.responseText; //Get a reference to CAPTCHA image img = document.getElementById('imgCaptcha'); //Change the image img.src = 'create_image.php?' + Math.random(); } } //Called every time when form is perfomed function getParam(theForm) { //Set the URL var url = 'freesmsgate.php'; //Set up the parameters of our AJAX call var postStr = theForm.txtCaptcha.name + "=" + encodeURIComponent( theForm.txtCaptcha.value ); //Call the function that initiate the AJAX request makeRequest(url, postStr); } function chk1() { agb = document.getElementById("agb"); if(agb.checked == true) { form = document.getElementById("freesmsform"); form.submit(); } else alert ("Вы не согласны с условиями соглашения (AGB)\n и поэтому не можете отправлять сообщения"); } function chk() { agb = document.getElementById("agb"); but = document.getElementById("freesmssend"); if(agb.checked == true) { but.disabled = false;} else but.disabled = true; } function chkfields() { var fsmsf = document.getElementById("freesmsform"); var agb = document.getElementById("agb"); var agbtext = document.getElementById("agbtext"); var adsinfo = document.getElementById("adsinfo"); var adsinfotext = document.getElementById("adsinfotext"); var txtCaptcha = document.getElementById("txtCaptcha"); rec = document.getElementById("receiver"); if(agb.checked == false) { agbtext.style.color = '#ff0000'; alert('Fur das Versenden von SMS, mussen Sie gelesen und stimmen Sie den AGB'); } else if(txtCaptcha.value == '') { txtCaptcha.style.borderColor = '#ff0000'; alert('Fur das Versenden von SMS, mussen Sie den Sicherheitscode in das Bild'); } else if(adsinfo.checked == false) { adsinfotext.style.color = '#ff0000'; alert('Без вашего согласия принимать рекламную информацию\nпользование услугой невозможно'); } else if (rec.value == "") { rec.style.borderColor = '#ff0000'; alert ("Введите номер получателя"); } else fsmsf.submit(); } //------------------------------------------------------------- // ADS //------------------------------------------------------------- function CreateRequest() { var Request = false; if (window.XMLHttpRequest) { //Gecko-совместимые браузеры, Safari, Konqueror Request = new XMLHttpRequest(); } else if (window.ActiveXObject) { //Internet explorer try { Request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (CatchException) { Request = new ActiveXObject("Msxml2.XMLHTTP"); } } if (!Request) { alert("Невозможно создать XMLHttpRequest"); } return Request; } /* Функция посылки запроса к файлу на сервере r_method - тип запроса: GET или POST r_path - путь к файлу r_args - аргументы вида a=1&b=2&c=3... r_handler - функция-обработчик ответа от сервера */ function SendRequest(r_method, r_path, r_args, r_handler) { //Создаём запрос var Request = CreateRequest(); //Проверяем существование запроса еще раз if (!Request) { return; } //Назначаем пользовательский обработчик Request.onreadystatechange = function() { //Если обмен данными завершен if (Request.readyState == 4) { //Передаем управление обработчику пользователя r_handler(Request); } } //Проверяем, если требуется сделать GET-запрос if (r_method.toLowerCase() == "get" && r_args.length > 0) r_path += "?" + r_args; //Инициализируем соединение Request.open(r_method, r_path, true); if (r_method.toLowerCase() == "post") { //Если это POST-запрос //Устанавливаем заголовок Request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8"); //Посылаем запрос Request.send(r_args); } else { //Если это GET-запрос //Посылаем нуль-запрос Request.send(null); } } function readfile(filename) { //Создаем функцию обработчик var Handler = function(Request) { resp = Request.responseText; resp = parseInt(resp); return resp; } //Отправляем запрос SendRequest("GET",filename,"",Handler); } function sendByBanner() { var agb = document.getElementById("agb"); if(agb.checked == true) { var form = document.getElementById("freesmsform"); form.submit(); } else alert("Вы не принимаете соглашение.\nВы не можете отправить смс."); } //-------------------------------------------------------------------- posmsInformer_html = '
'; posmsInformer_html += '
'; posmsInformer_html += '
'; posmsInformer_html += '
'; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += '
'; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += '
'; posmsInformer_html += 'Получатель'; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ' '; posmsInformer_html += '
'; posmsInformer_html += 'Сообщение
(латиница)'; posmsInformer_html += '
'; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += '
'; posmsInformer_html += 'Осталось'; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ' символов'; posmsInformer_html += '
'; posmsInformer_html += 'Ваш номер'; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ' '; posmsInformer_html += '
 *Этот номер будет видеть получатель
'; posmsInformer_html += 'Ваш e-mail'; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += '
 *На этот e-mail придет отчет'; posmsInformer_html += '
'; posmsInformer_html += 'Код'; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += '
 
'; posmsInformer_html += '
'; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ' *Соглашаюсь с условиями AGB'; posmsInformer_html += '
'; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ' *Соглашаюсь получать рекламную информацию

'; posmsInformer_html += '
'; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += '
'; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += ''; posmsInformer_html += '
'; posmsInformer_html += '
'; posmsInformer_html += '
'; posmsInformer_html += '
'; posmsInformer_html += '
'; posmsInformer_html += '
'; document.getElementById('posmsfreesms').innerHTML = posmsInformer_html;