﻿/* JavaScript Core 1.0 */
var _=function( id ){return new _.fn.init( id )}
_.fn = _.prototype = {
    $:null,
    isS:function(){return (this.$.style.display != 'none')},//Is Show
	h:function(){this.$.style.display = 'none';return this},//Hide
	s:function(){this.$.style.display = '';return this},//Show
	s2:function(){this.$.style.display = 'block';return this},//Show
	c:function(n){if(n==null)return this.$.className;else this.$.className = n;return this},//Class
	t:function(t){if(t==null)return this.$.innerHTML;else this.$.innerHTML = t;return this},//HTML
	v:function(vel){if(vel==null)return this.$.value;else this.$.value = vel;return this},//Value
	a:function(n,v){if(v==null)return this.$.getAttribute(n);else this.$.setAttribute(n,v);return this},//Attribute
	p:function(){return new _.fn.init( this.$.parentNode )},
	init:function(id){if(typeof id == "string")this.$ = document.getElementById(id); else this.$ = id}
}
_.fn.init.prototype = _.fn;

/*ajax*/
_.ajaxObj = null;
_.ajaxQueue = new Array();
_.get = function(url,func,f) {
    if(!f) _.ajaxQueue.push({u:url,f:func});
    if(_.ajaxObj!=null && !f)return;
    if (window.XMLHttpRequest){_.ajaxObj = new XMLHttpRequest()} else if (window.ActiveXObject) {_.ajaxObj = new ActiveXObject("Microsoft.XMLHTTP")}
    _.ajaxObj.onreadystatechange = _.got;
    _.ajaxObj.open("GET", url, true);
    _.ajaxObj.send(null);
}
_.got = function() {
  if (_.ajaxObj.readyState == 4) {
      if (_.ajaxObj.status == 200) {
	     if(_.ajaxQueue[0].f!=null)
		    _.ajaxQueue[0].f(_.ajaxObj.responseText)
      }
      _.ajaxQueue.splice(0, 1);
      if(_.ajaxQueue.length>0){
	    _.get(_.ajaxQueue[0].u,_.ajaxQueue[0].f,true);
      }else{
	    _.ajaxObj = null
      }
  }
}
/*--end ajax*/
_.url = function(u){window.location.href = u}