/*upgraded tools1(alix js app 1.0)
requirements : jquery1.4
*/
String.prototype.left=function(n){
	return this.substring(0,n)}
String.prototype.right=function(n){
	with(this){
		return substring(length-n)}}
String.prototype.lCase=function(){
	return this.toLowerCase()}
String.prototype.uCase=function(){
	return this.toUpperCase()}
String.prototype.myIndexOf=function(find, ofEnd){
	return this[ofEnd?'lastIndexOf':'indexOf'](find)}
//find , after this , 1/0(search of end?)
String.prototype.findAfter=function(find, after, ofEnd)
{
	with(this){
		var fromWhr=myIndexOf(after, ofEnd)
		return indexOf(find, fromWhr>=0 ? fromWhr : length)}
}
//vice versa
String.prototype.findBefore=function(find, before, ofEnd)
{
	with(this){
		var fromWhr=myIndexOf(before, ofEnd)
		return lastIndexOf(find, fromWhr>=0 ? fromWhr : 0)}
}
String.prototype.exist=function(str){
	return this.indexOf(str)>-1}
//get substring from a substr to another substr
String.prototype.find2find_substr=function(findStart, findEnd, ofEnd)
{
	with(this){
		var fromWhr=myIndexOf(findStart, ofEnd), toWhr=findAfter(findEnd, findStart);
		if(fromWhr<0)return ''
		if(toWhr<0)toWhr=length
		return substring(fromWhr, toWhr)}
}
String.prototype.replaceAll=function(oldS, newS){
	var str=new String(this), oldInd=str.indexOf(oldS)
	while(oldInd>-1){
		str=str.replace(oldS, newS)
		oldInd=str.indexOf(oldS)}
	return str
}

_t=new function()
{
	//ini
	var t=this
	var _conf=
		{
			'_static_path':'/AdminPanel/jscripts/',
			'_static_ext':'.js',
			'_direct_path_sign':'*',
			'_default_env':window
		},
		_tmp=
		{
			'loaded_jscripts':{/*name:1*/}
		}
	t.conf=_conf; t.tmp=_tmp
	//ini
	_tmp.loaded_jscripts[_conf._static_path+'tools'+_conf._static_ext]=1
	//:relax
	t.isSet=function(obj){return typeof obj!='undefined'}
	t.isStr=function(obj){return typeof obj=='string'}
	//:gatherers
	t.getEnv=function(whr, def)
	{
		def=def ? t.isStr(def) ? eval(def) : def : _conf._default_env
		return whr ? t.isStr(whr) ? eval(whr) : whr : def
	}
	//:writer
	t.wrt=function(str, whr, def)
	{
		if( !(whr=t.getEnv(whr, def)) )return false
		var doc=whr.document
		doc.open(); doc.write(str); doc.close()
	}
	//:JS Loader
	t.loadJS=function(src)
	{
		var src=
			(src.charAt(0)==_conf._direct_path_sign) ? src : _conf._static_path + src + _conf._static_ext
		if(_tmp.loaded_jscripts[src])return true
		_tmp.loaded_jscripts[src]=1
		t.wrt('<scr'+'ipt type="text/javascript" language="javascript" src="'+src+'"></scr'+'ipt>', window)
	}
}

_t.loadJS('jquery-1.4.2.min')
