Skip to content

@inspiredjw /paygate.js secret
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
paygate
/*
* PayGate OpenPayAPI version 4.3.18
* last updated at 2012.12.3
* copyright at PayGate Co., Ltd.
*/
var scriptid = 1, pgioArray = [], cnt = 0, forsha256 = false, url, langlib, lastDomCaller, AURL, remotewin, kindCSS, pay_rslt, pay_rslt_msg, trnsctn_dt, acquire_reqst_dt, sttl_dt, cncl_dt, pay_mthd, pay_amt, rmt_from_bnk_cd, rmt_from_accnt_no, crd_tp, crd_no, profile_no, crd_expr_mm, crd_expr_yyyy, crd_instll_cnt, crd_apprvl_no, usr_id, msg_rcptr, deal_crd_cmpny, mem_no, mrchnt_no, crd_prfx_no, mb_serial_no, trnsctn_st, taxcontactphone, taxcontactemail, taxcontactname, taxdepartment, taxbizitem, taxbiztype, taxaddr, taxrepresentative, taxcompanyname, taxvatregno, taxflag, md, cavv, eci, xid, actionURL, confirmpw, memno, sessid, acssuburl, acsurl, fromDT, loanSt, cardownernumber, receipttocountrycode, receipttotel, receipttoname, receipttoaddr, tid, cardauthcode, replycode, cardquota, cardexpireyear, returnpage, livescript, livescript2, livescript3, currentime, validationstatus, strConfirmMsg, platform, saveCardNum, apicommonlib, r0, r1, r2, r3, r4, msg, realpan, pares, goodcurrency, cardexpiremonth, errorString = '', getmaxlength = 1500, pubkeys, paygate, pubencryptionkeys;
var serverstatusflag = false;
document.write('<div id="PGIOheader"></div>');
document.write("<div id='div_lgdacom'></div>");
document.write("<div id='dop_parent'></div>");
function doTransaction(form) {
validationstatus = 1;
currentime = new Date();
initPGIOElements();
}
function doTransaction2() {
loadUI();
}
function doTransaction3() {
detectInformation();
}
function variablefun(){
this.ispguide = "https://service.paygate.net/img/isp/installIspDwn.html";
this.fullVersion = ''+parseFloat(navigator.appVersion);
this.nAgt = navigator.userAgent;
this.browserName = navigator.appName;
this.serverwaitmessage = "";
this.BrowserAppname = navigator.appName; //used
this.navigatorUserAgent = navigator.userAgent; //used
this.navigatorAppCodeName = navigator.appCodeName; //used
this.navigatorLanguage = navigator.language; //used
this.navigatorPlatform = navigator.platform; //used
this.documentTitle = document.title; //used
this.documentURL = document.URL; //used
this.documentReferrer = document.referrer; //used
this.documentCookie = getCookie();
this.gKbdCtrl = new Array('','','', '', '', '', '', '');
this.gKbdCtrlValue = new Array('','','', '', '', '', '', '');
this.openpayapihash = arguments.callee.toString().replace(/\W/g,"").toUpperCase();
this.DacomXPay = "<OBJECT id='XPayUpdater' classid='CLSID:9963FACF-7618-417B-B6DD-AB8B65AF8CD1' style='display:none' width='0' height='0' codebase='https://pgdownload.dacom.net/lgdacom/LGDacomXPayUpdater.cab#version=1,0,0,20' ></OBJECT>";
this.actionURLTarget = 'https://service.paygate.net';
this.charsetpool = "UTF-8 EUC-KR Shift-JIS EUC-JP GB2312 BIG5";
this.ReElementName = "";
this.ReElementValue = "";
this.detectPlatformHash;
this.langcodepool = "KR US JP CN TW";
this.domainInfo = true;
this.is_bufferlimit = true;
function getCookie(){
var name = 'COOKIE';
var cookies = document.cookie;
if (cookies.indexOf(name) != -1){
var startpos = cookies.indexOf(name)+name.length+1;
var endpos = cookies.indexOf(";",startpos)-1;
if (endpos == -2) endpos = cookies.length;
var returnCoo = unescape(cookies.substring(startpos,endpos));
return returnCoo;
}else{
return false;
}
}
forsha256 = true;
this.openpayapihash = SHA256(this.openpayapihash + SHA256(arguments.callee.toString().replace(/\W/g,"").toUpperCase()));
}
function apiMember(form) {
doTransaction(form);
}
function IntegrityCheck(){
if (getPGIOElement('charset').search('UTF-8') > -1) actionURL = paygatevars.actionURLTarget + '/INTL/IntegrityCheck.jsp';
else if (getPGIOElement('charset').search('EUC-KR') > -1) actionURL = paygatevars.actionURLTarget + '/payment/IntegrityCheck.jsp';
else if (getPGIOElement('charset').search('Shift-JIS') > -1) actionURL = paygatevars.actionURLTarget + '/JP/IntegrityCheck.jsp';
else if (getPGIOElement('charset').search('EUC-JP') > -1) actionURL = paygatevars.actionURLTarget + '/EUCJP/IntegrityCheck.jsp';
else if (getPGIOElement('charset').search('GB2312') > -1) actionURL = paygatevars.actionURLTarget + '/CN/IntegrityCheck.jsp';
else if (getPGIOElement('charset').search('BIG5') > -1) actionURL = paygatevars.actionURLTarget + '/CNB5/IntegrityCheck.jsp';
else actionURL = paygatevars.actionURLTarget + '/payment/IntegrityCheck.jsp';
var urlstring = 'openpayapihash=' + paygatevars.openpayapihash +
'&generateKeypair=true';
DirectDOMRequest(actionURL, urlstring, 'POST', 'IntegrityCheckResult', '', 'UTF-8');
}
function IntegrityCheckResult(jData){
pubkeys = jData.ResultSet.Keys;
paygate = jData.ResultSet.Result;
if (paygate.serverstatus == "OK") serverstatusflag = true;
setPGIOElement('rsaencryption', paygate.rsaencryption);
doTransaction2();
}
function loadPubEncryptionKeys() {
if ("true" == getPGIOElement('rsaencryption')) {
$.jCryption.getKeys(pubkeys, function(receivedKeys) {
pubencryptionkeys = receivedKeys;
});
}
doTransaction3();
}
function checkIntegrity(functionarguments, nextfunction) {
paygatevars.openpayapihash = SHA256(paygatevars.openpayapihash + SHA256(functionarguments.callee.toString().replace(/\W/g,"").toUpperCase()));
if (paygate.Integrity) {
paygate.integritystatus = true;
}
if(nextfunction == 'SHA256()'){
paygate.sha256Fun = true;
}
eval(nextfunction);
}
function getWaitMessage(langcode) {
var returnmessage = '';
if (getPGIOElement('charset') == 'UTF-8') {
if (langcode == 'CN') returnmessage = '请稍候.....';
else if (langcode == 'TW') returnmessage = '請稍候.....';
else if (langcode == 'KR') returnmessage = '잠시 기다리세요.....';
else if (langcode == 'JP') returnmessage = 'お待ちください.....';
else returnmessage = 'Please Wait.....';
} else {
returnmessage = 'Please Wait.....';
}
return returnmessage;
}
function detectInformation(){
paygate.waitMessage = getWaitMessage(getPGIOElement('langcode'));
displayStatus(paygate.waitMessage);
if ((paygate.verOffset=paygatevars.nAgt.indexOf("MSIE"))!=-1) {
paygatevars.browserName = "Explorer";
paygatevars.fullVersion = paygatevars.nAgt.substring(paygate.verOffset+5);
paygate.documentCharset = document.charset;
paygatevars.is_bufferlimit = true;
}
else if ((paygate.verOffset=paygatevars.nAgt.indexOf("Opera"))!=-1) {
paygatevars.browserName = "Opera";
paygatevars.fullVersion = paygatevars.nAgt.substring(paygate.verOffset+6);
paygatevars.is_bufferlimit = false;
}
else if ((paygate.verOffset=paygatevars.nAgt.indexOf("Chrome"))!=-1) {
paygatevars.browserName = "Chrome";
paygatevars.fullVersion = paygatevars.nAgt.substring(paygate.verOffset+7);
paygatevars.is_bufferlimit = false;
}
else if ((paygate.verOffset=paygatevars.nAgt.indexOf("Safari"))!=-1) {
paygatevars.browserName = "Safari";
paygatevars.fullVersion = paygatevars.nAgt.substring(paygate.verOffset+7);
paygatevars.is_bufferlimit = false;
}
else if ((paygate.verOffset=paygatevars.nAgt.indexOf("Firefox"))!=-1) {
paygatevars.browserName = "Firefox";
paygatevars.fullVersion = paygatevars.nAgt.substring(paygate.verOffset+8);
paygatevars.is_bufferlimit = false;
}
else if ((paygate.verOffset=paygatevars.nAgt.indexOf("Maple"))!=-1) {
paygatevars.browserName = "Maple";
paygatevars.fullVersion = paygatevars.nAgt.substring(paygate.verOffset+8);
paygatevars.is_bufferlimit = false;
}
else if ( (paygate.nameOffset=paygatevars.nAgt.lastIndexOf(' ')+1) < (paygate.verOffset=paygatevars.nAgt.lastIndexOf('/')) )
{
paygatevars.browserName = paygatevars.nAgt.substring(paygate.nameOffset,paygate.verOffset);
paygatevars.fullVersion = paygatevars.nAgt.substring(paygate.verOffset+1);
paygatevars.is_bufferlimit = false;
if (paygatevars.browserName.toLowerCase()==paygatevars.browserName.toUpperCase()) {
paygatevars.browserName = navigator.appName;
}
}
if ((paygate.ix=paygatevars.fullVersion.indexOf(";"))!=-1) paygatevars.fullVersion=paygatevars.fullVersion.substring(0,paygate.ix);
if ((paygate.ix=paygatevars.fullVersion.indexOf(" "))!=-1) paygatevars.fullVersion=paygatevars.fullVersion.substring(0,paygate.ix);
if (navigator.appVersion.indexOf("Win")!=-1) paygate.OSName="Windows";
if (navigator.appVersion.indexOf("Mac")!=-1) paygate.OSName="MacOS";
if (navigator.appVersion.indexOf("X11")!=-1) paygate.OSName="UNIX";
if (navigator.appVersion.indexOf("Linux")!=-1) paygate.OSName="Linux";
if (navigator.appVersion.indexOf("iPhone OS") != -1) paygate.OSName="IPHONE";
if (navigator.appVersion.indexOf("Android") != -1) paygate.OSName="ANDROID";
if (navigator.appVersion.indexOf("iPad") != -1) paygate.OSName="IPAD";
if (parseInt(navigator.appVersion)>3) {
paygate.screenW = screen.width;
paygate.screenH = screen.height;
}
else if (navigator.appName == "Netscape"
&& parseInt(navigator.appVersion)==3
&& navigator.javaEnabled()
)
{
var jToolkit = java.awt.Toolkit.getDefaultToolkit();
var jScreenSize = jToolkit.getScreenSize();
paygate.screenW = jScreenSize.width;
paygate.screenH = jScreenSize.height;
}
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
paygate.winW = window.innerWidth;
paygate.winH = window.innerHeight;
}
if (navigator.appName.indexOf("Microsoft")!=-1) {
paygate.winW = document.body.offsetWidth;
paygate.winH = document.body.offsetHeight;
}
if (navigator.appName.indexOf("Maple")!=-1) {
paygate.winW = document.body.offsetWidth;
paygate.winH = document.body.offsetHeight;
}
}
if(paygate.serviceoption.S00020=='2')
{
app.step7();
}
else
{
}
detectPlatform();
}
function detectPlatformHash(HASH){
}
function detectPlatform() {
if (validationstatus > 0) genTID();
var browser = 'UNKNOWN';
var os = 'UNKNOWN';
cnt = 0;
platform = browser + '_' + os;
setPGIOElement('platform',platform);
detectPlatformHash(paygatevars.browserName);
detectPlatformHash(paygatevars.fullVersion);
detectPlatformHash(paygatevars.BrowserAppname);
detectPlatformHash(paygatevars.navigatorUserAgent);
detectPlatformHash(paygatevars.navigatorAppCodeName);
if(paygatevars.navigatorLanguage != undefined){
detectPlatformHash(paygatevars.navigatorLanguage);
}
detectPlatformHash(paygatevars.navigatorPlatform);
detectPlatformHash(paygate.OSName);
detectPlatformHash(paygate.screenW);
detectPlatformHash(paygate.screenH);
detectPlatformHash(paygate.winW);
detectPlatformHash(paygate.winH);
detectPlatformHash(paygatevars.documentTitle);
detectPlatformHash(paygatevars.documentURL);
detectPlatformHash(paygatevars.documentReferrer);
detectPlatformHash(paygate.documentCharset);
detectPlatformHash(paygatevars.documentCookie);
detectPlatformHash(getPGIOElement('mid'));
actionURL = paygatevars.actionURLTarget+'/INTL/detectPlatform.jsp';
var urlstring = 'detectPlatformHash='+paygatevars.detectPlatformHash +
'&mid='+getPGIOElement('mid')+
'&tid='+getPGIOElement('tid')+
'&browserName='+paygatevars.browserName+
'&fullVersion='+paygatevars.fullVersion+
'&OSName='+paygate.OSName+
'&documentURL='+encodeURIComponent(paygatevars.documentURL);
paygate.waitMessage = getWaitMessage(getPGIOElement('langcode'));
displayStatus(paygate.waitMessage);
DirectDOMRequest(actionURL, urlstring, 'POST', 'platformDetectedFromServer', '',getPGIOElement('charset'));
}
function platformDetectedFromServer(jData) {
if(jData.ResultSet.Result[0].sessHash == 'true'){
paygate.catpchaSeach = 'true';
}
if(jData.ResultSet.Result[0].sessHash == 'true'){
paygate.catpchaSeach = 'true';
}
if(jData.ResultSet.Result[0].use_dmain != 'true'){
paygatevars.domainInfo = false;
}
if(jData.ResultSet.Result[0].httpVerify != 'true'){
paygate.httpVerify = true;
}
paygate.platformdetected = true;
if(jData.ResultSet.Result[0].usecheck == 'false' && getPGIOElement('paymethod')=='card'){
setPGIOElement('paymethod', '100');
}
if(paygatevars.domainInfo){
if(paygate.OSName =="IPAD"){
paygate.OSName="IPHONE";
}
if(!paygate.httpVerify && (getPGIOElement('paymethod') =='card' || getPGIOElement('paymethod') =='100' ||
getPGIOElement('paymethod') =='101' || getPGIOElement('paymethod') =='104' || getPGIOElement('paymethod') =='108' )){
if(getPGIOElement('checkPopup') =='check'){
continuePayment();
}else{
if( getPGIOElement('socialnumber') == "" || getPGIOElement('socialnumber') == null ){
if(getPGIOElement('cardnumber') == "" || getPGIOElement('cardnumber') == null){
reStartPayment();
}else{
continuePayment();
}
}else{
continuePayment();
}
}
}else{
continuePayment();
}
}else{
var srclocno = "9999";
loadLiveScript(srclocno,'', 'UTF-8');
}
}
function reStartPayment(){
url = paygatevars.actionURLTarget+"/ajax/popupCardInformation.jsp?";
var formelement = document.getElementsByName("PGIOForm")[0];
for( var i=0; i < PGIOForm.elements.length; i++){
var e = formelement.elements[i];
if(i==0 ){
url += e.name +"="+ e.value ;
}else{
url +="&"+ e.name +"="+ e.value ;
}
}
if(url.indexOf("tid") ==-1){
url += "&tid="+getPGIOElement('tid');
}
popupHTTPS();
}
function popupHTTPS(){
var tempform = "";
var widthSize = 360;
var heightSize = 400;
var leftPos = (screen.width - widthSize) / 2;
var topPos = (screen.height - heightSize) / 2;
var winProps = 'scrollbars=yes, resizable=yes, dependent=no, status=yes, width='+widthSize+', height='+heightSize+'+, left='+leftPos+', top='+topPos+'';
remotewin = window.open('about:blank','popupWin', winProps);
if (remotewin == null)
{
var text1 ="";
var text2 = "";
if (getPGIOElement('charset') == 'UTF-8') {
if (langcode == 'CN') {
text1 = '请单击“继续”按钮,打开弹出窗口。';
text2 ='继续';
}else if (langcode == 'TW') {
text1 = '請點選[繼續]按鈕, 打開彈跳視窗.';
text2 ='繼續';
}else if (langcode == 'KR') {
text1 = '팝업을 차단을 해지 하신 후 카드정보를 입력해주시기 바랍니다.';
text2 ='차단 해제';
}else if (langcode == 'JP'){
text1 = '「続ける」ボタンをクリックしてポップアップウィンドウを開いてください。';
text2 ='次へ';
}else {
text1 = 'Click the Continue button to open popup window.';
text2 ='Continue';
}
} else {
text1 = 'Click the Continue button to open popup window.';
text2 ='Continue';
}
tempform= '<form name="cardPopUpForm">' +
'<table border=1 cellspacing=0 cellpadding=2 style="border-collapse:collapse;" bordercolor=#000000 width="385">' +
'<tr><td bgcolor="#EFEFE0" colspan=2 align="center"><font size=2><b>' +
text1 +
'</b></font></center></td></tr>' +
'<tr><td bgcolor="#DAD5D0" colspan=2><center><font size=2>' +
'<input class="popHTTPS" type="button" value="'+text2+'" style="cursor:hand; color:#3232ff; font-weight:bold;" onClick="javascript:popupHTTPS()">' +
'</font></center></td></tr>' +
'</table>' +
'</form>';
displayStatus(tempform);
}else{
remotewin.location.href =url;
displayStatus("Please proceed to payment from the pop-up window.");
setPGIOElement('checkPopup', 'check');
checkPopupcrdNO();
}
}
function checkPopupcrdNO() {
paygate.timeout = "600";
if(!remotewin .closed){
cnt++;
if(cnt > paygate.timeout) {
setPGIOElement('replycode', '6000');
remotewin.close();
loadAPICommon(getPGIOElement('mid'));
} else {
self.setTimeout("checkPopupcrdNO()", 1000);
}
}else{
setPGIOElement('checkPopupIs', 'check');
loadAPICommon(getPGIOElement('mid'));
}
}
function parseResult(Data) {
Result = Data;
Result = Result.replace(new RegExp("--NEWLINE--",'g'),'\n');
Result = Result.replace(new RegExp("--DQUOT--",'g'),'"');
Result = Result.replace(new RegExp("--SQUOT--",'g'),'\'');
Result = Result.replace(new RegExp("--CQUOT--",'g'),'/');
Result = Result.replace(new RegExp("--SEMI--",'g'),';');
Result = Result.replace(new RegExp("--OPEN--",'g'),'<');
Result = Result.replace(new RegExp("--CLOSE--",'g'),'>');
Result = Result.replace(new RegExp("--BOPEN--",'g'),'{');
Result = Result.replace(new RegExp("--BCLOSE--",'g'),'}');
Result = Result.replace(new RegExp("--COLON--",'g'),':');
Result = Result.replace(new RegExp("--QOPEN--",'g'),'[');
Result = Result.replace(new RegExp("--QCLOSE--",'g'),']');
Result = Result.replace(new RegExp("--SO--",'g'),'(');
Result = Result.replace(new RegExp("--SC--",'g'),')');
Result = Result.replace(new RegExp("--AMP--",'g'),'&');
return Result;
}
function initPGIOElements(pgioform) {
if (pgioform == null) pgioform = document.PGIOForm;
pgioArray.splice(0,pgioArray.length);
var elem = pgioform.elements;
var elemvar;
for(var i = 0; i < elem.length; i++) {
if (elem[i].name != '' || elem[i].name != 'undefined') {
elemvar = elem[i].value;
if (elemvar == 'undefined') elemvar = '';
pgioArray[elem[i].name] = elemvar;
}
}
changePriceToInt();
}
function changePriceToInt() {
if(getPGIOElement("cardnumber") == "MCPCHECK"){
setPGIOElement("replycode","pay103");
paygatevars.serverwaitmessage = "중복거래처리";
displayStatus2(paygatevars.serverwaitmessage);
//getPGIOresult();
}
var val = getPGIOElement('unitprice');
var n = val.indexOf(".");
if (n != -1)
{
if (val.substring(n + 1) == "00" || getPGIOElement('goodcurrency')=='JPY')
{
setPGIOElement('unitprice', parseInt(val));
pgioArray['unitprice'] = parseInt(val);
}
}
defineCharset();
}
function continuePayment() {
if (getPGIOElement('duplication') == 'on') {
alert('Duplication Error:' + getPGIOElement('duplication'));
validationstatus = 0;
}
if (validationstatus > 0) {
if (document.PGIOForm.name != 'PGIOForm') {
alert('Invalid PGIOForm name');
validationstatus = 0;
}
}
continueDoTransaction();
}
function defineCharset() {
if (getPGIOElement('charset') == '') {
setPGIOElement('charset', 'EUC-KR');
} else if (paygatevars.charsetpool.search(getPGIOElement('charset')) < 0) {
setPGIOElement('charset', 'EUC-KR');
}
if (getPGIOElement('langcode') == '') {
setPGIOElement('langcode', 'KR');
} else if (paygatevars.langcodepool.search(getPGIOElement('langcode')) < 0) {
setPGIOElement('langcode', 'KR');
}
IntegrityCheck();
self.setTimeout("checkSvrStatusFlag()",15000);
}
function checkSvrStatusFlag() {
if (!serverstatusflag) {
loadUI();
if(getPGIOElement('charset') == 'UTF-8'){
if(getPGIOElement('langcode') == 'KR') paygatevars.serverwaitmessage = "결제처리가 정상적으로 완료되지 않았기 때문에 다시 실행해 주십시요";
else if(getPGIOElement('langcode') == 'US') paygatevars.serverwaitmessage = "Payment process has not been completed properly. Please try again later.";
else if(getPGIOElement('langcode') == 'JP') paygatevars.serverwaitmessage = "決済処理が正常に完了していないので、再度実行してください。";
else if(getPGIOElement('langcode') == 'CN') paygatevars.serverwaitmessage = "因为 付款处理没有成功,请稍后重新运行.";
}else{
paygatevars.serverwaitmessage = "We are currently updating the server.<br>Please try it again later.";
}
setPGIOElement('replycode','E9999');
setPGIOElement('replyMsg', paygatevars.serverwaitmessage);
var cardnumber = getPGIOElement('cardnumber');
//카드번호 가운데자리 치환
if(cardnumber == null){
cardnumber = "";
}else{
var left = cardnumber.substring(0,6);
var center = cardnumber.substring(6,12);
var right = cardnumber.substring(12,17);
center = "******";
cardnumber = left + center + right;
}
setPGIOElement("cardnumber",cardnumber);
displayStatus2(paygatevars.serverwaitmessage);
getPGIOresult();
}
}
function continueDoTransaction() {
if (validationstatus > 0) {
if(!document.PGIOForm.elements['mid']){
alert("mid not exist");
validationstatus = 0;
}
}
loadAPICommon(getPGIOElement('mid'));
}
function getAAProcessURL() {
var url;
if (getPGIOElement('charset').search('UTF-8') > -1) url = paygatevars.actionURLTarget + '/INTL/NewPayProcessS.jsp';
else if (getPGIOElement('charset').search('EUC-KR') > -1) url = paygatevars.actionURLTarget + '/payment/payProcess.jsp';
else if (getPGIOElement('charset').search('Shift-JIS') > -1) url = paygatevars.actionURLTarget + '/JP/NewPayProcessS.jsp';
else if (getPGIOElement('charset').search('EUC-JP') > -1) url = paygatevars.actionURLTarget + '/EUCJP/NewPayProcessS.jsp';
else if (getPGIOElement('charset').search('GB2312') > -1) url = paygatevars.actionURLTarget + '/payment/CN/payProcessCN.jsp';
else if (getPGIOElement('charset').search('BIG5') > -1) url = paygatevars.actionURLTarget + '/CNB5/NewPayProcessS.jsp';
else url = paygatevars.actionURLTarget + '/payment/payProcess.jsp';
return url;
}
function getPayProcessURL() {
var url;
if (getPGIOElement('charset').search('UTF-8') > -1) url = paygatevars.actionURLTarget+'/INTL/NewPayProcessS.jsp';
else if (getPGIOElement('charset').search('EUC-KR') > -1) url = paygatevars.actionURLTarget+'/payment/payProcess.jsp';
else if (getPGIOElement('charset').search('Shift-JIS') > -1) url = paygatevars.actionURLTarget+'/JP/NewPayProcessS.jsp';
else if (getPGIOElement('charset').search('EUC-JP') > -1) url = paygatevars.actionURLTarget+'/EUCJP/NewPayProcessS.jsp';
else if (getPGIOElement('charset').search('GB2312') > -1) url = paygatevars.actionURLTarget+'/payment/CN/payProcessCN.jsp';
else if (getPGIOElement('charset').search('BIG5') > -1) url = paygatevars.actionURLTarget+'/CNB5/NewPayProcessS.jsp';
else url = paygatevars.actionURLTarget+'/payment/payProcess.jsp';
return url;
}
function genTID() {
var returnvalue;
if (getPGIOElement('tid') == '') {
clearPGIOElement('tid');
currentime = new Date();
returnvalue = getPGIOElement('mid') + '_' + currentime.getFullYear() + '-' + (currentime.getMonth()+1) + '-' + currentime.getDate() + '.' + currentime.getHours() + currentime.getMinutes() + currentime.getSeconds() + Math.floor(Math.random() * 10000).toString();
setPGIOElement('tid',returnvalue);
}
}
function DOMRequest(URL, urlstring, method, callbackname, uniqueid, request_charset) {
if (paygatevars.charsetpool.search(request_charset) < 0) request_charset = 'UTF-8';
var strlength = urlstring.length;
if (paygatevars.is_bufferlimit && strlength > getmaxlength) {
if (uniqueid.length < 5) {
uniqueid = getSessID();
}
paygate.separatedRequest = {
"url": URL,
"urlstring": urlstring,
"method":method,
"callbackname": callbackname,
"uniqueid": uniqueid,
"request_charset": request_charset,
"cnt": 0};
storeMSIEDOM();
} else {
DOMRequestAction(URL, urlstring, method, callbackname, uniqueid, request_charset);
}
}
function storeMSIEDOM() {
var surlstring = paygate.separatedRequest.urlstring.substring(0,getmaxlength);
paygate.separatedRequest.urlstring = paygate.separatedRequest.urlstring.replace(surlstring,'');
var SURL = 'https://api.paygate.net/s.php?' + 'O=' + paygate.separatedRequest.cnt + '&Q=' +
paygate.separatedRequest.uniqueid + '&S=' + surlstring;
var domreq = document.createElement("script");
domreq.setAttribute("language", "JavaScript");
domreq.setAttribute("type", "text/javascript");
domreq.setAttribute("charset",paygate.separatedRequest.request_charset);
domreq.setAttribute("src", SURL);
domreq.setAttribute("id", "PGIOScript" + scriptid++);
document.getElementsByTagName('head').item(0).appendChild(domreq);
}
function storeEncDOM() {
var surlstring = paygate.separatedRequest.encdata.substring(0,getmaxlength);
paygate.separatedRequest.encdata = paygate.separatedRequest.encdata.replace(surlstring,'');
var SURL = paygatevars.actionURLTarget + '/INTL/storeEncDOM.jsp?C=cED&' + 'O=' + paygate.separatedRequest.cnt + '&Q=' +
paygate.separatedRequest.uniqueid + '&S=' + encodeURIComponent(surlstring);
var domreq = document.createElement("script");
domreq.setAttribute("language", "JavaScript");
domreq.setAttribute("type", "text/javascript");
domreq.setAttribute("charset","UTF-8");
domreq.setAttribute("src", SURL);
domreq.setAttribute("id", "PGIOScript" + scriptid++);
document.getElementsByTagName('head').item(0).appendChild(domreq);
}
function storePartialDOM() {
var surlstring = paygate.separatedRequest.urlstring.substring(0,getmaxlength);
paygate.separatedRequest.urlstring = paygate.separatedRequest.urlstring.replace(surlstring,'');
var SURL = paygatevars.actionURLTarget + '/INTL/storeEncDOM.jsp?C=cPD&' + 'O=' + paygate.separatedRequest.cnt + '&Q=' +
paygate.separatedRequest.uniqueid + '&S=' + encodeURIComponent(surlstring);
var domreq = document.createElement("script");
domreq.setAttribute("language", "JavaScript");
domreq.setAttribute("type", "text/javascript");
domreq.setAttribute("charset","UTF-8");
domreq.setAttribute("src", SURL);
domreq.setAttribute("id", "PGIOScript" + scriptid++);
document.getElementsByTagName('head').item(0).appendChild(domreq);
}
function continueStoreOrAction() {
if (paygate.separatedRequest.urlstring.length > 0) {
paygate.separatedRequest.cnt = paygate.separatedRequest.cnt + 1;
storeMSIEDOM();
} else {
urlstring = "S=ON";
DOMRequestAction(paygate.separatedRequest.url, urlstring, paygate.separatedRequest.method, paygate.separatedRequest.callbackname, paygate.separatedRequest.uniqueid, paygate.separatedRequest.request_charset);
}
}
function cED() {
if (paygate.separatedRequest.encdata.length > 0) {
paygate.separatedRequest.cnt = paygate.separatedRequest.cnt + 1;
storeEncDOM();
} else {
urlstring = "STOREDATSESSION&sessid=" + paygate.separatedRequest.uniqueid;
debugwrite('sessid at cED:' + paygate.separatedRequest.uniqueid);
encryptedDOMRequest(paygate.separatedRequest.url, urlstring, paygate.separatedRequest.method, paygate.separatedRequest.callbackname, paygate.separatedRequest.uniqueid, paygate.separatedRequest.request_charset);
}
}
function cPD() {
if (paygate.separatedRequest.urlstring.length > 0) {
paygate.separatedRequest.cnt = paygate.separatedRequest.cnt + 1;
storePartialDOM();
} else {
urlstring = "partialdata=STOREDATSESSION&sessid=" + paygate.separatedRequest.uniqueid;
debugwrite('sessid at cED:' + paygate.separatedRequest.uniqueid);
normalDOMRequest(paygate.separatedRequest.url, urlstring, paygate.separatedRequest.method, paygate.separatedRequest.callbackname, paygate.separatedRequest.uniqueid, paygate.separatedRequest.request_charset);
}
}
function DOMRequestAction(URL, urlstring, method, callbackname, uniqueid, request_charset) {
if (paygatevars.charsetpool.search(request_charset) < 0) request_charset = 'UTF-8';
AURL = "";
AURL = 'https://api.paygate.net/p.php?';
AURL = AURL +
'M=' + method +
'&C=' + callbackname +
'&I=' + getPGIOElement('mid') +
'&Q=' + uniqueid +
'&U=' + encodeURIComponent(URL) +
'&' + urlstring;
var domreq = document.createElement("script");
domreq.setAttribute("language", "JavaScript");
domreq.setAttribute("type", "text/javascript");
domreq.setAttribute("charset", request_charset);
domreq.setAttribute("src", AURL);
domreq.setAttribute("id", "PGIOScript" + scriptid++);
document.getElementsByTagName('head').item(0).appendChild(domreq);
}
function saveLastCall() {
try {
var lastfunc = arguments.callee.caller.arguments.callee.caller.name;
var lastargs = arguments.callee.caller.arguments.callee.caller.arguments;
var lastcall = null;
lastcall = lastfunc + '(';
for (var i = 0; i < lastargs.length; i++) {
if (typeof(lastargs[i]) == 'string')
lastcall += "'" + lastargs[i] + "'";
else
lastcall += lastargs[i];
if (i != lastargs.length - 1)
lastcall += ',';
}
lastcall = lastcall + ')';
if (lastcall.indexOf('undefine') > -1) {
lastDomCaller = null;
} else {
lastDomCaller = lastcall;
}
} catch (e) {
lastDomCaller = lastcall;
}
}
function encryptData(paramname,returnparam)
{
if ("true" == getPGIOElement('rsaencryption')) {
$.jCryption.encrypt(getPGIOElement(paramname), pubencryptionkeys, function(encrypted) {
//clearPGIOElement(paramname);
setPGIOElement('enc' + paramname, "encdata_" + encrypted); //urlstring = encrypted;
eval(returnparam + '();');
});
} else {
setPGIOElement('enc' + paramname, getPGIOElement(paramname));
eval(returnparam + '();');
}
}
function DirectDOMRequest(URL, urlstring, method, callbackname, uniqueid, request_charset) {
displayStatus();
saveLastCall();
if (paygatevars.charsetpool.search(request_charset) < 0) request_charset = 'UTF-8';
//if (getPGIOElement('rsaencryption') == 'true') {
/*
$.jCryption.getKeys(pubkeys, function(receivedKeys) {
keys = receivedKeys;
});
*/
/*$.jCryption.encrypt(urlstring, keys, function(encrypted) {
//urlstring = encrypted;
encryptedDOMRequest(URL, encrypted, method, callbackname, uniqueid, request_charset);
});*/
//encryptData();
//} else {
normalDOMRequest(URL, urlstring, method, callbackname, uniqueid, request_charset );
//}
}
function encryptedDOMRequest(URL, encrypted, method, callbackname, uniqueid, request_charset) {
var strlength = encrypted.length;
if (paygatevars.is_bufferlimit && strlength > getmaxlength) {
debugwrite('STRLENGTH:' + strlength);
debugwrite('uniqueid:' + uniqueid);
if (uniqueid.length < 5) {
uniqueid = getSessID();
}
debugwrite('uniqueid.length:' + uniqueid.length );
paygate.separatedRequest = {
"url": URL,
"encdata": encrypted,
"method":method,
"callbackname": callbackname,
"uniqueid": uniqueid,
"request_charset": request_charset,
"cnt": 0};
debugwrite('paygate.separatedRequest:' + paygate.separatedRequest);
storeEncDOM();
} else {
AURL = URL +
'?callback=' + callbackname +
'&encrypted=true' +
'&charset=' + request_charset +
'&encdata=' + encrypted;
var domreq = document.createElement("script");
domreq.setAttribute("language", "JavaScript");
domreq.setAttribute("type", "text/javascript");
domreq.setAttribute("charset", request_charset);
domreq.setAttribute("src", AURL);
domreq.setAttribute("id", "PGIOScript" + scriptid++);
document.getElementsByTagName('head').item(0).appendChild(domreq);
}
}
function normalDOMRequest(URL, urlstring, method, callbackname, uniqueid, request_charset) {
var strlength = urlstring.length;
if (paygatevars.is_bufferlimit && strlength > getmaxlength) {
if (uniqueid.length < 5) {
uniqueid = getSessID();
}
paygate.separatedRequest = {
"url": URL,
"urlstring": urlstring,
"method":method,
"callbackname": callbackname,
"uniqueid": uniqueid,
"request_charset": request_charset,
"cnt": 0};
storePartialDOM();
} else {
AURL = URL +
'?callback=' + callbackname +
'&encrypted=false' +
'&charset=' + request_charset +
'&' + urlstring;
var domreq = document.createElement("script");
domreq.setAttribute("language", "JavaScript");
domreq.setAttribute("type", "text/javascript");
domreq.setAttribute("charset", request_charset);
domreq.setAttribute("src", AURL);
domreq.setAttribute("id", "PGIOScript" + scriptid++);
document.getElementsByTagName('head').item(0).appendChild(domreq);
}
}
function loadLiveScript(srcno,mid, request_charset) {
if (paygatevars.charsetpool.search(request_charset) < 0) request_charset = 'UTF-8';
var srcurl = "https://api.paygate.net/util/getsource.php?srcno=" + srcno + '&mid=' + getPGIOElement('mid') + '&tid=' + getPGIOElement('tid');
/*dothu - add i18n support*/
try {
var languageCode = getPGIOElement('langcode') ;
//alert(languageCode);
if (languageCode != null && languageCode != 'undefined' ){
srcurl += '&langcode=' + languageCode;
}
} catch (e) {
//ignored
}
if (getPGIOElement('paymethod') == 'card'
|| getPGIOElement('paymethod') == '100'
|| getPGIOElement('paymethod') == '101'
|| getPGIOElement('paymethod') == '102'
|| getPGIOElement('paymethod') == '103'
) {
if(getPGIOElement("cardtype") != "2Z0" &&
getPGIOElement("cardtype") != "2Y0" &&
getPGIOElement("cardtype") != "2J0" &&
getPGIOElement("cardtype") != "2A0"){
}
}
livescript = document.createElement("script");
livescript.setAttribute("language", "JavaScript");
livescript.setAttribute("type", "text/javascript");
livescript.setAttribute("charset", request_charset);
livescript.setAttribute("src", srcurl);
livescript.setAttribute("id", "PGIOScript" + scriptid++);
document.getElementsByTagName('head').item(0).appendChild(livescript);
}
function loadUI() {
var screen = document.getElementById('PGIOscreen');
var screenwidth = screen.style.width;
if('' == screenwidth){
screen.style.width = '320px';
}
if(document.PGIOForm.elements['kindcss'] ){
if(document.PGIOForm.elements['kindcss'].value != "off"){
if(document.PGIOForm.elements['kindcss'].value == "0"){
kindCSS = "4139";
loadLiveStyle(kindCSS,getPGIOElement('mid'));
}else if(document.PGIOForm.elements['kindcss'].value == "1"){
kindCSS = "4134";
loadLiveStyle(kindCSS,getPGIOElement('mid'));
}else if(document.PGIOForm.elements['kindcss'].value == "2"){
kindCSS = "4135";
loadLiveStyle(kindCSS,getPGIOElement('mid'));
}else if(document.PGIOForm.elements['kindcss'].value == "3"){
kindCSS = "4136";
loadLiveStyle(kindCSS,getPGIOElement('mid'));
}else if(document.PGIOForm.elements['kindcss'].value == "4"){
kindCSS = "4137";
loadLiveStyle(kindCSS,getPGIOElement('mid'));
}else if(document.PGIOForm.elements['kindcss'].value == "5"){
kindCSS = "4138";
loadLiveStyle(kindCSS,getPGIOElement('mid'));
}else{
kindCSS = "4139";
loadLiveStyle(kindCSS,getPGIOElement('mid'));
}
}
}else{
if(!document.PGIOForm.elements['kindcss'])
kindCSS = "4139";
loadLiveStyle(kindCSS,getPGIOElement('mid'));
}
if (serverstatusflag) loadJSLIB("4200", getPGIOElement('mid'));
}
function loadLiveStyle(srcno,mid) {
var srcurl = "https://api.paygate.net/util/getsource.php?srcno=" + srcno + '&mid=' + getPGIOElement('mid') + '&tid=' + getPGIOElement('tid');
/* dothu - add i18n support*/
try {
var languageCode = getPGIOElement('langcode') ;
//alert(languageCode);
if (languageCode != null && languageCode != 'undefined' ){
srcurl += '&langcode=' + languageCode;
}
} catch (e) {
//ignored
}
livescript = document.createElement("link");
livescript.setAttribute("rel", "stylesheet");
livescript.setAttribute("type", "text/css");
livescript.setAttribute("href", srcurl);
livescript.setAttribute("id", "PGIOStyle");
document.getElementsByTagName('head').item(0).appendChild(livescript);
}
function loadJSLIB(srcno, mid) {
var srcurl = "https://api.paygate.net/util/getsource.php?srcno=" + srcno + '&mid=' + mid;
livescript = document.createElement("script");
livescript.setAttribute("type", "text/javascript");
livescript.setAttribute("src", srcurl);
document.getElementsByTagName('head').item(0).appendChild(livescript);
}
function verifyReceived(tid, callbacksuccess, callbackfail) {
var trnsctnid = '';
if (tid == null || tid == 'undefined' || tid == '') {
trnsctnid = getPGIOElement('tid');
} else {
trnsctnid = tid;
}
if(callbacksuccess == null || callbacksuccess == 'undefined' || callbacksuccess == ''){
callbacksuccess = 'nocallbacksuccess';
}
if(callbackfail == null || callbackfail == 'undefined' || callbackfail == ''){
callbackfail = 'nocallbackfail';
}
actionURL = paygatevars.actionURLTarget+'/admin/settle/verifyReceived.jsp';
urlstring = 'tid=' + trnsctnid +
'&callbacksuccess=' + callbacksuccess +
'&callbackfail=' + callbackfail+
'&apilog=' + getPGIOElement('apilog');
DirectDOMRequest(actionURL, urlstring, 'POST', '', sessid, getPGIOElement('charset'));
}
function loadAPICommon(mid) {
var commonliburl ="";
if(paygate.IntegrityFunction == 'apiMember'){
commonliburl = "https://api.paygate.net/util/getsource.php?srcno=4150&mid=" + getPGIOElement('mid') + '&tid=' + getPGIOElement('tid');
}else{
commonliburl = "https://api.paygate.net/util/getsource.php?srcno=4130&mid=" + getPGIOElement('mid') + '&tid=' + getPGIOElement('tid');
}
apicommonlib = document.createElement("script");
apicommonlib.setAttribute("language", "JavaScript");
apicommonlib.setAttribute("type", "text/javascript");
apicommonlib.setAttribute("charset", getPGIOElement('charset'));
apicommonlib.setAttribute("src", commonliburl);
apicommonlib.setAttribute("id", "PGIOScript" + scriptid++);
document.getElementsByTagName('head').item(0).appendChild(apicommonlib);
}
function loadAPILanguage(apilangcode, mid, request_charset) {
if (paygatevars.charsetpool.search(request_charset) < 0) {
reqeust_charset = 'UTF-8';
}
var srcno;
if (apilangcode == 'US') {
srcno = '4131'; // US
} else if (apilangcode == 'JP') {
srcno = '4133'; // JP
} else if (apilangcode == 'CN') {
srcno = '4129'; // CN
} else if (apilangcode == 'TW') {
srcno = '4140'; // TW
} else {
srcno = '4132'; // KR
}
var langliburl = "https://api.paygate.net/util/getsource.php?srcno=" + srcno + "&mid=" + getPGIOElement('mid') + "&tid=" + getPGIOElement('tid');
langlib = document.createElement("script");
langlib.setAttribute("language", "JavaScript");
langlib.setAttribute("type", "text/javascript");
langlib.setAttribute("charset", request_charset);
langlib.setAttribute("src", langliburl);
langlib.setAttribute("id", "PGIOScript" + scriptid++);
document.getElementsByTagName('head').item(0).appendChild(langlib);
}
function onCallSessionAA(form){
paygate.typeTransactionAA = "AA_SESSION";
document.getElementById('sessionNo').value = getSessionParamAA();
initPGIOElements(form);
var srclocno = "1082";
loadLiveScript(srclocno,'', 'UTF-8');
}
function getSessionParamAA(){
var query = location.href.substring((location.href.indexOf('?')+1), location.href.length);
if(location.href.indexOf('?') < 0) query = '';
querysplit = query.split('&');
query = new Array();
for(var i = 0; i < querysplit.length; i++){
var namevalue = querysplit[i].split('=');
namevalue[1] = namevalue[1].replace(/\+/g, ' ');
query[namevalue[0]] = unescape(namevalue[1]);
}
return query['sessionNo'];
}
function addStatus(msg, id, position) {
var display = document.getElementById(id);
if (null == display) {
if (document.getElementById('PGIOscreen')) {
var form = document.getElementById('PGIOscreen');
var display = document.createElement("div");
display.setAttribute("id", id);
display.innerHTML = msg;
if(null == position)
form.appendChild(display);
else
insertAfter(position.parentNode, display, position);
}
}
}
function removeStatus(id) {
if (document.getElementById('PGIOscreen')) {
var display = document.getElementById(id);
display.parentNode.removeChild(display);
}
}
function displayStatus(msg) {
if (msg != null && msg != '') {
if (document.getElementById('PGIOscreen')) {
document.getElementById('PGIOscreen').innerHTML = msg;
makeGraceView();
}
}
}
function displayStatus2(msg) {
if (msg != null && msg != '') {
if (document.getElementById('PGIOscreen')) {
document.getElementById('PGIOscreen').innerHTML = msg;
}
}
}
function makeGraceView() {
autoWrap();
fixupInput();
}
function autoWrap() {
var screen = document.getElementById("PGIOscreen");
if (screen.innerHTML.indexOf("opa_form_content") < 0) {
var wrapped = '<div id="opa_form_title">PayGate Payment</div>' +
'<div id="opa_form_content">' +
screen.innerHTML +
'</div>' +
'<div id="opa_form_command">';
if (lastDomCaller != null) {
// clearTimeout(paygate._timer);
if(getPGIOElement('disable_autowrap') != 'true')
wrapped += '<input class="autoWrap" type="button" value="Continue" style="display:none;" onclick="javascript:'+ lastDomCaller +'">';
paygate._timer = setTimeout(function() {
arguments.caller;
var list = Szzl('input[value=Continue]');
for(var i = 0; i < list.length; i++)
list[i].style.display = 'inline';
}, 240000);
}
wrapped += '</div>';
screen.innerHTML = wrapped;
}
}
function progress() {
var title = document.getElementById("opa_form_title");
if (null == title)
return;
paygate.progress += 1;
var temp = title.innerHTML;
var re = /\[\d\]/g;
temp = temp.replace(re, '');
title.innerHTML = temp + '<span style="float:right; font-weight:normal; font-size: 75%; position:absolute; left:300px;">[' + paygate.progress + ']</span>';
}
function addEvent( obj, type, fn ){
if (obj.addEventListener)
obj.addEventListener( type, fn, false );
else if (obj.attachEvent)
{
obj["e"+type+fn] = fn;
obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
obj.attachEvent( "on"+type, obj[type+fn] );
}
}
function removeEvent( obj, type, fn ){
if (obj.removeEventListener)
obj.removeEventListener( type, fn, false );
else if (obj.detachEvent)
{
obj.detachEvent( "on"+type, obj[type+fn] );
obj[type+fn] = null;
obj["e"+type+fn] = null;
}
}
function insertAfter(parent, node, reference) {
parent.insertBefore(node, reference.nextSibling);
}
function fixupInput() {
try {
var list = null;
list = Szzl('#PGIOscreen form');
for (var i = 0; i < list.length; i++) {
list[i].onsubmit = function() {return false};
}
list = Szzl('#PGIOscreen select').concat(Szzl('#PGIOscreen input'));
for (var i = 0; i < list.length; i++) {
list[i].focus();
break;
}
list = Szzl('#PGIOscreen :button:not(.opa_osk)');
for (var i = 0; i < list.length; i++) {
addEvent(list[i], 'click', function(event) {
this.enabled = false;
this.style.color = "gray";
});
}
list = Szzl('#PGIOscreen input[type=password]');
for (var i = 0; i < list.length; i++) {
lengthHelper = document.createElement("span");
lengthHelper.className = 'opa_hint_string';
lengthHelper.id = 'opa_hint_stringID';
insertAfter(list[i].parentNode, lengthHelper, list[i]);
addEvent(list[i], 'keyup', function(event) {
this.nextSibling.innerHTML = this.value.length;
});
}
list = Szzl('#PGIOscreen input[class*=card]').concat(Szzl('#PGIOscreen input[name^=tmpexp]')).concat(Szzl('#PGIOscreen input[name$=no]'));
for (var i = 0; i < list.length; i++) {
list[i].onkeypress = function(evt) {
try {
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
} catch(e) {}
}
}
list = Szzl('#PGIOscreen input[class*=card]').concat(Szzl('#PGIOscreen input[name^=tmpexp]')).concat(Szzl('#PGIOscreen input[name$=no]'));
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
for (var i = 0; i < list.length; i++) {
list[i].setAttribute('pattern', '[0-9]*');
}
}
list = Szzl('#PGIOscreen input[class$=email]');
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
for (var i = 0; i < list.length; i++) {
list[i].setAttribute('type', 'email');
}
}
} catch(e){
}
}
function enter2next(e, method) {
var key;
if(window.event)
key = window.event.keyCode; //IE
else
key = e.which; //firefox
if(key == 13) {
eval(method);
return false;
}
}
function getPGIOElement(varname, formname) {
if(varname != null){
paygatevars.ReElementName = varname;
paygatevars.ReElementValue = formname;
}
if (formname == null) formname = document.PGIOForm;
if (pgioArray[varname]) {
var pgiovalue = pgioArray[varname];
if (pgiovalue == 'undefined') pgiovalue = '';
return pgiovalue;
} else if (formname.elements[varname]) {
if(formname.elements[varname].type == "select-one"){
return formname.elements[varname].value;
} else {
if (formname.elements[varname][0]) {
return formname.elements[varname][0].value;
} else {
return formname.elements[varname].value;
}
}
} else {
return '';
}
}
function setPGIOElement(varname, varvalue) {
if(varname != null){
paygatevars.ReElementName = varname;
paygatevars.ReElementValue = varvalue;
}
if (document.PGIOForm.elements[varname]) {
if (document.PGIOForm.elements[varname][0]) {
document.PGIOForm.elements[varname][0].value = varvalue;
} else {
document.PGIOForm.elements[varname].value = varvalue;
}
}
pgioArray[varname] = varvalue;
}
function changePGIOElement(fromElement, toElement, toValue) {
if (getPGIOElement(toElement) == '') {
var tempelement = getPGIOElement(fromElement);
setPGIOElement(toElement, tempelement);
setPGIOElement(fromElement, toValue);
}
}
function clearPGIOElement(varname) {
if (document.PGIOForm.elements[varname]) {
if (document.PGIOForm.elements[varname][0]) {
document.PGIOForm.elements[varname][0].value = '';
} else {
document.PGIOForm.elements[varname].value = '';
}
}
pgioArray[varname] = '';
}
function SHA256(s){
var chrsz = 8;
var hexcase = 0;
function safe_add (x, y) {
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
function S (X, n) { return ( X >>> n ) | (X << (32 - n)); }
function R (X, n) { return ( X >>> n ); }
function Ch(x, y, z) { return ((x & y) ^ ((~x) & z)); }
function Maj(x, y, z) { return ((x & y) ^ (x & z) ^ (y & z)); }
function Sigma0256(x) { return (S(x, 2) ^ S(x, 13) ^ S(x, 22)); }
function Sigma1256(x) { return (S(x, 6) ^ S(x, 11) ^ S(x, 25)); }
function Gamma0256(x) { return (S(x, 7) ^ S(x, 18) ^ R(x, 3)); }
function Gamma1256(x) { return (S(x, 17) ^ S(x, 19) ^ R(x, 10)); }
function core_sha256 (m, l) {
var K = new Array(0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, 0xE49B69C1, 0xEFBE4786, 0xFC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x6CA6351, 0x14292967, 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2);
var HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19);
var W = new Array(64);
var a, b, c, d, e, f, g, h, i, j;
var T1, T2;
m[l >> 5] |= 0x80 << (24 - l % 32);
m[((l + 64 >> 9) << 4) + 15] = l;
for ( var i = 0; i<m.length; i+=16 ) {
a = HASH[0];
b = HASH[1];
c = HASH[2];
d = HASH[3];
e = HASH[4];
f = HASH[5];
g = HASH[6];
h = HASH[7];
for ( var j = 0; j<64; j++) {
if (j < 16) W[j] = m[j + i];
else W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);
T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);
T2 = safe_add(Sigma0256(a), Maj(a, b, c));
h = g;
g = f;
f = e;
e = safe_add(d, T1);
d = c;
c = b;
b = a;
a = safe_add(T1, T2);
}
HASH[0] = safe_add(a, HASH[0]);
HASH[1] = safe_add(b, HASH[1]);
HASH[2] = safe_add(c, HASH[2]);
HASH[3] = safe_add(d, HASH[3]);
HASH[4] = safe_add(e, HASH[4]);
HASH[5] = safe_add(f, HASH[5]);
HASH[6] = safe_add(g, HASH[6]);
HASH[7] = safe_add(h, HASH[7]);
}
return HASH;
}
function str2binb (str) {
var bin = Array();
var mask = (1 << chrsz) - 1;
for(var i = 0; i < str.length * chrsz; i += chrsz) {
bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i%32);
}
return bin;
}
function Utf8Encode(string) {
string = string.replace(/\r\n/g,"\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
utftext += String.fromCharCode(c);
}
else if((c > 127) && (c < 2048)) {
utftext += String.fromCharCode((c >> 6) | 192);
utftext += String.fromCharCode((c & 63) | 128);
}
else {
utftext += String.fromCharCode((c >> 12) | 224);
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
utftext += String.fromCharCode((c & 63) | 128);
}
}
return utftext;
}
function binb2hex (binarray) {
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var str = "";
for(var i = 0; i < binarray.length * 4; i++) {
str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);
}
return str;
}
s = Utf8Encode(s);
return binb2hex(core_sha256(str2binb(s), s.length * chrsz));
}
function encodeChar(input) {
char = getPGIOElement('charset');
char = char.toUpperCase();
return encodeURIComponent(input);
}
/* Szzl selector */
(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,done=0,toString=Object.prototype.toString,hasDuplicate=false,baseHasDuplicate=true;[0,0].sort(function(){baseHasDuplicate=false;return 0});var Szzl=function(selector,context,results,seed){results=results||[];context=context||document;var origContext=context;if(context.nodeType!==1&&context.nodeType!==9){return[]}if(!selector||typeof selector!=="string"){return results}var parts=[],m,set,checkSet,extra,prune=true,contextXML=Szzl.isXML(context),soFar=selector,ret,cur,pop,i;do{chunker.exec("");m=chunker.exec(soFar);if(m){soFar=m[3];parts.push(m[1]);if(m[2]){extra=m[3];break}}}while(m);if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context)}else{set=Expr.relative[parts[0]]?[context]:Szzl(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector]){selector+=parts.shift()}set=posProcess(selector,set)}}}else{if(!seed&&parts.length>1&&context.nodeType===9&&!contextXML&&Expr.match.ID.test(parts[0])&&!Expr.match.ID.test(parts[parts.length-1])){ret=Szzl.find(parts.shift(),context,contextXML);context=ret.expr?Szzl.filter(ret.expr,ret.set)[0]:ret.set[0]}if(context){ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Szzl.find(parts.pop(),parts.length===1&&(parts[0]==="~"||parts[0]==="+")&&context.parentNode?context.parentNode:context,contextXML);set=ret.expr?Szzl.filter(ret.expr,ret.set):ret.set;if(parts.length>0){checkSet=makeArray(set)}else{prune=false}while(parts.length){cur=parts.pop();pop=cur;if(!Expr.relative[cur]){cur=""}else{pop=parts.pop()}if(pop==null){pop=context}Expr.relative[cur](checkSet,pop,contextXML)}}else{checkSet=parts=[]}}if(!checkSet){checkSet=set}if(!checkSet){Szzl.error(cur||selector)}if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet)}else if(context&&context.nodeType===1){for(i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&Szzl.contains(context,checkSet[i]))){results.push(set[i])}}}else{for(i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i])}}}}else{makeArray(checkSet,results)}if(extra){Szzl(extra,origContext,results,seed);Szzl.uniqueSort(results)}return results};Szzl.uniqueSort=function(results){if(sortOrder){hasDuplicate=baseHasDuplicate;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1)}}}}return results};Szzl.matches=function(expr,set){return Szzl(expr,null,null,set)};Szzl.find=function(expr,context,isXML){var set;if(!expr){return[]}for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.leftMatch[type].exec(expr))){var left=match[1];match.splice(1,1);if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break}}}}if(!set){set=context.getElementsByTagName("*")}return{set:set,expr:expr}};Szzl.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&Szzl.isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.leftMatch[type].exec(expr))!=null&&match[2]){var filter=Expr.filter[type],found,item,left=match[1];anyFound=false;match.splice(1,1);if(left.substr(left.length-1)==="\\"){continue}if(curLoop===result){result=[]}if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true}else if(match===true){continue}}if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true}else{curLoop[i]=false}}else if(pass){result.push(item);anyFound=true}}}}if(found!==undefined){if(!inplace){curLoop=result}expr=expr.replace(Expr.match[type],"");if(!anyFound){return[]}break}}}if(expr===old){if(anyFound==null){Szzl.error(expr)}else{break}}old=expr}return curLoop};Szzl.error=function(msg){throw"Syntax error, unrecognized expression: "+msg;};var Expr=Szzl.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href")}},relative:{"+":function(checkSet,part){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag){part=part.toLowerCase()}for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}checkSet[i]=isPartStrNotTag||elem&&elem.nodeName.toLowerCase()===part?elem||false:elem===part}}if(isPartStrNotTag){Szzl.filter(part,checkSet,true)}},">":function(checkSet,part){var isPartStr=typeof part==="string",elem,i=0,l=checkSet.length;if(isPartStr&&!/\W/.test(part)){part=part.toLowerCase();for(;i<l;i++){elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName.toLowerCase()===part?parent:false}}}else{for(;i<l;i++){elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part}}if(isPartStr){Szzl.filter(part,checkSet,true)}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck,nodeCheck;if(typeof part==="string"&&!/\W/.test(part)){part=part.toLowerCase();nodeCheck=part;checkFn=dirNodeCheck}checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML)},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck,nodeCheck;if(typeof part==="string"&&!/\W/.test(part)){part=part.toLowerCase();nodeCheck=part;checkFn=dirNodeCheck}checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML)}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[]}},NAME:function(match,context){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i])}}return ret.length===0?null:ret}},TAG:function(match,context){return context.getElementsByTagName(match[1])}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match}for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").replace(/[\t\n]/g," ").indexOf(match)>=0)){if(!inplace){result.push(elem)}}else if(inplace){curLoop[i]=false}}}return false},ID:function(match){return match[1].replace(/\\/g,"")},TAG:function(match,curLoop){return match[1].toLowerCase()},CHILD:function(match){if(match[1]==="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]==="even"&&"2n"||match[2]==="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0}match[0]=done++;return match},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name]}if(match[2]==="~="){match[4]=" "+match[4]+" "}return match},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if((chunker.exec(match[3])||"").length>1||/^\w/.test(match[3])){match[3]=Szzl(match[3],null,null,curLoop)}else{var ret=Szzl.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret)}return false}}else if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true}return match},POS:function(match){match.unshift(true);return match}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden"},disabled:function(elem){return elem.disabled===true},checked:function(elem){return elem.checked===true},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true},parent:function(elem){return!!elem.firstChild},empty:function(elem){return!elem.firstChild},has:function(elem,i,match){return!!Szzl(match[3],elem).length},header:function(elem){return(/h\d/i).test(elem.nodeName)},text:function(elem){return"text"===elem.type},radio:function(elem){return"radio"===elem.type},checkbox:function(elem){return"checkbox"===elem.type},file:function(elem){return"file"===elem.type},password:function(elem){return"password"===elem.type},submit:function(elem){return"submit"===elem.type},image:function(elem){return"image"===elem.type},reset:function(elem){return"reset"===elem.type},button:function(elem){return"button"===elem.type||elem.nodeName.toLowerCase()==="button"},input:function(elem){return(/input|select|textarea|button/i).test(elem.nodeName)}},setFilters:{first:function(elem,i){return i===0},last:function(elem,i,match,array){return i===array.length-1},even:function(elem,i){return i%2===0},odd:function(elem,i){return i%2===1},lt:function(elem,i,match){return i<match[3]-0},gt:function(elem,i,match){return i>match[3]-0},nth:function(elem,i,match){return match[3]-0===i},eq:function(elem,i,match){return match[3]-0===i}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array)}else if(name==="contains"){return(elem.textContent||elem.innerText||Szzl.getText([elem])||"").indexOf(match[3])>=0}else if(name==="not"){var not=match[3];for(var j=0,l=not.length;j<l;j++){if(not[j]===elem){return false}}return true}else{Szzl.error("Syntax error, unrecognized expression: "+name)}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case'only':case'first':while((node=node.previousSibling)){if(node.nodeType===1){return false}}if(type==="first"){return true}node=elem;case'last':while((node=node.nextSibling)){if(node.nodeType===1){return false}}return true;case'nth':var first=match[2],last=match[3];if(first===1&&last===0){return true}var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count}}parent.sizcache=doneName}var diff=elem.nodeIndex-last;if(first===0){return diff===0}else{return(diff%first===0&&diff/first>=0)}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName.toLowerCase()===match},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!==check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array)}}}};var origPOS=Expr.match.POS,fescape=function(all,num){return"\\"+(num-0+1)};for(var type in Expr.match){Expr.match[type]=new RegExp(Expr.match[type].source+(/(?![^\[]*\])(?![^\(]*\))/.source));Expr.leftMatch[type]=new RegExp(/(^(?:.|\r|\n)*?)/.source+Expr.match[type].source.replace(/\\(\d+)/g,fescape))}var makeArray=function(array,results){array=Array.prototype.slice.call(array,0);if(results){results.push.apply(results,array);return results}return array};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(e){makeArray=function(array,results){var ret=results||[],i=0;if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array)}else{if(typeof array.length==="number"){for(var l=array.length;i<l;i++){ret.push(array[i])}}else{for(;array[i];i++){ret.push(array[i])}}}return ret}}var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){if(!a.compareDocumentPosition||!b.compareDocumentPosition){if(a==b){hasDuplicate=true}return a.compareDocumentPosition?-1:1}var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true}return ret}}else if("sourceIndex"in document.documentElement){sortOrder=function(a,b){if(!a.sourceIndex||!b.sourceIndex){if(a==b){hasDuplicate=true}return a.sourceIndex?-1:1}var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true}return ret}}else if(document.createRange){sortOrder=function(a,b){if(!a.ownerDocument||!b.ownerDocument){if(a==b){hasDuplicate=true}return a.ownerDocument?-1:1}var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.setStart(a,0);aRange.setEnd(a,0);bRange.setStart(b,0);bRange.setEnd(b,0);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true}return ret}}Szzl.getText=function(elems){var ret="",elem;for(var i=0;elems[i];i++){elem=elems[i];if(elem.nodeType===3||elem.nodeType===4){ret+=elem.nodeValue}else if(elem.nodeType!==8){ret+=Szzl.getText(elem.childNodes)}}return ret};(function(){var form=document.createElement("div"),id="script"+(new Date()).getTime();form.innerHTML="<a name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[]}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match}}root.removeChild(form);root=form=null})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i])}}results=tmp}return results}}div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2)}}div=null})();if(document.querySelectorAll){(function(){var oldSzzl=Szzl,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return}Szzl=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!Szzl.isXML(context)){try{return makeArray(context.querySelectorAll(query),extra)}catch(e){}}return oldSzzl(query,context,extra,seed)};for(var prop in oldSzzl){Szzl[prop]=oldSzzl[prop]}div=null})()}(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(!div.getElementsByClassName||div.getElementsByClassName("e").length===0){return}div.lastChild.className="e";if(div.getElementsByClassName("e").length===1){return}Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1])}};div=null})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i}if(elem.nodeName.toLowerCase()===cur){match=elem;break}elem=elem[dir]}checkSet[i]=match}}}function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i}if(typeof cur!=="string"){if(elem===cur){match=true;break}}else if(Szzl.filter(cur,[elem]).length>0){match=elem;break}}elem=elem[dir]}checkSet[i]=match}}}Szzl.contains=document.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:function(a,b){return a!==b&&(a.contains?a.contains(b):true)};Szzl.isXML=function(elem){var documentElement=(elem?elem.ownerDocument||elem:0).documentElement;return documentElement?documentElement.nodeName!=="HTML":false};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"")}selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Szzl(selector,root[i],tmpSet)}return Szzl.filter(later,tmpSet)};window.Szzl=Szzl})();
var paygatevars = new variablefun();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.