var ajax_httpdir='https://wmcasher.ru';var request = false; try { request = new XMLHttpRequest(); } catch (trymicrosoft) { try { request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (othermicrosoft) { try { request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (failed) { request = false; } } } if (!request) alert("Error initializing XMLHttpRequest!"); function showLayer(descr) { if(document.getElementById(descr).style.display == "none" ) { document.getElementById(descr).style.display = "inline"; } else { document.getElementById(descr).style.display = "none"; } } function checkvalue(varchanged) { var id_source_in = document.getElementById("id_source_in").value; var id_source_out = document.getElementById("id_source_out").value; var varchangedvalue = document.getElementById(varchanged).value; if (varchangedvalue=='') varchangedvalue='null'; var url2 = ajax_httpdir+"/formxml.php?mode=checkvalue&id_source_in=" + escape(id_source_in) +"&id_source_out=" + escape(id_source_out) +"&" + escape(varchanged) +"="+ escape(varchangedvalue); request.open("GET", url2, true); request.onreadystatechange = checkvaluedone; request.send(null); } function checkvaluedone() { if (request.readyState == 4) { if (request.status == 200) { var xmldoc2 = request.responseXML; var root = xmldoc2.getElementsByTagName('root').item(0); var errorname=root.childNodes[0].nodeName; var errorvalue=root.childNodes[0].childNodes[0].nodeValue; var Image = document.getElementById(errorname+"_statusimg"); var Check = document.getElementById(errorname+"_check"); if(errorvalue=='ok') { Image.setAttribute("src", "img/noerror.gif"); Check.value='1'; } else { Image.setAttribute("src", "img/error.gif"); Check.value='0'; } var helpvalue=root.childNodes[1].childNodes[0].nodeValue; if(helpvalue!='0') { document.getElementById(errorname+'_help').childNodes[0].nodeValue = helpvalue; } if(errorname=='voucher') { setTimeout("getCustomerInfo('summin')", 1000); } } else if (request.status == 404) { alert("Error checkvaluedone. URL does not exist."); } else { // alert("Error checkvaluedone. Status is: " + request.status); } } } function getCustomerInfo(varchanged) { var id_source_in = document.getElementById("id_source_in").value; var id_source_out = document.getElementById("id_source_out").value; if(varchanged) { var varchangedparam=document.getElementById(varchanged).value; } var type = document.getElementById("type").value; var url = ajax_httpdir+"/formxml.php?mode=summcheck&id_source_in=" + escape(id_source_in) +"&id_source_out=" + escape(id_source_out) + "&" +escape(varchanged) + "=" + escape(varchangedparam) +"&type="+ escape(type); //alert(url); request.open("GET", url, true); request.onreadystatechange = updatePage; request.send(null); var spinner = document.getElementById('spinner'); spinner.setAttribute("src", "img/spinner.gif"); } function updatePage() { if (request.readyState == 4) { if (request.status == 200) { var xmldoc = request.responseXML; var summin = xmldoc.getElementsByTagName('summin').item(0); document.getElementById("summin").value = summin.firstChild.nodeValue; var prefix_in = xmldoc.getElementsByTagName('prefix_in').item(0); document.getElementById("help_prefix_in").childNodes[0].nodeValue = prefix_in.firstChild.nodeValue; if(document.getElementById("summincomis")) { var summincomis = xmldoc.getElementsByTagName('summincomis').item(0); document.getElementById("summincomis").value = summincomis.firstChild.nodeValue; document.getElementById("help_prefixcomis_in").childNodes[0].nodeValue = prefix_in.firstChild.nodeValue; } var summout = xmldoc.getElementsByTagName('summout').item(0); document.getElementById("summout").value = summout.firstChild.nodeValue; var prefix_out = xmldoc.getElementsByTagName('prefix_out').item(0); document.getElementById("help_prefix_out").childNodes[0].nodeValue = prefix_out.firstChild.nodeValue; if(document.getElementById("curs")) { var curs = xmldoc.getElementsByTagName('curs').item(0); document.getElementById("curs").value = curs.firstChild.nodeValue; } if(document.getElementById("comis")) { var comis = xmldoc.getElementsByTagName('comis').item(0); document.getElementById("comis").value = comis.firstChild.nodeValue; } var spinner = document.getElementById('spinner'); spinner.setAttribute("src", "img/spacer.gif"); if(document.getElementById("koshelek")) setTimeout("checkvalue('koshelek')", 1000); } else if (request.status == 404) { alert("updatePage Error. URL does not exist."); } else { //alert("updatePage Error. Status is: " + request.status); } } } function wmidopen() { var wmid = document.getElementById("koshelek_help").childNodes[0].nodeValue; var url3='http://passport.webmoney.ru/asp/certview.asp?wmid=' + wmid; window.open(url3,'',''); } function showlayermultiform(source) { var currentselectedsource = document.getElementById('currentselectedsource').value; document.getElementById('source'+currentselectedsource).className = ""; document.getElementById('comises'+currentselectedsource).style.display = "none"; document.getElementById('source'+source).className = "white"; document.getElementById('comises'+source).style.display = "inline"; document.getElementById('currentselectedsource').value=source; } function coloriton(idchange) { document.getElementById(idchange).className = 'white'; } function coloritout(idchange) { var currentselectedsource = document.getElementById('currentselectedsource').value; if('source'+currentselectedsource!=idchange) { document.getElementById(idchange).className = ''; } } function showarr(source) { document.getElementById('arr'+source).style.display = "inline"; } function hidearr(source) { document.getElementById('arr'+source).style.display = "none"; } function user_selected_id_source_in() { document.getElementById('summin').value=0; document.getElementById('img_id_source_in').setAttribute('src', 'img/minisources/'+document.getElementById('id_source_in').value+'.png'); getCustomerInfo(''); } function user_selected_id_source_out() { //document.getElementById('summin').value=0; document.getElementById('img_id_source_out').setAttribute('src', 'img/minisources/'+document.getElementById('id_source_out').value+'.png'); getCustomerInfo('summin'); }