!function() { var d = document, w = window, conf = { lang: 'en', url: 'https%3A%2F%2Fwww.the-essays.com%2Forder%3F__utmla%3D9bfa07d4be85ad32acdee16ab669bdb4', containerId: 'myIdContainer2', component: 'type2', exposition: '', addStyle: function(href) { var d = document, s = d.createElement('link'); s.rel = 'stylesheet'; s.type = 'text/css'; s.href = href; d.head.appendChild(s); }, addScript: function(src) { var d = document, s = d.createElement('script'); s.src = src; d.body.appendChild(s); }, addTemplate: function(path) { var c = document.getElementById(this.containerId); c.innerHTML = path; } }; conf.addStyle('https://www.dsa7.net/css/app.css'); conf.addScript('https://www.dsa7.net/js/jquery.js'); conf.addScript('https://www.dsa7.net/js/validate.js'); conf.addTemplate('
Price calculator
We`ve got the best prices, check out yourself!
Urgency
Pages
Our Price
0
0

'); function l() { var c = $('#' + conf.containerId), f = c.find('form'), fd = c.find('.m-prtnrsForm06__select[name="pp[type]"]'), fl = c.find('.m-prtnrsForm06__select[name="pp[level]"]'), fu = c.find('.m-prtnrsForm06__select[name="pp[urgency]"]'), fp = c.find('.m-prtnrsForm06__select[name="pp[pages]"]'), pr = c.find('.m-prtnrsForm06__priceValue'), prf = c.find('.m-prtnrsForm06__priceValueFull'), ds = c.find('.m-prtnrsForm06__discount'); c.find('input, select, button').attr('disabled', true); $.ajax({ dataType: 'json', url: 'https://www.dsa7.net/data?url=' + conf.url + '&component=' + conf.component , success: function(data) { function createListDoctype() { fd.empty(); var g = []; $.each(data.doctype, function(key) { if (g.indexOf(this.group) == -1) { g.push(this.group); } }); for (var i = 0; i < g.length; i++) { var gr = $('').attr('label', g[i]).appendTo(fd); $.each(data.doctype, function(key) { if (this.group == g[i]) { gr.append(new Option(this.value, key)); } }); } } function createListLevel(d, active) { fl.empty(); var ss = 0; $.each(data.doctype[d].level, function(key) { if (this.value == active) { ss = key; } if (this.is_default && ss == 0) { ss = key; } fl.append(new Option(this.value, key)); }); fl.find('option[value="' + ss + '"]').attr('selected', true); } function createListUrgency(d, l, active) { fu.empty(); var ss = 0; $.each(data.doctype[d].level[l].urgency, function (key) { if (this.value == active) { ss = key; } if (this.is_default && ss == 0) { ss = key; } fu.append(new Option(this.value, key)); }); fu.find('option[value="' + ss + '"]').attr('selected', true); } function numberOfElements(d) { var limit = data.page.page_limits[d], urgencyInDays = data.urgency_in_days, cvU = fu.find('option:selected').attr('value'), ctT = fd.find('option:selected').attr('value'), count = data.page.count[d]; if (limit == 0) { return 200; } switch (urgencyInDays[cvU]) { case 0.25: $max = 6; if (ctT == 'Multiple Choice Questions') { $max = 15; } else if (ctT == 'Math\/Physics\/Chemistry problems' || ctT == 'Accounting\/Statistic\/Economic problems') { $max = 3; } else if (ctT == 'Statistics project') { $max = 3; } break; case 0.33: $max = 10; if (ctT == 'Multiple Choice Questions') { $max = 25; } else if (ctT == 'Math\/Physics\/Chemistry problems' || ctT == 'Accounting\/Statistic\/Economic problems') { $max = 3; } else if (ctT == 'Statistics project') { $max = 3; } break; case 0.5: $max = 10; if (ctT == 'Multiple Choice Questions') { $max = 37; } else if (ctT == 'Math\/Physics\/Chemistry problems' || ctT == 'Accounting\/Statistic\/Economic problems') { $max = 4; } break; case 1: $max = 1.5 * urgencyInDays[cvU] * limit; if (ctT == 'Math\/Physics\/Chemistry problems' || ctT == 'Accounting\/Statistic\/Economic problems') { $max = 6; } break; default: $max = 1.5 * urgencyInDays[cvU] * limit; } if ($max <= count) { return $max; } return count; } function createPage(d, active) { var datapage = data.page, pageLabel = $('.m-prtnrsForm06__inputLabelPages'), count = numberOfElements(d), a = 1; pageLabel.text(datapage.label[d]); fp.empty(); for (var i = 1; i <= count; i++) { var text = datapage.text[d], page = '', value = ''; if (text != '') { text = (i == 1) ? text : text + 's'; } page = (datapage.per_page[d] != 0) ? (' / ' + (datapage.per_page[d] * i) + ' words') : ''; value = i + ' ' + text + page; if (i == active) { a = i; } fp.append(new Option(value, i)); } fp.find('option[value="' + a + '"]').attr('selected', true); return a; } function createPrice(d, l, u, p = 1) { var price = 0; var priceDiscount = 0; $.each(data.doctype[d].level[l].urgency[u].price, function() { price = this.value; }); p = (p <= 1) ? price : (price * p); if (!$.isEmptyObject(data.discount)) { priceDiscount = p - ( p * (data.discount.value/100) ); prf.html(parseFloat(p).toFixed(2)).removeClass('hide'); pr.html(parseFloat(priceDiscount).toFixed(2)); } else { pr.html(parseFloat(p).toFixed(2)); } } function setDiscount() { ds.val(); if (!$.isEmptyObject(data.discount)) { ds.val(data.discount.name); } } function work() { var d = null, l = null, u = null, p = 1; fp.on('change', function() { p = createPage(d, fp.find('option:selected').attr('value')); createPrice(d, l, u, p); }); fu.on('change', function() { u = fu.val(); fp.change(); }); fl.on('change', function() { l = fl.val(); createListUrgency(d, l, fu.find('option:selected').attr('value')); fu.change(); }); fd.on('change', function() { d = fd.val(); createListLevel(d, fl.find('option:selected').attr('value')); fl.change(); fp.change(); }); fd.change(); } createListDoctype(); setDiscount(); work(); if(conf.exposition == undefined || !conf.exposition) { c.find('button').attr('disabled', false); } c.find('input, select').attr('disabled', false); } }); new FormValidator(f.attr('name'), [{ name: fd.attr('id'), display: 'Type of assignment', rules: 'required' }, { name: fl.attr('id'), display: 'Level', rules: 'required' }, { name: fu.attr('id'), display: 'Urgency', rules: 'required' }, { name: fp.attr('id'), display: 'Page', rules: 'required' }], function(errors, event) { $('input, select').removeClass('m-prtnrsForm06__select--error'); for (var i = 0; i < errors.length; i++) { $('#' + errors[i].id).addClass('m-prtnrsForm06__select--error'); } }); } if (d.readyState == 'complete'){ l(); } else { if (w.attachEvent){ w.attachEvent('onload', l); } else { w.addEventListener('load', l, false); } } }(window, document);