// Author:kenit
// ver 0.008
function $(a){return document.getElementById(a)}function deleteAllChild(a){if(a&&a.hasChildNodes)for(var b=a.childNodes.length,d=0;d<b;d++)a.removeChild(a.childNodes.item(0))}function form_value_maker(a,b,d){var c=document.createElement("input");c.setAttribute("type","hidden");c.setAttribute("name",b);c.setAttribute("value",d);a.appendChild(c)}
var ajax=function(){this.pool=[];this.getIdelthread=function(){for(var a=0;a<this.pool.length;a++)if(this.pool[a].http_request.readyState==4&&this.pool[a].http_request.status==200)return a;a=new ajax_request;this.pool.push(a);return this.pool.length-1};return{queue:{paraqueue:[],xhr:null,t:null,push:function(a){this.paraqueue.push(a);this.t&&clearInterval(this.t);this.t=setInterval("window.ajax.queue.dequeue()",100)},dequeue:function(){if(this.paraqueue.length>0){if(this.xhr==null||this.xhr.http_request.readyState==
4&&this.xhr.http_request.status==200||this.xhr.http_request.readyState==0){var a=this.paraqueue.shift();this.xhr=ajax.request(a.url,a.method,a.sync,a.xml)}}else this.t&&clearInterval(this.t)}},request:function(a,b,d,c,e,g){var f=getIdelthread();pool[f].url=a;pool[f].method=b;pool[f].sync=d;pool[f].xml=c;pool[f].submit();if(typeof e!="undefined"&&typeof g=="function"&&parseInt(e,10)!=NaN){pool[f].onError=g;setTimeout("window.ajax.checktimeout("+f+")",parseInt(e,10))}else{pool[f].onError=new Function;
setTimeout("window.ajax.checktimeout("+f+")",30000)}return pool[f]},checktimeout:function(a){if(pool[a].http_request.readyState!=4||pool[a].http_request.status!=200){pool[a].http_request.abort();pool[a].onError()}}}}();
function ajax_request(a,b,d,c){this.url=a;this.method=b;this.sync=d;this.xml=c;this.newhttprequest=function(){return window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest};var e=this;this.http_request=this.newhttprequest();this.submit=function(){this.http_request.abort();this.http_request.overrideMimeType&&this.xml&&this.http_request.overrideMimeType("text/xml");this.http_request.onreadystatechange=function(){if(e.http_request.readyState==4)if(e.http_request.status==200){e.response=
e.xml?e.http_request.responseXML:e.http_request.responseText;e.method(e.response)}};this.http_request.open("GET",this.url,this.sync);this.http_request.send(null)}}function option_gen(a,b,d){var c=document.createElement("option");c.setAttribute("value",a);c.innerHTML=b;if(d)c.selected=true;return c}
function Obj2Source(a,b){if(a==null)return"null";if(a.toGMTString)return"(new Date("+a.valueOf()+"))";switch(typeof a){case "string":b=a;b=a.replace(String.fromCharCode(10),"");b=b.replace(/"/g,"'");return'"'+b+'"';case "object":var d="";for(var c in a)d+=a.concat?","+Obj2Source(a[c],b):',"'+c+'":'+Obj2Source(a[c],b);return a.concat?"["+d.slice(1)+"]":"{"+d.slice(1)+"}";case "function":return b?a:"";default:return a}}
function tdmaker(a,b,d){var c=document.createElement("td");if(typeof a=="string"||typeof a=="number")c.innerHTML=a;else c.appendChild(a);if(d)c.className=d;b.appendChild(c);return c}function isFF(){var a={a:"a",b:"b"};return a.toSource?true:false}function addCSS(a,b){if(typeof a!="undefined"&&b!="")a.className+=" "+b}function removeCSS(a,b){if(typeof a!="undefined"&&b!=""){b=new RegExp(b,"g");if(a.className.search(b)>-1)a.className=a.className.replace(b,"")}}
function period_day(a,b){if(a=="")return false;var d=parseInt(a.split("-")[0],10),c=parseInt(a.split("-")[1],10);a=parseInt(a.split("-")[2],10);var e=new Date;e.setFullYear(d);e.setMonth(c-1);e.setDate(a+b);return e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()}function xmlstrtoDOM(a){try{xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async="false";xmlDoc.loadXML(a)}catch(b){parser=new DOMParser;xmlDoc=parser.parseFromString(a,"text/xml")}return xmlDoc}
function xmltodom(a,b){if(typeof XSLTProcessor!="undefined"){var d=new XSLTProcessor;d.importStylesheet(a);a=d.transformToFragment(b,document);b=document.createElement("div");b.appendChild(a);return b.innerHTML}else return typeof b.transformNode!="undefined"?b.transformNode(a):false}function htmlspecialchars(a){a=a.replace(/&/g,"&amp;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");a=a.replace(/"/g,"&quot;");return a=a.replace(/'/g,"&#039;")}
function htmlspecialchars_decode(a){a=a.replace(/&amp;/g,"&");a=a.replace(/&lt;/g,"<");a=a.replace(/&gt;/g,">");a=a.replace(/&quot;/g,'"');return a=a.replace(/&#039;/g,"'")}function setobjvisible(a){if(typeof a=="undefined"||a.nodeType!=1)return false;var b="";switch(a.nodeName.toUpperCase()){case "TD":b="table-cell";break;case "TR":b="table-row";break;case "TABLE":b="table";break;default:b="block";break}try{a.style.display=b}catch(d){a.style.display="block"}};