var ie=document.all && !window.opera;
var IE6=navigator.appVersion.indexOf("MSIE 6")!=-1;

var _=function(obj,route){
	if(!obj) return null;
	if(typeof obj=="string" && document.getElementById) obj=document.getElementById(obj);
	if(obj) return route?_DOM(obj,route):obj;
	else return null;
};



//Linguistic DOM objects search functionality
// ">" - next sibling tag
// "<" - prefious sibling tag
// "^" - first child tag
// "$" - last child tag
// "/" - parent node
// "~" - search  in child nodes
// "@" - return array matches
// "." - className property
// ":" - id property
// "#" - name property
// ----- RegExp to search _\(\'?\"?[a-zA-Z0-9_]+\'?\"?,
function _DOM(obj,route){
	route=route.replace(/[^<>\^$\/~a-z0-9_@.:# ]/gi,""); //clear uncorrect instructions
	route=route.replace(/(^[a-z@.:#].*)/i,"^$1"); //normalize inctructions (start with firstChild)
	route=route.replace(/((\<+)|(\>+)|(\^)|(\$)|(\/)|(\~)|(\@))/g,"$1*").replace(/\*([a-z0-9_@.:# ])/gi,"$1"); //add "any tag" (*) pointer
	var tags=route.toUpperCase().match(/([a-z0-9_*.:# ]+)/gi) || []; //create tags array
	var pointer=route.replace(/[^<>\^$\/~@]+/g,"+"); //split inctructions
	
	//alert(route+" ||| "+tags+" ||| "+pointer+" ||| ")
	var fit={
		">":"nextSibling",
		"<":"previousSibling",
		"^":"firstChild",
		"$":"lastChild",
		"/":"parentNode",
		".":ie?"className":"class",
		":":"id",
		"#":"name"
	};
	var tagPos=0, childPos=0;
	var char, tag, tagName, propKey, propValue, found, childNodes;
	var matches=[];

	while((char=pointer.charAt(0))){
		if(char=="+"){//change filter by "tag"
			if(tags[tagPos+1]) tagPos++;
			pointer=pointer.substr(1);
			continue;
		}
		
		tagName=tags[tagPos];
		propKey="";
		
		//if property exist
		if(tagName && (/[.:#]/.test(tagName))){
			propKey=fit[tagName.replace(/[^.:#]/g,"")];
			tag=tagName.match(/([a-z1-6_]*)[.:#]([a-z0-9_ ]*)/i);
			tagName=tag[1] || "*";
			propValue=tag[2];
			//alert(tagName+" "+propKey+" "+propValue);
		}
		
		//search in child nodes
		if(char=="~"){
			if(!childNodes) childNodes=obj.getElementsByTagName(tagName);
			else childPos++;
		}
		else if(childNodes){
			childNodes=null;
			childPos=0;
		}
		
		if(!(obj=obj[fit[char]] || (childNodes && childNodes[childPos]))) return matches.length?matches:null; //set next object
		found=!(obj.nodeType!=1 || (tagName!="*" && obj.tagName!=tagName) || (propKey && (!obj.getAttribute(propKey) || typeof obj.getAttribute(propKey)!="string" || obj.getAttribute(propKey).toUpperCase()!=propValue)));
		if(found) pointer=pointer.substr(1);
		
		//if first/last child not found in first step
		if((char=="^" || char=="$") && !found){
			pointer=pointer.replace(/./,(char=="^"?">":"<"));
		}
		
		//if matches symbol was found (return array of matches)
		if(pointer.charAt(0)=="@"){
			if(char=="^" && found) char=">";
			pointer=char+pointer;
			matches[matches.length]=obj;
		}
	}
	return obj;
};

//get tag Attribute
function _ATTR(obj,attr){
	obj=_(obj);
	if(!obj || !attr) return null;
	return obj.getAttribute && obj.getAttribute(attr)!=undefined ? obj.getAttribute(attr) : (obj[attr]!=undefined ? obj[attr] : null);
};


function addEvent(el, evname, func){
	if(!el["on"+evname] && el!=window && el!=document) return el["on"+evname]=func;
	if(el.attachEvent) el.attachEvent("on"+evname, func); // IE
	else if(el.addEventListener) el.addEventListener(evname, func, true); // Gecko / W3C
	else el["on"+evname]=func;
};

var EVENT=function(obj, ev){
	return{
		add:function(func){
			obj["on"+ev]=new Function(this.asString(obj["on"+ev])+this.asString(func));
		},
		asString:function(func){
			var func=func.toString().replace(/^[^{]+{(.*)/,"$1");
			func=func.substr(0, func.length-1)+";\n";
			return func;
		}
	}
};


var COOKIE={
	set:function(name, value, expire){
		if(expire){
			var d=new Date();
			d.setTime(d.getTime()+expire*1000);
			expire="; expires="+d.toUTCString();
		}
		else expire="";
		document.cookie=name+"="+escape(value)+expire+"; path=/";
	},
	get:function(name) {
		if(document.cookie.length==0) return false;
		var offset=document.cookie.indexOf(name+"=");
		if(offset!=-1) { 
			offset+=name.length+1;
			var end=document.cookie.indexOf(";", offset);
			if (end==-1) end=document.cookie.length;
			return unescape(document.cookie.substring(offset, end)) 
		}
		return false;
	}
};


// element className & style functions
var Style=function(obj){
	return {
		empty:function(){
			return obj.className.replace(/\s/g,"")==""?true:false;
		},
		all:function(name){
			return !this.empty()?obj.className.split(/\s+/):[];
		},
		exist:function(name){
			for(var i=0, c=this.all(name), l=c.length; i<l; i++)
				if(c[i]==name) 
					return true;
			return false;
		},
		set:function(name){
			obj.className=name;
		},
		add:function(name){
			this.remove(name);
			obj.className+=' '+name;
			return true;
		},
		remove:function(name){
			obj.className=obj.className.replace(new RegExp("((^)|(\\s))"+name+"((\\s)|($))"),"$3");
			return false;
		},
		invert:function(name){
			return this.exist(name) ? this.remove(name) : this.add(name);
		},
		clear:function(){
			obj.className='';
		}
	}
};

//Element styles functions
var CSS=function(obj){
	obj=_(obj);
	return {
		//convert js style property to css property (zIndex -> z-index)
		js2css:function(prop){
			return prop.replace(/([A-Z])/g,"-$1").toLowerCase();
		},
		//get style|styles value from css element (arguments=[string|hash|array])
		get:function(prop){
			if(typeof prop=="string"){
				if(obj.currentStyle) return obj.currentStyle[prop];
				if(window.getComputedStyle) return window.getComputedStyle(obj,null).getPropertyValue(this.js2css(prop));
			}
			else if(prop){
				var style={};
				for(var i in prop){
					if(prop.length) i=prop[i]; //get prop if array
					style[i]=this.get(i);
				}
				return style;
			}
			else return 0;
		},
		//set new styles to element & return old styles (arguments=[hash])
		set:function(hash){
			var style={};
			for(var i in hash){
				style[i]=this.get(i);
				obj.style[i]=hash[i];
			}
			return style;
		},
		//copy style|styles from obj to anoter element & return this styles (arguments=[string|array])
		copy:function(prop,to){
			if(typeof prop=="string")
				return (to.style[prop]=this.get(prop));
			else if(prop){
				var style=this.get(prop);
				for(var i in style)
					to.style[i]=style[i];
				return style;
			}
			return null;
		},
		//check current element style|styles (arguments=[hash])
		check:function(hash){
			for(var i in hash)
				if(hash[i]!=this.get(i))
					return false;
			return true;
		}
	}
};


//js include
function include(src){
	if(!document.files) document.files={};
	if(document.files[src]) return false;
	document.files[src]=1;
	src=(/^https?:\/\/.+/.test(src)?src:GLOBAL_PATH+src);
	if(src.indexOf(".css")==-1) document.write('<'+'script type="text/javascript" src="'+src+'"><'+'/script>');
	else document.write('<link type="text/css" rel="stylesheet" href="'+src+'" />');
};


//init png in IE6
function initPNG(root){
	//return false;
	if(!IE6) return false;
	var all=root.getElementsByTagName("*");
	var src;
	for(var i=0, l=all.length; i<l; i++){
		if(all[i].currentStyle && all[i].currentStyle["backgroundAttachment"]=="fixed"){
			var src=all[i].tagName.toLowerCase()=="img" ? all[i].src : all[i].currentStyle["backgroundImage"];
			if( !(/\.png/i).test(src)) continue;
			if(all[i].tagName.toLowerCase()=="img"){
				all[i].style.width=all[i].offsetWidth;
				all[i].style.height=all[i].offsetHeight;
				all[i].src=IMGS_PATH+"dot.gif"; 
			}
			else src=src.replace(/url\(\"(.*)\"\)$/i,"$1");
			
			var sizing=all[i].currentStyle["backgroundRepeat"]=="no-repeat"?"crop":"scale";
			all[i].style["filter"]='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+src+'",sizingMethod='+sizing+')';
			all[i].style["backgroundImage"]="none";
			all[i].style["backgroundPosition"]="-1000px -1000px";
		}
	}
};

//debug output for Array & Hash objects
Array.prototype.toString=
Object.prototype.toString=function(){
	var cont = [];
	var addslashes = function(s){
		return s.split('\\').join('\\\\').split('"').join('\\"');
	};
	for (var k in this){ 
		if (cont.length) cont[cont.length-1] += ",";
		var v = this[k];
		var vs = '';
		if (v.constructor == String) vs = '"' + addslashes(v) + '"';
		else vs = v.toString();
		cont[cont.length]=k + ": " + vs;
	}
	cont = "	" + cont.join("\n").split("\n").join("\n	");
	var s = cont;
	if (this.constructor == Object) s = "{\n"+cont+"\n}";
	if (this.constructor == Array) s = "[\n"+cont+"\n]";
	return s;
};var GLOBAL_PATH="site/";
var IMGS_PATH=GLOBAL_PATH+"imgs/";



//INCLUDES
//include("css/hack.css");
//include("css/box.css");
//include("js/box.js");
//include("js/ajax.js");
//include("js/fs.js");
//--------
if(location.host=="ukrinsoft.com") include("http://www.google-analytics.com/ga.js");
//--------

//document.load=document.onload;
document.onload=function(){
	if(document.isLoaded) return false;
	else document.isLoaded=1;
	if(location.host=="ukrinsoft.com") ga();
	init_content();
	new Box(_("root"));
	fs=FullScreen();
	animationLogo();
	initPNG(document);
	if(document.load) for(var i in document.load) document.load[i]();
	
};
//document.write('<'+'script type="text/javascript">document.onload();</script'+'>');



function animationLogo(){
	var els=[
		{x:26, y:0, c:"#ff5f00"},
		{x:52, y:13, c:"#0087c6"},
		{x:65, y:52, c:"#5ebe12"},
		{x:39, y:65, c:"#ff9000"},
		{x:0, y:13, c:"#ffcc00"},
		{x:0, y:26, c:"#ffcc00"},
		{x:0, y:39, c:"#ffcc00"},
		{x:0, y:52, c:"#ffcc00"},
		{x:0, y:65, c:"#ffcc00"},
		{x:13, y:26, c:"#ffcc00"},
		{x:13, y:39, c:"#ffcc00"},
		{x:13, y:52, c:"#ffcc00"},
		{x:26, y:39, c:"#ffcc00"}
	];
	var block=document.createElement("div");
	block.className="move";
	block.appendChild(document.createElement("div"));
	var cur;
	for(var i in els){
		cur=document.createElement("b");
		cur.style.top=Number(els[i].y+26)+"px";
		cur.style.left=Number(els[i].x+39)+"px";
		cur.style.background=els[i].c;
		cur.move=new Move(cur);
		cur.move.onEndDrag=function(){
			var cc={x:this.obj.offsetLeft%13, y:this.obj.offsetTop%13};
			this.obj.style.top=Number(this.obj.offsetTop+(cc.y<7?-cc.y:13-cc.y))+"px";
			this.obj.style.left=Number(this.obj.offsetLeft+(cc.x<7?-cc.x:13-cc.x))+"px";
		};
		cur.onmouseover=function(){var _this=this; _this.className="act"; setTimeout(function(){_this.className=""},100)};
		block.appendChild(cur);
	}
	_("root").insertBefore(block, _("root").firstChild);
};

function _act(obj){
	if(!obj || !obj.parentNode) return false;
	if(_ATTR(obj, "noact")!=undefined) return false;
	var par=(obj.parentNode.tagName=="LI" || obj.parentNode.tagName=="VAR" ? obj.parentNode.parentNode : obj.parentNode);
	if(!par.set) par.set=function(i){return _(par, '~@a')[i].onclick();}; //init funtion [set]
	if(!par.act) par.act=function(i){return _act(_(par, '~@a')[i]);}; //init funtion [set]
	if(!par.unset) par.unset=function(){Style(par.cur).remove("act"); par.cur=null; return false;}; //init funtion [set]
	if(par.cur==obj) return false;
	if(!par.cur) par.cur=_(par, "a.act"); // if no [cur] try to find it
	if(par.cur) Style(par.cur).remove("act");
	Style(obj).add("act");
	par.cur=obj;
	(_ATTR(obj, "onact") || function(){})(); //call [onact] event
	return false;
};


function team(obj, n){
	_act(obj);
	obj.blur();
	_("person").innerHTML=_("uid_"+obj.hash.substr(1)).innerHTML;
	if(pageTracker) pageTracker._trackPageview(obj.href.replace(/[^#]*#(.*)/,"/team/$1/"));
};



function init_prev(root_id){
	var a=_(root_id).getElementsByTagName("a");
	for(var i=0, l=a.length; i<l; i++)
		if(a[i].href){ 
			//hover(a[i]); //preload img
			//a[i].onmouseover=function(){hover(this, 1)}
			//a[i].onmouseout=function(){hover(this, 0)}
			a[i].onfocus=function(){this.blur()};
			a[i].onclick=function(){return fs.show(this)};
		}
};


function slides(obj){
	function set(obj, num){
		num=num?num:(obj.cur==1?2:1);
		obj.cur=num;
		obj.src=obj.src.replace(/(.+_)[0-9]+(\.jpg)$/,"$1"+num+"$2");
	}
	obj.onmouseover=function(){obj.tm=setTimeout(function(){set(obj); obj.onmouseover()}, obj.cur==2?1500:500)};
	obj.onmouseout=function(){clearTimeout(obj.tm); set(obj, 1)};
	obj.cur=1;
	obj.onmouseover();
};


function init_content(){
	var tag=document.getElementsByTagName("a");
	for(var i=0, l=tag.length; i<l; i++){
		if(tag[i].lang){ //set antiapam mails
			var mail=tag[i].lang+"@"+tag[i].href.replace(/[^:]+:\/\/(.*)\/$/,"$1");
			tag[i].href="mailto:"+mail;
			if(!tag[i].innerHTML || tag[i].rel=="this") tag[i].innerHTML=mail;
			tag[i].lang="";
		}
		if(tag[i].rel=="nofollow"){ //set correct external links
			tag[i].target="_blank";
		}
	}
	
	var tag=document.getElementsByTagName("del");
	for(var i=0, l=tag.length; i<l; i++){
		if(tag[i].title){ //noindex del tags
			tag[i].innerHTML=tag[i].title;
			tag[i].title="";
			if(ie) tag[i].outerHTML+=" ";
		}
	}
};


/*Google Analytics*/
var pageTracker;
function ga(){
	pageTracker = _gat._getTracker("UA-1604326-3");
	pageTracker._initData();
	pageTracker._trackPageview();
};

function showhide(obj,args){
	obj=_(obj);
	var show=(args!=undefined && typeof args=="object")?args.show:args;
	if(show!=undefined) obj.style.display=(show?"block":"none");
	else obj.style.display=(CSS(obj).check({display:'block'})?"none":"block");
	show=CSS(obj).check({display:'block'});
	if(args!=undefined && typeof args=="object" && args.sender) Checkbox(args.sender, show);
	return false;
};

function Box(obj){
	var el;
	var firstChild=obj.firstChild;
	/*base*/
	(obj.insertBefore(document.createElement("div"),firstChild)).className="tl";
	(obj.insertBefore(document.createElement("div"),firstChild)).className="bl";
	(obj.insertBefore(document.createElement("div"),firstChild)).className="tr";
	(obj.insertBefore(document.createElement("div"),firstChild)).className="br";
	(el=obj.insertBefore(document.createElement("div"),firstChild)).className="tf";
	(el.appendChild(document.createElement("div")));
	(el=obj.insertBefore(document.createElement("div"),firstChild)).className="bf";
	(el.appendChild(document.createElement("div")));
	(el=obj.insertBefore(document.createElement("div"),firstChild)).className="lf";
	(el.appendChild(document.createElement("div")));
	(el=obj.insertBefore(document.createElement("div"),firstChild)).className="rf";
	(el.appendChild(document.createElement("div")));
	
	/*other*/
	

	return obj;
};
(AJAX=function(opt){this.init(opt)}).prototype={
	
	CACHE:{},
		
	init:function(opt){
		opt=opt || {};
		this.method=opt.method || "http";
		this.file=opt.file || "";
		this.query=opt.query || "";
		this.caching=opt.caching || false;
		this.hash=opt.hash || {};
		this.onready=opt.onready || function(){};
		if(opt.onready) this.send();
	},
		
	send:function(){
		//add hash to query
		this.query+=this.json2query(this.hash);
		//if cache==true > call data from cache & return
		try{if(this.caching && this.CACHE[this.query]) return this.ondata(this.CACHE[this.query]);}catch(e){};
		
		var _this=this;
		var request, response;
		var SID=(new Date()).getTime()+Math.round(Math.random()*1000);
		
		switch(this.method){
			case "http":
				request=window.XMLHttpRequest?new XMLHttpRequest():(new ActiveXObject("Msxml2.XMLHTTP") || null); // ||"Microsoft.XMLHTTP" - ie5x
				if(request){
					request.open('POST', this.file, true);
					request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); // $_POST[] || $_REQUEST[]
					request.onreadystatechange=function(){  
						if(request.readyState==4){
							if(request.getResponseHeader('Content-Type').indexOf("/xml")!=-1) response=_this.xml2json(request); //xml
							else response=(new Function('return '+request.responseText))(); //json
							_this.ondata(response);
						}
					};
					request.send(this.query); //request send 
					break;
				}
				
			case "script":
				request=document.createElement("script");
				if(request){
					request.id=SID;
					var src=this.file+"?"+"_scriptID_="+request.id+"&"+this.query;
					if(ie) request.src=src.substr(0,2048); //MAX msie:2kb
					else{request.src=src; request.src=request.src.substr(0,4096)}; //MAX gesko:4Kb
					request.onreadystatechange=function(response){
						if(response && !response.initEvent){
							_this.ondata(response);
							setTimeout(function(){request.parentNode.removeChild(request)},13);
						}
					};
					document.body.appendChild(request); //request send 
					break;
				}
				
			case "form":
				var request=document.createElement(ie?"<iframe name="+SID+">":"iframe");
				if(request){
					request.name=SID;
					request.style.position="absolute";
					request.style.visibility="hidden";
					this.form.appendChild(request);
					//this.form.encoding="multipart/form-data";
					this.form.method="post";
					this.form.target=request.name;
					this.form.action=this.file+this.form.action.replace(/.*(\?.*)$/,"$1");
					request.onreadystatechange=request.onload=function(response){
						if(!request.readyState || request.readyState=="complete"){
							_this.ondata((new Function('return '+request.contentWindow.document.body.innerHTML))());
							setTimeout(function(){request.parentNode.removeChild(request)},13);
						}
					};
					this.form.submit(); //request send 
					break;
				}
				
			default: return request;
		}
	},
	
	ondata:function(response){
		if(this.caching || this.CACHE[this.query]) this.CACHE[this.query]=response; //cache response data
		this.response=response;
		this.onready(response);
	},
	
	json2query:function(hash, pref){
		var query="";
		for(var i in hash){
			var key=(pref?pref+"["+i+"]":i);
			query+=(typeof hash[i]=="object" ? this.json2query(hash[i],key) : "&"+key+"="+hash[i].toString().replace(/&/g, "%26"));
		}
		return query;
	},
	
	xml2json:function(request){
		var parseXML=function(node){
			if(node.childNodes.length==1 && node.firstChild.nodeType==3) return node.firstChild.data; //if text node
			var hash={};
			for(var i=0, childs=node.childNodes, l=childs.length; i<l; i++)
				if(childs[i].nodeType==1) 
					hash[childs[i].tagName]=parseXML(childs[i]);
			return hash;
		};
		var doc=ie?request.responseXML:(new DOMParser()).parseFromString(request.responseText, "text/xml"); //get XML content
		var response={obj:{}, text:''};
		if(doc && doc.documentElement) response.obj=parseXML(doc);
		return response;
	},
	
	onerror:function(message){alert("Server output error...\n"+message)}
};var fs; //fullscreen object
var AUTOSIZE=1;  //autosize image to screen


function FullScreen(){
	var fs;
	this.init=function(){
		var _this=this;
		(fs=document.createElement("div")).className="fs";
		(fs.appendChild(document.createElement("blockquote"))).onclick=function(){_this.hide()};
		fs.appendChild(fs.block=document.createElement("div"));
		(fs.block.appendChild(document.createElement("a"))).onclick=function(){_this.hide()};
		fs.block.appendChild(fs.pager=document.createElement("var"));
		fs.block.appendChild(fs.desc=document.createElement("b"));
		fs.block.appendChild(fs.content=document.createElement("span"));
		
		document.body.appendChild(fs);
		fs.scrollSize=this.scrollSize();
		if(IE6){
			addEvent(window, "scroll", function(){this.IE6_centered()});
			addEvent(window, "resize", function(){this.IE6_centered()});
			this.IE6_centered();
		}
		return this;
	};
	this.IE6_centered=function(){
	
		if(!this.isOpen) return false;
		//fs.style.height=document.documentElement.scrollHeight+"px";
		fs.style.width=document.documentElement.scrollWidth+"px";
		fs.style.marginTop=-document.body.offsetTop+"px";
		fs.style.marginLeft=-document.body.offsetLeft+"px";
		fs.block.style.top=Math.round(document.documentElement.scrollTop+((document.documentElement.offsetHeight)/2))+"px";
		fs.block.style.left=Math.round(document.documentElement.scrollLeft+((document.documentElement.offsetWidth)/2))+"px";
	};
	
	this.scrollSize=function(){ //calc srroll size
		var div=document.createElement("div");
		div.style.width="50px";
		div.style.height="50px";
		div.style.overflow="auto";
		div.style.visibility="hidden";
		div.style.position="absolute";
		(div.appendChild(document.createElement("div"))).style.height="100px";
		document.body.appendChild(div);
		var size=div.offsetWidth-div.clientWidth;
		document.body.removeChild(div);
		return size;
	};
	
	this.show=function(obj,update){
		var _this=this;
		this.isOpen=1;
		if(!update) this.write('',{width:200, height:200});
		fs.style.height=document.documentElement.scrollHeight+"px";
		fs.style.display="block";
		new AJAX({
			method:"http", 
			file:document.getElementsByTagName("base")[0].href+"site/index.php", 
			query:"sizeof="+obj.href+(obj.getElementsByTagName("img")[0]?"&desc="+obj.getElementsByTagName("img")[0].alt:""),
			onready:function(response){_this.write(obj.href,response,update)},
			send:1
		});
		return false;
	};
	this.hide=function(){
		this.isOpen=0;
		if(window.opera){ document.documentElement.scrollTop+=1; document.documentElement.scrollTop-=1;}
		fs.style.display="none";
		fs.content.innerHTML=fs.pager.innerHTML=fs.desc.innerHTML='';
	};
	this.write=function(url, ifile, update){
		if(!ifile.width || !ifile.height) return false;
		var _this=this;
		if(IE6) this.IE6_centered();
		fs.content.style.overflow="visible";
		var w=ifile.width+20;
		var h=ifile.height+20;
		var di=ifile.width/ifile.height;
		var de=document.documentElement;
		if(h>de.clientHeight){
			h=de.clientHeight-fs.scrollSize;
			if(AUTOSIZE){ifile.height=h-20; ifile.width=Math.round(ifile.height*di); w=ifile.width+20;} //resize image
			else{fs.content.style.overflow="auto"; w+=fs.scrollSize;} //for scroller size
		}/*
		if(w>de.offsetHeight){
			w=de.offsetHeight-fs.scrollSize;
			if(AUTOSIZE){ifile.width=w-20; ifile.height=Math.round(ifile.width/di); h=ifile.height+20;} //resize image
			else{fs.content.style.overflow="auto"; h+=fs.scrollSize;} //for scroller size
		}*/
		fs.block.style.marginLeft=-Math.round((w+20)/2+(IE6?-50:0))+"px";
		fs.block.style.marginTop=-Math.round((h+20)/2+(IE6?-50:0))+"px";
		fs.content.style.width=Number(w-20)+"px";
		fs.content.style.height=Number(h-20)+"px";
		if(url){
			if(pageTracker) pageTracker._trackPageview(ifile.path);
			if(/.+.jpg$/.test(url)) fs.content.innerHTML='<img src="'+url+'" width="'+ifile.width+'" height="'+ifile.height+'" />';
			if(/.+.swf$/.test(url)) fs.content.innerHTML='<object type="application/x-shockwave-flash" data="'+url+'" width="'+ifile.width+'" height="'+ifile.height+'"><param name="movie" value="'+url+'" /><param name="quality" value="high" /></object>';
			if(!update){
				fs.desc.innerHTML=ifile.desc;
				if(ifile.count>1) //if srceens are more than 1
					for(var i=1; i<=ifile.count; i++){
						var a=document.createElement("a");
						a.innerHTML=i;
						a.href=url.replace(/_[0-9]./,"_"+i+".");
						a.content=fs.content;
						a.onfocus=function(){this.blur()};
						a.onclick=function(){_act(this); this.content.innerHTML=''; return _this.show(this,1)};
						fs.pager.appendChild(a);
						if(i==1) _act(a);
					}
			}
		}
	};
	return this.init();
};//© <stipuha /> development (2007)
//> Move html objects control
//--------------------------------
//> INITIALIZE
//  obj.move=new Move(obj, options);
//	options={verDrag, horDrag, bounds, target, dragEnabled}

function Move(obj,opt){
	var _this=this;
	//options
	var opt=opt?opt:{};
	var verDrag=opt.verDrag!=undefined ? opt.verDrag : true;
	var horDrag=opt.horDrag!=undefined ? opt.horDrag : true;
	var target=opt.target!=undefined ? opt.target : obj;
	this.bounds=opt.bounds!=undefined ? opt.bounds : {t:0, b:document.body.offsetHeight-obj.offsetHeight, l:0, r:document.body.offsetWidth-obj.offsetWidth};
	this.dragEnabled=opt.dragEnabled!=undefined ? opt.dragEnabled : true;
	this.obj=obj;
	var draging=false;
	var tm;
	var defCursor=obj.style.cursor;
	
	target._=this;
	target.onmousedown=function(e){this._.StartDrag(e)};
	
	this.StartDrag=function(e){
		this.onStartDrag();
		if(this.dragEnabled){
			preventEvent(e);
			obj.style.cursor=verDrag && horDrag ? "move" : (verDrag ? "n-resize" : (horDrag ? "e-resize" : "pointer") );
			this.offset={x:Coord(e).x-obj.offsetLeft, y:Coord(e).y-obj.offsetTop};
			obj.style["margin"]="0px";
			draging=true;
			document.dragObj=this;
			document.onmousemove=function(e){ this.dragObj.Drag(e)};
			document.onmouseup=function(e){ this.dragObj.EndDrag(e)};
		}
	};
	
	this.Drag=function(e){
		if(draging){
			preventEvent(e);
			this.pos={x:Coord(e).x-this.offset.x, y:Coord(e).y-this.offset.y}; //position in page
			if(horDrag) obj.style["left"]=this.checkBound(this.pos,"x")+"px";
			if(verDrag) obj.style["top"]=this.checkBound(this.pos,"y")+"px";
			this.shift={ // object shift in float persent
				x:(obj.offsetLeft-this.bounds.l)/(this.bounds.r-this.bounds.l)*100, 
				y:(obj.offsetTop-this.bounds.t)/(this.bounds.b-this.bounds.t)*100
			};
			this.onDrag();
			clearTimeout(tm);
			tm=setTimeout(function(){_this.onPauseDrag()},500);
			
		}
	};

	this.EndDrag=function(e){
		if(draging){
			draging=false;
			obj.style.cursor=defCursor;
			document.onmousemove=null;
			document.onmouseup=null;
			this.onEndDrag();
			clearTimeout(tm);
		}
	};
	
	this.checkBound=function(c,d){
		var _bound={begin:d=="x"?this.bounds.l:this.bounds.t, end:d=="x"?this.bounds.r:this.bounds.b}; 
		return _bound.begin>c[d] ? _bound.begin : (_bound.end<c[d] ? _bound.end : c[d]);
	};
	
	this.onStartDrag=function(){};
	this.onPauseDrag=function(){};
	this.onDrag=function(){};
	this.onEndDrag=function(){};
	
	return this;
};


function preventEvent(e){
	if(window.event){
	window.event.cancelBubble = true;
	window.event.returnValue = false;
	}
	else if (e.preventDefault) e.preventDefault();
};

function Coord(e){
	if(window.event){
		this.x=window.event.clientX;
		this.y=window.event.clientY;
	}
	else{
		this.x=e.pageX;
		this.y=e.pageY;
	}
	return this;
};
