Subversion Repositories SmartDukaan

Rev

Rev 20145 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
15085 anikendra 1
<html>
15203 anikendra 2
<head>
3
  <title>Redirect</title>
18167 amit.gupta 4
  <meta HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
5
  <meta HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
15085 anikendra 6
<script type="text/javascript">
15203 anikendra 7
String.prototype.capitalizeFirstLetter = function() {
8
    return this.charAt(0).toUpperCase() + this.slice(1);
9
}
15085 anikendra 10
function pass_it_on() {
11
   var l=window.location+"";
12
   var dsp=document.getElementById("display");
20146 naman 13
   var qsloc=l.indexOf("?");
15085 anikendra 14
   if(qsloc>=0) {
15203 anikendra 15
      var link = document.createElement('a');          
15085 anikendra 16
      var query_string=unescape(l.substring(qsloc+1));
18167 amit.gupta 17
      link.setAttribute('href', Base64.decode(query_string));
18
      url=Base64.decode(query_string);
19
      window.location=url;
20
      //dsp.innerHTML="<a id='noreferrer' rel = 'noreferrer' href='"+url+"'>Redirecting to " + link.hostname + "</a>";
21
      //document.getElementById('noreferrer').click();
15085 anikendra 22
   }
23
}
15203 anikendra 24
var Base64 = {
25
 
26
 
27
    _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
28
 
29
 
30
    encode: function(input) {
31
        var output = "";
32
        var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
33
        var i = 0;
34
 
35
        input = Base64._utf8_encode(input);
36
 
37
        while (i < input.length) {
38
 
39
            chr1 = input.charCodeAt(i++);
40
            chr2 = input.charCodeAt(i++);
41
            chr3 = input.charCodeAt(i++);
42
 
43
            enc1 = chr1 >> 2;
44
            enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
45
            enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
46
            enc4 = chr3 & 63;
47
 
48
            if (isNaN(chr2)) {
49
                enc3 = enc4 = 64;
50
            } else if (isNaN(chr3)) {
51
                enc4 = 64;
52
            }
53
 
54
            output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
55
 
56
        }
57
 
58
        return output;
59
    },
60
 
61
 
62
    decode: function(input) {
63
        var output = "";
64
        var chr1, chr2, chr3;
65
        var enc1, enc2, enc3, enc4;
66
        var i = 0;
67
 
68
        input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
69
 
70
        while (i < input.length) {
71
 
72
            enc1 = this._keyStr.indexOf(input.charAt(i++));
73
            enc2 = this._keyStr.indexOf(input.charAt(i++));
74
            enc3 = this._keyStr.indexOf(input.charAt(i++));
75
            enc4 = this._keyStr.indexOf(input.charAt(i++));
76
 
77
            chr1 = (enc1 << 2) | (enc2 >> 4);
78
            chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
79
            chr3 = ((enc3 & 3) << 6) | enc4;
80
 
81
            output = output + String.fromCharCode(chr1);
82
 
83
            if (enc3 != 64) {
84
                output = output + String.fromCharCode(chr2);
85
            }
86
            if (enc4 != 64) {
87
                output = output + String.fromCharCode(chr3);
88
            }
89
 
90
        }
91
 
92
        output = Base64._utf8_decode(output);
93
 
94
        return output;
95
 
96
    },
97
 
98
    _utf8_encode: function(string) {
99
        string = string.replace(/\r\n/g, "\n");
100
        var utftext = "";
101
 
102
        for (var n = 0; n < string.length; n++) {
103
 
104
            var c = string.charCodeAt(n);
105
 
106
            if (c < 128) {
107
                utftext += String.fromCharCode(c);
108
            }
109
            else if ((c > 127) && (c < 2048)) {
110
                utftext += String.fromCharCode((c >> 6) | 192);
111
                utftext += String.fromCharCode((c & 63) | 128);
112
            }
113
            else {
114
                utftext += String.fromCharCode((c >> 12) | 224);
115
                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
116
                utftext += String.fromCharCode((c & 63) | 128);
117
            }
118
 
119
        }
120
 
121
        return utftext;
122
    },
123
 
124
    _utf8_decode: function(utftext) {
125
        var string = "";
126
        var i = 0;
127
        var c = c1 = c2 = 0;
128
 
129
        while (i < utftext.length) {
130
 
131
            c = utftext.charCodeAt(i);
132
 
133
            if (c < 128) {
134
                string += String.fromCharCode(c);
135
                i++;
136
            }
137
            else if ((c > 191) && (c < 224)) {
138
                c2 = utftext.charCodeAt(i + 1);
139
                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
140
                i += 2;
141
            }
142
            else {
143
                c2 = utftext.charCodeAt(i + 1);
144
                c3 = utftext.charCodeAt(i + 2);
145
                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
146
                i += 3;
147
            }
148
 
149
        }
150
 
151
        return string;
152
    }
153
 
154
}
15085 anikendra 155
</script>
156
</head>
157
<body onload="pass_it_on();">
158
 
15767 anikendra 159
<div id="display" style="text-align:center;">
15085 anikendra 160
</div>
161
</body>
162
</html>