<!-- common functions :::
// written or changed by Vady.
// vady@i.com.ua

// 2use popup() function: <a href="javascript:;" onClick="javascript:popup('name', '#link', 0, 0, 300, 150, 0, 0, 1, 1, 1); return false;"></a>
function popup(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable){
	var wint = (screen.height - height) / 2;
	var winl = (screen.width - width) / 2;
	toolbar_str = toolbar ? 'yes' : 'no';
	menubar_str = menubar ? 'yes' : 'no';
	statusbar_str = statusbar ? 'yes' : 'no';
	scrollbar_str = scrollbar ? 'yes' : 'no';
	resizable_str = resizable ? 'yes' : 'no';
	window.open(url, name, 'left='+winl+',top='+wint+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

function restore() {
	obj.src = obj.lsrc;
}

function cl(id,what) {
	var im;
	im = findObj(id,'');
	im.src = "images/" + what;
}

function change(id,src) {
	var lsrc;
	if (!src) src = 'menu/0'+id.substr(1)+'-o.gif';
	obj = findObj(id,'');
	if(!obj.lsrc) obj.lsrc = obj.src;
	obj.src = "images/" + src;
}

function preloadImgs() {
	var d = document;
	if(d.images) {
		if(!d.IMGs) d.IMGs=new Array();
		var i,j=d.IMGs.length,a=preloadImgs.arguments;
		for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){
		d.IMGs[j]=new Image; d.IMGs[j++].src = 'images/' + a[i];
		}
	}
}

function findObj(n, d) { //v4.01
	var p,i,x;	if(!d) d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

// -->