// JavaScript Document

Date.prototype.sqlDate=function() {
	var r=[]
	r.push(this.getFullYear())
	r.push(((this.getMonth()<9)?"0":"")+(this.getMonth()+1))
	r.push(((this.getDate()<10)?"0":"")+this.getDate())
	return r.join("-")
}

Date.prototype.sqlDateTime=function() {
	var r=[]
	r.push(((this.getHours()<10)?"0":"")+this.getHours())
	r.push(((this.getMinutes()<10)?"0":"")+this.getMinutes())
	r.push(((this.getSeconds()<10)?"0":"")+this.getSeconds())
	return this.sqlDate()+" "+r.join(":")
}

function $o(id) {return document.getElementById(id)}
function $t(o,id) {return o.getElementsByTagName(id)}
function sc(o,ncn,ocn) {
	if (o) {
		if (ocn!=undefined) {
			if(ocn!="") {
				var re=new RegExp("\\b"+ocn+"\\b","gi")
				var i=o.className.search(re)
				if (i!=-1) {o.className=o.className.replace(re,"")}
			}
		}
		if (ncn!="") {
			var re=new RegExp("\\b"+ncn+"\\b","gi")
			var i=o.className.search(re)
			if (i==-1) {o.className=o.className.replace(/\s*$/,'')+" "+ncn}
		}
	}
}



function addLoader(f_toLoad) {
	if (f_toLoad!=undefined) {
	if (window.onload) {
		var z_toLoad=window.onload	
		window.onload=function () {f_toLoad();z_toLoad()}
	} else {
		window.onload=f_toLoad
	}}
}