<!-- utils
//=========================== 'BW' ===========================
function findObj(n, doc){
  var i, obj;
  if(!doc) doc = document;
  if(!n || n == null) return null;
  if(doc.all && (obj=doc.all[n])!=null) return obj;
  if(document.getElementById && (obj=document.getElementById(n))!=null) return obj;
  if(doc.layers) for(i in doc.layers) if((obj=findObj(n,doc.layers[i].document))!=null) return obj;
  for(i in doc.forms) if((obj=doc.forms[i][n])!=null) return obj;
  for(i in doc.images) if((obj=doc.images[n])!=null) return obj;
  return null;
}
// end 'getObjectBW' ---------------

//=========================== 'stile' ========================
function onVD(){
	var elem_id = null;
	this.set_alt = function(id, txt){ if((elem_id = findObj(id))!= null) elem_id.alt = txt;}
	this.roll = function(id, path){ if((elem_id = findObj(id))!= null) elem_id.src = path;}
	this.visibili = function(id, vis){
		if((elem_id = findObj(id))!= null && elem_id.style){
			if(vis) elem_id.style.visibility = vis;
			else elem_id.style.visibility = elem_id.style.visibility =="hidden" ? "visible" : "hidden";
		}
	}
	this.display = function(id, vis){
		if((elem_id = findObj(id))!= null && elem_id.style){
			if(vis) elem_id.style.display = vis;
			else elem_id.style.display = elem_id.style.display =="" ? "none" : "";
		}
	}
}
var ona = new onVD();
//--------------
function setColor(){
	var elem_id = null;
	/*/
	this.style = function(id){
		if((elem_id = findObj(id))!= null && elem_id.style) return elem_id.style;
		return null;
	}
	/*/
	this.fg = function(id, color){
		if((elem_id = findObj(id))!= null && elem_id.style) elem_id.style.color = color;
	}
	this.bg = function(id, color){
		if((elem_id = findObj(id))!= null && elem_id.style) elem_id.style.backgroundColor = color;
	}
	this.dbg = function(color){
		document.bgColor = color;
	}
	this.clas = function(id, color){
		if((elem_id = findObj(id))!= null && elem_id.className) elem_id.className = color;
	}
}
var set_c = new setColor();
// end 'stile' --------------

//=========================== 'cookie' ========================
function cookies(){
	this.get = function(name){
		var search = name+"=";
		var result = "";
		if(document.cookie.length > 0){
			offset = document.cookie.indexOf(search);
			if(offset != -1){ 
				offset += search.length;
				end = document.cookie.indexOf(";", offset);
				if(end == -1) end = document.cookie.length;
				result=unescape(document.cookie.substring(offset, end));
			}
		}
		return result;
	}
	this.pop = function(name, value){
		var result = "";
		var openones = this.get(name).split(" ");
		for(i=0;i<=openones.length;i++){if(openones[i]!=value) result += openones[i]+" ";}
		document.cookie=name+"="+escape(result);
	}
	this.push = function(name, value){
		document.cookie=name+"="+escape(this.get(name)+" "+value);
	}
}
var cook = new cookies();
// end 'cookie' -------------

//=========================== 'convert' ==========================
function dec_hex(dec){
  var hexStr = "0123456789ABCDEF";
  var low = dec % 16;
  var high = (dec - low)/16;
  hex = "" + hexStr.charAt(high) + hexStr.charAt(low);
  return hex;
}
// end 'convert' -----------
//=========================== 'redirect' ==========================
function redirect(path){document.location.href=path;}
//--------------
function new_window(path, w_nam,  height, width){
	faktur="height="+height+", width="+width+", scrollbars=1, menubar=no, statusbar=no, resizable=yes";
	window.open(path, w_nam, faktur);
}
function arg_href(){
	this.arr = new Array();
	this.href = new Array();
	if(s=document.location.href.substr(document.location.href.lastIndexOf('?')+1))
		for(i in (ar=s.split("&"))) if(arr=ar[i].split("=")) this.arr[i]=this.href[arr[0]]=arr[1];
}
var arg = new arg_href();
// end 'redirect' -----------
//=========================== 'util' ==========================
function datutil(){
	var flag = false;
	var month = new Array("января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "декабря");
	this.chk_int=function(mon){for(i=0;i<month.length;i++){if(mon==month[i]){mon=i<9?"0"+(i+1):i+1; flag=true;}}return flag?mon:0;}
	this.chk_str=function(mon){return month[parseInt(mon+1)];}
}
//var datU = new datutil();
function stringutil(){
	/*
	this.split=function(){
		var arg = this.split.arguments;
		var arr=arg[1].split(arg[1]);
		for(a=2;a<arg.length;a++){
			for(i=0;i<arr.length;i++) arr[i]=arr[i].split(arg[a]);
		}
		return arr;
	};
	*/
	this.split=function(str, arg1, arg2){
		var arr=str.split(arg1);
			for(i=0;i<arr.length;i++) arr[i]=arr[i].split(arg2);
		return arr;
	};
	this.spliting=function(str, arg){
		var arr=str.split(arg1);
		for(i=(arr.length-1);i>=0;i--) arr[i-1]=arr[i-1]+arg+arr[i];
		return arr;
	};
}
//var strU = new stringutil();
// end 'util' -----------
//-->

