$ = function(e){
	switch(typeof e){
		case "string":
			return document.getElementById(e);
		break;
		default:
			return e;
		break;
	}
}

var state = Array ('on.gif','off.gif');
var on = /on.gif/i;
var off = /off.gif/i;

g = { /* global */
	o:function(e){ /* object */
		return document.getElementById(e);
	}
}


w = { /* window */
	o:function(u,n){
		var win = window.open(u,n,'width=300,height=400,scrollbars=yes',true);
		win.focus();
	},
	oc:function(u,n,p){ /* open custom -> size */
		var win = window.open(u,n,p+',scrollbars=yes',true);
		win.focus();
	},
	s:function(u,n,p){
		var win = window.open(u,n,p,true);
		win.focus();
	},
	t:function(e){
		return top.opener.g.o(e);
	},
	tv:function(e,v){
		this.t(e).value = v;
	},
	c:function(){
		self.close();// = window.parent.opener;
	}
}

swap = { /* swap */
	showBlock:function(e){ /* show */
		(e.style.display == "none") ? e.style.display = "block" : 0;
	},
	hideBlock:function(e){ /* hide */
		(e.style.display == "block") ? e.style.display = "none" : 0;
	},
	swapBlock:function(e){ /* show-hide */
		(e.style.display == "block") ? e.style.display = "none" : e.style.display = "block";
	},
	swapInlineBlock:function(e){ /* show-hide */
		(e.style.display == "inline-block") ? e.style.display = "none" : e.style.display = "inline-block";
	}
	
}


s = { /* swap */
	sh:function(e){ /* show-hide */
		(e.style.display == "none") ? e.style.display = "inline" : e.style.display = "none";
	},
	sb:function(e){/* show-hide block element */
		(e.style.display == "none") ? e.style.display = "block" : e.style.display = "none";
	},
	h:function (e) { /* hide */
		(e.style.display == "inline-block") ? e.style.display = "none" : 0;
	},
	s:function (e) { /* show */
		(e.style.display == "none") ? e.style.display = "inline-block" : 0;
	},
	ssff:function (e) { /* show */
		(e.style.display == "none") ? e.style.display = "block" : 0;
	},
	shff:function (e) { /* show */
		(e.style.display == "block") ? e.style.display = "none" : 0;
	}	
	
}

htmlinput = {
	/* Convert to Object */
	o:function(el){
		return document.getElementById(el);
	},
	e:function(el){
		return document[el];
	},
	setv:function(el){
		el = this.e(el);
		el.value = this.swap(el);
		return;
	},
	swap:function(el){
		tmp = this.e(el).src;
		tmp.match(on) != null ? this.e(el).src = tmp.replace(on,state[1]) : this.e(el).src = tmp.replace(off,state[0]);
	},
	/* html checkbox emulator */
	checkbox:function(el){
		this.swap(el);
	}
}

function m(s,t){
	var tmp = new Array();
	var x = 0;
	for (var i = 0; i < s.length; i++) {
		if (s.options[i].selected) {
			var intTargetLen = t.length++;
			t.options[intTargetLen].text = s.options[i].text;
			t.options[intTargetLen].value = s.options[i].value;
		}else {
			var objTempValues = new Object();
			objTempValues.text = s.options[i].text;
			objTempValues.value = s.options[i].value;
			tmp[x] = objTempValues;
			x++;
		}
	}
	s.length = tmp.length;
	for (var i = 0; i < tmp.length; i++) {
		s.options[i].text = tmp[i].text;
		s.options[i].value = tmp[i].value;
		s.options[i].selected = false;
	}
}


