/* $$Helper(); attachHandler(to,evtname,func,global) var r = new $0.asr(); r.req(url,querystr,readystate-callback,want-mime); */ function defined(expr){ return ((typeof expr!='undefined')&&(expr!=null)); } function map(){ var args = arguments; if (args.length==1) { args = args[0]; } var t = args[args.length-1]; if (typeof t != 'object') { return; } for (var a=0; a=mt) { window.clearInterval(t); }} if(cond.call()) { window.clearInterval(t); }else{ i+=intT; if(typeof dothat=='function'){ dothat.call(); } } }; t=window.setInterval(l,intT); return this; } function when(cond,dothat,mt){ var intT=50;var t=0;var i=0;if(typeof cond!='function'){return false;} var l = function() { if(mt){if(i>=mt) { window.clearInterval(t); }} if(cond.call()) { window.clearInterval(t); if(typeof dothat=='function'){ dothat.call(); } }else{ i+=intT; } }; t=window.setInterval(l,intT); return this; } function $E(ed){ var e = (typeof ed=='object'&&ed!=null)?ed:$0.getElementById(ed); return e || undefined; } function $N(n){ var r = $0; var a = null; if(arguments.length>1){ var e=(typeof n=='object')?n:$E(n); //a = e.getElementsByTagName(arguments[1]); r = e; n = arguments[1]; } var newa = []; if (typeof n=='object') { for (var i in n) { var a = r.getElementsByTagName(n[i]); for (var i in a) { var ele = a[i]; if (!ele.nodeName) {continue;} newa.push(ele); } } } else { var a = r.getElementsByTagName(n); for (var i in a) { var ele = a[i]; if (!ele.nodeName) {continue;} newa.push(ele); } } return newa; } function $CI(ed){ var e=(typeof ed=='object')?ed:$E(ed); var r,p1,p2,b1,b2; var $={w:0,h:0}; // for body better approach, document.body.clientHeight eq 0 // compat IE, Moz if(e==$0.body){ var w=$0.documentElement.clientWidth; var h=$0.documentElement.clientHeight; // need to subtract margin here, bec it affects inner dimensions rel. to window dim. if(e.currentStyle){ var m1 = parseInt(e.currentStyle.marginLeft); var m2 = parseInt(e.currentStyle.marginRight); w-=(isNaN(m1)&&isNaN(m2)) ? (sparseInt($S(e).marginLeft)+sparseInt($S(e).marginRight)) : (m1+m2); m1 = parseInt(e.currentStyle.marginTop); m2 = parseInt(e.currentStyle.marginBottom); h-=(isNaN(m1)&&isNaN(m2)) ? (sparseInt($S(e).marginTop)+sparseInt($S(e).marginBottom)) : (m1+m2); } else { w-=(parseInt(window.getComputedStyle(e, null).marginLeft)+ parseInt(window.getComputedStyle(e, null).marginRight)); h-=(parseInt(window.getComputedStyle(e, null).marginTop)+ parseInt(window.getComputedStyle(e, null).marginBottom)); } $.w = w; $.h = h; } else { r=$R(e); $.w = r.r-r.l; $.h = r.b-r.t; } if($){ if(e.currentStyle){ p1 = parseInt(e.currentStyle.paddingLeft); p2 = parseInt(e.currentStyle.paddingRight); $.w-=(isNaN(p1)&&isNaN(p2)) ? (sparseInt($S(e).paddingLeft)+sparseInt($S(e).paddingRight)) : (p1+p2); p1 = parseInt(e.currentStyle.paddingTop); p2 = parseInt(e.currentStyle.paddingBottom); $.h-=(isNaN(p1)&&isNaN(p2)) ? (sparseInt($S(e).paddingTop)+sparseInt($S(e).paddingBottom)) : (p1+p2); b1 = parseInt(e.currentStyle.borderLeftWidth); b2 = parseInt(e.currentStyle.borderRightWidth); $.w-=(isNaN(b1)&&isNaN(b2)) ? (sparseInt($S(e).borderLeftWidth)+sparseInt($S(e).borderRightWidth)) : (b1+b2); b1 = parseInt(e.currentStyle.borderTopWidth); b2 = parseInt(e.currentStyle.borderBottomWidth); $.h-=(isNaN(b1)&&isNaN(b2)) ? (sparseInt($S(e).borderTopWidth)+sparseInt($S(e).borderBottomWidth)) : (b1+b2); } else { $.w-=(parseInt(window.getComputedStyle(e, null).paddingLeft)+ parseInt(window.getComputedStyle(e, null).paddingRight)); $.w-=(parseInt(window.getComputedStyle(e, null).borderLeftWidth)+ parseInt(window.getComputedStyle(e, null).borderRightWidth)); $.h-=(parseInt(window.getComputedStyle(e, null).paddingTop)+ parseInt(window.getComputedStyle(e, null).paddingBottom)); $.h-=(parseInt(window.getComputedStyle(e, null).borderTopWidth)+ parseInt(window.getComputedStyle(e, null).borderBottomWidth)); } } return $; } function $R(ed){ var e=(typeof ed=='object')?ed:$E(ed); var $={l:0,t:0,r:0,b:0}; if (e.offsetParent){ var p=e; do{ $.l+=p.offsetLeft; $.t+=p.offsetTop; }while(p=p.offsetParent); } var s=$S(e); if(s.display=='block'){ $.r=$.l+e.offsetWidth; $.b=$.t+e.offsetHeight; }else{ var v=s.visibility; var d=s.display; s.visibility='hidden'; s.display='block'; $.r=$.l+e.offsetWidth; $.b=$.t+e.offsetHeight; s.visibility=v; s.display=d; } return $; } function $IR(ed){ var e=(typeof ed=='object')?ed:$E(ed); var $=$R(e),p,b; if($){ if(e.currentStyle){ p = parseInt(e.currentStyle.paddingLeft); $.l+=(isNaN(p))?sparseInt($S(e).paddingLeft) : p; p = parseInt(e.currentStyle.paddingRight); $.r-=(isNaN(p))?sparseInt($S(e).paddingRight) : p; p = parseInt(e.currentStyle.paddingTop); $.t+=(isNaN(p))?sparseInt($S(e).paddingTop) : p; p = parseInt(e.currentStyle.paddingBottom); $.b-=(isNaN(p))?sparseInt($S(e).paddingBottom) : p; b = parseInt(e.currentStyle.borderLeftWidth); $.l+=(isNaN(b))?sparseInt($S(e).borderLeftWidth) : b; b = parseInt(e.currentStyle.borderRightWidth); $.r-=(isNaN(b))?sparseInt($S(e).borderRightWidth) : b; b = parseInt(e.currentStyle.borderTopWidth); $.t+=(isNaN(b))?sparseInt($S(e).borderTopWidth) : b; b = parseInt(e.currentStyle.borderBottomWidth); $.b-=(isNaN(b))?sparseInt($S(e).borderBottomWidth) : b; } else { $.l+=parseInt(window.getComputedStyle(e, null).paddingLeft); $.r-=parseInt(window.getComputedStyle(e, null).paddingRight); $.t+=parseInt(window.getComputedStyle(e, null).paddingTop); $.b-=parseInt(window.getComputedStyle(e, null).paddingBottom); $.l+=parseInt(window.getComputedStyle(e, null).borderLeftWidth); $.r-=parseInt(window.getComputedStyle(e, null).borderRightWidth); $.t+=parseInt(window.getComputedStyle(e, null).borderTopWidth); $.b-=parseInt(window.getComputedStyle(e, null).borderBottomWidth); } } return $; } function $BR(ed){ var e=(typeof ed=='object')?ed:$E(ed); var $=$R(e),m; if($){ if(e.currentStyle){ m = parseInt(e.currentStyle.marginLeft); $.l-=(isNaN(m)) ? sparseInt($S(e).marginLeft) : m; m = parseInt(e.currentStyle.marginTop); $.t-=(isNaN(m)) ? sparseInt($S(e).marginTop) : m; m = parseInt(e.currentStyle.marginRight); $.r+=(isNaN(m)) ? sparseInt($S(e).marginRight) : m; m = parseInt(e.currentStyle.marginBottom); $.b+=(isNaN(m)) ? sparseInt($S(e).marginBottom) : m; } else { $.l-=parseInt(window.getComputedStyle(e, null).marginLeft); $.t-=parseInt(window.getComputedStyle(e, null).marginTop); $.r+=parseInt(window.getComputedStyle(e, null).marginRight); $.b+=parseInt(window.getComputedStyle(e, null).marginBottom); } } return $; } function $S(ed){ var e=(typeof ed=='object')?ed:$E(ed); return e.style; } function sparseInt(v){ return (v=='auto'||v=='')?0:parseInt(v); } /** * * URL encode / decode * http://www.webtoolkit.info/ * **/ var Url = { // public method for url encoding encode : function (string) { return escape(this._utf8_encode(string)); }, // public method for url decoding decode : function (string) { return this._utf8_decode(unescape(string)); }, // private method for UTF-8 encoding _utf8_encode : function (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; }, // private method for UTF-8 decoding _utf8_decode : function (utftext) { var string = ""; var i = 0; var c = c1 = c2 = 0; while ( i < utftext.length ) { c = utftext.charCodeAt(i); if (c < 128) { string += String.fromCharCode(c); i++; } else if((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i+1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return string; } } var $0=document; var $_=null; with ($_=$0) { $_.url=location; $_.qrystr={}; var ls = []; if (location.search.indexOf('?')>-1) { ls = location.search.substring(1, location.search.length).split('&'); } if (ls) { for (var i in ls) { var tmp = ls[i].split('='); $_.qrystr[tmp[0]] = tmp[1]; } } $_.asr = function() { this.o = null; this.create = function() { if (window.XMLHttpRequest) { this.o = new XMLHttpRequest(); this.o.onerror = function() { alert('Uncatched connection error.'); }; } else if (window.ActiveXObject) { try { this.o = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { this.o = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } }; this.req = function(url,qso,rscb,want) { if (typeof this.o != "object") { return false; } var $_ = this.o; var rsc = function() { if ($_.readyState==4) { if ($_.status==200) { var res = $_.responseXML; var result = (res.getElementsByTagName('result'))[0]; rscb(result); /* if (parseInt(result.getAttribute('status'))==1) { rscb(result); } else { if (result.firstChild.nodeType==4) { alert(result.firstChild.nodeValue); } else { alert(result.firstChild.nodeValue); } rscb(false); } */ } else { alert('Connection status error.'); } } }; with($_){ open('POST', url, true); onreadystatechange = rsc; if (typeof qso=='object'){ qso = this.parse_asoc(qso); } // alert(qso+"\n"+url); if (this.o.overrideMimeType) { if (want) { overrideMimeType(want); } } setRequestHeader('Content-Type','application/x-www-form-urlencoded'); setRequestHeader('Content-length',qso.length); setRequestHeader("Connection", "close"); send(qso); } }; this.parse_asoc = function(o) { var a = []; if (o.nodeName.toLowerCase()=='form') { var fs = $N(o,['input','textarea']); for (var i in fs) { if (fs[i].type!='submit'&& fs[i].type!='reset') { var val = fs[i].value; // var and = Url.encode('&'); // val = val.replace(/\&/g, and); //a.push(fs[i].name+'='+encodeURI(val)); if (fs[i].type=='radio') { if (fs[i].checked) { a.push(fs[i].name+'='+Url.encode(val)); } } else { a.push(fs[i].name+'='+Url.encode(val)); } } } fs = $N(o,['select']); // TODO parse