dex.utils = { randOrd: function() { return (Math.round(Math.random())-0.5); }, get_cookie:function(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } else { begin += 2; } var end = document.cookie.indexOf(";", begin); if (end == -1) { end = dc.length; } return unescape(dc.substring(begin + prefix.length, end)); }, set_cookie:function(name, value, expires, path, domain, secure) { var today = new Date(); today.setTime( today.getTime() ); expires = expires * 1000; var expires_date = new Date( today.getTime() + (expires) ); document.cookie= name + "=" + escape(value) + ((expires) ? "; expires=" + expires_date.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); }, getElementsByClass:function(searchClass,node,tag) { var classElements = new Array(); if ( node == null ) node = document; if ( tag == null ) tag = '*'; var els = node.getElementsByTagName(tag); var elsLen = els.length; var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)"); for (i = 0, j = 0; i < elsLen; i++) { if ( pattern.test(els[i].className) ) { classElements[j] = els[i]; j++; } } if (classElements.length == 0) { return false; } else if (classElements.length == 1) { return classElements[0]; } else { return classElements; } }, ua : { os: function() { var dataOS = [ { string: navigator.platform, subString: "Win", identity: "Windows" }, { string: navigator.platform, subString: "Mac", identity: "Mac" }, { string: navigator.userAgent, subString: "iPhone", identity: "iPhone/iPod" }, { string: navigator.platform, subString: "Linux", identity: "Linux" } ]; return this.searchString(dataOS); }, searchString: function (data) { for (var i=0;i 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; }, 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; }, /** * * Javascript open window * http://www.webtoolkit.info/ * **/ popup : function (anchor, options) { var args = ''; if (typeof(options) == 'undefined') { var options = new Object(); } if (typeof(options.name) == 'undefined') { options.name = 'win' + Math.round(Math.random()*100000); } if (typeof(options.height) == 'undefined') { options.height = 450; } if (typeof(options.width) == 'undefined') { options.width = 600; } options.y=Math.floor((screen.availHeight-(options.height || screen.height))/2)-(screen.height-screen.availHeight); options.x=Math.floor((screen.availWidth-(options.width || screen.width))/2)-(screen.width-screen.availWidth); args += "height=" + options.height + ","; args += "width=" + options.width + ","; args += "screenx=" + options.x + ","; args += "screeny=" + options.y + ","; args += "left=" + options.x + ","; args += "top=" + options.y + ","; args += "resizable=1," if (typeof(options.scrollbars) != 'undefined') { args += "scrollbars=1,"; } if (typeof(options.menubar) != 'undefined') { args += "menubar=1,"; } if (typeof(options.locationbar) != 'undefined') { args += "location=1,"; } //if (typeof(options.resizable) != 'undefined') { args += "resizable=1,"; } return window.open(anchor, options.name, args); }, notice_counter : 0, notice : function(html, timeout) { this.close = function() { new YAHOO.util.Anim(this.elm.id, {bottom:{to:-156}}, 0.2, YAHOO.util.Easing.easeBoth ).animate(); delete this.elm; dex.utils.notice_counter-- }; this.show = function () { if (this.elm) { this.elm.style.display = 'block'; var to_bottom = (dex.utils.notice_counter * 121); var from_bottom = to_bottom - 150; dex.utils.notice_counter++; new YAHOO.util.Anim(this.elm.id, {bottom:{from:from_bottom,to:to_bottom}}, 1, YAHOO.util.Easing.easeBoth ).animate(); } }; this.id = 'new_popup_' + parseInt(Math.random(0,999)*1000); this.timeout = timeout; var body = document.getElementsByTagName("body")[0]; this.elm = document.createElement('div'); this.elm.id = this.id; this.elm.className = 'PopUpManager'; this.elm.popup = this; //this.elm.obj = this; var close_bttn = document.createElement('a'); close_bttn.className = 'close_popup'; close_bttn.innerHTML = 'x'; close_bttn.href = '#'; close_bttn.id = this.id+'close'; this.elm.appendChild(close_bttn); this.elm.innerHTML+= html; body.appendChild(this.elm); dex.load.onclick("animation",function(){ this.show(); if (this.timeout){ var self = this; setTimeout(function() { self.close(); }, (this.timeout*1000)); } },{scope:this}); YAHOO.util.Event.addListener(close_bttn.id, "click", this.close, this, true); }, error : function (msg) { this.el = document.getElementById('error_panel'); this.msg = msg; if (!this.el) { this.el = document.createElement('DIV'); this.el.id = 'error_panel'; document.getElementsByTagName('body')[0].appendChild(this.el); } dex.load.onclick("container",function(){ if (!this.el.panel) { this.el.panel = new YAHOO.widget.Panel('error_panel', { width:"400px", fixedcenter: true, constraintoviewport: true, close:true, visible:false, modal: true, draggable:true}); } this.el.panel.setHeader("Error"); this.el.panel.setBody(this.msg); this.el.panel.render(); this.el.panel.show(); }, {scope:this}); return false; }, go_select : function(a) { if(a) { window.location=a[a.selectedIndex].value } else { return } }, is_numeric : function(keycode) { return ((keycode >= 48 && keycode <= 57) || keycode == 8 || keycode == 189 || keycode == 32 || (keycode >= 96 && keycode <= 105)); }, is_alpha : function(keycode) { return ((keycode >= 65 && keycode <= 90) || keycode == 8 || keycode == 32 || keycode == 190); }, md5: function(C){var D;var w=function(b,a){return(b<>>(32-a))};var H=function(k,b){var V,a,d,x,c;d=(k&2147483648);x=(b&2147483648);V=(k&1073741824);a=(b&1073741824);c=(k&1073741823)+(b&1073741823);if(V&a){return(c^2147483648^d^x)}if(V|a){if(c&1073741824){return(c^3221225472^d^x)}else{return(c^1073741824^d^x)}}else{return(c^d^x)}};var r=function(a,c,b){return(a&c)|((~a)&b)};var q=function(a,c,b){return(a&b)|(c&(~b))};var p=function(a,c,b){return(a^c^b)};var n=function(a,c,b){return(c^(a|(~b)))};var u=function(W,V,aa,Z,k,X,Y){W=H(W,H(H(r(V,aa,Z),k),Y));return H(w(W,X),V)};var f=function(W,V,aa,Z,k,X,Y){W=H(W,H(H(q(V,aa,Z),k),Y));return H(w(W,X),V)};var F=function(W,V,aa,Z,k,X,Y){W=H(W,H(H(p(V,aa,Z),k),Y));return H(w(W,X),V)};var t=function(W,V,aa,Z,k,X,Y){W=H(W,H(H(n(V,aa,Z),k),Y));return H(w(W,X),V)};var e=function(V){var W;var d=V.length;var c=d+8;var b=(c-(c%64))/64;var x=(b+1)*16;var X=new Array(x-1);var a=0;var k=0;while(k>>29;return X};var s=function(d){var a="",b="",k,c;for(c=0;c<=3;c++){k=(d>>>(c*8))&255;b="0"+k.toString(16);a=a+b.substr(b.length-2,2)}return a};var E=[],L,h,G,v,g,U,T,S,R,O=7,M=12,J=17,I=22,B=5,A=9,z=14,y=20,o=4,m=11,l=16,j=23,Q=6,P=10,N=15,K=21;C=this.utf8_encode(C);E=e(C);U=1732584193;T=4023233417;S=2562383102;R=271733878;D=E.length;for(L=0;L // MIT License parseUri : function(str) { var o = this.parseUri_options, m = o.parser[o.strictMode ? "strict" : "loose"].exec(str), uri = {}, i = 14; while (i--) uri[o.key[i]] = m[i] || ""; uri[o.q.name] = {}; uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) { if ($1) uri[o.q.name][$1] = $2; }); return uri; }, parseUri_options : { strictMode: false, key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], q: { name: "queryKey", parser: /(?:^|&)([^&=]*)=?([^&]*)/g }, parser: { strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ } } }; YAHOO.register("dex.utils", dex.utils, {version: "1", build: "1"});